Hello all,
I am beginner in php and I have a few quenstions for my current project. I am working on basic php system that an editor add and edit text content (the website is designed for articles ).
add.php
Title | |
Description | |
Text | |
edit.php
Title | > |
Description | > |
Text | id="edit_tx"> |
> |
while($res=mysql_fetch_array($result))
{
$title = $res[‘title’];
$descrip = $res[‘descrip’];
$text = $res[‘text’];
}
[/php]
index.php
[php]
echo “
while($res=mysql_fetch_array($result)){
echo "<hr><h2>".$res['title']."</h2>";
echo "<h3>".$res['descrip']."</h3>";
echo "<pre>".$res['text']."</pre>";
echo "<a href=\"edit.php?id=$res[id]\">Edit</a> | <a href=\"delete.php?id=$res[id]\">Delete</a><hr>";
}
echo “
[/php]
My question is: Is it correct to use only tag for the form or I can use tag for adding and editing the content? Because when is - it doesn not show the whole content, and if I use - when I edit it doen’t show nothing.
My other question is: How can I format the the data (the text) in the index.php? I tryed to format the text with css, but always the text is showed in one line.
Thanks in advance!