[PHP] Re: Can't find .php3 files

2008-01-09 Thread Peter Ford
Jim wrote:
> I'm sure this is a FAQ but I can't seem to come up with the right search
> keys to dig it out.
> I'm trying to help a friend migrate his application to php 5 from
> another system.  The problem seems to be that he references files
> (require, include, etc) that have a .php3 extension, however there are
> no files in those locations with the .php3.  There are files with .php
> extensions.  It's running on a system that has php 4 on it.
> 
> So I'm sure either php or Apache is rewriting the files somehow, but I
> don't know how.
> 
> Can someone please point me to the appropriate documentation or give me
> a hint as to what is going on here?
> 
> Thanks,
> Jim.

Take a look in the Apache reference docs for mod_rewrite (exactly where you look
depends on which version of Apache you are using).

Then search for (a) any .htaccess files in the web-app, and (b) any Apache
config files: this will be Linux-distro-dependent but somewhere like /etc/apache
or /etc/httpd might be the first thing to try...

You are looking for either directory-specific or system-wide Apache RewriteRule
directives, especially those that contain a pattern which matches ".php3"

If you can't find anything like that, then Apache ain't rewriting...

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



Re: [PHP] ereg help!

2008-01-09 Thread Richard Heyes

$out = basename($file, ".html") . ".com";

fairly limited i think, but simple.


Nothing wrong with being simple, and therefore both fast and easy to 
understand by a wider audience. The only downer I can immediately think 
of though is that whitespace isn't accommodated, but who really ends a 
file name with white space?


--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



RE: [PHP] Can't find .php3 files

2008-01-09 Thread Ford, Mike
Chris wrote:
> 
> > I think you misunderstood.  I have lots of file with things like
> > 
> > require "admin.php3"
> > 
> > But there is no admin.php3 anywhere.  There is however a file
> > admin.php. Since this works on the old server then something on
> > that system is translating a request for a .php3 file to .php I'm
> > guessing. Apache or php but I don't know which.
> 
> It will be apache.

If the line quoted above is exactly as it appears in the PHP script, then it 
will definitely *not* be Apache. A require with just a filename like that goes 
straight to the file system, with nary even a hint of a thought  of involving 
Apache.  So the admin.php3 file must exist *somewhere* in the file system.

As someone else suggested, I think your best bet is to examine the include_path 
setting in php.ini (via a phpinfo() script if necessary).

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
JG125, The Headingley Library,
James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 812 4730  Fax:  +44 113 812 3211 


To view the terms under which this email is distributed, please go to 
http://disclaimer.leedsmet.ac.uk/email.htm

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



[PHP] PHPInfo - the application

2008-01-09 Thread Richard Heyes
Does anyone have a URL for it? Naturally Google returns a lot of pages 
which are about the actual function.


Thanks.

--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



Re: [PHP] ereg help!

2008-01-09 Thread Anup Shukla

steve wrote:

On Tuesday 08 January 2008 20:30:29 Chris wrote:

I usually use preg_* functions so here's my go:



echo preg_replace('/\.php$/', '.com', $file);


The '$' at the end makes sure it's a .php file and won't cause problems 
with files like xyz.php.txt .



(otherwise I'd just use a straight str_replace).


Thanks

Guess i was just trying to over think it. Have not done much with files.


Steve



$out = basename($file, ".html") . ".com";

fairly limited i think, but simple.

--
Regards,
Anup Shukla

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



Re: [PHP] PHPInfo - the application

2008-01-09 Thread Lester Caine

Richard Heyes wrote:
Does anyone have a URL for it? Naturally Google returns a lot of pages 
which are about the actual function.


http://www.php.net/
just put phpinfo into the 'search for' and you will get the REAL data for it.

Google is never the best starting point when you know what you are looking for!

--
Lester Caine - G8HFL
-
Contact - http://home.lsces.co.uk/lsces/wiki/?page=contact
L.S.Caine Electronic Services - http://home.lsces.co.uk
MEDW - http://home.lsces.co.uk/ModelEngineersDigitalWorkshop/
Firebird - http://www.firebirdsql.org/index.php

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



Re: [PHP] PHPInfo - the application

2008-01-09 Thread Stut

Richard Heyes wrote:

Lester Caine wrote:

Richard Heyes wrote:
Does anyone have a URL for it? Naturally Google returns a lot of 
pages which are about the actual function.


http://www.php.net/
just put phpinfo into the 'search for' and you will get the REAL data 
for it.


Google is never the best starting point when you know what you are 
looking for!


Did you actually read my email? The subject is a rather good hint too.


Do you mean phpsysinfo? http://phpsysinfo.sf.net/

-Stut

--
http://stut.net/

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



Re: [PHP] PHPInfo - the application

2008-01-09 Thread Richard Heyes

Do you mean phpsysinfo? http://phpsysinfo.sf.net/


Bingo, thanks.

--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



Re: [PHP] PHPInfo - the application

2008-01-09 Thread Richard Heyes

Lester Caine wrote:

Richard Heyes wrote:
Does anyone have a URL for it? Naturally Google returns a lot of pages 
which are about the actual function.


http://www.php.net/
just put phpinfo into the 'search for' and you will get the REAL data 
for it.


Google is never the best starting point when you know what you are 
looking for!


Did you actually read my email? The subject is a rather good hint too.

--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



Re: [PHP] Can't find .php3 files

2008-01-09 Thread Jim

Ford, Mike wrote:

Chris wrote:
  

I think you misunderstood.  I have lots of file with things like

require "admin.php3"

But there is no admin.php3 anywhere.  There is however a file
admin.php. Since this works on the old server then something on
that system is translating a request for a .php3 file to .php I'm
guessing. Apache or php but I don't know which.
  

It will be apache.



If the line quoted above is exactly as it appears in the PHP script, then it 
will definitely *not* be Apache. A require with just a filename like that goes 
straight to the file system, with nary even a hint of a thought  of involving 
Apache.  So the admin.php3 file must exist *somewhere* in the file system.

As someone else suggested, I think your best bet is to examine the include_path 
setting in php.ini (via a phpinfo() script if necessary).

Cheers!

Mike

  

Hi, Mike,

The include is more like
require "../admin/admin.php3" 
I don't know exactly how Apache performs its magic so I wasn't sure that 
the request for an include file would even pass through Apache's hands.  
In my limited world, an include wouldn't have to involve Apache, just 
the file systems.


We did look at the php.ini file in /etc and it was pretty much 
innocuous.  Looked like a default from when the system was installed.  
I'll have a closer look today.


Thanks.
Jim

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



Re: [PHP] Can't find .php3 files

2008-01-09 Thread Anup Shukla

Jim wrote:

Hi, Mike,

The include is more like
require "../admin/admin.php3" I don't know exactly how Apache performs 
its magic so I wasn't sure that the request for an include file would 
even pass through Apache's hands.  In my limited world, an include 
wouldn't have to involve Apache, just the file systems.




The admin.php3 seems to be 2 levels above the current dir.

What about

print realpath("../admin/admin.php3")

in the same script?

--
Regards,
Anup Shukla

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



Re: [PHP] First stupid post of the year. [SOLVED]

2008-01-09 Thread Nisse Engström
On Mon, 7 Jan 2008 10:29:45 -0500, tedd wrote:

> At 12:03 PM +0100 1/7/08, Nisse Engström wrote:
>>How does the following pages compare? The display
>>should be identical:
>>
>>
>>
> 
> Nisse:
> 
> No, there is quite a difference depending upon 
> the text encoding used in my browser (Safari).

   You said that there was no windows-1252 setting
in Safari, so I am curious to know if it is capable
of mapping the 1252-encoded page to the correct
characters. If you set your browser to detect the
encoding *automatically*, does the two pages display
identically, or are there differences?

   According to the mappings at unicode.org, there
are a lot of difference between MACROMAN and CP1252,
for instance, the first character on the page (0x80)
is A-DIARESIS in MACROMAN and EURO SIGN in 1252.


/Nisse

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



Re: [PHP] Posting Summary for Week Ending 4 January, 2008: php-general@lists.php.net

2008-01-09 Thread Michelle Konzack
Hi Daniel,

Am 2008-01-04 18:31:00, schrieb Daniel Brown:
> Ignore that.  It's a new script that is going to start running as
> of 4:00p EST on 11 January, 2008.  It will summarize the number of
> messages to the list, then tell who posted how many, what size, et
> cetera.
> 
> There may be one or two more messages that will wind up getting
> sent because I accidentally manually ran the live script while testing
> it for the cron.

Is this a Joke?  --  I have gotten over 100 of them...

Thanks, Greetings and nice Day
Michelle Konzack
Systemadministrator
Tamay Dogan Network
Debian GNU/Linux Consultant


-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
# Debian GNU/Linux Consultant #
Michelle Konzack   Apt. 917  ICQ #328449886
   50, rue de Soultz MSN LinuxMichi
0033/6/6192519367100 Strasbourg/France   IRC #Debian (irc.icq.com)


signature.pgp
Description: Digital signature


RE: [PHP] Can't find .php3 files

2008-01-09 Thread Ford, Mike
On 09 January 2008 12:18, Anup Shukla wrote:

> Jim wrote:
> > Hi, Mike,
> > 
> > The include is more like
> > require "../admin/admin.php3" I don't know exactly how Apache
> > performs its magic so I wasn't sure that the request for an include
> > file would even pass through Apache's hands.  In my limited world,
> > an include wouldn't have to involve Apache, just the file systems.
> > 
> 
> The admin.php3 seems to be 2 levels above the current dir.
> 
> What about
> 
> print realpath("../admin/admin.php3")
> 
> in the same script?

That's quite a good suggestion.

Just to be clear about the other point, an include or require is purely file 
system based, *unless* you give it a full URL beginning with a protocol name 
such as http:// or ftp:// (which, as a general rule, is somewhat 
disrecommended!).

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
JG125, The Headingley Library,
James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 812 4730  Fax:  +44 113 812 3211 



To view the terms under which this email is distributed, please go to 
http://disclaimer.leedsmet.ac.uk/email.htm

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



Re: [PHP] Posting Summary for Week Ending 4 January, 2008: php-general@lists.php.net

2008-01-09 Thread Daniel Brown
No, go back over the archives or digests and you'll see that it
was supposed to be a once-per-week email for post tracking on the list
that went haywire.  It wound up sending over a hundred messages to the
list, which - in my opinion - also indicates a flaw in the mailing
list software.

On Jan 8, 2008 4:57 PM, Michelle Konzack <[EMAIL PROTECTED]> wrote:
> Hi Daniel,
>
> Am 2008-01-04 18:31:00, schrieb Daniel Brown:
> > Ignore that.  It's a new script that is going to start running as
> > of 4:00p EST on 11 January, 2008.  It will summarize the number of
> > messages to the list, then tell who posted how many, what size, et
> > cetera.
> >
> > There may be one or two more messages that will wind up getting
> > sent because I accidentally manually ran the live script while testing
> > it for the cron.
>
> Is this a Joke?  --  I have gotten over 100 of them...
>
> Thanks, Greetings and nice Day
> Michelle Konzack
> Systemadministrator
> Tamay Dogan Network
> Debian GNU/Linux Consultant
>
>
> --
> Linux-User #280138 with the Linux Counter, http://counter.li.org/
> # Debian GNU/Linux Consultant #
> Michelle Konzack   Apt. 917  ICQ #328449886
>50, rue de Soultz MSN LinuxMichi
> 0033/6/6192519367100 Strasbourg/France   IRC #Debian (irc.icq.com)
>



-- 


Daniel P. Brown
Senior Unix Geek and #1 Rated "Year's Coolest Guy" By Self Since 1979.

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



Re: [PHP] Can't find .php3 files

2008-01-09 Thread Jim

Ford, Mike wrote:

On 09 January 2008 12:18, Anup Shukla wrote:

  

Jim wrote:


Hi, Mike,

The include is more like
require "../admin/admin.php3" I don't know exactly how Apache
performs its magic so I wasn't sure that the request for an include
file would even pass through Apache's hands.  In my limited world,
an include wouldn't have to involve Apache, just the file systems.

  

The admin.php3 seems to be 2 levels above the current dir.

What about

print realpath("../admin/admin.php3")

in the same script?



That's quite a good suggestion.

Just to be clear about the other point, an include or require is purely file 
system based, *unless* you give it a full URL beginning with a protocol name 
such as http:// or ftp:// (which, as a general rule, is somewhat 
disrecommended!).

  

Thank you, that confirmed what I suspected.

Jim.

Cheers!

Mike


  


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



Re: [PHP] Posting Summary for Week Ending 4 January, 2008: php-general@lists.php.net

2008-01-09 Thread Daniel Brown
On Jan 9, 2008 2:01 AM, Wolf <[EMAIL PROTECTED]> wrote:
> Looks like your cron job is set for every minute Don!  Please disable it 
> until you get the kinks worked out of it!

That was all fixed last week, and no more messages have been sent
since that night.

My apologies once again to everyone for (what was supposed to be)
a surprise with good intentions in mind.  It should work just fine
now if the datacenter gets the dead hard drive swapped out soon
enough.

2008 is fun!

-- 


Daniel P. Brown
Senior Unix Geek and #1 Rated "Year's Coolest Guy" By Self Since 1979.

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



Re: [PHP] First stupid post of the year. [SOLVED]

2008-01-09 Thread tedd

At 1:19 PM +0100 1/9/08, Nisse Engström wrote:

On Mon, 7 Jan 2008 10:29:45 -0500, tedd wrote:


 At 12:03 PM +0100 1/7/08, Nisse Engström wrote:

How does the following pages compare? The display
should be identical:


 >>
 >>


 Nisse:

 No, there is quite a difference depending upon
 the text encoding used in my browser (Safari).


   You said that there was no windows-1252 setting
in Safari, so I am curious to know if it is capable
of mapping the 1252-encoded page to the correct
characters. If you set your browser to detect the
encoding *automatically*, does the two pages display
identically, or are there differences?

   According to the mappings at unicode.org, there
are a lot of difference between MACROMAN and CP1252,
for instance, the first character on the page (0x80)
is A-DIARESIS in MACROMAN and EURO SIGN in 1252.


Nisse:

Yes, I said that there is no "windows-1252" 
setting for Safari. It does not offer that 
"named" setting in it's list of text encodings 
available. There is no 1252 mentioned either -- 
however, that does not mean that it's not there 
under a different name. Understandably, I don't 
think Apple wants to use the term "windows" in 
it's list of text encodings.


There is no Automatic setting. You set whatever 
you want the default to be and that's it.


The:



looks good ONLY under UTF-8 setting.

The:



looks good ONLY under Western (ISO Latin 1).

If I use Western (Mac OS Roman) there is 
considerable difference, but it's not gibberish.


HTH's

tedd


--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] PHPInfo - the application

2008-01-09 Thread Lester Caine

Richard Heyes wrote:

Do you mean phpsysinfo? http://phpsysinfo.sf.net/


Bingo, thanks.


I bet google works as well now :)

THAT looks a very useful package and it's been sitting in the package list on 
all my Linux machines un-found.

I've already got it set up on the local network!

--
Lester Caine - G8HFL
-
Contact - http://home.lsces.co.uk/lsces/wiki/?page=contact
L.S.Caine Electronic Services - http://home.lsces.co.uk
MEDW - http://home.lsces.co.uk/ModelEngineersDigitalWorkshop/
Firebird - http://www.firebirdsql.org/index.php

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



Re: [PHP] http_request

2008-01-09 Thread peeyush gulati
Thank you all for your replies.

We just solved it down using HTTP_REQUEST.

1.What we did was using HTTP_REQUEST a request was send to login page with
post
data credentials like username, password and some other field if required.

