Form Help

Joined
Jan 30, 2007
Messages
3
Reaction score
0
Code:
<? 
$song = "$_GET[song]";
print "Your Requesting: $song";
?>

<form action="mail2.php?song=[B]$song[/B]" method="POST">
<b>Email</b><br>
<input type="text" name="email" size=40>
<p><input type="submit" value=" Send ">
</form>

How would I be able to correctly use the bolded part? As in actually using the string instead of literally using $song
 
Sorry, but it's a mess.

I will only fix the code for you, but not explain why it's wrong. OK ?

On 2nd line: $song = "$_GET[song]";
The correct is: $song = "$_GET['song']";

On 6th line: <form action="mail2.php?song=$song" method="POST">
The correct is: <form action="mail2.php" method="GET">
 
I need to get $song from that to mail2.php, weather it be $_GET, $_POST, or whatever. The reason I had action="mail2.php?song=$song" was because thats the only way I knew how, but it doesnt work, it literally uses the text "$song" instead of the actual string.
 
Back