Jump to content

[SOLVED] Need help with $_GET / Form


Will-28

Recommended Posts

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

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']

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.