Jump to content

Recommended Posts

echo $data1;

 

try this

 

<?php
$data1 = $_GET['data1'];
echo $data1;
?>

 

Both of you, worked like a charm.

 

I appreciate the quick response, I'm new to PHP so maybe you guys can assist me with problems in the future.

 

:thumbs up:

 

$data1 = $_GET['data1']; is an assignment statement. The output to the browser by the original code is <body></body>. What were you expecting to be displayed?

 

Ahh, makes sense - the $_GET tells the browser to grab the information from the URL and the echo displays it. When is it appropriate to use print vs echo?

Link to comment
https://forums.phpfreaks.com/topic/154383-http-get-not-working/#findComment-811703
Share on other sites

Ahh, makes sense - the $_GET tells the browser to grab the information from the URL and the echo displays it. When is it appropriate to use print vs echo?

 

For the most part, use which ever you prefer. See this discussion (linked to from the php manual) :

 

http://www.faqts.com/knowledge_base/view.phtml/aid/1/fid/40

Link to comment
https://forums.phpfreaks.com/topic/154383-http-get-not-working/#findComment-811715
Share on other sites

echo $data1;

 

try this

 

<?php
$data1 = $_GET['data1'];
echo $data1;
?>

 

Both of you, worked like a charm.

 

I appreciate the quick response, I'm new to PHP so maybe you guys can assist me with problems in the future.

 

:thumbs up:

 

$data1 = $_GET['data1']; is an assignment statement. The output to the browser by the original code is <body></body>. What were you expecting to be displayed?

 

Ahh, makes sense - the $_GET tells the browser to grab the information from the URL and the echo displays it. When is it appropriate to use print vs echo?

perhaps you should read up a little on echo and print.

Link to comment
https://forums.phpfreaks.com/topic/154383-http-get-not-working/#findComment-811716
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.