how can i resolve this
Parse error: syntax error, unexpected T_STRING in C:\xampp\htdocs\Elomity\index.php on line 88 - <? include ("inc/incfiles/header.inc.php"); ?>
-
<?
-
$reg = @$_POST['reg'];
-
//declaring variables to prevent errors
-
$fn = ""; //First Name
-
$ln = ""; //Last Name
-
$un = ""; //Username
-
$em = ""; //Email
-
$em2 = ""; //Email 2
-
$pswd = ""; //Password
-
$pswd2 = ""; //Password2
-
$d = ""; //Sign up Date
-
$u_check = ""; //Check if username is exists
-
//registration form
-
$fn = strip_tags(@$_POST['fname']);
-
$ln = strip_tags(@$_POST['lname']);
-
$un = strip_tags(@$_POST['username']);
-
$em = strip_tags(@$_POST['email']);
-
$em2 = strip_tags(@$_POST['email2']);
-
$pswd = strip_tags(@$_POST['password']);
-
$pswd2 = strip_tags(@$_POST['password2']);
-
$d = date("Y-m-d"); // Year - Month - Day
-
-
if ($reg) {
-
if ($em==$em2) {
-
// Check if user already exists
-
$u_check = mysql_query("SELECT username FROM users WHERE username='$un'");
-
// Count the amount of rows where username = $un
-
$check = mysql_num_rows($u_check);
-
if ($check == 0) {
-
//check all of the fields have been filed in
-
if ($fn&&$ln&&$un&&$em&&$em2&&$pswd&&$pswd2) {
-
// check that passwords match
-
if ($pswd==$pswd2) {
-
// check the maximum length of username/first name/last name does not exceed 25 characters
-
if (strlen($un)>25||strlen($fn)>25||strlen($ln)>25) {
-
echo "The maximum limit for username/first name/last name is 25 characters!";
-
}
-
else
-
{
-
// check the maximum length of password name does not exceed 25 characters and is not less than 5
-
if (strlen($pswd)>30||strlen($pswd)<5) {
-
echo "Your password must be between 5 and 30 characters long";
-
}
-
else
-
{
-
//encrypt password and password 2 using md5 before sending to database
-
$pswd = md5($pswd);
-
$pswd2 = md5($pswd2);
-
$query = mysql_query("INSERT INTO users VALUES ('','$un','$fn','$ln','$em','$pswd','$d','0')");
-
die("<h2>Welcome to Elomity</h2>Login to your account to get started...");
-
}
-
}
-
}
-
else {
-
echo "Your passwords don't match";
-
}
-
}
-
else
-
{
-
echo "Please fill in all of the fields";
-
}
-
}
-
else
-
{
-
echo "Username already taken";
-
}
-
}
-
else {
-
echo "Your E-mails don't match";
-
}
-
}
-
?>
-
<?
-
//Login Script
-
if (isset($_POST["user_login"]) && isset($_POST["password_login"])) {
-
$user_login = preg_replace('#[^A-Za-z0-9]#i', '', $_POST["user_login"]); // filter everything but letters and numbers
-
$password_login = preg_replace('#[^A-Za-z0-9]#i', '', $_POST["password_login"]); // filter everything but letters and numbers
-
$md5password_login = md5($password_login);
-
$sql = mysql_query("SELECT id FROM users WHERE username='$user_login' AND password='$password_login' LIMIT 1"); // query the person
-
//Check for their existance
-
$userCount = mysql_num_rows($sql); //Count the number of rows returned
-
if ($userCount == 1) {
-
while($row = mysql_fetch_array($sql)) {
-
$id = $row["id"];
-
}
-
$_SESSION ["id"] = $id;
-
$_SESSION ["user_login"] = $user_login;
-
$_SESSION ["password_login"] = $password_login;
-
header ("location: index.php");
-
//checks to see if user is logged in
-
$user = $_SESSION ["user_login"];
-
//If the user is not logged in
-
if (!isset ($_SESSION["user_login"])){ header ("location: index.php"); exit();
-
}
-
if (isset ($_SESSION["user_login"])){ header ("location: home.php"); exit();
-
}
-
}
-
?>
2 5400 Luuk 1,047
Recognized Expert Top Contributor
There is a 'strange' character in your source.
I copied above code, and when editting, line 88 looks like: - $_SESSION ["user_login"]<feff> = $user_login;
-
Dormilich 8,658
Recognized Expert Moderator Expert
that is the BOM (Byte Order Mark) U+FEFF. it’s used to indicate UTF encoded files.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Wescotte |
last post by:
The error message Parse error: syntax error, unexpected $end in FILE on
line X is one I run into frequently and I know the cause is I missed an
ending quote.
Is there an easy way to determine...
|
by: rhys |
last post by:
My Gurus and Angels --
Please pardon this old-school programmer, only recently enlightened to open-source, having been trapped in the convenience of proprietary lingos for way too long. My...
|
by: SilvaZodiac |
last post by:
Hi everyone,
I'm still rather new to PHP code, and I have a syntax error. I've tried several different solutions, but it won't fix. It seems to suggest that I need a new bracket somewhere in the...
|
by: fburn |
last post by:
I need some help with an error I'm getting using php 5.2.5 running on linux.
I receive an error:
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or...
|
by: akohistani |
last post by:
I am having Parse error problem with my newly purchased Php upload script I have uploaded the script and I get the error below
Parse error: syntax error, unexpected $end in URL/functions.php on...
| |
by: paulrajj |
last post by:
hi to all,
i am getting syntax error on my code..
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in D:\xampp\htdocs\Dummy\paulraj\matrim\exam.php on line 62
...
|
by: benicio |
last post by:
Parse error: syntax error, unexpected T_STRING, expecting '(' in C:\wamp\www\study_group\includes\functions.php on line 19
I got this error and this syntax is from 8 to 19th line.
<?php
...
|
by: brkseven |
last post by:
Looking for help with this Contact Form.
The error is on line 1, but that' doesn't mean a lot, I think. In fact, a php syntax check passed it, but I was hoping for an easy syntax error, it looks...
|
by: CYNTHIA CUTRER |
last post by:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
...
|
by: Vicki Hendra |
last post by:
Hi
I am new to php fullstop
I and colleagues have setup wordpress blogs for our local towns, giving the local businesses free advertisment.
Part of the problem started when using wordpress...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| | |