Computers |
|
| | #3 (permalink) |
| Banned Join Date: Oct 2006
Posts: 82
| Try this simple form. There are a butt load of them available. 1. First you need to create a form to use the PHPmail script. A form will look something like the one below. It must be saved as an htm or html file. You can edit the one below to suit your own needs. <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Contact Us</title> <link rel="stylesheet" type="text/css" href="../../css/nms.css" /> </head> <body> <form method="post" action="mail.php"> <table> <tr> <td>What is your name ?</td> <td><input type="text" name="name" /></td> </tr> <tr> <td>What is your e-mail address ?</td> <td><input type="text" name="email" /></td> </tr> <tr> <td> Comments:</td> <td><textarea name="data" cols=40 rows=6></textarea></td> </tr> <tr> <td colspan="2"><input type="submit" /></td> </tr> </table> </form> </body> </html> 2. Next you need to create a file named mail.php which will contain the following code. <? $to = 'me@mydomain.com'; $subject = 'subject'; $message = 'From: ' . $_REQUEST['name'] . "\n\n" . $_REQUEST['data']; $email = $_REQUEST['email']; $headers = 'From: ' . $email . "\r\n" . 'Reply-To: ' . $email . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail ($to, $subject, $message, $headers); header("Location: thanks.html"); ?> Note: You will replace 'me@mydomain.com' with your e-mail account and 'subject' with what will be in the subject field of the e-mail. Replace "thanks.html" with the name of the page that the viewer will be redirected to after submitting the form. 3. Upload both files into your webspace. Make sure to set the correct permission for the PHP file. Further reading: PHP Mail Cheers, Williwaw ![]() |
| | |
| | #4 (permalink) |
| Ultra Techie Join Date: Jul 2006
Posts: 878
| didnt quite get step 3 3. Upload both files into your webspace. Make sure to set the correct permission for the PHP file. could you just describe it abit more and thanks for this, it is excellent please could you check this out and give me your thoughts if this would work or not website |
| | |
| | #7 (permalink) |
| Banned Join Date: Oct 2006
Posts: 82
| This will not work for you then. You must have FTP access to the/your server for this to work. To answer your other question: Use permissions to define who can and cannot view files or folders, who can and cannot run files, and who can and cannot change files or folders on a server. Cheers, Williwaw |
| | |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| New Site Project - Flash + PHP + MySQL + CSS | theone_trent | Web Graphics, design, digital images | 2 | 06-30-2007 12:12 PM |
| Need a good captcha generating php script | surut | Windows Operating Systems and Software | 1 | 05-26-2007 08:23 AM |
| PHP captcha script needed | iorgus | Programming Discussions | 2 | 05-20-2007 12:33 PM |
| PHP 2-player game? | thejeremy | Programming Discussions | 4 | 04-09-2007 05:01 PM |
| Remote file access w/ IP + PHP? | thejeremy | Programming Discussions | 2 | 04-04-2007 04:24 PM |