Using php mail function allows a user of a wesbite to send email without opening up ther mail client, information such as subject message reply-to email address can be included.

With this could I also add fileds to send things such as booking time date, telephone number etc?

Can this go in the header fiels or something so that I can check it in my inbox

or does this require an sql table? i dont want to use one mainly becuase i havent made one befoer, and i want any reservation to be sent straight to my inbox

clarification?

Recommended Answers

All 7 Replies

You can put anything you want in the email. And you wouldn't need a SQL table unless you're storing information in some way.

thanks


so if i had say a html input field named "telephone"

the relavent php value for it would be $telephone?

would that go inside the $message() bit or $header() ?

I have no idea, show me your code.

PHP

<?php
$email = $_REQUEST['email'] ;
$subject = $_REQUEST['subject'] ;
$message = $_REQUEST['message'] ;

mail( "contact@superdial.co.uk", $subject, 
$message, "From: $email" );
header( "Location: http://superdial.co.uk/sent.htm" );
?>

FORM

<form action="mail.php" method="post">
Send a message to the superdial.co.uk inbox. Please complete all fields.
<br><br>
Reply-to email: <input type="text" name="email" size="25">
<br><br>Subject:
<select name="subject">
<option value="Accessibility">Accessibility</option>
<option value="Numbers">Access Numbers</option>
<option value="Advertising">Advertising</option>
<option value="Credit">Calling Credit</option>
<option value="Careers">Careers</option>
<option value="Other">Other</option>
</select>
<br><br>
<textarea name="message" rows="15" cols="80">Enter your message here.</textarea>
<br><br>
<input type="submit" value="Send"></font>
</form>

how could i include like a telepphone number to call a client back on?? i tried messing around by addid more form fields and changing lines in the php, but to no success

i did try but sql was mainly involved from what i could gather


anyone else with anything constructive please do reply

i did try but sql was mainly involved from what i could gather


anyone else with anything constructive please do reply

Then you're looking at the wrong things. Take a look at w3schools.com, read the tutorials for PHP

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.