Jump to content

E_Gruber

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

E_Gruber's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Also... do I keep the script in it's own ".php" file, or should I incorporate it into the web-page?
  2. Not sure if I left code out... I'm not completely sure what I'm doing wrong. I'm using examples to create my own script... I may have missed something. As far as uploading it to the wrong directory, I have it in the root directory with the html page. Is that wrong?
  3. Hi, I posted this already on another thread but I'll start my own just incase... I have an html contact form that I'm trying to create a working php script for. I'm having a few difficulties... partly because I'm very new at this... well mostly because of that! When I try to submit the contact form I get this error... Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home8/zomglawl/public_html/ericgruber.net/mailer.php on line 9 Parse error: syntax error, unexpected T_IF in /home8/zomglawl/public_html/ericgruber.net/mailer.php on line 10 Please be gentle because this is all new to me... Here's the script... <?php if(isset($_POST["submit"])) { $to = "you@yourdomain.net"; $subject = "Contact from website"; $name_field = $_POST[ "name"]; $email_field = $_POST[ "email"]; $city_field = $_POST[ "city"]; $state_field = $_POST[ "state"]; $phone_field = $_POST[ "phone"]; $message = $_POST[ "message"]; $body = "From: $name_field \n E-Mail: $email_field \n City: $city_field \n State: $state_field \n Phone: $phone_field \n Message: Message: $message \n "; echo "Data has been submitted to $to!"; mail($to, $subject, $body); } else { echo "blarg!"; } ?> Here's my html form... <form method="post" action="mailer.php"> <table style="margin-bottom: 0pt;" cellspacing="0"> <tbody> <tr> <td width="150">Name<span class="required"> *</span></td> <td><input name="Name" type="text"></td> </tr> <tr> <td>Email<span class="required"> *</span></td> <td><input name="Email" type="text"></td> </tr> <tr> <td>City</td> <td><input name="City" type="text"></td> </tr> <tr> <td>State</td> <td><input name="State" type="text"></td> </tr> <tr> <td>Phone<span class="required"> *</span></td> <td><input name="Phone" size="12" maxlength="12" type="text"></td> </tr> <tr> <td>Comment<span class="required"> *<br> <br> <br> <br> <br> </span></td> <td><textarea name="Comment" cols="40" rows="6"></textarea></td> </tr> <tr> <td><input name="Submit" value="Submit" type="submit"></td> <td> </td> </tr> </tbody> </table> </form> Thank you...
  4. I made a couple of changes based on conrad's script... I still get an error when trying to submit the form. The error shows up as... Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home8/zomglawl/public_html/ericgruber.net/mailer.php on line 9 Parse error: syntax error, unexpected T_IF in /home8/zomglawl/public_html/ericgruber.net/mailer.php on line 10 Here's the script as of now. <?php if(isset($_POST["submit"])) { $to = "you@yourdomane.net"; $subject = "Contact from website"; $name_field = $_POST[ "name"]; $email_field = $_POST[ "email"]; $city_field = $_POST[ "city"]; $state_field = $_POST[ "state"]; $phone_field = $_POST[ "phone"]; $message = $_POST[ "message"]; $body = "From: $name_field \n E-Mail: $email_field \n City: $city_field \n State: $state_field \n Phone: $phone_field \n Message: Message: $message \n "; echo "Data has been submitted to $to!"; mail($to, $subject, $body); } else { echo "blarg!"; } ?> Thanks
  5. Hi... I have a similar problem. I have a form created in html but can't seem to get the php script to work. Please help... I'm new to this, so be gentle. Here's the html form, <form method="post" action="mailer.php"> <table style="margin-bottom: 0pt;" cellspacing="0"> <tbody> <tr> <td width="150">Name<span class="required"> *</span></td> <td><input name="Name" type="text"></td> </tr> <tr> <td>Email<span class="required"> *</span></td> <td><input name="Email" type="text"></td> </tr> <tr> <td>City</td> <td><input name="City" type="text"></td> </tr> <tr> <td>State</td> <td><input name="State" type="text"></td> </tr> <tr> <td>Phone<span class="required"> *</span></td> <td><input name="Phone" size="12" maxlength="12" type="text"></td> </tr> <tr> <td>Message<span class="required"> *<br> <br> <br> <br> <br> </span></td> <td><textarea name="Message" cols="40" rows="6"></textarea></td> </tr> <tr> <td><input name="Submit" value="Submit" type="submit"></td> <td> </td> </tr> </tbody> </table> </form> ...and the php <?php if(isset($_POST['submit'])) { $to = "you@yourdomain.net"; $subject = "Contact from website"; $name_field = $_POST['name']; $email_field = $_POST['email']; $city_field = $_POST['city']; $state_field = $_POST['state']; $phone_field = $_POST['phone']; $message = $_POST['message']; $body = "From: $name_field \n E-Mail: $email_field \n City: $city_field \n State: $state_field \n Phone: $phone_field \n Message: Message: \n $message"; echo "Data has been submitted to $to!"; mail($to, $subject, $body); } else { echo "blarg!"; } ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.