Will-28 Posted December 6, 2007 Share Posted December 6, 2007 Been trying many ways for when someone fills in the form, it will add the data on 2nd page where $x1 is. Can someone pls point me to the right direction? 1st page: <form method="POST" action="../wmp.php?" style="display:inline;" target="I1"> <p><font face="Arial" size="1" color="#CCCCCC">Windows Media Player</font><br> <input type="text" name="$x1" size="12" value="http://" style="border:1px solid #CCFF33; font-family: Arial; font-size: 8pt; background-color:#CCCCCC"><input type="submit" value=">" name="$x1" style="border:1px solid #CCFF33; font-family: Arial; font-size: 8pt; color:#CCFF33; background-color:#000000"></p> </form> 2nd page <?php $x1=$_GET['url']; echo "<PARAM NAME=\"URL\" VALUE=\"$x1\">"; ?> Link to comment https://forums.phpfreaks.com/topic/80373-solved-need-help-with-_get-form/ Share on other sites More sharing options...
rarebit Posted December 6, 2007 Share Posted December 6, 2007 When using form's use $_POST, or $_REQUEST will get either. $_GET is for urls, e.g. www.a.com/index.html?name=value&crash=burn Link to comment https://forums.phpfreaks.com/topic/80373-solved-need-help-with-_get-form/#findComment-407404 Share on other sites More sharing options...
kenrbnsn Posted December 6, 2007 Share Posted December 6, 2007 The name in the <input> needs to be "url", not "$x1". Ken Link to comment https://forums.phpfreaks.com/topic/80373-solved-need-help-with-_get-form/#findComment-407405 Share on other sites More sharing options...
phpSensei Posted December 6, 2007 Share Posted December 6, 2007 Well first of all action="../wmp.php?" << Is missing a http var like "?url=http://site.com" or something. then you can use $_GET['url'], and print it out which will give you "http://ww.site.com". Now if you want to get data posted from a form, name the textfield or whatver you have then use $_POST['textfield'] to get the data from one page or another, and the same goes for $_GET. change <input type="text" name="$x1" to <input type="text" name="url" and change $_GET['url'] to $_POST['url'] Link to comment https://forums.phpfreaks.com/topic/80373-solved-need-help-with-_get-form/#findComment-407409 Share on other sites More sharing options...
Will-28 Posted December 6, 2007 Author Share Posted December 6, 2007 Thanks all, got it to work Link to comment https://forums.phpfreaks.com/topic/80373-solved-need-help-with-_get-form/#findComment-407421 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.