SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Zealot txt3rob's Avatar
    Join Date
    Jul 2013
    Location
    Liverpool UK
    Posts
    199
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Jquery and PHP headers

    Hi

    I have a login page that I would like to use some jquery to style it but if i put it in when the user logs in it use's PHP header to redirect them to private.php but in the address bar the page still stays on login.php but shows the content of private.php.

    how can i force it to change to private.php as this will let the buttons work with out a refresh.

  2. #2
    SitePoint Addict bronze trophy vectorialpx's Avatar
    Join Date
    Dec 2012
    Location
    Bucharest
    Posts
    247
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    How does it have the content of "private.php" but the page is "login.php".
    Is it an include? Can you provide some code, to be more clear?

    If you still have the content of private.php, what's the problem?
    You can still use your buttons that work "with out a refresh"
    Be nice to nerds. Chances are you'll end up working for one - Bill Gates
    > photos | admin panel

  3. #3
    SitePoint Zealot txt3rob's Avatar
    Join Date
    Jul 2013
    Location
    Liverpool UK
    Posts
    199
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    // Redirect the user to the private members-only page. 
                
    header("Location: private.php"); 
                
                die(
    "Redirecting to: private.php"); 
            } 
    is the code but if i put

    Code:
    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.css" />
    <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
    <script src="http://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.js"></script>
    in to the page when i click login then login occurs but in the address bar it shows login.php but is showing the content of private.php and any button on the page does not work.

  4. #4
    SitePoint Addict bronze trophy vectorialpx's Avatar
    Join Date
    Dec 2012
    Location
    Bucharest
    Posts
    247
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    This code does not help. I need the structure - I can see an unclosed bracket there so, is this redirect after the login is done?.
    Does private include login?
    Be nice to nerds. Chances are you'll end up working for one - Bill Gates
    > photos | admin panel

  5. #5
    SitePoint Zealot txt3rob's Avatar
    Join Date
    Jul 2013
    Location
    Liverpool UK
    Posts
    199
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i've pasted my code to pastebin for you

    http://pastebin.com/xbu4zkdq

    Will it matter than private.php also includes

    Code:
    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.css" />
    <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
    <script src="http://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.js"></script>

  6. #6
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,801
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Does it make a difference if you move the script tags to the bottom of the page where they belong?
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">


Bookmarks

Posting Permissions

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