Php

Join Discord

Kaori

LOMCN MiR3 Queen!
VIP
Jun 3, 2004
3,584
38
285
Canada
This is an old script (edited) I used on another site.

PHP:
<?php

function showhtml() {
echo <<<END
<html>
 <head>
  <title>Your Title Here</title>
 </head>
 <body>
  <h1 align="center">Booking</h1>
  <form action="booking.php" method="post">
   <table align="center" border="0" bgcolor="#ececec" cellspacing="5">
    <tr><td><font face="arial" size="2">Company *</font></td><td><input type="text" size="30" name="Company"></td></tr>
    <tr><td><font face="arial" size="2">Name *</font></td><td><input type="text" size="30" name="Name"></td></tr>
    <tr><td><font face="arial" size="2">Phone *</font></td><td><input type="text" size="30" name="Phone"></td></tr>
    <tr><td><font face="arial" size="2">Fax</font></td><td><input type="text" size="30" name="Fax"></td></tr>
    <tr><td><font face="arial" size="2">Email address *</font></td><td><input type="text" size="30" name="Email"></td></tr>
    <tr><td valign="top"><font face="arial" size="2">Special Requests</font></td><td><textarea name="Requests" rows="6" cols="30"></textarea></td></tr>
    <tr><td>* Required</td><td><input type="submit" value="Send"></td></tr>
   </table>
  </form>
 </body>
</html>
END;
exit;
}

// Variables
$my_email = "[email protected]";
$continue = "/";

// This prevents values being entered in a URL
if ($_SERVER['REQUEST_METHOD'] != "POST") {
  showhtml();
  exit;
}
$message = "";
$set = 0;
while (list($key,$value) = each($_POST)) {
  if(!(empty($value))) { $set = 1; }
  $message = $message . "$key: $value\r\n";
}
if ($set!==1) {
  showhtml();
  exit;
}
$message = $message . "--\r\n";
$message = $message . "Sent From IP: " . $_SERVER['REMOTE_ADDR'] . "\r\n";
$message = stripslashes($message);

$subject = "Booking Request";
$headers = "From: [email protected]\r\n";

mail($my_email, $subject, $message, $headers);

?>
<html>
 <head>
  <title>Your Title Here</title>
 </head>
 <body bgcolor="#ffffff" text="#000000">
  <center>
   <h1>Thank you!</h1>
   <h2>Your request has been sent!</h2>
   <h3><a href="/">Return to Homepage</a></h3>
  </center>
 </body>
</html>
 

Kaori

LOMCN MiR3 Queen!
VIP
Jun 3, 2004
3,584
38
285
Canada
name your php file "booking.php"

edit the file so it has your email address in it.

put it anywhere in your directory... and access it through your browser.. try it