$_GET call between URL

if( $_GET["shortcode"]) {
$api = file_get_contents("https://api.instagram.com/oembed/?url=http://instagram.com/p/"$_GET["shortcode"]"/");      
$apiObj = json_decode($api,true);      
$media_id = $apiObj['media_id'];
echo $_GET["shortcode"];

Open in new window

it not work . how can i call $_GET between URL

Open in new window

Mehran GoudarziAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

Peos JohnConnect With a Mentor PHPCommented:
You need to add dot(.) to concat the string, Please check the below line.

$api = file_get_contents("https://api.instagram.com/oembed/?url=http://instagram.com/p/".$_GET["shortcode"]."/");      

Open in new window

Leonidas DosasCommented:
Try with isset function:

if(isset( $_GET["shortcode"])){
//code here...

Open in new window

Ray PaseurCommented:
If you're new to PHP and want some good learning resources, this article can help.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.