2. Then using HTTP_RESPONSE the cookies that were being sent from the
application(viz wordpress,mediawiki) to the layer were retrieved into local
variables.

3. Finally the cookies were set using setcookie() depending what all cookies
were
to be set like sessionid, username and so on.

4. Then using header('Location:URL'); the page was directed to desired
loggedin
page and since the cookies were also set now so the user would not have any
issues in navigating through the application.

If anyone is still not clear or has some doubts please do tell also suggest
if this would have some loop holes.

Thanks once again all.

Peeyush


On Jan 5, 2008 10:18 PM, Daniel Brown <[EMAIL PROTECTED]> wrote:

> On Jan 5, 2008 11:41 AM, peeyush gulati <[EMAIL PROTECTED]> wrote:
> > Thank  you will do that
> >
> > Ok can i redirect the response to the browser from the layer after my
> layer
> > has recieved the response from the application.
>
>Absolutely.  That's the same premise under which the PayPal IPN
> works.  The script ("layer") sends a request to the application, and
> receives a response, parses it if necessary, and feeds that data back
> to the client.
>
> --
>  Daniel P. Brown
> [Phone Numbers Go Here!]
> [They're Hidden From View!]
>
> If at first you don't succeed, stick to what you know best so that you
> can make enough money to pay someone else to do it for you.
>



-- 
Thanks and Regards
Peeyush Gulati
+91-9916304135


Re: [PHP] Posting Summary for Week Ending 4 January, 2008: php-general@lists.php.net

2008-01-09 Thread Jochem Maas
Daniel Brown schreef:
> No, go back over the archives or digests and you'll see that it
> was supposed to be a once-per-week email for post tracking on the list
> that went haywire.  It wound up sending over a hundred messages to the
> list, which - in my opinion - also indicates a flaw in the mailing
> list software.

so do we call you 'PostTrack' or "PassTheBuck" from now on? ;-)

> 
> On Jan 8, 2008 4:57 PM, Michelle Konzack <[EMAIL PROTECTED]> wrote:
>> Hi Daniel,
>>
>> Am 2008-01-04 18:31:00, schrieb Daniel Brown:
>>> Ignore that.  It's a new script that is going to start running as
>>> of 4:00p EST on 11 January, 2008.  It will summarize the number of
>>> messages to the list, then tell who posted how many, what size, et
>>> cetera.
>>>
>>> There may be one or two more messages that will wind up getting
>>> sent because I accidentally manually ran the live script while testing
>>> it for the cron.
>> Is this a Joke?  --  I have gotten over 100 of them...
>>
>> Thanks, Greetings and nice Day
>> Michelle Konzack
>> Systemadministrator
>> Tamay Dogan Network
>> Debian GNU/Linux Consultant
>>
>>
>> --
>> Linux-User #280138 with the Linux Counter, http://counter.li.org/
>> # Debian GNU/Linux Consultant #
>> Michelle Konzack   Apt. 917  ICQ #328449886
>>50, rue de Soultz MSN LinuxMichi
>> 0033/6/6192519367100 Strasbourg/France   IRC #Debian (irc.icq.com)
>>
> 
> 
> 

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



[PHP] Re: [PHP-DB] forms and method POST - variables

2008-01-09 Thread Daniel Brown
On Jan 9, 2008 11:25 AM, Lukáš Moravec <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have one question about forms and php (which I use for Mysql too).
>
> Do I need for variables from any form in html and method POST (then in php
> script) to set these variables with:
>
> $variable=$_POST['variable'];
[snip!]

That's a question that should be asked on the PHP-General list,
actually.  I'm forwarding the response to that list with this message.

Are you receiving any errors?  Are any messages displayed when you
have the following at the beginning of the script?


$_GET and $_POST are predefined superglobal variables, which have
been available in PHP since dinosaurs roamed the Earth.

-- 


Daniel P. Brown
Senior Unix Geek and #1 Rated "Year's Coolest Guy" By Self Since 1979.


Re: [PHP] Posting Summary for Week Ending 4 January, 2008: php-general@lists.php.net

2008-01-09 Thread Daniel Brown
On Jan 9, 2008 1:45 PM, Jochem Maas <[EMAIL PROTECTED]> wrote:
> Daniel Brown schreef:
> > No, go back over the archives or digests and you'll see that it
> > was supposed to be a once-per-week email for post tracking on the list
> > that went haywire.  It wound up sending over a hundred messages to the
> > list, which - in my opinion - also indicates a flaw in the mailing
> > list software.
>
> so do we call you 'PostTrack' or "PassTheBuck" from now on? ;-)

No, you call me The Moron Who Commented-Out The Wrong Line And
Flooded The List With Test Data.

It's a long name, but it's accurate.  When I was running the cron
to see why the piped response wasn't working (as it turned out, I had
simply mistyped the address in valiases), it was supposed to send the
data directly to my email address only.  However, I commented out the
wrong line, and uncommented the line containing the
php-general@lists.php.net address.

Then, because I didn't know that it was working the whole time,
when I discovered the bugs and repaired them, the messages - sent
every minute by the cron for testing - were queued in the mailing list
database, pending confirmation of the sending address.  THIS is the
part I believe is a serious flaw in the mailing list software, because
it's been proven that all a malicious user would have to do is flood
the list, then confirm the address from which they sent the messages
after the queue has been flooded, and the messages will be dispatched.
 It should only hold a maximum of two messages in the queue, in my
[very] humble opinion.

The problem was that all of the messages were sitting in the queue
without my knowledge.  They were not being sent from the server when
they were being received by subscribers to the list, they were being
sent by the mailing list software.  This also identifies an issue that
would suggest that the mailing list system could be vulnerable to a
denial-of-service style of attack, where the queue is flooded with
thousands - even millions - of messages and doesn't dispose of them
properly.

So once again, my apologies, but I do think that the exercise
accidentally identified a security and stability issue with the list
software that should be addressed.  Maybe it can be done with a
setting, but it may require a hard-coded patch.  I don't know, but
hopefully someone else here does.

-- 


Daniel P. Brown
Senior Unix Geek and #1 Rated "Year's Coolest Guy" By Self Since 1979.

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



Re: [PHP] First stupid post of the year. [SOLVED]

2008-01-09 Thread Nisse Engström
On Wed, 9 Jan 2008 10:30:59 -0500, tedd wrote:

> Yes, I said that there is no "windows-1252" 
> setting for Safari. It does not offer that 
> "named" setting in it's list of text encodings 
> available. There is no 1252 mentioned either -- 
> however, that does not mean that it's not there 
> under a different name. Understandably, I don't 
> think Apple wants to use the term "windows" in 
> it's list of text encodings.
> 
> There is no Automatic setting. You set whatever 
> you want the default to be and that's it.

Interesting. Would you be kind enough to compare
the following pages (with  headers):

   
   

For what it's worth, the pages look identical when
viewed with Browsrcamp[1], both with and without[2]
 headers.


/Nisse

  -   -   -  

[1]: 
[2]: 
 

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



[PHP] PHP SOAP Client formats

2008-01-09 Thread Tim Traver

Hi all,

ok, I am a little bit new to the SOAP game, but I understand it, and am 
using it to talk to an outside API.


The problem that I have is that the server that I am talking to (that is 
not in my control), will accept the following SOAP call



http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";>
 
   https://api.authorize.net/soap/v1/";>
 
   name
   string
 
   
 



But it refuses a call that I have made using the SOAPClient PHP classes 
that look like this :



http://schemas.xmlsoap.org/soap/envelope/"; 
xmlns:ns1="https://api.authorize.net/soap/v1/";>
 
   
 
   name
   string
 
   
 


It appears that the one that PHP creates is all in line with all of the 
latest standards, and I know that the server is a Microsoft IIS server.


Does anyone know any parameters that I can use with the PHP SOAP client 
that could help me contruct the request like the top one???


I don't want to have to build the text myself, and open a socket and 
send the text manually like I did to verify that the top one works, and 
the bottom one doesn't.


