user10531871
user10531871

Reputation:

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?

Upvotes: 0

Views: 3258

Answers (1)

Rémi Bosgaerd
Rémi Bosgaerd

Reputation: 150

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)

Upvotes: 1

Related Questions