using multiple php files

Reply

Join Date: Jul 2009
Posts: 3
Reputation: nrbsneil is an unknown quantity at this point 
Solved Threads: 0
nrbsneil nrbsneil is offline Offline
Newbie Poster

using multiple php files

 
0
  #1
Jul 14th, 2009
Hi guys,

This may seem a little simple, but I'm new to html/php programming so here goes

I have a listbox with six items on my page.

I would like to call a different php file depending on what option was selected

psudo code would be

if selection = 1 then use 1.php
if selection = 2 then use ...

Is this possible?
Any sample code would be very helpful.

My page has a variety of barcode types, and I would like to use the same input page but call different functions depending on which option was selected.

N eil
Neil
NRB Systems / UK
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 217
Reputation: mrcniceguy is an unknown quantity at this point 
Solved Threads: 4
mrcniceguy mrcniceguy is offline Offline
Posting Whiz in Training

Re: using multiple php files

 
0
  #2
Jul 14th, 2009
you use include function.
u can read more here
http://us3.php.net/manual/en/function.include.php
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 94
Reputation: sikka_varun is an unknown quantity at this point 
Solved Threads: 11
sikka_varun's Avatar
sikka_varun sikka_varun is offline Offline
Junior Poster in Training

Re: using multiple php files

 
0
  #3
Jul 14th, 2009
something like this would be helpful:

  1. switch($var)
  2. {
  3. case 1: include("1.php");
  4. break;
  5. case 2: include("2.php");
  6. break;
  7. case 3: include("3.php");
  8. break;
  9. }
VâRûN
---Happy to Help---
sikka_varun@yahoo.com
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 3
Reputation: nrbsneil is an unknown quantity at this point 
Solved Threads: 0
nrbsneil nrbsneil is offline Offline
Newbie Poster

Re: using multiple php files

 
0
  #4
Jul 14th, 2009
Many thanks mrcniceguy

Will look into this. I thought it must be straightforward.

Neil


Originally Posted by mrcniceguy View Post
you use include function.
u can read more here
http://us3.php.net/manual/en/function.include.php
Neil
NRB Systems / UK
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC