javascript, php, and mysql?

andr0x

New member
sure do something like thi,: lets say the submit button is called "comment" and is set like this:

<input type="submit" name="comment" value="Leave Comment" />

now you can do <form action="guestbook.php">

and at the top of guestbook.php have (assuming you're using post):

if isset($_POST['comment'])
{
// ur code
}

so the first time you open guestbook.php this value will NOT be set so this code won't be executed, but once it is you can run the code that will add the comment.

now this is very basic but easy to grasp if you're just starting, once ur ready for a site which will go live you'll want to do it a more advanced way.
 
i just got started with php and mysql. so i tried making my own guestbook.

it's got the main guestbook.php page with the form and everything. then the form passes the info to an addcomment.php that stores the data into the tables.

i was wondering... i have
<form action="addcomment.php"...>

is there anyway to instead have the adding comment script included in the same guestbook.php page?
 
Back
Top