Jump to content

websime

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

websime's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks! and how about a good book to pick up for first-time php guy. Only code experience I have is html and css at this point...
  2. okay here's some easy questions: 1. what is looool?? 2. Does anyone know if GoDaddy supports php? I am diggin thru my client's account and don't see it stated anywhere that they do. 3. They DO support asp. Can anyone point me to a site where I can get a simple asp mail script and learn more about it? thanks!
  3. Thanks to all 3 of you for your quick replies! I replaced that $success = mail($EmailTo, $Subject, $Body, "From: <".$Email.">"); and I changed the first error to error1.html... result: error2.html is triggered. as for echo'ing the 3 variables to make sure they are not empty...unfortunately I have no clue what that means! Care to enlighten me? html code is the same here is the new php <?php // get posted data into local variables $Email = Trim(stripslashes($_POST['Email'])); $EmailTo = "bentsime@gmail.com"; $Subject = "User Contact - Contact Page"; $Name = Trim(stripslashes($_POST['Name'])); $Phonenumber = Trim(stripslashes($_POST['Phonenumber'])); $Regarding = Trim(stripslashes($_POST['Regarding'])); $Comments = Trim(stripslashes($_POST['Comments'])); // validation $validationOK=true; if (Trim($Email)=="") $validationOK=false; if (Trim($Name)=="") $validationOK=false; if (Trim($Comments)=="") $validationOK=false; if (!$validationOK) { print "<meta http-equiv=\"refresh\" content=\"0;URL=../error1.html\">"; exit; } // prepare email body text $Body = ""; $Body .= "Name: "; $Body .= $Name; $Body .= "\n"; $Body .= "Phonenumber: "; $Body .= $Phonenumber; $Body .= "\n"; $Body .= "Regarding: "; $Body .= $Regarding; $Body .= "\n"; $Body .= "Comments: "; $Body .= $Comments; $Body .= "\n"; // send email $success = mail($EmailTo, $Subject, $Body, "From: <".$Email.">"); // redirect to success page if ($success){ print "<meta http-equiv=\"refresh\" content=\"0;URL=../thanks2.html\">"; } else{ print "<meta http-equiv=\"refresh\" content=\"0;URL=../error2.html\">"; } ?>
  4. Hey guys, The curious thing about this situation is that I am using virtually the same code (html, css, and php) on a contact form for another site and it works perfectly. For some reason, I can't seem to get it to work on this site: http://www.namastenutrition.net/form.htm The form loads fine and it is accessing the php file, but everytime I fill it out and click submit, it loads the error2.html page and does not email me the information. Any help would be most appreciated!!! HTML: <form id="myform" class="cssform" method="POST" action="php/contact.php"> <fieldset> <legend>To contact me, simply fill out this form!</legend> <p> <label for="user">Name</label> <input type="text" id="user" name="Name" value="" /> </p> <p> <label for="phonenumber">Phone Number:</label> <input type="text" id="phonenumber" name="Phonenumber" value="" /> </p> <p> <label for="emailaddress">Email Address:</label> <input type="text" id="emailaddress" name="Email" value="" /> </p> <p> <label for="regarding">Regarding:</label> <input type="text" id="regarding" name="Regarding" value="" /> </p> <p> <label for="comments">Questions or Comments:</label> <textarea id="comments" name="Comments" rows="5" cols="25"></textarea> </p> <div style="margin-left: 150px;"> <input type="submit" name="submit" value="Submit" class="submit"> <input type="reset" name="clear" value="Clear" class="clear"> </div> </fieldset> </form> PHP: <?php // get posted data into local variables $Email = Trim(stripslashes($_POST['Email'])); $EmailTo = "bentsime@gmail.com"; $Subject = "User Contact - Contact Page"; $Name = Trim(stripslashes($_POST['Name'])); $Phonenumber = Trim(stripslashes($_POST['Phonenumber'])); $Regarding = Trim(stripslashes($_POST['Regarding'])); $Comments = Trim(stripslashes($_POST['Comments'])); // validation $validationOK=true; if (Trim($Email)=="") $validationOK=false; if (Trim($Name)=="") $validationOK=false; if (Trim($Comments)=="") $validationOK=false; if (!$validationOK) { print "<meta http-equiv=\"refresh\" content=\"0;URL=../error2.html\">"; exit; } // prepare email body text $Body = ""; $Body .= "Name: "; $Body .= $Name; $Body .= "\n"; $Body .= "Phonenumber: "; $Body .= $Phonenumber; $Body .= "\n"; $Body .= "Regarding: "; $Body .= $Regarding; $Body .= "\n"; $Body .= "Comments: "; $Body .= $Comments; $Body .= "\n"; // send email $success = mail($EmailTo, $Subject, $Body, "From: <$Email>"); // redirect to success page if ($success){ print "<meta http-equiv=\"refresh\" content=\"0;URL=../thanks2.html\">"; } else{ print "<meta http-equiv=\"refresh\" content=\"0;URL=../error2.html\">"; } ?>
  5. Well, that advice got me looking into the issue thru the hosting CP and found a form mail .asp solution that go daddy offers, which did exactly what I was looking for and nothing more. This one is solved for now but I will be getting in touch via PM as soon as I can to discuss mailing lists! thanks to everyone for being helpful and kind.
  6. Hey jonahpup I went with your code setup and it pretty much worked great! Thanks. It seemed to take the info okay and it sent the 'success' message to the browser window. The only glitch is that it did not send the e-mail to me with the entered information! Do I need to do anything thru the hosting account? set up a database or anything? Thanks, also, can anyone tell me why I cannot send private messages??
  7. hey, first post here, not a phpfreak, just getting me toes wet =] so, I want to accomplish a simple thing here... http://www.namastenutrition.net/mock.html That is just a jpg of the site I am coding, but you can see the field on the left side I am working with. This is what I am trying to do: 1. User enters their email address 2. User clicks Sign Up! 3. User is sent to index_thanks.html 4. Users e-mail address is emailed to my e-mail address. I know this is realllly simple, I have implemented a contact.php page successfully, but when I try to edit it down, I get errors. If anyone can help me out here, it would be most appreciated!!! Thanks, sime
×
×
  • 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.