Welcome Guest!

If you do not have an account yet on The Web Squeeze forums, please Register! It’s FREE and there are many benefits:

  • Receive Fast Advice
  • Learn Programming Languages
  • Get Professional Website Reviews
  • Quick Troubleshooting Assistance

> My Php Contact Form Wont Work!

This is a discussion on My Php Contact Form Wont Work!, within the PHP section. This forum and the thread "My Php Contact Form Wont Work!" are both part of the Programming Your Website category.

 
Reply to this topicStart new topic
> My Php Contact Form Wont Work!, i know nothing about php at all!
Bruno
post Jun 27 2008, 11:27 AM
Post #1


Rapid Squeezer
****

Group: Members
Posts: 126
Joined: 14-February 08
From: Northampton, England
Member No.: 117



i found this tutorial on google for a php contact for and it basicly just gave me the code so me being me thought " HAPPY DAYS NO WORK FOR ME! " oh how i was wrong! sad.gif i cant get it to work and i dont know why. all of the tuorials iv tryed havn't worked so its gotta be me doing somthing wrong.

can anyone point out what im doing wrong please ?

links:

http://www.bruno89.co.uk/contact.html
http://www.bruno89.co.uk/mail.php

theres the codes i have.

thanks people i realy should learn this huh lol
dave,


--------------------
Thanks,
Dave.
---------------------------------
My Portfolio....:: bruno89.co.uk (60% finished)
Information.....:: Available for work
---------------------------------
Go to the top of the page
 
+Quote Post
Bruno
post Jun 27 2008, 11:32 AM
Post #2


Rapid Squeezer
****

Group: Members
Posts: 126
Joined: 14-February 08
From: Northampton, England
Member No.: 117



this is were i got it from by the way:

http://www.tutorialguide.net/php_contact_form_tutorial.html


--------------------
Thanks,
Dave.
---------------------------------
My Portfolio....:: bruno89.co.uk (60% finished)
Information.....:: Available for work
---------------------------------
Go to the top of the page
 
+Quote Post
Justify
post Jun 27 2008, 12:23 PM
Post #3


Squeezing
***

Group: Members
Posts: 88
Joined: 14-February 08
Member No.: 76



Can you post your php in code boxes please, i can't see the code from the link.

Will check the tutorial for the moment
Go to the top of the page
 
+Quote Post
Bruno
post Jun 27 2008, 01:44 PM
Post #4


Rapid Squeezer
****

Group: Members
Posts: 126
Joined: 14-February 08
From: Northampton, England
Member No.: 117



ok here it is

CODE
"<?php

$youremail = "dave@bruno89.co.uk";

$subject = "Bruno89.co.uk Contact Form";

$thankyou = "contact.html";

;if($email == ""){
?>
No email address added. Please go back.<br/>
"<?php
;}elseif($name == ""){
"?>
No name added. Please go back.<br/>
<?php
;}elseif($message == ""){
"?>
No message added. Please go back.<br/>
"<?php
;}else{

$msg = ereg_replace("\\\'", "'", $message);
$msg = ereg_replace('\\\"', "\"", $msg);
$message1 = "from: $name\nemail: $email\nmessage:\n$msg1";

mail($youremail, $subject, $msg, "From: $email\r\nReply-to: $email\r\n");
?>
<meta http-equiv="refresh" content="0; url=<?echo $thankyou;?>"">
"<?php
}
"?>


--------------------
Thanks,
Dave.
---------------------------------
My Portfolio....:: bruno89.co.uk (60% finished)
Information.....:: Available for work
---------------------------------
Go to the top of the page
 
+Quote Post
Bruno
post Jun 27 2008, 03:20 PM
Post #5


Rapid Squeezer
****

Group: Members
Posts: 126
Joined: 14-February 08
From: Northampton, England
Member No.: 117



im getting reli anoyed with this now sad.gif anyone know any tutorials that work ?


--------------------
Thanks,
Dave.
---------------------------------
My Portfolio....:: bruno89.co.uk (60% finished)
Information.....:: Available for work
---------------------------------
Go to the top of the page
 
+Quote Post
velo
post Jun 27 2008, 04:23 PM
Post #6


Rapid Squeezer
****

Group: Members
Posts: 158
Joined: 19-February 08
From: Netherlands
Member No.: 172



What's up with all the " and ; in beginning of some lines? Like

CODE
"<?php
}
"?>

