Jump to content


switch function and directories


4 replies to this topic

#1 HEki_

    Young Padawan

  • Members
  • Pip
  • 165 posts

Posted 26 December 2005 - 04:48 AM

Hi,
i never had problems with switch action and flash ... i put switch function on a php document which had flash as a navigation, than i used index.php?p= to call the pages ...
now i have main directory in which i have index.php on this index.php i have flash navigation. i also have a directory with some files in that main directory to which i want to link ...

<?php switch ($HTTP_GET_VARS[p])
{
//Default - case
case 'ir':
default:
include 'ir/ir.html';
break;
}
?>

how do i put the path for include??? this way is not working ... pls help

best regards
heki

#2 Chaos King

    Senior Programmer

  • P2L Staff
  • PipPipPip
  • 676 posts
  • Gender:Male
  • Location:Florida

Posted 26 December 2005 - 12:45 PM

Man, that script isn't even working correctly I bet. Its because its wrong.

<?php

switch ($HTTP_GET_VARS[p])
{

	case 'ir':
	include 'ir/ir.html';
	break;

	default:
	include 'pathto/news.php';
	break;
}
?>

Now to include the ir/ir.html, simple do index.php?page=ir
where it says 'pathto/news.php', you can put your news url there or the homepage there.

I hope that helps. It should work now. Good luck!

#3 rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 26 December 2005 - 01:33 PM

The way he has it now should work just fine. But i don't understand what you're trying to do.
I know it's nothing to do with including the news, but could you give a specific example of what you mean by "how do i put the path for include."
Also, according to what you said, the first paragraph on the following page should help, but if i'm right, it may not.
http://php.net/manua...ion.include.php

#4 HEki_

    Young Padawan

  • Members
  • Pip
  • 165 posts

Posted 31 December 2005 - 03:09 PM

Ok, the thing is:
www.heki.clan-sun.com

at the top you see the navigation. i load everything in the iframe ... but i would like to load via include function and php ... couse something isnt working right now. and it would be easier to change everything via include function than to go into the flash and play with that ...

so in the navigation i tried it as i have shown u above, but it didnt work, so i am guessing my path wasnt correct ... and it has to be shown differently with php. that is why i am asking you guys how must i show the path to the file ...

main directory:
index.php (with navigation and include function)
---->IR directory:
---->with ir.html (to which i want to link when the button on that index.php will be pressed)

hope i made it clear ...

Edited by HEki_, 31 December 2005 - 03:10 PM.


#5 Av-

    I Feel Left Out

  • Members
  • PipPipPipPip
  • 1,971 posts
  • Gender:Male
  • Location:10 ft. below sea level

Posted 03 January 2006 - 08:59 AM

try

./ir/ir.html






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users