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> "; ?> Quote 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. Quote 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 Quote 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'] Quote 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? Quote 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. Quote 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? Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.