-2

I'm new to php, creating a registration form and getting

Parse error: syntax error, unexpected ';'

on line 6. This works well on my xampp local server when uploaded to Cpanel is when I get the error.

<?php
   include ('connection.php');
   if(isset($_POST['submitform'])){
      $name = trim(mysql_escape_string($_POST['name']));
      $email = trim(mysql_escape_string($_POST['email']));
      $passwords = trim(mysql_escape_string(($_POST['pwd']));
      $password = md5($passwords);
   }
?>

I'm using php 5.4 on my local Server

Hamza Zafeer
  • 2,360
  • 13
  • 30
  • 42
Daniel
  • 9
  • 2

2 Answers2

1

change this line ;

$passwords = trim(mysql_escape_string(($_POST['pwd']));

to

$passwords = trim(mysql_escape_string($_POST['pwd']));
B.Kocaman
  • 800
  • 4
  • 13
0

Parser error is solved

<?php
include ('connection.php');
if(isset($_POST['submitform'])){
$name = trim(mysql_escape_string($_POST['name']));
$email = trim(mysql_escape_string($_POST['email']));
$passwords = trim(mysql_escape_string($_POST['pwd']));
$password = md5($passwords);
}
Sundar
  • 4,580
  • 6
  • 35
  • 61