Ok, i want to insert the $_session[‘BusinessName’], date and time into the database, and for some reasong it is not taking in those values
any idea why it is not doing that
here is my code
[code=php]
<?PHP
$BusinessName = addslashes($_POST[‘BusinessName’]);
$date= addslashes($_POST[‘date’]);
$from = addslashes($_POST[‘from’]);
$status= addslashes($_POST[‘status’]);
$subject= addslashes($_POST[‘subject’]);
$message= addslashes($_POST[‘message’]);
if(isset($_SESSION[‘BusinessName’])){
$query = “INSERT INTO `messages` (`BusinessName`,`date`,`from`,`status`,`subject`,`message`)
VALUES (‘”.$_SESSION[‘BusinessName’].”‘,'”.$date.”‘,'”.$from.”‘, ‘”.$status.”‘,'”.$subject.”‘,
‘”.$message.”‘)”;
$result = mysql_query($query);
echo mysql_error();
if($result)
{
echo mysql_affected_rows().” .Your Message have been sent. We will get back to you. <br>”;
}
}
?>
<center>
<?
$_SESSION[‘BusinessName’];
?>
<? echo'<form action=”‘. $_SERVER[‘PHP_SELF’].'” method=”post” >’; ?>
<table width=”390″ border=”1″ bordercolor=”#FFFFFF”>
<tr>
<td width=”92″ bgcolor=”#CCCCCC”><strong>From</strong></td>
<td width=”282″><? echo'<input name=”from” type=”text” size=”60″>’; ?></td>
</tr>
<tr>
<td bgcolor=”#CCCCCC”><strong>Subject </strong></td>
<td><? echo'<input name=”textfield2″ type=”subject” size=”60″>’; ?></td>
</tr>
<tr>
<td bgcolor=”#CCCCCC”><strong>Body</strong></td>
<td><p>
<? echo'<textarea name=”message” cols=”75″ rows=”10″></textarea>’; ?>
</p>
<p> </p></td>
</tr>
<tr>
<td> </td>
<td bgcolor=”#EFEFEF”><div align=”right”>
<table width=”200″ border=”0″ bgcolor=”#EFEFEF”>
<tr>
<td><? echo'<input type=”submit” name=”Submit2″>’; ?></td>
<td><? echo'<input type=”submit” name=”Submit” >’; ?></td>
</tr>
</table>
[code=php]