View Single Post
ישן 15-04-06, 20:21   # 4
mr. dids
חבר בקהילה
 
מיני פרופיל
תאריך הצטרפות: Mar 2006
הודעות: 161

mr. dids לא מחובר  

זה הקוד של השליחה
עכשיו איך אני שם את זה ?

PHP קוד:
<?php

require "db.php";
if (
$_GET['act']=="add") {

    
$name    =    $_POST['username'];
    
$email    =    $_POST['email'];
    
$body    =    $_POST['body'];
    
    
$name    =    str_replace("'","'"$name);
    
$name    =    str_replace("<","&lt;"$name);
    
$name    =    str_replace(">","&gt;"$name);

        
$name    =    trim($name);

    
$email    =    str_replace("'","'"$email);
    
$email    =    str_replace("<","&lt;"$email);
    
$email    =    str_replace(">","&gt;"$email);

        
$email    =    trim($email);

    
$body    =    str_replace("'","'"$body);
    
$body    =    str_replace("<","&lt;"$body);
    
$body    =    str_replace(">","&gt;"$body);
    
$body    =    str_replace(chr(13),"<br>"$body);

        
$body    =    trim($body);

    
$userIP    =    $_SERVER[REMOTE_ADDR];

    
$time    =    date("d/n/Y - H:i:s");

if (
$name=="") {
    
$error_name "לא הכנסת שם";
        
$errors 1;
}
if (
$body=="") {
    
$error_body "לא הכנסת הודעה";
        
$errors 1;
}

if (
$errors=="") {

$Add mysql_query("INSERT INTO msgs(username,email,body,userIP,date) VALUES('$name','$email','$body','$userIP','$time')",$conn);

echo 
"<script>window.close();</script>";

    }
}

echo 
"<html><head><link rel='stylesheet' type='text/css' href='style.css' /></head><body>";
echo 
"<table border='0' align='center' width='100%'><form name='addmsg' method='post' action='?act=add' onsubmit='submit.disabled=true;'>";
echo 
"<tr><td align='right'>שם:</td><td align='right'> <input type='text' size='10' maxlength='10' name='username'>  <font color='red'>{$error_name}</font></td></tr><br>";

echo 
"<br><tr><td align='right'>ההודעה:</td><td align='right'> <textarea name='body' dir='rtl' cols='30' rows='5' maxlength='200'></textarea>  <font color='red'>{$error_body}</font></td></tr>";
echo 
"<br><tr><td align='right' colspan='2'><input type='submit' name='submit' value='שלח'> <input type='reset' name='reset' value='נקה'></td></tr>";
echo 
"</form><br><br><tr><td align='center' colspan='2'><a href='javascript:window.close()'>סגור חלון</a></td></tr></table></body></html>";

?>
  Reply With Quote