OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
php-general Digest 3 Jan 2007 08:58:49 -0000 Issue 4548

php-general-digest-helplists.php.net
Date: Wed Jan 03 2007 - 02:58:49 CST


php-general Digest 3 Jan 2007 08:58:49 -0000 Issue 4548

Topics (messages 246377 through 246426):

Converting C# Hashing Routines to PHP
        246377 by: Jason Alexander
        246384 by: Jochem Maas
        246391 by: Jason Alexander
        246393 by: Richard Lynch

Re: Javascript detection , working version
        246378 by: Robert Cummings
        246379 by: tedd
        246381 by: Satyam
        246382 by: Jürgen Wind
        246383 by: Jürgen Wind
        246385 by: Jürgen Wind

I need help with PHP, cURL, and POST
        246380 by: Charley
        246386 by: Jochem Maas
        246387 by: Ligaya A. Turmelle
        246392 by: Charley
        246394 by: Charley
        246396 by: Richard Lynch
        246410 by: Charley
        246412 by: Charley

Re: Please help me
        246388 by: Peter Lauri

Re: How to read cookies set by php?
        246389 by: Peter Lauri
        246397 by: Richard Lynch

Re: Concerning SSL
        246390 by: Peter Lauri
        246395 by: Richard Lynch

Re: Formatting time :/
        246398 by: Richard Lynch

Re: Temporary Emails - Your Recommendations - An Appeal to the PHP Community
        246399 by: Richard Lynch

Trouble compiling in mysqli under PHP5 -- "mysql_config not found"
        246400 by: Weston C
        246407 by: Roman Neuhauser
        246408 by: Roman Neuhauser

Re: Request of php5
        246401 by: Richard Lynch

Re: Basic question - Starting a background task without waiting for its end.
        246402 by: Richard Lynch

Re: Best way to manage open slots for download
        246403 by: Richard Lynch

Re: php 5 and register_globals=off gives lotsa errors
        246404 by: Richard Lynch

how to static link openssl libs into php binary
        246405 by: hbeaumont hbeaumont

Re: php/ajax question
        246406 by: Richard Lynch

Pushing a file to the browser
        246409 by: Mike Mannakee
        246411 by: Casey Chu
        246418 by: Roman Neuhauser
        246425 by: Curt Zirzow

http request problem
        246413 by: Kencana
        246414 by: Kencana
        246415 by: Curt Zirzow
        246416 by: Fahad Pervaiz
        246419 by: Roman Neuhauser
        246420 by: Curt Zirzow
        246421 by: Roman Neuhauser
        246424 by: Curt Zirzow

software recommendation: ServiceCapture
        246417 by: Paul Novitski

Re: Downloading utf-8 encoded files
        246422 by: Nisse Engström

read cwk files
        246423 by: John Salib
        246426 by: Curt Zirzow

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscribelists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscribelists.php.net

To post to the list, e-mail:
        php-generallists.php.net

----------------------------------------------------------------------

attached mail follows:


Hey there,

I'm currently working on converting an ASP.NET, C# site/application to
PHP, and I've run into a small snag. The login algorithm hashes the
user passwords like so:

MD5 md1 = new MD5CryptoServiceProvider();
byte[] buffer1 = new ASCIIEncoding().GetBytes(stringToHash);
byte[] buffer2 = md1.ComputeHash(buffer1);
md1.Clear();
return Convert.ToBase64String(buffer2);

The challenge here is that in this conversion, I'm also migrating the
users over to a different system which uses a completely different
hashing mechanism. So, really, I need to be able to un-hash these
values, if that's even possible.

Thoughts? Options? I'm afraid this is one way hash, that I'm not going
to be able to do anything about, unfortunately.

TIA,
-Jason

attached mail follows:


Jason Alexander wrote:
> Hey there,
>
>
> I'm currently working on converting an ASP.NET, C# site/application to
> PHP, and I've run into a small snag. The login algorithm hashes the

welcome to the other side, did you get a refund for the red lightsabre?

;-) [go on keep reading, you'll to the useful bit of the reply eventually...]

> user passwords like so:
>
> MD5 md1 = new MD5CryptoServiceProvider();
> byte[] buffer1 = new ASCIIEncoding().GetBytes(stringToHash);
> byte[] buffer2 = md1.ComputeHash(buffer1);
> md1.Clear();
> return Convert.ToBase64String(buffer2);
>

holy smoke - all those line to do what seems to ammount to (in php):

function myHash($s) {
        return base64_encode(md5($s));
}
>
> The challenge here is that in this conversion, I'm also migrating the
> users over to a different system which uses a completely different
> hashing mechanism. So, really, I need to be able to un-hash these
> values, if that's even possible.
>
> Thoughts? Options? I'm afraid this is one way hash, that I'm not going
> to be able to do anything about, unfortunately.

well you out of luck regarding simply converting the md5 hashes to
another encryption form (e.g. sha1).

obviously php does have a way to gen md5 hashes using the function md5()

you might consider writing a login routine that makes use of 2 password fields,
one for the md5 hash and one for the new hash. if the a user attempts a login and
the 'new hash' field is empty an md5 hash of the given password is checked
against the 'md5 hash' field - if it matches then a hash is made of the given
password using the new hashing mechanism and that is stored in the 'new hash' field
(after which the 'md5 hash' field can be cleared and the future logins will be checked
against the 'new hash' field) ... some time in the future it may be possible to
recode the login and remove the 'md5 hash' field completely.

the use of base64 encoding in your sample code might complicate the solution
a tiny bit but hopefully you get the idea.

>
>
> TIA,
> -Jason
>

attached mail follows:


Thanks Jochem,

Yeah, I'm one of those types that wields whatever lightsabre is given
to him. ;-)

Perfect, thanks for the heads up on how that translates in PHP. Yeah,
good idea on the dual column. I was thinking the same thing, and it
seems to be the most non-intrusive way to add it into the new data
model.

Thanks for the help! Greatly appreciated!

-Jason