Thanks,

Tim.



[PHP] fgetcsv

2008-01-09 Thread Danny Brow
Hi Everyone,

I'm trying to compare a value to the first field in a csv fILE (example
of the data below). Using while takes too long and I can't figure out
how to compare just one row at a time. I've tried some variations of the
following.


//Common for all trials
$demoID = fopen("newDemoID.csv", "r");;
$ID = "43";

$data = fgetcsv($demoID);



First try with while:

/*
while ($data) {
if ($data[0] == $wolfID) {
print $data[1] . "," . $data[2] . "," . $data[3] .
".\n";
}
}
*/


Takes for every.

I can't use just the below because it only compares the first row.

/*
if ($data[0] == $wolfID) {
   print $data[1] . "," . $data[2] . "," . $data[3] . ".\n";
}

*/


I know this is simple, but I've hit codes block due to lack of sleep. 

Thanks,
Dan



Sample Data:

> 5,1,"Smith","Myrtle"
> 6,2,"Smith","Carita"
> 7,3,"Smith","Paul"
> 8,4,"Smith","Donald"





-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

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



[PHP] Unable to override status code in certain installations..?

2008-01-09 Thread RavenWorks

Hello,

I'm currently trying to create a system where a custom 404 ErrorDocument in
PHP is able to 301 Redirect the browser in certain cases. This works fine on
some servers, however, on some other servers the PHP script seems to be
unable to replace the 404 header.

Correctly overrides with '200' status:
http://fidelfilms.ca/redirectTest/

Unable to override default '404' status:
http://fraticelli.info/redirectTest/

Those two pages will look the same in a browser window, but one returns 404
and one returns 200 (as it should, because of the header() call) -- check
with whatever browser plugin you prefer for reading HTTP headers, such as
Live HTTP Headers for Firefox.

Returning the correct status code is important because we're migrating a
site from one domain to another, and we don't want to lose ranking in search
engines. (In the examples above, I return 200 as a test, but in practice
this will be used to 301 all visitors -- and search engines -- to the new
domain.)

My question is this: What causes PHP to be able to override the
ErrorDocument status on some servers and not others? Is it caused by PHP's
behavior or Apache? Is this a configurable option, or was the behavior
permanently changed in a given version of either?
-- 
View this message in context: 
http://www.nabble.com/Unable-to-override-status-code-in-certain-installations..--tp14723283p14723283.html
Sent from the PHP - General mailing list archive at Nabble.com.

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



Re: [PHP] fgetcsv

2008-01-09 Thread Jim Lucas

Danny Brow wrote:

Hi Everyone,

I'm trying to compare a value to the first field in a csv fILE (example
of the data below). Using while takes too long and I can't figure out
how to compare just one row at a time. I've tried some variations of the
following.


//Common for all trials
$demoID = fopen("newDemoID.csv", "r");;
$ID = "43";

$data = fgetcsv($demoID);



First try with while:

/*
while ($data) {
if ($data[0] == $wolfID) {
print $data[1] . "," . $data[2] . "," . $data[3] .
".\n";
}
}
*/


Takes for every.

I can't use just the below because it only compares the first row.

/*
if ($data[0] == $wolfID) {
   print $data[1] . "," . $data[2] . "," . $data[3] . ".\n";
}

*/


I know this is simple, but I've hit codes block due to lack of sleep. 


Thanks,
Dan



Sample Data:


5,1,"Smith","Myrtle"
6,2,"Smith","Carita"
7,3,"Smith","Paul"
8,4,"Smith","Donald"








Maybe try something like this.



--
Jim Lucas

   "Some men are born to greatness, some achieve greatness,
   and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
by William Shakespeare

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



Re: [PHP] fgetcsv

2008-01-09 Thread Daniel Brown
On Jan 9, 2008 5:35 PM, Danny Brow <[EMAIL PROTECTED]> wrote:
> Hi Everyone,
>
> I'm trying to compare a value to the first field in a csv fILE (example
> of the data below). Using while takes too long and I can't figure out
> how to compare just one row at a time. I've tried some variations of the
> following.
>
>
> //Common for all trials
> $demoID = fopen("newDemoID.csv", "r");;
> $ID = "43";
>
> $data = fgetcsv($demoID);
>
>
>
> First try with while:
>
> /*
> while ($data) {
> if ($data[0] == $wolfID) {
> print $data[1] . "," . $data[2] . "," . $data[3] .
> ".\n";
> }
> }
> */

As an alternative, you could try this:



-- 


Daniel P. Brown
Senior Unix Geek and #1 Rated "Year's Coolest Guy" By Self Since 1979.

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



Re: [PHP] fgetcsv

2008-01-09 Thread Chris

Danny Brow wrote:

Hi Everyone,

I'm trying to compare a value to the first field in a csv fILE (example
of the data below). Using while takes too long and I can't figure out
how to compare just one row at a time. I've tried some variations of the
following.


So are you trying to compare the first column or the first row? You've 
said you want to compare both.


To compare the first row:

If you really do want to compare the first column, then the time to do 
it will be based on how big the csv file is. If you have a big file, 
it's going to take a long time to go through each row and then look at 
the first field.


http://www.designmagick.com/

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



Re: [PHP] fgetcsv

2008-01-09 Thread Danny Brow
I need to compare the first field of each row. But this idea is shot to
hell, i've been running one of the examples on the file and it's been
about an hour+ already... 6500 records have to be checked... I think
MySQL is calling my name right now.

Thanks,
Dan


On Thu, 2008-01-10 at 09:59 +1100, Chris wrote:
> Danny Brow wrote:
> > Hi Everyone,
> > 
> > I'm trying to compare a value to the first field in a csv fILE (example
> > of the data below). Using while takes too long and I can't figure out
> > how to compare just one row at a time. I've tried some variations of the
> > following.
> 
> So are you trying to compare the first column or the first row? You've 
> said you want to compare both.
> 
> To compare the first row:
> 
>  
> $handle = fopen('file.csv', 'r') or die("unable to open file");
> 
> $my_row = array('1','2','John Smith');
> 
> $data = fgetcsv($handle, 1000, ",");
> 
> if ($data === false) {
>   echo "Unable to get anything from the file.";
> }
> 
> if (is_array($data)) {
>   if ($data == $my_row) {
>   echo "The first row matched\n";
>   } else {
>   echo "The first row didnt match\n";
>   }
> }
> 
> fclose($handle);
> 
> 
> If you really do want to compare the first column, then the time to do 
> it will be based on how big the csv file is. If you have a big file, 
> it's going to take a long time to go through each row and then look at 
> the first field.
> 
>  
> $handle = fopen('file.csv', 'r') or die("unable to open file");
> 
> $my_value = '1';
> 
> $row_count = 0;
> while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
>   $row_count++;
>   if ($data[0] == $my_value) {
>   echo "Found my_value on row ", $row_count, "\n";
>   } else {
>   echo "Did not find my_value on row ", $row_count, "\n";
>   }
> }
> 
> fclose($handle);
> 
> -- 
> Postgresql & php tutorials
> http://www.designmagick.com/
> 


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

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



[PHP] PHP Jpeg Uploads Corrupting

2008-01-09 Thread Scott Wilcox

Greetings folks,

I'm having a few issues with PHP this evening. I'm uploading various jpg 
images, doing a resize via GD, and then storing the image in a database.


Usually this works fine, but for some unknown reason I'm getting 
corrupted uploads. The corruption happens before any processing is done 
on the image, and I can't seem to work out why. Form is as follows:







You can view the corrupting image here:

http://nixbox.org/page_image.php?type=full

Any help would be appreciated greatly, I just can't seem to figure this 
one out.


Scott.

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



Re: [PHP] fgetcsv

2008-01-09 Thread Jim Lucas

Danny Brow wrote:

I need to compare the first field of each row. But this idea is shot to
hell, i've been running one of the examples on the file and it's been
about an hour+ already... 6500 records have to be checked... I think
MySQL is calling my name right now.

