Location: PHPKode > scripts > AGTC-PHP Form Mailer > agtc-php-form-mailer-v2-0a/install.php
<html>
<head>
<title>AGTC-Form Mailer V2.0a Installation</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>

<?php
$file1 = "configure.php";
if ((!file_exists($file1)) or (!is_readable($file1)) or (!is_writable($file1))){ 
echo "<span class=\"small_red_text\">There was an error, either the file configure does not exsist or is not writable or readable, <br>
If the file configure.php does exist then please check the CHMOD settings for this file. Recommended setting (777)</span>";}

echo "<h4>AGTC-Form Mailer v2.0a - Installation</h4>
<form action='' method='post'>
Please enter the email address you want your form to be sent to:&nbsp; <span class=\"small_red_text\">eg. hide@address.com</span><br>
<input type=\"text\" name=\"emailfield\" value=\"$emailfield\" size=\"30\" maxlength=\"30\"><br><br>
Please enter the form header title:&nbsp; <span class=\"small_red_text\">eg. My Website Contact Form</span><br>
<input type=\"text\" name=\"headerfield\" value=\"$headerfield\" size=\"30\" maxlength=\"30\"><br><br>
Please enter the form intro (Goes below header title):&nbsp; <span class=\"small_red_text\">eg. You can contact me by filling in the form below</span><br>
<input type=\"text\" name=\"introfield\" value=\"$introfield\" size=\"100\" maxlength=\"100\"><br><br>
Please enter subject field for your form:&nbsp; <span class=\"small_red_text\">eg. An enquiry to My Website</span><br>
<input type=\"text\" name=\"subjectfield\" value=\"$subjectfield\" size=\"50\" maxlength=\"50\"><br><br>
Option Form Fields Below: (Please chose the fields you would like to have on your form)<br><br>
<label>Allow Surname on form:<br>
    <input type='radio' name='optsn' value='1' checked>
    Yes</label>
    <br>
    <label>
    <input type='radio' name='optsn' value='0'>
    No</label><br><br>
	
	<label>Allow Address on form:<br>
    <input type='radio' name='optad' value='1' checked>
    Yes</label>
    <br>
    <label>
    <input type='radio' name='optad' value='0'>
    No</label>
<br><br>
	
	<label>Allow Home Telephone Number on form:<br>
    <input type='radio' name='optht' value='1' checked>
    Yes</label>
    <br>
    <label>
    <input type='radio' name='optht' value='0'>
    No</label>
	<br><br>
	
	<label>Allow Works Telephone Number on form:<br>
    <input type='radio' name='optwt' value='1' checked>
    Yes</label>
    <br>
    <label>
    <input type='radio' name='optwt' value='0'>
    No</label>
	<br><br>
	
	<label>Allow Fax Telephone Number on form:<br>
    <input type='radio' name='optft' value='1' checked>
    Yes</label>
    <br>
    <label>
    <input type='radio' name='optft' value='0'>
    No</label>
	<br><br>
	
	<label>Allow Mobile/Cell Number on form:<br>
    <input type='radio' name='optmt' value='1' checked>
    Yes</label>
    <br>
    <label>
    <input type='radio' name='optmt' value='0'>
    No</label>
<br><br>
<input type='hidden' name='edit' value='yes'>
<input type='submit' name='submit' value='INSTALL'>
</form></div>";

if ($_POST['submit']) {

$configcontent = "<?php\r
// *************************************************************************************************
// Title: 			PHP AGTC-FORM MAILER v2.0a
// Developed by: 	Andy Greenhalgh
// Email:			hide@address.com
// Website:			agtc.co.uk
// Copyright:		2005-2006(C)Andy Greenhalgh - (AGTC)
// Licence:			GPL - Copyright notices must remain 
// *************************************************************************************************
//
// Do not change this code from here unless you know what you are doing.\r
\$email = \"" . $emailfield . "\";\r
\$subject = \"" . $subjectfield . "\";\r
\$formheader = \"" . $headerfield . "\";\r
\$formintro = \"" . $introfield . "\";\r
// ( 1 = True or ON / 0 = False or OFF ) \r
\$snopt = " . $optsn . ";\r
\$adopt = " . $optad . ";\r
\$htopt = " . $optht . ";\r
\$wtopt = " . $optwt . ";\r
\$ftopt = " . $optft . ";\r
\$mtopt = " . $optmt . ";\r
?>

";	
if (is_writable($file1)) {
    if (!$handle = fopen($file1, 'w')) {
         echo "Cannot open file ($file1)";
         exit;
   }
   if (fwrite($handle, $configcontent) === FALSE) {
       echo "<img src=\"images/cross.jpg\">&nbsp;Cannot write to file ($file1), check CHMOD is set to 777";
       exit;
   }
   echo "
   <div class='small_red_text'>Success, setup complete. Please delete the install.php file before continuing. Add a link to contact.php to your site to use this form.</div>";
   fclose($handle);
} else {
   echo "<div class='small_red_text'>The file $file1 is not in your main site directory, please check it exists !!</div>";
}}
?>
</body>
</html>
Return current item: AGTC-PHP Form Mailer