hailmunan Posted September 18, 2008 Share Posted September 18, 2008 hello all, i`m trying to make users input the url into a text field.. and then.. when users hit the button, it will bring the users to another page.. i`m having problems with the strings .. can anyone help? urgent.. <? //print "$i. <a href='".$row['url']."'>".$row['url']."</a><br>\n"; $url = addslashes( $_POST['urlField'] ); print " <form name='form1' method='post' action='http://localhost/fyp/populate.php?url=http://".$url."'> <label> <input type='text' name='urlField' id='urlField' value='http://'> <input type='submit' name='submitBtn' id='submitBtn' value='Submit'> </label> </form> "; ?> Link to comment https://forums.phpfreaks.com/topic/124858-strings-in-php-form-wont-work-urgent-help/ Share on other sites More sharing options...
Maq Posted September 18, 2008 Share Posted September 18, 2008 What kind of problems? Errors? Post the code to the other page as well. Link to comment https://forums.phpfreaks.com/topic/124858-strings-in-php-form-wont-work-urgent-help/#findComment-645059 Share on other sites More sharing options...
hailmunan Posted September 18, 2008 Author Share Posted September 18, 2008 the string doesnt work.. after i click the submit button, the url bar displays this --> http://localhost/fyp/populate.php?url=http:// so the ".$url." doesnt work.. it supposed to go to the url where users keyed in.. e.g : http://localhost/fyp/populate.php?url=http://facebook.com if the users keyed in facebook.com Link to comment https://forums.phpfreaks.com/topic/124858-strings-in-php-form-wont-work-urgent-help/#findComment-645068 Share on other sites More sharing options...
Mchl Posted September 18, 2008 Share Posted September 18, 2008 Check if there's anything in $_POST['urlField'] Link to comment https://forums.phpfreaks.com/topic/124858-strings-in-php-form-wont-work-urgent-help/#findComment-645069 Share on other sites More sharing options...
hailmunan Posted September 18, 2008 Author Share Posted September 18, 2008 it supposed to be what user keyed in perhaps i messed up with the form structure? Link to comment https://forums.phpfreaks.com/topic/124858-strings-in-php-form-wont-work-urgent-help/#findComment-645082 Share on other sites More sharing options...
Mchl Posted September 18, 2008 Share Posted September 18, 2008 do echo $_POST['urlField'] and see if anything comes up. If not, you're likely misspeled a field name. Link to comment https://forums.phpfreaks.com/topic/124858-strings-in-php-form-wont-work-urgent-help/#findComment-645084 Share on other sites More sharing options...
Maq Posted September 19, 2008 Share Posted September 19, 2008 Is the form getting submitted to itself? Link to comment https://forums.phpfreaks.com/topic/124858-strings-in-php-form-wont-work-urgent-help/#findComment-645336 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.