Need Help with php, Parse error: syntax error, unexpected T_STRING, expecting ',' or ';'?
-
hi im new to php and im doing a very basic login system, when i view my work im gettin this error when the user has logged in and clicked on the members page. Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in C:\xampp\htdocs\member.php on line 9 my member.php is <?php session_start(); if (isset($_SESSION['username'])) echo "Welcome, ".$_SESSION['username'] ."!<br><a href='logout.php'>logout,</a>; else die"you must be logged in!"; ?> i know its basic but im very new to this and any help would be appriciated. thanks, liam
-
Answer:
You need double quotes " between the </a> tag and the ; otherwise it will see everything until the double quotes after die as part of the string die is a function, so you need to put its agrument in brackets. So it should read die("you must be logged in!");
LIAM at Yahoo! Answers Visit the source
Other answers
You need double quotes " between the </a> tag and the ; otherwise it will see everything until the double quotes after die as part of the string die is a function, so you need to put its agrument in brackets. So it should read die("you must be logged in!");
Mike
You need double quotes " between the </a> tag and the ; otherwise it will see everything until the double quotes after die as part of the string die is a function, so you need to put its agrument in brackets. So it should read die("you must be logged in!");
Punitha J
echo "Welcome, ".$_SESSION['username'] ."!<br><a href='logout.php'>logout,</a>"; need a double quotes at the end of line...just before semicolon You should put the die function in bracket with double inverted comma. That will make your programs run and don't leave any line blank line after the IF condition, as you're not using 2nd bracket "{ }" which is always recommended, so you need to make sure that you won't leave any blank line out there. Otherwise it may give you an error. Thanks!!!!!!!!!
Steve
echo "Welcome, ".$_SESSION['username'] ."!<br><a href='logout.php'>logout,</a>"; need a double quotes at the end of line...just before semicolon You should put the die function in bracket with double inverted comma. That will make your programs run and don't leave any line blank line after the IF condition, as you're not using 2nd bracket "{ }" which is always recommended, so you need to make sure that you won't leave any blank line out there. Otherwise it may give you an error. Thanks!!!!!!!!!
You need double quotes " between the </a> tag and the ; otherwise it will see everything until the double quotes after die as part of the string die is a function, so you need to put its agrument in brackets. So it should read die("you must be logged in!");
Punitha J
Related Q & A:
- I need help on what I need to buy or do.Best solution by Yahoo! Answers
- How do i correct syntax error?Best solution by Yahoo! Answers
- I need help with some horse questions, can you help me.Best solution by Yahoo! Answers
- Can't delete name off messenger address list, error code 40402,need help pls?Best solution by Yahoo! Answers
- How to correct syntax error in Yahoo mail page?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.