Hi there:
I have been trying to escape a single quote. I have read up so much on this and have gone to many websites. I was getting a syntax error when posting in "address1" and now I don't, but nothing is sent to the database. Here is the output: (and yes, it is connecting to MySQL before script) Do I need to have escape_data at $_POST .... ? Please if someone knows what the heck I'm doing wrong, I would love to know. Thanks in advance
$sql = "INSERT INTO $table_name
(id, name, address1) VALUES
('', '$POST[name]', '$POST[address1]')";
$result = @($sql,$connection) or die(mysql_error());
?>
<html>
<head>
<title>Address Added</title>
</head>
<body>
<h1>added</h1>
<h2>added</h2>
<p>added successfully</p>
<h2><em><? echo "$POST[name]"; ?>
<? echo "'" .escape_data($POST[$address1]). "'"; ?></em></h2>
Here's input fields that coincide with the above variables name and address1:
<p><strong>First Name:</strong><br>
<input type="text" name="name" size=35 maxlength=50>
<p><strong>Address:</strong><br>
<input type="text" name="address1'. '" size=35 maxlength=75></p>