adeang_1
03-23-2008, 08:46 AM
My form will not insert the content into my database
<?php
/**
* @author
* @copyright 2008
*/
$their_gulf = $_GET["id"];
if (isset($_POST['Submit']))
{
$nickname = $_SESSION['nickname'];
$message = (trim(strip_tags(($_POST['message']))));
$con = mysql_connect("localhost","adeang","123");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("adeang", $con);
mysql_query("INSERT INTO wall (message, sent_from, sent_to)
VALUES ('$message', '$nickname', '$their_gulf')");
mysql_close($con);
}
?>
<form name="Message_submit" method="post" action="sent_message.php" id="Form1">
<div id="wb_Text3" style="position:width:49px;height:14px;z-index:9" align="left">
<font style="font-size:11px" color="#000000" face="Arial">Message</font></div>
<textarea name="message" id="TextArea1" style="position:width:200px;height:226px;z-index:10" rows="11" cols="17" tabindex="1">TYPE YOUR MESSAGE HERE!!!!</textarea>
<input type="submit" id="Button1" name="Button1" value="Submit" style="position:width:96px;height:25px;z-index:11" tabindex="2">
</form>
okay so here are some of the values are found:
when someone clicks someones nickname they are set to their wall and then the id is in the link aka http://localhost/their_profile.php?id=adeang
and the session is set and uses a nickname IE adeang or whatever
the form contains a text area
and submit button
I cannot get it to actually insert the data. plz help
<?php
/**
* @author
* @copyright 2008
*/
$their_gulf = $_GET["id"];
if (isset($_POST['Submit']))
{
$nickname = $_SESSION['nickname'];
$message = (trim(strip_tags(($_POST['message']))));
$con = mysql_connect("localhost","adeang","123");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("adeang", $con);
mysql_query("INSERT INTO wall (message, sent_from, sent_to)
VALUES ('$message', '$nickname', '$their_gulf')");
mysql_close($con);
}
?>
<form name="Message_submit" method="post" action="sent_message.php" id="Form1">
<div id="wb_Text3" style="position:width:49px;height:14px;z-index:9" align="left">
<font style="font-size:11px" color="#000000" face="Arial">Message</font></div>
<textarea name="message" id="TextArea1" style="position:width:200px;height:226px;z-index:10" rows="11" cols="17" tabindex="1">TYPE YOUR MESSAGE HERE!!!!</textarea>
<input type="submit" id="Button1" name="Button1" value="Submit" style="position:width:96px;height:25px;z-index:11" tabindex="2">
</form>
okay so here are some of the values are found:
when someone clicks someones nickname they are set to their wall and then the id is in the link aka http://localhost/their_profile.php?id=adeang
and the session is set and uses a nickname IE adeang or whatever
the form contains a text area
and submit button
I cannot get it to actually insert the data. plz help