I am to my wits end on this one. I am not a code guru, but I know my way around basic php/mysql. I am populating a textarea with a block of text from mysql. Then upon submission, it executes the update script and stores it in the database.
SIMPLE RIGHT, it just will not work. I have tried changing just about everything down to the field types in mysql, to different form editors. The kicker is, any different block of text works fine. A paragraph of Lorem Ipsum works great. It is just this simple block of text that does not work? Is there some illegal word that php refuses to send?
There is no error, the browser just sits there until it times out. This is the paragraph (with punctuation stripped out)
In preparation for my next career goal I obtained a loan from the Teachers Credit Union to purchase a rubber tire backhoe loader and incorporated XYZ corp in April of 1974 I began doing small jobs during weekends and off days Meanwhile my younger brother Bob graduated from Some University in Boston Massachusetts with a degree in Accounting and went to work for ABC corp a Big Eight accounting firm.
Someone please enlighten me.
Here is the code if it matters:
<?php
include("fckeditor/fckeditor.php") ;
if(isset($_GET['updateaboutus']))
{
$text=$_POST['text'];
$update_link_id = mysql_connect ($host, $user, $pass);
if (!$update_link_id)
{
die('Could not connect: ' . mysql_error());
}
if (!mysql_select_db($dbname)) die(mysql_error());
mysql_query("UPDATE $dbtable SET text = '$text' WHERE label = 'aboutus'");
$result = stripslashes(nl2br($text));
echo "<div style='color:#FF0000;font-weight:bold;'>Site Updated Successfully!</div><br />
$result
<br /><br /><a href='admin.php'>« Admin Home</a>";
mysql_close($update_link_id);
}
else {
$link_id = mysql_connect ($host, $user, $pass);
if (!mysql_select_db($dbname)) die(mysql_error());
$query="SELECT * FROM $dbtable WHERE label='aboutus'";
$result=mysql_query($query);
while ($row = mysql_fetch_array($result)) {
$text=$row["text"];
echo "<form action='?updateaboutus' name='updateaboutus' method='POST'>";
$oFCKeditor = new FCKeditor('text') ;
$oFCKeditor->BasePath = '/beta/admin/fckeditor/' ;
$oFCKeditor->Height='300';
$oFCKeditor->Value = $text ;
$oFCKeditor->Create() ;
}
mysql_close($link_id);
}
?>
<input type='hidden' name='label' value='aboutus' /><input type='submit' value='SUBMIT' class='button'></form>