On 1/2/07, Jochem Maas <jochemiamjochem.com> wrote:
> Jason Alexander wrote:
> > Hey there,
> >
> >
> > I'm currently working on converting an ASP.NET, C# site/application to
> > PHP, and I've run into a small snag. The login algorithm hashes the
>
> welcome to the other side, did you get a refund for the red lightsabre?
>
> ;-) [go on keep reading, you'll to the useful bit of the reply eventually...]
>
> > user passwords like so:
> >
> > MD5 md1 = new MD5CryptoServiceProvider();
> > byte[] buffer1 = new ASCIIEncoding().GetBytes(stringToHash);
> > byte[] buffer2 = md1.ComputeHash(buffer1);
> > md1.Clear();
> > return Convert.ToBase64String(buffer2);
> >
>
> holy smoke - all those line to do what seems to ammount to (in php):
>
> function myHash($s) {
> return base64_encode(md5($s));
> }
> >
> > The challenge here is that in this conversion, I'm also migrating the
> > users over to a different system which uses a completely different
> > hashing mechanism. So, really, I need to be able to un-hash these
> > values, if that's even possible.
> >
> > Thoughts? Options? I'm afraid this is one way hash, that I'm not going
> > to be able to do anything about, unfortunately.
>
> well you out of luck regarding simply converting the md5 hashes to
> another encryption form (e.g. sha1).
>
> obviously php does have a way to gen md5 hashes using the function md5()
>
> you might consider writing a login routine that makes use of 2 password fields,
> one for the md5 hash and one for the new hash. if the a user attempts a login and
> the 'new hash' field is empty an md5 hash of the given password is checked
> against the 'md5 hash' field - if it matches then a hash is made of the given
> password using the new hashing mechanism and that is stored in the 'new hash' field
> (after which the 'md5 hash' field can be cleared and the future logins will be checked
> against the 'new hash' field) ... some time in the future it may be possible to
> recode the login and remove the 'md5 hash' field completely.
>
> the use of base64 encoding in your sample code might complicate the solution
> a tiny bit but hopefully you get the idea.
>
> >
> >
> > TIA,
> > -Jason
> >
>
>

attached mail follows:


You can reverse the base64 easily enough.

You ain't gonna reverse md5 in this lifetime.

The dual-column could work, or you could just accept the password if
it matches either routine in a single column.

The odds of your new algorithm coincidentally matching the
base64(md5()) of another user and giving access to a Bad Guy is
effectively nil.

On Tue, January 2, 2007 3:20 pm, Jason Alexander wrote:
> Hey there,
>
>
> I'm currently working on converting an ASP.NET, C# site/application to
> PHP, and I've run into a small snag. The login algorithm hashes the
> user passwords like so:
>
> MD5 md1 = new MD5CryptoServiceProvider();
> byte[] buffer1 = new ASCIIEncoding().GetBytes(stringToHash);
> byte[] buffer2 = md1.ComputeHash(buffer1);
> md1.Clear();
> return Convert.ToBase64String(buffer2);
>
>
> The challenge here is that in this conversion, I'm also migrating the
> users over to a different system which uses a completely different
> hashing mechanism. So, really, I need to be able to un-hash these
> values, if that's even possible.
>
> Thoughts? Options? I'm afraid this is one way hash, that I'm not going
> to be able to do anything about, unfortunately.
>
>
> TIA,
> -Jason
>
> --
> 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 starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

attached mail follows:


On Tue, 2007-01-02 at 21:55 +0100, Satyam wrote:
> ----- Original Message -----
> From: "Robert Cummings" <robertinterjinn.com>
> To: "Jürgen Wind" <jwindgmx.de>
> Cc: <php-generallists.php.net>
> Sent: Tuesday, January 02, 2007 8:57 PM
> Subject: Re: [PHP] Javascript detection , working version
>
>
> > On Tue, 2007-01-02 at 11:32 -0800, Jürgen Wind wrote:
> >> Robert Cummings wrote:
> >> >
> >> > Out of curiosity, can you guarantee the Javascript redirect will always
> >> > occur before the meta redirect when Javascript is enabled? Otherwise
> >> > you
> >> > have a race condition.
> >> >
> >> > Cheers,
> >> > Rob.
> >> >
> >> i have no idea, it is just a quick&dirty hack, i'm no js expert ;)
> >> the js part is rather fast, maybe a little delay or window.write is
> >> neccessary after the redirect?
> >
> > No, you always want the javascript to run first. The question is whether
> > a meta redirect could ever occur before the javascript redirect. If it
> > can then occasionally you may get "javascript not detected" since the
> > meta redirect would occur when in fact javascript is enabled.
> >
> > Cheers,
> > Rob.
> > --
>
> What I usually do is to make the entry page the one that would be used
> without JavaScript and branch only if JavaScript is present.

Yeah, that was what I did :)

Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'

attached mail follows:


At 3:39 PM -0500 1/2/07, Robert Cummings wrote:
>On Tue, 2007-01-02 at 15:24 -0500, tedd wrote:
>> Rob:
>>
>> That's a good point -- even if a delay was added
>> it's not certain that it wouldn't experience a
>> race issue. And the longer the delay, the more
>> problems you have with the user experience.
>>
>> Perhaps a token scheme, like prohibiting
>> duplicate from submissions, might work.
>
>Well I don't know if there is a race condition. I don't know enough
>about meta redirects and javascript execution to know if a race
>condition exists at all. That was why I did my solution the way I did
>it, I know for a fact there is no race condition in it :)
>
>Cheers,
>Rob.

Rob:

I haven't had a chance to check out your solution, but I will.

Many thanks.

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

attached mail follows:


----- Original Message -----
From: "Robert Cummings" <robertinterjinn.com>
>>
>> What I usually do is to make the entry page the one that would be used
>> without JavaScript and branch only if JavaScript is present.
>
> Yeah, that was what I did :)
>
> Cheers,
> Rob.
> --

Sorry, it seems I missed it.

Satyam

attached mail follows:


Satyam wrote:
>
>
> What I usually do is to make the entry page the one that would be used
> without JavaScript and branch only if JavaScript is present.
>
> Satyam
>

yes, that's the best solution, updated version:
http://149.222.235.16/jstest/
--
View this message in context: http://www.nabble.com/Javascript-detection-tf2905451.html#a8132106
Sent from the PHP - General mailing list archive at Nabble.com.

attached mail follows:


Robert Cummings wrote:
>
> Out of curiosity, can you guarantee the Javascript redirect will always
> occur before the meta redirect when Javascript is enabled? Otherwise you
> have a race condition.
>
> Cheers,
> Rob.
>
yes, you where right (i noticed some problems with opera)
updated version: http://149.222.235.16/jstest/
--
View this message in context: http://www.nabble.com/Javascript-detection-tf2905451.html#a8132150
Sent from the PHP - General mailing list archive at Nabble.com.

attached mail follows:


that's why i prefer discussing here in the forum, we benefit from the
experiences of each other :)
updated version: http://149.222.235.16/jstest/
--
View this message in context: http://www.nabble.com/Javascript-detection-tf2905451.html#a8132203
Sent from the PHP - General mailing list archive at Nabble.com.

attached mail follows:


I am an experienced programmer who is just learning php and curl.

I have tried for several days to figure out how to use curl with POST
to get history information from e-gold.

The following script, which I guess uses GET works when XXXX YYYY ZZZZ have
appropriate stuff in them.

But no matter what I have tried, and whose examples I have followed
I cannot get this to work with CURLOPT_POST set to true with what I think
is the appropriate information supplied.

I am testing this from XAMPP 1.5.5 on a Windows XP system, and the SSL
stuff and everything I think I need is present and seems to be working fine.

The commented out form also works, so I guess e-gold will accept POSTed data.

I just do not know how to get curl to send it for me or what options I
need to make it work.

Would someone be interested in showing me exactly what I need to modify this
script to work with POST?

<?php
 session_start();
/*****
<form action="https://www.e-gold.com/acct/historycsv.asp" method="post">
<input type="hidden" name="AccountID" value="XXXXXX">
<input type="hidden" name="PassPhrase" value="YYYYYYYYYYYYYYY">
<input type="hidden" name="startmonth" value="12">
<input type="hidden" name="startday" value="1">
<input type="hidden" name="startyear" value="2006">
<input type="hidden" name="endmonth" value="12">
<input type="hidden" name="endday" value="31">
<input type="hidden" name="endyear" value="2006">
<input type="hidden" name="paymentsreceived" value="1">
<input type="hidden" name="fees" value="1">
<input type="submit" value="Submit">
*****/

