dcsimg
www.webdeveloper.com
Results 1 to 4 of 4

Thread: Passing variables (from callback) from one page to another with JQuery/Javascript?

  1. #1
    Join Date
    Dec 2013
    Posts
    8

    Passing variables (from callback) from one page to another with JQuery/Javascript?

    Hi,
    I want to make use of the API of oneall.com (http://docs.oneall.com/api/), with a social media plugin. After the login i want to route the user to the next page, and normally you should verify that with the connection_token (catched from the first page with the social login). On http://docs.oneall.com/services/impl.../social-login/ there is an example how to handle this with PHP.

    PHP Code:
    <?php
     
    //Check if we have received a connection_token
    [B]if ( ! empty ($_POST['connection_token']))[/B]
    {
      
    //Get connection_token
      
    $token $_POST['connection_token'];
    How can we do "if ( ! empty ($_POST['connection_token']))" in javascript/Jquery? Is that technically possible? I dont make use of PHP, thats the reason..

    Thanks a lot in advance.

  2. #2
    Join Date
    Mar 2007
    Location
    localhost
    Posts
    2,945
    Instead of using a $_POST variable, set a session variable and please post this in the PHP forum as this is not a JavaScript question.

    Ta.
    STOP using $ prefix on JavaScript variable names...
    Please remember to wrap any code you have in forum tags:-

    [CODE]...[/CODE] [HTML]...[/HTML] [PHP]...[/PHP]

    If you can't think outside the box, you will be trapped forever with no escape...

  3. #3
    Join Date
    Dec 2013
    Posts
    8
    Any other suggestions? I dont want to do this in PHP. I want to handle this with Jquery/Javascript/Ajax. Is there any possibility to do this?

  4. #4
    Join Date
    Mar 2007
    Location
    localhost
    Posts
    2,945
    Yes, use a form and GET rather than POST, you will need to URL encode the data and decode it between pages.

    You will have an issue over security as you will be exposing information to casual viewers who seek out exploitable sites.
    STOP using $ prefix on JavaScript variable names...
    Please remember to wrap any code you have in forum tags:-

    [CODE]...[/CODE] [HTML]...[/HTML] [PHP]...[/PHP]

    If you can't think outside the box, you will be trapped forever with no escape...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles