Welcome Guest!
Please login
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.
![]() ![]() |
Jun 27 2008, 11:27 AM
Post
#1
|
|
|
Rapid Squeezer ![]() ![]() ![]() ![]() Group: Members Posts: 146 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!
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 --------------------------------- |
|
|
Jun 27 2008, 11:32 AM
Post
#2
|
|
|
Rapid Squeezer ![]() ![]() ![]() ![]() Group: Members Posts: 146 Joined: 14-February 08 From: Northampton, England Member No.: 117 |
-------------------- Thanks, ---------------------------------Dave. My Portfolio....:: bruno89.co.uk (60% finished) Information.....:: Available for work --------------------------------- |
|
|
Jun 27 2008, 12:23 PM
Post
#3
|
|
|
Squeezing ![]() ![]() ![]() Group: Members Posts: 96 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 |
|
|
Jun 27 2008, 01:44 PM
Post
#4
|
|
|
Rapid Squeezer ![]() ![]() ![]() ![]() Group: Members Posts: 146 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 --------------------------------- |
|
|
Jun 27 2008, 03:20 PM
Post
#5
|
|
|
Rapid Squeezer ![]() ![]() ![]() ![]() Group: Members Posts: 146 Joined: 14-February 08 From: Northampton, England Member No.: 117 |
im getting reli anoyed with this now
-------------------- Thanks, ---------------------------------Dave. My Portfolio....:: bruno89.co.uk (60% finished) Information.....:: Available for work --------------------------------- |
|
|
Jun 27 2008, 04:23 PM
Post
#6
|
|
![]() Rapid Squeezer ![]() ![]() ![]() ![]() Group: Members Posts: 182 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 |
|
|
Jun 28 2008, 05:15 AM
Post
#7
|
|
|
Rapid Squeezer ![]() ![]() ![]() ![]() Group: Members Posts: 146 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
thanks dave. -------------------- Thanks, ---------------------------------Dave. My Portfolio....:: bruno89.co.uk (60% finished) Information.....:: Available for work --------------------------------- |
|
|
Jun 28 2008, 05:17 AM
Post
#8
|
|
|
Rapid Squeezer ![]() ![]() ![]() ![]() Group: Members Posts: 146 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 --------------------------------- |
|
|
Jun 28 2008, 05:48 AM
Post
#9
|
|
![]() Rapid Squeezer ![]() ![]() ![]() ![]() Group: Members Posts: 182 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 |
|
|
Jun 28 2008, 05:55 AM
Post
#10
|
|
|
Rapid Squeezer ![]() ![]() ![]() ![]() Group: Members Posts: 146 Joined: 14-February 08 From: Northampton, England Member No.: 117 |
WOOO! thank you sooooooooooooooooooooo much. OH MY GOD IM HAPPY ONCE AGEN!
-------------------- Thanks, ---------------------------------Dave. My Portfolio....:: bruno89.co.uk (60% finished) Information.....:: Available for work --------------------------------- |
|
|
Jul 2 2008, 01:34 PM
Post
#11
|
|
![]() Rapid Squeezer ![]() ![]() ![]() ![]() Group: Members Posts: 182 Joined: 19-February 08 From: Netherlands Member No.: 172 |
Hehe you're welcome.
-------------------- fresh-style.nl - small webdesign & development projects |
|
|
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!
![]() ![]() |
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
Similar Topics
| Topic Title | Replies | Topic Starter | Views | Last Action | |||
|---|---|---|---|---|---|---|---|
![]() |
12 | gribble | 428 | 19th February 2008 - 05:49 AM Last post by: welshstew |
|||
![]() |
12 | xkatx21x | 532 | 28th February 2008 - 11:41 PM Last post by: Rakuli |
|||
![]() |
4 | thesealportalteam | 352 | 20th February 2008 - 09:00 AM Last post by: thesealportalteam |
|||
![]() |
14 | 902 | 479 | 22nd February 2008 - 02:45 AM Last post by: c010depunkk |
|||
![]() |
5 | thesealportalteam | 250 | 22nd February 2008 - 11:48 PM Last post by: Monie |
|||






Jun 27 2008, 11:27 AM







