Location: PHPKode > scripts > Form Mail Lite > form/skin.php
<?php
require("header.php");
?>
<SCRIPT TYPE="text/javascript" SRC="list.js"></SCRIPT>
<?php
if(!$_POST["edit"]){
if($_GET["fid"]){
$Log=file("log/form.cgi");
for($i=0;$i<sizeof($Log);$i++){
$line=explode(",",$Log[$i]);
if($line[0]==$_GET["fid"]){
$Fid=$line[0];
$To=$line[6];
$Subject=$line[7];
$Text=$line[8];
$Sign=$line[9];
$Complete=$line[10];
$Remail=$line[11];
$Text=str_replace("<br />","\n",$Text);
$Sign=str_replace("<br />","\n",$Sign);
$Complete=str_replace("<br />","\n",$Complete); 
break;
}
}
}
}
if($_POST["edit"]){
$Fid=$_POST['fid'];
$To=$_POST["to"];
$Subject=$_POST["subject"];
$Text=$_POST["text"];
$Sign=$_POST["sign"];
$Complete=$_POST["complete"];
$Remail=$_POST["remail"];
}
if($_POST["edit"]){
$Fid = strip_tags($Fid);
$To = strip_tags($To);
$Subject = strip_tags($Subject);
$Text = strip_tags($Text);
$Sign = strip_tags($Sign);
$Complete = strip_tags($Complete);
$Remail = strip_tags($Remail);
$Text=nl2br($Text);
$Text=str_replace("\n","",$Text);
$Text=str_replace("\r","",$Text);
$Sign=nl2br($Sign);
$Sign=str_replace("\n","",$Sign);
$Sign=str_replace("\r","",$Sign);
$Complete=nl2br($Complete);
$Complete=str_replace("\n","",$Complete);
$Complete=str_replace("\r","",$Complete);
$To=str_replace(",","",$To);
$Subject=str_replace(",","",$Subject);
$Text=str_replace(",","",$Text);
$Sign=str_replace(",","",$Sign);
$Complete=str_replace(",","",$Complete);
$Log=file("log/form.cgi");
for($i=0;$i<sizeof($Log);$i++){
$line=explode(",",$Log[$i]);
if($line[0]==$Fid){
$list=$line[1];
$solid=$line[2];
$left=$line[3];
$right=$line[4];
$font=$line[5];
break;
}
}
$lines=array("$Fid","$list","$solid","$left","$right","$font","$To","$Subject","$Text","$Sign","$Complete","$Remail","1");
$lines=implode(",",$lines);
$lines=$lines."\n";
$Log=file("log/form.cgi");
for($i=0;$i<sizeof($Log);$i++){
$line=explode(",",$Log[$i]);
if($line[0]==$Fid){
$Flg++;
array_splice($Log,$i,1,$lines);			
}
}
if($Flg){
$fp=fopen("log/form.cgi","w");
flock($fp, LOCK_EX);
foreach($Log as $line)fputs($fp,$line);	
fclose($fp); 
}
$Text=str_replace("<br />","\n",$Text);
$Sign=str_replace("<br />","\n",$Sign);
$Complete=str_replace("<br />","\n",$Complete);
print "Saved<br><br>";
}
?>
<form action="" method="POST">
<select name="fid" onChange="change(this.options[this.selectedIndex].value);">
<?php
$Log=@file("log/form.cgi");
for($i=0;$i<sizeof($Log);$i++){
$line=explode(",",$Log[$i]);
$Selected="";
if($line[0]==$Fid){
$Selected="selected";
}
?>
<option value="<?=$line[0]?>" <?=$Selected?>><?=$line[1]?></option>
<?php
}
?>
</select><br>
hide@address.com<br>
<input size="30" type="text" name="to" value="<?=$To?>"></input><br>
Subject<br>
<input size="30" type="text" name="subject" value="<?=$Subject?>"></input><br>
<br>
<?php
if($Remail==1){
$Checked="checked";
}
else{
$Checked="";
}
?>
<table><tr>
<td><input type="checkbox" name="remail" value="1" <?=$Checked?>></td><td>Reply</td></tr>
</table>
Message<br>
<textarea name="text" cols="40" rows="6"><?=$Text?></textarea><br>
Signature<br>
<textarea name="sign" cols="40" rows="6"><?=$Sign?></textarea>
<br>
Completion message<br>
<textarea name="complete" cols="40" rows="6"><?=$Complete?></textarea>
<br><input type="submit" name="edit" value=" Update "></form>
<?php
require("footer.php");
?>
Return current item: Form Mail Lite