Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 11-28-2005, 06:30 PM Arrays & Php
amw_drizz's Avatar
Ultra Talker

Posts: 340
Name: Jon
Location: New York
Trades: 0
Okay im not a complete newb when it comes to php, i can at least attempt to find my way out of dark cave. but i have just started in to learning how to use arrays and if statments to call other pages. before i started using arrays it always relied on a unsecure if statement. and in my attempts to get it to work more securley i screwed up somewere

this is the code that calls other pages
PHP Code:
                        $function $_GET['function'];
                        
$page $_GET['p'];
                        
$do $_GET['do'];
                        
                        
$do_arrary = array(
                                                
'login'  =>  '/scripts/login.php',
                                                
'signup' =>  'scripts/signup.php',
                                                
'logout' =>  'scripts/logout.php',
                                                
'recover_pass' => 'scripts/recoverpass.php',
                                                
'change_pass'  => 'scripts/changeuserpass.php',
                        );
                        
                        
$actions = array(   
                                                
'empty'    => '',
                                                
'blank'    => 'pages/home.php'
                                                
'pak'      => 'pages/pak.php'
                                                
'about'    => 'pages/about.php',
                                                
'contact'  => 'pages/contact.php',
                                                
'news'     => 'pages/news.php',
                                                
'contact'  => 'pages/contact.php',
                                                                

                         ); 
                        
                        if (
$function == "offline") {
                        echo 
"<center><h1>Sorry Function Not Avalible Yet</h1></center>";
                        exit;
                        }
                        
                        if(
$do || array_key_exists($do$do_array)){
                        include(
$do_array$do ]);
                        
$do_action '1';
                        }
                        else{
                        
$do_action '0';
                        }
                                            
                        if(
$do_action == 0){
                        if(!isset(
$page) || !array_key_exists($page$actions)) {
                          
//  $HTTP_GET_VARS['page'] = 'blank'; // set a default 
                        
$page 'blank';
                        include(
$actions$page ]);
                        }
                        else{
                        include(
$actions$page ]); 
                        }
                        } 
Whats happing is that the $do_array for some reason is not yeilding the pages im looking for. and when ever that array is parsed it says that there are no pages to be found for inclusion.
__________________
AMW_Drizz
Dev Machine:: Apache 2.2.6 PHP 5.2.6 MySQL 5.1
amw_drizz is offline
Reply With Quote
View Public Profile Visit amw_drizz's homepage!
 
 
Register now for full access!
Old 11-28-2005, 06:54 PM
0beron's Avatar
Defies a Status

Posts: 1,832
Location: Somewhere else entirely
Trades: 0
$do_arrary = array(

^ You mis-spelled array when defining it?
__________________
UPDATE 0beron SET talkupation = talkupation + lots WHERE post = 'helpful';

Please login or register to view this content. Registration is FREE
(aka MSN handwriting for forums)
0beron is offline
Reply With Quote
View Public Profile Visit 0beron's homepage!
 
Reply     « Reply to Arrays & Php
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

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





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.22583 seconds with 12 queries