evdude Member Posts: 135 From: Earth Orbit Registered: 03-14-2007 |
I'm trying to make a web page that some one can enter text into a text box and submit it, and then the page will then have that person's message on it. can some one tell me how to do this? ------------------ |
||
Jari Member Posts: 1471 From: Helsinki, Finland Registered: 03-11-2005 |
Hi, sounds like you need forms. This page shows how to use them: http://www.w3schools.com/html/html_forms.asp check the part where it shows "The Form's Action Attribute and the Submit Button" I hope that helps and please tell if you have any problems. ------------------ [VoHW] (Help needed) [Blog] - Truedisciple (mp3) |
||
tehriddler Junior Member Posts: 8 From: Portland, Oregon Registered: 05-07-2007 |
evdude, I remember back when I was curious about your same question. This is how I got into PHP. What you'll need to do is: In your form tags, have the action point to the php page that will be recieving the comments. You will need to also have the method as post. Example: After that, the receiving page (with a .php extention) will need to be set up to recieve the 'posted' form data. I'm sorry that I do not have to time to fully delve into this process right now, but if you'd like, I'd suggest checking out this tutorial on Forms and PHP. Best of luck on your project! God Bless! [This message has been edited by tehriddler (edited May 19, 2007).] |
||
MastaLlama Member Posts: 671 From: Houston, TX USA Registered: 08-10-2005 |
You can do it in PHP, ASP, ColdFusion...all kinds of different ways. You could even use Client-Side JavaScript if you don't want to get out of HTML and into a web programming language (not that Javascript isn't...it's just not as powerful). | ||
MastaLlama Member Posts: 671 From: Houston, TX USA Registered: 08-10-2005 |
here's an example of how to do it with just Javascript...doesn't save the info...
There's some cool stuff you can do there...for example paste the following into the box, click the "Display Text" button then use the new form:
[This message has been edited by mastallama (edited May 20, 2007).] |
||
MastaLlama Member Posts: 671 From: Houston, TX USA Registered: 08-10-2005 |
Also, you'll get different results with different browsers...IE will make the original form disappear, FF will write your new stuff above the form. | ||
evdude Member Posts: 135 From: Earth Orbit Registered: 03-14-2007 |
Thanks for the replys. I think could make a form, I just need to know how to make a php or ASP thing edit the html document so the input is always there. ------------------ |
||
MastaLlama Member Posts: 671 From: Houston, TX USA Registered: 08-10-2005 |
You really don't want it to edit the HTML, you'll want to use a database. If you're using a Windows Server with IIS4 or higher you can use an Access database with ASP no problem. If you just want to do this for testing at home you could run Personal Web Server if you can find an old copy of it somewhere on the web. If you're serious about learning ASP there's a site that really helped me when I was starting out: http://www.ASP101.com Specific samples that may help you: Adding records to an Access Database Deleting records in an Access Database Updating records in an Access Database Counting records in an Access Database Bring it all together to view/edit/delete in an little interface. There's tons of other things you can do but if you're looking at using a database (not just Access - although your connection string would have to change a bit) this is a great place to start. |
||
evdude Member Posts: 135 From: Earth Orbit Registered: 03-14-2007 |
Ok, I'd use ASP but I don't know if googlepages will let me use it. Is there a way to write to xml with javascript? ------------------ "trust in the lord with all your heart and lean not on your own understanding, in all your way's, acknowledge him and he will direct your path" proverbs 3:5-6 |
||
samw3 Member Posts: 542 From: Toccoa, GA, USA Registered: 08-15-2006 |
It seems googlepages doesn't even support javascript that well. http://www.google.com/support/pages/bin/answer.py?answer=35213 ------------------ |
||
MastaLlama Member Posts: 671 From: Houston, TX USA Registered: 08-10-2005 |
What are you trying to do? I could host a page for you on my website if you need me to. | ||
evdude Member Posts: 135 From: Earth Orbit Registered: 03-14-2007 |
@samw3: I'm using my own HTML files, and just putting a link to them in the in main page. I tried using javascript in one of those and it worked. if it doesn't for editing xml I can make a gadget(which can have javascript) and use that. @mastallama: its a form to comunicate with a friend about the development of a game that I'm making for him and my brother. ------------------ "trust in the lord with all your heart and lean not on your own understanding, in all your way's, acknowledge him and he will direct your path" proverbs 3:5-6 [This message has been edited by evdude (edited August 23, 2007).] |
||
evdude Member Posts: 135 From: Earth Orbit Registered: 03-14-2007 |
Ok, I figured it out. ------------------ "trust in the lord with all your heart and lean not on your own understanding, in all your way's, acknowledge him and he will direct your path" proverbs 3:5-6 |