Click to See Complete Forum and Search --> : Form post to web page assistance req


robertpath
09-20-2003, 07:14 PM
I have created form but am having difficulty coding it to post to a web page. Any assistance would be appreciated. Using Dreamweaver 4.0 as editor.

pyro
09-20-2003, 07:17 PM
What exactly are you trying to do? Just print out the forms contents?

robertpath
09-20-2003, 07:21 PM
I'm trying to have form contents posted to a web page upon submission for viewers of the web site to view the posts on a separate page. I want to provide users the option to post messages and view the posts on another page.

pyro
09-20-2003, 07:49 PM
So you want the contents to be viewable by other people? If so, this will require some sort of serverside language. If your server supports PHP, take a look at http://forums.webdeveloper.com/showthread.php?s=&threadid=10856&highlight=guestbook

robertpath
09-20-2003, 08:14 PM
when I use the code for the guestbook I get the following code displayed on the web page. Any suggestions?

\nPosted by $name at $time on $date.\n\n"; ##Write the file## $fp = fopen ($filename, "a"); if ($fp) { fwrite ($fp, $value); fclose ($fp); } else { echo ("Your entry could not be added."); } } ?>
" METHOD="post">
Your Message:

Your Name:

$line) { $text .= $line; } $text = split("", $text); for ($i=0; $i"; echo $text[$i]; echo "
"; } ?>

pyro
09-20-2003, 08:17 PM
I'm guessing that your server must not support PHP...

robertpath
09-20-2003, 08:18 PM
I haven't loaded it to my server yet, I've just put the code into my web page and displayed the page

pyro
09-20-2003, 08:30 PM
PHP runs serverside, which means it requires a web server that has PHP installed to parse the PHP. Try uploading it to your server, and hope it supports PHP... :)

robertpath
09-20-2003, 09:08 PM
The php works fine on my server, where do I specify the page name I want the post to display on?

Thanks for your help.

pyro
09-20-2003, 10:37 PM
They will display on the current page. The PHP writes to a .txt file called guestbook.txt, so make sure you have uploaded that to the same directory, and CHMODed it to 666.

robertpath
09-20-2003, 10:58 PM
Is the CHMODed it to 666 set by my host? If so, what do I need to ask them to set? CHMODed to 666?

Thanks

pyro
09-20-2003, 11:08 PM
No, you can CHMOD the files with your FTP program. If you don't know how to do this, read your FTP programs documentation, or try searching google for some tutorials.