Skip to:
Content
Pages
Categories
Search
Top
Bottom

PHP If statement URL question

  • Avatar of thestasi
    thestasi
    Participant

    @thestasi

    Had a brain freeze and just can’t get this simple thing to work. I’m sure it’s very easy but I’m trying to write the following as in php

    IF page =“/” OR page contains the word blog then

    do this

    else

    do that

    end if

    **********************

    I’ve got this

    $url= $_SERVER['REQUEST_URI'];

    if ($url == “/”) : ?>

    however I keep fiddling with the OR part and can’t get it to work

    Also if I wanted to write later:

    if the page doesn’t =“/” or does not contain the word blog then do this…..

    Any ideas?

    Ta

    MW

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.