473,558 Members | 2,827 Online
Bytes | Software Development & Data Engineering Community
+ 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\Con tact Database\addent ry.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"]."\">
  7.     if (isset($_GET["master_id"])) {
  8.         //connect to database
  9.         $mysqli = mysqli_connect("localhost", "test", "test", "houseinsandiego");
  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 2156
8,658 Recognized Expert Moderator Expert
you forgot to close the last string part in line 5.
Jul 5 '10 #2
2 New Member
thanks, now, how about this other parse error?

Parse error: parse error in C:\wamp\www\Con tact Database\addent ry.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
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']."\" />"
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
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
1,168 Recognized Expert Top Contributor
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

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 getting values from a form submission, the book says:
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 started on this Web Server" can i have a solution to this?thanks..
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 the following error when attempting to create or open the Web project located at the following URL: 'http://localhost/WebApplication1'. 'HTTP/1.1 500...
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 Type Mismatch on a COM function call in whih I am passing a parameter. I see that I do have an error, but why am I NOT getting the same message the...
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 based on ASP.NET and has Web forms. The files for this project reside remotely on a Windows 2000 Server machine with IIS 6.0, .NET framework 1.1...
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 list box. The list box contains the following (alert, info, both). The ID for each value is hidden from the operator. alert has an ID of 1, info...
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. -------------------------------------------------------------------------------- A name was started with an invalid character. Error processing resource...
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 possibly the traceback into a string for example? I've been eyeballing the PyErr_ module and it seems fairly limited. In other words PyErr_Print() calls...
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 progress controls on to my ascx page. on output of the page, i am getting the error message as ......"Script controls may not be registered before...
by: Anthony97 | last post by:
I get the following error message Run-time error '2455' you entered invalid reference to the property FileSearch '*************************************************************************************** Set fs = Application.FileSearch With fs ' Set search directory and file type to search for .LookIn = strFileLocation ...
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.