- This topic is empty.
-
AuthorPosts
-
March 24, 2012 at 10:57 am #37319
Anonymous
InactiveOk, doing my first site, so don’t be too cruel!
I want to add a simple guestbook/comments section to my website pages 3 and 4 (out of 5 all in all) but…
I’ve already done all the html and css parts on the forms – what’s left is form processing.
The main question is:
IS IT POSSIBLE TO MAKE MY FORM GET PROCESSED WITHOUT CHANGING DOCTYPE FROM .HTML TO .PHP ?I’ve already seen tons of scripts to process forms – I mean php to mysql etc. and even found and implemented a nice form, which actually required me to change two of my files 3.html and 4.html into 3.php and 4.php. But the question still remains – is this THE ONLY WAY?
I’ve also read that one can change .htaccess file on the server side so it would read BUT, that is just a workaround, and also has issues (that will make ALL your .html files get processed by the server whether they have or don’t have any code in ’em.)Is there a way to do it as I think:
1. a form on page.html sends data to .php (which is a separate file) via /form action=”processor script.php?/
2. that “processor script.php” gets data and loads it to some database (let us say “database.db or .txt”)
3. javascript (or what, say ajax, i don’t know yet) loads the data from “database.db or .txt” to page.html every time when it is loaded or refreshed.Is there a way that it will work? Don’t write the code yourself, just give a hint, or url example.
Mind again I DON’T WANT TO ADD SCRIPT TO PAGE.HTML FOR IT WILL AUTOMATICALLY REQUIRE ME TO CHANGE PAGE.HTML INTO PAGE.PHP
THANK YOU VERY MUCH!
March 24, 2012 at 11:01 am #99845Vermaas
ParticipantHTML:
PHP:
if($_SERVER === 'POST') {
// Rest of your php code
}
?>
If you want to let your visitor stay on the html page, you’ll need some ajax for you to do the trick.
March 24, 2012 at 11:45 am #99848Anonymous
InactiveOk. thx. yet, not closing, will do the code and post it here. It would be nice if it gets assessed here)
March 24, 2012 at 4:52 pm #99856mailmevenkat
Memberhmmm!it depends and no doctype is needed to be specified.what ever within the php tags will be processed in server and the outside php tags are processed client side.
-
AuthorPosts
- The forum ‘Back End’ is closed to new topics and replies.