$_GET call between URL

Posted on 2017-04-04
Last Modified: 2017-04-04
if( $_GET["shortcode"]) {
$api = file_get_contents(""$_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"$_GET["shortcode"]"/");

Open in new window

Question by:Mehran Goudarzi
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

by:Leonidas Dosas
ID: 42077653
Try with isset function:

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

Open in new window


Accepted Solution

Peos John earned 500 total points
ID: 42077660
You need to add dot(.) to concat the string, Please check the below line.

$api = file_get_contents("".$_GET["shortcode"]."/");      

Open in new window

LVL 110

Expert Comment

by:Ray Paseur
ID: 42077898
If you're new to PHP and want some good learning resources, this article can help.

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Extract data from output with RegEx 1 41
How do I add date to text file name 15 30
Change background images after 5 seconds. 12 48
Joomla Editing 3 23
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question