Author Topic: NEED PHP HELP PLEASSSSEEEE  (Read 561 times)

Offline LuLuLu

  • Member
  • Posts: 16
NEED PHP HELP PLEASSSSEEEE
« on: September 13, 2009, 09:39:19 PM »
P.S.
i can't do /server irc.rizon.net? it keeps reconnecting @_@
changed servers lol irc.lolipower.org ftw

___________________ ___________
I need a php mail script, this is what I have so far but it's not sending properly

mail.html
Code: [Select]
<html>
<head><title>Contact Us</title></head>
<body>
<form action="mail.php" method="POST">

<p><b>Subject</b><br>
<input type="text" name="subject" size=40>

<p><b>Phone #</b><br>
<input type="text" name="phone" size=20>

<p><b>Message</b><br>
<textarea cols=40 rows=10 name="message"></textarea>

<p><input type="submit" value=" Send ">
</form>
</body>
</html>

mail.php
Code: [Select]
<?php

$email = 'lululu@friedshrimp.com';
$subject = $HTTP_POST_VARS['subject'];
$message = $http_post_vars['phone'];
$message = $http_post_vars['message'];


if (!preg_match("/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/", $email)) {
  echo "<h4>Invalid email address</h4>";
  echo "<a href='javascript:history.back(1);'>Back</a>";
} elseif ($subject == "") {
  echo "<h4>No subject</h4>";
  echo "<a href='javascript:history.back(1);'>Back</a>";
}


elseif (mail($email,$subject,$message)) {
  echo "<h4>Thank you for sending email</h4>";
} else {
  echo "<h4>Can't send email to $email</h4>";
}
?>

I want the text in the Phone field to be sent along with the message field.  I can only get the message fiend to send properly or nothing at all.  How do I link the phone field :(

help pls thanks!!
« Last Edit: September 13, 2009, 10:00:28 PM by LuLuLu »

Offline LuLuLu

  • Member
  • Posts: 16
Re: NEED PHP HELP PLEASSSSEEEE
« Reply #1 on: September 14, 2009, 12:34:45 AM »
trial and error ftw lolz

$email = 'lululu@friedshrmip.com';
$subject = $HTTP_POST_VARS['subject'];
$phone = $HTTP_POST_VARS['phone'];
$content = $HTTP_POST_VARS['content'];
$message = $phone.' '.$content;

[solved]