473,466 Members | 1,455 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Parse error: syntax error, unexpected T_ELSE(please help)

2 New Member
Hi im new in php and i got a problem(T_ELSE) with this code please help!

"Parse error: syntax error, unexpected T_ELSE in C:\xampp\htdocs\update.php on line 15"

Expand|Select|Wrap|Line Numbers
  1. <?php
  2.     include 'db_connect.php';
  3.  
  4. $name = $_POST['Fname'];
  5. $surname = $_POST['Sname'];
  6. $pass = $_POST['Pname'];
  7. $user = $_POST['Uname'];
  8.  
  9. if (!$_post['submit']);    
  10.   {
  11.     echo "echo please fill out the form";
  12.     header('location: hello.php');
  13.    }
  14.  
  15.    else 
  16.    {
  17.    $sql_insert = "INSERT INTO membersinfo ('name', 'surname', 'pass', 'user') 
  18.     values ('Fname', 'Sname',  'Pname',  'Uname')};
  19.    echo "user has been created!";
  20.    header('location: hello.php');
  21.  
  22.    ?>
Feb 13 '12 #1
3 5319
Rabbit
12,516 Recognized Expert Moderator MVP
You didn't close your else statement.
Feb 13 '12 #2
khelcrosshatch
2 New Member
Thank you Rabbit... now i closed the else statement with "}" but still I got the same "Parse error: syntax error, unexpected T_ELSE".

<?php
include 'db_connect.php';

$name = $_POST['Fname'];
$surname = $_POST['Sname'];
$pass = $_POST['Pname'];
$user = $_POST['Uname'];


if (!$_post['submit']);
{
echo "echo please fill out the form";
header('location: hello.php');
}

else
{
$sql_insert = "INSERT INTO membersinfo ('name', 'surname', 'pass', 'user')
values ('Fname', 'Sname', 'Pname', 'Uname')";
echo "user has been created!";
header('location: hello.php');
}
?>
Feb 13 '12 #3
Rabbit
12,516 Recognized Expert Moderator MVP
You shouldn't have a semicolon after your if statement.
Feb 13 '12 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: basswhizz | last post by:
Hi everyone im a high school student and I'm having trouble with one of my projects could you please help!! I'm getting this error message. Parse error: syntax error, unexpected...
1
by: sheenrose | last post by:
<? $uname = $_REQUEST; $pass = $_REQUEST; /*Connecting, selecting database */ $LogStatus = 0; $link = mysql_connect("localhost","root","kushal") or die();
5
praclarush
by: praclarush | last post by:
I've just started php, and this is a class assignment, but my question is I’m getting this error PHP Parse error: syntax error, unexpected T_IF, expecting T_VARIABLE or '$' in...
2
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...
9
akohistani
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...
10
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 ...
1
by: karine | last post by:
Hi, I keep getting this error message "Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ']' in /home/env49986/public_html/welcome.php on line 16" below is the code ...
3
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> ...
5
by: vultren | last post by:
Parse error: syntax error, unexpected $end in I keep getting that, I have no clue where to fix it. Any help would be VERY APPRECIATED! <?php if(isset($_POST)) { // EDIT THE 2 LINES...
3
by: Christina Brook | last post by:
I am fairly new at this and I am I am receiving this error code: Parse error: syntax error, unexpected T_STRING in /home/brooks/christinalbrooks-www/index.html on line 1 for this code: <?xml...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.