$pf = "AccountID=XXXXXX";
$pf .= "&PassPhrase=YYYYYYYYYYYYYYY";
$pf .= "&startmonth=12";
$pf .= "&startday=1";
$pf .= "&startyear=2006";
$pf .= "&endmonth=12";
$pf .= "&endday=31";
$pf .= "&endyear=2006";
$pf .= "&paymentsreceived=1";
$pf .= "&fees=1";
$pf .= "&paymentidfilter=ZZZZZZZZZZZZZZZZ";

$ch = curl_init();

// Follow any Location headers
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
$url='https://www.e-gold.com/acct/historycsv.asp?' . $pf;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_HEADER, FALSE);

$data=curl_exec($ch);
$info=curl_getinfo($ch);
echo "<p>curlerror=" . curl_error($ch);
curl_close($ch);
echo "<p>data=";
var_dump($data);
echo "<p>info=";
var_dump($info);
?>

attached mail follows:


Charley wrote:
> I am an experienced programmer who is just learning php and curl.
>

...

>
> Would someone be interested in showing me exactly what I need to modify this
> script to work with POST?

the interest is 10%/week ;-) ... read on ...

>
> <?php
> session_start();
> /*****
> <form action="https://www.e-gold.com/acct/historycsv.asp" method="post">
> <input type="hidden" name="AccountID" value="XXXXXX">
> <input type="hidden" name="PassPhrase" value="YYYYYYYYYYYYYYY">
> <input type="hidden" name="startmonth" value="12">
> <input type="hidden" name="startday" value="1">
> <input type="hidden" name="startyear" value="2006">
> <input type="hidden" name="endmonth" value="12">
> <input type="hidden" name="endday" value="31">
> <input type="hidden" name="endyear" value="2006">
> <input type="hidden" name="paymentsreceived" value="1">
> <input type="hidden" name="fees" value="1">
> <input type="submit" value="Submit">
> *****/
>
> $pf = "AccountID=XXXXXX";
> $pf .= "&PassPhrase=YYYYYYYYYYYYYYY";
> $pf .= "&startmonth=12";
> $pf .= "&startday=1";
> $pf .= "&startyear=2006";
> $pf .= "&endmonth=12";
> $pf .= "&endday=31";
> $pf .= "&endyear=2006";
> $pf .= "&paymentsreceived=1";
> $pf .= "&fees=1";
> $pf .= "&paymentidfilter=ZZZZZZZZZZZZZZZZ";
>

you don't want/need the GET query in $pf ...
instead something like this needs to be used (AFAIK):

curl_setopt($ch, CURLOPT_POSTFIELDS, array(
        'AccountID' => 'XXXXX',
        'PassPhrase' => 'XXXXXX',
        /* etc, etc */
));

refer to http://php.net/curl for more info.

this assumes that e-gold does accept POST as a request method
(which you test form seems to indicate it does)

> $ch = curl_init();
>
> // Follow any Location headers
> curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
> $url='https://www.e-gold.com/acct/historycsv.asp?' . $pf;
> curl_setopt($ch, CURLOPT_URL, $url);
> curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
>
> curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
> curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
> curl_setopt($ch, CURLOPT_HEADER, FALSE);
>
> $data=curl_exec($ch);
> $info=curl_getinfo($ch);
> echo "<p>curlerror=" . curl_error($ch);
> curl_close($ch);
> echo "<p>data=";
> var_dump($data);
> echo "<p>info=";
> var_dump($info);
> ?>
>

attached mail follows:


Have you looked at this tutorial -
http://devzone.zend.com/node/view/id/1081

It has an example specifically for how to use curl with POST

Respectfully,
Ligaya Turmelle

-----Original Message-----
From: Charley [mailto:charleyshipmanrunbox.com]
Sent: Wednesday, January 03, 2007 1:24 AM
To: php-generallists.php.net
Subject: [PHP] I need help with PHP, cURL, and POST

I am an experienced programmer who is just learning php and curl.

I have tried for several days to figure out how to use curl with POST to
get history information from e-gold.

The following script, which I guess uses GET works when XXXX YYYY ZZZZ
have appropriate stuff in them.

But no matter what I have tried, and whose examples I have followed I
cannot get this to work with CURLOPT_POST set to true with what I think
is the appropriate information supplied.

I am testing this from XAMPP 1.5.5 on a Windows XP system, and the SSL
stuff and everything I think I need is present and seems to be working
fine.

The commented out form also works, so I guess e-gold will accept POSTed
data.

I just do not know how to get curl to send it for me or what options I
need to make it work.

Would someone be interested in showing me exactly what I need to modify
this script to work with POST?

<?php
 session_start();
/*****
<form action="https://www.e-gold.com/acct/historycsv.asp" method="post">
<input type="hidden" name="AccountID" value="XXXXXX"> <input
type="hidden" name="PassPhrase" value="YYYYYYYYYYYYYYY"> <input
type="hidden" name="startmonth" value="12"> <input type="hidden"
name="startday" value="1"> <input type="hidden" name="startyear"
value="2006"> <input type="hidden" name="endmonth" value="12"> <input
type="hidden" name="endday" value="31"> <input type="hidden"
name="endyear" value="2006"> <input type="hidden"
name="paymentsreceived" value="1"> <input type="hidden" name="fees"
value="1"> <input type="submit" value="Submit"> *****/

$pf = "AccountID=XXXXXX";
$pf .= "&PassPhrase=YYYYYYYYYYYYYYY";
$pf .= "&startmonth=12";
$pf .= "&startday=1";
$pf .= "&startyear=2006";
$pf .= "&endmonth=12";
$pf .= "&endday=31";
$pf .= "&endyear=2006";
$pf .= "&paymentsreceived=1";
$pf .= "&fees=1";
$pf .= "&paymentidfilter=ZZZZZZZZZZZZZZZZ";

$ch = curl_init();

// Follow any Location headers
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
$url='https://www.e-gold.com/acct/historycsv.asp?' . $pf;
curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch,
CURLOPT_RETURNTRANSFER, 1);

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch,
CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_HEADER, FALSE);

$data=curl_exec($ch);
$info=curl_getinfo($ch);
echo "<p>curlerror=" . curl_error($ch);
curl_close($ch);
echo "<p>data=";
var_dump($data);
echo "<p>info=";
var_dump($info);
?>

attached mail follows:


To Ligaya and Jochm,

Thanks for your answers.

I have read and tried what several tutorials say to do. I have used both arrays and query strings to specify the post fields. I had not seen the tutorial Ligaya mentioned, but it was not essentially different from the others I have seen. And the PHP cURL documentation assumes that I know a lot more about what each option means than I do. I have been reading and re-reading that for days now.

I have the feeling that there is a CURLOPT_something or other that I should be using and am not, but I have no idea what it could be.

