Here Is The Full Contact Section Code
Message.php
Code: Select all
<?php
echo file_get_contents($_REQUESTї"file"]);
?>
Types.php
Code: Select all
<?php
$thetypes = Array();
$thevisualtypes = Array();
function AddType($name,$value) {
global $thetypes;
global $thevisualtypes;
$thetypesї] = Array($name,$value);
$thevisualtypesї$value] = $name;
}
function EchoTypes() {
global $thetypes;
echo '<select name="type" id="type" size="10">';
echo '\n';
for ($i=0; $i<sizeof($thetypes); $i++) {
echo '<option value="'.$thetypesї$i]ї1].'"';
if ($_REQUESTї"type"] == $thetypesї$i]ї1]) {
echo ' SELECTED';
}
echo '>';
echo $thetypesї$i]ї0];
echo '</option>';
echo '\n';
}
echo '</select>';
}
AddType("Requests - To Add Something","Additions");
AddType("Requests - Changes","Changes");
AddType("Requests - Removals","Removals");
AddType("","__NA1");
AddType("Login - Problems","Login_Problems");
AddType("Login - Suspended","Login_Suspended");
AddType("","__NA2");
AddType("Programming","Programming");
AddType("","__NA3");
AddType("Other","Other");
?>
SendConfirmation.php
Code: Select all
<?php
require_once "../Settings.php";
$time = $_REQUESTї"id"];
$boundary = "==MP_Bound_xyccr948x==";
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: multipart/alternative; boundary="$boundary"\r\n";
$headers .= "From: donotreply@codeandgames.com\r\n";
$html_msg .= '<table align="center" border="1" cellpadding="8">';
$html_msg .= '<tr>';
$html_msg .= '<th>';
$html_msg .= 'Message';
$html_msg .= '</th>';
$html_msg .= '</tr>';
$html_msg .= '<tr>';
$html_msg .= '<td>';
$html_msg .= $_REQUESTї"message"];
$html_msg .= '</td>';
$html_msg .= '</tr>';
$html_msg .= '</table>';
$confirmsubject = "Please Confirm Your Email To 'Code And Games'";
$confirmmessage = "<center>";
$confirmmessage .= "Please click on the link below to send your message:\n\n";
$confirmmessage .= '<a href="'.$emailconfirmdir.'confirmmail.php?id=$time">Click here to confirm</a>';
$confirmmessage .= '\n<BR><BR>\n<BR><BR>\n';
$confirmmessage .= $html_msg;
$textconfirm = "Please Confirm Your Email To 'Code And Games'";
$textconfirm .= "\n";
$textconfirm .= "Click On The Link Below";
$textconfirm .= "\n\n";
$textconfirm .= $emailconfirmdir."confirmmail.php?id=$time";
$message = "This is a Multipart Message in MIME format\n";
$message .= "--$boundary\n";
$message .= "Content-type: text/html; charset=iso-8859-1\n";
$message .= "Content-Transfer-Encoding: 7bit\n\n";
$message .= $confirmmessage . "\n";
$message .= "--$boundary\n";
$message .= "Content-Type: text/plain; charset="iso-8859-1"\n";
$message .= "Content-Transfer-Encoding: 7bit\n\n";
$message .= $textconfirm . "\n";
$message .= "--$boundary--";
$mailsent = mail($_REQUESTї"Email"], $confirmsubject, $message, $headers);
if ($mailsent) {
?>
Due To Security
<BR>
We Have To Confirm That Your Email-Adress Is Valid.
<BR><BR>
Please Check Your Email, For A Confirmation Message
<BR>
It Could Take 1-20 Minutes To Arrive In Your Inbox - <?php echo $_REQUESTї"Email"]; ?>
<?php
} else {
echo "There was an error sending the e-mail.";
}
?>
Contact.php
Code: Select all
<?php
include("../Login/Valid.php");
include("Types.php");
function GetData($name) {
if ($_REQUESTї"submitted"] == null) {
return "";
}
else {
return $_REQUESTї$name];
}
}
$emailsent = true;
$errors = Array();
if (!$_REQUESTї"submitted"]) {
$emailsent = false;
}
else if($_REQUESTї"canceledsend"] == "t") {
$emailsent = false;
}
else {
CheckIfEmpty($_REQUESTї"firstname"],"First Name");
CheckIfEmpty($_REQUESTї"surname"],"Surname");
//CheckIfEmpty($_REQUESTї"subject"],"Subject");
CheckIfEmpty($_REQUESTї"message"],"Message");
ValidEmail($_REQUESTї"Email"],"E-mail Address");
if ($_REQUESTї"type"] == null || $_REQUESTї"type"] == undefined || $_REQUESTї"type"] == "") {
$errorsї] = "You Didn't Select A Type";
}
if (strpos($_REQUESTї"type"],"NA") == 2) {
$errorsї] = "You Selected A Blank Type Field";
}
if (sizeof($errors) != 0) {
$emailsent = false;
}
}
if (!$emailsent) {
?>
<HTML>
<HEAD>
<TITLE>Contact Us</TITLE>
<script language="Javascript1.2"><!-- // load htmlarea
_editor_url = "../htmlarea/"; // URL to htmlarea files
var win_ie_ver = parseFloat(navigator.appVersion.split("MSIE")ї1]);
if (navigator.userAgent.indexOf('Mac') >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Windows CE') >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Opera') >= 0) { win_ie_ver = 0; }
if (win_ie_ver >= 5.5) {
document.write('<scr' + 'ipt src="' +_editor_url+ 'editor.js"');
document.write(' language="Javascript1.2"></scr' + 'ipt>');
} else { document.write('<scr'+'ipt>function editor_generate() { return false; }</scr'+'ipt>'); }
// --></script>
</HEAD>
<BODY BGCOLOR="DDDDDD">
<center>
<h1>Contact Us</h1>
<BR><BR>
<?php
if ($_REQUESTї"submitted"]) {
?>
<TABLE>
<TR>
<TD>
<?php
for ($i=0; $i<sizeof($errors); $i++) {
$thiserror = $errorsї$i];
?>
<TABLE>
<TR>
<TD align="center" valign="middle">
<img src="Exclamation.gif">
</TD>
<TD align="center" valign="middle">
<B><I><font color="FF8800">
<?php
echo $thiserror;
?>
</font></I></B>
</TD>
</TR>
</TABLE>
<?php
}
?>
</TD>
</TR>
</TABLE>
<BR><BR>
<?php
}
?>
<form name="MyForm" id="MyForm" action="Contact.php" method="post">
<input type="hidden" name="submitted" id="submitted" value="t">
First Name : <input type="text" name="firstname" id="firstname" value="<?php echo htmlspecialchars(GetData("firstname")) ?>">
<BR>
Surname : <input type="text" name="surname" id="surname" value="<?php echo htmlspecialchars(GetData("surname")) ?>">
<BR>
Email-Address : <input type="text" name="Email" id="Email" value="<?php echo htmlspecialchars(GetData("Email")) ?>">
<BR>
Subject : <input type="text" name="subject" id="subject" value="<?php echo htmlspecialchars(GetData("subject")) ?>">
<BR>
<TABLE>
<TR>
<TD>
Type :
</TD>
<TD>
<?php
EchoTypes();
?>
</TD>
</TR>
</TABLE>
<BR><BR>
Message :
<BR>
<span style="display:none;">
<textarea name="message" id="message"></textarea>
</span>
</form>
<textarea name="mymessage" id="mymessage"><?php echo GetData("message"); ?></textarea>
<script language="JavaScript1.2" defer>
var config = new Object(); // create new config object
config.width = "90%";
config.height = "200px";
config.bodyStyle = 'background-color: #FFFFFF; font-family: "Verdana"; font-size: x-small;';
config.debug = 0;
config.toolbar = ї
ї'fontname'],
ї'fontsize'],
ї'fontstyle'],
ї'linebreak'],
ї'bold','italic','underline','separator'],
ї'strikethrough','subscript','superscript','separator'],
ї'justifyleft','justifycenter','justifyright','separator'],
ї'OrderedList','UnOrderedList','Outdent','Indent','separator'],
ї'forecolor','backcolor','separator'],
ї'HorizontalRule','Createlink','InsertImage','htmlmode','separator'],
ї'about','help']
];
editor_generate('mymessage',config);
</script>
<BR><BR>
<script language="JavaScript">
function Submit() {
MyForm.message.innerText = editor_getHTML('mymessage')
MyForm.submit();
}
function Cancel() {
window.close();
}
</script>
<button onclick="Submit()">Submit</button>
<button onclick="Cancel()">Cancel</button>
</BODY>
</HTML>
<?php
}
else {
if ($_REQUESTї"emailsent"] != "t") {
$thetime = time();
$headerfile = "Messages/Tempory/".$thetime.".headers";
$messagefile = "Messages/Tempory/".$thetime.".message";
$hfc_firstname = $_REQUESTї"firstname"];
$hfc_surname = $_REQUESTї"surname"];
$hfc_email = $_REQUESTї"Email"];
$hfc_subject = $_REQUESTї"subject"];
$hfc_type = $thevisualtypesї$_REQUESTї"type"]];
$headerfilecontent = <<<EOF
$hfc_firstname
$hfc_surname
$hfc_email
$hfc_subject
$hfc_type
EOF;
$hf = fopen($headerfile,"w");
fwrite($hf,$headerfilecontent);
fclose($hf);
$mf = fopen($messagefile,"w");
fwrite($mf,$_REQUESTї"message"]);
fclose($mf);
?>
<HTML>
<HEAD>
<TITLE>Contact Us</TITLE>
</HEAD>
<BODY BGCOLOR="DDDDDD">
<form name="MyForm" id="MyForm" action="Contact.php" method="post" style="display:none;">
<input type="hidden" name="emailsent" id="emailsent" value="t">
<input type="hidden" name="canceledsend" id="canceledsend" value="f">
<input type="hidden" name="submitted" id="submitted" value="t">
<input type="hidden" name="id" id="id" value="<?php echo $thetime; ?>">
First Name : <input type="text" name="firstname" id="firstname" value="<?php echo htmlspecialchars(GetData("firstname")) ?>">
<BR>
Surname : <input type="text" name="surname" id="surname" value="<?php echo htmlspecialchars(GetData("surname")) ?>">
<BR>
Email-Address : <input type="text" name="Email" id="Email" value="<?php echo htmlspecialchars(GetData("Email")) ?>">
<BR>
Subject : <input type="text" name="subject" id="subject" value="<?php echo htmlspecialchars(GetData("subject")) ?>">
<BR>
<TABLE>
<TR>
<TD>
Type :
</TD>
<TD>
<?php
EchoTypes();
?>
</TD>
</TR>
</TABLE>
<BR><BR>
Message :
<BR>
<textarea name="message" id="message"><?php echo $_REQUESTї"message"]; ?></textarea>
</form>
<center>
<h1>Contact Us</h1>
<BR><BR>
Please Confirm You Want To Send This Message
<BR><BR><BR><BR>
<TABLE>
<TR>
<TD>
First Name :
</TD>
<TD>
<?php echo $_REQUESTї"firstname"]; ?>
</TD>
</TR>
<TR>
<TD>
Surname :
</TD>
<TD>
<?php echo $_REQUESTї"surname"]; ?>
</TD>
</TR>
<TR>
<TD>
E-mail Address :
</TD>
<TD>
<?php echo $_REQUESTї"Email"]; ?>
</TD>
</TR>
<TR>
<TD>
Subject :
</TD>
<TD>
<?php echo $_REQUESTї"subject"]; ?>
</TD>
</TR>
<TR>
<TD>
Type :
</TD>
<TD>
<?php echo $thevisualtypesї$_REQUESTї"type"]]; ?>
</TD>
</TR>
</TABLE>
<BR><BR>
<iframe name="messageframe" id="messageframe" src="Message.php?file=<?php echo $messagefile; ?>"></iframe>
<BR><BR>
<script language="JavaScript">
function Send() {
MyForm.submit();
}
function Edit() {
MyForm.canceledsend.value = "t";
MyForm.submit();
}
function Cancel() {
window.close();
}
</script>
<button onclick="Send()">Send</button>
<button onclick="Edit()">Edit</button>
<button onclick="Cancel()">Cancel</button>
</BODY>
</HTML>
<?php
}
else {
include("SendConfirmation.php");
}
}
?>
Step 1
Step 2
Step 3
!!! PLEASE HELP !!!
Scottie_Too_Hottie7