JamesCliff
Programmer
Hi all,
Right my site is database driven,
As u can see the homepage has writing on it, this is called from a database. The user can edit the writing from the admin section by editing whats in the text field and then clicking update. Ive got it so that the text is displayed on the home page in the same format that it is entered into the text field and then the table. This ensures that tabs, spaces and new lines are where the user wants them to be.
However my problem now is that if the user types a line of text into the field box and dosnt press enter once to start a new line the whole site is then stetched apart into bits and completely distorted. So to over come this i have manually started a new line every 16 words of so, so that the text is displayed on the home page without stretching the site. Im woundering if theres anyway to automaticlly do this so the user dosnt have to keep pressing enter every line and a half in the text box.
Would i set a letter column limit in the mysql query that calls the text from the database or would i put a limit on the text field in the admin section some how? Or is there another way of doing it. Basiclly i want it to start a new line and not stetch the site, so i want it to limit the amount of characters per line that it displays on the home page.
This is the code i am using on the home page to call the text from the database and keep it in the format entered by the user in the text field box:
I done know if its this i need to edit in order to do what im trying to do but i thought id post it anyway.
Im really stuck with this one, so any help would be appriciated.
Thanks alot
Jim
Right my site is database driven,
As u can see the homepage has writing on it, this is called from a database. The user can edit the writing from the admin section by editing whats in the text field and then clicking update. Ive got it so that the text is displayed on the home page in the same format that it is entered into the text field and then the table. This ensures that tabs, spaces and new lines are where the user wants them to be.
However my problem now is that if the user types a line of text into the field box and dosnt press enter once to start a new line the whole site is then stetched apart into bits and completely distorted. So to over come this i have manually started a new line every 16 words of so, so that the text is displayed on the home page without stretching the site. Im woundering if theres anyway to automaticlly do this so the user dosnt have to keep pressing enter every line and a half in the text box.
Would i set a letter column limit in the mysql query that calls the text from the database or would i put a limit on the text field in the admin section some how? Or is there another way of doing it. Basiclly i want it to start a new line and not stetch the site, so i want it to limit the amount of characters per line that it displays on the home page.
This is the code i am using on the home page to call the text from the database and keep it in the format entered by the user in the text field box:
Code:
$table = "home" ;
$sql = "select `homeid`, `context` from $table";
$rslt = mysql_query($sql);
while ($result = mysql_fetch_array($rslt))
{
echo "<table width='650'>";
echo "<tr>";
echo '<td><pre><font face="Verdana, Arial, Helvetica, sans-serif">' . $result['context'] . '</font></pre></td>
</tr>';
}
echo "</table>";
I done know if its this i need to edit in order to do what im trying to do but i thought id post it anyway.
Im really stuck with this one, so any help would be appriciated.
Thanks alot
Jim