Jump to content
xisto Community
pbrugge

Php Mail Script Wont Work :(

Recommended Posts

My script wont work and I cant figure out where I did go wrong

The form looks like this:

[/br]<form name="member-request" action="index.php?page=request" method="post">[br] 	 <p><b>Gender:</b></p>[/br] 	 <ul>[br] 	 <input type="radio" name="gen" value="1" />Male[/br] 	 <input type="radio" name="gen" value="2" />Female[br] 	 </ul>[/br] 	 <p><b>Your Name:</b></p>[br]    <p><input type="text" size="40" name="name"  class="forminput"></p>[/br] 	 <p><b>Hotmail:</b></p>[br]    <p><input type="text" size="40" name="email" class="forminput"></p>[/br] 	 <p><b>small word about yourself:</b></p>[br]    <p><textarea rows="6" cols="40" name="message" class="forminput"></textarea></p>[/br] 	 <p><b>what do you like about worms?:</b></p>[br]    <p><textarea rows="6" cols="40" name="worms" class="forminput"></textarea></p>[/br] 	 <p><input type="submit" name="submit" value="Submit" style="cursor:pointer"> <input type="reset" name="reset" value="Clear" style="cursor:pointer"></p>[br]          </form>[/br]

"index.php?page=request" point to mail.php which is set in the index.php

[br]case "request":[/br]include('mail.php');[br]      break;[/br]

I have done so because that way the layout stays the same.

My mail.php looks like this:

[br]<div id="contentContainer">[/br]  <div class="cont">[br] 	 <div class="contsection">*****</div>[/br] 	 <div class="conthead">[br]    <h1>Will you get wormed today?</h1>[/br] 	 </div>[br] 	 <?php>[/br]    $formsent=mail("request@wormsparty.info", "request form", "Request from: $name \r\ngender $gen [br]    \r\nabout self: $message \r\nabout worms: $worms" "From: $email\r\nbounce-to:request@wormsparty.info");[br][/br]   	 if($formsent==1)[/br]      {[br]      echo "<p>Hello, $name. We have recieved your request/question. We will get back to you as fast as we can,<br />[/br]      Best regards WormsParty.info team</p>";[br]      }[/br]   	 else[br]      {[/br]      echo "<p>I am sorry, $name. We did not recieve your request/question. Please try again or use the mail address on the contact page</p>";[br]      }[/br]    </?>[br]  </div>[/br]</div>

It does nothing at all, the mail is not send and I dont get a error or what so ever, the content of the page ( mail.php) stays blank <_<

please help me figure this out...

thx

Share this post


Link to post
Share on other sites

I assume that it's a copy/paste error, but

form name="member-request" action="index.php?page=request" method="post">

needs to have a "<" in front of it, like this:

<form name="member-request" action="index.php?page=request" method="post">

I doubt that's it, but who knows...

Share this post


Link to post
Share on other sites
<div id="contentContainer">[br] <div class="cont">[/br]  <div class="contsection">*****</div>[br]  <div class="conthead">[/br]   <h1>Will you get wormed today?</h1>[br]  </div>[/br]  <?php[br]   $formsent=mail("request@wormsparty.info", "request form", "Request from: $name\r\n[/br]gender $gen\r\n[br]about self: $message\r\n[/br]about worms: $worms\r\n[br]From: $email\r\nbounce-to:request@wormsparty.info");[/br][br]    if($formsent == 1)[/br]     { echo "<p>Hello, $name. We have recieved your request/question. We will get back to you as fast as we can,<br />[br]     Best regards WormsParty.info team</p>"; }[/br]    else {[br]     echo "<p>I am sorry, $name. We did not recieve your request/question. Please try again or use the mail address on the contact page</p>";[/br]     }[br]   </?php>[/br] </div>[br]
[/br]
This should work, according to my crash course in php. I plan to piggyback off this and make a script. Although first... need to learn mysql.. *cries*

Chances are one reason is didn't work is because programming is piggy when you use
if($VAR==$VAR2)
I know for a fact it will reguard it as an invalid syntax (just like in mIRC.)

So be sure to parse correctly and use
if($VAR == $VAR2)

<_<

Share this post


Link to post
Share on other sites

LOL never mind I been stuppid myself...

Just overlooked the code and went "what the *BLEEP* is wrong here" and finaly I see it

[br]<?php> ....... </?>[/br]

Should be

[br]<?php ....... ?>[/br]

How dumb <_< , I cant think of a excuse why I did not see it before but its fine since it is working now :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | 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.