I thought it might have to do with cookies or verification or something, but I think I have tried all possible relevant combinations of those things.

I guess I will let it go for a while -- I was hoping someone would tell me that they had thus and such problem and did this and that to fix it and that that would work for me. (OK, so I'm an optimist (optomist??))

Thanks again, guys.

attached mail follows:


I apologize for the previous message. This
one should wrap better.

To Ligaya and Jochm,

Thanks for your answers.

I have read and tried what several tutorials
say to do. I have used both arrays and query
strings to specify the post fields. I had
not seen the tutorial Ligaya mentioned, but
it was not essentially different from the
others I have seen. And the PHP cURL
documentation assumes that I know a lot more
about what each option means than I do. I
have been reading and re-reading that for
days now.

I have the feeling that there is a
CURLOPT_something or other that I should be
using and am not, but I have no idea what it
could be.

I thought it might have to do with cookies or
verification or something, but I think I have
tried all possible relevant combinations of
those things.

I guess I will let it go for a while -- I was
hoping someone would tell me that they had
thus and such problem and did this and that
to fix it and that that would work for me.
(OK, so I'm an optimist (optomist??))

Thanks again, guys.

attached mail follows:


On Tue, January 2, 2007 9:23 am, Charley wrote:
> <input type="hidden" name="AccountID" value="XXXXXX">
...
> <input type="submit" value="Submit">
> *****/
>
> $pf = "AccountID=XXXXXX";
...
> $pf .= "&paymentidfilter=ZZZZZZZZZZZZZZZZ";

You are missing the "Submit" input, and ASP being ASP, it probably was
programmed to expect it, and will puke without it.

You also have added a paymentidfilter parameter that was not in the
original. You may not be allowed to have that in the POST, perhaps.

>
> $ch = curl_init();

...
> echo "<p>curlerror=" . curl_error($ch);

Based on the rest of your excellent post, you probably have no error
output here, but to be pedantic... Are there any error messages here?

You may also want to turn off the FOLLOWLOCATION and dump out whatever
responses as the come, and then build up another query to follow the
re-directs by hand. This will sometimes lead you to find out that
there are, for example, cookies flying back and forth that you need to
track (CURLOPT_COOKIEJAR and CURLOPT_COOKIEFILE) or something similar.

You may also want to provide some extra headers to make curl look more
like a "real" browser to fool any anti-web-scraping features in their
ASP script.

Compare output with Firefox LiveHTTPHeaders (?) and what curl is
giving you to find clues/differences that might indicate what to try
next.

Keep in mind that your goal is to make your curl script
indistinguishable to e-gold from a "real" user.

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

attached mail follows:


Richard,

Thanks for your answer.

What do you mean about the submit input? I
thought that was just a text link to cause
the form to be submitted when clicked. I
didn't know that it sent anything to the
server. (As you can tell, I don't know
anything about asp except what it stands
for.)

The paymentidfilter is a legitimate field,
and works in the form and in the GET version
of the cURL stuff.

You're right that I get no curl error, and
the curl info didn't seem to have anything
interesting in it.

It seems that e-gold has as its error
response to send the login page for whatever
one is asking for. This is not very helpful
(at least to me).

I'll see if I can get this LiveHTTPheaders
thing for firefox, since firefox is my main
browser.

From what I read, the cookie jar and file
options take the name of the same file as
their arguments. Is there any path
information that is required? Can I just use
something like "mycookies.txt" or must it
have a specific extension?

Thanks again.

attached mail follows:


It works!

All I did was comment out the
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1)
and set up the post and post fields options.

I used the query string format.

I may try the array later, but since this
works, I'm going to use it for now.

Thanks everybody!

attached mail follows:


I also use PHPmailer to send emails. However it is good to do it the 'hard'
way once to learn about mailing headers etc.

Best regards,
Peter Lauri

www.dwsasia.com - company web site
www.lauri.se - personal web site
www.carbonfree.org.uk - become Carbon Free

-----Original Message-----
From: Steven Macintyre [mailto:stevensteven.macintyre.name]
Sent: Tuesday, January 02, 2007 2:44 PM
To: php-generallists.php.net
Subject: RE: [PHP] Please help me

> When I send a mail using php using mail(), and using html tags in
> message
> body , these tags are being displayed as it is.
> Please let me know if there's any way of how to tackle with this.

I use phpmailer for all my email sending ...

Never had a problem with it

S

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

attached mail follows:


Are you trying to read cookies that are not set by your host? If that is the
case you will probably be disappointed. The purpose with cookies is that
they should only be table to be read by the one who is setting the cookie.

If you want to read cookies on the machine that you are able to view just:

echo "<pre>";
print_r($_COOKIE);
echo "</pre>";

Best regards,
Peter Lauri

www.dwsasia.com - company web site
www.lauri.se - personal web site
www.carbonfree.org.uk - become Carbon Free

-----Original Message-----
From: Dotan Cohen [mailto:dotancohengmail.com]
Sent: Tuesday, January 02, 2007 4:17 PM
To: php php
Subject: [PHP] How to read cookies set by php?

I'm trying to debug some scripts, and I see that the contents of
cookies seems to be encoded (in Firefox2 on Kubuntu, at least). How
can one read the cookies stored on his machine?

Dotan Cohen

http://what-is-what.com/what_is/gmail.html
http://datip.com

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

attached mail follows:


Configure the browser to prompt you before saving cookies, and then
surf there again?

Turn on LiveHTTPHeaders and see what the browser sends when you surf
back to that site?

Hack your /etc/hosts or \WINDOWS\system32\drivers\etc\hosts to have
the other guy's domain re-directed to your localhost, and set up PHP
to var_dump($_COOKIES) might work? Seems like an awful lot of work,
but it might make you feel like a real hacker :-) :-) :-)

On Tue, January 2, 2007 8:16 am, Dotan Cohen wrote:
> I'm trying to debug some scripts, and I see that the contents of
> cookies seems to be encoded (in Firefox2 on Kubuntu, at least). How
> can one read the cookies stored on his machine?
>
> Dotan Cohen
>
> http://what-is-what.com/what_is/gmail.html
> http://datip.com
>
> --
> 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 starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

attached mail follows:


Make the src ABSOULUTE and it will work. When you are using relative links
as you are right now the web server will look in the
https://www.mywebsite.com/images....

Best regards,
Peter Lauri

www.dwsasia.com - company web site
www.lauri.se - personal web site
www.carbonfree.org.uk - become Carbon Free

-----Original Message-----
From: R. Van Tassel [mailto:jazzsnoboptonline.net]
Sent: Tuesday, January 02, 2007 6:33 PM
To: php-generallists.php.net
Subject: RE: [PHP] Concerning SSL

How do you correct the image URLs? That's what I'm asking.

I have a website that is secure. When you change the URL from
http://www.mywebsite.com
to
https://www.mywebsite.com

the images disappear.

The images are codes as relative links:

http://www.mywebsite.com/images/myimage.jpg

is coded as <img src="images/myimage.jpg" /> if a root file

is coded as <img src="../images/myimage.jpg" /> if in a directory

