robbins Posted January 1, 2007 Share Posted January 1, 2007 i have a form i want to work, but its on like index.php?page=54 and whenever i submit it, using no action, or using the above listed page as the action, it overrides the ?page=54 and puts its own get data there like ?u7=20... i've tried post but it does the same thing... heres my php code checking it... if ($_POST['u7'] != "130") { stuff here ... its not the php problem, since it doesn't have a chance to do anything with the form overriding. heres the form i'm using... <form method='get' action='index.php?page=54'> <select name='u7'> <option value='50'>50</option> <option value='20'>20</option> <option value='0' selected='true'>0</option> <option value='-20'>-20</option> <option value='-50'>-50</option> </select> <input value='Submit Points' type='submit'></form>sooo... how do i post so that php can check the submited data, yet allow it to post to index.php?page=54 ????? Thanks! Link to comment https://forums.phpfreaks.com/topic/32490-solved-php-and-forms-can-a-form-postget-to-a-page-thats-already-got-someidhere/ Share on other sites More sharing options...
corbin Posted January 1, 2007 Share Posted January 1, 2007 add<option type="hidden" name="page" value="54">to the form stuff. Link to comment https://forums.phpfreaks.com/topic/32490-solved-php-and-forms-can-a-form-postget-to-a-page-thats-already-got-someidhere/#findComment-150963 Share on other sites More sharing options...
robbins Posted January 1, 2007 Author Share Posted January 1, 2007 hmm... that isn't showing up. like i added it but it doesn't have any affect... Link to comment https://forums.phpfreaks.com/topic/32490-solved-php-and-forms-can-a-form-postget-to-a-page-thats-already-got-someidhere/#findComment-150966 Share on other sites More sharing options...
JasonLewis Posted January 1, 2007 Share Posted January 1, 2007 or you could change the action to [code=php:0]$_SERVER['REQUEST_URI'][/code] allthough it may not work. and corbin, should this;[code=php:0]<option type="hidden" name="page" value="54">[/code]be this:[code=php:0]<input type="hidden" name="page" value="54">[/code] Link to comment https://forums.phpfreaks.com/topic/32490-solved-php-and-forms-can-a-form-postget-to-a-page-thats-already-got-someidhere/#findComment-150968 Share on other sites More sharing options...
robbins Posted January 1, 2007 Author Share Posted January 1, 2007 [quote author=ProjectFear link=topic=120604.msg494819#msg494819 date=1167688322]and corbin, should this;[code=php:0]<option type="hidden" name="page" value="54">[/code]be this:[code=php:0]<input type="hidden" name="page" value="54">[/code][/quote]you win! thanks much! lol Link to comment https://forums.phpfreaks.com/topic/32490-solved-php-and-forms-can-a-form-postget-to-a-page-thats-already-got-someidhere/#findComment-150976 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.