TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 03-07-2009, 05:15 AM   #1 (permalink)
The Acquainted
 
KingOfTheSouth's Avatar
 
Join Date: Oct 2008
Location: Cincinnati
Posts: 151
Thanks: 14
KingOfTheSouth is on a distinguished road
Default Coding errors

Hey I know PHP but I am not really familiar with all the errors... Like I came across a error
Quote:
Parse error: syntax error, unexpected T_VARIABLE in /home1/clubbink/public_html/changestatus.php on line 8
I did not know what it meant and I still don't know what it meant.. If some could post like some basic errors like this and what it means I would appreciate it...

Thanks, King
KingOfTheSouth is offline  
Reply With Quote
Old 03-07-2009, 11:31 AM   #2 (permalink)
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

Most syntax errors are very basic typing mistakes: most often missing a semi-colon off of the end of the previous line of code, or not matching up your parenthesis pairs.
Salathe is offline  
Reply With Quote
Old 03-07-2009, 05:24 PM   #3 (permalink)
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
Wildhoney is on a distinguished road
Default

Salathe is right.

I never really come across any PHP errors such as these any more. However, when I used a simple application for programming, such as Notepad, these errors were commonplace.

Try using Zend Studio or something similar. They will point out the syntax errors before you even attempt to execute the script.
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote
Old 03-07-2009, 09:39 PM   #4 (permalink)
The Wanderer
 
Join Date: Feb 2008
Posts: 15
Thanks: 2
Mathew is on a distinguished road
Default

The error you have means it's come across a variable it wasn't expecting. You will have left out a ';'.

Read the error, it tells you exactly what's wrong.
Mathew is offline  
Reply With Quote
Old 03-07-2009, 09:45 PM   #5 (permalink)
The Acquainted
 
KingOfTheSouth's Avatar
 
Join Date: Oct 2008
Location: Cincinnati
Posts: 151
Thanks: 14
KingOfTheSouth is on a distinguished road
Default

Not always
KingOfTheSouth is offline  
Reply With Quote
Old 03-07-2009, 10:41 PM   #6 (permalink)
Wizard
Top Contributor 
 
Village Idiot's Avatar
 
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
Village Idiot is on a distinguished road
Default

Quote:
Originally Posted by KingOfTheSouth View Post
Not always
That is because you have not properly investigated what the terms mean, but have simply defaulted to "I don't know what it means". Lets break this apart (all this information is available on Google)

Parse error: This means that it had a problem reading the code
syntax error, This means that the error lies within the grammatical structure of the program
unexpected T_VARIABLE this means that it found a variable when it did not expect one (IE when it is not allowed to be present).
in /home1/clubbink/public_html/changestatus.php on line 8 This provides the location where it ran into the error.

To basically, this message says that you placed a variable where it should not be on line eight. These errors are most commonly forgotten semi-colons, but can manifest themselves in forgetting or misplacing anything.

If that is not descriptive enough, I don't know what is.
__________________

Village Idiot is offline  
Reply With Quote
Old 03-07-2009, 10:53 PM   #7 (permalink)
The Contributor
 
Sakakuchi's Avatar
 
Join Date: Feb 2009
Posts: 64
Thanks: 1
Sakakuchi is on a distinguished road
Default

Got this error last week to. What I had done was the following:

PHP Code:
    print <<< END
        Talk PHP rules :)
    END; 
and that is how it should like:
PHP Code:
print <<< END
        Talk PHP rules :)
END; 
The Token at the end may not have any tabs or spaces. -> So it didnt close the string - and gave that error to.
Sakakuchi is offline  
Reply With Quote
Old 03-11-2009, 02:02 AM   #8 (permalink)
The Acquainted
 
KingOfTheSouth's Avatar
 
Join Date: Oct 2008
Location: Cincinnati
Posts: 151
Thanks: 14
KingOfTheSouth is on a distinguished road
Default

Yeah, I understand that
KingOfTheSouth is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Coding Standards Ross TalkPHP Developer Team 18 07-20-2008 12:40 PM
Muting errors in PHP5 Ross General 4 06-30-2008 03:13 PM
New Coding Tutorials Site Third_Degree Show Off 9 06-10-2008 01:42 PM
Where and when do you find yourself coding? bmicallef The Lounge 7 12-14-2007 02:05 AM


All times are GMT. The time now is 07:49 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design