The popup is javascript. Google that. Easy.
The form is php.
It's really not that hard. Yeah... php.net and look for stuff.
Basically, set the form's action to either the same page or another, and in that page, put a php script that handles the data input. I'd say, for your use, put it in a new page.
Ex:
<form action="nextpage.php" method="post">
Now... you've got your form setup. Put that in a popup with correctly named fields for comment, email, whatever.
Now... in nextpage.php (or yournamehere.php), do something like this:
PHP Code:
<?php
$varname = $_POST['varname']; /*gets the variables that were sent from the
form. see 'method="post"' above. The other one is "get"/$_GET[''], but that
adds them to your url as well, so this way its hidden and cleaner.*/
[repeat above line for each variable.] //repeat above...
INSERT add to database code OR mail() function code
/*I'd recommend the mail function... have it mail to your email (maybe setup
a free new account) and then just use html to add to your page. You could
use a database and it would be easier, but then you'd have to have a db and
know how to put the data in and get the data out. Tutorials will help with
either of these. You could even do something with a text file instead of a
database or something... but... I'd recommend the other two options. (Maybe
you could even code it to add directly to your page... that's kinda risky
though... at least the email way lets you verify...)*/
if ([CHECK IF IT WORKED HERE-- see tutorial for method you choose above]) { //optional
echo "[insert html (javascript) for the closepopup command]"; /*prints html
that will close the window.*/
} //optional, see above
?>
Hope this helps.
Bookmarks