PDA

View Full Version : Form to Email question



komputa_skoo
07-18-2006, 02:27 PM
I posted my question in the scripting forum, but it seems like no one goes there.... and this stuff has consumed me. I need help asap!!

here is the info that my server says I have:

Operating system Linux
Service Status Click to View
Kernel version 2.6.15.1-mingoto
Machine Type i686
Apache version 1.3.34 (Unix)
PERL version 5.8.0
Path to PERL /usr/bin/perl
Path to sendmail /usr/sbin/sendmail
Installed Perl Modules Click to View
PHP version 4.3.11
MySQL version 4.1.19-standard-log
cPanel Build 10.8.2-STABLE 120
Theme cPanel X v2.5.0

I think it says cgiemail is already installed on my server.....
I have READ ALL I CAN, but no one gives step by step in the instructions. Would anyone mind if I "U2U" message them to get thru this?????

I apologize, but it would be greatly appreciated!!!!!!

[Edited on 7/18/2006 by komputa_skoo]

mkeefe
07-18-2006, 03:07 PM
I am not sure what you are asking?

rAyVoLvEz
07-18-2006, 03:27 PM
i think she wants to know how to get data from a form to send thru to her email?

komputa_skoo
07-18-2006, 04:58 PM
yea ray!!!
'
for some reason it is SO complicated.

I just want people to be able to fill out a registration form, then when they click submit, it wil turn into an email and be sent to me. this is where ive been looking...

http://web.mit.edu/wwwdev/cgiemail/user.html

i would LOVE for someone to walk me thru it!!!! It just kinda skips pieces on how to insdtall and set it up properly.

[Edited on 7/18/2006 by komputa_skoo]

PNeal
07-18-2006, 05:10 PM
I looked at that link, now I'm confused...

Sending email with PHP is easy.

Have a look at Matt's Basic Emailer with PHP (http://www.scriptplayground.com/tutorials/php/Basic-Emailer-with-PHP/)

komputa_skoo
07-18-2006, 05:33 PM
LOL, Ill look at it now.

EASY, I'll throw up if it ends up being easy.:blush

komputa_skoo
07-18-2006, 05:34 PM
OHHHH, I tried that one too already.

Do i have to know php to do this, cuz it confused the HECK outta me!!!!

The second set of code where it say "BEGIN CONFIGURATION" does that just go into the php file???

man..... i need to go to school!

[Edited on 7/18/2006 by komputa_skoo]

komputa_skoo
07-18-2006, 05:59 PM
okay, Im getting closer...

*made the html page (easy of course)

*created a PHP page, named it contact.php like the tut says.

*I adjusted the variables to go to my email, etc.

*I uploaded the html page and the php page to my site, but after i fill out the form and hit SUBMIT, it goes to the blank "contact.php" page. So I checked my email, and nothing was sent either.

look http://www.komputaskoografix.com/sayhi.htm

:mad:

mkeefe
07-19-2006, 01:06 AM
Please post your contact.php file just to make sure everything was edited properly.

To do this, just upload the file with a .phps extension doing so will allow the source to be viewable.

Matt

komputa_skoo
07-19-2006, 02:54 AM
ummm i saved it as phps, but i cant get it to open heres the 'sol called' location http://www.komputaskoografix.com/contact.phps

should i be saving them in a certain directory, or what????

I will just post the script, sorry!!!

this is what the WHOLE page script/code says:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body>
<p>
<?
///////////////////////////
//Begin Configuration
///////////////////////////

// Your email
$to = "komputaskoo@yahoo.com" . ", " ;

// Email Subject
$subject = "Comment From " . "KomputaSkoo Grafix";

// Server name, to display in the headers
$server_name = "komputaskoografix";

///////////////////////////
//End Configuration
///////////////////////////

if (!empty($_POST['send']) || !empty($_GET['send']))
{
$action = (!empty($_POST['send'])) ? $_POST['send'] : $_GET['send'];
}
else
{
$action = '';
}

$build_message = false;
if($action == "send")
{
$build_message = true;
$message = trim($_POST['message']);
$name = trim($_POST['name']);
$email = trim($_POST['email']);
$time = time();
$date = date("F j, Y", time());
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/plain; charset=UTF-8\r\n";
$headers .= "From: $email\r\n";
$headers .= "X-mailer: " . $server_name . " Server\r\n";
}

if($build_message)
{
/* message */
$message = "
Sender Name: $name\n
Sender E-Mail: $email\n
Date Sent: $date\n
Message:\n----------------------------------------\n$message \n";

if(mail($to, $subject, $message, $headers))
{
$result = "<b>Thank you</b>.<br />I will get back to you very soon.<br />";
}
else
{
$result = "Sorry: An error occured, please try again later.";
}
}

// Output a result Message
print $result;
?>
</p>
</body>
</html>

[Edited on 7/19/2006 by komputa_skoo]

mkeefe
07-19-2006, 04:46 AM
Ok the config looks ok.

Do you get any errors or anything?

Matt

komputa_skoo
07-19-2006, 11:49 AM
no, it just goes to that blank white php page, and nothing happens.

but when i 'preview in browser', after i click submit, it asks me to open or save contact.php.... like it wants me to download it.

i REALLY want to figure this out!!

rAyVoLvEz
07-20-2006, 12:30 AM
Originally posted by komputa_skoo
no, it just goes to that blank white php page, and nothing happens.

but when i 'preview in browser', after i click submit, it asks me to open or save contact.php.... like it wants me to download it.

i REALLY want to figure this out!!

from my experience, if u get the open or save contact.php when u preview in browser, theoretically, ur script is workin perfectly fine.. then when u put on server, it should work.. if i'm not wrong, there is a missing step.. when u click submit, does it get a new page saying thank you? i usually use asp.. not absolutely sure here..

komputa_skoo
07-21-2006, 07:29 PM
yea ray thats true, when i test it it always asks to save...

mkeefe walked me through his PHP emailer and its workin now thank GOD!!!!!!

and thanks to all of you who take time to help us newbies out!!!!