-----Original Message-----
From: Jochem Maas [mailto:jochemiamjochem.com]
Sent: Tuesday, January 02, 2007 11:27 AM
To: R. Van Tassel
Cc: php-generallists.php.net
Subject: Re: [PHP] Concerning SSL

R. Van Tassel wrote:
> Hello everyone, I hope you all had a great new year.
>
> I'm having an issue with a website where changing the URL from http:// to
> https:// makes the images disappear. The images are all relative and not
> absolute.
>
> How can I fix this?

correct the image URLs? clear your cache?

we gave up mind-reading on the list last year, please provide us with
some actual info otherwise we can't help you.

>
> Thanks,
> -Roy
>

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

attached mail follows:


On Tue, January 2, 2007 10:19 am, R. Van Tassel wrote:
> I'm having an issue with a website where changing the URL from http://
> to
> https:// makes the images disappear. The images are all relative and
> not
> absolute.
>
> How can I fix this?

Right-click on the image and see what its "properties" or "location" is.

See what you're trying to use as an image URL.

Then figure out why that URL doesn't work.

You may also get useful info if you try to surf to that image direct
with "view image" from the right-click.

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

attached mail follows:


If it is stored in a database, you may want to convert within your query:
MySQL: date_format
Postgresql: to_char

If it's just in a text file, PHP's date() function should do it:
http://php.net/date

I dunno if there's a nifty constant for the format you want, but you
could always mess with mktime and date to get what you want.
http://php.net/mktime

On Tue, January 2, 2007 6:39 am, Steven Macintyre wrote:
> Hi all,
>
> I am unable to find out how to do this ... or what the format is
> "called"
> bar zulu format
>
> I have standard 00:00:00 time stored ... and wish to display it as
> 00h00 ...
> has anyone done this with php ... can you point me to right page etc
> ...
>
> What is that format called?
>
>
>
> Kind Regards,
>
>
> Steven Macintyre
> http://steven.macintyre.name
> --
>
> http://www.friends4friends.co.za
>
> --
> 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 starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

attached mail follows:


On Mon, January 1, 2007 4:26 am, Jason Paschal wrote:
> i realize this isn't the appropriate mailing list and i risk being
> black-listed (flame, defamed, ignored, etc.).
>
> i occasionally use temporary emails when registering for forums or to
> get
> some shareware (we've all done it, don't give me that look, i have
> given
> what i could, when i could) and while i like the way mytrashmail.com
> works,
> i don't like having mytrashmail.com as part of the temp addy.
>
> does anyone know of a similar service that uses a more enticing
> domain?

Yahoo.com?
Hotmail.com?

Or, since you control your own domain name, presumably, use something
like:
jpaschalhadbetternotspammeexample.com
when you give your email to jpaschal.com and use
amazonhadbetternotspammeexample.com
when you give your email to example.com and...

You can set up your email with catchall, or you can just set up the
email alias for as long as you need it to exist, and nuke it later
or...

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

attached mail follows:


I'm trying to build a CLI/CGI binary of PHP5 with MySQLi under Mac OS
X. When I invoke configure, I get the following error message:

"checking whether to enable embedded MySQLi support... no
mysql_config not found
configure: error: Please reinstall the mysql distribution"

Now, mysql (4.1.22) is in fact installed, and it looks to me like the
headers are in fact there (and mysql_config seems to be under ./bin),
and I did give it the path with the config option
(--with-mysqli=/usr/local/mysql -- yes, I know this isn't the
conventional Mac OS X path, but I like these things under /usr/local,
so....).

Curiously, I note that a build using --with-mysql=/usr/local/mysql
works just fine.

Any ideas what I'm doing wrong here?

attached mail follows:


# westoncgmail.com / 2007-01-02 18:23:33 -0700:
> I'm trying to build a CLI/CGI binary of PHP5 with MySQLi under Mac OS
> X. When I invoke configure, I get the following error message:
>
> "checking whether to enable embedded MySQLi support... no
> mysql_config not found
> configure: error: Please reinstall the mysql distribution"
>
> Now, mysql (4.1.22) is in fact installed, and it looks to me like the
> headers are in fact there (and mysql_config seems to be under ./bin),
> and I did give it the path with the config option
> (--with-mysqli=/usr/local/mysql -- yes, I know this isn't the
> conventional Mac OS X path, but I like these things under /usr/local,
> so....).
>
> Curiously, I note that a build using --with-mysql=/usr/local/mysql
> works just fine.
>
> Any ideas what I'm doing wrong here?

It wants "--with-mysql=/usr/local/mysql/mysql_config", see
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/config.m4?revision=1.25&view=markup

--
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man. You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991

attached mail follows:


# neuhausersigpipe.cz / 2007-01-03 02:55:11 +0000:
> # westoncgmail.com / 2007-01-02 18:23:33 -0700:
> > I'm trying to build a CLI/CGI binary of PHP5 with MySQLi under Mac OS
> > X. When I invoke configure, I get the following error message:
> >
> > "checking whether to enable embedded MySQLi support... no
> > mysql_config not found
> > configure: error: Please reinstall the mysql distribution"
> >
> > Now, mysql (4.1.22) is in fact installed, and it looks to me like the
> > headers are in fact there (and mysql_config seems to be under ./bin),
> > and I did give it the path with the config option
> > (--with-mysqli=/usr/local/mysql -- yes, I know this isn't the
> > conventional Mac OS X path, but I like these things under /usr/local,
> > so....).
> >
> > Curiously, I note that a build using --with-mysql=/usr/local/mysql
> > works just fine.
> >
> > Any ideas what I'm doing wrong here?
>
> It wants "--with-mysql=/usr/local/mysql/mysql_config", see

--sith-mysqli, of course, sorry for the noise

> http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/config.m4?revision=1.25&view=markup

--
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man. You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991

attached mail follows:


On Mon, January 1, 2007 12:40 am, edwardsplita.org.mo wrote:
> Dear All,
>
> Happy New Year,
>
> How much mem ( Ram ) does the php5 need ?

Yes.

:-)

Depends on what extension you add, what you do with those extensions,
and what sort of performance you expect to get.

Depends if you run as a Module, as CGI, as Fast CGI, and if you are on
Windows, Linux, FreeBSD, or Other.

Probably a little more than PHP5, and not quite as much as PHP6.

Does that help at all?

I'd like to give a better answer, if you asked a better question.
:-)

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

attached mail follows:


You can try tacking a "&" at the end to fork the Notepad opening...

It may or may not work depending on a bunch of factors.

Don't be surprised if it "works" and makes your Windows box even more
unstable than it already way, and you get random crashes from this.

Thread-safety within PHP extensions is not guaranteed, and don't even
ask about Notepad and thread safety...

Note that it could work fine for YEARS and then you un-comment an
un-threadsafe extension in php.ini and Bam! the whole thing starts
crashing at random points for no obvious reason.

