Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Dec 2008
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Unhappy Redirect issue - whoever helps it get rapidshare acc

    I have problem, thx for in advance

    I have website and my problem is that i want user to go to first my homepage, they can't go to other pages first, if they type the url they redirect to my homepage and then they can go to other pages ? any idea guys ? need help really ....

    no sound in flash file - any suggestion ?

    THanks in advance

    If you anwser my solution i will give you rapidshare acc.

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Include a file on the other pages. In this file check for a session. If this session does not exist send them back to the index page. On the index page set the session. Then they would be able to go to other pages.

    checksession.php
    PHP Code:
    <?php
    session_start
    ();
    if(!isset(
    $_SESSION['home'])) header("Location: index.php");
    ?>
    Then in your pages add
    [php]<?php include_once('checksession.php'); ?>
    On your index page add this to the very top before any HTML.
    PHP Code:
    <?php
    session_start
    ();
    $_SESSION['home'] = "true";
    ?>
    As to the sound in the flash file we would need to see your page but its likely the sound path is wrong. Its relative to the location of the flash file not the web page.
    Last edited by _Aerospace_Eng_; 12-14-2008 at 08:03 AM.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    Regular Coder
    Join Date
    Dec 2006
    Posts
    166
    Thanks
    9
    Thanked 4 Times in 4 Posts
    Not the most secure, but you can try this...

    In your index.php (homepage) file, set a session variable:
    PHP Code:
    session_start();
    $_SESSION['checkpoint'] = "true"
    In your other pages do this
    PHP Code:
    session_start();
    if (!isset(
    $_SESSION['checkpoint']) || $_SESSION['checkpoint'] != "true")
      
    header('Location: index.php'); 
    Edit: XD I guess aerospace was 1 minute ahead of me
    Last edited by 194673; 12-14-2008 at 08:04 AM.


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •