Forums

Session IDs via &ID= in the URL. How do I capture the ID? (3 posts)

  1. stinski
    Member
    Posted 1 year ago #

    Hi all -- I'm new to this stuff but learning my way.

    I'm using a page driven by WordPress, and users will be directed to the page with a 32-digit ID appended to the URL.

    Example:

    http://www.MYURL.com/pageslug&ID=56gqenwe2889kjndfkv8nszif8jjfy6a/

    Does anyone know of a plugin that would help me capture that 32-digit ID? Any ideas? Thanks.

  2. Mark / t31os
    Moderator
    Posted 1 year ago #

    Anything in the URL strung together with ? and & is a query string (set of query parameters), you can capture that in PHP using..

    <?php
    if( isset( $_GET['ID'] ) ) {
       echo $_GET['ID']; // Print's the value for testing
       // Or store in var example
       $my_var = $_GET['ID'];
    }
    ?>

    or

    <?php
    if( isset( $_REQUEST['ID'] ) ) {
       echo $_REQUEST['ID']; // Print's the value for testing
       // Or store in var example
       $my_var = $_REQUEST['ID'];
    }
    ?>

    http://php.net/manual/en/reserved.variables.get.php
    http://php.net/manual/en/reserved.variables.request.php

  3. stinski
    Member
    Posted 1 year ago #

    Thanks so much -- will check it out.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags