Jump to content

#!#!Display Text writeen in text box on page#!#!


louieaw

Recommended Posts

I want to display the exact text written in a box on a page in a certain place. I am pretty clueless. HELP!!ANYBODY! :) maybe you could write it around this?

<html><head></head><body><style>body{font-family:Comic Sans MS;}a{color:black;text-decoration:none}a:hover{color:#909090}A:hover{font-weight:bold}table.nav</style><center><a href="index.html" style="font-size:20;color:red">Back</a></center><br><center><table border="0" width="100%" bgcolor="gray"><tr><td></table><br><br><br><br>Comments on my site<br><br><table border="1" width="600"></body></html>

Link to comment
Share on other sites

Wow, I've never seen such a short piece of code with so many problems in it.Style declarations only are allowed in the head, not in the body, and the style tag should have a type attribute on it as well.<style type="text/css">You also have a selector in the CSS called table.nav, but there aren't any properties for it. You have this table:<table border="0" width="100%" bgcolor="gray"><tr><td></table>Which doesn't have anything in it, and you never close the <tr> or <td> elements. And then you have this just hanging out at the bottom:<table border="1" width="600">which doesn't do anything at all, it's not even closed. And, back to your original question, how do you want that to work? You can use Javascript to read what someone writes in a box and just put that text on the page, but it won't save it for anyone else or if the user goes to another page and then back. If you want to save the text so other people see it then you will need a form that submits to a page that is written using a server-side language like ASP, PHP, Coldfusion, Perl, Python, etc and read what was submitted through the form then save it in a database. Then the page where you want the text to show up would need to get the text from the database and write it where you want it to go on the page.Also, a giant font really isn't necessary.

Link to comment
Share on other sites

Guest FirefoxRocks

1. You cannot do this with just XHTML. You need to store the information on a server using a database such as MySQL, MSSQL or another database software, along with using server-side scripting (PHP, ASP, etc).2. Your code is so invalid, here is a fixed version:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head><title>My page</title><style type="text/css">body{font-family:Comic Sans MS}a{color:black;text-decoration:none}a:hover{color:#909090;font-weight:bold}</style></head><body><p style="text-align:center"><a href="index.html" style="font-size:20pt;color:red">Back</a><br /></p><p><br /><br /><br /><br />Comments on my site<br /><br /></p></body></html>

Sorry but I removed some unnecessary code because they don't do anything. Hope that helps! :)

Link to comment
Share on other sites

Wow, I've never seen such a short piece of code with so many problems in it.Style declarations only are allowed in the head, not in the body, and the style tag should have a type attribute on it as well.<style type="text/css">You also have a selector in the CSS called table.nav, but there aren't any properties for it. You have this table:<table border="0" width="100%" bgcolor="gray"><tr><td></table>Which doesn't have anything in it, and you never close the <tr> or <td> elements. And then you have this just hanging out at the bottom:<table border="1" width="600">which doesn't do anything at all, it's not even closed. And, back to your original question, how do you want that to work? You can use Javascript to read what someone writes in a box and just put that text on the page, but it won't save it for anyone else or if the user goes to another page and then back. If you want to save the text so other people see it then you will need a form that submits to a page that is written using a server-side language like ASP, PHP, Coldfusion, Perl, Python, etc and read what was submitted through the form then save it in a database. Then the page where you want the text to show up would need to get the text from the database and write it where you want it to go on the page.Also, a giant font really isn't necessary.
Oh, well I was in a hurry, but can you write something using the second option. "If you want to save the text so other people see it then you will need a form that submits to a page that is written using a server-side language like ASP, PHP, Coldfusion, Perl, Python, etc and read what was submitted through the form then save it in a database."I dont know any of those languages. I would be grateful if you could write something that involves this option.Thanks-louieaw
Link to comment
Share on other sites

1. You cannot do this with just XHTML. You need to store the information on a server using a database such as MySQL, MSSQL or another database software, along with using server-side scripting (PHP, ASP, etc).2. Your code is so invalid, here is a fixed version:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head><title>My page</title><style type="text/css">body{font-family:Comic Sans MS}a{color:black;text-decoration:none}a:hover{color:#909090;font-weight:bold}</style></head><body><p style="text-align:center"><a href="index.html" style="font-size:20pt;color:red">Back</a><br /></p><p><br /><br /><br /><br />Comments on my site<br /><br /></p></body></html>

Sorry but I removed some unnecessary code because they don't do anything. Hope that helps! :)

Thanks for fixing it up! I just started writing. But maybe you know a way where if somebody writes in a textbox, then it saves to the site so others can see it?
Link to comment
Share on other sites

Guest FirefoxRocks

From what you are describing, I think you mean a shoutbox. You can find a lot of shoutboxes by searching on Google, but for most of them you will need PHP and possibly MySQL to store the shouts.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...