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\">"; ?> Quote Link to comment 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 Quote Link to comment 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 Quote Link to comment 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'] Quote Link to comment 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 Quote Link to comment 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.