Jump to content

vickyjackson

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

vickyjackson's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi, Have created a php form to send contact information from my website - the form is sent by email which is recieved instantly but I then get an error (404) saying contact_form.php cannot be found. (This is the page with the php code to send the email which is working. ) the code can be seen below. <?php ... $sent = mail($myemail, $subject, $forminfo, "From: <$email>"); if($sent) { header("Location: [a href=\"http://www.something.co.uk/thankyou.php?name=$_POST\" target=\"_blank\"]http://www.something.co.uk/thankyou.php?name=$_POST[/a][name]"); } else { echo 'Sorry, your message could not be sent at this time. Please try again or email us directly.'; } ?> It is not redirecting to the page I ask it to!! Please help - taken me a long time to get this form working as my hosting company had me on a server which didn't support it!! Thanks, Vicky
  2. Hi, I'm really having problems with my form - I've been trying to get this to work for hours & hours & can't work out what is wrong with it. Below I have pasted the form code & the php code. When the form is submitted I can't see any mention at the bottom of the window to mail, just straight away says finding page 'thankyou.php'. Thankyou page loads with the 'name' element which I added to the URL. If anyone can shed any light on this I would appreciate it soo much. Thanks, Vicky <FORM CODE> <form name="form1" method="post" action="Contactform.php"> <table width="95%" border="0" align="center" cellpadding="1" cellspacing="1"> <tr> <td width="34%"><font face="Arial, Helvetica, sans-serif">Name:</font></td> <td width="66%"><font face="Arial, Helvetica, sans-serif"> <input name="name" type="text" id="name" size="40" maxlength="40"> </font></td> </tr> <tr> <td> <p><font face="Arial, Helvetica, sans-serif">E-Mail:</font></p></td> <td><font face="Arial, Helvetica, sans-serif"> <input name="email" type="text" id="email" size="40" maxlength="40"> </font></td> </tr> <tr> <td><font face="Arial, Helvetica, sans-serif">Phone:</font></td> <td><input name="phone" type="text" id="phone" size="30" maxlength="30"></td> </tr> <tr> <td><font face="Arial, Helvetica, sans-serif">Address:</font></td> <td><textarea name="address" cols="30" rows="4" id="address"></textarea></td> </tr> <tr> <td><font face="Arial, Helvetica, sans-serif">I am interested in: </font></td> <td><select name="option" id="option"> <option value="Unsure">I'm Not Sure</option> <option value="Mini Package">Mini</option> <option value="Standard Package">Standard</option> <option value="Advanced Package">Advanced</option> </select></td> </tr> <tr> <td><font face="Arial, Helvetica, sans-serif">Message:</font></td> <td><font face="Arial, Helvetica, sans-serif"> <textarea name="com" cols="40" rows="8" id="com"></textarea> </font></td> </tr> <tr> <td><font face="Arial, Helvetica, sans-serif">&nbsp;</font></td> <td><font face="Arial, Helvetica, sans-serif"> <input name="Submit" type="submit" id="Submit" value="Submit"> <input name="Reset" type="reset" id="Reset" value="Reset"> </font></td> </tr> </table> <p>&nbsp;</p> <p>&nbsp;</p> </form> PHP_____________________________________________________________________________________ <? $name = $_POST["name"]; $email = $_POST["email"]; $phone = $_POST["phone"]; $address = $_POST["address"]; $site = $_POST["site"]; $com = $_POST["com"]; $today = date("d, M Y"); $recipient = "vicky@something.co.uk"; $subject = "Enquiry from the Website"; $forminfo ="Name: $name\nEmail: $email\nPhone: $phone\nAddress: $address\nInterested in: $site\nMessage: $com\nForm Submitted: $today\n\n"; $sent = mail($recipient, $subject, $forminfo, "From: $email"); if($sent) { header("Location: [a href=\"http://www.something.co.uk/thankyou.php?name=$_POST\" target=\"_blank\"]http://www.something.co.uk/thankyou.php?name=$_POST[/a][name]");} else { echo 'Sorry, your message could not be sent at this time. Please try again or email us directly.'; } ?>
  3. I added the code at the end of the php but before the end tag - but no errors were displayed. Any other ideas?? Just really frustrating - been on this for hours! Thanks so much, Vicky Sorry - misread that - been looking at the screen too long. Have put it at the start of the code but still no luck - is it still meant to be within the php tag? Thanks
  4. Hi, having some real problems here & I can't seem to fix it. I'm really new to this & just need a simple form but can't get it to work! I've created a form with the action set to "contactform.php" which is where the following code is... php: -------------------------------------------------------------------------------- <? $name = $_POST["name"]; $email = $_POST["email"]; $phone = $_POST["phone"]; $address = $_POST["address"]; $package = $_POST["package"]; $comments = $_POST["comments"]; $today = date("d, M Y"); $recipient = "vicky@something.co.uk"; $subject = "Enquiry from the Website"; $forminfo = "Name: $name\n Email: $email\n Phone: $phone\n Address: $address\n Interested in: $package\n Message: $comments\n Form Submitted: $today\n\n"; mail("vicky@something.co.uk", "Contact from Website", $forminfo, "From: $email"); header("Location: [a href=\"http://www.something.co.uk/thankyou.php?name=$_POST\" target=\"_blank\"]http://www.something.co.uk/thankyou.php?name=$_POST[/a][name]"); ?> -------------------------------------------------------------------------------- Then I have thankyou page set up to display the text.. "thankyou (name) your info has been submitted etc. The thankyou page is working, with the name displaying correctly but no emails are coming through. I have tried a different email address but still no luck. The 'thankyou' and 'contactform' are both php pages but the page with the initial form on is not - does this matter? I have checked that all the form textboxes etc match upto the names set in the php - don't know what else to try. If anyone could help I would appreciate it sooo much. Thanks, Vicky
×
×
  • 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.