SEO Software
+ Reply to Thread
Results 1 to 5 of 5

Thread: Is there any way to do this in PHP (or with a combination of JS)?

  1. #1
    Registered User immediate is on a distinguished road immediate's Avatar
    Join Date
    Nov 2009
    Location
    kavoir.com
    Posts
    71
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Is there any way to do this in PHP (or with a combination of JS)?

    There's a login form on page A: http://www.example.com/A.html

    The 'action' attribute of which is: action="/B.html"

    So when someone logs in with the form on A.html, the data will be submitted to / visitor redirected to B.html.

    Now what I want is: there's an <iframe></iframe> on /C.html, framing B.html, is there any way so that when someone logs in with the form on A.html, the visitor is redirected to C.html and the login details is submitted to B.html that's framed on C.html in the <iframe></iframe>? So after the person logs in from A.html, he arrives at C.html with the actual CP dashboard framed in an <iframe>.

    I have absolutely no clue in achieving this. Maybe the form will be submitted to C.html first and C.html submits the login details to B.html (framed in C.html) via JavaScript? How?
    So you want to start a website and get prevalent? How about purchasing some website content database.


  2. SEO Software

  3. #2

    Default

    You mean passing variables between javascript on different frames?

    yes its possible, most browsers dont support this due to security risks

  4. #3

    Default

    You can try different browser , must be install javascript in your computer

  5. #4

    Default

    One way I've been passing variables to lightbox is to use the $_GET[]; instead of $_POST[]; so when you login still post those variables but when you get to c.html make the iframe tag

    <iframe src="http://b.php?user=$_POST['username']&pass=$_POST['pass']"></iframe>

    Then on b.php grab the variables from the QUERY string like this
    $_GET['user'];
    $_GET['pass'];

    That will atleast pass those variables to the iframe for you I'm not sure where you want it to go from there.

    P.S. passing usernames and passwords through URL strings could be a risky idea so you can encode the url with base64_encode(); so it would go

    $user = base64_encode($_POST['username']);
    $pass = base64_encode($_POST['password']);

    <iframe src="b.php?user=<?php echo $user; ?>&pass=<?php echo $pass; ?>"></iframe>

    Then in B.php use base64_decode(); like so
    $username = base64_decode($_GET['user']);
    $pass = base64_decode($_GET['pass']);

    None of this is tested I'm just going off what I have done in the past for similar situations.

  6. #5

    Default

    Why use JS??

    why not redirect them using the header tags?

    PHP Code:
    header("Location: usercp.php"); 
    And set up some cookies too

+ Reply to Thread

Tags for this Thread

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