I tried finding it, but I couldn't.
Main Topics
Browse All TopicsI'm not quite sure what they mean here.
Here is my code.
It says line 58.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
katcarvell:
You have unbalanced parenthesis in your 'if' statement.
WRONG:
if ( (!isset($_POST['username']
die('You did not fill in a required field.');
CORRECT:
if (!isset($_POST['username']
There's a simple way to check unbalanced paranthesis in your code. As you read your code, start counting up for every opening parenthesis, and count down one for every closing parenthesis as shown below. At the end of the 'if' statement you should be at zero.
ie:
1 2 3 2 3 4 3 2
if ( (!isset($_POST['username']
Since you ended up at two, your statement is not balanced. I also ALWAYS suggest:
1) Using opening and closing braces even when there is a single statement after the 'if', or 'while' statement.
2) Use indenting of code after all 'if', 'while', 'for', 'switch', and other block level conditions. It helps eliminate mistakes and makes the intent of the code so much easier to see. I reformatted your original code as shown below.
//if the login form is submitted
if (isset($_POST['submit']))
{ // if form has been submitted
// makes sure they filled it in
if (!isset($_POST['username']
{
die('You did not fill in a required field.');
}
}
The error is between your "{" on line 54 and "}" on line 59. Between those two brackets, you have six left parenthesis, and only four right ones. Your error is on line 57, in which you have five left, and only three right. You need another ")" before the "II," and another ")" one at the end of the line. Try that and see if it works.
M.
katcarvell:
Also please take CoyotesIT advice and never post your true connection code anywhere. Anyone reading this post now could now have DBA privileges to your database. The first thing you should be doing at the moment is changing the usernames and passwords. The next time you have a similar post, change the connect line to read:
mysql_connect("datrabase name", "username", "password") or die(mysql_error());
@katcarvell: Maybe a little OT, but you are going to be debugging unpredictable behavior in this script soon, so I will try to offer a little guidance on the use of header().
header() is an inline command in PHP. After you issue header, the script keeps right on running. This makes sense - you can issue several header commands depending on your needs.
But header("Location: ") almost ALWAYS intends to send the browser to a new page. In order to do that and terminate the operation of your script in a predictable fashion, you need to add exit; after the header() statement. See lines 43 through 49 in your OP snippet.
Best regards, ~Ray
Business Accounts
Answer for Membership
by: CoyotesITPosted on 2008-12-29 at 09:52:07ID: 23257259
First off, you should change your mysql password now that you posted it to the world.
Next, you are probably missing your closing bracket on your opening if statement checking if the form has been submitted. I took a quick glance and it looks like you are just missing the close to the opening of:
if (isset($_POST['submit'])) {
....code
and possibly your while statement.
just go through and make sure you have all your open,close brackets.