FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


please could someone help me with this php code





silverpersian888
Can someone please tell me why this does not work ?



<?php

$formcontent = $_POST['name'] . ' would like some information.' . chr(10) . chr(13);
$formcontent .= 'their email is : ' . $_POST['email'] . chr(22) . chr(24);

$formcontent .= ' Here is their Question : ' . $_POST['Question'] . chr(20) . chr(30) ;

$recipient = 'silverpersian888@yahoo.co.uk';
$subject = 'Website Form 2';

mail($recipient, $subject, $formcontent) or die('An error occurred while trying to send your e-mail, please notify Jo.');

echo "Thank You!";
?>
<body style="background-color:pink">
<p style="text-align:center;color:black">Thank you
Your Question has been sent.

<a href="index.html"><b style="color:black">click here to return to the Tooth Fairy homepage[/url]</p>
</body>
jmraker
Without knowing what doesn't work:

Is there a form that has a <form action="that_page.php" method="post"> and has fields with those names?

If you call that page any other way all of those $_POST variables would not exist and nothing concatenated for them.

I've had the mail function not work with no errors or warnings. If it isn't sending mail at all, try a really simple call to mail to a few email addresses like

Code:
<?php
var_dump(mail('silverpersian888@yahoo.co.uk', 'Test', 'Testing'));
var_dump(mail('another@gmail.com', 'Test', 'Testing'));
var_dump(mail('testmail@mailinator.com, ', 'Test', 'Testing'));
?>


If none of them show up, you'll probably need to check the mail server's logs to see what happened to them.

The mailinator.com address is a handy public access email address. Mail with any username @ mailinator.com and goto the site and enter the username you used to view all of it's recent mail.
belltown
Your code worked fine when I copied it to my server and changed $recipient to the address of my own gmail account.

I've just tried sending a message to your Yahoo account. If it doesn't come through it may be because the e-mail is being blocked by Yahoo for some reason. If so try sending a message to a different (non-Yahoo) account and see if that works.
belltown
Do you even have a hosting account here? I see that you only have 1 post and 5 points. You can't send e-mails from here, or run any kind of scripts for that matter without an active account.
sonam
I am post one tutorial here:
http://www.frihost.com/users/sonam/blog/vp-83950.html

Maybe it will help you little bit.

Sonam
Related topics
Can someone help me ? Com domain setup?
Show PHP Code
CAN SOMEONE HELP? I DON'T UN DERSTAND HOW TO UPLOAD WEBSITE!
Cash Mod
setup.php
Need help with site getting error on http://validator.w3.org
mySQL Query/PHP code - get the highest value...
CSS for making images go through a php code.
VERY URGENT! Please Help Me!
What is a good or bad php code?
I want PHP Code to ......
[HELP] PHP (and some MyBB) Administration
Session directory permissions issue
Help With Simple PHP Code Snipit
i am having problems with this php code.... can someone help
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.