Thanks... My problem with reading the manuals or sample code is that when "place holder" names are substituted like foo and foobar - those are easy to spot, but some like $K or $v or something else - I can't figure out where my own data is supposed to go, and which of my data is supposed to go there! I ain't just a dumb girl, but occaisionally my brain gets blocked on some stuff i guess. ;p
====
Well, i found out that my problem is way at the beginning, and I think it has something to do with stripslashes.
This is the process:
I fill in a form, I get a preview of the data then have it post to the database. The preview is coming out fine, even with quotes and/or apostrophes. But then when it is submitted to the databases everything after the first set of " or ' is dropped.
Here is what I have so far: This is the code for the first form - addreview.php:
<?php
if(isset($submit)):
$db = mysql_connect("host", "user");
mysql_select_db("dbname", $db);
$sql = "INSERT INTO reviews
VALUES(NULL,'$title','$body','$date','$author','$publisher','$amazonurl','$reviewer')";
mysql_query($sql);
print("<h2>The Data Has Been Entered</h2>\n");
print("<b>You can add another news story below</b>\n");
print("<p>\n");
endif;
$title = stripslashes($title);
$body = stripslashes($body);
$author = stripslashes($author);
?>
--- this is followed by all the form fields -----
=================
THis is the code from the "preview page" results-preview.php:
<?php
//Set the variables for the database access:
$Host = "host";
$User = "user";
$DBName = "dbname";
$TableName = "table";
$Link = mysql_connect ($Host, $User);
$Query = "SELECT *, DATE_FORMAT(date, '%m-%d-%Y') AS date_format FROM reviews where reviews_id = '$reviews_id'";
$Result = mysql_db_query ($DBName, $Query, $Link);
echo mysql_error();
if(isset($submit)):
$db = mysql_connect("host", "user");
mysql_select_db("dbname", $db);
endif;
$title = stripslashes($title);
$body = stripslashes($body);
$author = stripslashes($author);
{
print ("<TABLE BORDER=0 WIDTH=\"100%\" CELLSPACING=1 CELLPADDING=2 ALIGN=CENTER>");
print ("<TR>");
print ("<TD ALIGN=left VALIGN=TOP><font size=3 face=Arial, Helvetica, sans-serif><b>$title</b></font></TD>");
print ("</TR>");
print ("<TR>");
print ("<TD ALIGN=left VALIGN=TOP><font size=2 face=Arial, Helvetica, sans-serif><br>Written By: $author<br>$publisher</font><br><br></TD>");
print ("</TR>");
print ("<TR>");
print ("<TD ALIGN=left VALIGN=TOP><font size=2 face=Arial, Helvetica, sans-serif><br>Reviewed By: $reviewer</font><br><br></TD>");
print ("</TR>");
print ("<TR>");
print ("<TD ALIGN=left VALIGN=TOP><font size=2 face=Arial, Helvetica, sans-serif>$body</font></TD>");
print ("</TR>");
}
print ("</TABLE>");
print ("<form action=addreview.php method=POST>");
print("<input type=hidden name=title value=\"$title\">");
print("<input type=hidden name=body value=\"$body\">");
print("<input type=hidden name=date value=\"$date\">");
print("<input type=hidden name=author value=\"$author\">");
print("<input type=hidden name=publisher value=\"$publisher\">");
print("<input type=hidden name=amazonurl value=\"$amazonurl\">");
print("<input type=hidden name=reviewer value=\"$reviewer\">");
print ("<P><P><P><a href=\"javascript:history.back()\"
onmouseover=\"window.status='back up one page';\"
onmouseout=\"window.status=' ';\"><CENTER><HR><B>Click here to go back and make some changes or corrections</b></CENTER></a>
<br>");
print("<center><input type=\"submit\" name=\"submit\" value=\"Submit to Articles Database and to enter a new article\">");
print ("</form></center>");
?>
===========================
Hope this is not too much!
Kathy