Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Closed Thread
Old 07-07-2007, 09:29 AM   #1 (permalink)
jay_bo's Avatar
 
Ultra Techie

Join Date: Jul 2006

Posts: 898

jay_bo is on a distinguished road

Exclamation php

i want a forum on my site which emails to my address OFF the SITE i DONT want it to open up ther default email program thanks
jay_bo is offline  
Old 07-07-2007, 06:03 PM   #2 (permalink)
mademokid's Avatar
 
Newb Techie

Join Date: Jun 2007

Posts: 28

mademokid is on a distinguished road

Default Re: php

Do you have php and sendmail on your webserver?
mademokid is offline  
Old 07-07-2007, 07:29 PM   #3 (permalink)
 
Banned

Join Date: Oct 2006

Posts: 81

williwaw

Default Re: php

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

williwaw is offline  
Old 07-08-2007, 07:21 AM   #4 (permalink)
jay_bo's Avatar
 
Ultra Techie

Join Date: Jul 2006

Posts: 898

jay_bo is on a distinguished road

Default Re: php

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
jay_bo is offline  
Old 07-08-2007, 10:15 AM   #5 (permalink)
mademokid's Avatar
 
Newb Techie

Join Date: Jun 2007

Posts: 28

mademokid is on a distinguished road

Default Re: php

Do you have a hosting company or a web address yet?
mademokid is offline  
Old 07-08-2007, 12:18 PM   #6 (permalink)
jay_bo's Avatar
 
Ultra Techie

Join Date: Jul 2006

Posts: 898

jay_bo is on a distinguished road

Default Re: php

no not yet i have been testing my scripts out on easy php

im not sure on what he means by this "Make sure to set the correct permission for the PHP file"
jay_bo is offline  
Old 07-08-2007, 01:27 PM   #7 (permalink)
 
Banned

Join Date: Oct 2006

Posts: 81

williwaw

Default Re: php

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
williwaw is offline  
Old 07-09-2007, 07:14 AM   #8 (permalink)
jay_bo's Avatar
 
Ultra Techie

Join Date: Jul 2006

Posts: 898

jay_bo is on a distinguished road

Default Re: php

oryt okay i get ya. yea wel im designing a web site for a hotel so i will have one soon
jay_bo is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


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 01:12 PM
Need a good captcha generating php script surut Windows Operating Systems and Software 1 05-26-2007 09:23 AM
PHP captcha script needed iorgus Programming Discussions 2 05-20-2007 01:33 PM
PHP 2-player game? thejeremy Programming Discussions 4 04-09-2007 06:01 PM
Remote file access w/ IP + PHP? thejeremy Programming Discussions 2 04-04-2007 05:24 PM