PHP Web Host - Quality Web Hosting For All PHP Applications Free RavenNuke(tm) Add Ons
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.
Author Message
SuperCat
Hangin' Around


Joined: Nov 27, 2004
Posts: 37
Location: MN

PostPosted: Mon Dec 13, 2004 9:13 am Reply with quote Back to top

In my experience from making a lot of blocks and moules for users, i have come to find that a certain percentage of users have problems when an array is accessed when it is not formatted correctly. This also applies to server variables like $_SERVER[HTTP_USER_AGENT].

An array is basically many variables in one. Instead of having this:
Code:
$var1 $var2 $var3 etc...


We can have everything inside $var like:
Code:
 $var[1] $var[2] $var[3] etc...


Anyways, when accessing these vars, theres a correct way to do them and a wrong way in certain circumstances. Basically 3 possible ways. 2 are correct, 1 is wrong.

Examples of this:

Inside double quotes (correct):
Code:
echo "$var[1]";


Outside double quotes (correct) (notice the single quotes):
Code:
if ($var['1'] == 10) { echo "$var[1]"; }


Outside double quotes (wrong) (missing single quotes on var outside double quotes):
Code:
if ($var[1] == 10) { echo "$var[1]"; }


The wrong style may work on most users, but it doesnt work on ALL users.

PHP-Nuke is littered with bad arrays.

This is probably the cause of the login security code problem for nuke 7.5 and 7.6 discussed in another thread.
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
Display posts from previous:       
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum