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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.