Thanks,
Dan


On Thu, 2008-01-10 at 09:59 +1100, Chris wrote:

Danny Brow wrote:

Hi Everyone,

I'm trying to compare a value to the first field in a csv fILE (example
of the data below). Using while takes too long and I can't figure out
how to compare just one row at a time. I've tried some variations of the
following.
So are you trying to compare the first column or the first row? You've 
said you want to compare both.


To compare the first row:

If you really do want to compare the first column, then the time to do 
it will be based on how big the csv file is. If you have a big file, 
it's going to take a long time to go through each row and then look at 
the first field.


http://www.designmagick.com/






even on a slow machine 6500 records should be very fast.

Are you doing this through a web interface or command line?

If browser, are you sure that your script is still running?  Could the PHP 
timeout be exceeded?

Try the other example that I gave you.



I looked for the last result, time for me was

,1,Smith,Myrtle
Run time was 0.04 seconds.



--
Jim Lucas

   "Some men are born to greatness, some achieve greatness,
   and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
by William Shakespeare

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



Re: [PHP] PHP Jpeg Uploads Corrupting

2008-01-09 Thread Jim Lucas

Scott Wilcox wrote:

Greetings folks,

I'm having a few issues with PHP this evening. I'm uploading various jpg 
images, doing a resize via GD, and then storing the image in a database.


Usually this works fine, but for some unknown reason I'm getting 
corrupted uploads. The corruption happens before any processing is done 
on the image, and I can't seem to work out why. Form is as follows:







You can view the corrupting image here:

http://nixbox.org/page_image.php?type=full

Any help would be appreciated greatly, I just can't seem to figure this 
one out.


Scott.



First, start your own thread next time.  Don't hijack someone else's.

Now a question.  Are you doing an error redirect for /account/photo ??

if so, the post data is not carried through the error redirect.


--
Jim Lucas

   "Some men are born to greatness, some achieve greatness,
   and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
by William Shakespeare

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



Re: [PHP] PHP Jpeg Uploads Corrupting

2008-01-09 Thread Scott Wilcox

Jim Lucas wrote:

Scott Wilcox wrote:

Greetings folks,

I'm having a few issues with PHP this evening. I'm uploading various 
jpg images, doing a resize via GD, and then storing the image in a 
database.


Usually this works fine, but for some unknown reason I'm getting 
corrupted uploads. The corruption happens before any processing is 
done on the image, and I can't seem to work out why. Form is as follows:


method="post">





You can view the corrupting image here:

http://nixbox.org/page_image.php?type=full

Any help would be appreciated greatly, I just can't seem to figure 
this one out.


Scott.



First, start your own thread next time.  Don't hijack someone else's.

Now a question.  Are you doing an error redirect for /account/photo ??

if so, the post data is not carried through the error redirect.


Ah my bad, I'd just edited as new :)

/account/photo is a standard apache rewrite, which usually passes the 
data through no problem. Other forms within the page post fine, although 
none of them are receiving data. It seems that the data is getting 
there, just not as it should be.


Any ideas on how to debug/where to go from here?

Thanks.

Scott.


RE: [PHP] fgetcsv

2008-01-09 Thread Bastien Koert

http://ca.php.net/manual/en/function.fgetcsv.php
_
Discover new ways to stay in touch with Windows Live! Visit the City @ Live 
today!
http://getyourliveid.ca/?icid=LIVEIDENCA006
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP Jpeg Uploads Corrupting

2008-01-09 Thread Scott Wilcox
Ah, ignore. Problem seems to be solved. Some piping seems to have caused 
corrupting. All working now. Thanks anyway folks! :)


Scott Wilcox wrote:

Jim Lucas wrote:

Scott Wilcox wrote:

Greetings folks,

I'm having a few issues with PHP this evening. I'm uploading various 
jpg images, doing a resize via GD, and then storing the image in a 
database.


Usually this works fine, but for some unknown reason I'm getting 
corrupted uploads. The corruption happens before any processing is 
done on the image, and I can't seem to work out why. Form is as 
follows:


method="post">





You can view the corrupting image here:

http://nixbox.org/page_image.php?type=full

Any help would be appreciated greatly, I just can't seem to figure 
this one out.


Scott.



First, start your own thread next time.  Don't hijack someone else's.

Now a question.  Are you doing an error redirect for /account/photo ??

if so, the post data is not carried through the error redirect.


Ah my bad, I'd just edited as new :)

/account/photo is a standard apache rewrite, which usually passes the 
data through no problem. Other forms within the page post fine, 
although none of them are receiving data. It seems that the data is 
getting there, just not as it should be.


Any ideas on how to debug/where to go from here?

Thanks.

Scott.



RE: [PHP] PHP SOAP Client formats

2008-01-09 Thread Bastien Koert

XML is case sensitive. I notice the case of the xml is different. Try making 
the PHP created xml the same case.
 
Bastien> Date: Wed, 9 Jan 2008 13:54:36 -0800> From: [EMAIL PROTECTED]> To: 
php-general@lists.php.net> Subject: [PHP] PHP SOAP Client formats> > Hi all,> > 
ok, I am a little bit new to the SOAP game, but I understand it, and am > using 
it to talk to an outside API.> > The problem that I have is that the server 
that I am talking to (that is > not in my control), will accept the following 
SOAP call> > > http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";>> > 
https://api.authorize.net/soap/v1/";>> 
> name> 
string> > 
> > > > > But it refuses a call 
that I have made using the SOAPClient PHP classes > that look like this :> > 
> http://schemas.xmlsoap.org/soap/envelope/"; 
xmlns:ns1="https://api.authorize.net/soap/v1/";>> > 
> > name> 
string> > 
> > > > It appears 
that the one that PHP creates is all in line with all of the > latest 
standards, and I know that the server is a Microsoft IIS server.> > Does anyone 
know any parameters that I can use with the PHP SOAP client > that could help 
me contruct the request like the top one???> > I don't want to have to build 
the text myself, and open a socket and > send the text manually like I did to 
verify that the top one works, and > the bottom one doesn't.> > Thanks,> > 
Tim.> 
_
Use fowl language with Chicktionary. Click here to start playing!
http://puzzles.sympatico.msn.ca/chicktionary/index.html?icid=htmlsig

[PHP] Get Parameters in Includes?

2008-01-09 Thread Liam

How do I use a get parameter in a include?

e.g.


I can't modify the cgi file though, and HTML includes don't work on my 
server.


Thanks in advance.

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



Re: [PHP] Unable to override status code in certain installations..?

2008-01-09 Thread Richard Lynch
On Wed, January 9, 2008 4:35 pm, RavenWorks wrote:
> I'm currently trying to create a system where a custom 404
> ErrorDocument in
> PHP is able to 301 Redirect the browser in certain cases. This works
> fine on
> some servers, however, on some other servers the PHP script seems to
> be
> unable to replace the 404 header.
>
> Correctly overrides with '200' status:
> http://fidelfilms.ca/redirectTest/
>
> Unable to override default '404' status:
> http://fraticelli.info/redirectTest/
>
> Those two pages will look the same in a browser window, but one
> returns 404
> and one returns 200 (as it should, because of the header() call) --
> check
> with whatever browser plugin you prefer for reading HTTP headers, such
> as
> Live HTTP Headers for Firefox.
>
> Returning the correct status code is important because we're migrating
> a
> site from one domain to another, and we don't want to lose ranking in
> search
> engines. (In the examples above, I return 200 as a test, but in
> practice
> this will be used to 301 all visitors -- and search engines -- to the
> new
> domain.)
>
> My question is this: What causes PHP to be able to override the
> ErrorDocument status on some servers and not others? Is it caused by
> PHP's
> behavior or Apache? Is this a configurable option, or was the behavior
> permanently changed in a given version of either?

I think you are falling prey to a PHP bug.

You should be able to find it in:
http://bugs.php.net

You could also check the ChangeLogs:
http://php.net/ChangeLog-5.php
http://php.net/ChangeLog-4.php

I could be wrong, as my memory is rather vague on this one, and it's
always possible that you have similar/same symptoms with an entirely
different issue.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] Get Parameters in Includes?

2008-01-09 Thread mike
that is a horrible method.

it works in zeus and apache, but not lighttpd, from my experience.

it's just not a good idea. technically that should only be file paths,
and i would expect it to load a file named "x.cgi?want=ssilinks"
although fopen wrappers can confuse that further...

in my opinion i would say "redesign it properly."



On 1/9/08, Liam <[EMAIL PROTECTED]> wrote:
> How do I use a get parameter in a include?
>
> e.g.
> 
>
> I can't modify the cgi file though, and HTML includes don't work on my
> server.
>
> Thanks in advance.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

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



[PHP] Inclusion with Get Parameters?

2008-01-09 Thread Liam

Hi!

I have a cgi script that returns a particular value when I call it as 
x.cgi?want=ssilinks.  I need to call it like that, but whenever I put 
the GET parameter into the include path, I get a warning saying that the 
file could not be found.  Any help?


Thanks,
Liam

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



Re: [PHP] fgetcsv

2008-01-09 Thread Richard Lynch
On Wed, January 9, 2008 4:35 pm, Danny Brow wrote:
> I'm trying to compare a value to the first field in a csv fILE
> (example
> of the data below). Using while takes too long and I can't figure out
> how to compare just one row at a time. I've tried some variations of
> the
> following.
>
>
> //Common for all trials
> $demoID = fopen("newDemoID.csv", "r");;
> $ID = "43";
>
> $data = fgetcsv($demoID);
>
>
>
> First try with while:
>
> /*
> while ($data) {
> if ($data[0] == $wolfID) {
> print $data[1] . "," . $data[2] . "," . $data[3] .
> ".\n";
> }
> }
> */
>
>
> Takes for every.

*IF* the line you are looking for is almost always in the early rows,
and *IF* you only need the first match,
you can use the above and put a "break;" inside the if { }

This will let the script end as soon as it finds the answer.

You do have another $data = fgetcsv($demoID); inside the while loop,
right?

Otherwise you are looking at the same first line over and over and
over and over and over until PHP gives up on you.

> I can't use just the below because it only compares the first row.
>
> /*
> if ($data[0] == $wolfID) {
>print $data[1] . "," . $data[2] . "," . $data[3] . ".\n";
> }
>
> */
>
>
> I know this is simple, but I've hit codes block due to lack of sleep.

It's actually not simple at all, since you are trying to scan through
a large file (it must be large to take a long time) and find only one
chunk at the beginning of a row.

There are several other techniques to consider:
#1.
Put the data into an SQL database before you try to search for
specific field/value information.
SQL was designed to make this stuff fast.
CSV was designed to dump files out to pass between
spreadsheets/databases.

#2.
*IF* the file isn't TOO large compared to your available RAM, you
could load the whole thing with "file_get_contents" and then do some
preg magic to find the line you want:
$file = file_get_contents("/full/path/to/file");
preg_match("/^$wolfID,.*\$/ms", $file, $match);
var_dump($match);
//use preg_match_all to find ALL the lines that match

#3.
*IF* the file is too large, and *IF* the CSV parsing is the slow part
(which I doubt) it's possible that a simple fgets() and simple check
sch as:
if (substr($line, 0, strlen($wolfID)) == $wolfID)
would be faster...
Actually, pull the strlen($wolfID) out of the loop into a variable,
and maybe use strpos instead of substr instead and...
The biggest time sink is probably reading the file line by line,
though, not the actual processing which is pretty minimal... In which
case this solution will probably not significantly beat your current
time.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] fgetcsv

2008-01-09 Thread Richard Lynch
6500 rows is chump-change.

You probably don't have the fgetcsv inside the while loop to get past
the first row... :-)

On Wed, January 9, 2008 6:09 pm, Danny Brow wrote:
> I need to compare the first field of each row. But this idea is shot
> to
> hell, i've been running one of the examples on the file and it's been
> about an hour+ already... 6500 records have to be checked... I think
> MySQL is calling my name right now.
>
> Thanks,
> Dan
>
>
> On Thu, 2008-01-10 at 09:59 +1100, Chris wrote:
>> Danny Brow wrote:
>> > Hi Everyone,
>> >
>> > I'm trying to compare a value to the first field in a csv fILE
>> (example
>> > of the data below). Using while takes too long and I can't figure
>> out
>> > how to compare just one row at a time. I've tried some variations
>> of the
>> > following.
>>
>> So are you trying to compare the first column or the first row?
>> You've
>> said you want to compare both.
>>
>> To compare the first row:
>>
>> >
>> $handle = fopen('file.csv', 'r') or die("unable to open file");
>>
>> $my_row = array('1','2','John Smith');
>>
>> $data = fgetcsv($handle, 1000, ",");
>>
>> if ($data === false) {
>>  echo "Unable to get anything from the file.";
>> }
>>
>> if (is_array($data)) {
>>  if ($data == $my_row) {
>>  echo "The first row matched\n";
>>  } else {
>>  echo "The first row didnt match\n";
>>  }
>> }
>>
>> fclose($handle);
>>
>>
>> If you really do want to compare the first column, then the time to
>> do
>> it will be based on how big the csv file is. If you have a big file,
>> it's going to take a long time to go through each row and then look
>> at
>> the first field.
>>
>> >
>> $handle = fopen('file.csv', 'r') or die("unable to open file");
>>
>> $my_value = '1';
>>
>> $row_count = 0;
>> while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
>>  $row_count++;
>>  if ($data[0] == $my_value) {
>>  echo "Found my_value on row ", $row_count, "\n";
>>  } else {
>>  echo "Did not find my_value on row ", $row_count, "\n";
>>  }
>> }
>>
>> fclose($handle);
>>
>> --
>> Postgresql & php tutorials
>> http://www.designmagick.com/
>>
>
>
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] Get Parameters in Includes?

2008-01-09 Thread Liam

mike wrote:

that is a horrible method.

Thanks for the nice positive, refreshing and most helpful response.

in my opinion i would say "redesign it properly."
Well what the hell do you suggest I do???  The script is MEANT to be 
used this way, as it has an admin panel inside etc.


Oh, by the way, nice grammar.

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



Re: [PHP] Inclusion with Get Parameters?

2008-01-09 Thread Jim Lucas

Liam wrote:

Hi!

I have a cgi script that returns a particular value when I call it as 
x.cgi?want=ssilinks.  I need to call it like that, but whenever I put 
the GET parameter into the include path, I get a warning saying that the 
file could not be found.  Any help?


Thanks,
Liam



I would look into calling it from exec() or system(). That might work 
better.


Or, I would look into calling it with cURL.  This way you call it like 
you would in your browser.  That will work the best.


Jim

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



Re: [PHP] Get Parameters in Includes?

2008-01-09 Thread Chris

The script is MEANT to be used this way


I doubt it.

