Welcome to the Geeks & God Static Archive. Read more »

Contact PHP

Joined: 11/28/2008

Ok,

so here is the story, redid our church website and everything worked out great. except somehow our contact.php file got deleted in the process of the new site getting uploaded and other files getting deleted. Can somebody help us out and make a new contact.php for us?

You can visit the site it is www.victorylifecenter.org

You can click on the contact button and see that everything is setup, but have not contact.php file

Thanks
Pastor

Joined: 11/28/2008
Form-to-Mail PHP ScriptThat

Form-to-Mail PHP Script

That should help you immensly. Also, don't forget to read This too.

If you have any questions, come back and ask them, we don't bite. /wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="wink.gif" />

Joined: 11/28/2008
here's mineYou'll just have

here's mine

You'll just have to change a few variables and such, and it should work fine.

Joined: 11/28/2008
Ok,got everything loaded.

Ok,

got everything loaded. seems to work. but when i receive the emails, i get nothing in the messages.

I get now subject matter, no contact or any message

??

Help Please

Thanks
Pastor

Joined: 11/28/2008
Did you change the variables

Did you change the variables to the names of your form fields?

Joined: 11/28/2008
yes i didHere is the

yes i did

Here is the code:

<?php

@extract($_POST);

$name = stripslashes($name);

$email = stripslashes($email);

$subject = stripslashes($subject);

$text = stripslashes($text);

mail('info@victorylifecenter.org',$subject,$text,"From: $name <$email>");

header("location:thanks.html");

?>

does that work

Joined: 11/28/2008
I just realized that the

I just realized that the version I just gave you for download was my old version, this one's more secure, and should work for you (I changed the email address though so you don't get a bunch of spam):

CODE
<?php

@extract($_POST);
$name = stripslashes($Name);
$email = stripslashes($Email);
$subject = stripslashes($Subject);
$message = stripslashes($Message);
$visitorip = $REMOTE_ADDR;

$text = "$name ($visitorip) has sent this message through victorylifecenter.org:

$message";

if(eregi("MIME-Version:",$text.$name.$email.$subject.$visitorip)){die('Get out, spammer.');}
if(eregi("Content-Type:",$text.$name.$email.$subject.$visitorip)){die('Get out, spammer.');}

if($name = " ") {die('Please fill out all form fields.');}
if($email = " ") {die('Please fill out all form fields.');}
if($subject = " ") {die('Please fill out all form fields.');}
if($message = " ") {die('Please fill out all form fields.');}
if($visitorip = " ") {die('error.');}

mail('info[at]victorylifecenter.org',$subject,$text,"From: $name <$email>");

header("location:thanks.html");

?>

Joined: 11/28/2008
still getting an error. when

still getting an error. when you fill out all forms and sent, it takes you to a page that says please fill out all forms

thanks
Pastor

Joined: 11/28/2008
CODE <?php@extract($_POST;$n
CODE
<?php

@extract($_POST);
$name = stripslashes($Name);
$email = stripslashes($Email);
$subject = stripslashes($Subject);
$message = stripslashes($Message);
$visitorip = $REMOTE_ADDR;

$text = "$name ($visitorip) has sent this message through victorylifecenter.org:

$message";

if(eregi("MIME-Version:",$text.$name.$email.$subject.$visitorip)){die('Get out, spammer.');}
if(eregi("Content-Type:",$text.$name.$email.$subject.$visitorip)){die('Get out, spammer.');}

mail('info[at]victorylifecenter.org',$subject,$text,"From: $name <$email>");

header("location:thanks.html");

?>

Try that, then post the email you get (something won't work right, I'm just not sure what part isn't going to work right).

Joined: 11/28/2008
Ok,The email was sent and i

Ok,

The email was sent and i received nothing in the email

No subject
no message
No email

Thanks
Pastor

Joined: 11/28/2008
That's bizarre. Anybody else

That's bizarre. Anybody else have a clue what's going on there?

Joined: 11/28/2008
Got it fixed. Thanks for the

Got it fixed.

Thanks for the help

Pastor