Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 122
  • Last Modified:

$_GET call between URL

<?php
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
http://instagram.com/p/"$_GET["shortcode"]"/");

Open in new window

0
Mehran Goudarzi
Asked:
Mehran Goudarzi
1 Solution
 
Leonidas DosasCommented:
Try with isset function:

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

Open in new window

0
 
Peos JohnPHPCommented:
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

1
 
Ray PaseurCommented:
If you're new to PHP and want some good learning resources, this article can help.
https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now