On Sun, December 31, 2006 10:18 am, Michel wrote:
>
> I (very simply) try to open a "notepad" on a simple text file in a
> simplistic PHP script, and would like to go on and display the next
> page
> without waiting for this notepad to be shut.
>
> After various attempts, I have used an :
>
> exec ('bash -c cmd /C start /MAX notepad "my_file" > NUL');
>
> ... but it still wait for the shutting of the notepad ..!
>
> Could anybody help me ?
>
> For clarification :
> 1) I use this script on a machine which is in the same time "server"
> and
> "client", which gives "meaning" to this operation.
> 2) I use "bash -c" because I have the cygwin platform which can easily
> initiate tasks in background, but it could be suppressed, because it
> "de
> facto" changes nothing...
>
> Thank's for help.
>
> Michel.
>
> --
> 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 starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

attached mail follows:


I think you want $bytes_out >= $size, actually...

I'm not sure what you are sending out for that last extra byte... :-)

You could consider just timing out any zombies.

You could use "ignore_user_abort" and hope to "finish" most of the
downloads, as far as PHP is concerned, but I don't think
ignore_user_abort is 100% guaranteed, and there's always the chance of
a PHP or Apache connection crashing...

You could also re-think the problem to check, say, load on the server,
or some sort of bandwidth meter that you could manage, rather than N
slots.

So somebody on a dog-slow dialup downloading would not "count" as much
as somebody sucking down your entire bandwidth on a T-1.

By shaping it by the bytes/sec being spewed out by PHP, zombie
connections will naturally stop updating the meter, so won't count.

On Sun, December 31, 2006 9:12 am, Aras wrote:
> First of all, Happy New Year for everyone in the list. I wish 2007
> brings
> all us happiness, health and peace.
>
> I want to read your advises at a point i am stuck within, i have an
> application that serves downloads to clients. For some reason i am
> limiting
> total open slot for some group of users (not related to my technical
> question).
>
> Example;
>
> // CHECKS SLOT HERE
>
> else { // IF THERE ANY AVAILABLE SLOTS SEND THE FILE
>
> // INCREMENT SLOT NUMBER BY 1
>
> $fp = fopen($pathside,"r");
>
> if ($fp) {
>
> while (!feof($fp)) {
> echo fread($fp, 334);
>
> $bytes_out += 334;
> ob_flush();
>
> if ($bytes_out > $size) {
>
> // DECREASE SLOT NUMBER BY 1, BECAUSE THIS DOWNLOAD IS FINISHED
>
> }
>
> }
>
> }
>
> }
>
>
> Slots are recorded and checked from a simple mysql table. Everything
> works
> in this scenario. There is no problem if a person starts a download
> and
> finishes it, his slots get empty upon doing so. Yet if he cancelles
> the
> transfer, he will never reach my control structure to empty the slot.
> And
> slots will be full of zombies.
>
> I have thought of updating a mysql field for alive-connections in the
> while
> loop, but it will definitely add some load on my server. Updating a
> system
> file is not secure and good way.
>
> What other ways can you recommend to me for the situtation?
>
>
> Aras Koktas
> managerphidot.com
> Business Excellence Development
> Phi.dot Internet Systems
>
> --
> 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 starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

attached mail follows:


It's NOT register_globals being off.

It's E_NOTICE being on.

You could turn E_NOTICE off and *ignore* these errors -- They are
still there, you are just ignoring them.

Or you could fix the script:

$action = isset($_GET['action']) ? $_GET['action'] : '';

would be the replacement line for your first example.

