473,412 Members | 2,092 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

parse error, syntax error unexpected $end in line 25

Expand|Select|Wrap|Line Numbers
  1. <HTML>
  2. <?php
  3. if($submit)
  4.     {
  5.     $db = mysql_connect("localhost", "root","");
  6.     mysql_select_db("learndb",$db);
  7.     $sql = "INSERT INTO personnel (firstname, lastname, nick, email, salary)
  8.     VALUES ('$first','$last','$nickname','$email','$salary')";
  9.     $result = mysql_query($sql);
  10.     echo "Thank you! Information entered.\n";
  11.     }
  12. else
  13.     {
  14.     ?>
  15.     <form method="post" action="input.php">
  16.     First name:<input type="Text" name="first"><br>
  17.     Last name:<input type="Text" name="last"><br>
  18.     Nick Name:<input type="Text" name="nickname"><br>
  19.     E-mail:<input type="Text" name="email"><br>
  20.     Salary:<input type="Text" name="salary"><br>
  21.     <input type="Submit" name="submit" value="Enter information"></form>
  22.     <?
  23.     }
  24. ?>
  25. </HTML>
Nov 19 '12 #1
7 2140
Rabbit
12,516 Expert Mod 8TB
Do you have short open tags turned on?
Nov 19 '12 #2
Hi Rabbit,
Thanks alot for your reply,

I am a new programmer to PHP and I am not getting you when you say short open tags turned on.
Please elaborate more

Thanks
I am really stack here
Nov 20 '12 #3
Rabbit
12,516 Expert Mod 8TB
This is an open tag: <?php.
This is a short open tag: <?.

Unless you have it turned on, you can't use short open tags. Either turn it on or change your short open tag.
Nov 20 '12 #4
Thanks a lot,

It has worked.
Nov 20 '12 #5
Hi Rabbit,
I am getting another error: undefined variable: submit in input.php line 4
Nov 20 '12 #6
omerbutt
638 512MB
can you paste the code inside input.php
regards,, iassume that your current code is from the same file and the $submit inside the if codition is what it is saying about , it cant find $submit is it the complete code
Omer Aslam
Nov 20 '12 #7
Rabbit
12,516 Expert Mod 8TB
That means the variable you're trying to use, $submit, doesn't exist. Maybe you named it something else. Or maybe you forgot to declare it. Whatever, the issue is, you need to look at the rest of your codeand see if it's been declared and initialized, if not, you need to do so.
Nov 20 '12 #8

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

Similar topics

8
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...
36
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...
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...
9
by: ajd335 | last post by:
Hi all... I am getting an error Parse error: syntax error, unexpected $end in http:/..... on line 117...(117 is the EOF).. can you plz help me out..I have checked out for the < , > ,{ ,} etc.......
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 ...
2
by: TanjaPetro | last post by:
Hello to everyone. I changed a few files on my site and when I tried to log into the admin area I got this message: Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting...
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: Ann Madden | last post by:
Hello - I am super green to php and mysql. I have received the following error: Parse error: syntax error, unexpected $end in C:\website\chart.php on line 84... I have been through the code matching...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
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,...
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
jinu1996
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...
0
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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...

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.