Jump to content

spoontard

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

spoontard's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thank you so much! However i changed the ereg to preg_match, caused errors so i changed it back and the same with :- <?php echo $PHP_SELF; ?> // should be $_SERVER['PHP_SELF']; So i left it to echo. But all is well and good so thanks for the help mate
  2. If you read under my code i gave a reason why it says blank So where it says "Blank" an email is in its place.. I just can't see why it would not be working :\
  3. It was on php4, so i switched it to php5. I then changed the code that you told me too and no luck so i changed it back to php4 and still no luck. Any more ideas? :\
  4. I am rather new too PHP and i found a email form for a website on another site and edited slightly to suit my needs better, however it will not send to the specified email, it redirects on the same page with an error. I just can't seem to figure out what is causing it Any help would be greatly appreciated! <html> <head> <title>BLANK</title> <link rel="stylesheet" href="style.css" type="text/css" media="screen" /> <?php // your name $recipientname = "BLANK"; // your email $recipientemail = "BLANK"; // subject of the email sent to you $subject = "Contact form for $recipientname"; // send an autoresponse to the user? $autoresponse = "yes"; // subject of autoresponse $autosubject = "Thank you for your message."; // autoresponse message $automessage = "We have received your message and will get back to you as soon as possible."; // thankyou displayed after the user clicks "submit" $thanks = "Thank you for contacting us.<br>We will get back to you as soon as possible.<br>"; ?> </head> <body> <div id="mainwrap"> <?php include("header.php"); ?> <?php include("leftnav.php"); ?> <div id="contentwrap"> <div id="breadcrumb"></div> <div id="content"> <h2>Still Under Development...</h2> <?php if($_POST['submitform']) { $Name = $HTTP_POST_VARS['Name']; $Email = $HTTP_POST_VARS['Email']; $Comments = $HTTP_POST_VARS['Comments']; // check required fields $dcheck = explode(",",$require); while(list($check) = each($dcheck)) { if(!$$dcheck[$check]) { $error .= "Missing $dcheck[$check]<br>"; } } // check email address if ((!ereg(".+\@.+\..+", $Email)) || (!ereg("^[a-zA-Z0-9_@.-]+$", $Email))){ $error .= "Invalid email address<br>";} // display errors if($error) { ?> <b>Error</b><br> <?php echo $error; ?><br> <a href="#" onClick="history.go(-1)">try again</a> <?php } else { $browser = $HTTP_USER_AGENT; $ip = $REMOTE_ADDR; // format message $message = "Online-Form Response for $recipientname: Name: $Name Email: $Email Comments: $Comments ----------------------------- Browser: $browser User IP: $ip"; // send mail and print success message mail($recipientemail,"$subject","$message","From: $Name <$Email>"); if($autoresponse == "yes") { $autosubject = stripslashes($autosubject); $automessage = stripslashes($automessage); mail($Email,"$autosubject","$automessage","From: $recipientname <$recipientemail>"); } echo "$thanks"; } } else { ?> <form name="contactform" action="<?php echo $PHP_SELF; ?>" method="post"> <input type="hidden" name="require" value="Name,Email,Comments"> <br> Name <br> <input name="Name" size="25"> <br> <br> E-mail<br> <input name="Email" size="25"> <br> <br> Comments<br> <textarea name="Comments" rows="5" cols="35"></textarea> <br> <br> <input type="submit" value="Submit" name="submitform"> <input type="reset" value="Reset" name="reset"> </p> <br> </form> <?php } ?> </div> </div> <?php include("footer.php"); ?> </div> </body> </html> This is the contactus.php page which is the main page with the form layout etc.(Email etc blanked out for my privacy) This is what it links to on the same page, i just can't seem to fix it no matter what i do ! Please help Thanks in advance!
×
×
  • 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.