Re: [PHP] differences in between these env. variables

2012-01-27 Thread Tedd Sperling
On Jan 11, 2012, at 9:24 PM, tamouse mailing lists wrote:

> Is there ever a case where SCRIPT_NAME does not equal PHP_SELF?

Was this every answered? I would like to know.

Cheers,

tedd


_
t...@sperling.com
http://sperling.com

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



Re: [PHP] differences in between these env. variables

2012-01-27 Thread Matijn Woudt
On Fri, Jan 27, 2012 at 6:09 PM, Tedd Sperling  wrote:
> On Jan 11, 2012, at 9:24 PM, tamouse mailing lists wrote:
>
>> Is there ever a case where SCRIPT_NAME does not equal PHP_SELF?
>
> Was this every answered? I would like to know.
>
> Cheers,
>
> tedd

I don't think it was answered, but I'll answer now. Yes, there is a difference.

At [1] you'll find a script that prints both SCRIPT_NAME and PHP_SELF.
For most of the time, the output will be the same. But now, try the
url at [2], and you'll see that it returns /dev/test/envvars.php for
SCRIPT_NAME, and /dev/test/envvars.php/a/b/c for PHP_SELF.

I hope this clears things up a bit.

- Matijn


[1] http://tijnema.myftp.org/dev/test/envvars.php
[2] http://tijnema.myftp.org/dev/test/envvars.php/a/b/c

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



RE: [PHP] differences in between these env. variables

2012-01-27 Thread admin

> -Original Message-
> From: Tedd Sperling [mailto:tedd.sperl...@gmail.com]
> Sent: Friday, January 27, 2012 12:09 PM
> To: php-general. List
> Subject: Re: [PHP] differences in between these env. variables
> 
> On Jan 11, 2012, at 9:24 PM, tamouse mailing lists wrote:
> 
> > Is there ever a case where SCRIPT_NAME does not equal PHP_SELF?
> 
> Was this every answered? I would like to know.
> 
> Cheers,
> 
> tedd
> 
> 
> _
> t...@sperling.com
> http://sperling.com
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


Ted I show on the 11 Jan there was 2 answers.

I'll extend your example. We now have a RewriteRule in apache like this:

RewriteRule ^files/?$ /directory/file.php [L,QSA]

Which will rewrite /files/... --> /directory/file.php

REQUEST_URI now contains how it was called by the browser,
'/files/something.php'
SCRIPT_NAME returns path to script (/directory/file.php), set by the SAPI
(apache, ..).
PHP_SELF returns also the path to script (/directory/file.php), but set by
PHP self.
I don't have any ORIG_PATH_INFO on my Ubuntu box, so be careful about this
one.

Recommended: Depends on which you need. I prefer PHP_SELF over SCRIPT_NAME,
but that's more personal choice.
Matijn




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



Re: [PHP] differences in between these env. variables

2012-01-27 Thread Adam Richardson
On Fri, Jan 27, 2012 at 12:09 PM, Tedd Sperling wrote:

> On Jan 11, 2012, at 9:24 PM, tamouse mailing lists wrote:
>
> > Is there ever a case where SCRIPT_NAME does not equal PHP_SELF?
>
> Was this every answered? I would like to know.
>
> Cheers,
>
> tedd
>

Yep, can be different:
http://stackoverflow.com/questions/279966/php-self-vs-path-info-vs-script-name-vs-request-uri

Adam

-- 
Nephtali:  A simple, flexible, fast, and security-focused PHP framework
http://nephtaliproject.com


RE: [PHP] Re: Getting Column Names from an AS400 Database

2012-01-27 Thread Cheryl Sullivan

Indeed!!  Thank you - got it going.  I am by no means a
database-connection expert (clearly)

-Original Message-
From: Maciek Sokolewicz [mailto:tula...@php.net] 
Sent: Thursday, January 26, 2012 11:48 AM
To: php-general@lists.php.net; Cheryl Sullivan
Cc: Jim Giner; php-general@lists.php.net
Subject: Re: [PHP] Re: Getting Column Names from an AS400 Database

On 26-01-2012 16:40, Cheryl Sullivan wrote:
>
> Thanks for your response... I changed the $outval line to
>
> $outval = odbc_columns($rs, "DB#LIBNAME", "%", "TABLENAME", "%");
>
> ...but still got the same error -
>
> Warning: odbc_columns() expects parameter 1 to be resource, object
given
> in D:\WAMP\www\directory\filename.php on line 13
>
>
> -Original Message-
> From: Jim Giner [mailto:jim.gi...@albanyhandball.com]
> Sent: Thursday, January 26, 2012 10:31 AM
> To: php-general@lists.php.net
> Subject: [PHP] Re: Getting Column Names from an AS400 Database
>
> I'm thinking that it should read
>
> $rs = $conn->execute($q);
> $outval = odbc_columns($rs, "DB#LIBNAME", "%", "TABLENAME", "%");
>
> You need to provide the results of the query to the odbc_columns, not
> the
> connection object.
> Just my guess since I've never used this.
>
According to the manual, the connection resource should be used.
But anyway, that's not the problem.

The problem is that you're starting with a COM Object, and all of a 
sudden try to use the odbc functions on it. Of course that blows up in 
your face, since COM !== ODBC.

Instead, you should use the properties and methods from the COM OLE 
Object you've instantiated. I don't know what these are exactly, but I'm

sure you'll be able to find them in the MSDN reference somewhere.

