Jump to content

Uips

New Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by Uips

  1. Thx cyberRobot, i finaly got it working, slightly different code. Its very basic but works for me since im new to PHP <?php $name = $_POST['name']; $email = $_POST['email']; $telefon = $_POST['telefon']; $liik = $_POST['liik']; $message = $_POST['message']; $email_message = " Nimi: ".$name." E-post: ".$email." Telefon: ".$telefon." Töö Liik: ".$liik." Töö kirjeldus: ".$message." "; mail ("@outlook.com" , "Hinnapäring", $email_message); if (mail) { ?> <script language="javascript" type="text/javascript"> alert('Saadetud'); window.location = 'hinnaparing.html'; </script> <?php } else { ?> <script language="javascript" type="text/javascript"> alert('Saatmisel esines viga'); window.location = 'hinnaparing.html'; </script> <?php } ?> Im curious if its possible to change the sender to email typed in the form. Right now the web host sends me the message. I could Reply faster if it would refer the email as sender. If its possible can someone give me a head start what should i do?
  2. Hello im new to PHP and i have problems getting PHP working for my websites contac form Here the HTML form code <form action="" method="post"> <div class="form_settings"> <p><span>Name</span><input class="contact" type="text" name="your_name" value="" /></p> <p><span>Email Address</span><input class="contact" type="text" name="your_email" value="" /></p> <p><span>Message</span><textarea class="contact textarea" rows="8" cols="50" name="your_enquiry"></textarea></p> <p style="padding-top: 15px"><span> </span><input class="submit" type="submit" name="contact_submitted" value="submit" /></p> </div> </form> Heres the PHP code <?php $field_name = $_POST['cf_name']; $field_email = $_POST['cf_email']; $field_message = $_POST['cf_message']; $mail_to = 'example@gmail.com'; $subject = 'Message from '.$field_name; $body_message = 'From: '.$field_name."\n"; $body_message .= 'E-mail: '.$field_email."\n"; $body_message .= 'Message: '.$field_message; $headers = 'From: '.$field_email."\r\n"; $headers .= 'Reply-To: '.$field_email."\r\n"; $mail_status = mail($mail_to, $subject, $body_message, $headers); if ($mail_status) { ?> <script language="javascript" type="text/javascript"> alert('Sent'); window.location = 'kontakt.html'; </script> <?php } else { ?> <script language="javascript" type="text/javascript"> alert('Error'); window.location = 'kontakt.html'; </script> <?php } ?> I would be really thankful if someone could fix the PHP code for me and make it work with the html above.
×
×
  • 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.