If you want the contents from that url, then use curl 
(http://www.php.net/curl).


--
Postgresql & php tutorials
http://www.designmagick.com/

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



Re: [PHP] Inclusion with Get Parameters?

2008-01-09 Thread Liam

Jim Lucas wrote:

Liam wrote:

Hi!

I have a cgi script that returns a particular value when I call it as 
x.cgi?want=ssilinks.  I need to call it like that, but whenever I put 
the GET parameter into the include path, I get a warning saying that 
the file could not be found.  Any help?


Thanks,
Liam



I would look into calling it from exec() or system(). That might work 
better.


Or, I would look into calling it with cURL.  This way you call it like 
you would in your browser.  That will work the best.


Jim
Thanks for your reply, but I don't understand you.  PHP is not my mother 
tongue :P  Could you please give me examples?  It seems I forgot to 
mention that that is an include.


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



Re: [PHP] Get Parameters in Includes?

2008-01-09 Thread mike
On 1/9/08, Liam <[EMAIL PROTECTED]> wrote:
> mike wrote:
> > that is a horrible method.
> Thanks for the nice positive, refreshing and most helpful response.

read the sentence below it.

> > in my opinion i would say "redesign it properly."
> Well what the hell do you suggest I do???  The script is MEANT to be
> used this way, as it has an admin panel inside etc.

provide more details. like what is the .cgi? perl? or is it PHP as
well for some reason?

> Oh, by the way, nice grammar.

i gave you an opinion and my personal experience trying to support the
same method you're attempting here. i did not only reply to say "don't
do it"

i assume the .cgi is in perl, and you're trying to call this in PHP?

if it is all PHP, you can define a variable and just call the include
without having to deal with a query string. probably not the case.

if not, then pre-generate the navigation items in a flatfile and call
that in using include(). otherwise you can waste a web request each
time back to your webserver to execute the CGI with the proper
environment and parameters.

i could give a rip about capitalization here, and the grammar being
used is good enough to be understood. either way, you'll skip past the
meat of the message anyway and look for other things to reply about.

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



Re: [PHP] Get Parameters in Includes?

2008-01-09 Thread Richard Lynch
On Wed, January 9, 2008 8:38 pm, Liam wrote:
> How do I use a get parameter in a include?
>
> e.g.
> 
>
> I can't modify the cgi file though, and HTML includes don't work on my
> server.
>
> Thanks in advance.

In order to fire the CGI and have it processed, you would need to do:

$html = file_get_contents("http://.../x.cgi?want=ssilinks";);

This will require php.ini to have allow_url_fopen set to "on" which
has some serious security considerations to ponder before you go
changing it...

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] Get Parameters in Includes?

2008-01-09 Thread Liam

On 1/9/08, Liam <[EMAIL PROTECTED]> wrote:

mike wrote:

that is a horrible method.

Thanks for the nice positive, refreshing and most helpful response.


read the sentence below it.


in my opinion i would say "redesign it properly."

Well what the hell do you suggest I do???  The script is MEANT to be
used this way, as it has an admin panel inside etc.


provide more details. like what is the .cgi? perl? or is it PHP as
well for some reason?


Oh, by the way, nice grammar.


i gave you an opinion and my personal experience trying to support the
same method you're attempting here. i did not only reply to say "don't
do it"

i assume the .cgi is in perl, and you're trying to call this in PHP?

if it is all PHP, you can define a variable and just call the include
without having to deal with a query string. probably not the case.

if not, then pre-generate the navigation items in a flatfile and call
that in using include(). otherwise you can waste a web request each
time back to your webserver to execute the CGI with the proper
environment and parameters.

i could give a rip about capitalization here, and the grammar being
used is good enough to be understood. either way, you'll skip past the
meat of the message anyway and look for other things to reply about.


The cgi script IS perl.  Oh, RE: the sentence below it: I'm running 
apache, and it DOESN'T work.  The reason I am trying to call it in php 
is to include it on a webpage.  So, tell me, how am I supposed to 
pre-generate the contents in a flatfile (whatever that is)?  Or if I 
can't do that, then what I am supposed to do?


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



Re: [PHP] PHP SOAP Client formats

2008-01-09 Thread Tim Traver

Bastien,

Thank you for answering, but the issue is that the PHP SOAPClient 
classes actually create that xml to send, so I have no control over the 
xml that is sent with a call command to the SOAP object...


I just wondered if there was any flags that I am missing that might 
bring the php stuff in line with what the server expects.


I want to use PHP's built in classes for this so I don't have to 
manually send xml to the api...


Thanks,

Tim.


Bastien Koert wrote:
XML is case sensitive. I notice the case of the xml is different. Try 
making the PHP created xml the same case.
 
Bastien


> Date: Wed, 9 Jan 2008 13:54:36 -0800
> From: [EMAIL PROTECTED]
> To: php-general@lists.php.net
> Subject: [PHP] PHP SOAP Client formats
>
> Hi all,
>
> ok, I am a little bit new to the SOAP game, but I understand it, and am
> using it to talk to an outside API.
>
> The problem that I have is that the server that I am talking to 
(that is

> not in my control), will accept the following SOAP call
>
> 
> http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";>

> 
> https://api.authorize.net/soap/v1/";>
> 
> name
> string
> 
> 
> 
> 
>
>
> But it refuses a call that I have made using the SOAPClient PHP classes
> that look like this :
>
> 
> xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"; 
xmlns:ns1="https://api.authorize.net/soap/v1/";>

> 
> 
> 
> name
> string
> 
> 
> 
> 
>
> It appears that the one that PHP creates is all in line with all of the
> latest standards, and I know that the server is a Microsoft IIS server.
>
> Does anyone know any parameters that I can use with the PHP SOAP client
> that could help me contruct the request like the top one???
>
> I don't want to have to build the text myself, and open a socket and
> send the text manually like I did to verify that the top one works, and
> the bottom one doesn't.
>
> Thanks,
>
> Tim.
>



HO HO HO, if you've been nice this year, email Santa! Visit 
asksanta.ca to learn more! 


RE: [PHP] fgetcsv

2008-01-09 Thread Danny Brow
Um, I've read the manual.


On Wed, 2008-01-09 at 20:11 -0500, Bastien Koert wrote:
> http://ca.php.net/manual/en/function.fgetcsv.php
> _
> Discover new ways to stay in touch with Windows Live! Visit the City @ Live 
> today!
> http://getyourliveid.ca/?icid=LIVEIDENCA006
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

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



Re: [PHP] Get Parameters in Includes?

2008-01-09 Thread mike
On 1/9/08, Liam <[EMAIL PROTECTED]> wrote:

> The cgi script IS perl.  Oh, RE: the sentence below it: I'm running
> apache, and it DOESN'T work.  The reason I am trying to call it in php
> is to include it on a webpage.  So, tell me, how am I supposed to
> pre-generate the contents in a flatfile (whatever that is)?  Or if I
> can't do that, then what I am supposed to do?

1) lynx -dump http://blah.com/x.cgi?getssi >file.htm every so often,
or some other method to request the cgi and dump the output
2) include("http://blah.com/x.cgi?getssi";) requires fopen wrappers on
includes and is a poor security measure (would not really recommend
this)
3) use curl functions to grab it in PHP and display (still will
technically issue an HTTP request) - probably the best method, if you
have to.

CGI scripts are not designed to be executed on the command line using
parameters like GET. which is why it's poorly supported. i do have it
working under zeus and i have had it working in the past under apache,
but it might have been due to a specific configuration method (it also
was not CGI, but an SSI call to a php script with GET parameters...
same idea, but different SAPI, which could be why it doesn't work for
you anyway)

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



[PHP] Scratch that

2008-01-09 Thread Liam
How can I display the returned HTML contents of a cgi (Perl) script, 
without get parameters?


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



Re: [PHP] fgetcsv

2008-01-09 Thread Danny Brow
You are so right, takes all of 0.122 s to process the whole file with
the fgetcsv inside the while loop Guess I need to look up why this
was the problem.

Thanks everyone!


