Advertisement
SSYT

Any Ideea?

May 9th, 2016
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.95 KB | None | 0 0
  1. <?php
  2.     header('Access-Control-Allow-Origin: http://myscripts.forumz.ro');
  3.  
  4.     $mysql = mysql_connect("mysql.hostinger.ro", "u719064522_bitcd", "5vEelfGVsC") or die(mysql_error());
  5.     if(!$mysql)
  6.         print("Conexiunea cu serverul a esuat !");
  7.     $database = mysql_select_db("u719064522_stupd") or die(mysql_error());
  8.     if(!$database)
  9.         print("Conexiunea cu baza de date a esuat !");
  10.    
  11.         $date = date("d.m.Y - h:i");
  12.         $date_db = date("Y-m-d h:i");
  13.         $user_id = $_POST['user_link'];
  14.         $user_name = $_POST['user_name'];
  15.         $user_text = $_POST['content'];
  16.         if(isset($_POST))
  17.         {
  18.             if(empty($user_text)) {
  19.                 echo "Toate rubricile formularului sunt obligatorii";
  20.             } else {
  21.                 $data = "<strong>[". $date ."]</strong> [".$user_id."] ".$user_name." has update status !";
  22.                 echo $data;
  23.                 $query = "INSERT into `status_update` (`User`, `Status`, `Date`, `Coments`) VALUES ($user_id, $user_name, $date_db, $user_text)";
  24.                 mysql_query($query);
  25.             }
  26.         }
  27. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement