RE: [PHP] fopen a URL with = in it

2001-08-03 Thread Corey Chapman

It does not work with the = right in the URL.. PHP gives me a warning 
about the fopen statement or file statement if I do.. and then returns 
nothing.

If I escape it, it loads the proper URL, but then the page it opens 
does not recognize the defined variables because it loads 
http://www.something.com/file.php?thing\=thething instead of 
http://www.something.com/file.php?thing=thething...

> why dont you try:
> fopen("http://www.something.com/file.php?thing=thething","r";);
> 
> ...and are you sure it's "not working", or just
> not returning anything???
> 
> try putting checks on *all* IO/net functions:
> 
> $fp = fopen( ... ) 
>   or die("Cannot open file!");
> 
> 
> 
> 
> > -----Original Message-
> > From: Corey Chapman [mailto:[EMAIL PROTECTED]]On Behalf Of Corey
> > Chapman
> > Sent: Friday, August 03, 2001 2:46 PM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] fopen a URL with = in it
> > 
> > 
> > Something that's been driving me crazy for a few days. Could it 
> > be a bug in PHP?
> > 
> > Using the fopen function (or even the file function), I want to 
open a 
> > web page for read. Sounds easy? Well, say I want to have an "=" 
sign in 
> > the URL.. well that is where the problem comes. I have tried things 
> > like this:
> > 
> > $eq = urlencode("=");
> > $URL = "http://www.something.com/file.php?thing".$eq."thething"
> > 
> > I have tried many other combinations as well.. the problem is this: 
> > when PHP calls fopen(), it does not allow the = sign in the 
variable 
> > passed in. So I figured I should escape it..
> > 
> > fopen("http://www.something.com/file.php?thing\=thething","r";;);
> > 
> > But that did not work either. It allows me to pass it in, but then 
it 
> > tries to open the literal \= in the url, which of course doesn't 
> > exist. The url has just an =. I thought encoding the whole or part 
URL 
> > would work. well it loads the page, but the page itself doesn't 
> > recognize the encoded = sign as being an = sign.. 
> > 
> > Bah! Anyone have any ideas.. ?
> > 
> > 
> > Corey Chapman
> > Xnull CEO
> > (Chat with us: http://forum.xnull.com)
> > 
> > -- 
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: php-list-
[EMAIL PROTECTED]
> > 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: php-list-
[EMAIL PROTECTED]
> 
> 
> 

Corey Chapman
Xnull CEO
(Chat with us: http://forum.xnull.com)

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] web traffic report

2001-08-03 Thread Corey Chapman

Can't you just run a cron job (set it to do it automatically every so 
often) to delete the file from your web account's tmp folder.. ?

> Has anyone figured a way to purge access-log files after webalizer is 
done
> using to data only so far back?
> 
> -eric
> - Original Message -
> > I'm rather fond of Webalizer (www.mrunix.net/webalizer).
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: php-list-
[EMAIL PROTECTED]
> 
> 
> 

Corey Chapman
Xnull CEO
(Chat with us: http://forum.xnull.com)

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Re: fopen a URL with = in it

2001-08-03 Thread Corey Chapman

So you're saying that I should be able to pass the = sign in just fine 
into the fopen call with no errors? I understand what you mean that if 
= was what the variable was defined as, then THAT is where I'd use 
urlencode ;) I wasn't too sure about that, but now I am.

Quite odd that it reports errors then when passing in an = sign. 
Perhaps PHP does not like to load url's like that.. 