On Wed, 2008-01-09 at 20:59 -0600, Richard Lynch wrote:
> 6500 rows is chump-change.
> 
> You probably don't have the fgetcsv inside the while loop to get past
> the first row... :-)
> 
> On Wed, January 9, 2008 6:09 pm, Danny Brow wrote:
> > I need to compare the first field of each row. But this idea is shot
> > to
> > hell, i've been running one of the examples on the file and it's been
> > about an hour+ already... 6500 records have to be checked... I think
> > MySQL is calling my name right now.
> >
> > Thanks,
> > Dan
> >
> >
> > On Thu, 2008-01-10 at 09:59 +1100, Chris wrote:
> >> Danny Brow wrote:
> >> > Hi Everyone,
> >> >
> >> > I'm trying to compare a value to the first field in a csv fILE
> >> (example
> >> > of the data below). Using while takes too long and I can't figure
> >> out
> >> > how to compare just one row at a time. I've tried some variations
> >> of the
> >> > following.
> >>
> >> So are you trying to compare the first column or the first row?
> >> You've
> >> said you want to compare both.
> >>
> >> To compare the first row:
> >>
> >>  >>
> >> $handle = fopen('file.csv', 'r') or die("unable to open file");
> >>
> >> $my_row = array('1','2','John Smith');
> >>
> >> $data = fgetcsv($handle, 1000, ",");
> >>
> >> if ($data === false) {
> >>echo "Unable to get anything from the file.";
> >> }
> >>
> >> if (is_array($data)) {
> >>if ($data == $my_row) {
> >>echo "The first row matched\n";
> >>} else {
> >>echo "The first row didnt match\n";
> >>}
> >> }
> >>
> >> fclose($handle);
> >>
> >>
> >> If you really do want to compare the first column, then the time to
> >> do
> >> it will be based on how big the csv file is. If you have a big file,
> >> it's going to take a long time to go through each row and then look
> >> at
> >> the first field.
> >>
> >>  >>
> >> $handle = fopen('file.csv', 'r') or die("unable to open file");
> >>
> >> $my_value = '1';
> >>
> >> $row_count = 0;
> >> while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
> >>$row_count++;
> >>if ($data[0] == $my_value) {
> >>echo "Found my_value on row ", $row_count, "\n";
> >>} else {
> >>echo "Did not find my_value on row ", $row_count, "\n";
> >>}
> >> }
> >>
> >> fclose($handle);
> >>
> >> --
> >> Postgresql & php tutorials
> >> http://www.designmagick.com/
> >>
> >
> >
> > --
> > This message has been scanned for viruses and
> > dangerous content by MailScanner, and is
> > believed to be clean.
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> 
> 
> -- 
> Some people have a "gift" link here.
> Know what I want?
> I want you to buy a CD from some indie artist.
> http://cdbaby.com/from/lynch
> Yeah, I get a buck. So?
> 
> 


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

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



[PHP] Re: Scratch that

2008-01-09 Thread Liam

Liam wrote:
How can I display the returned HTML contents of a cgi (Perl) script, 
without get parameters?

Oh, this means that
1: It mustn't count as a http hit,
and 2: I need to only get what is between the  tags.

Thanks in advance.

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



Re: [PHP] PHP SOAP Client formats

2008-01-09 Thread Nathan Nobbe
On Jan 9, 2008 10:45 PM, Tim Traver <[EMAIL PROTECTED]> wrote:

> Bastien,
> I want to use PHP's built in classes for this so I don't have to
> manually send xml to the api...


writing the xml by hand would be madness...

i didnt want to spend all night screwing around w/ it, since i dont have
any credentials to test w/, but if you look on the auth.net website you
will see they have a robust api in several languages, including php,
that happens to use the SoapClient class from php5.

there is a nice manual,
http://www.authorize.net/support/CIM_SOAP_guide.pdf
in it i found the service call you have mentioned in your initial post,
at that point in the document is a link to sample code
http://developer.authorize.net/dscode/php_cim.zip
which should have everything you need to interact w/ the auth.net
services in php (at a cursory glance).

-nathan


Re: [PHP] Re: Scratch that

2008-01-09 Thread mike
On 1/9/08, Liam <[EMAIL PROTECTED]> wrote:
> Liam wrote:

> 1: It mustn't count as a http hit,

it's going to

> and 2: I need to only get what is between the  tags.

now you're just asking the list to code something for you...


my suggestions again:

look into rewriting it to be more reusable
look at http://us2.php.net/manual/en/function.tidy-get-body.php

it's CGI, it can be executed using perl on the shell, sometimes -
depends on what it actually does. however it may count as a "hit"
either way. CGI must be executed to work, just depends on if it's
going to be executed via the web (definately a hit) or the shell
(maybe/maybe not depending on what the script does)

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



[PHP] Rephrase

2008-01-09 Thread Liam

OK, what I meant was
1) Not count as though the user manually navigated to that page (for my 
sanity when checking the site statistics!)

and
2) I also need to know how to run a expression-ish thing so that when I 
'parse' the text, it returns all text between x and y, but parse it 
BEFORE it gets 'included'.


Note: fOpen is NOT enabled, and I CAN'T enable it.

Thanks in advance
P.S. Sorry mike for my previous ungracious answer.

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



Re: [PHP] Re: Scratch that

2008-01-09 Thread Liam

OK, what I meant was
1) Not dump the contents to a file, as the cgi will dynamically show 
different links every time, (it's a reciprocal linking script)
2) Not count as though the user manually navigated to that page (for my 
sanity when checking the site statistics!)

and
3) I also need to know how to run a expression-ish thing so that when I 
'parse' the text, it returns all text between x and y, but parse it 
BEFORE it gets 'included'.


Note: fOpen is NOT enabled, and I CAN'T enable it.

Thanks in advance
P.S. Sorry mike for my previous ungracious answer.

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



Re: [PHP] Re: Scratch that

2008-01-09 Thread mike
On 1/9/08, Liam <[EMAIL PROTECTED]> wrote:
> OK, what I meant was
> 1) Not dump the contents to a file, as the cgi will dynamically show
> different links every time, (it's a reciprocal linking script)
> 2) Not count as though the user manually navigated to that page (for my
> sanity when checking the site statistics!)
> and
> 3) I also need to know how to run a expression-ish thing so that when I
> 'parse' the text, it returns all text between x and y, but parse it
> BEFORE it gets 'included'.
>
> Note: fOpen is NOT enabled, and I CAN'T enable it.
>
> Thanks in advance
> P.S. Sorry mike for my previous ungracious answer.

what language are you comfortable in?

obviously perl is supported on your server.

i would recommend if you know perl, to stick with what you know and
integrate it together.

otherwise it sounds like you've got a handful of requirements (and
scope creep), no clue where to start, and no PHP knowledge to boot.
this is where i think you decide to just "pay someone to do it quick"
:)

1) rentacoder.com
2) phparch.com forums i think has a jobs area

anyway, expression stuff can be done using php.net/preg, php.net/ereg
and if possible, just normal str* functions. first you need to get the
content though and if you can't get that, i'm not sure that's going to
help any more ...

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



Re: [PHP] PHP SOAP Client formats

2008-01-09 Thread Tim Traver



Nathan Nobbe wrote:

On Jan 9, 2008 10:45 PM, Tim Traver <[EMAIL PROTECTED]> wrote:

  

Bastien,
I want to use PHP's built in classes for this so I don't have to
manually send xml to the api...




writing the xml by hand would be madness...

i didnt want to spend all night screwing around w/ it, since i dont have
any credentials to test w/, but if you look on the auth.net website you
will see they have a robust api in several languages, including php,
that happens to use the SoapClient class from php5.

there is a nice manual,
http://www.authorize.net/support/CIM_SOAP_guide.pdf
in it i found the service call you have mentioned in your initial post,
at that point in the document is a link to sample code
http://developer.authorize.net/dscode/php_cim.zip
which should have everything you need to interact w/ the auth.net
services in php (at a cursory glance).

-nathan

  

Hey Nathan,

Thanks...that's actually really funny, because they must have put the 
PHP sample code for the CIM method in there within the last week, 
because that was why I was writing my own SOAP stuff to interact with 
them (using those manuals)...


The issue that I ended up running in to was that the SOAP calls I was 
making were getting errors back, and I couldn't get anyone from 
authorize.net to give me any support for what the issue was...


Hopefully, their PHP class will do the trick...

Thanks,

Tim.




Re: [PHP] Re: Scratch that

2008-01-09 Thread Liam
My non-profit setup makes that 'Pay Someone' alternative.  What I am 
planning on doing:


When the script is called, it is equivilent of using the want=ssilinks 
GET parameter.


So therefore, all I need to do is get the HTML returned from the script, 
not the contents of the script itself.  Can anyone help now?


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