Maybe i'm missing something obvious, but it doesn't look good.
CODE
<?php
}
?>


edit:
I think that is your problem, since error message is
QUOTE
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/bruno/public_html/mail.php on line 18


Try this maybe (haven't checked the rest for errors):
CODE
<?php

$youremail = "dave@bruno89.co.uk";

$subject = "Bruno89.co.uk Contact Form";

$thankyou = "contact.html";

if($email == ""){
?>
No email address added. Please go back.<br/>
<?php
}elseif($name == ""){
?>
No name added. Please go back.<br/>
<?php
}elseif($message == ""){
?>
No message added. Please go back.<br/>
<?php
}else{

$msg = ereg_replace("\\\'", "'", $message);
$msg = ereg_replace('\\\"', "\"", $msg);
$message1 = "from: $name\nemail: $email\nmessage:\n$msg1";

mail($youremail, $subject, $msg, "From: $email\r\nReply-to: $email\r\n");
?>
<meta http-equiv="refresh" content="0; url=<?echo $thankyou;?>">
<?php
}
?>


This post has been edited by velo: Jun 27 2008, 04:25 PM


--------------------

fresh-style.nl - small webdesign & development projects
Go to the top of the page
 
+Quote Post
Bruno
post Jun 28 2008, 05:15 AM
Post #7


Rapid Squeezer
****

Group: Members
Posts: 126
Joined: 14-February 08
From: Northampton, England
Member No.: 117



hey thanks ill give it a try if it doesn't work ill tell ya smile.gif

thanks

dave.


--------------------
Thanks,
Dave.
---------------------------------
My Portfolio....:: bruno89.co.uk (60% finished)
Information.....:: Available for work
---------------------------------
Go to the top of the page
 
+Quote Post
Bruno
post Jun 28 2008, 05:17 AM
Post #8


Rapid Squeezer
****

Group: Members
Posts: 126
Joined: 14-February 08
From: Northampton, England
Member No.: 117



ok i tryed that and now it wont leme cos its keeps saying that i havn't added an email address :S even tho i have. any tips?

thanks agen,

dave.


--------------------
Thanks,
Dave.
---------------------------------
My Portfolio....:: bruno89.co.uk (60% finished)
Information.....:: Available for work
---------------------------------
Go to the top of the page
 
+Quote Post
velo
post Jun 28 2008, 05:48 AM
Post #9


Rapid Squeezer
****

Group: Members
Posts: 158
Joined: 19-February 08
From: Netherlands
Member No.: 172



That's not so weird. You are checking if name, email and message are empty, but you don't retreive these variables from the form.
Add in the top (under <?php ):

CODE
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];


Haven't checked out the example site, but the php seems very incomplete.


--------------------

fresh-style.nl - small webdesign & development projects
Go to the top of the page
 
+Quote Post
Bruno
post Jun 28 2008, 05:55 AM
Post #10


Rapid Squeezer
****

Group: Members
Posts: 126
Joined: 14-February 08
From: Northampton, England
Member No.: 117



WOOO! thank you sooooooooooooooooooooo much. OH MY GOD IM HAPPY ONCE AGEN! biggrin.gif thank you! biggrin.gif


--------------------
Thanks,
Dave.
---------------------------------
My Portfolio....:: bruno89.co.uk (60% finished)
Information.....:: Available for work
---------------------------------
Go to the top of the page
 
+Quote Post
velo
post Jul 2 2008, 01:34 PM
Post #11


Rapid Squeezer
****

Group: Members
Posts: 158
Joined: 19-February 08
From: Netherlands
Member No.: 172



Hehe you're welcome. wink.gif


--------------------

fresh-style.nl - small webdesign & development projects
Go to the top of the page
 
+Quote Post
If you found The Web Squeeze to be helpful, please donate so we can keep this site FREE, FRESH, and fortified with Web Design & Development info!
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Collapse

> Similar Topics

    Topic Title Replies Topic Starter Views Last Action
No New Posts   12 gribble 260 19th February 2008 - 05:49 AM
Last post by: welshstew
No New Posts 12 xkatx21x 341 28th February 2008 - 11:41 PM
Last post by: Rakuli
No New Posts   4 thesealportalteam 153 20th February 2008 - 09:00 AM
Last post by: thesealportalteam
No new   14 902 242 22nd February 2008 - 02:45 AM
Last post by: c010depunkk
No New Posts   5 thesealportalteam 122 22nd February 2008 - 11:48 PM
Last post by: Monie