-2

Having some issues parsing this batch of php to send form data to my AWS RDS database. I have followed a few tutorials but I seem to end up in the same place.

<?php

$con = mysqli_connect('accountuserdb.cyietmcjutfg.us-east-2.rds.amazonaws.com','redact','redact')

$Email = $_POST('email');
$Username = $_POST('username');
$Userpass = $_POST('password');

$sql = "INSERT INTO useraccounts (Email,Username,Userpass) VALUES ('$Name','$Username','$Userpass')";

header("refresh:2; url="success.html");

?>

I am a little confused as to why I am receiving the parse error? outdated syntax maybe?

Seth Kerr
  • 27
  • 8

1 Answers1

2

In PHP you access array elements with [], not ()

so you have to write

$Email = $_POST['email'];

instead of

$Email = $_POST('email');

and make sure to properly escape the values with mysqli_real_escape_string()

http://php.net/manual/en/mysqli.real-escape-string.php

Michael M.
  • 189
  • 1
  • 7