unexpected T_STRING error
I Seem to be getting this error:
Parse error: syntax error, unexpected T_STRING in C:\Inetpub\vhosts\foreverms.com\httpdocs\register_do.php on line 4
PHP Code:
<?php
include 'config.php'
// Connects to your Database
mysql_connect($host['server'], $host['username'], $host['password']) or die(mysql_error());
mysql_select_db($host['database']) or die(mysql_error());
//This code runs if the form has been submitted
if (isset($_POST['submit'])) {
//This makes sure they did not leave any fields blank
if (!$_POST['name'] | !$_POST['pass'] | !$_POST['pass2'] | !$_POST['pin'] | !$_POST['gender'] ) {
die('You did not complete all of the required fields');
}
// checks if the username is in use
if (!get_magic_quotes_gpc()) {
$_POST['name'] = addslashes($_POST['name']);
}
$usercheck = $_POST['name'];
$check = mysql_query("SELECT username FROM users WHERE username = '$usercheck'")
or die(mysql_error());
$check2 = mysql_num_rows($check);
//if the name exists it gives an error
if ($check2 != 0) {
die('Sorry, the username '.$_POST['name'].' is already in use.');
}
// this makes sure both passwords entered match
if ($_POST['pass'] != $_POST['pass2']) {
die('Your passwords did not match. ');
}
// here we encrypt the password and add slashes if needed
$_POST['pass'] = md5($_POST['pass']);
if (!get_magic_quotes_gpc()) {
$_POST['pass'] = addslashes($_POST['pass']);
$_POST['name'] = addslashes($_POST['username']);
}
// now we insert it into the database
$insert = "INSERT INTO users (username, password, pin, gender)
VALUES ('".$_POST['username']."', '".$_POST['pass']."' '".$_POST['pin']."' '".$_POST['pass']."' '".$_POST['gender']"')";
$add_member = mysql_query($insert);
?>
<h1>Registered!</h1>
<p>Thank you, you have registered - you may now login</a>.</p>
Any ideal what the error is?
Re: unexpected T_STRING error
You forgot a semi-colon after your include() line:
PHP Code:
include('config.php');
Re: unexpected T_STRING error
You forgot a semicolon somewhere. You be told which line. ;)
Re: unexpected T_STRING error
Quote:
Originally Posted by DigiRev
You forgot a semi-colon after your include() line:
PHP Code:
include('config.php');
Ahhh sorry; the beauty of quick reply. That's the second time I have replied and one of your posts has appeared :D
Re: unexpected T_STRING error
PHP Code:
mysql_query("INSERT [BEFORE] visualAd..")
:p