Does this variable can be seen?

Hi, I just want to ask some help, Is it possible to pass variable to the site,using file_get_contents

$myvar = 6;


  $myresult = file_get_contents('http://some.mysite.com/populatedata.php?id=$myvar');


in the the populatedata.php
there will be a select statement
something like this.


   select * from my_table where id = $myvar
   .......
   .....

I need that var to be seen in the populatedata.php,is this possible ?

Thank you in advance.

For http://some.mysite.com/populatedata.php?id=6

In populatedata.php, $_GET[‘id’] will be 6

I think the OP is saying that the content of http://some.mysite.com/populatedata.php will depend on the value of the variable $myvar
So the contents of file_get_contents will change.

I do not know why the OP does not just try it and see what they get.

This may work.


$myvar = '6';
$myresult = file_get_contents("http://some.mysite.com/populatedata.php?id=$myvar");