• As webmaster of the village web site I have been asked to add something which I don’t thinks is possible!
    In the village is a small wild life area. At the gate is a notice with a QR code that leads to a YouTube video about what can be seen at this time in the area. What I have been asked to do is setup a means of directing the person using the QR code to the village web site and from there redirecting them to a YouTube video appropriate for the month or season.
    Is this possible, or more to the point, easily done? If it is, I’d appreciate a pointer to the how.

    • This topic was modified 1 year, 8 months ago by begadoc. Reason: clarification

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Generically, if the QR code takes them to a particular page in the site then auto redirects, you really just need a static file not a page and you could do something like:

    <?php 
    $month = date('m');
    
    if($month == 1){
    	header("Location: https://youtube.com/x");
    	die();
    } elseif($month == 2){
    	header("Location: https://youtube.com/y");
    	die();
    } elseif($month == 3){
    	header("Location: https://youtube.com/z");
    	die(); 
    } else {
       /* some default action... */
    }
    ?>
    

    Totally untested so just an idea.

    Thread Starter begadoc

    (@begadoc)

    Many thanks – will give that a try.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Conditional redirecting’ is closed to new replies.