האתר יושב על שרת לינוקס ככה שהשפה זה PHP
עכשיו מסד נתונים אין לי עדיין (זה חלק ממה שאני מנסה לעשות-אפשר אולי בשרת יש לי אפשרות לעשות מסדי SQL)והנה קוד המקור של הטופס:
form.php
<?php
include ("config.php");
// Contact Form By TalGarty
$mail_check=true;
if(trim($_POST)=="")
$mail_check=false;
if(trim($_POST)=="")
$mail_check=false;
if(trim($_POST)=="")
$mail_check=false;
if(trim($_POST)=="")
$mail_check=false;
if(trim($_POST)=="")
$mail_check=false;
if($mail_check){
$to=$config;
$subject = $_POST;
$message = '<html><head><title>$lang</title></head><body>
'.$lang.': '.$_POST.'<br>
'.$lang.': '.$_POST.'<br>
'.$lang.': '.$_POST.'<br><p>
'.$lang.': '.$_POST.'<br>
'.$lang.': '.$_POST.'<br>
</body></html>';
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=windows-1255' . "\r\n";
$headers .= 'From: '.$_POST.' <'.$_POST.'>' . "\r\n";
if(mail($to, $subject, $message, $headers)){
echo $lang;
}
else{
echo $lang;
}
}else{
echo $lang;
}
?>
----------------------------------------------------------------
config.php
<?php
// Contact Form By TalGarty
$config = Array(
"email" => "[email protected]",
);
$lang = Array(
"newemailarriveed" => "הודעה חדשה",
"newemailfrom" => "שולח",
"info" => "מידע",
"fullname" => "שם מלא",
"iemail" => "אימייל",
"fone" => "טלפון",
"subject" => "נושא",
"content" => "תוכן ההודעה",
"success" => "הודעה נשלחה בהצלחה",
"eror1" => "שגיאה: האימייל לא נשלח.",
"eror2" => "שגיאה: אחד או יותר מהשדות ריקות.",
);
?>
---------------------------------------------------------
index.html
<form action="form.php" method="post">
<!-- Contact Form By TalGarty -->
<table>
<tr>
<td><font color="red">*</font><font size="1" color="white" face="Tahoma"> שם מלא: </font></td>
<td><input type="text" name="name" maxlength="20"></td>
</tr>
<tr>
<td><font color="red">*<font size="1" color="white" face="Tahoma">אימייל: </font></td>
<td> <input type="text" name="email" maxlength="30"></td>
</tr>
<tr>
<td><font color="red">*<font size="1" color="white" face="Tahoma">טלפון: </font></td>
<td> <input type="text" name="fone" maxlength="30"></td>
</tr>
<tr>
<td><font color="red">*<font size="1" color="white" face="Tahoma">נושא: </font></td>
<td> <input type="text" name="subject" maxlength="30"> </td>
</tr>
<tr>
<td><font color="red">*<font size="1" color="white" face="Tahoma">הודעה: </font> </td>
<td> <textarea rows="5" color="white" name="content" cols="30" maxlength="120">רשום כאן את הודעה שלך</td>
</tr>
<tr>
<td></td>
<td><font size="1" color="white" face="Tahoma">השדות עם <font color="red">*</font> הינם חובה</font><br /><br /></td>
</tr>
<tr>
<td></td>
<td><input type="submit" name="posted" value="שלח"> <input type="reset" value="נקה"></td>
</tr>
</table>
</form>
תודה רבה
אVי