Voodoo Jai Posted January 19, 2008 Share Posted January 19, 2008 I have a rating poll that I want to use with my db and dynamic pages but cannot pass the data to and from it. What I want to happen is pple rate the page then it refreshes itself with the rating. Instead of refreshing itself it goes to another static page. I think the prolem lies in passing the url variables back to itself and that is why it is not working. I have tried adding the ? mark and then the word "takeaway" and a variable identifier unique to the page. Could some one help. Many thanks in advance. here is part of the code that I think is not right echo '<form method="post" action="'.$_SERVER["PHP_SELF"].'">'; // ***** this is what I think it should look like ****************** //echo '<form method="post" action="'.$_SERVER["PHP_SELF"]."?TakeawyID".$takeaway_id'">'; Quote Link to comment https://forums.phpfreaks.com/topic/86789-solved-problem-with-form-code/ Share on other sites More sharing options...
resago Posted January 19, 2008 Share Posted January 19, 2008 you can leave off the action part if you want it to post to itself. so thats not it. you need a form element called TakeawyID. Quote Link to comment https://forums.phpfreaks.com/topic/86789-solved-problem-with-form-code/#findComment-443603 Share on other sites More sharing options...
Voodoo Jai Posted January 19, 2008 Author Share Posted January 19, 2008 you can leave off the action part if you want it to post to itself. so thats not it. you need a form element called TakeawyID. Could you please clarify for me. Quote Link to comment https://forums.phpfreaks.com/topic/86789-solved-problem-with-form-code/#findComment-443605 Share on other sites More sharing options...
revraz Posted January 19, 2008 Share Posted January 19, 2008 You can try: echo "<form method='post' action=?takeawayid=1>'; Quote Link to comment https://forums.phpfreaks.com/topic/86789-solved-problem-with-form-code/#findComment-443606 Share on other sites More sharing options...
resago Posted January 19, 2008 Share Posted January 19, 2008 echo "<form method='post'>"; echo "<input type=hidden name=TakeawyID value=$takeaway_id>"; echo "</form>"; Quote Link to comment https://forums.phpfreaks.com/topic/86789-solved-problem-with-form-code/#findComment-443612 Share on other sites More sharing options...
Voodoo Jai Posted January 19, 2008 Author Share Posted January 19, 2008 Got it thanks a lot guys N girls if approp Jai Quote Link to comment https://forums.phpfreaks.com/topic/86789-solved-problem-with-form-code/#findComment-443628 Share on other sites More sharing options...
revraz Posted January 19, 2008 Share Posted January 19, 2008 Mark as solved please Quote Link to comment https://forums.phpfreaks.com/topic/86789-solved-problem-with-form-code/#findComment-443630 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.