Does anybody know about PHP?

Jenny
Rank: Apatite

Joined: 08/09/2004
Points: 695

Just thought I'd post this on the off-chance that anyone can help..... (possibly Jon, since GeologyRocks is done in php Winking )

I'm trying to get a feedback for to work using php, but it's not working The page displays fine, it appears to work and goes to the success page I created, but the email never arrives in my inbox.

If anyone is interested (and might be able to help) I can post the code I use...

Thanks

~Jenny~

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

Rainbow Stitching Club - why not pop in for a visit?
---
Archerfish - get paid for clicking your mouse!

User info:
Submitted by Jenny on Fri, 01/05/2007 - 20:52.
javi_geo
Rank: Calcite

Joined: 20/04/2005
Points: 240

Hi Jenny,

I´m working with php nuke. So, Tell me exactly what do you need, and I´ll try to help you.

Javi.

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

Lucky man whose destiny is to know the Earth´s secrets. Eurípides (480-405)

User info:
Fri, 01/05/2007 - 20:56
Jon
Rank: Topaz

Joined: 18/12/2006
Points: 2977

Go ahead and post the code, Jenny (or email to me). I've been staring at php code all day, so I might leave it until tomorrow Winking

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

Geologists are gneiss!!

User info:
Fri, 01/05/2007 - 23:56
Jenny
Rank: Apatite

Joined: 08/09/2004
Points: 695

The form 'seems' to work fine and goes to the success page like it should, but I never receive the emails....

Here's the script I'm using (in a file named 'sendmail.php'):

<br />
<?  $email = $_REQUEST['email'] ;<br />
  $message = $_REQUEST['message'] ;<br />
  $name = $_REQUEST['name'] ;</p>
<p>  mail( "[email protected]", "Feedback Query",<br />
    $message, "From: $name <$email>" );<br />
  header( "Location: http://www.yourdomain.com/success.php" );<br />
?>

and here's the form:

<form method="post" action="sendmail.php"><br />
<table cellpadding=5><br />
<tr><br />
<td><br />
<p align="left"><br />
  Name:<br />
</td><br />
<td><br />
<input name="name" type="text" size="33"<br />
   maxlength="256" /><br /><br />
</td><br />
</tr></p>
<p><tr><br />
<td><br />
<p align="left"><br />
  Email:<br />
</td><br />
<td><br />
<input name="email" type="text" size="33"<br />
   maxlength="256" /><br /><br />
</td><br />
</tr><br />
<tr><br />
<td><br />
  Message:<br />
</td><br />
<td><br />
  <textarea name="message" rows="5" cols="30"><br />
  </textarea><br /><br />
</td><br />
</tr><br />
</table></p>
<p><p align="center"><br />
<input type="submit" name="Submit"<br />
   value="Submit this message"><br />
<input type="reset" name="Reset" value="Reset this form"></p>
<p></form>

As I said, I've updated all the fields with my email address and necessary webpages, but it just doesn't work

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

Rainbow Stitching Club - why not pop in for a visit?
---
Archerfish - get paid for clicking your mouse!

User info:
Sat, 01/06/2007 - 10:40
Jon
Rank: Topaz

Joined: 18/12/2006
Points: 2977

The code looks fine to me. I can't see any immediate problems (that would cause this not to work).

Causes:

o Your host has not configured smtp correctly
o The mail is getting thrown in the spam pit by your isp or your email client
o Typo in the email address Winking

I have to say that this script is not the best script I've seen (I do recognise it from various "Write your first php script webpages though Winking). The email address is not checked so could be anything (including email headers to send bulk, i.e. spam, email). It would be a lot easier to debug if instead of calling another page (success.php) the script was in that page and the form called success.php: that way you could print out what was being put in the mail form. Also, the return value from mail isn't checked (it returns TRUE or FALSE), letting you know if the mail was actually sent. Try this for starters:

</p>
<p>  $email = $_REQUEST['email'] ;<br />
  $message = $_REQUEST['message'] ;<br />
  $name = $_REQUEST['name'] ;</p>
<p>  if(mail( "[email protected]", "Feedback Query",<br />
    $message, "From: $name <email>" )){<br />
       header( "Location: http://www.yourdomain.com/success.php" );<br />
  } else {<br />
     print("Ooops!\n");<br />
  }</p>
<p>

This'll tell you if the email was sent or not...

Hope this helps a bit Smiling face

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

Geologists are gneiss!!

User info:
Sat, 01/06/2007 - 11:00
javi_geo
Rank: Calcite

Joined: 20/04/2005
Points: 240

Hi Jenny,

Your code is Ok, so...

do you have a free server or paid for....?

Some free servers have the e-mail option released. In that case, you should look for another one.

Tell me about that.

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

Lucky man whose destiny is to know the Earth´s secrets. Eurípides (480-405)

User info:
Mon, 01/08/2007 - 15:14

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.