php-windows Digest 10 Apr 2004 14:48:15 -0000 Issue 2203
Topics (messages 23403 through 23408):
Including remote PHP script, Return DO NOT works.
23403 by: ricardo.junior.infosoftonline.com
23406 by: Svensson, B.A.T. (HKG)
23407 by: DvDmanDT
23408 by: Svensson, B.A.T. (HKG)
Re: Tuning mySQL, php and apache
23404 by: hubo
IIS 6.0, PHP 4 access violations
23405 by: Tomi Viikari
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
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.
--- End Message ---
--- Begin Message ---
You should have a closer look at the concept of a function.
A function are suposed to return a value (with "return"),
not a script.
Try this in your main script:
$fu = bar();
echo "$fu<br>\n";
--[in your include file you need to have something likje this:]----
function bar()
$val = "simples";
return $val;
}
------------------------------------------------
-----Original Message-----
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: 2004-04-10 03:55
Subject: [PHP-WIN] Including remote PHP script, Return DO NOT works.
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
--- End Message ---
--- Begin Message ---
Accutually, you _can_ return from included files, see manual for more info
on that..
Why it doesn't work, is because the script will include the generated HTML
from simples.php, which is probably nothing.. Meaning there will be no
return statement,, And when there's no return in the file, include() will
return the status of the include (true or false, 1 or 0).. To make that
work, try to rename simples.php to simples.txt and include it.. Cause then
it wont be parsed by the server before PHP gets it.. Hope it makes sense..
For both of you, look at this page:
http://php/manual/en/function.include.php#AEN5536
--
// DvDmanDT
MSN: dvdmandt€hotmail.com
Mail: dvdmandt€telia.com
"B.A.T. Svensson" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
> You should have a closer look at the concept of a function.
>
> A function are suposed to return a value (with "return"),
> not a script.
>
> Try this in your main script:
>
> $fu = bar();
> echo "$fu<br>\n";
>
> --[in your include file you need to have something likje this:]----
>
> function bar()
> $val = "simples";
> return $val;
> }
>
> ------------------------------------------------
>
>
>
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> To: [EMAIL PROTECTED]
> Sent: 2004-04-10 03:55
> Subject: [PHP-WIN] Including remote PHP script, Return DO NOT works.
>
> 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
--- End Message ---
--- Begin Message ---
I don't claim a script can't return a value. All I say is
that the key word "return" is meant to be used with functions,
not with scripts. In other words using "return" in a script,
like the previous suggestion, is a semantic mistake/fault,
and wont work as intended - in my naive oppinion, the
interpreter should return an error message if a return
is encountered outside a function.
It's all about sematics of usage.
-----Original Message-----
From: DvDmanDT
To: [EMAIL PROTECTED]
Sent: 2004-04-10 15:41
Subject: Re: [PHP-WIN] Including remote PHP script, Return DO NOT works.
Accutually, you _can_ return from included files, see manual for more
info on that..
Why it doesn't work, is because the script will include the generated
HTML from simples.php, which is probably nothing.. Meaning there will be no
return statement,, And when there's no return in the file, include()
will return the status of the include (true or false, 1 or 0).. To make that
work, try to rename simples.php to simples.txt and include it.. Cause then
it wont be parsed by the server before PHP gets it.. Hope it makes sense..
For both of you, look at this page:
http://php/manual/en/function.include.php#AEN5536
--
// DvDmanDT
MSN: dvdmandt$hotmail.com
Mail: dvdmandt$telia.com
"B.A.T. Svensson" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
> You should have a closer look at the concept of a function.
>
> A function are suposed to return a value (with "return"),
> not a script.
>
> Try this in your main script:
>
> $fu = bar();
> echo "$fu<br>\n";
>
> --[in your include file you need to have something likje this:]----
>
> function bar()
> $val = "simples";
> return $val;
> }
>
> ------------------------------------------------
>
>
>
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> To: [EMAIL PROTECTED]
> Sent: 2004-04-10 03:55
> Subject: [PHP-WIN] Including remote PHP script, Return DO NOT works.
>
> 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
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
You might want to have a look at (persistent connections)
http://www.mysql.com/news-and-events/newsletter/2002-11/a0000000086.html
and (connection pooling)
http://www.mysql.com/news-and-events/newsletter/2003-05/a0000000173.html or
http://dev.mysql.com/doc/connector/odbc/en/faq_3.html#Connection_pool
"Jim MacDiarmid" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
>
> I'm working with Apache 2.0 and MySQL 4.0.. I'm trying to tune the
> performance of my site. I was wondering if there was a way to grab an
> existing open persisent DB connection instead of opening a new one
> unless it's needed?
>
> Thanks in advance,
>
> Jim
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
server: Windows server 2003 standard / IIS 6.0
PHP: PHP 4.1.1
I've recently setup PHP on my Win2003 with IIS6,
Sometimes PHP works and other time it doesn't... ( after boot, better)
When it doesn't it just prints out:
PHP has encountered an Access Violation at XXX
Any ideas?
--- End Message ---