| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| Senior Member Join Date: May 2005 Location: Ontario Canada
Posts: 3,088
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | what does this code mean? Hey i m reading a tutorial and they dont really explain what this line means: PHP Code:
__________________ |
| |
| | #2 (permalink) |
| NamePros Regular Join Date: Feb 2006 Location: Montreal, Quebec, Canada
Posts: 324
![]() | DUnno why they use the @ but it means PHP Code: |
| |
| | #4 (permalink) |
| Senior Member Join Date: Dec 2006 Location: England
Posts: 1,568
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | To add to what has been said, the line is what is called a ternary operator. I wrote a tutorial about them here: http://www.zoomcities.com/forum/showthread.php?tid=2362 I do not know why they have used the @ sign to suppress a potential warning either as there will not be one. That line i actually better written as: PHP Code: |
| |
| | #5 (permalink) | ||||||||
| NamePros Expert Join Date: Nov 2003 Location: Scotland
Posts: 5,069
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
| ||||||||
| |
| | #6 (permalink) |
| Senior Member Join Date: Dec 2006 Location: England
Posts: 1,568
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | True, i tend to advise most people to ignore notices unless they want to spend 90% of their time on endless pursuits of perfection. PHP Code: |
| |
| | #7 (permalink) | ||||
| NamePros Expert Join Date: Nov 2003 Location: Scotland
Posts: 5,069
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
| ||||
| |
| | #8 (permalink) | ||||||||
| NamePros Regular Join Date: Feb 2006
Posts: 584
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
????: NamePros.com http://www.namepros.com/showthread.php?t=275047 A suggestion would be to use php.ini or htaccess to change display_errors to off. Errors may reveal information to aid a hacking attempt. | ||||||||
| |
| | #9 (permalink) |
| NamePros Regular Join Date: May 2005 Location: England
Posts: 392
![]() ![]() ![]() | Showing all notices can be very annoying, for example if i did: PHP Code:
__________________ -Beaver6813.com - Web Developer Extraordinaire! |
| |
| | #10 (permalink) | ||||
| Senior Member Join Date: Dec 2006 Location: England
Posts: 1,568
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
| ||||
| |
| | #11 (permalink) | ||||
| NamePros Expert Join Date: Nov 2003 Location: Scotland
Posts: 5,069
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
all it would take to fix that notice is using the isset function on $_GET['code'] so the code would end up:- PHP Code: | ||||
| |
| | #12 (permalink) | ||||
| NamePros Regular Join Date: May 2005 Location: England
Posts: 392
![]() ![]() ![]() |
__________________ -Beaver6813.com - Web Developer Extraordinaire! | ||||
| |