> You would only want URLEncode if "thething" had the "=" in it as part 
of the
> data...
> 
> "http://whatever.com/foo.php?operand="; . urlencode("=")
> 
> might be a URL for math geeks to talk about the "=" sign :-)
> 
> --
> WARNING [EMAIL PROTECTED] address is an endangered species -- Use
> [EMAIL PROTECTED]
> Wanna help me out?  Like Music?  Buy a CD: http://l-i-
e.com/artists.htm
> Volunteer a little time: http://chatmusic.com/volunteer.htm
> - Original Message -
> From: Corey Chapman <[EMAIL PROTECTED]>
> Newsgroups: php.general
> To: <[EMAIL PROTECTED]>
> Sent: Friday, August 03, 2001 1:45 PM
> Subject: fopen a URL with = in it
> 
> 
> > Something that's been driving me crazy for a few days. Could it
> > be a bug in PHP?
> >
> > Using the fopen function (or even the file function), I want to 
open a
> > web page for read. Sounds easy? Well, say I want to have an "=" 
sign in
> > the URL.. well that is where the problem comes. I have tried things
> > like this:
> >
> > $eq = urlencode("=");
> > $URL = "http://www.something.com/file.php?thing".$eq."thething"
> >
> > I have tried many other combinations as well.. the problem is this:
> > when PHP calls fopen(), it does not allow the = sign in the variable
> > passed in. So I figured I should escape it..
> >
> > fopen("http://www.something.com/file.php?thing\=thething","r";;);
> >
> > But that did not work either. It allows me to pass it in, but then 
it
> > tries to open the literal \= in the url, which of course doesn't
> > exist. The url has just an =. I thought encoding the whole or part 
URL
> > would work. well it loads the page, but the page itself doesn't
> > recognize the encoded = sign as being an = sign..
> >
> > Bah! Anyone have any ideas.. ?
> >
> >
> > Corey Chapman
> > Xnull CEO
> > (Chat with us: http://forum.xnull.com)
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: php-list-
[EMAIL PROTECTED]
> 
> 
> 

Corey Chapman
Xnull CEO
(Chat with us: http://forum.xnull.com)

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] magazine-subscription

2001-08-05 Thread Corey Chapman

Nope.. we are writing our own to handle our Ezine. Best bet is to work 
on a mysql/php system, unless you can find one.

> Hi, 
> 
>  Does anyone know of a tool to handle an online
> magazine and the magazine-subscriptions?
> 
> Thanks, 
> Chetan.
> 
> __
> Do You Yahoo!?
> Make international calls for as low as $.04/minute with Yahoo! 
Messenger
> http://phonecard.yahoo.com/
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: php-list-
[EMAIL PROTECTED]
> 
> 
> 

Corey Chapman
Xnull CEO
(Chat with us: http://forum.xnull.com)

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] age

2001-08-05 Thread Corey Chapman

Here's something I use for a date string that looks like mm/dd/ to 
turn the date into an age from the current date.

$age = explode("/", $bdate);
$userage = date("Y") - $age[2];
if($age[0] > date("m") || ( $age[0] == date("m") && $age[1] > date
("d"))) { --$userage; }
if($userage > 50) { $userage = ""; }

I did not compensate for leap years, however. You could use my code, 
and it should work fine, but the first line where I do an explode, 
you'd have to change that to turn your date string into #'s like I 
use.. 

> 
> does any one know where i can get a script that will convert a 
birthdate in to an age.  i have one half written however i have 
incounter difficulties with dealing with leap years.  perhaps soem one 
would know the solution  . ..  or just a premade script is fine
> 
> 
> $test = strtotime ("January 12, 1944");
> $test2 = strtotime ("January 9, 1954");
> 
> $oneyear = 3600 * 24 * 365;
> 
> $diff = $test2 - $test;
> $ans = $diff/$oneyear;
> 
> echo $ans;
> 
> 
> 
> 
> 
> Thank You,
>  
> Jon Yaggie
> www.design-monster.com
>  
> And they were singing . . . 
>  
> '100 little bugs in the code
> 100 bugs in the code
> fix one bug, compile it again
> 101 little bugs in the code
>  
> 101 little bugs in the code . . .'
>  
> And it continued until they reached 0
> 
> 
> 
> 

Corey Chapman
Xnull CEO
(Chat with us: http://forum.xnull.com)

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Re: fopen a URL with = in it

2001-08-05 Thread Corey Chapman

Ya, I may have to.. I can't seem to get this to work.

> I think it's time for you to submit a bug report at 
http://bugs.php.net
> unless one of the developers expressly described why it shouldn't 
work...
> 
> --
> WARNING [EMAIL PROTECTED] address is an endangered species -- Use
> [EMAIL PROTECTED]
> Wanna help me out?  Like Music?  Buy a CD: http://l-i-
e.com/artists.htm
> Volunteer a little time: http://chatmusic.com/volunteer.htm
> - Original Message -
> From: Corey Chapman <[EMAIL PROTECTED]>
> To: Richard Lynch <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Friday, August 03, 2001 10:19 PM
> Subject: Re: [PHP] Re: fopen a URL with = in it
> 
> 
> > So you're saying that I should be able to pass the = sign in just 
fine
> > into the fopen call with no errors? I understand what you mean that 
if
> > = was what the variable was defined as, then THAT is where I'd use
> > urlencode ;) I wasn't too sure about that, but now I am.
> >
> > Quite odd that it reports errors then when passing in an = sign.
> > Perhaps PHP does not like to load url's like that..
> >
> > > You would only want URLEncode if "thething" had the "=" in it as 
part
> > of the
> > > data...
> > >
> > > "http://whatever.com/foo.php?operand="; . urlencode("=")
> > >
> > > might be a URL for math geeks to talk about the "=" sign :-)
> > >
> > > --
> > > WARNING [EMAIL PROTECTED] address is an endangered species -- Use
> > > [EMAIL PROTECTED]
> > > Wanna help me out?  Like Music?  Buy a CD: http://l-i-
> > e.com/artists.htm
> > > Volunteer a little time: http://chatmusic.com/volunteer.htm
> > > - Original Message -
> > > From: Corey Chapman <[EMAIL PROTECTED]>
> > > Newsgroups: php.general
> > > To: <[EMAIL PROTECTED]>
> > > Sent: Friday, August 03, 2001 1:45 PM
> > > Subject: fopen a URL with = in it
> > >
> > >
> > > > Something that's been driving me crazy for a few days. Could it
> > > > be a bug in PHP?
> > > >
> > > > Using the fopen function (or even the file function), I want to
> > open a
> > > > web page for read. Sounds easy? Well, say I want to have an "="
> > sign in
> > > > the URL.. well that is where the problem comes. I have tried 
things
> > > > like this:
> > > >
> > > > $eq = urlencode("=");
> > > > $URL = "http://www.something.com/file.php?
thing".$eq."thething";;
> > > >
> > > > I have tried many other combinations as well.. the problem is 
this:
> > > > when PHP calls fopen(), it does not allow the = sign in the 
variable
> > > > passed in. So I figured I should escape it..
> > > >
> > > > fopen("http://www.something.com/file.php?thing\=thething","r";;);
> > > >
> > > > But that did not work either. It allows me to pass it in, but 
then
> > it
> > > > tries to open the literal \= in the url, which of course doesn't
> > > > exist. The url has just an =. I thought encoding the whole or 
part
> > URL
> > > > would work. well it loads the page, but the page itself doesn't
> > > > recognize the encoded = sign as being an = sign..
> > > >
> > > > Bah! Anyone have any ideas.. ?
> > > >
> > > >
> > > > Corey Chapman
> > > > Xnull CEO
> > > > (Chat with us: http://forum.xnull.com)
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > To contact the list administrators, e-mail: php-list-
> > [EMAIL PROTECTED]
> > >
> > >
> > >
> >
> > Corey Chapman
> > Xnull CEO
> > (Chat with us: http://forum.xnull.com)
> 
> 
> 

Corey Chapman
Xnull CEO
(Chat with us: http://forum.xnull.com)

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]