Just remember that using the COM API will make things a lot harder for 
you, since you can't rely on the PHP Manual to help you with anything. 
If you're familair with the OLE object you're using, it shouldn't post 
any problems though.

- Tul


Notice: This communication, including attachments, may contain information that 
is confidential and protected. It constitutes non-public information intended 
to be conveyed only to the designated recipient(s). If you believe that you 
have received this communication in error, please notify the sender immediately 
by return e-mail and promptly delete this e-mail, including attachments without 
reading or saving them in any manner. The unauthorized use, dissemination, 
distribution, or reproduction of this e-mail, including attachments, is 
prohibited and may be unlawful. Thank you.


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



[PHP] Re: ArrayInterator always true

2012-01-27 Thread TCP
I've got a temporary fix but still the iterator always return true,
still hope someone could help me out to point out the problem:)

//parseOptions utilitiese by tgckpg
function parseOptions ( $argStream, $handler ) {
//Chop first useless argument -- argv[0]
array_shift ( $argStream ) ;
//Initiate ArrayObject for iterator
$arrayobject = new ArrayObject ( $argStream ) ;
//Initiate iterator for iteration
$iterator = $arrayobject->getIterator();

//If options is set first
if( $iterator->valid() && preg_match ( '/^-\w$/', $iterator->current() 
) ) {
//iterate through whole argument stream
for (   ; $iterator->valid(); $iterator->next() ) {
//Check if reached next option
if( preg_match ( '/^-\w$/', $opts = 
$iterator->current() ) ) {
//Get current options
$currOpt = $opts;
//echo "$currOpt\n";
//Test if next stream is an option
for ( $iterator->next(); $iterator->valid(); 
$iterator->next() ) {
if ( preg_match ( '/^-\w$/', $opts = 
$iterator->current() ) ) {
//echo "$currOpt $opts\n";
$handler($currOpt);
$currOpt = $opts;
} else break;
//var_dump($iterator->valid());
}
}//End if
//echo "$currOpt $opts\n";
$handler($currOpt, $opts);
//A temporary fix for infinite 
loop<--
if(!$iterator->valid())
break;
}// End for
//If option is not set first.
} else {
//Try other approach.
}// End if
}

On Tue, Jan 24, 2012 at 4:18 AM, TCP  wrote:
> I'm trying to parse an $agrv array that contain options (without
> square brackets): [-a "abc" -b "bbc" "bcc" -d "dbc" -e -f]
> I use ArrayIterator to iterate through the line:
>  - whenever it reach /-\w/, it read through the following qoutes
> until it reach another /-\w/.
>
>
>
> The problem is it seems the $iterator->valid() always return TRUE and
> cause infinte loop.
>
>
> function parseOptions ( $argStream, $handler ) {
>        //Chop first useless argument -- argv[0]
>        array_shift ( $argStream ) ;
>        //Initiate ArrayObject for iterator
>        $arrayobject = new ArrayObject ( $argStream ) ;
>        //Initiate iterator for iteration
>        $iterator = $arrayobject->getIterator();
>
>        //If options is set first
>        if( $iterator->valid() && preg_match ( '/^-\w$/', $iterator->current() 
> ) ) {
>                //iterate through whole argument stream
>                for (   ; $iterator->valid(); $iterator->next() ) {
>                        //Check if reached next option
>                        if( preg_match ( '/^-\w$/', $opts = 
> $iterator->current() ) ) {
>                                //Get current options
>                                $currOpt = $opts;
>                                //echo "$currOpt\n";
>                                //Test if next stream is an option
>                                for ($iterator->next(); $iterator->valid(); 
> $iterator->next() ) {
>                                        if ( preg_match ( '/^-\w$/', $opts = 
> $iterator->current() ) ) {
>                                                //echo "$currOpt $opts\n";
>                                                //$handler($currOpt, $opts);
>                                                $currOpt = $opts;
>                                        }
>                                        var_dump($iterator->valid());
>                                }
>                        }//End if
>                        //echo "$currOpt $opts\n";
>                        //$handler($currOpt, $opts);
>                }// End for
>
>        //If option is not set first.
>        } else {
>                //Try other approach.
>        }// End if
> }
>
>
> I've no idea what is going on.
> Please help.
>
>
> Regards,
> Panguin
>
> --
> 筆使文富,卻使人窮。



-- 
Regards,
Panguin


[PHP] Re: Re: File upload in map drive with PHP

2012-01-27 Thread Michelle Konzack
Merhaba Mehmet YAYLA,

Am 2012-01-26 15:10:34, hacktest Du folgendes herunter:
> I'm using code this bellow.

...with an error!

>  method="post"> 
> Select image: 
> 

You can not use
action="upload_file.php?upload=1"

together with
method="post"

and you have to use
 

  

Thanks, Greetings and nice Day/Evening
Michelle Konzack

-- 
# Debian GNU/Linux Consultant ##
   Development of Intranet and Embedded Systems with Debian GNU/Linux
   Internet Service Provider, Cloud Computing


itsystems@tdnet Jabber  linux4miche...@jabber.ccc.de
Owner Michelle Konzack

Gewerbe Strasse 3   Tel office: +49-176-86004575
77694 Kehl  Tel mobil:  +49-177-9351947
Germany Tel mobil:  +33-6-61925193  (France)

USt-ID:  DE 278 049 239

Linux-User #280138 with the Linux Counter, http://counter.li.org/


signature.pgp
Description: Digital signature