louieaw Posted September 12, 2007 Share Posted September 12, 2007 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 More sharing options...
justsomeguy Posted September 12, 2007 Share Posted September 12, 2007 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 More sharing options...
Guest FirefoxRocks Posted September 14, 2007 Share Posted September 14, 2007 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 More sharing options...
louieaw Posted September 15, 2007 Author Share Posted September 15, 2007 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 More sharing options...
louieaw Posted September 15, 2007 Author Share Posted September 15, 2007 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 More sharing options...
Guest FirefoxRocks Posted September 15, 2007 Share Posted September 15, 2007 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 More sharing options...
Synook Posted September 15, 2007 Share Posted September 15, 2007 Have a look at the PHP and SQL tutorials: http://www.w3schools.com/php/ and http://www.w3schools.com/sql/ Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.