473,465 Members | 1,929 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

I keep getting this error message and would love your help

2 New Member
I keep getting this error, could somebody help?
Parse error: parse error, expecting `']'' in C:\wamp\www\Contact Database\addentry.php on line 5

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. if ((!$_POST) || (isset($_GET["master_id])){
  3.         //haven't seen the form, so show it
  4.         $display_block = "
  5.         <form method=\"post\" action=\"".$_SERVER["PHP_SELF"]."\">
  6.  
  7.     if (isset($_GET["master_id"])) {
  8.         //connect to database
  9.         $mysqli = mysqli_connect("localhost", "test", "test", "houseinsandiego");
  10.  
  11.         ??get first, last names for display/tests validity
  12.         $get_names_sql = "SELECT concat_ws(' ',f_name, l_name) AS display_name
  13.                             FROM master_name WHERE id = '".$_GET["master_id"]."'";
  14.         $get_names_res = mysqli_query($mysqli, $get_names_sql)
  15.                             or die(mysqli_error($mysqli));
Jul 4 '10 #1
5 2149
Dormilich
8,658 Recognized Expert Moderator Expert
you forgot to close the last string part in line 5.
Jul 5 '10 #2
hpailles
2 New Member
@hpailles
thanks, now, how about this other parse error?

Parse error: parse error in C:\wamp\www\Contact Database\addentry.php on line 69

Expand|Select|Wrap|Line Numbers
  1. if ($_GET) {
  2. $display_block .= "<input type=\"hidden\"name=\"master_id\"
  3. value=\"".$_GET["master_id"]."\">"
  4. }
Jul 6 '10 #3
TheServant
1,168 Recognized Expert Top Contributor
Not sure without more code, but there might be some confusion with using double quotes to call your $_GET variable. Try:
Expand|Select|Wrap|Line Numbers
  1. if ($_GET) {
  2. $display_block .= "<input type=\"hidden\"name=\"master_id\"
  3. value=\"".$_GET['master_id']."\" />"
  4.  
I also added and extra '/' at the end as HTMl should have a self closing element like:
Expand|Select|Wrap|Line Numbers
  1. <input />
Jul 6 '10 #4
Dormilich
8,658 Recognized Expert Moderator Expert
missing semi-colon.

@TheServant: strictly speaking, the self closing tag (<tagName />) is only required in XML, in HTML it is an error, which is gracefully ignored.
Jul 6 '10 #5
TheServant
1,168 Recognized Expert Top Contributor
@Dormilich
Ahhh yes. Now it's glaring me in the face. I have spent too long in VB, forgetting my semi-colons :S

And thanks for the XML/HTML correction. I can't stand incorrect things like that... One of my pet hates.
Jul 6 '10 #6

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

Similar topics

3
by: Jason | last post by:
hello, i am new to PHP, so go easy. I am using the examples in the book: PHP: Your Visual Blueprint For Creating Open Source, Server Side Content In the section where they talk about...
3
by: dcinfinite | last post by:
dear all.. i have a problem..when i start a new project, theres an error message saying "visual studio.net cannot create or open application Website " Http://localhost/Webapplication1" not...
8
by: Rod | last post by:
I have been working with ASP.NET 1.1 for quite a while now. For some reason, opening some ASP.NET applications we wrote is producing the following error message: "The Web server reported...
1
by: Jeff | last post by:
I am testing my ASP page and when I click on the link to open up my new asp page I get "page cannot be displayed". When another person clicks on the she gets a descriptive error message about a...
0
by: daniel_xi | last post by:
Hi all, I am getting this error message when I try to open a project in Visual Studio .NET 2003. Now, this is happening only for one of my projects, the rest are fine. This particular project is...
2
by: sesling | last post by:
Our Database stores event messages in a table called eventnotifications. The table has a message type column. There are two types of messages (alert or info). I have created a form that includes a...
0
by: jonny | last post by:
The XML page cannot be displayed Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later. ...
3
by: Sami Vaisanen | last post by:
Hello group, I'm writing a C++ based application that embeds the python engine. Now I have a problem regarding exception/error information. Is there a way to get the exception message and...
7
by: rajkumarbathula | last post by:
Hi I am creating a usercontrol in .net and using that as webpart in sharepoint site. i want to make use of ajax in my user control. and hence i added scriptmanager, updatepannel and update...
10
by: Anthony97 | last post by:
I get the following error message Run-time error '2455' you entered invalid reference to the property FileSearch ...
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
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...
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: 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?
0
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 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.