Jump to content

tezzo

New Members
  • Posts

    8
  • Joined

  • Last visited

tezzo's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. hey...thank you so much for your reply...you are a genius.....(Sorry for late comment)... I am stuck again.... on submitting the form......i want to show the error and successful message on the same page.....by hiding the contact form..... e.g Feedback form on the homepage of http://www.flipkart.com/ (Don't worry about the animation)
  2. can u tell me how can i add BCC in the above script......i tried a few ways...like 1) $headers .= "\r\nBcc: her@$herdomain\r\n\r\n"; 2) $email_bcc = "xyz@abc.com"; (top half after $email_to and then adding it at the bottom half 'Bcc: '$email_bcc."\r\n" . after 'Reply-To: '.$email."\r\n" .) I am getting syntax error for 2nd method. Not able to understand whats wrong
  3. i want to insert validations for radio buttons in the above form........(I tried many scripts but no luck) below is my html code <form> <input type="radio" name="txtRadio" value="Purchase"> Purchase <input type="radio" name="txtRadio" value="Sell"> Sell </form>
  4. i want to insert code for file upload..........i don't want the validation....just the code
  5. heyy...gr8....its working....i was evn inserting the disclaimer in the codes above set of codes....hence it was not working...problem 2 solved .....but 1 remains
  6. well....Client wants the disclaimer also in the email....i dont want at the end of it........it is the middle.....but this is not the script fot that......i just have to edit the textfield name....i dont know what code should i put in my script
  7. i am unable to understand where to insert the code...in php i only know how to replace the existing textfield names with my textfields name and email id...so you can imagine my knowledge in php.......would you please show to where do i add the code.....Sorry for troubles
  8. <?php if(isset($_POST['txtEmail'])) { // EDIT THE 2 LINES BELOW AS REQUIRED $email_to = "xyz@abc.com"; $email_subject = "Subject"; $email_from = "abc@xyz.com"; function died($error) { // your error code can go here echo "We are very sorry, but there were error(s) found with the form you submitted. "; echo "These errors appear below."; echo $error."<br /><br />"; echo "Please go back and fix these errors.<br /><br />"; die(); } // validation expected data exists if(!isset($_POST['txtName']) || !isset($_POST['txtEmail']) || !isset($_POST['txtAddress']) || !isset($_POST['txtContact']) || !isset($_POST['txtUpload'])) { died('We are sorry, but there appears to be a problem with the form you submitted.'); } $name = $_POST['txtName']; // required $email = $_POST['txtEmail']; // required $address = $_POST['txtAddress']; // required $contact = $_POST['txtContact']; // not required $upload = $_POST['txtUpload']; // required $email_message = "Form Details are below.\n\n"; function clean_string($string) { $bad = array("content-type","bcc:","to:","cc:","href"); return str_replace($bad,"",$string); } $email_message .= "Full Name: ".clean_string($name)."\n\n"; $email_message .= "Address: ".clean_string($address)."\n\n"; $email_message .= "Email ID: ".clean_string($email)."\n\n"; $email_message .= "Contact No.: ".clean_string($contact)."\n\n"; $email_message .= "File: ".clean_string($upload)."\n\n"; // create email headers $headers = 'From: '.$email_from."\r\n". 'Reply-To: '.$email."\r\n" . 'X-Mailer: PHP/' . phpversion(); @mail($email_to, $email_subject, $email_message, $headers); ?> <!-- include your own success html here --> Thank you for contacting us. We will be in touch with you very soon. <?php } ?> i am a rookie in php I got 2 problems 1) I am not able to insert a code for file upload in the above code. 2) In other type of form (with different textfields).i have a text (it is like a disclaimer) in the html form which i want it in email too.
×
×
  • 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.