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 05-27-2008, 05:17 PM   #1 (permalink)
The Contributor
 
Join Date: May 2008
Location: Iran
Posts: 53
Thanks: 33
Yoosha is on a distinguished road
Unhappy Some functions NOT DEFIND!

Hi,
Some functions not defined! Why?

Notice: Undefined variable: HTTP_GET_VARS
Notice: Undefined variable: dir_files
Notice: Undefined variable: PHP_SELF
...
Send a message via Yahoo to Yoosha
Yoosha is offline  
Reply With Quote
Old 05-27-2008, 06:22 PM   #2 (permalink)
The Wanderer
 
Join Date: May 2008
Posts: 17
Thanks: 2
Alex is on a distinguished road
Default

Quote:
Originally Posted by Yoosha View Post
Notice: Undefined variable: HTTP_GET_VARS
Notice: Undefined variable: dir_files
Notice: Undefined variable: PHP_SELF
...
1. Try $_GET instead
2. Not sure about this
3. Shouldn't you be using $_SERVER['PHP_SELF'] ?
Alex is offline  
Reply With Quote
Old 05-27-2008, 07:03 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

2. I'm guessing that's supposed to be an array key? After all, who puts underscores in their variable names, excluding PHP with their $_POST and $_GET, et cetera. (Hands up those who do!). Nonetheless, I assume it would be $data['dir_files'].
__________________
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 05-27-2008, 07:14 PM   #4 (permalink)
The Prestige
Advanced Programmer Top Contributor Good Samaritan 
 
sketchMedia's Avatar
 
Join Date: Oct 2007
Location: Manchester, UK
Posts: 854
Thanks: 32
sketchMedia is on a distinguished road
Default

i think that its because you have 'register_globals' off, you can only access $PHP_SELF with register globals on i think.

use $_SERVER and other superglobals instead.
__________________
mysql> SELECT * FROM `users` WHERE `users`.`clue` > 0;
Empty set (0.00 sec)
sketchMedia is offline  
Reply With Quote
Old 05-27-2008, 10:01 PM   #5 (permalink)
The Frequenter
Zend Certified 
 
Join Date: Sep 2007
Location: Denmark
Posts: 352
Thanks: 8
Kalle is on a distinguished road
Default

First off, its not functions its magic variables/arrays! =)

Notice: Undefined variable: HTTP_GET_VARS
This is due to register_long_arrays being off, use $_GET insted of $HTTP_GET_VARS or activate register_long_arrays (deprecated not recommeded!)

Notice: Undefined variable: PHP_SELF
This is due to register_globals, use $_SERVER['PHP_SELF'] insted or activate register_globals (deprecated and not recommeded!)

Notice: Undefined variable: dir_files
That not a PHP variable, its a custom variable in the script, the notice is generated in examples like the one below:

PHP Code:
foreach(php_uname() as $key => $value)
{
    
/** Notice: Undefined variable: uname */
    
$uname .= $key ': ' $value PHP_EOL;

To fix such notices you need to define the variable before usage, in the example above we would have to put this in before we run the foreach loop:

PHP Code:
$uname ''
__________________

Last edited by Kalle : 05-28-2008 at 12:01 AM.
Send a message via MSN to Kalle Send a message via Skype™ to Kalle
Kalle 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


All times are GMT. The time now is 11:56 PM.

 
     

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