943,796 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 351
  • PHP RSS
Jul 14th, 2009
0

using multiple php files

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
nrbsneil is offline Offline
3 posts
since Jul 2009
Jul 14th, 2009
0

Re: using multiple php files

you use include function.
u can read more here
http://us3.php.net/manual/en/function.include.php
Reputation Points: 17
Solved Threads: 8
Posting Whiz in Training
mrcniceguy is offline Offline
278 posts
since Mar 2008
Jul 14th, 2009
0

Re: using multiple php files

something like this would be helpful:

php Syntax (Toggle Plain Text)
  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. }
Reputation Points: 11
Solved Threads: 12
Junior Poster in Training
sikka_varun is offline Offline
94 posts
since Dec 2008
Jul 14th, 2009
0

Re: using multiple php files

Many thanks mrcniceguy

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

Neil


Click to Expand / Collapse  Quote originally posted by mrcniceguy ...
you use include function.
u can read more here
http://us3.php.net/manual/en/function.include.php
Reputation Points: 10
Solved Threads: 0
Newbie Poster
nrbsneil is offline Offline
3 posts
since Jul 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: web crawler
Next Thread in PHP Forum Timeline: What i've done wrong?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC