Page 1 of 1

Help please :)

Posted: Mon Feb 16, 2004 5:50 am
by mikegotnaild
I made a form and a script to put that data from the form into mysql. Well all form data is recorded to the data base correctly except for one column where they fill in their email address. Instead of recording the email address that i type in the form. It records it as '#Email' instead. What could be causing this? Heres my code:

This is the email form code

Email:<br>
<input type="text" name="email"size=20><br>

Now my action code:

Code: Select all

<?
//MySQL Variables. 
$host = "hostname";
$login_name = "username";
$password = "password";

//Connecting to MYSQL
MySQL_connect("$host","$login_name","$password");

//Select the database
MySQL_select_db("bandsandmembers") or die("Could not select database");

//Assign contents of form to variables
$bandname = $_POST&#1111;'band_name'];
$description = $_POST&#1111;'description'];
$history = $_POST&#1111;'history'];
$influences = $_POST&#1111;'influences'];
$genra = $_POST&#1111;'genra'];
$email = $_POST&#1111;'email'];
$website = $_POST&#1111;'website'];

$sql = "INSERT INTO nuke_bands (band_name, description, history, influences, genra, email, website) VALUES ('$bandname','$description','$history','$influences','$genra','#email','$website')";

$result = mysql_query($sql);

//Code to check if statement executed properly and display message
if ($result) &#123;
header("Location: http://naild.com/localmm/modules.php?name=Band_List&file=sent");
&#125; else &#123;
echo("An error has occured");
&#125;
//Close connection with MySQL
MySQL_close()
?>
[/quote]

Posted: Mon Feb 16, 2004 7:19 am
by nutstretch
You've used #email instead of $email

('$bandname','$description','$history','$influences','$genra','#email','$website')";

Posted: Mon Feb 16, 2004 7:53 am
by mikegotnaild
umm.. I DIDNT EVEN SEE THAT!! IM BLIND!

Posted: Mon Feb 16, 2004 7:54 am
by mikegotnaild
i got some kind of weird A.D.D. or somethin! :(

Posted: Mon Feb 16, 2004 4:52 pm
by tim
lol every programmer has to make them sort if mistakes here n there to make them better.