General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old November 4th, 2003, 06:48 PM
thecharking thecharking is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 187 thecharking User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via AIM to thecharking
function not called?

ok i have two pages, and both use similar functions for doing different things: one is a user reg/add/edit page, another, movie reg/add/edit page. It jsut checks to see what is beign done and then makes the query depending on that. it works fine in my users page, but the movie page says the function has not been called! here is a little bit of both:

PHP Code:
if($IsLoggedIn)
    {
if(!
$_POST)
    {
    if(
$userLvl == 3)
        {
        switch(
$_GET['strMethod'])
            {    case 
"add":
                    
adminAdd();
                    break;
                case 
"edit";
                    
adminEdit();
                    break;
                    
                case 
"delete";
                    
deleteProfile();
                    break;
                    
            } } else {
                    if(
$details[0] == $_GET['userid'])
                        { switch(
$_GET['strMethod'])
                            {    case 
"edit";
                                    
edit();
                                    break;
                                
                                case 
"delete";
                                    
deleteProfile();
                                    break; } } else {
echo 
"You do not have the authorization to perform this function!"; } } } } else {
    
jump(); }
                
function 
adminAdd()
    {
$GLOBALS['getuserinfo'] = mysql_query("SELECT * FROM users WHERE userid = " $_GET['userid'] . " AND pending = 'yes'");
$GLOBALS['getpic'] = mysql_query("SELECT * FROM userpics WHERE userid = " $_GET['userid'] . " AND pending = 'yes'");

$GLOBALS['button'] = "Add!";
$GLOBALS['title'] = "Add Pending User!";
    }

//...... 


it continues sort of like that, butthe functions work... and then the movie one is almsot the same...

PHP Code:
if($IsLoggedIn&&$userLvl >= 2&&!$_POST)
    {

include( 
$_SERVER['DOCUMENT_ROOT'] . 'prp/security/connectMovies.php');

        switch(
$_GET['strMethod'])
            {    case 
"add":
                    
addMovie();
                    break;
                case 
"edit";
                    
editMovie();
                    break;
                    
                case 
"delete";
                    
deleteMovie();
                    break;
            }
                
function 
addMovie()
    {
$GLOBALS['getmovieinfo'] = mysql_query("SELECT * FROM movieinfo WHERE movieid = " $_GET['number'] . " AND pending = 'yes'");
//$GLOBALS['getpic'] = mysql_query("SELECT * FROM userpics WHERE userid = " . $_GET['number'] . " AND pending = 'yes'");

$GLOBALS['button'] = "Add!";
$GLOBALS['title'] = "Add Pending Movie!";
    }

//... 


this says function not called? why?
__________________
hey it's the CHARKING

Reply With Quote
  #2  
Old November 5th, 2003, 07:23 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
Try printing out each of the variables in your if statement to make sure they're being set correctly. Is it only the add function that won't run or is it the case that in the movies script, none of the functions referenced in the switch statement will run?

Reply With Quote
  #3  
Old November 5th, 2003, 10:24 PM
thecharking thecharking is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 187 thecharking User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via AIM to thecharking
i echoed them thats fine, and it doesn't work for any of them. I was thinking it's because it's calling a function that the script hasnt run into yet? but, my user script did it...

Reply With Quote
  #4  
Old November 6th, 2003, 07:11 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
Should there maybe be a slash in here:

PHP Code:
include( $_SERVER['DOCUMENT_ROOT'] . 'prp/security/connectMovies.php'); 


between the document root and the rest of the include path? If the include's not loading properly, maybe your functions aren't available to be run (though I'd think you'd get some pretty explicit errors in this case).

Reply With Quote
  #5  
Old November 6th, 2003, 01:44 PM
thecharking thecharking is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 187 thecharking User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via AIM to thecharking
fixed it

okay I decided that what was causing the error was that I had it all enveloped inside of an if statement (for security)... in the other script I hadnt done that, I had left the functions out of the if. So that fixed it. But I don't fully understand why.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > function not called?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT