-2

Start the session

session_start();

$userid = $_SESSION["Id"];
$name = $_SESSION["name"];
$pr = $_SESSION["profilepicture"];

include 'config/config.php';
include 'config/config1.php';
include 'config/connect.php';

$IDMail = $_POST['IDMail']
$Message = $_POST['Message']
$userid = $_POST['userid']

$time = time();

mysql_query("INSERT INTO mail (IDMail, IDUser, Time, Message) VALUES ('$IDMail','$IDUser','$time','$message')")  or die("error in insert please".mysql_error());
Qirel
  • 25,449
  • 7
  • 45
  • 62
  • 5
    you have missed ';' after variable declaration like $IDMail =$_POST['IDMail'] – Dhanesh Jun 21 '19 at 04:05
  • 3
    You shouldn't be using mysql_*(). Use mysqli_*() or PDO instead. See [this question](https://stackoverflow.com/questions/12859942/why-shouldnt-i-use-mysql-functions-in-php/12860046#12860046) –  Jun 21 '19 at 04:37

2 Answers2

1

You've missed semicolon at the end of lines 11 to 13.

Alireza A2F
  • 519
  • 4
  • 26
0

All three lines where you assign $_POST attributes need a semicolon after them.

$IDMail =$_POST['IDMail']

$Message = $_POST['Message']

$userid = $_POST['userid']

should be

$IDMail =$_POST['IDMail'];

$Message = $_POST['Message'];

$userid = $_POST['userid'];
Nick Busey
  • 49
  • 5
  • Well did exactly that and still being faced with errors like undefined index:message. Undefined variable :IDUser. Undefined variable :time – isaac jusom Jun 22 '19 at 12:20