Search code examples
phppostback

PHP Postback URL


I would like to know how to get variables from postback url so I can insert them into database.

Example:

mywebsite.com/postback.php

When something is done on other website and not mine, website pings me back like:

mywebsite.com/postback.php?id=3&token=391

What exactly now do I need to put in postback.php file so I can get those variables and use them to update the database I'm connected to?


Solution

  • The response from the other website is a basic GET request You can access those variables in your postback.php file with the $_GET var

    $id = $_GET['id'];
    $token = $_GET['token'];
    
    (SQL Insert there)