php-windows Digest 11 Apr 2004 12:22:10 -0000 Issue 2204

Topics (messages 23409 through 23413):

Re: Including remote PHP script, Return DO NOT works.
        23409 by: DvDmanDT
        23413 by: Svensson, B.A.T. (HKG)

GD doesn't work?
        23410 by: arno muhren
        23411 by: DvDmanDT

[POSTGRES] reading blob
        23412 by: Sara Rubis

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 ---
Quote from the manual:

"Handling Returns: It is possible to execute a return() statement inside an
included file in order to terminate processing in that file and return to
the script which called it. Also, it's possible to return values from
included files. You can take the value of the include call as you would a
normal function. This is not, however, possible when including remote files
unless the output of the remote file has valid PHP start and end tags (as
with any local file). You can declare the needed variables within those tags
and they will be introduced at whichever point the file was included. "

Therefore, it works as intended, and is not a fault of any kind.. The reason
it doesn't work for the OP is that the script tries to include the generated
output from the script on http://localhost/, which doesn't have any return
keywords, and thats why.. If he rename the file he tries to include to .txt,
it will work as he want it to..

http://php.net/manual/en/function.include.php - Example 11-7, and the text
right above it..
-- 
// DvDmanDT
MSN: dvdmandt€hotmail.com
Mail: dvdmandt€telia.com
"B.A.T. Svensson" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
> 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 ---
What is the point you want to make with this reference?

-----Original Message-----
From: DvDmanDT
To: [EMAIL PROTECTED]
Sent: 2004-04-10 18:05
Subject: Re: [PHP-WIN] Including remote PHP script, Return DO NOT works.

Quote from the manual:

"Handling Returns: It is possible to execute a return() statement inside
an included file in order to terminate processing in that file and return
to the script which called it. Also, it's possible to return values from
included files. You can take the value of the include call as you would
a normal function. This is not, however, possible when including remote
files unless the output of the remote file has valid PHP start and end tags
(as with any local file). You can declare the needed variables within those
tags and they will be introduced at whichever point the file was included. "

Therefore, it works as intended, and is not a fault of any kind.. The
reason it doesn't work for the OP is that the script tries to include the
generated output from the script on http://localhost/, which doesn't have
any return keywords, and thats why.. If he rename the file he tries to
include to .txt, it will work as he want it to..

http://php.net/manual/en/function.include.php - Example 11-7, and the
text right above it..
-- 
// DvDmanDT
MSN: dvdmandt$hotmail.com
Mail: dvdmandt$telia.com

"B.A.T. Svensson" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
> 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

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

--- End Message ---
--- Begin Message ---
Hi everyone,

I have a Windows 2003 Server installed with IIS, PHP, MySQL and Moodle
(Learning Environment) running on it, the problem is that all the jpg-files
are been shown as a white square with a red cross on it. I have enabled GD
in php.ini and when I take a look at my info.php file, it says that jpg is
supported...I have tried several things, but nothing works, hope someone can
help me with this.

Arno

--- End Message ---
--- Begin Message ---
Sounds like it has nothing to do with GD or PHP.. Probably a badly
configured Apache..

-- 
// DvDmanDT
MSN: dvdmandt€hotmail.com
Mail: dvdmandt€telia.com
"Arno Muhren" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
> Hi everyone,
>
> I have a Windows 2003 Server installed with IIS, PHP, MySQL and Moodle
> (Learning Environment) running on it, the problem is that all the
jpg-files
> are been shown as a white square with a red cross on it. I have enabled GD
> in php.ini and when I take a look at my info.php file, it says that jpg is
> supported...I have tried several things, but nothing works, hope someone
can
> help me with this.
>
> Arno

--- End Message ---
--- Begin Message ---
Hello,
I need a source function example for extracting a blob field from a postgres db and 
viewing it with browser.

Thanks,
Sara Rubis

--- End Message ---

Reply via email to