On Sat, December 30, 2006 7:21 pm, Wikus Moller wrote:
> Hi to all.
>
> I am having huge problems running my script, which worked fine on a
> server with php 4 and register_globals turned on, on a server with php
> 5 and register_globals turned off.
>
> I get errors around the area in my script where I use $_GET (not the
> only error). For example the following code on my index.php file which
> like many other sites I know, handles quite a large amount
> if(action=="main"); etc etc. :
>
> <?
> $action = $_GET["action"]; //line 55
> $sid = $_GET["sid"]; //line 56
> $page = $_GET["page"]; //line 57
> $who = $_GET["who"]; //line 58
> ?>
>
> When I go to http://chillinglounge.net (where the error is located) I
> get the following error message(s):
>
> Notice: Undefined index: action in
> C:\websites\chillinglounge.net\public_html\index.php on line 55
>
> Notice: Undefined index: sid in
> C:\websites\chillinglounge.net\public_html\index.php on line 56
>
> Notice: Undefined index: page in
> C:\websites\chillinglounge.net\public_html\index.php on line 57
>
> Notice: Undefined index: who in
> C:\websites\chillinglounge.net\public_html\index.php on line 58
>
> Now if you would look at exactly the same script at
> http://ranterswap.net you'd see absolutely no errors.
>
> That's where I need your help. I know what is causing this error. I
> believe it's the fact that register_globals is turned off.
>
> But what I really want to know is: How do I fix it without trying to
> turn register_globals on via .htaccess (because it doesn't work)?
>
> Is there a function or some magic script that would to the trick?
> Or do I have to recode my entire script and how?
>
> --
> 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 starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

attached mail follows:


Hi,

I need to build my own php binary to use on a remote server that I do
not have full control over. The latest php needs a newer openssl than
the server has.

How can I compile php such that it will link in the openssl libs
statically so that I can run it on the remote server which does not
have the newest openssl libs?

Thank you.

attached mail follows:


Mixing Location and Cookie headers has always been hit and miss...

I think you could fix it with session_write_close() or you could just
replace the Location: with:
require 'b.php';
since you are just wasting HTTP connections the way you have it now...

On Sat, December 30, 2006 12:56 pm, tedd wrote:
> Hi gang:
>
> I have a small php script that behaves differently depending upon
> who's calling it. The code is:
>
> <?php session_start(); /* a.php */
> ob_start();
> $_SESSION['var'] = "test";
> ob_clean();
> header("Location: http://www.example.com/b.php"); /* Redirect browser
> */
> exit; ?>
>
> If the code is called directly, namely http://www.example.com/a.php,
> then the $_SESSION var is filled with "text" and the redirect is
> realized.
>
> However, if the php script is called via ajax:
>
> -snip- preceding ajax
>
> function sndReq(action)
> {
> http.open('get', 'a.php');
> http.send(null);
> }
>
> Then the $_SESSION var is filled with "test", but the redirect is not
> realized.
>
> Why can't the php script redirect the browser when called via ajax ?
>
> Thanks.
>
> 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
>
>

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

attached mail follows:


Hello,

I have a script I've created which takes a file upload, monkeys with the
data in it, and needs to push the new file out to the browser. Everything
is coded and working up to that last point, but I've never pushed out a file
to the browser before. Does anyone have the code for this laying around
that I can see (and modify)?

Mike

attached mail follows:


What do you mean by `pushing`?

On 9/15/06, Mike Mannakee <mikebasementideas.com> wrote:
> Hello,
>
> I have a script I've created which takes a file upload, monkeys with the
> data in it, and needs to push the new file out to the browser. Everything
> is coded and working up to that last point, but I've never pushed out a file
> to the browser before. Does anyone have the code for this laying around
> that I can see (and modify)?
>
> Mike
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


# mikebasementideas.com / 2006-09-15 20:39:16 -0400:
> I have a script I've created which takes a file upload, monkeys with the
> data in it, and needs to push the new file out to the browser. Everything
> is coded and working up to that last point, but I've never pushed out a file
> to the browser before.

Each time any of your PHP web scripts is run to display a "page", it
"pushes" a file to the browser: the page is the file.

> Does anyone have the code for this laying around that I can see (and
> modify)?

There's no code, there's only comprehension. The fishing manual is at:
ftp://ftp.rfc-editor.org/in-notes/rfc2616.txt

--
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man. You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991

attached mail follows:


roman neuhauser describes it rather well on the other thread.
Basically. the push in this context below, is the response php
provides

php.net/header has a lot of info about how to send a non html file
back to the browser.

Curt.

On 1/2/07, Casey Chu <heavyccaseygmail.com> wrote:
> What do you mean by `pushing`?
>
> On 9/15/06, Mike Mannakee <mikebasementideas.com> wrote:
> > Hello,
> >
> > I have a script I've created which takes a file upload, monkeys with the
> > data in it, and needs to push the new file out to the browser. Everything
> > is coded and working up to that last point, but I've never pushed out a file
> > to the browser before. Does anyone have the code for this laying around
> > that I can see (and modify)?
> >
> > Mike
> >
> > --
> > 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
>
>

attached mail follows:


hi all,

I got problem in getting file content. the file is located at another server
(tomcat) and it is a jsp file.
i don't know why i keep getting the same error message file accessing that
file but
while i am trying to access to another file, from another server it run
perfect.
this is the error message i get:
PHP Warning:
file_get_contents(http://123.123.1.2:8008/V3JRoute?slot=1&startX=103.880764&startY=1.335458&endX=103.886297&endY=1.334953&routeType=1&format=2)
[function.file-get-contents]: failed to open stream: HTTP request failed!
$5$13:53:22,13:53:22,13:53:22,13:53:22,13:53:22$0.0,0.0,0.0,0.0,0.0$Depart
on,Turn sharp left onto,Continue on,Turn right onto in C:\Program
Files\MapGuideOpenSource\WebServerExtensions\www\phpviewersample\xmlaccesstrial.php
on line 5

take note that the text in bold is part of the page contents.
i don't understand why i cant get the whole content and keep getting this
error.
I hope somebody can help me out.

Thank you

Regards,
Kencana
--
View this message in context: http://www.nabble.com/http-request-problem-tf2911952.html#a8136255
Sent from the PHP - General mailing list archive at Nabble.com.

attached mail follows:


hi all,

by the way, the page that i am trying to get, i can open the page without
any problem
in IE 7 browser.

Thanks

Regards,
Kencana

--
View this message in context: http://www.nabble.com/http-request-problem-tf2911952.html#a8136297
Sent from the PHP - General mailing list archive at Nabble.com.

attached mail follows:


On 1/2/07, Kencana <bluesky_dyxhotmail.com> wrote:
>
> hi all,
>
> I got problem in getting file content. the file is located at another server
> (tomcat) and it is a jsp file.
> i don't know why i keep getting the same error message file accessing that
> file but
> while i am trying to access to another file, from another server it run
> perfect.
> this is the error message i get:
> PHP Warning:
> file_get_contents(http://123.123.1.2:8008/V3JRoute?slot=1&startX=103.880764&startY=1.335458&endX=103.886297&endY=1.334953&routeType=1&format=2)
> [function.file-get-contents]: failed to open stream: HTTP request failed!
> $5$13:53:22,13:53:22,13:53:22,13:53:22,13:53:22$0.0,0.0,0.0,0.0,0.0$Depart
> on,Turn sharp left onto,Continue on,Turn right onto in C:\Program
> Files\MapGuideOpenSource\WebServerExtensions\www\phpviewersample\xmlaccesstrial.php
> on line 5

Sounds like you need to make that 'right turn', the only people that
could answer this are the people that wrote V3JRoute

Curt.

attached mail follows:


===ORINGIAL===
hi all,

I got problem in getting file content. the file is located at another server
(tomcat) and it is a jsp file.
i don't know why i keep getting the same error message file accessing that
file but
while i am trying to access to another file, from another server it run
perfect.
this is the error message i get:
PHP Warning:
file_get_contents(
http://123.123.1.2:8008/V3JRoute?slot=1&startX=103.880764&startY=1.335458&endX=103.886297&endY=1.334953&routeType=1&format=2
)
[function.file-get-contents]: failed to open stream: HTTP request failed!
$5$13:53:22,13:53:22,13:53:22,13:53:22,13:53:22$0.0,0.0,0.0,0.0,0.0$Depart
on,Turn sharp left onto,Continue on,Turn right onto in C:\Program
Files\MapGuideOpenSource\WebServerExtensions\www\phpviewersample\xmlaccesstrial.php
on line 5

take note that the text in bold is part of the page contents.
i don't understand why i cant get the whole content and keep getting this
error.
I hope somebody can help me out.

Thank you

Regards,
Kencana
===END ORIGINAL===

I tried following code but it gives the same error

$link="
http://123.123.1.2:8008/V3JRoute?slot=1&startX=103.880764&startY=1.335458&endX=103.886297&endY=1.334953&routeType=1&format=2
";

$handle2= fopen($link,"r");

   $contents = '';
   while (!feof($handle2)) {
     $contents = fread($handle, 819200);
     echo $contents;
   }

I tried opening the given URL directly, but this url seems to be a broken
link. If you try any other link, it will work

--
Regards
Fahad Pervaiz
www.ecommerce-xperts.com
(Shopping Cart, Web Design, SEO)

attached mail follows:


# fahad.pervaizgmail.com / 2007-01-03 11:19:21 +0500:
> ===ORINGIAL===
> hi all,
>
> I got problem in getting file content. the file is located at another server
> (tomcat) and it is a jsp file.
> i don't know why i keep getting the same error message file accessing that
> file but
> while i am trying to access to another file, from another server it run
> perfect.
> this is the error message i get:
> PHP Warning:
> file_get_contents(
> http://123.123.1.2:8008/V3JRoute?slot=1&startX=103.880764&startY=1.335458&endX=103.886297&endY=1.334953&routeType=1&format=2
> )
> [function.file-get-contents]: failed to open stream: HTTP request failed!
> $5$13:53:22,13:53:22,13:53:22,13:53:22,13:53:22$0.0,0.0,0.0,0.0,0.0$Depart
> on,Turn sharp left onto,Continue on,Turn right onto in C:\Program
> Files\MapGuideOpenSource\WebServerExtensions\www\phpviewersample\xmlaccesstrial.php
> on line 5
>
> take note that the text in bold is part of the page contents.

The text/plain version of your multipart/mixed email omits terminal
escape sequences ("tags") so there's no bold. But that error message
is somehow garbled anyway.

Now, what happens if you try to display that same url in a normal
browser on the same network where it fails in the PHP script? If it
works, what's the difference between the two requests? Use a packet
capture and analysis tool like Wireshark (formerly Ethereal) to tell.
If it doesn't work, fix that first. If it works from a normal browser,
you can't see anything wrong with the request made by PHP, *and* you
know your requests actually hit the server, ask its admin to cooperate.

--
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man. You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991

attached mail follows:


On 1/2/07, Fahad Pervaiz <fahad.pervaizgmail.com> wrote:
> this is the error message i get:
> PHP Warning:
> file_get_contents(
> http://123.123.1.2:8008/V3JRoute?slot=1&startX=103.880764&startY=1.335458&endX=103.886297&endY=1.334953&routeType=1&format=2
> )
> [function.file-get-contents]: failed to open stream: HTTP request failed!
> $5$13:53:22,13:53:22,13:53:22,13:53:22,13:53:22$0.0,0.0,0.0,0.0,0.0$Depart
> on,Turn sharp left onto,Continue on,Turn right onto in C:\Program
> Files\MapGuideOpenSource\WebServerExtensions\www\phpviewersample\xmlaccesstrial.php
> on line 5
>
> ===END ORIGINAL===
>
> I tried following code but it gives the same error

Same error?

>
> $link="
> http://123.123.1.2:8008/V3JRoute?slot=1&startX=103.880764&startY=1.335458&endX=103.886297&endY=1.334953&routeType=1&format=2
> ";
>
> $handle2= fopen($link,"r");
>
> $contents = '';
> while (!feof($handle2)) {

I get invalid handle with this code right at the above line.

And...
telnet 123.123.1.2 8008; never responds

if $link doesn't have carriage returns or line feeds, it waits for a
long time and repeats about an invalid handle as well.

> I tried opening the given URL directly, but this url seems to be a broken
> link. If you try any other link, it will work

i'm suspect at the actual ip used, the ip in question seems odd.

Curt

attached mail follows:


# fahad.pervaizgmail.com / 2007-01-03 11:19:21 +0500:
> ===ORINGIAL===
[...]
> ===END ORIGINAL===

Gah, early morning! Ok, I wasted my time thanks to your quoting style.
Would you please use something more conventional, like prefixing each
line of the quoted material with "> "? Thank you!
 
> I tried following code but it gives the same error
>
> $link="
> http://123.123.1.2:8008/V3JRoute?slot=1&startX=103.880764&startY=1.335458&endX=103.886297&endY=1.334953&routeType=1&format=2
> ";
>
> $handle2= fopen($link,"r");
>
> $contents = '';
> while (!feof($handle2)) {
> $contents = fread($handle, 819200);
> echo $contents;
> }
>
> I tried opening the given URL directly, but this url seems to be a broken
> link. If you try any other link, it will work

Thank you for the information.

Seriosly: does that mean that your original question is answered, or do
you still expect advice on getting it to work? I really can't tell,
there's neither a question nor a "solved" statement in your email.

--
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man. You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991

attached mail follows:


# fahad.pervaizgmail.com / 2007-01-03 11:19:21 +0500:
> ===ORINGIAL===
> hi all,
>
> I got problem in getting file content. the file is located at another server
> (tomcat) and it is a jsp file.
> i don't know why i keep getting the same error message file accessing that
> file but
> while i am trying to access to another file, from another server it run
> perfect.
> this is the error message i get:
> PHP Warning:
> file_get_contents(
> http://123.123.1.2:8008/V3JRoute?slot=1&startX=103.880764&startY=1.335458&endX=103.886297&endY=1.334953&routeType=1&format=2
> )
> [function.file-get-contents]: failed to open stream: HTTP request failed!
> $5$13:53:22,13:53:22,13:53:22,13:53:22,13:53:22$0.0,0.0,0.0,0.0,0.0$Depart
> on,Turn sharp left onto,Continue on,Turn right onto in C:\Program
> Files\MapGuideOpenSource\WebServerExtensions\www\phpviewersample\xmlaccesstrial.php
> on line 5
>
> take note that the text in bold is part of the page contents.

The text/plain version of your multipart/mixed email omits terminal
escape sequences ("tags") so there's no bold. But that error message
is somehow garbled anyway.

Now, what happens if you try to display that same url in a normal
browser on the same network where it fails in the PHP script? If it
works, what's the difference between the two requests? Use a packet
capture and analysis tool like Wireshark (formerly Ethereal) to tell.
If it doesn't work, fix that first. If it works from a normal browser,
you can't see anything wrong with the request made by PHP, *and* you
know your requests actually hit the server, ask its admin to cooperate.

--
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man. You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991

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

attached mail follows:


On 1/3/07, Roman Neuhauser <neuhausersigpipe.cz> wrote:
> # fahad.pervaizgmail.com / 2007-01-03 11:19:21 +0500:
> > ===ORINGIAL===
> [...]
> > ===END ORIGINAL===
>
> Gah, early morning! Ok, I wasted my time thanks to your quoting style.
> Would you please use something more conventional, like prefixing each
> line of the quoted material with "> "? Thank you!

I had the same problem.

>
> > I tried following code but it gives the same error
> >
> > $link="
> > http://123.123.1.2:8008/V3JRoute?slot=1&startX=103.880764&startY=1.335458&endX=103.886297&endY=1.334953&routeType=1&format=2
> > ";
> >
> > $handle2= fopen($link,"r");
>> ...
>
> Seriosly: does that mean that your original question is answered, or do
> you still expect advice on getting it to work? I really can't tell,
> there's neither a question nor a "solved" statement in your email.

It all is in Kencana's (the original author) shoes right now i dont
know what to advise other than what has been provided to figure out
such an odd error.

Curt

attached mail follows:


I've recently discovered a tool that I recommend for web work:
ServiceCapture by Kevin Langdon
http://kevinlangdon.com/serviceCapture/

It acts as an HTTP proxy, inserting itself between browser and the
net, and logs the details of http requests and responses.

It's been a great help to me lately while working on a PHP-Flash
dialog via AMF-PHP, and will undoubtedly save time on future projects
when I need to debug cookies and posts.

(This is a spontaneous, unsolicited, uninvested recommendation. I
just really like the software and thought you might find it useful.)

Regards,

Paul
__________________________

Juniper Webcraft Ltd.
http://juniperwebcraft.com

attached mail follows:


On Tue, 26 Dec 2006 17:22:39 +0500, "Fahad Pervaiz" wrote:

> I want to download UTF-8 encoded kml files from a website. I have written a
> script that automatically downloads KML file. Problem is that some of the
> utf-8 charc are distrubed after saving file on windows. below is the script.
>
> $handle = fopen($link, "rb");
>
> $handle2= fopen("kml/$i.kml","w");

Using binary mode in both streams might help:

   $handle2= fopen("kml/$i.kml","wb");
                                ^^^^

--nfe

attached mail follows:


Hi,

I need to read cwk files (mac clarisworks files). so is it possible to do so
using php if so how to do that?

Thanks.

_________________________________________________________________
Get FREE Web site and company branded e-mail from Microsoft Office Live
http://clk.atdmt.com/MRT/go/mcrssaub0050001411mrt/direct/01/

attached mail follows:


On 1/3/07, John Salib <nicetime_chhotmail.com> wrote:
> Hi,
>
> I need to read cwk files (mac clarisworks files). so is it possible to do so
> using php if so how to do that?

Sure you can read the files, the question is what is the output you want it in?

Once that is answered, is there such a tool i can use to do that?

Curt.