Announcement

Collapse
No announcement yet.

header("Location:") within Actinic

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    header("Location:") within Actinic

    Hi everybody

    I've been playing around with PHP within actinic and trying to come up with a simple login script. It's all working okay except for one thing - the header("Location:") field.

    It works fine in a separate function, however when I include it within actinic, the header doesn't seem to work.

    Here's the code I've included within actinic:-

    PHP Code:
    <?php

    if (!isset($_SESSION['admin_logged_in'])) {
      
    header('Location: http://www.google.com');
    }
    if (isset(
    $_SESSION['admin_logged_in']))

        echo 
    "Admin set!";

    ?>
    The function works as if I replace the "header(Location..." with a meta refresh it works within actinic, just can't seem to figure it out why.

    #2
    The inbuilt php engine only runs on the desktop as a page is compiled, it's not an online php engine, maybe you've mixed that bit up if i've understood what you are trying to do. You can rename normal pages to be .php in actinic if required.

    Comment


      #3
      Cheers Lee. I was still naming the pages as .html but using the php block include. Didn't know you could rename the pages .php and it still work. Cheers

      Comment


        #4
        I've been asked to create a login for a Sellerdeck site and found this;
        I have created a simple login using the help page at https://www.tutorialrepublic.com/php...gin-system.php

        I have added a few lines of code to my htaccess file;
        AddType application/x-httpd-php .html
        AddHandler php5-script .php .html

        This is so I can run the php at the top pf the pages in the Sellerdeck html files;
        <?php session_start(); if(!isset($_SESSION["loggedin"]) || $_SESSION["loggedin"] !== true){ header("location: login.php"); exit; } ?>
        <!doctype html>
        ….

        Comment

        Working...
        X