NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page Request: PHP Help

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 07-09-2006, 07:42 AM THREAD STARTER               #1 (permalink)
New Member
Join Date: Jan 2006
Location: USA
Posts: 20
DJDOG is an unknown quantity at this point
 



Request: PHP Help


Hello,

I feel really dumb asking this, but I'm in need of some help I like coding with functions like...

<?
function code() {
echo "code here";
}

switch ($action) {
case "Code":
code();
break;
}
?>

The question is I want to use like inside "code to do a & include type of thing like, ?action=Code&id=MoreCode "&id"

How would I go about doing this? (If so please tell me I'm dumb...)
DJDOG is offline  
Old 07-12-2006, 11:19 AM   #2 (permalink)
NamePros Regular
 
monaco's Avatar
Join Date: Jul 2005
Location: Tucson, AZ
Posts: 689
monaco will become famous soon enough
 



this ?foo=bar&baz=zeb... style of data passing is just using GET to send data. When the script runs, just use the $_GET variable. In the example above, $_GET['action'] would be "Code", $_GET['id'] would be "MoreCode".

I don't know what you mean by using &include in there...but your example won't work because nobody leaves register_globals turned on. You need to use $_GET to get at them.
__________________
My Website | My Blog
monaco is offline  
Old 07-15-2006, 02:50 AM   #3 (permalink)
New Member
Join Date: Jul 2006
Posts: 20
Scolls is an unknown quantity at this point
 



Not sure what you're asking, but if you're wanting to perhaps place all your own functions in a seperate php file and simply include for use in your code, you'd do something like this:

<?
function .... etc etc
//place all your functions in this file
?>

And then include like this in your program:

<?
include("path/functions_filename_whatever.php")
// now you can call your functions just as though they were inside this file
?>

Hope this helped... in case I understood your question correctly
Scolls is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Liquid Web Smart Servers  
All times are GMT -7. The time now is 02:27 PM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger