Including remote PHP script, Return DO NOT works.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi All,

I don't know if this is the wanted situation...
If you include a full URL path to a file in your own server (or specify a
remote php script) that has a RETURN statment, the value is not return
from this script (remotely or locally with full URL path).

See example below:

simples.php 's code:
<?
  $val = "simples";
  return $val;
?>
-----------------------------------------------
main_1.php 's code:
<?
   $resultado = include ("./simples.php");
   print_r($resultado);
?>
-----------------------------------------------
main_2.php 's code:
<?
   $resultado = include ("http://localhost/simples.php";);
   print_r($resultado);
?>
-----------------------------------------------

Running main_1.php (http://localhost/main_1.php) I got the following
output:

   simples

Running main_2.php (http://localhost/main_2.php) I got the following
output instead of "simples" as before:

   1

This is a normal situation?
If yes (or also if this is a bug), what could be done to return the result
of a remote script execution? There is another way to get the result of a
external execution?

I need this to external users be able to run SQL commands on my mysql
server without pass them my server password. I pretend to use a
username/password protection to do some users just access some tables...
There is something like that I can use?

Tahnks a lot,
Ricardo Jr.

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux