You are missing our premiere tool bar navigation system! Register and use it for FREE!

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 1027 guest(s) and 0 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - php Functions question [ ]
 Forum FAQ  •  Search  •   •  Memberlist  •  Usergroups   •  Register  •  Profile •    •  Log in to check your private messages  •  Log in

 
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
Author Message
LadyCherry
Lieutenant
Lieutenant


Joined: Aug 12, 2003
Posts: 190


PostPosted: Wed Nov 03, 2010 5:41 am Reply with quoteBack to top

Hello there,

I actually had a php question related to how nuke uses functions.

What im trying to do is create a page that uses functions and switches on its own with a URL such as:
http://testerfake.com/functions.php?op=main
then one like this:
http://testerfake.com/functions.php?op=second

Those would take you to the same file but the function in them would make it look like a different page.

I guess the trouble im having is (Without using phpnuke) having a page do that on its own. (Seeing the op and the main or second respectivly using switch and case)

Heres an example I have that is not working.

What am I missing? A parse url or something?

Code:

<?php
/************************************************************************/
/*Functions Example                                                     */
/************************************************************************/
function mainpage()
        {
        echo \\\"Main Page\\\";
        }

function secondpage()
        {
        echo \\\"Second Page\\\";
        //This would make it go back to main page:
        //mainpage();
        }

switch($op)
        {
        case \\\"main\\\":
        mainpage();
        break;

        case \\\"second\\\":
        secondpage();
        break;

        }
?>


Thank you so much for your time
Find all posts by LadyCherryView user's profileSend private message
v3x
Support Mod
Support Mod


Joined: Oct 19, 2004
Posts: 1041

Location: UK

PostPosted: Thu Nov 04, 2010 3:22 am Reply with quoteBack to top

What error do you get when you run the script?
Find all posts by v3xView user's profileSend private messageVisit poster's website
Display posts from previous:      
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next 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



Powered by phpBB © 2001, 2005 phpBB Group

Ported by Nuke Cops © 2003 www.nukecops.com
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::
Powered by TOGETHER TEAM srl ITALY http://www.togetherteam.it - DONDELEO E-COMMERCE http://www.DonDeLeo.com - TUTTISU E-COMMERCE http://www.tuttisu.it
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.040 Seconds - 334 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::