Jump to content

Recommended Posts

Hello to you all....If someone could help me with this I would be most grateful I have looked through the forum and to be honest I dont know what Im looking at..so sorry if this topic has been covered.

 

I have a small website that I want to put  contact form on. I was given a simple php script by my webspace provider...It sends an emal address and a message the user submits...which is fine....but i want to add more....I have tackled the HTML side of things ok..

How can I expand on this even if I knew how to add one more item that would be  great help. I have tred many different things and I get nothing..

This is the script provided to me...

 

<?php

 

mail("enquiries@themcdonaldguesthouse.co.uk", "Feedback Form results", $_REQUEST[message], "From: $_REQUEST", "-f".$_REQUEST);

 

header( "Location: http://www.themcdonaldguesthouse.co.uk/thankyou.html" );

 

?>

 

 

Thanks for any help in advance.....Rob

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/51755-solved-newbie-help-with-form-mail/
Share on other sites

Try this

 

 

form.html

Code:

<HTML>
    <head>
        <title>
            Form
        </title>
    </head>
    <body>
        <form action="mail.php" method="POST">
            <input name="name">
            <br><input name="email">
            <br><input name="phone">
            <br><input type="submit" value="Send!">
        </form>
    </body>
</HTML>

 

mail.php

<?php
    $email = "your@email.adress";
    $subject = "Contact Form";
    $message = "Name: ".$_POST['name'];
    $message .= "\nEmail Adress: ".$_POST['email'];
    $message .= "\nTelephone: ".$_POST['phone'];
    $message = addslashes($message);
    mail($email, $subject, $message);
    echo("Thankyou for filling out the Form!");
?>

 

 

 

on a side note, in your code replace

 

$_REQUEST[message] with {$_REQUEST['message']}

and

$_REQUEST with {$_REQUEST['email']}

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.