Jump to content

please someone help


DarkHavn

Recommended Posts

What the hell is oing on, this is my following code


[code]

if($_POST['clientsubmit']){
connect(); //Connects to the database


$name = strip_tags($_POST['name']);
$lname = strip_tags($_POST['lname']);
$email = strip_tags($_POST['email']);
$hphone = strip_tags($_POST['phone']);
$cphone = strip_tags($_POST['cphone']);
$password = md5($_POST['pass']);

//$insertquery = 'INSERT INTO agent (name, a_lname, email, phone, cell, pass) VALUES(' . "$name" . ',' . "$lname" . ',' . "$email" . ',' . "$hphone" . ',' . "$cphone" . ',' .  "$password" . ');';
$insertquery = "INSERT INTO agent (name, lname, email, phone, cell, pass) VALUES ($name, $lname, $email, $hphone, $cphone, '$pass');";
if(mysql_query("$insertquery")) {
$_SESSION['success'] = "Thank you, your Agent has been Signed up";
header("Location: ../thanks/thanks.php");
} else {

$error = mysql_error();
echo "$error";
$ip = $_SERVER['REMOTE_ADDR'];
$errormsg = "INSERT INTO information (error, ip) VALUES ($error, $ip);";
mysql_query("$errormsg");
}


}
[/code]

What the following does is just take simple input from a form and insert in into the mysql database, everything matches, the table names etc are correct, but everytime i go to submit it i get this error


"Unknown name in feildlist"  (The name being the section for the agents first name), but then it keeps jumping around, last night when i gave up and when to bed it was complaining that the md5() password wasn't in the feildlist???????


Please help me guys/girls? :(
Link to comment
https://forums.phpfreaks.com/topic/18252-please-someone-help/
Share on other sites

check that the query will run independantly.....

comment out the if statement that subits teh query and echo out the string you have generated to the screen, copy and paste it into phpmyadmin adn run the query - se what errors are returned and come back if you need more help.
Link to comment
https://forums.phpfreaks.com/topic/18252-please-someone-help/#findComment-78359
Share on other sites

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.