PHP - Value Equals Anything?
Hello all,
Just a quick one here, I'm not sure what to put in the quotations of an if statement if I want to say if value equals ANYTHING. Thanks Similar Tutorials$test = substr_count($_POST['signature'], '>'); $test1 = substr_count($_POST['signature'], '<'); if ($_SESSION['logged_in'] != '1') { static $the_echo = 'You need to be logged in!'; } elseif ($_POST['change_box2'] != 'CHANGE') { static $the_echo = 'You must fill in the "CHANGE" box!'; } elseif ($test != '0') { static $the_echo = 'Contains illegal characters!'; } elseif ($test1 != '0') { static $the_echo = 'Contains illegal characters!'; } } echo $_POST['signature']; echo $test; ?> Those two echos a few lines above (echo $_POST['signature']; and echo $test;) come out to The Little Android and 0 yet it still echos illegal characters...what? This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=310935.0 i have this code <?php $rulepages = array(); $rulepages[] = array("name" => "1111213", "page" => "fasdd21.php", "id" => "1"); $rulepages[] = array("name" => "41231245152", "page" => "fasd.php", "id" => "2"); ?> <table width="100%"> <tr> <td width="15%"> <?php sort($rulepages); foreach($rulepages AS $rulepage){ echo "<a href=\"?id=".$rulepage["id"]."\">".$rulepage["name"]."</a>"; echo "<br />"; } ?> </td> <td width="80%"> <?php $id = $_GET["id"]; // ?? ?> </td> </tr> </table> what do i do to search the array where the id equals the get ? thanks Hi,
I'm using an example below regarding a whole URL. I'm looking for some conditional PHP that will display certain content depending on if the URL contains the word 'liz' if not, display else.
$host = $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; if($host == 'liz-4.website.com') This topic has been moved to CSS Help. http://www.phpfreaks.com/forums/index.php?topic=349596.0 Hi, I have a page on my Intranet which lists a bunch of install files (for example, Microsoft Office), which are stored in the same directory structure as the site itself. I also have a duplicate installs folder structure in another office, on their local server. I want to make it so that the link changes, depending on which office the user is in. To simplify: If (user is in London) display London link else display Blackpool link I've been trying to make it work via IP Address. The IP range in London is 10.44.6.* However, I can't make the script work with a wildcard (it works fine if I put a specific address in). The code I have so far is: Code: [Select] <?php $ip=$_SERVER['REMOTE_ADDR']; if ($ip == '10.44.6.*') { ?><a href="link1.php">Click Here</a><?php } else { ?><a href="link2.php">Click Here</a><?php }; ?> I think it may be an obvious solution, but if some kind person could perhaps point out my mistakes? Thanks, Dave |