PDA

View Full Version : Need syntax help...


AshleyQuick
11-13-2004, 10:16 PM
How can I add a second url to this? I can't seem to get the syntax right.

<?php
if($_SERVER["PHP_SELF"] == '/products/Templates/index.php') {
?>

Ash

marek_mar
11-13-2004, 11:27 PM
Add where/how??

if($_SERVER["PHP_SELF"] == '/products/Templates/index.php' || $_SERVER["PHP_SELF"] == $_2nd_url) {

maxnix
11-14-2004, 03:54 AM
Possible alternative...

if (eregi("(index1.php)|(index2.php)", $_SERVER["PHP_SELF"])) {

HTH,
Max

Fou-Lu
11-14-2004, 09:56 AM
Yeah, the number of ways you can change it is just rediculous.

Or's, else's ands, numerous different ways. I'd go with the first example there, as its a lot more clean cut than most other ways. Straight forward and simple.

Unless we are mistaken as to what you mean....

raf
11-14-2004, 04:52 PM
How can I add a second url to this?
Can you tell us what exactly you need?

marek_mar
11-14-2004, 05:06 PM
A way with which you can add more url's in the future.

<?
$allowed_url = array('index.php', 'index2.htm', 'and_so_on.php');
if(in_array($_SERVER['PHP_SELF'], $allowed_url))
{
// Do something.
}
?>