Page 1 of 1

i know, stupid question, but how..

Posted: Sat Jan 27, 2007 10:18 pm
by eaposztrof
in the /page/eng/ dir i have htm and php files
what i want: when the $page.htm not exits, include the $page.php

i try this, but i can't find the "or" function

Code: Select all

if ($page) {
read_html("page/".$language."/".$page.".htm") or read_html("page/".$language."/".$page.".php");
}
and i try this, but not working, when can't find the $spage_htm, crash:

Code: Select all

$spage_htm="page/".$language."/".$page.".htm";
$spage_php="page/".$language."/".$page.".php";
...
$spage = include_once $spage_htm;
	if(!$spage) {
		read_html($spage_php);
	} else {
		include($spage_htm);
	}
i hope i was clear.. thx..

Posted: Sat Jan 27, 2007 11:14 pm
by superdezign

Code: Select all

if(file_exists("page/".$language."/".$page.".htm"))
{
    // use the html page
}
else
{
    // use the php page
}
This is assuming you want the HTML version of the file to have priority

$_SERVER['PHP_SELF']

Posted: Sun Jan 28, 2007 12:16 am
by eaposztrof
thx.. and congrat for your page design!

when i want to request the selfpage (/asd/index.php) i use:

Code: Select all

$_SERVER['PHP_SELF']
and how i can request the selfpage vih options? like:
/asd/index.php?p=ceg

Re: $_SERVER['PHP_SELF']

Posted: Sun Jan 28, 2007 12:24 am
by wildwobby
eaposztrof wrote:thx.. and congrat for your page design!

when i want to request the selfpage (/asd/index.php) i use:

Code: Select all

$_SERVER['PHP_SELF']
and how i can request the selfpage vih options? like:
/asd/index.php?p=ceg
use $_GET['p']

Re: $_SERVER['PHP_SELF']

Posted: Sun Jan 28, 2007 12:36 am
by eaposztrof
wildwobby wrote:use $_GET['p']
so i can't get the full line?

the problem:

Posted: Sun Jan 28, 2007 12:48 am
by eaposztrof
the problem is:
i have included asd.php in the index.php, once i have more options, eg ?p=asd1&a=asd2, once just one, eg ?p=asd1. in the asd.php has a link, like ..href="".$page_url_with_options."&loadimage=".$nextimage."";
how i can get the real $page_url_with_options?

Posted: Sun Jan 28, 2007 1:24 am
by superdezign
Well it's a hell of a lot more sensible to $_GET['whatever'] per variable so you can actually use them, but to each his own.

Code: Select all

$_SERVER['PHP_SELF'].$_SERVER['QUERY_STRING'];

Posted: Sun Jan 28, 2007 1:32 am
by eaposztrof
superdezign wrote:Well it's a hell of a lot more sensible to $_GET['whatever'] per variable so you can actually use them, but to each his own.

Code: Select all

$_SERVER['PHP_SELF'].$_SERVER['QUERY_STRING'];
thx.. really:

Code: Select all

$_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING'];

Posted: Sun Jan 28, 2007 1:36 am
by superdezign
... Did I do that? :?