- <HTML>
-
<?php
-
if($submit)
-
{
-
$db = mysql_connect("localhost", "root","");
-
mysql_select_db("learndb",$db);
-
$sql = "INSERT INTO personnel (firstname, lastname, nick, email, salary)
-
VALUES ('$first','$last','$nickname','$email','$salary')";
-
$result = mysql_query($sql);
-
echo "Thank you! Information entered.\n";
-
}
-
else
-
{
-
?>
-
<form method="post" action="input.php">
-
First name:<input type="Text" name="first"><br>
-
Last name:<input type="Text" name="last"><br>
-
Nick Name:<input type="Text" name="nickname"><br>
-
E-mail:<input type="Text" name="email"><br>
-
Salary:<input type="Text" name="salary"><br>
-
<input type="Submit" name="submit" value="Enter information"></form>
-
<?
-
}
-
?>
-
</HTML>
7 2140
Do you have short open tags turned on?
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
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.
Thanks a lot,
It has worked.
Hi Rabbit,
I am getting another error: undefined variable: submit in input.php line 4
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
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.
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: 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...
|
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.......
|
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: 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: 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...
|
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: 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...
|
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...
|
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
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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: 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...
|
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...
| | |