Re: [PHP] uksort wisdom

2002-02-04 Thread Edward van Bilderbeek - Bean IT

shouldn't it be:
uksort($array_array,"cmp");

Greets,

Edward


- Original Message -
From: "Sondra Russell" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, February 05, 2002 5:52 AM
Subject: [PHP] uksort wisdom


> Hi Guys!
>
> I'm looking to get a *deeper understanding* of uksort.  My quandry:
>
> $array[listing1][name] = "listing 1";
> $array[listing1][premiere] = "";
> $array[listing2][name] = "listing 2";
> $array[listing2][premiere] = "";
> $array[listing3][name] = "listing 3";
> $array[listing3][premiere] = "yes";
>
> I'd like the result to come out as:
> $array[listing3] //(this is the one with the premiere set to "yes")
> $array[listing1] // (no premiere, but in order)
> $array[listing2] // (again, no premiere, but again in order)
>
> So far, I've got:
>
> function cmp= ($a,$b) {
> global $array;
> if ($array [$a][premiere] == "yes") {
> return -1;
> } else {
> return ($a < $b) ? -1 : 1;
> }
> }
>
> uksort($array_array,cmp);
>
> But that ends up, strangely with:
> $array[listing3]
> $array[listing2]
> $array[listing1]
>
>
> Any wisdom?  Just would like a better idea of the inner workings of
uksort.
>
> Best,
> Sondra
>
> --
> 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




RE: [PHP] whic OS is under?

2002-02-04 Thread Jerry Verhoef (UGBI)

http://www.php.net/manual/en/function.php-uname.php

Take a look at the example there

> -Original Message-
> From: Ivo Stoykov [mailto:[EMAIL PROTECTED]]
> Sent: Monday, February 04, 2002 2:45 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] whic OS is under?
> 
> 
> Hi group:
> 
> Is there a way to guess which OS the script is running? I 
> couldn't find
> anything in the manual about this.
> 
> Thank you
> 
> Ivo
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


The information contained in this email is confidential and
may be legally privileged. It is intended solely for the 
addressee. Access to this email by anyone else is 
unauthorized. If you are not the intended recipient, any 
form of disclosure, production, distribution or any action 
taken or refrained from in reliance on it, is prohibited and 
may be unlawful. Please notify the sender immediately.

The content of the email is not legally binding unless 
confirmed by letter bearing two authorized signatures.

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




Re: [PHP] Problem...header already sent by

2002-02-04 Thread Jason Wong

On Tuesday 05 February 2002 15:20, Peter wrote:
> Hi Ryan,
>   Thanks for the examples.  Okay, I deleted the other stuff and just put
> this code and I get this from
> my interpreter?  Is this a setting problem?


Are you running PHP as a CGI? If so, what you want to do cannot be done. See 
chapter "HTTP authentication with PHP".


-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk

/*
You will triumph over your enemy.
*/

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




Re: [PHP] Problem...header already sent by

2002-02-04 Thread Ryan F. Bayhonan

It will work as expected Peter.



So where do we go from here??

Ryan



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




RE: [PHP] Re: Changes in Sessions (PHP Versions)

2002-02-04 Thread Travis Simpson

Sorry, I probably worded my question wrong.

I am creating a 10 step (or so) form that is non-linear... The user
enters all of their information and is able to go back and change
information that they have filled in. So I have the form (POST)
information set into session variables as soon as they click "Next" in
the form. Well, with 4.1.1 there were no problems... It ALL worked
perfectly. But unfortunately, in 4.0.6 it doesn't act the same.

I just have a foreach loop go through all the POST variables and make
them into SESSION variables,

--- Snippet ---
start_session();
foreach ($HTTP_POST_VARS as $key => $value) {
$HTTP_SESSION_VARS["$key"] = $value;
}
--- End Snippet ---

Easy enough... Now, I have all the 10 steps linked to on the side bar.
Step 1

But for some weird reason, those links BLANK all the session variables.
I tested this by doing a count() on the HTTP_SESSION_VARS array. And as
soon as I click one of the Step links on the side, it clears all of
them. I am not sure if I am doing this wrong, but it works fine (as I
said) in 4.1.1.

Another problem that I seem to be having... Is that 4.0.6 almost seems
like it is maxing out with a certain number of SESSION variables. Once
it has so many, it just starts over.

I will just post the link here tomorrow, unfortunately I don't have the
files on this computer.

I hope this is a little more clear.

Thanks,
-Travis



-Original Message-
From: Yasuo Ohgaki [mailto:[EMAIL PROTECTED]] 
Sent: Monday, February 04, 2002 6:11 PM
To: [EMAIL PROTECTED]; Travis Simpson
Subject: [PHP] Re: Changes in Sessions (PHP Versions)


Travis Simpson wrote:
> Hey,
> 
> I am just wondering if there were any changes done to the session 
> "engine" or settings between PHP 4.0.6 and 4.1.1.
> 
> I have been getting nothing but grief from 4.0.6 and 4.1.1 seems to 
> work fine.
> 


What did work with 4.0.6 and what didn't with 4.1.1?

If you are trying to use mm/msession save handler, it's broken somewhat.

-- 
Yasuo Ohgaki
Please CC me when you reply to news/list messages.
Do not reply only to me :)


-- 
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




Re: [PHP] Problem...header already sent by

2002-02-04 Thread Peter

Hi Ryan,
  Thanks for the examples.  Okay, I deleted the other stuff and just put
this code and I get this from
my interpreter?  Is this a setting problem?

Thanks,
Peter


*
/* error message from the web server */
The server encountered an internal error or misconfiguration and was unable
to complete your request.
Please contact the server administrator, [EMAIL PROTECTED] and inform them of
the time the error occurred, and anything you might have done that may have
caused the error.

More information about this error may be available in the server error log.

/* snipet from apache/logs/error.log */

[Mon Feb 04 22:36:30 2002] [error] [client 127.0.0.1] malformed header from
script. Bad header=HTTP/1.0 401 Unauthorized: /apache/php/php.exe




> Hello Peter. Good Day.
>
> Omitting  does not solve the problem. I've experience this
> problem also before. I found out that the once causing the problem is when
> any data that has been sent to the client. I have listed some example
below.
>
> Examples: All of these will cause a warning when header is called.
>
> 1. Since the tag  will be interpreted by the client browser first
> before the  tags, data has been sent to the client, telling
the
> client that an html file is being rendered. So when the browser interprets
> the header function, a warning will be issued.
>
> 
>  header( some parameters );
> exit;
>  ?>
>
> 2. This will also cause an error. Remember that a call to an echo or print
> function will send data (the parameters of the function) to the client. So
> when the header is interpreted, a warning will be issued.
>
>  echo "Some text";
> header( some params );
> exit;
> ?>
>
> Hope this is clear to you now. When a data has been sent already to the
> client, a call to a header will fail. The best thing you must do is to put
> the logic/check part on the first line of the file (See below). In the
> example below, I check first is the a user is valid by calling the the
> function verify_user( params... ) before any other html tags be rendered.
So
> when the user is not valid it will redirect an error page, if it is valid,
> the Welcome to page will be printed.
>
>   session_start();
>  include 'include/config.inc';
>  include 'include/pgsql.inc';
>
>  if (!verify_user($username, $Password, $c_id))
>  {
>   session_register("isValid");
>   $isValid=false;
>   $title = "Web-based Training System Login";
>   $msg = "Access Denied!!!";
>   $link = "../../index.php?id=".$c_id;
>   header("Location:
>
notify2.php?title=".urlencode($title)."&msg=".urlencode($msg)."&link=".urlen
> code($link));
>   exit;
>  }
> ?>
> 
> 
> Welcome to the page.
> 
> 
>
> Hope this help you more.
>
> Until then...
>
> Ryan F. Bayhonan
>
> - Original Message -
> From: "Peter" <[EMAIL PROTECTED]>
> To: "Ryan F. Bayhonan" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Tuesday, February 05, 2002 2:14 PM
> Subject: Re: [PHP] Problem...header already sent by
>
>
> > Hi Ryan,
> >   I tried and took the  tags out and I still get the same
> > messaage.  Why?
> >
> > Thanks,
> > Peter
> >
> >
> > > Hello Peter.
> > >
> > > I discribe my reply below:
> > >
> > > > **
> > > > Warning: Cannot add header information - headers already sent by
> (output
> > > > started at C:\apache\htdocs\proj\sports\phps\verify.php:2) in
> > > > C:\apache\htdocs\proj\sports\phps\verify.php on line 26
> > > > ***
> > >
> > > This warning message appear when the server already send data to the
> > client.
> > >
> > > > 1. 
> > > > 2.  > > > 
> > > >
> > > >
> > > >  23.   if (!$auth) {
> > > >  24.  header("www-Authenticate: Basic realm='Private'");
> > > >  25.  header("HTTP/1.0 401 Unauthrized");
> > > > ...
> > > > ?>
> > > > 
> > >
> > > In the above code, the  tag has been sent to the client
> > browser
> > > already, thus when calling header function it would cause a warning
> > telling
> > > you that data has been rendered already.
> > >
> > > Hope this help.
> > >
> > > Ryan
> > >
> > >
> >
> > --
> > 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] Syntax high lighting

2002-02-04 Thread Jason Rennie

Hi all,

A few months ago I saw a php class (?) for doing syntax high lighting of
various programming languages. But I lost the link in a compter crash and
now I cant find it again.

does anybody know of a php script to do this sort of code highlighting
similar to the show_source() function for php, but for c++,c,perl etc etc
?

Jason

-- 
Hofstadter's Law : "It always takes longer than you expect, even when you
take Hofstadter's Law into account."


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




RE: [PHP] Problem...header already sent by

2002-02-04 Thread Peter Brown

If you include ob_start() at the beginning of the code this will turn
output buffering on and hence enable you to send the header() tag at any
line in the code.

Peter

-Original Message-
From: Ryan F. Bayhonan [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, 5 February 2002 5:54 PM
To: Peter; [EMAIL PROTECTED]
Subject: Re: [PHP] Problem...header already sent by


Hello Peter. Good Day.

Omitting  does not solve the problem. I've experience this
problem also before. I found out that the once causing the problem is
when any data that has been sent to the client. I have listed some
example below.

Examples: All of these will cause a warning when header is called.

1. Since the tag  will be interpreted by the client browser first
before the  tags, data has been sent to the client, telling
the client that an html file is being rendered. So when the browser
interprets the header function, a warning will be issued.




2. This will also cause an error. Remember that a call to an echo or
print function will send data (the parameters of the function) to the
client. So when the header is interpreted, a warning will be issued.



Hope this is clear to you now. When a data has been sent already to the
client, a call to a header will fail. The best thing you must do is to
put the logic/check part on the first line of the file (See below). In
the example below, I check first is the a user is valid by calling the
the function verify_user( params... ) before any other html tags be
rendered. So when the user is not valid it will redirect an error page,
if it is valid, the Welcome to page will be printed.




Welcome to the page.



Hope this help you more.

Until then...

Ryan F. Bayhonan

- Original Message -
From: "Peter" <[EMAIL PROTECTED]>
To: "Ryan F. Bayhonan" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Tuesday, February 05, 2002 2:14 PM
Subject: Re: [PHP] Problem...header already sent by


> Hi Ryan,
>   I tried and took the  tags out and I still get the same

> messaage.  Why?
>
> Thanks,
> Peter
>
>
> > Hello Peter.
> >
> > I discribe my reply below:
> >
> > > **
> > > Warning: Cannot add header information - headers already sent by
(output
> > > started at C:\apache\htdocs\proj\sports\phps\verify.php:2) in 
> > > C:\apache\htdocs\proj\sports\phps\verify.php on line 26
> > > ***
> >
> > This warning message appear when the server already send data to the
> client.
> >
> > > 1. 
> > > 2.  > > 
> > >
> > >
> > >  23.   if (!$auth) {
> > >  24.  header("www-Authenticate: Basic realm='Private'");
> > >  25.  header("HTTP/1.0 401 Unauthrized");
> > > ...
> > > ?>
> > > 
> >
> > In the above code, the  tag has been sent to the client
> browser
> > already, thus when calling header function it would cause a warning
> telling
> > you that data has been rendered already.
> >
> > Hope this help.
> >
> > Ryan
> >
> >
>
> --
> 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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Problem...header already sent by

2002-02-04 Thread Ryan F. Bayhonan

Hello Peter. Good Day.

Omitting  does not solve the problem. I've experience this
problem also before. I found out that the once causing the problem is when
any data that has been sent to the client. I have listed some example below.

Examples: All of these will cause a warning when header is called.

1. Since the tag  will be interpreted by the client browser first
before the  tags, data has been sent to the client, telling the
client that an html file is being rendered. So when the browser interprets
the header function, a warning will be issued.




2. This will also cause an error. Remember that a call to an echo or print
function will send data (the parameters of the function) to the client. So
when the header is interpreted, a warning will be issued.



Hope this is clear to you now. When a data has been sent already to the
client, a call to a header will fail. The best thing you must do is to put
the logic/check part on the first line of the file (See below). In the
example below, I check first is the a user is valid by calling the the
function verify_user( params... ) before any other html tags be rendered. So
when the user is not valid it will redirect an error page, if it is valid,
the Welcome to page will be printed.




Welcome to the page.



Hope this help you more.

Until then...

Ryan F. Bayhonan

- Original Message -
From: "Peter" <[EMAIL PROTECTED]>
To: "Ryan F. Bayhonan" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, February 05, 2002 2:14 PM
Subject: Re: [PHP] Problem...header already sent by


> Hi Ryan,
>   I tried and took the  tags out and I still get the same
> messaage.  Why?
>
> Thanks,
> Peter
>
>
> > Hello Peter.
> >
> > I discribe my reply below:
> >
> > > **
> > > Warning: Cannot add header information - headers already sent by
(output
> > > started at C:\apache\htdocs\proj\sports\phps\verify.php:2) in
> > > C:\apache\htdocs\proj\sports\phps\verify.php on line 26
> > > ***
> >
> > This warning message appear when the server already send data to the
> client.
> >
> > > 1. 
> > > 2.  > > 
> > >
> > >
> > >  23.   if (!$auth) {
> > >  24.  header("www-Authenticate: Basic realm='Private'");
> > >  25.  header("HTTP/1.0 401 Unauthrized");
> > > ...
> > > ?>
> > > 
> >
> > In the above code, the  tag has been sent to the client
> browser
> > already, thus when calling header function it would cause a warning
> telling
> > you that data has been rendered already.
> >
> > Hope this help.
> >
> > Ryan
> >
> >
>
> --
> 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




Re: [PHP] Problem...header already sent by

2002-02-04 Thread Peter Ruan

Okay, I deleted the other stuff and just put this code and I get this from
my interpreter?  Is this a setting problem?

Thanks,
Peter



[Mon Feb 04 22:36:30 2002] [error] [client 127.0.0.1] malformed header from
script. Bad header=HTTP/1.0 401 Unauthorized: /apache/php/php.exe

"Niklas lampén" <[EMAIL PROTECTED]> wrote in message
007701c1ae09$1bde80b0$ba93c5c3@Niklas">news:007701c1ae09$1bde80b0$ba93c5c3@Niklas...
> There can't be _anything_ before headers. Even a single space and/or
> linebreak causes an error.
>
>
> Niklas




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




Re: [PHP] Problem...header already sent by

2002-02-04 Thread Peter Ruan

Okay, I deleted the other stuff and just put this code and I get this from
my interpreter?  Is this a setting problem?

Thanks,
Peter

"Niklas lampén" <[EMAIL PROTECTED]> wrote in message
007701c1ae09$1bde80b0$ba93c5c3@Niklas">news:007701c1ae09$1bde80b0$ba93c5c3@Niklas...
> There can't be _anything_ before headers. Even a single space and/or
> linebreak causes an error.
>
>
> Niklas
>
>
> -Original Message-
> From: Peter Ruan [mailto:[EMAIL PROTECTED]]
> Sent: 5. helmikuuta 2002 7:42
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Re: [PHP] Problem...header already sent by
>
>
>
> I tried it w/o the  tag and I get the BAD Header message.
>
> -Peter
>
> >From: Jeff Sheltren <[EMAIL PROTECTED]>
> >To: "Peter Run" <[EMAIL PROTECTED]>,[EMAIL PROTECTED]
> >Subject: Re: [PHP] Problem...header already sent by
> >Date: Mon, 04 Feb 2002 21:30:42 -0800
> >
> >You can't send anything before you send headers...  the "html" tag is
> >messing you up I believe.
> >
> >Jeff
> >
> >At 08:24 PM 2/4/2002 -0800, Peter Run wrote:
> >>Hi,
> >>   I get the warning message (see below), whenever I try anything with
>
> >>authentication/session with PHP.  This is tried under Windows
> (PHPTriad).
> >>I
> >>get the same message with my Linux drive as well.  I appreciate your
> help.
> >>Please reply here and cc: to my personal email [EMAIL PROTECTED]
> >>
> >>Thanks in advance,
> >>-Peter
> >>**
> >>Warning: Cannot add header information - headers already sent by
> >>(output started at C:\apache\htdocs\proj\sports\phps\verify.php:2) in
> >>C:\apache\htdocs\proj\sports\phps\verify.php on line 26
> >>***
> >>
> >>1. 
> >>2.  >> 
> >>
> >>
> >>  23.   if (!$auth) {
> >>  24.  header("www-Authenticate: Basic realm='Private'");
> >>  25.  header("HTTP/1.0 401 Unauthrized");
> >>...
> >>?>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>--
> >>PHP General Mailing List (http://www.php.net/)
> >>To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>
>
>
> _
> Chat with friends online, try MSN Messenger: http://messenger.msn.com
>
>
> --
> 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] whic OS is under?

2002-02-04 Thread Ivo Stoykov

Hi group:

Is there a way to guess which OS the script is running? I couldn't find
anything in the manual about this.

Thank you

Ivo



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




Re: [PHP] Problem...header already sent by

2002-02-04 Thread Peter Run

Okay, I deleted the other stuff and just put this code and I get this from
my interpreter?  Is this a setting problem?

Thanks,
Peter



[Mon Feb 04 22:36:30 2002] [error] [client 127.0.0.1] malformed header from
script. Bad header=HTTP/1.0 401 Unauthorized: /apache/php/php.exe

"Martin Towell" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
you have :
24.  header("www-Authenticate: Basic realm='Private'");
25.  header("HTTP/1.0 401 Unauthrized");

I have (and this works)

  Header ("WWW-authenticate: Basic realm=\"$blah\"");
  Header ("HTTP/1.0 401 Unauthorized");

* "Unauthrized" should be "Unauthorized" - missing "o"


-Original Message-
From: Niklas Lampén [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 05, 2002 4:51 PM
To: Php-General
Subject: RE: [PHP] Problem...header already sent by


There can't be _anything_ before headers. Even a single space and/or
linebreak causes an error.


Niklas


-Original Message-
From: Peter Ruan [mailto:[EMAIL PROTECTED]]
Sent: 5. helmikuuta 2002 7:42
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] Problem...header already sent by



I tried it w/o the  tag and I get the BAD Header message.

-Peter

>From: Jeff Sheltren <[EMAIL PROTECTED]>
>To: "Peter Run" <[EMAIL PROTECTED]>,[EMAIL PROTECTED]
>Subject: Re: [PHP] Problem...header already sent by
>Date: Mon, 04 Feb 2002 21:30:42 -0800
>
>You can't send anything before you send headers...  the "html" tag is
>messing you up I believe.
>
>Jeff
>
>At 08:24 PM 2/4/2002 -0800, Peter Run wrote:
>>Hi,
>>   I get the warning message (see below), whenever I try anything with

>>authentication/session with PHP.  This is tried under Windows
(PHPTriad).
>>I
>>get the same message with my Linux drive as well.  I appreciate your
help.
>>Please reply here and cc: to my personal email [EMAIL PROTECTED]
>>
>>Thanks in advance,
>>-Peter
>>**
>>Warning: Cannot add header information - headers already sent by
>>(output started at C:\apache\htdocs\proj\sports\phps\verify.php:2) in
>>C:\apache\htdocs\proj\sports\phps\verify.php on line 26
>>***
>>
>>1. 
>>2. > 
>>
>>
>>  23.   if (!$auth) {
>>  24.  header("www-Authenticate: Basic realm='Private'");
>>  25.  header("HTTP/1.0 401 Unauthrized");
>>...
>>?>
>>
>>
>>
>>
>>
>>
>>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>
>




_
Chat with friends online, try MSN Messenger: http://messenger.msn.com


--
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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Collecting Meta Tags and Traping Errors

2002-02-04 Thread Analysis and Solutions

Hi Philip:

"Philip J. Newman" wrote:
> 
>  $get_url = "http://www.philipsdomain.com/";;
> $metatags = get_meta_tags($get_url,1);
> echo $metatags['keywords'];
> echo $metatags[description];
> ?>

This code works perfectly for me, on an NT 4 machine using PHP 4.0.7 dev. 
Oh, perfectly, spare the fact that the page at
"http://www.philipsdomain.com/"; has absolutely no contents.

Try "http://www.analysisandsolutions.com/"; instead and see what happens.

Are you running into problems mentioned in the manual of unix v mac?  What
happens if you take out the ",1" in the get_meta_tags() call?

Enjoy,

--Dan

PS:  In the future, pleaes be kind enough to 1) just send emails to the list,
not to me and the list and 2) snip out content from the message you're
responding to.  Thanks.

-- 
PHP scripts that make your job easier
  http://www.analysisandsolutions.com/code/
 SQL Solution  |  Layout Solution  |  Form Solution
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Ave, Brooklyn NY 11232v: 718-854-0335f: 718-854-0409

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




[PHP] Re: PHP Classes and Sessions

2002-02-04 Thread Yasuo Ohgaki

Php-List wrote:
> What is the proper way to transfer class properties through-out my pages...
> 
> let's say i have a ShoppingCart Class and i have methods like
> addToCart(id, qty) and deleteFromCart(id)
> also i have properties like CartItems("id" => array(), "qty"=> array())
> 
> this is what i do...
> 
> //when the user enters my site, i do some...
> -
> if (!session_is_registered("myCart")){
> $myCart = new ShoppingCart();
>  (some other stuffs...)
> session_register("myCart");
> }
> else {
> $myCart = new ShoppingCart();
> }
> 

You are not following session manual page...

You are over writing $myCart with second "new" statement.
You don't need it and your can use $myCart if
ShoppingCart class definition is included before
starting session.

-- 
Yasuo Ohgaki
Please CC me when you reply to news/list messages.
Do not reply only to me :)


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




Re: [PHP] Collecting Meta Tags and Traping Errors

2002-02-04 Thread Philip J. Newman

Warning: get_meta_tags("http://www.philipsdomain.com/";) - No error in
d:\website\myphp\test01.php on line 5

even with the changes i get the error

http://www.philipsdomain.com/";;

$metatags = get_meta_tags($get_url,1);

echo $metatags['keywords'];

echo $metatags[description];

?>


- Original Message -
From: "Analysis and Solutions" <[EMAIL PROTECTED]>
To: "PHP List" <[EMAIL PROTECTED]>
Sent: Tuesday, February 05, 2002 7:03 PM
Subject: Re: [PHP] Collecting Meta Tags and Traping Errors


> Hi Philip:
>
> Several problems...
>
> >  > $get_url = "http://www.philipsdomain.com";;
>
> Put a "/" on the end there.  Without it, you're not really hitting a page,
> but rather a redirect to a page.
>
>
> > $metatags= get_meta_tags($get_url,1);
> >
> > echo "$metatags[Keywords]";
>
> The manual indicates that the key names are converted to lower case, so
you
> need to use "keywords" rather than "Keywords."  Also, since they key name
is
> text, it's best to quote the key name.  So, rewrite the line like this:
>
>echo $metatags['keywords'];
>
>
> > echo "";
> > echo "$metatags[Description]";
>
> Same principles apply here.
>
> Enjoy,
>
> --Dan
>
> --
> PHP scripts that make your job easier
>   http://www.analysisandsolutions.com/code/
>  SQL Solution  |  Layout Solution  |  Form Solution
>  T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
>  4015 7 Ave, Brooklyn NY 11232v: 718-854-0335f: 718-854-0409
>
> --
> 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




RE: [PHP] Accessing Oracle DBMS_OUTPUT from PHP

2002-02-04 Thread Rudolf Visagie

Hi,

I don't think PHP can pick up responses from the DBMS_OUTPUT object; it only
picks up raised errors. Speaking under correction though.

-Original Message-
From: Robert Mena [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 05, 2002 1:29 AM
To: php mailing list
Subject: [PHP] Accessing Oracle DBMS_OUTPUT from PHP


Hi,

I have developed some php scripts to interact to an
oracle db using a set of predefined stored procedures
(which I did not write).

Those procedures are called either by a desktop delphi
application and my php scripts
(linux+apache+mod_php...).

I'd like to know how can I access the contents of
DBMS_OUTPUT so I can echo the custom error messages ?

A fragment of code of the actual procedure

 IF (vmINT_QtdLines <= 0) THEN
  DBMS_OUTPUT.PUT_LINE('NOTHING FOUND UNDER
THIS ID.');
  RAISE MyError;
END IF;

Calling from delphi it shows the custom message, under
php it only shows the ORA .

Any ideas ?


__
Do You Yahoo!?
Great stuff seeking new owners in Yahoo! Auctions! 
http://auctions.yahoo.com

-- 
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




Re: [PHP] Redirect problem.... UGH!!

2002-02-04 Thread Analysis and Solutions

Hi Robert:

> Perhaps you can help, since my posts don't seem to be making it to the
> newsgroup.
>
> I have been trying to use readfile() or header() to load another PHP...

Check the archives: http://groups.google.com/groups?hl=en&group=php.general

Good luck,

--Dan

-- 
PHP scripts that make your job easier
  http://www.analysisandsolutions.com/code/
 SQL Solution  |  Layout Solution  |  Form Solution
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Ave, Brooklyn NY 11232v: 718-854-0335f: 718-854-0409

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




Re: [PHP] Problem...header already sent by

2002-02-04 Thread Peter

Hi Ryan,
  I tried and took the  tags out and I still get the same
messaage.  Why?

Thanks,
Peter


> Hello Peter.
>
> I discribe my reply below:
>
> > **
> > Warning: Cannot add header information - headers already sent by (output
> > started at C:\apache\htdocs\proj\sports\phps\verify.php:2) in
> > C:\apache\htdocs\proj\sports\phps\verify.php on line 26
> > ***
>
> This warning message appear when the server already send data to the
client.
>
> > 1. 
> > 2.  > 
> >
> >
> >  23.   if (!$auth) {
> >  24.  header("www-Authenticate: Basic realm='Private'");
> >  25.  header("HTTP/1.0 401 Unauthrized");
> > ...
> > ?>
> > 
>
> In the above code, the  tag has been sent to the client
browser
> already, thus when calling header function it would cause a warning
telling
> you that data has been rendered already.
>
> Hope this help.
>
> Ryan
>
>

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




Re: [PHP] Collecting Meta Tags and Traping Errors

2002-02-04 Thread Analysis and Solutions

Hi Philip:

Several problems...

>  $get_url = "http://www.philipsdomain.com";;

Put a "/" on the end there.  Without it, you're not really hitting a page,
but rather a redirect to a page.


> $metatags= get_meta_tags($get_url,1);
> 
> echo "$metatags[Keywords]";

The manual indicates that the key names are converted to lower case, so you
need to use "keywords" rather than "Keywords."  Also, since they key name is
text, it's best to quote the key name.  So, rewrite the line like this:

   echo $metatags['keywords'];


> echo "";
> echo "$metatags[Description]";

Same principles apply here.

Enjoy,

--Dan

-- 
PHP scripts that make your job easier
  http://www.analysisandsolutions.com/code/
 SQL Solution  |  Layout Solution  |  Form Solution
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Ave, Brooklyn NY 11232v: 718-854-0335f: 718-854-0409

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




Re: [PHP] Ports

2002-02-04 Thread Evan Nemerson

There are 2^16 ports.

The networkice page just lists the ports that exploitable services run on, 
and would be ineffective for a port scan.

Scanning all 2^16 ports, or even the first 49151, would be incredibly 
inefficient.

Scanning all the IANA ports would be rather inefficient and insufficient. 
What about BO2K, netbus, etc.- applications without ports assigned by IANA.

A quick check of the nmap man page reveals that nmap's "...default is to scan 
all ports between 1 and 1024 as well as any ports listed in the services file 
which comes with nmap." This could be a good idea.

Now, that being said, this might not be the best way to do it. You can't scan 
multiple ports at once without some complicated coding (execute script once 
for each port, output to a text file, parse the text file, etc...) which 
would undoubtedly slow the process down. Also, you can't do a SYN, FIN, or 
Xmas tree, ping, or null scan- every good port scanner needs at least a syn 
scan.

I tried to do this about a year ago until I came to the conclusion that if I 
wanted to write a port scanner, I should help out with Nmap.

This does, however, touch on the three things I would most love to see in 
PHP- functions for libnet, libpcap, and fork(). Modules would be great for 
the first two, but I think fork should be part of the main language.








On Monday 04 February 2002 17:08, you wrote:
> Well, a quick google -
>
>  http://www.google.com/search?hl=en&q=tcp+ports
>
> - gave me:
>
>  http://www.networkice.com/advice/Exploits/Ports/
> and
>  http://www.iana.org/assignments/port-numbers
>
>  This would presumably be the authoritative source; the answer to
> your questions is at the top of this (very long) page.
>
>  -steve
>
> At 04:20 PM 2/4/02 , Liam MacKenzie wrote:
> >Just a quick question...
> >What is the highest port possible?
> >
> >I want to make a PHP port scanner, but need to know the portrange.
> >
> >Thanks
>
> ++
>
> | Steve Edberg  [EMAIL PROTECTED] |
> | Database/Programming/SysAdmin(530)754-9127 |
> | University of California, Davis http://pgfsun.ucdavis.edu/ |
>
> +-- Gort, Klaatu barada nikto! --+


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




RE: [PHP] Problem...header already sent by

2002-02-04 Thread Martin Towell

you have :
24.  header("www-Authenticate: Basic realm='Private'");
25.  header("HTTP/1.0 401 Unauthrized");

I have (and this works)

  Header ("WWW-authenticate: Basic realm=\"$blah\"");
  Header ("HTTP/1.0 401 Unauthorized");

* "Unauthrized" should be "Unauthorized" - missing "o"


-Original Message-
From: Niklas Lampén [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 05, 2002 4:51 PM
To: Php-General
Subject: RE: [PHP] Problem...header already sent by


There can't be _anything_ before headers. Even a single space and/or
linebreak causes an error.


Niklas


-Original Message-
From: Peter Ruan [mailto:[EMAIL PROTECTED]] 
Sent: 5. helmikuuta 2002 7:42
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] Problem...header already sent by



I tried it w/o the  tag and I get the BAD Header message.

-Peter

>From: Jeff Sheltren <[EMAIL PROTECTED]>
>To: "Peter Run" <[EMAIL PROTECTED]>,[EMAIL PROTECTED]
>Subject: Re: [PHP] Problem...header already sent by
>Date: Mon, 04 Feb 2002 21:30:42 -0800
>
>You can't send anything before you send headers...  the "html" tag is 
>messing you up I believe.
>
>Jeff
>
>At 08:24 PM 2/4/2002 -0800, Peter Run wrote:
>>Hi,
>>   I get the warning message (see below), whenever I try anything with

>>authentication/session with PHP.  This is tried under Windows
(PHPTriad).
>>I
>>get the same message with my Linux drive as well.  I appreciate your
help.
>>Please reply here and cc: to my personal email [EMAIL PROTECTED]
>>
>>Thanks in advance,
>>-Peter
>>**
>>Warning: Cannot add header information - headers already sent by 
>>(output started at C:\apache\htdocs\proj\sports\phps\verify.php:2) in 
>>C:\apache\htdocs\proj\sports\phps\verify.php on line 26
>>***
>>
>>1. 
>>2. > 
>>
>>
>>  23.   if (!$auth) {
>>  24.  header("www-Authenticate: Basic realm='Private'");
>>  25.  header("HTTP/1.0 401 Unauthrized");
>>...
>>?>
>>
>>
>>
>>
>>
>>
>>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>
>




_
Chat with friends online, try MSN Messenger: http://messenger.msn.com


-- 
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



RE: [PHP] Problem...header already sent by

2002-02-04 Thread Niklas Lampén

There can't be _anything_ before headers. Even a single space and/or
linebreak causes an error.


Niklas


-Original Message-
From: Peter Ruan [mailto:[EMAIL PROTECTED]] 
Sent: 5. helmikuuta 2002 7:42
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] Problem...header already sent by



I tried it w/o the  tag and I get the BAD Header message.

-Peter

>From: Jeff Sheltren <[EMAIL PROTECTED]>
>To: "Peter Run" <[EMAIL PROTECTED]>,[EMAIL PROTECTED]
>Subject: Re: [PHP] Problem...header already sent by
>Date: Mon, 04 Feb 2002 21:30:42 -0800
>
>You can't send anything before you send headers...  the "html" tag is 
>messing you up I believe.
>
>Jeff
>
>At 08:24 PM 2/4/2002 -0800, Peter Run wrote:
>>Hi,
>>   I get the warning message (see below), whenever I try anything with

>>authentication/session with PHP.  This is tried under Windows
(PHPTriad).
>>I
>>get the same message with my Linux drive as well.  I appreciate your
help.
>>Please reply here and cc: to my personal email [EMAIL PROTECTED]
>>
>>Thanks in advance,
>>-Peter
>>**
>>Warning: Cannot add header information - headers already sent by 
>>(output started at C:\apache\htdocs\proj\sports\phps\verify.php:2) in 
>>C:\apache\htdocs\proj\sports\phps\verify.php on line 26
>>***
>>
>>1. 
>>2. > 
>>
>>
>>  23.   if (!$auth) {
>>  24.  header("www-Authenticate: Basic realm='Private'");
>>  25.  header("HTTP/1.0 401 Unauthrized");
>>...
>>?>
>>
>>
>>
>>
>>
>>
>>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>
>




_
Chat with friends online, try MSN Messenger: http://messenger.msn.com


-- 
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




Re: [PHP] Problem...header already sent by

2002-02-04 Thread Peter Ruan


I tried it w/o the  tag and I get the BAD Header message.

-Peter

>From: Jeff Sheltren <[EMAIL PROTECTED]>
>To: "Peter Run" <[EMAIL PROTECTED]>,[EMAIL PROTECTED]
>Subject: Re: [PHP] Problem...header already sent by
>Date: Mon, 04 Feb 2002 21:30:42 -0800
>
>You can't send anything before you send headers...  the "html" tag is
>messing you up I believe.
>
>Jeff
>
>At 08:24 PM 2/4/2002 -0800, Peter Run wrote:
>>Hi,
>>   I get the warning message (see below), whenever I try anything with
>>authentication/session with PHP.  This is tried under Windows (PHPTriad).  
>>I
>>get the same message with my Linux drive as well.  I appreciate your help.
>>Please reply here and cc: to my personal email [EMAIL PROTECTED]
>>
>>Thanks in advance,
>>-Peter
>>**
>>Warning: Cannot add header information - headers already sent by (output
>>started at C:\apache\htdocs\proj\sports\phps\verify.php:2) in
>>C:\apache\htdocs\proj\sports\phps\verify.php on line 26
>>***
>>
>>1. 
>>2. > 
>>
>>
>>  23.   if (!$auth) {
>>  24.  header("www-Authenticate: Basic realm='Private'");
>>  25.  header("HTTP/1.0 401 Unauthrized");
>>...
>>?>
>>
>>
>>
>>
>>
>>
>>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>
>




_
Chat with friends online, try MSN Messenger: http://messenger.msn.com


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




RE: [PHP] PHP Classes and Sessions

2002-02-04 Thread Martin Towell

i believe you're meant to serialise objects and then register the serialised
version?? Don't quote me on that, never used sessions, but I didn't
read/hear it somewhere

Martin


-Original Message-
From: PHP-List [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 05, 2002 4:30 PM
To: [EMAIL PROTECTED]
Subject: [PHP] PHP Classes and Sessions


What is the proper way to transfer class properties through-out my pages...

let's say i have a ShoppingCart Class and i have methods like
addToCart(id, qty) and deleteFromCart(id)
also i have properties like CartItems("id" => array(), "qty"=> array())

this is what i do...

//when the user enters my site, i do some...
-
if (!session_is_registered("myCart")){
$myCart = new ShoppingCart();
 (some other stuffs...)
session_register("myCart");
}
else {
$myCart = new ShoppingCart();
}

--
if the object in the session is not present
i would create an instance and then register 
it to the session.
else if it is present, i would just reconstruct it...
because if i don't, even though it is in the 
sessions, the properties and methods are 
not constructed (no handler, i don't know how 
to call it).

my code works, but is there any other way
to do this, because i think it's kinda slow 

another question, is it ok to have a database-driven
shopping cart? i make use of the database to as the 
actual cart holder?


i need your opinions on these


thanks!



Brian Feliciano





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



Re: [PHP] Problem...header already sent by

2002-02-04 Thread Ryan F. Bayhonan

Hello Peter.

I discribe my reply below:

> **
> Warning: Cannot add header information - headers already sent by (output
> started at C:\apache\htdocs\proj\sports\phps\verify.php:2) in
> C:\apache\htdocs\proj\sports\phps\verify.php on line 26
> ***

This warning message appear when the server already send data to the client.

> 1. 
> 2.  
>
>
>  23.   if (!$auth) {
>  24.  header("www-Authenticate: Basic realm='Private'");
>  25.  header("HTTP/1.0 401 Unauthrized");
> ...
> ?>
> 

In the above code, the  tag has been sent to the client browser
already, thus when calling header function it would cause a warning telling
you that data has been rendered already.

Hope this help.

Ryan


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




Re: [PHP] Problem...header already sent by

2002-02-04 Thread Jeff Sheltren

You can't send anything before you send headers...  the "html" tag is 
messing you up I believe.

Jeff

At 08:24 PM 2/4/2002 -0800, Peter Run wrote:
>Hi,
>   I get the warning message (see below), whenever I try anything with
>authentication/session with PHP.  This is tried under Windows (PHPTriad).  I
>get the same message with my Linux drive as well.  I appreciate your help.
>Please reply here and cc: to my personal email [EMAIL PROTECTED]
>
>Thanks in advance,
>-Peter
>**
>Warning: Cannot add header information - headers already sent by (output
>started at C:\apache\htdocs\proj\sports\phps\verify.php:2) in
>C:\apache\htdocs\proj\sports\phps\verify.php on line 26
>***
>
>1. 
>2.  
>
>
>  23.   if (!$auth) {
>  24.  header("www-Authenticate: Basic realm='Private'");
>  25.  header("HTTP/1.0 401 Unauthrized");
>...
>?>
>
>
>
>
>
>
>
>--
>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] PHP Classes and Sessions

2002-02-04 Thread PHP-List

What is the proper way to transfer class properties through-out my pages...

let's say i have a ShoppingCart Class and i have methods like
addToCart(id, qty) and deleteFromCart(id)
also i have properties like CartItems("id" => array(), "qty"=> array())

this is what i do...

//when the user enters my site, i do some...
-
if (!session_is_registered("myCart")){
$myCart = new ShoppingCart();
 (some other stuffs...)
session_register("myCart");
}
else {
$myCart = new ShoppingCart();
}

--
if the object in the session is not present
i would create an instance and then register 
it to the session.
else if it is present, i would just reconstruct it...
because if i don't, even though it is in the 
sessions, the properties and methods are 
not constructed (no handler, i don't know how 
to call it).

my code works, but is there any other way
to do this, because i think it's kinda slow 

another question, is it ok to have a database-driven
shopping cart? i make use of the database to as the 
actual cart holder?


i need your opinions on these


thanks!



Brian Feliciano





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




[PHP] Problem...header already sent by

2002-02-04 Thread Peter Run

Hi,
  I get the warning message (see below), whenever I try anything with
authentication/session with PHP.  This is tried under Windows (PHPTriad).  I
get the same message with my Linux drive as well.  I appreciate your help.
Please reply here and cc: to my personal email [EMAIL PROTECTED]

Thanks in advance,
-Peter
**
Warning: Cannot add header information - headers already sent by (output
started at C:\apache\htdocs\proj\sports\phps\verify.php:2) in
C:\apache\htdocs\proj\sports\phps\verify.php on line 26
***

1. 
2. 







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




Re: [PHP] IP based redirection

2002-02-04 Thread J.F.Kishor

Hi,


This could be done by having a conf file through which you could
get the IP address of the machine from where the request is come. 

ie..



You can include the above conf file in other scripts of yours and you and 
do a check according to your need, and display pages according to the
result of the check. 

Good luck 

cheers 
JFK 
kishor
Nilgiri Networks.

On Sat, 2 Feb 2002, [EMAIL PROTECTED] wrote:

> Could you please help us, to redirect some of our pages to based on IP
> address. We have used SmartRedirect program but it is not working on
> with some of our ISP's IP address. We are located at India, and like
> to have some language specific pages to be displayed to our Indian
> user while english language to other world. Thanks,
> 
> Hemant Kumar
> DInsol.com
> http://www.dinsol.com/
> 




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




Re: [PHP] Can PHP read system installation?

2002-02-04 Thread Tyler Longren

Well, the OSTYPE variable contains some useful info.  As do the LC_ALL,
HOSTTYPE, MACHTYPE, and SERVER_SOFTWARE variables.  Check php_info() for
more useful variables.

Tyler

- Original Message -
From: "Ryan F. Bayhonan" <[EMAIL PROTECTED]>
To: "Tyler Longren" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Monday, February 04, 2002 10:55 PM
Subject: Re: [PHP] Can PHP read system installation?


> What if the pc runs not on linux let say windows, how do i do it?
>
> Thanks.
>
> Ryan
>
> - Original Message -
> From: "Tyler Longren" <[EMAIL PROTECTED]>
> To: "Ryan F. Bayhonan" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Tuesday, February 05, 2002 12:50 PM
> Subject: Re: [PHP] Can PHP read system installation?
>
>
> > Well, if you know the box is running Linux, you can get the kernel info
by
> > doing this:
> > system("uname -a");
> >
> > Tyler
> >
> > - Original Message -
> > From: "Ryan F. Bayhonan" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Monday, February 04, 2002 10:51 PM
> > Subject: [PHP] Can PHP read system installation?
> >
> >
> > > I just would like to know if PHP can sort of identify all the software
> > > installed in a given computer (e.g. OS ).
> > >
> > > If PHP can what particular function to use.
> > >
> > > Thanks.
> > >
> > > Regards,
> > >
> > > Ryan
> > >
> > >
> > > --
> > > 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 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




Re: [PHP] Can PHP read system installation?

2002-02-04 Thread Ryan F. Bayhonan

What if the pc runs not on linux let say windows, how do i do it?

Thanks.

Ryan

- Original Message -
From: "Tyler Longren" <[EMAIL PROTECTED]>
To: "Ryan F. Bayhonan" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, February 05, 2002 12:50 PM
Subject: Re: [PHP] Can PHP read system installation?


> Well, if you know the box is running Linux, you can get the kernel info by
> doing this:
> system("uname -a");
>
> Tyler
>
> - Original Message -
> From: "Ryan F. Bayhonan" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, February 04, 2002 10:51 PM
> Subject: [PHP] Can PHP read system installation?
>
>
> > I just would like to know if PHP can sort of identify all the software
> > installed in a given computer (e.g. OS ).
> >
> > If PHP can what particular function to use.
> >
> > Thanks.
> >
> > Regards,
> >
> > Ryan
> >
> >
> > --
> > 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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Can PHP read system installation?

2002-02-04 Thread Tyler Longren

Well, if you know the box is running Linux, you can get the kernel info by
doing this:
system("uname -a");

Tyler

- Original Message -
From: "Ryan F. Bayhonan" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, February 04, 2002 10:51 PM
Subject: [PHP] Can PHP read system installation?


> I just would like to know if PHP can sort of identify all the software
> installed in a given computer (e.g. OS ).
>
> If PHP can what particular function to use.
>
> Thanks.
>
> Regards,
>
> Ryan
>
>
> --
> 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




Re: [PHP] Limit 15 where "Newest"

2002-02-04 Thread Tyler Longren

$sql="select author, title, chapter from table order by date DESC limit 15";

That's how you'd go about getting the 15 most recent table entries.  The
"next 15" thing will require a bit more though.

Tyler

- Original Message -
From: "WIll" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, February 04, 2002 9:37 PM
Subject: [PHP] Limit 15 where "Newest"


> I am trying to write a limit statement for my database. I want to say
> something like
>
> $sql="select author, title, chapter from database where last_update =
> "Newest" order by date limit 15";
>
> My question is how do you say " Newest" in php MySQL?
> And how do you put t link on the bottom of the page that will select the
> next 15 items in the database?
>
> Thank you.
>
> --WIll
>
> --
> 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] Can PHP read system installation?

2002-02-04 Thread Ryan F. Bayhonan

I just would like to know if PHP can sort of identify all the software
installed in a given computer (e.g. OS ).

If PHP can what particular function to use.

Thanks.

Regards,

Ryan


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




Re: [PHP] Picking a random record from a database.

2002-02-04 Thread Tyler Longren

SELECT * FROM table ORDER BY rand() LIMIT 1;

Tyler
- Original Message - 
From: "Philip J. Newman" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, February 04, 2002 10:37 PM
Subject: [PHP] Picking a random record from a database.


I have a database of Jokes.

I have 30 Jokes

I would like (each time the page is loaded) to have a random Joke appear.

Can anyone help.

Philip J. Newman
Philip's Domain - Internet Project.
http://www.philipsdomain.com/
[EMAIL PROTECTED]



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




[PHP] Limit 15 where "Newest"

2002-02-04 Thread WIll

I am trying to write a limit statement for my database. I want to say 
something like

$sql="select author, title, chapter from database where last_update =
"Newest" order by date limit 15";

My question is how do you say " Newest" in php MySQL?
And how do you put t link on the bottom of the page that will select the
next 15 items in the database?

Thank you.

--WIll

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




[PHP] Picking a random record from a database.

2002-02-04 Thread Philip J. Newman

I have a database of Jokes.

I have 30 Jokes

I would like (each time the page is loaded) to have a random Joke appear.

Can anyone help.

Philip J. Newman
Philip's Domain - Internet Project.
http://www.philipsdomain.com/
[EMAIL PROTECTED]



Re: [PHP] breaking out of two loops

2002-02-04 Thread Daniel Grace

"Lars Torben Wilson" <[EMAIL PROTECTED]> wrote in message
1012867253.2248.185.camel@ali">news:1012867253.2248.185.camel@ali...
> On Mon, 2002-02-04 at 15:54, Erik Price wrote:
> > Short and sweet:
> >
> > If I have an "if" statement inside a "switch" statement, how can I
> > "break" out of both blocks that I am in?  Will one "break" end
> > everything?  Or should I use one for each level deep that I am?
> >
> >
> > Erik
>
> From the manual:
>
>break accepts an optional numeric argument which tells it how
>many nested enclosing structures are to be broken out of
>
> You can find this at http://www.php.net/break (which will take you
> to http://www.php.net/manual/en/control-structures.break.php).
>
>
> Hope this helps,
>
> Torben

That being said, break only breaks out of looping constructs. A break placed
within an if-block will break out of the loop around it. There isn't a
direct way to break out of an if-block alone (if that's your intent), though
this will work:

do {
if(condition) {
...
...
...
break;
}
} while(0);

-- Daniel Grace



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




Re: [PHP] Reading log files.

2002-02-04 Thread Lars Torben Wilson

On Mon, 2002-02-04 at 19:22, Jared wrote:
> I am creating a script that reads "Radius" log files and prints them to
> the browser.  I want the User to be able to specify the Number of lines
> they want to see beginning at the end of the file and going up instead
> of reading the lines at the beginning (Which I can do). 
> Does anyone have an idea on how to do this?
> 
> Thanks in Advanced  Jared

I came up with two little routines for this sort of thing. The one using
arrays is faster on small files; the one using fseek() is much, much 
faster on big files. Take your pick:




Hope this helps,

Torben


-- 
 Torben Wilson <[EMAIL PROTECTED]>
 http://www.thebuttlesschaps.com
 http://www.hybrid17.com
 http://www.inflatableeye.com
 +1.604.709.0506


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




[PHP] Collecting Meta Tags and Traping Errors

2002-02-04 Thread Philip J. Newman

I'm trying to get the meta tags.

http://www.philipsdomain.com";;

$metatags= get_meta_tags($get_url,1);

echo "$metatags[Keywords]";
echo "";
echo "$metatags[Description]";

?>


This is the error I get

Warning: get_meta_tags("http://www.philipsdomain.com";) - No error in
d:\website\myphp\test1.php on line 4

Most sites that have meta tags that I have tried the meta tags do not come
up.  Is there a way to trap these errors? and give common out put?

Philip J. Newman
Philip's Domain - Internet Project.
http://www.philipsdomain.com/
[EMAIL PROTECTED]
Phone: +64 25 6144012




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




Re: [PHP] Templating

2002-02-04 Thread Lars Torben Wilson

On Mon, 2002-02-04 at 18:20, Trent Gillespie wrote:
> I have a template file that I would like to add the content to no write over it. I 
>want the string $content to be added to my template instead of writing over it. Here 
>is my current script
> 
> $tutorial = "template.php";
> 
> 
> $fp = fopen("$tutorial","w");
> fputs($fp, $content, strlen($content));
> 
> 
> If you need any other info please just ask. And if you dont get my question aske 
>again.

Use 'a' instead of 'w' as the file open mode in your fopen() call:

  $fp = fopen($tutorial, 'a');

This is documented on the fopen() page in the manual, btw:

  http://www.php.net/fopen


Hope this helps,

Torben

-- 
 Torben Wilson <[EMAIL PROTECTED]>
 http://www.thebuttlesschaps.com
 http://www.hybrid17.com
 http://www.inflatableeye.com
 +1.604.709.0506


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




Re: [PHP] Reading log files.

2002-02-04 Thread Jeff Sheltren

Well, the first thing that comes to mind would be using the UNIX tail 
command.  Of course, this does you no good if you're on windows, but I'm 
not sure if that is the case.

if $n is the number of lines specified by the user, then the code would be 
like:

System("tail -$n logfile");

Jeff

At 12:22 AM 2/5/2002 -0300, Jared wrote:
>I am creating a script that reads "Radius" log files and prints them to
>the browser.  I want the User to be able to specify the Number of lines
>they want to see beginning at the end of the file and going up instead
>of reading the lines at the beginning (Which I can do).
>Does anyone have an idea on how to do this?
>
>Thanks in Advanced  Jared



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




Re: [PHP] Grabing Meta Tag information.

2002-02-04 Thread Lars Torben Wilson

On Mon, 2002-02-04 at 19:21, Philip J. Newman wrote:
> Is someone able to point me into the right direction.
> 
> I have a disire to make a database of hyperlinks.  At the moment the process is, 
>some what slow, as I have to input all the data by hand.  I would like some way that 
>I can just put the URL in and it fetches the META TAG information.
> 
> If you can help (o;
 
Something like this? ;) Works with fopen wrappers, too.

  http://www.php.net/manual/en/function.get-meta-tags.php

Quick test:

http://www.thebuttlesschaps.com');
print_r($foo);
?>


Hope this helps,

Torben

> Philip J. Newman
> Philip's Domain - Internet Project.
> http://www.philipsdomain.com/
> [EMAIL PROTECTED]
> Phone: +64 25 6144012
-- 
 Torben Wilson <[EMAIL PROTECTED]>
 http://www.thebuttlesschaps.com
 http://www.hybrid17.com
 http://www.inflatableeye.com
 +1.604.709.0506


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




[PHP] Reading log files.

2002-02-04 Thread Jared

I am creating a script that reads "Radius" log files and prints them to
the browser.  I want the User to be able to specify the Number of lines
they want to see beginning at the end of the file and going up instead
of reading the lines at the beginning (Which I can do). 
Does anyone have an idea on how to do this?

Thanks in Advanced  Jared


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




[PHP] Grabing Meta Tag information.

2002-02-04 Thread Philip J. Newman

Is someone able to point me into the right direction.

I have a disire to make a database of hyperlinks.  At the moment the process is, some 
what slow, as I have to input all the data by hand.  I would like some way that I can 
just put the URL in and it fetches the META TAG information.

If you can help (o;

Philip J. Newman
Philip's Domain - Internet Project.
http://www.philipsdomain.com/
[EMAIL PROTECTED]
Phone: +64 25 6144012



[PHP] Templating

2002-02-04 Thread Trent Gillespie

I have a template file that I would like to add the content to no write over it. I 
want the string $content to be added to my template instead of writing over it. Here 
is my current script

$tutorial = "template.php";


$fp = fopen("$tutorial","w");
fputs($fp, $content, strlen($content));


If you need any other info please just ask. And if you dont get my question aske again.



[PHP] Re: Changes in Sessions (PHP Versions)

2002-02-04 Thread Yasuo Ohgaki

Travis Simpson wrote:
> Hey,
> 
> I am just wondering if there were any changes done to the session
> "engine" or settings between PHP 4.0.6 and 4.1.1.
> 
> I have been getting nothing but grief from 4.0.6 and 4.1.1 seems to work
> fine.
> 


What did work with 4.0.6 and what didn't with 4.1.1?

If you are trying to use mm/msession save handler, it's broken
somewhat.

-- 
Yasuo Ohgaki
Please CC me when you reply to news/list messages.
Do not reply only to me :)


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




[PHP] Re: PHP v4.1.1 WDDX problems

2002-02-04 Thread Yasuo Ohgaki

Adam Cassar wrote:
> Hi All,
> 
> I am attempting to compiler php v4.1.1 as a fast cgi runner with WDDX.
> 
> I get all the way through the compile and it get's stuck at:
> 
> ./.libs/libphp4.a(wddx.o): In function `php_wddx_push_element':
> /usr/local/src/php-4.1.1/ext/wddx/wddx.c:780: undefined reference to
> `xml_utf8_decode'
> ./.libs/libphp4.a(wddx.o): In function `php_wddx_process_data':
> /usr/local/src/php-4.1.1/ext/wddx/wddx.c:911: undefined reference to
> `xml_utf8_decode'
> 
> I take it that it's having some problems linking to the xml module? Any
> ideas?
> 
> 
> 

WDDX requires XML. I suppose you don't have one.

-- 
Yasuo Ohgaki
Please CC me when you reply to news/list messages.
Do not reply only to me :)


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




[PHP] PHP v4.1.1 WDDX problems

2002-02-04 Thread Adam Cassar


Hi All,

I am attempting to compiler php v4.1.1 as a fast cgi runner with WDDX.

I get all the way through the compile and it get's stuck at:

./.libs/libphp4.a(wddx.o): In function `php_wddx_push_element':
/usr/local/src/php-4.1.1/ext/wddx/wddx.c:780: undefined reference to
`xml_utf8_decode'
./.libs/libphp4.a(wddx.o): In function `php_wddx_process_data':
/usr/local/src/php-4.1.1/ext/wddx/wddx.c:911: undefined reference to
`xml_utf8_decode'

I take it that it's having some problems linking to the xml module? Any
ideas?



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




Re: [PHP] Ports

2002-02-04 Thread Steve Edberg

Well, a quick google -

 http://www.google.com/search?hl=en&q=tcp+ports

- gave me:

 http://www.networkice.com/advice/Exploits/Ports/
and
 http://www.iana.org/assignments/port-numbers

 This would presumably be the authoritative source; the answer to 
your questions is at the top of this (very long) page.

 -steve


At 04:20 PM 2/4/02 , Liam MacKenzie wrote:
>Just a quick question...
>What is the highest port possible?
>
>I want to make a PHP port scanner, but need to know the portrange.
>
>Thanks




++
| Steve Edberg  [EMAIL PROTECTED] |
| Database/Programming/SysAdmin(530)754-9127 |
| University of California, Davis http://pgfsun.ucdavis.edu/ |
+-- Gort, Klaatu barada nikto! --+



[PHP] testing for cookies on the server side (again, still can't get my head around it)

2002-02-04 Thread Justin French

Hi all,

Forgive me for re-posting this topic, but I still can't get my head
around the right way to work with sessions/cookies, whilst providing
some sort of server side testing for people without cookies.  I do not
want to do it client side (javascript etc).

I've got a block of code that I can include at the top of any page,
which protects it by:

1   looking for a session
2a  if one doesn't exist, provides a login form
2b  if one does exist, displays the page


Easy enough, untill someone comes in with cookie turned off, and they
get a login page each and every time they get a protected page.  Bad.


If I want to provide access to all users, then I need to pass the
session around in the URL, but if I'm reasonably happy to exclude non
cookie browsers, I'd like to provide an explanation page that tells them
why they can't access the site, etc etc.


So what's the flow of code to test for cookies on the server side?  I'm
pretty sure that the only way is to set a cookie, then test for it.


+ look for the session

   + if session does exist, show the page

   + if session doesn't exist, look for a cookie called 'cookieAvailable'

  + if 'cookieAvailable' doesn't exist, set it, and refresh the
script with ?cookieTest=set (to know i've already set it)

 + if 'cookieAvailable' still doesn't exist, show a "sorry, no
cookies" page

  + if 'cookieAvailable' does exist, show a login form, let them
login and start a session


I guess the expiry date of the cookieAvailable should be only a day
(since it's *possible* that they could turn cookies off), and same with
the session expiry.


Anything I'm missing here?


Thanks in advance,
Justin French

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




Re: [PHP] Sockets

2002-02-04 Thread Mike Frazer

As I said, you're probably better off with fsockopen() anyway.  Remember,
the oure socket functions are experimental (or at least were last time I
checked that part of the manual) and you never really know with experimental
things.  As well, they may change at any time, rendering your scripts
useless on later versions of PHP.

The Network functions, as classified in the manual, are very solid and
widely supported.  If it works the way you want it to with one method, why
recreate your own wheel?

Mike Frazer



"Evan Nemerson" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> That's the first thing I tried- doesn't work with the lower-level sockets.
> (the socket_* functions)
>
> Right now I have an fsockopen version, and I'm commenting out the socket
> version- hopefully I'll be able to get it to work later.
>
> Thanks, but do you have any other ideas???
>
>
> -Evan
>
>
>
>
>
>
> On Monday 04 February 2002 14:53, you wrote:
> > I've found fsockopen to be very reliable.  I've done a few socket
scripts
> > with PHP (WhoisPro, et al).
> >
> > I believe the easiest way to check for a remotely closed socket is to do
an
> > fgets() and check for EOF:
> >
> >while (!feof($connection)) {
> > $buffer .= fgets($connection, 4096);  // 4096 is the chunk size, you
> > can adjust it
> >}
> >
> > I *think* EOF on a socket deonotes a remote socket close but I could be
> > horribly wrong.
> >
> > Mike Frazer
> >
> >
> >
> > "Evan Nemerson" <[EMAIL PROTECTED]> wrote in message
> > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> >
> > > I am aware of cURL, but I want to just use the standard PHP stuff if I
> > > can because I plan on releasing this when I'm done, and want to KISS
for
> > > other people.
> > >
> > > I know people have to compile PHP with sockets, but they will anyways
for
> > > this project- I'm going to need socket_listen and socket_create_listen
> >
> > too.
> >
> > > This is for a proxy server which will work kinda like multiproxy, but
> >
> > should
> >
> > > be more powerful. It will support direct connections or going through
> >
> > another
> >
> > > proxy server. It seperates anonymous from non-anonymous proxy servers,
> >
> > then
> >
> > > sorts them by speed. Data is stored in tab seperated value text files
> > > (I'm even avoiding mySQL!!!)
> > >
> > > I just signed up for a page @ sourceforge. If anyone is interesting in
> > > helping out e-mail me.
> > >
> > > Thanks for the idea, though. I think right now my fall-back is
fsockopen.
> >
> > I
> >
> > > would really love to get sockets working for this...
> > >
> > > On Sunday 03 February 2002 23:32, you wrote:
> > > > A quick note...
> > > >
> > > > If you are not aware of cURL (curl.haxx.se), then you may want to
look
> >
> > into
> >
> > > > it.
> > > >
> > > > If you are, then please disregard this post.
> > > >
> > > > -Jason Garber
> > > >
> > > > At 11:06 PM 2/3/2002 -0800, Evan Nemerson wrote:
> > > > >Anyone know if there is a way yet to see if a socket is still
> > > > > connected
> >
> > to
> >
> > > > > a host? I want to use a socket to send "GET / HTTP/1.0\r\n\r\n"
over
> > > > > a socket, and retrieve everything the server sends. That part
works
> >
> > great,
> >
> > > > > but I can't figure out when the remote host disconnects.
> > > > >
> > > > >I have the CVS version of php.
> > > > >
> > > > >Here is the function so far. The problem is at the end.
> > > > >
> > > > >
> > > > >
> > > > >function getdata ($host, $port, $data)
> > > > >{
> > > > > /* well, the below comment would be true if i could get it
> > > > > working! */
> > > > >
> > > > > /* This function sends $data to $host:$port, then returns
the
> > > > > response
> > > > > * until connection is severed. Great for HTTP, but won't
> >
> > usually
> >
> > > > > work * too well in protocols where data needs to be analyzed, and
> >
> > replied
> >
> > > > > * to appropriatly, such as POP v3 */
> > > > >
> > > > > // Create a socket
> > > > > $so = socket_create (AF_INET, SOCK_STREAM,
> > > > > getprotobyname("TCP")); if ( !$so )
> > > > > {
> > > > > exit("Could not create socket.\n");
> > > > > }
> > > > >
> > > > > // Connect...
> > > > > $ec = socket_connect ($so, $host, $port);
> > > > > if ( $ec < 0 )
> > > > > {
> > > > > exit ("ERROR $ec: ".socket_strerror($ec));
> > > > > }
> > > > >
> > > > > /* Write $data to socket. The manual doesn't say what it
> >
> > returns,
> >
> > > > > but I'll
> > > > > * assume (even though it makes an ass out of you and me)
that
> >
> > it
> >
> > > > > is the same
> > > > > * as socket_connect() because it wouldn't be logical to
> > > > > return
> >
> > a
> >
> > > > >descriptor. */
> > > > > $ec = socket_write ( $so, $data, ( strlen($data) ));
> > > > > if ( $ec < 0 )
> > > > > {
> > > > > exit ("ER

Re: [PHP] OS X cersion coming soon...(was Re: [PHP] Zend Studio)

2002-02-04 Thread Erik Price


On Monday, February 4, 2002, at 07:23  PM, Michael Zornek wrote:

>> http://www.zend.com/store/products/zend-studio.php is pretty 
>> descriptive,
>> and you can try it out for free...
>
> Anyone interested in an OS X version hold tight, their PR people tell 
> me it
> should be out in 30 days or so.

It certainly looks powerful.
But you'd have to pry BBEdit out of my lifeless fingers.


Erik





Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




Re: [PHP] strtotime problem

2002-02-04 Thread DL Neil

Torben,

> > > No offense, but in TFM (which you have of course R), follow the 'Date
> > > Input Formats' link to:
> > >
> > >http://www.gnu.org/manual/tar-1.12/html_chapter/tar_7.html
> > >
> > > You will find this sentence:
> > >
> > >The construct 'month/day/year', popular in the United States, is
> > >accepted.
> > >
> > > In other words, '10/12/2002' should work fine with strtotime(). The
> > > problem is elsewhere.
> >
> >
> > =One thing for sure, I'm not going to get into an argument with the guy who may 
>well have written that very
part
> > of the manual !
>
> Well, I didn't write that bit--and being an author doesn't necessarily
> make me any more likely to be correct--just more publicly wrong when I
> screw up. :)

=ah the joys of leadership, and the "loneliness of command"!

=I have a healthy respect for the PHP manual - and thus, its authors. It is unusually 
complete (for an open
source product) and very readable.

=I also make extensive use of the PHP-ER.

> > =The -1 is the key indicator.
>
> Yeah, I forgot to mention to Toni why $date3 was so weird--feeding a
> string instead of a timestamp to date().
>
> > =Rather than majoring on the manual, I was working on Toni's email address (which 
>told me very little) and
the
> > fact that she is on the US Pacific Coast. In other words, her server time zone 
>(which affects the way data
> > functions work) is likely subject to Summer Time discontinuities. This combined 
>with the date being
converted
> > back and forth with datetime formats, crosses the from one day to the other.
>
> Yeah, that's what I figured too (being in Vancouver, I run into this
> problem every so often).


=and I've just realised that I wrote "US Pacific Coast" which will attract comments 
from Canucks like a
lightning rod - excuse: I'm 'talking' with a colleague in San Diego... (he's having 
his chocolate biscuit and
coffee for afternoon break - and I'm having something similar for a bedtime snack - 
here, have one yourself)


=We still don't know where Toni and/or her(?) server are actually located. I wait with 
bated breath...


=As someone who works with(in) international organisations and moving around (the 
world) frequently, I pay a lot
of attention to where I am, and what time it is - and have a glowering dislike of 
ignorami who phone me at 0400
(local) having decided that lunchtime their time must be a 'good time' or who 
miscalculated thinking that it was
actually 1600!

=This topic confuses the life out of 'normal' people - and the summer time changes 
producing discontinuities so
that one hour ago, may not in fact have 'happened' one hour previously, is a real 
mind-bender. Guess such people
should be prohibited from flying/sailing across the International Date Line!

=A few years ago, I considered working on Y2K projects to have brought me full circle 
(of the clock?) having
spent quite a bit of time early in my career writing time-date subroutines for newly 
acquired machines/operating
systems. Now I find myself back in a similar arena with PHP/MySQL.

=My recommended solution is always to refer everything to a 'constant' time. That is 
to say, not use local
summer time, or in the case of multiple time zones use UTC/Zulu (in PHP the gm* 
functions - as in GMT). I have a
standard 'lecture' on the subject, which has been thrown at various lists, from 
time-to-time. Last time I
reviewed it, I was trying to remember where I had read a really good write-up about 
the 'confusion of time', so
thanks for reminding me about the GNU docs reference (ex-PHP manual, strtotime() ), 
because that's where it is!

=Now if you could find me a similarly logical cure for 'jet lag'...

=Regards,
=dn



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




[PHP] OS X cersion coming soon...(was Re: [PHP] Zend Studio)

2002-02-04 Thread Michael Zornek

Twas 2/4/02 5:49 PM, when "Zeev Suraski" <[EMAIL PROTECTED]> said:

> http://www.zend.com/store/products/zend-studio.php is pretty descriptive,
> and you can try it out for free...

Anyone interested in an OS X version hold tight, their PR people tell me it
should be out in 30 days or so.

Mike


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




[PHP] Re: Installing PHP 4.1.1 on Redhat w/ RPMs

2002-02-04 Thread J Smith


Personally, I'd recommend compiling from source it is at all possible. 
You'll likely get improved performance, and it's nice to know you can set 
things up exactly as you see fit.

Another thing you could try if that seems daunting or you need to install 
the RPMs onto several machines that all have the same set up (serverS, 
right?) would be to grab a source RPM and rebuild it on one machine. 
Basically, a command like this should work:

# rpm --rebuild php-x.x.x.src.rpm

The RPM should unbundle, configure, and compile, install itself, then place 
a fresh RPM in /src/redhat/RPMS/something (depending on your architecture). 
The new RPM will install on any system that has the same setup and 
libraries as the one you just performed the rebuild on.

In some cases, there may be times when you'll need to edit a file or two in 
the RPM to get it to compile. There should be howtos on this at redhat.com. 

J



Darren Gamble wrote:

> Good day,
> 
> This isn't strictly a PHP question, but, I am hoping someone on this list
> has gone through this already and can provide some assistance.
> 
> I'd like to upgrade to PHP 4.1.1 on our Redhat 7.2 servers, and so I've
> downloaded all of the PHP RPMs from Rawhide.  I would really, really like
> to do this with RPMs if at all possible.
> 
> When I go to install, I find out that:
> 
> 
> error: failed dependencies:
> libcrypto.so.3   is needed by php-4.1.1-1
> 
> 
> OK, no problem so far.  I just need to get the new openssl packages.
> 
> But, after downloading them and adding them to the install list, I then
> find that libcrypto.so.2 (which would be replaced by libcrypto.so.3) is
> needed by
> dozens of packages on the system.  I really can't upgrade them all.
> 
> I am just going from openssl-0.9.6b-8 to openssl-0.9.6c-2 .  It appears to
> me that openssl must have changed the API for their library between an
> extremely minor version number (is that even supposed to happen?), which
> is what I think is causing me the problem.
> 
> I'm not quite sure how to proceed.  Has anyone else on the list done this
> yet?
> 
> Thanks to all who reply,
> 


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




[PHP] Ports

2002-02-04 Thread Liam MacKenzie

Just a quick question...
What is the highest port possible?

I want to make a PHP port scanner, but need to know the portrange.

Thanks



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




Re: [PHP] breaking out of two loops

2002-02-04 Thread Lars Torben Wilson

On Mon, 2002-02-04 at 15:54, Erik Price wrote:
> Short and sweet:
> 
> If I have an "if" statement inside a "switch" statement, how can I 
> "break" out of both blocks that I am in?  Will one "break" end 
> everything?  Or should I use one for each level deep that I am?
> 
> 
> Erik

>From the manual:

   break accepts an optional numeric argument which tells it how
   many nested enclosing structures are to be broken out of

You can find this at http://www.php.net/break (which will take you
to http://www.php.net/manual/en/control-structures.break.php).


Hope this helps,

Torben

> 
> 
> Erik Price
> Web Developer Temp
> Media Lab, H.H. Brown
> [EMAIL PROTECTED]

-- 
 Torben Wilson <[EMAIL PROTECTED]>
 http://www.thebuttlesschaps.com
 http://www.hybrid17.com
 http://www.inflatableeye.com
 +1.604.709.0506


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




[PHP] breaking out of two loops

2002-02-04 Thread Erik Price

Short and sweet:

If I have an "if" statement inside a "switch" statement, how can I 
"break" out of both blocks that I am in?  Will one "break" end 
everything?  Or should I use one for each level deep that I am?


Erik







Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




[PHP] Re: Yet another regex question

2002-02-04 Thread liljim

Hello again,

> This is excellent.  If you don't mind digging out your functions, I'd much
> appreciate it...

I'll have a look tomorrow.

> The previous question was for alpha only, no numeric ...names dont have
> numbers, but addresses usually do.

Alright, well:

[a-z] matches a through z
[A-Z] same, upper case
[0-9] yup, zero through 9
[ ] space

Look up the pattern modifiers, and the pattern syntax in the pcre section of
the manual):

if (!preg_match("/[a-zA-Z]+$/", $name)) {
// $name doesn't consist of characters within a-z or A-Z
}


> I'd got kinda mixed up there on the date thing...lol.  I have a javascript
> date picker thingy, but unfotunately it drops leading zeros on the dates
and
> times.  I think, however, your suggestion if pulldowns is much safer, but
> the date will be for MySQL or MS Access.  I think -MM-DD HH:MM:SS, as
> you suggested would be the answer, and I'll try to add the time into the
> $date variable.

Just out of curiosity, what are you using this for?  I mean, you might be
doing more work than you need to be doing.

> The currency is irrelevent here (although will UK£).  I just want the 2
> decimal places money format.  I have STATE above because thats what the
> field is in the databaseOn display it says state/county.

I see - check out number_format(), printf() and sprintf() in the manual -
this might already solve some of what you want, though I can't see why you'd
need two decimal places in a regex check :

$19.95 // one decimal
£19.95 // same
£19.95.1 // what the? :)

Can you elaborate as to why you need 2?


Alright, time for sleep.

Try and give a bit more info as to what you're using these for (and where,
if it's currently being used) your code is failing..

:)

Night

James


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




[PHP] RE: Yet another regex question

2002-02-04 Thread Simon H

Thanks James

This is excellent.  If you don't mind digging out your functions, I'd much
appreciate it...


> Hello, Simon
>
> "Simon H" wrote in message...
> > I'm trying to validate an input form, for database INSERT/UPDATE.  I'm
> > looking for a couple of Techniques and I cant seem to find examples
> > anywhere:
> >
> > 1. Validate Alpha Text with spaces, such as NAME, CITY, STATE, but limit
> the
> > length of each one separately, and remove unwanted characters like
> > '@!"£$%^&*() etc that might mess with the SQL.
>
> Alright, clearup before you insert. That's my first bit of advice.
> Here's a function for you.
>
> function ClearUnwanteds($string) {
> $string = preg_replace("/[^a-zA-Z0-9 ]/", $string);
> $string = trim($string);
> return $string;
> }
>
> This will replace (when invoked, like this: $string =
> ClearUnwanteds($string) ) the characters you don't want, and then trim the
> string.  Then you can do:
>
> if (strlen($string) < /*enter minimum characters*/) {
> // error
> }
>
> > 2. As above but alphanumeric with spaces etc. for say ADDRESS1 ADDRESS2
> > POSTCODE, etc.
>
> Hmm.. isn't that what you wanted for your previous problem?


The previous question was for alpha only, no numeric ...names dont have
numbers, but addresses usually do.

>
> > 3. Validate DATE/TIME input to DD-MM- HH:MM:SS or D-M- H:M:S, or
> any
> > combination, but only allow valid dates and times, or as close to it as
> > possible.
>
> You should pick a format, and stick to it, then form a function around the
> format you've chosen - or look up some classes available for use
> on the net.
> Since you're storing the data in a MySQL database, you may as
> well check the
> date in the format it's stored in your db in the date (-MM-DD) or
> datetime (-MM-DD HH:MM:SS) formats MySQL uses I would go
> for select
> boxes with the day, month and year specified, then use something like
> checkdate() to check the date on these variables, then "merge" them
> (can't think of a better word) to form your date - i.e.
>
> if (CheckDate($month, $day, $year)) {
> // -- if ok, $date = $year . "-" . $month . "-" . $day;
> } else {
> // failure
> }
>
>  I have formed some functions that I've made available (somewhere), if you
> need them I can probably drag them out and give you the urls.

I'd got kinda mixed up there on the date thing...lol.  I have a javascript
date picker thingy, but unfotunately it drops leading zeros on the dates and
times.  I think, however, your suggestion if pulldowns is much safer, but
the date will be for MySQL or MS Access.  I think -MM-DD HH:MM:SS, as
you suggested would be the answer, and I'll try to add the time into the
$date variable.


>
> > 4. Validate MONEY input...numeric with 2 decimal places only.
>
> What currency?  You're using a UK email address, but you've specified
> "STATE" in one of your other regex "wanteds", which is more typical of the
> US address format.


The currency is irrelevent here (although will UK£).  I just want the 2
decimal places money format.  I have STATE above because thats what the
field is in the databaseOn display it says state/county.


>
> > Also, what is the best way to allow some fields to be empty, like
> ADDRESS2,
> > but if they have data, then validate it.
>
> if (!emtpy($field)) {
> // perform validation.
> }
>
> ???
>
> > I've tried several times to do these myself using eregi, but when I test
> it,
> > the validation fails in some way...I'm shooting in the dark
> tho, and don't
> > really understand regex just yet, or probably the majority of
> PHP for that
> > matter.
>
> Well, ok. But that's what you're here for, right? :)

Truethanks!!

>
> > Thankfully I've got an email one... it was easy to find, since
> that's what
> > all examples are geared for.  My application is for updating a DB with
> SQL,
> > and I cant find anything suitable.
>
> Then your'e looking in the wrong places (and more specifically, looking at
> things from the wrong perspective - regex's can be applied to pretty much
> anything (though, there are occassions when using them is overkill))!
>
> > If there is any other advice for data input into DB's regarding
> security,
> > I'd really to hear it.
>
> bvr's advice is good - read up on what he's suggested. :) Oh, and
> there are
> the manual entries (for which I've forgotten the addresses).
>
> Good luck!
>
> ~James
>

Thanks again James!

Simon H


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




[PHP] Accessing Oracle DBMS_OUTPUT from PHP

2002-02-04 Thread Robert Mena

Hi,

I have developed some php scripts to interact to an
oracle db using a set of predefined stored procedures
(which I did not write).

Those procedures are called either by a desktop delphi
application and my php scripts
(linux+apache+mod_php...).

I'd like to know how can I access the contents of
DBMS_OUTPUT so I can echo the custom error messages ?

A fragment of code of the actual procedure

 IF (vmINT_QtdLines <= 0) THEN
  DBMS_OUTPUT.PUT_LINE('NOTHING FOUND UNDER
THIS ID.');
  RAISE MyError;
END IF;

Calling from delphi it shows the custom message, under
php it only shows the ORA .

Any ideas ?


__
Do You Yahoo!?
Great stuff seeking new owners in Yahoo! Auctions! 
http://auctions.yahoo.com

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




Re: [PHP] strtotime problem

2002-02-04 Thread Lars Torben Wilson

On Mon, 2002-02-04 at 15:05, DL Neil wrote:
> Torben,
> > No offense, but in TFM (which you have of course R), follow the 'Date
> > Input Formats' link to:
> >
> >http://www.gnu.org/manual/tar-1.12/html_chapter/tar_7.html
> >
> > You will find this sentence:
> >
> >The construct 'month/day/year', popular in the United States, is
> >accepted.
> >
> > In other words, '10/12/2002' should work fine with strtotime(). The
> > problem is elsewhere.
> 
> 
> =One thing for sure, I'm not going to get into an argument with the guy who may well 
>have written that very part
> of the manual !

Well, I didn't write that bit--and being an author doesn't necessarily 
make me any more likely to be correct--just more publicly wrong when I
screw up. :)
 
> =The -1 is the key indicator.

Yeah, I forgot to mention to Toni why $date3 was so weird--feeding a 
string instead of a timestamp to date().

> =Rather than majoring on the manual, I was working on Toni's email address (which 
>told me very little) and the
> fact that she is on the US Pacific Coast. In other words, her server time zone 
>(which affects the way data
> functions work) is likely subject to Summer Time discontinuities. This combined with 
>the date being converted
> back and forth with datetime formats, crosses the from one day to the other.

Yeah, that's what I figured too (being in Vancouver, I run into this
problem every so often).


Cheers,

Torben
 
> =Regards,
> =dn
> 
-- 
 Torben Wilson <[EMAIL PROTECTED]>
 http://www.thebuttlesschaps.com
 http://www.hybrid17.com
 http://www.inflatableeye.com
 +1.604.709.0506


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




[PHP] Re: problems using an elsif statement on apache php 4.06

2002-02-04 Thread David Robley

In article <[EMAIL PROTECTED]>, 
[EMAIL PROTECTED] says...
> I have two php scripts being included on my website.
> 
> one is a switch statement used for page navigation, and the other is an
> elseif used to display different html code based on the value of a variable
> (different on each page)
> 
> My apache server keeps freezing up and my hosting company tells me that the
> child processes arent dieing off, requiring me to call them everytime I need
> to restart the server.
> 
> What could be causing this? Is theree a better way to display dynamic
> content besides an elsif statemet?

Without seeing your script, my advice would be to check the logic of your 
program flow; it may be that you are getting into an unexpected loop.

-- 
David Robley
Temporary Kiwi!

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




[PHP] Re: HELP! I was just wondering

2002-02-04 Thread David Robley

In article <[EMAIL PROTECTED]>, 
[EMAIL PROTECTED] says...
> I've been playing around with php alot lately and started to scheme ways to
> use it-lol
> 
> so heres what I tried to do:
> 
> first there is a switch statement:
>  switch($page) {
> 
> case "refer": require("some_file.php");
> exit;
> ?>
> On that some_file.php I have an elseif like so:
> 
>  
> if($page  == $refer)
> {
> $title = "Welcome to this website";
> }
> elseif($page == $somethingelse)
> {
> $title = "Something else than the other one";
> }
> else
> {
> $title ="the default";
> }
> 
> Both these are included by:
>  require('switch.php');
> require('elseif.php');
> ?>
> 
> Then on the page where thee are required I require them at the top of the
> page.
> and I have this:
>  echo "$title"; ?>
> The first part of the if statement returns true always.

If you think about it, it has to in the scenario you give.
if $page == 'refer' then include(somefile)

Then in somefile you again test the value of $page - which can _only_ be 
'refer'.

May I suggest you 'benchtest' your logic? Work your way through your code 
and keep track (with pencil and paper, if you like) of the values of your 
key variables at any point in the execution of the script.

And, usage of the exit() function in your Switch may not be exactly what 
you need, either; look at break!

-- 
David Robley
Temporary Kiwi!

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




[PHP] Re: HTTP Error 405 using POST method

2002-02-04 Thread David Robley

In article <[EMAIL PROTECTED]>, 
[EMAIL PROTECTED] says...
> Hi. I'm learning PHP3 on an IIS 4.0 box and I started by trying out this
> simple HTML form. The form lets the user input his/her name, email address,
> and select whether he/she likes oranges or apples and sends the data to a
> .php file that displays what the user input on the HTML form. The form
> method is POST. When I submit the data I type, I receive an HTTP Error 405
> message with the following text:
> 
> HTTP Error 405
> 405 Method Not Allowed
> 
> The method specified in the Request Line is not allowed for the resource
> identified by the request. Please ensure that you have the proper MIME type
> set up for the resource you are requesting.
> 
> Please contact the server's administrator if this problem persists.
> 
> 
> Here is the HTML page with the form I am using:


 
> What am I doing wrong?

Looks like IIS is not configured to accept POST requests; confirm by 
changing to GET and try again. If this is the case you'll need to make 
some changes to IIS configuration; sorry, can't tell you how or where as 
I have never used that software.

-- 
David Robley
Temporary Kiwi!

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




[PHP] Re: Yet another regex question

2002-02-04 Thread liljim

Hello, Simon

"Simon H" wrote in message...
> I'm trying to validate an input form, for database INSERT/UPDATE.  I'm
> looking for a couple of Techniques and I cant seem to find examples
> anywhere:
>
> 1. Validate Alpha Text with spaces, such as NAME, CITY, STATE, but limit
the
> length of each one separately, and remove unwanted characters like
> '@!"£$%^&*() etc that might mess with the SQL.

Alright, clearup before you insert. That's my first bit of advice.
Here's a function for you.

function ClearUnwanteds($string) {
$string = preg_replace("/[^a-zA-Z0-9 ]/", $string);
$string = trim($string);
return $string;
}

This will replace (when invoked, like this: $string =
ClearUnwanteds($string) ) the characters you don't want, and then trim the
string.  Then you can do:

if (strlen($string) < /*enter minimum characters*/) {
// error
}

> 2. As above but alphanumeric with spaces etc. for say ADDRESS1 ADDRESS2
> POSTCODE, etc.

Hmm.. isn't that what you wanted for your previous problem?

> 3. Validate DATE/TIME input to DD-MM- HH:MM:SS or D-M- H:M:S, or
any
> combination, but only allow valid dates and times, or as close to it as
> possible.

You should pick a format, and stick to it, then form a function around the
format you've chosen - or look up some classes available for use on the net.
Since you're storing the data in a MySQL database, you may as well check the
date in the format it's stored in your db in the date (-MM-DD) or
datetime (-MM-DD HH:MM:SS) formats MySQL uses I would go for select
boxes with the day, month and year specified, then use something like
checkdate() to check the date on these variables, then "merge" them
(can't think of a better word) to form your date - i.e.

if (CheckDate($month, $day, $year)) {
// -- if ok, $date = $year . "-" . $month . "-" . $day;
} else {
// failure
}

 I have formed some functions that I've made available (somewhere), if you
need them I can probably drag them out and give you the urls.

> 4. Validate MONEY input...numeric with 2 decimal places only.

What currency?  You're using a UK email address, but you've specified
"STATE" in one of your other regex "wanteds", which is more typical of the
US address format.

> Also, what is the best way to allow some fields to be empty, like
ADDRESS2,
> but if they have data, then validate it.

if (!emtpy($field)) {
// perform validation.
}

???

> I've tried several times to do these myself using eregi, but when I test
it,
> the validation fails in some way...I'm shooting in the dark tho, and don't
> really understand regex just yet, or probably the majority of PHP for that
> matter.

Well, ok. But that's what you're here for, right? :)

> Thankfully I've got an email one... it was easy to find, since that's what
> all examples are geared for.  My application is for updating a DB with
SQL,
> and I cant find anything suitable.

Then your'e looking in the wrong places (and more specifically, looking at
things from the wrong perspective - regex's can be applied to pretty much
anything (though, there are occassions when using them is overkill))!

> If there is any other advice for data input into DB's regarding security,
> I'd really to hear it.

bvr's advice is good - read up on what he's suggested. :) Oh, and there are
the manual entries (for which I've forgotten the addresses).

Good luck!

~James



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




Re: [PHP] strtotime problem

2002-02-04 Thread DL Neil

Torben,

> > toni,
> >
> > > $date1 = "10/12/2002";
> > > $date1 = date("D M j Y", strtotime($date1));
> > > $date2 = date("D M j Y");
> > > $date3 = date("D M j Y", $date1);
> > > print $date1."";
> > > print $date2."";
> > > print $date3."";
> > >
> > > The code above gives me the following output:
> > >
> > > Fri Oct 11 2002
> > > Mon Feb 4 2002
> > > Wed Dec 31 1969
> > >
> > > Is the strtotime() function causing this problem?
> >
> >
> > =yes, in a way. Please RTFM:
> > strtotime -- Parse about any English textual datetime description into a UNIX 
>timestamp
> >
> > The function expects to be given a string containing an English date
> >  format and will try to parse that format into a UNIX timestamp relative
> >  to the timestamp given in now, or the current time
> >  if none is supplied. Upon failure, -1 is returned.
> >
> > =The -1 explains $date3, it also enables you to back-track to an issue with $date1.
> >
> > =If you are in America, what does 10/12 mean?
> > =If you are in Europe, what does 10/12 mean?
> > =Thus, how can strtotime() attempt to determine the meaning of the textual date?
> > (I'll send you the full lecture if you have no idea what I'm talking about)
>
> No offense, but in TFM (which you have of course R), follow the 'Date
> Input Formats' link to:
>
>http://www.gnu.org/manual/tar-1.12/html_chapter/tar_7.html
>
> You will find this sentence:
>
>The construct 'month/day/year', popular in the United States, is
>accepted.
>
> In other words, '10/12/2002' should work fine with strtotime(). The
> problem is elsewhere.


=One thing for sure, I'm not going to get into an argument with the guy who may well 
have written that very part
of the manual !

=The -1 is the key indicator.

=Rather than majoring on the manual, I was working on Toni's email address (which told 
me very little) and the
fact that she is on the US Pacific Coast. In other words, her server time zone (which 
affects the way data
functions work) is likely subject to Summer Time discontinuities. This combined with 
the date being converted
back and forth with datetime formats, crosses the from one day to the other.

=Regards,
=dn


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




Re: [PHP] uksort wisdom

2002-02-04 Thread Lars Torben Wilson

On Mon, 2002-02-04 at 20:52, Sondra Russell wrote:
> Hi Guys!
> 
> I'm looking to get a *deeper understanding* of uksort.  My quandry:
> 
> $array[listing1][name] = "listing 1";
> $array[listing1][premiere] = "";
> $array[listing2][name] = "listing 2";
> $array[listing2][premiere] = "";
> $array[listing3][name] = "listing 3";
> $array[listing3][premiere] = "yes";
> 
> I'd like the result to come out as:
> $array[listing3] //(this is the one with the premiere set to "yes")
> $array[listing1] // (no premiere, but in order)
> $array[listing2] // (again, no premiere, but again in order)
> 
> So far, I've got:
> 
> function cmp= ($a,$b) {
>   global $array;
>   if ($array [$a][premiere] == "yes") {
>   return -1;
>   } else {
>   return ($a < $b) ? -1 : 1;
>   }
> }
> 
> uksort($array_array,cmp);
> 
> But that ends up, strangely with:
> $array[listing3]
> $array[listing2]
> $array[listing1]
> 
> 
> Any wisdom?  Just would like a better idea of the inner workings of uksort.

I would approach this by speaking the problem out to myself:

  For every pair of items (call them $a and $b) I want to compare, 
If $a is the premiere, put it first;
Otherwise, if $b is the premiere, put *it* first;
Otherwise, put whichever one has the lowest name first.

So...you end up with something like this:

function cmp($a, $b) {
global $array;

/* If $a is the premiere, put it first. */
if ($array[$a]['premiere'] === 'yes') {
return -1;
} else if ($array[$b]['premiere'] === 'yes') {
/* Otherwise, if $b is the premiere, put it first. */
return 1;
}
/* Otherwise, just string-compare the names. */
return strcmp($a, $b);
}


However, I would *strongly* suggest quoting your array indices (and,
incidentally, the 'cmp' bit in the uksort() call--not doing so will
eventually bite you. For more information as to why using unquoted
string array indices is a Bad Thing, see:

http://www.php.net/manual/en/language.types.array.php#language.types.array.donts

One last thing--if it would make sense for you to sort on the 'name'
attribute instead of the array index, you can avoid having to mess
around with globals here, by using uasort() instead of uksort(), and
using the following comparison function:


function cmp($a, $b) {
/* If $a is the premiere, put it first. */
if ($a['premiere'] === 'yes') {
return -1;
} else if ($b['premiere'] === 'yes') {
/* Otherwise, if $b is the premiere, put it first. */
return 1;
}
/* Otherwise, just string-compare the names. */
return strcmp($a['name'], $b['name']);
}


...just 'cause globals usually cause heartache in the long run. If not,
no big worries. :)


Hope this helps,


Torben

> Best,
> Sondra

-- 
 Torben Wilson <[EMAIL PROTECTED]>
 http://www.thebuttlesschaps.com
 http://www.hybrid17.com
 http://www.inflatableeye.com
 +1.604.709.0506


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




Re: [PHP] Sockets

2002-02-04 Thread Evan Nemerson

That's the first thing I tried- doesn't work with the lower-level sockets. 
(the socket_* functions)

Right now I have an fsockopen version, and I'm commenting out the socket 
version- hopefully I'll be able to get it to work later.

Thanks, but do you have any other ideas???


-Evan






On Monday 04 February 2002 14:53, you wrote:
> I've found fsockopen to be very reliable.  I've done a few socket scripts
> with PHP (WhoisPro, et al).
>
> I believe the easiest way to check for a remotely closed socket is to do an
> fgets() and check for EOF:
>
>while (!feof($connection)) {
> $buffer .= fgets($connection, 4096);  // 4096 is the chunk size, you
> can adjust it
>}
>
> I *think* EOF on a socket deonotes a remote socket close but I could be
> horribly wrong.
>
> Mike Frazer
>
>
>
> "Evan Nemerson" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> > I am aware of cURL, but I want to just use the standard PHP stuff if I
> > can because I plan on releasing this when I'm done, and want to KISS for
> > other people.
> >
> > I know people have to compile PHP with sockets, but they will anyways for
> > this project- I'm going to need socket_listen and socket_create_listen
>
> too.
>
> > This is for a proxy server which will work kinda like multiproxy, but
>
> should
>
> > be more powerful. It will support direct connections or going through
>
> another
>
> > proxy server. It seperates anonymous from non-anonymous proxy servers,
>
> then
>
> > sorts them by speed. Data is stored in tab seperated value text files
> > (I'm even avoiding mySQL!!!)
> >
> > I just signed up for a page @ sourceforge. If anyone is interesting in
> > helping out e-mail me.
> >
> > Thanks for the idea, though. I think right now my fall-back is fsockopen.
>
> I
>
> > would really love to get sockets working for this...
> >
> > On Sunday 03 February 2002 23:32, you wrote:
> > > A quick note...
> > >
> > > If you are not aware of cURL (curl.haxx.se), then you may want to look
>
> into
>
> > > it.
> > >
> > > If you are, then please disregard this post.
> > >
> > > -Jason Garber
> > >
> > > At 11:06 PM 2/3/2002 -0800, Evan Nemerson wrote:
> > > >Anyone know if there is a way yet to see if a socket is still
> > > > connected
>
> to
>
> > > > a host? I want to use a socket to send "GET / HTTP/1.0\r\n\r\n" over
> > > > a socket, and retrieve everything the server sends. That part works
>
> great,
>
> > > > but I can't figure out when the remote host disconnects.
> > > >
> > > >I have the CVS version of php.
> > > >
> > > >Here is the function so far. The problem is at the end.
> > > >
> > > >
> > > >
> > > >function getdata ($host, $port, $data)
> > > >{
> > > > /* well, the below comment would be true if i could get it
> > > > working! */
> > > >
> > > > /* This function sends $data to $host:$port, then returns the
> > > > response
> > > > * until connection is severed. Great for HTTP, but won't
>
> usually
>
> > > > work * too well in protocols where data needs to be analyzed, and
>
> replied
>
> > > > * to appropriatly, such as POP v3 */
> > > >
> > > > // Create a socket
> > > > $so = socket_create (AF_INET, SOCK_STREAM,
> > > > getprotobyname("TCP")); if ( !$so )
> > > > {
> > > > exit("Could not create socket.\n");
> > > > }
> > > >
> > > > // Connect...
> > > > $ec = socket_connect ($so, $host, $port);
> > > > if ( $ec < 0 )
> > > > {
> > > > exit ("ERROR $ec: ".socket_strerror($ec));
> > > > }
> > > >
> > > > /* Write $data to socket. The manual doesn't say what it
>
> returns,
>
> > > > but I'll
> > > > * assume (even though it makes an ass out of you and me) that
>
> it
>
> > > > is the same
> > > > * as socket_connect() because it wouldn't be logical to
> > > > return
>
> a
>
> > > >descriptor. */
> > > > $ec = socket_write ( $so, $data, ( strlen($data) ));
> > > > if ( $ec < 0 )
> > > > {
> > > > exit ("ERROR $ec: ".socket_strerror($ec));
> > > > }
> > > > else
> > > > {
> > > > /* PROBLEM IS HERE- what do I put instead of while (
>
> $x
>
> > > > == 0 )??? */
> > > > $x = 0;
> > > > while ( $x == 0 )
> > > > {
> > > > $buffer = socket_read ( $so, 1,
>
> PHP_BINARY_READ);
>
> > > > $string .= $buffer;
> > > > }
> > > > }
> > > >
> > > > // And (hopefully) return $string, for your viewing pleasure.
> > > > return $string;
> > > >}
> > > >
> > > >--
> > > >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] Changes in Sessions (PHP Versions)

2002-02-04 Thread Travis Simpson

Hey,

I am just wondering if there were any changes done to the session
"engine" or settings between PHP 4.0.6 and 4.1.1.

I have been getting nothing but grief from 4.0.6 and 4.1.1 seems to work
fine.

Any help would be MUCH appreciated.

Thanks,
-Travis

Oh, if this isn't the right list to post questions like this, please let
me know the correct list. Thanks.


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




Re: [PHP] Zend Studio

2002-02-04 Thread Zeev Suraski

At 06:44 PM 2/4/2002, Alex Shi wrote:
>Hi,
>
>After a long time absent from Zend I came across to it today just for
>any new articles. To my surprise they changed their home page and
>it seems like they are promoting their Zend Studio 2.0. I have no idea
>what it is. Is it like a Visual Studio? Does it support template? If any
>out there has ever used it could you please give some comment.

It's a development platform for PHP, including a powerful development 
environment (the most advanced code completion and debugging engines for 
PHP), server management interface, and a comprehensive collection of help 
files.

http://www.zend.com/store/products/zend-studio.php is pretty descriptive, 
and you can try it out for free...

Zeev


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




Re: [PHP] sockets

2002-02-04 Thread Evan Nemerson

You have two options. You could use cURL, or you could do a post request by 
hand. I reccomend the first, but if you need to do it by hand, you'll need to 
read up on the HTTP/1.1 RFC (2616, if memory serves, but im not 100% on that 
one).

NOTE: With the script i sent you, if you need to send more headers just add 
them onto the $data arg.




On Monday 04 February 2002 07:35, you wrote:
> Hi,
>
> nope, its still not working.. Along with the Host and port, I Have to send
> 3 more fields, Action,Username and Password for authentification and it has
> to be Post for the Servlet does not respond to Get requests..
>
> any more ideas pl???
>
> Thnx...
>
> sands
>
> -Original Message-
> From: Evan Nemerson [mailto:[EMAIL PROTECTED]]
> Sent: segunda-feira, 4 de Fevereiro de 2002 15:25
> To: Sandeep Murphy
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] sockets
>
>
> This should help you. It is the fsockopen version of what I posed about 6
> hours ago.
>
> function getdata ($host, $port, $data)
> {
>   $fp = fsockopen ( $host, $port, $ec, $es, 5.0);
>   if ( !$fp )
>   {
>   exit ("ERROR $ec: $es\n");
>   }
>   fputs ($fp, $data);
>   while ( !feof($fp) )
>   {
>   $buffer = fgets ($fp,128);
>   $string .= $buffer;
>   }
>   fclose ($fp);
>
>   return $string;
> }
>
>
> sends $data to $host:$port and returns the response, until the connection
> is
>
> severed. something like getdata ("www.php.net", 80, "GET /
> HTTP/1.0\r\n\r\n") should work out well for you
>
> On Monday 04 February 2002 07:15, you wrote:
> > Hi,
> >
> > I am trying to access a remote file by opening a socket on port 80 but
>
> keep
>
> > getting refused...
> >
> > The server does listen on port 80 as i can access it via browser...
> >
> > my code reads like this:
> >  > $Destination =
>
> "http://srv157:7001/Palmeira2Application/palmeira2.servlets.communicator.Co
>
> >m municator";
> > $Request = "action=$action&username=$uname&password=$password";
> > $cfgTimeOut = 20;
> >
> > $theURL = parse_url($Destination);
> > $host = $theURL["host"];
> > $path = $theURL["path"];
> > $port = $theURL["port"]; if ($port=="") $port=80;
> > $header = "POST ".$path." HTTP/1.0\r\n";
> > $header .= "Host: ".$host."\r\n";
> > $header .= "Accept: */*\r\n";
> > $header .= "Accept-Language: en\r\n";
> > $header .= "User-Agent: PHP/4.0.6 (Apache/1.3.20)\r\n";
> > $header .= "Content-Type: text/xml\r\n";
> > $header .= "Content-Length: ".strlen($Request)."\r\n";
> > $header .= "Content: \r\n\r\n";
> > $msg = $header. $Request ;
> > $Response = "";
> >
> > echo $port;
> > //echo $host;
> >
> > // open a socket
> > if(!$cfgTimeOut)
> > // without timeout
> > $fp = fsockopen($host,$port);
> > else
> > // with timeout
> > $fp = fsockopen($host,$port, &$errno, &$errstr, $cfgTimeOut);
> >
> >
> > if ($fp) {
> > if (!fputs($fp,$msg,strlen($msg))) { return false; } // S E N D
> >
> > while (!feof($fp)) {$Response .= fgets($fp,32768);}
> >
> > fclose($fp); // R E C E I V E
> >
> > } else
> > {
> > echo "Unable to access (".$Destination.").";
> >
> > echo "Try another";}
> >
> > print "$response\n";
> >
> > print "hello";
> > ?>
> >
> > any suggestions pl??
> >
> > TIa,
> > sands

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




Re: [PHP] strtotime problem

2002-02-04 Thread Lars Torben Wilson

On Tue, 2002-02-05 at 14:11, DL Neil wrote:
> toni,
> 
> > $date1 = "10/12/2002";
> > $date1 = date("D M j Y", strtotime($date1));
> > $date2 = date("D M j Y");
> > $date3 = date("D M j Y", $date1);
> > print $date1."";
> > print $date2."";
> > print $date3."";
> > 
> > The code above gives me the following output:
> > 
> > Fri Oct 11 2002
> > Mon Feb 4 2002
> > Wed Dec 31 1969
> > 
> > Is the strtotime() function causing this problem?
> 
> 
> =yes, in a way. Please RTFM:
> strtotime -- Parse about any English textual datetime description into a UNIX 
>timestamp
>
> The function expects to be given a string containing an English date
>  format and will try to parse that format into a UNIX timestamp relative
>  to the timestamp given in now, or the current time
>  if none is supplied. Upon failure, -1 is returned.
> 
> =The -1 explains $date3, it also enables you to back-track to an issue with $date1. 
> 
> =If you are in America, what does 10/12 mean?
> =If you are in Europe, what does 10/12 mean?
> =Thus, how can strtotime() attempt to determine the meaning of the textual date? 
> (I'll send you the full lecture if you have no idea what I'm talking about)

No offense, but in TFM (which you have of course R), follow the 'Date 
Input Formats' link to:

   http://www.gnu.org/manual/tar-1.12/html_chapter/tar_7.html

You will find this sentence:

   The construct 'month/day/year', popular in the United States, is
   accepted. 

In other words, '10/12/2002' should work fine with strtotime(). The
problem is elsewhere.


Torben

> =Regards,
> =dn
 
-- 
 Torben Wilson <[EMAIL PROTECTED]>
 http://www.thebuttlesschaps.com
 http://www.hybrid17.com
 http://www.inflatableeye.com
 +1.604.709.0506


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




Re: [PHP] general question...

2002-02-04 Thread Erik Price


On Wednesday, January 30, 2002, at 03:32  AM, jas wrote:

> Using php3 is there a way to have a page only be access if the user is
> coming from another page?  I don't quite know how to word what I am 
> thinking
> but for instance...
> Form <-- page that contains a form to submit an email address to a 
> mailing
> list
> Confirm <-- page that confirms the users email address
> Submit <-- page that connects to database and submits users email 
> address
>
> What I want to do is have users not be able to access the submit page 
> unless
> they are refered from the confirm page...  Using php is this possible? 
> And
> if so could someone point out somewhere that has more info so I may 
> begin
> incorporating this into my scripts.
> Thanks in advance...

The best way to do this would be to have a page that calls ITSELF.  And 
certain parts of the page only execute if certain conditions are met, 
i.e. an easy example:
(hint: start reading from the bottom for this one)

switch ($_POST['action']) {
case 'submit':
// take the contents of the previous form and send them
// to the mail function
// print a "message sent" message to the user's screen
// and a link out of this page back to your main site
case 'confirm':
// print the contents of the form from the previous instance
// of this page to the screen, with a "submit" button that
// says "confirm" and another hidden input that says

// take the contents of the form and throw them into a variable
// that will be passed to the next (and final) instance of
// this page
default:
// print the form for the person to email

Contents 
// print a hidden variable in the form

// unless the form is filled out and submitted,
// this is the only thing anyone will ever see
}


See what happens?  There is no way that the user will see the top two 
sections (the 'confirm' and the 'submit' sections) unless they've done 
what's needed in the "default" section.  Unless they break your page 
somehow.

Note that I've used PHP 4.1.0-style variable names, in case you're using 
register_globals=0.  You don't need to use them if you have 
register_globals=1.


Erik





Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




Re: [PHP] strtotime problem

2002-02-04 Thread DL Neil

toni,

> $date1 = "10/12/2002";
> $date1 = date("D M j Y", strtotime($date1));
> $date2 = date("D M j Y");
> $date3 = date("D M j Y", $date1);
> print $date1."";
> print $date2."";
> print $date3."";
> 
> The code above gives me the following output:
> 
> Fri Oct 11 2002
> Mon Feb 4 2002
> Wed Dec 31 1969
> 
> Is the strtotime() function causing this problem?


=yes, in a way. Please RTFM:
strtotime -- Parse about any English textual datetime description into a UNIX timestamp
   
The function expects to be given a string containing an English date
 format and will try to parse that format into a UNIX timestamp relative
 to the timestamp given in now, or the current time
 if none is supplied. Upon failure, -1 is returned.

=The -1 explains $date3, it also enables you to back-track to an issue with $date1. 

=If you are in America, what does 10/12 mean?
=If you are in Europe, what does 10/12 mean?
=Thus, how can strtotime() attempt to determine the meaning of the textual date? 
(I'll send you the full lecture if you have no idea what I'm talking about)

=Regards,
=dn



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




[PHP] Re: PEAR IMAGICK [WAS-> RANT: Why doesn't PHP have built-in support for dynamic]

2002-02-04 Thread Christian Stocker

In <[EMAIL PROTECTED]>, Michael Kimsal wrote:

> Christian Stocker wrote:
> 
> 
>>>see (which is how I labelled it above) and what I'm capable of actually
>>>contributing.
>>>Doing C-code PHP extensions is beyond my capabilities, so I make do
>>>with what others contribute.  Simply because something is opensource
>>>doesn't mean everyone has equal talent to add in actual code.  :( I
>>>thank you for your contribution of this code so far, and should you
>>>continue to work on it in whatever fashion you choose, so much the
>>>better.  It is appreciated, OO or not (it would just be appreciated
>>>more if it was OO.)  :)
>>>
>>>
>> i would it appreciate as well, if it was OO. I was just not capable
>> back then to do it OO, maybe i am the next time I invest more time in
>> it.
>> 
>> christian
>> 
>> 
>> 
> FWIW, I re-evaluated the situation, and I think I was mistaken- it's not
> a PHP exension you're writing, is it?  It's just PHP code, like much of
> PEAR right?  Or is it an actual extension that I'd compile in?

it's an actual extension, which has to be compiled in.

chregu

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




RE: [PHP] Oddity

2002-02-04 Thread Andrew Chase

You can also do

\n";

}

?>

(mysql_fetch_array uses MYSQL_BOTH for the second argument by default, which
returns an array using both numeric and associative keys - that's why you
were getting double results. :))


Per the manual:
-
http://www.php.net/manual/en/function.mysql-fetch-array.php

The optional second argument result_type in mysql_fetch_array() is a
constant and can take the following values: MYSQL_ASSOC, MYSQL_NUM, and
MYSQL_BOTH. This feature was added in PHP 3.0.7. MYSQL_BOTH is the default
for this argument.

By using MYSQL_BOTH, you'll get an array with both associative and number
indices. Using MYSQL_ASSOC, you only get associative indices (as
mysql_fetch_assoc() works), using MYSQL_NUM, you only get number indices (as
mysql_fetch_row() works).
-

HTH,

-Andy



> -Original Message-
> From: Chris Boget [mailto:[EMAIL PROTECTED]]
>
> > $macroDataArray = mysql_fetch_array( $result );
>
> I'm still curious what is going wrong, but I've found a work arround.
> One of the things I love about PHP is that you learn something new
> just about every day.  Instead of fetch_array(), I can use fetch_assoc()
> and it'll do just what I need. :)


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




Re: [PHP] strtotime problem

2002-02-04 Thread Lars Torben Wilson

On Mon, 2002-02-04 at 13:40, toni baker wrote:
> $date1 = "10/12/2002";
> $date1 = date("D M j Y", strtotime($date1));
> $date2 = date("D M j Y");
> $date3 = date("D M j Y", $date1);
> print $date1."";
> print $date2."";
> print $date3."";
> 
> The code above gives me the following output:
> 
> Fri Oct 11 2002
> Mon Feb 4 2002
> Wed Dec 31 1969
> 
> Is the strtotime() function causing this problem?
> Thanks.

What do you get with the following?




Torben


-- 
 Torben Wilson <[EMAIL PROTECTED]>
 http://www.thebuttlesschaps.com
 http://www.hybrid17.com
 http://www.inflatableeye.com
 +1.604.709.0506


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




[PHP] Can anyone jog my memory on HTTP_REFERER & Javascript "location:replace"?

2002-02-04 Thread Scott Fletcher

Hi!

I had found a way around the problem and it work, but when I enabled the
web security features, it messed up.  So, with some debugging and I found
the problem and I'm not sure how to find a way around it.  You see 

I use page1.php to do certain features but the problem is that PHP
execution get done before the file (non-PHP programming) in passthru('...')
get done later.  So, I can't get the result before PHP finish executing.
There, I came up with the Javascript where the non-PHP scripting can spit
out the Javascript code and the Javascript take care of it.  It work so
well.  To my dismay, the PHP pick up the HTTP_REFERER doesn't work because
HTTP_REFERER was all blank when Javascript use "location.replace('');" code.
So, it messed up the webpage.  Is there a way to get the HTTP_REFERER code?
Or a different Javascript code?  I mean there's no way to get the PHP
execution to pause while the non-PHP programming get done first.  Is there?

Thanks,
 Scott



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




Re: [PHP] General question...

2002-02-04 Thread Bogdan Stancescu

You just need to take a look at HTTP_REFERER - just search for it on php.net,
I'm sure you'll find relevant data.

Bogdan

jas wrote:

> Ok I think I know what I need to learn... how can I do a redirect based on
> whether or not a user came from a certain page?  For example... if a user
> comes from a page called confirm.php then it takes them to a page called
> thanks.php and if the user came from a different server or typed the url
> directly then it would redirect the user to the index.php page?
> Thanks in advance...
> Jas
> P.S. A tutorial on this would definately prevent me from posting the same
> question again. =)
>
> --
> 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




Re: [PHP] Re: General question...

2002-02-04 Thread Lars Torben Wilson

On Mon, 2002-02-04 at 13:52, Philip Hallstrom wrote:
> Something along the lines of:
> 
> if( ereg("/confirm.php", $_SERVER['HTTP_REFERER']) )  {
>   Header("Location: thanks.php");
>   exit;
> }else {
>   Header("Location: index.php");
>   exit;
> }
> 
> You might want to do some additional checking as well.. the above would
> match both "/path/to/confirm.php" as well as
> "/path/to/somewhere/else.php?fakeit=/confirm.php")
> 
> I'll leave that sort of stuff up to you :)

One other note: you cannot trust the user agent to even send referrer 
header. They aren't required to, and it's quite easy to spoof (tools
such as wget and curl even include commands specifically so they can
lie about where they came from).

In short, you can never really know. You could, I suppose, make users
log in and track them with a session. Otherwise, while you *can* do
something like what you propose, it'll never be particularly robust
when using $HTTP_REFERER.


Torben

> On Wed, 30 Jan 2002, jas wrote:
> 
> > Ok I think I know what I need to learn... how can I do a redirect based on
> > whether or not a user came from a certain page?  For example... if a user
> > comes from a page called confirm.php then it takes them to a page called
> > thanks.php and if the user came from a different server or typed the url
> > directly then it would redirect the user to the index.php page?
> > Thanks in advance...
> > Jas
> > P.S. A tutorial on this would definately prevent me from posting the same
> > question again. =)
> >
> >
> >
> > --
> > 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
> 
-- 
 Torben Wilson <[EMAIL PROTECTED]>
 http://www.thebuttlesschaps.com
 http://www.hybrid17.com
 http://www.inflatableeye.com
 +1.604.709.0506


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




[PHP] Search

2002-02-04 Thread TV Karthick Kumar

Hi all,

Is there any other way to search all the html pages in a website with a
given keyword and link to those pages, wihout using the udmsearch and
mnogo... if so, please let me know...

Thanks.

TIA,
Karthick



_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


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




[PHP] Apache/PHP get stuck when using form "POST".

2002-02-04 Thread Scott Fletcher

Hi!

I have an interesting problem.  I am wondering if it is related to PHP
or Apache.  So, I need your feedback on this one.  What happen is when I use
the HTML Form "POST" and submitted it.  It worked fine and getting to the
2nd page.  The 2nd page include some PHP script and a modem script..  PHP is
able to executed the script and get result from the modem.  They all work
fine.

All of sudden I get customer complaining about problem with website.
After some feedback from them, I use two seperate web browsers to browse my
company's website.   One for the modem and the other for browsing around.
So, when I did the form "POST" and wait for the modem to fnish the task.  On
the 2nd browser, I was able to browse around but when the 2nd page from the
1st browser was executed.  The 2nd browser, all of a sudden, it stopped
browsing as if the webpage froze.  I kept trying to browser around but with
no luck until the modem from the 1st browser is finish.  It is when I was
again able to browse around on the 2nd browser.

In my opinion, the problem is either related to the C programming for
the modem or Apache that isn't able to dedicated it's resources to the
browsers.  That the problem have nothing to do with PHP itself.  Am I right?

Thanks,
 Scott



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




Re: [PHP] Email Attachment

2002-02-04 Thread Mauricio Sthandier

Thanxs... I couldn't use your script (because of my lack of experiencie
maybe) but you gave me a very good hint about what to look for.
I sent an attachment (with a class located in this URL :
http://renoir.vill.edu/~ylee/mailfile.txt), but that wasn't what my boss was
thinking of.
(Now he tells !)
Anyway, is useful and I repeat my gratitude.

"Frank Hertogs" <[EMAIL PROTECTED]> escribió en el mensaje
000401c1ab7e$4b2e7790$3400a8c0@fritzzz57619dp">news:000401c1ab7e$4b2e7790$3400a8c0@fritzzz57619dp...
> This should do the trick, experiment wit hit;
>
> function mail_attachment($email, $buffer)
>  {
> //subject
> $subject = "Testing pdf attachment.."
> //sender
> $x_sender = "F. Hertogs";
> //extra (optional) headers
> $x_headers = "From: [EMAIL PROTECTED]\n";
> $x_headers .= "PHP mailer\n";
> $x_headers .= "MIME-version: 1.0\n";
> //tell mail program it's multipart/mixed
> $x_headers .= "Content-type: multipart/mixed; ";
> //tell mail program what boundary looks like
> $x_headers .= "boundary=\"Message-Boundary\"\n";
> //encoding
> $x_headers .= "Content-transfer-encoding: 7BIT\n";
> //to prevent error in case email is empty (I only use this for testing
> //normally; use php or javascript to check forms before submitting
> if(!IsSet($email))
>  $email = "[EMAIL PROTECTED]";
> //first boundary
> $body = "--Message-Boundary\n";
> //start text message
> $body .= "Content-type: text/plain; charset=US-ASCII\n";
> $body .= "Content-transfer-encoding: 7BIT\n";
> $body .= "Content-description: Mail message body\n\n";
> //text for message
> $body .= "Dear sir,\n\nHere is the requested file blabla"
> //end text message
> $body .= "\n\n--Message-Boundary\n";
> //start application pdf in this example
> $body .= "Content-type: application/pdf name=\"attach.pdf\"\n";
> $body .= "Content-Transfer-Encoding: base64\n";
> $body .= "Content-disposition: attachment; filename=\"attach.pdf\"\n\n";
> $enc_pdf = chunk_split(base64_encode($buffer));
> $body .= $enc_pdf . "\n"; }
> $body .= "--Message-Boundary--\n";
> //mail actual message
> mail($email, $subject, $body, $x_headers);
> }
>
> I hope this helps you.
>
> Frank.
>
> -Oorspronkelijk bericht-
> Van: Mauricio Sthandier [mailto:[EMAIL PROTECTED]]
> Verzonden: vrijdag 1 februari 2002 20:45
> Aan: [EMAIL PROTECTED]
> Onderwerp: [PHP] Email Attachment
>
> Hello, I'm new in php development... I was wondering how can I attach a
> Word
> (.doc) Document in an email sent with the mail() function (if I can do
> it
> just with it).
>
> I know it has to see with the additional headers of the email, but I
> would
> be grateful If anyone could tell where can i go to for this specific
> information.
>
> I couldn't find it in PHP manual (.pdf version).
>
> Thanxs !
>
>
>
>
> --
> 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]
>
>



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




[PHP] uksort wisdom

2002-02-04 Thread Sondra Russell

Hi Guys!

I'm looking to get a *deeper understanding* of uksort.  My quandry:

$array[listing1][name] = "listing 1";
$array[listing1][premiere] = "";
$array[listing2][name] = "listing 2";
$array[listing2][premiere] = "";
$array[listing3][name] = "listing 3";
$array[listing3][premiere] = "yes";

I'd like the result to come out as:
$array[listing3] //(this is the one with the premiere set to "yes")
$array[listing1] // (no premiere, but in order)
$array[listing2] // (again, no premiere, but again in order)

So far, I've got:

function cmp= ($a,$b) {
global $array;
if ($array [$a][premiere] == "yes") {
return -1;
} else {
return ($a < $b) ? -1 : 1;
}
}

uksort($array_array,cmp);

But that ends up, strangely with:
$array[listing3]
$array[listing2]
$array[listing1]


Any wisdom?  Just would like a better idea of the inner workings of uksort.

Best,
Sondra

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




[PHP] Re: General question...

2002-02-04 Thread Philip Hallstrom

Something along the lines of:

if( ereg("/confirm.php", $_SERVER['HTTP_REFERER']) )  {
Header("Location: thanks.php");
exit;
}else {
Header("Location: index.php");
exit;
}

You might want to do some additional checking as well.. the above would
match both "/path/to/confirm.php" as well as
"/path/to/somewhere/else.php?fakeit=/confirm.php")

I'll leave that sort of stuff up to you :)

On Wed, 30 Jan 2002, jas wrote:

> Ok I think I know what I need to learn... how can I do a redirect based on
> whether or not a user came from a certain page?  For example... if a user
> comes from a page called confirm.php then it takes them to a page called
> thanks.php and if the user came from a different server or typed the url
> directly then it would redirect the user to the index.php page?
> Thanks in advance...
> Jas
> P.S. A tutorial on this would definately prevent me from posting the same
> question again. =)
>
>
>
> --
> 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] General question...

2002-02-04 Thread jas

Ok I think I know what I need to learn... how can I do a redirect based on
whether or not a user came from a certain page?  For example... if a user
comes from a page called confirm.php then it takes them to a page called
thanks.php and if the user came from a different server or typed the url
directly then it would redirect the user to the index.php page?
Thanks in advance...
Jas
P.S. A tutorial on this would definately prevent me from posting the same
question again. =)



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




Re: [PHP] PHP and Apache authorization: how to logout. Help!

2002-02-04 Thread LaserJetter

I read somewhere that if you type an underscore it clears authentication
info. I haven't tried it and it seems obscure but its worth a try!


LJ

"Frederick L. Steinkopf" <[EMAIL PROTECTED]> wrote in message
018201c1ac67$c4d9c6a0$851a88ac@frederis">news:018201c1ac67$c4d9c6a0$851a88ac@frederis...
> While I've never done this before,
>  couldn't you use a session and have session variables tied to the user
name
> and password and then have the logout function kill the session?
>
> - Original Message -
> From: "Rodolfo Gonzalez" <[EMAIL PROTECTED]>
> To: "Matthew Walker" <[EMAIL PROTECTED]>
> Cc: "Aras Kucinskas" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Saturday, February 02, 2002 8:26 PM
> Subject: RE: [PHP] PHP and Apache authorization: how to logout. Help!
>
>
> > On Fri, 1 Feb 2002, Matthew Walker wrote:
> > > Does anyone have the answer for this question? I need it too...
> >
> > As I learnt before, it's not possible without closing the user's
browser.
> >
> > > My site is in directory which is protected with .htaccess file.
> > > I want to develope a logout function, which can reset Apache
> > > authorization.
> >
> >
> > --
> > 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] strtotime problem

2002-02-04 Thread toni baker

$date1 = "10/12/2002";
$date1 = date("D M j Y", strtotime($date1));
$date2 = date("D M j Y");
$date3 = date("D M j Y", $date1);
print $date1."";
print $date2."";
print $date3."";

The code above gives me the following output:

Fri Oct 11 2002
Mon Feb 4 2002
Wed Dec 31 1969

Is the strtotime() function causing this problem?
Thanks.


__
Do You Yahoo!?
Great stuff seeking new owners in Yahoo! Auctions! 
http://auctions.yahoo.com

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




Re: [PHP] date problems

2002-02-04 Thread Edward van Bilderbeek - Bean IT

i think it is the strtotime() function that gives the trouble... why don't
you try mktime() ?



> sounds like it might have something to do with leap year.
>
> Jim Lucas
> - Original Message -
> From: "toni baker" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, February 04, 2002 12:03 PM
> Subject: [PHP] date problems
>
>
> > $date1 = "12/12/2001";
> > $date1 = date("D M j Y", strtotime($date1));
> > print $date1."";
> >
> > When I execute the code above I get the following
> > output:
> >
> > Tue Dec 11 2001 instead Wed Dec !2 2001
> >
> > Why does this happen and how can I get the Dec 12
> > output?  Thanks
> >
> >
> >
> >
> >
> >
> > __
> > Do You Yahoo!?
> > Great stuff seeking new owners in Yahoo! Auctions!
> > http://auctions.yahoo.com
> >
> > --
> > 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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: PEAR IMAGICK [WAS-> RANT: Why doesn't PHP have built-in support for dynamic]

2002-02-04 Thread Michael Kimsal

Christian Stocker wrote:


>>see (which is how I labelled it above) and what I'm capable of actually
>>contributing.
>>Doing C-code PHP extensions is beyond my capabilities, so I make do with
>>what others contribute.  Simply because something is opensource doesn't
>>mean everyone has equal talent to add in actual code.  :(
>>I thank you for your contribution of this code so far, and should you
>>continue to work on it in whatever fashion you choose, so much the
>>better.  It is appreciated, OO or not (it would just be appreciated more
>>if it was OO.)  :)
>>
> 
> i would it appreciate as well, if it was OO. I was just not capable back
> then to do it OO, maybe i am the next time I invest more time in it.
> 
> christian
> 


FWIW, I re-evaluated the situation, and I think I was mistaken- it's not 
a PHP exension you're writing, is it?  It's just PHP code, like much of 
PEAR right?  Or is it an actual extension that I'd compile in?


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




Re: [PHP] date problems

2002-02-04 Thread Jim Lucas [php]

sounds like it might have something to do with leap year.

Jim Lucas
- Original Message - 
From: "toni baker" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, February 04, 2002 12:03 PM
Subject: [PHP] date problems


> $date1 = "12/12/2001";
> $date1 = date("D M j Y", strtotime($date1));
> print $date1."";
> 
> When I execute the code above I get the following
> output:
> 
> Tue Dec 11 2001 instead Wed Dec !2 2001
> 
> Why does this happen and how can I get the Dec 12 
> output?  Thanks
> 
> 
> 
> 
> 
> 
> __
> Do You Yahoo!?
> Great stuff seeking new owners in Yahoo! Auctions! 
> http://auctions.yahoo.com
> 
> -- 
> 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] HELP! I was just wondering

2002-02-04 Thread cyberskydive

I've been playing around with php alot lately and started to scheme ways to
use it-lol

so heres what I tried to do:

first there is a switch statement:

On that some_file.php I have an elseif like so:



Then on the page where thee are required I require them at the top of the
page.
and I have this:
 echo "$title"; ?>
The first part of the if statement returns true always.

My question is why? Arent the variables $page and $refer etc passed over? Am
I going about this all wrong?
It doesnt work if even in the same file as the page and not in includes.

I thought that it didnt matter where we define variables in php, so I tried
to define the $title in the body of an html page but that didnt work
either-lol

using php4

on windows and solaris

is there a way to get this type of variable from any predefined HTTP
variables?

so I tried




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




[PHP] javascript delete

2002-02-04 Thread Mostafa Al-Mallawani

hi, i know this question's been asked before but i can't find the email...how do i do 
the delete link that pops up a message box with the information of the deleted entry 
using php? like the one in phpmyadmin 2.2.3. thanks. :) 



[PHP] problem with mail()/html/outlook

2002-02-04 Thread ryan-php

I'm trying to send an html email via a php script, but I'm running into a 
rather bizarre problem.  I can get it to send the email just fine, but when it 
is read on windows Outlook (macintosh outlook express are unaffected) clients, 
it strips two characters after any '=' signs, so it plays havoc on the html it 
tries to send:


  

becomes:

  http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] general question...

2002-02-04 Thread Tyler Longren

if (eregi("page_user_has_to_come_from",$HTTP_REFERER) != "") {
print "You didn't come from the right page, please go back.";
}
else {
print "Congrats, you came from the right page!";
}

Tyler

- Original Message -
From: "jas" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 30, 2002 2:32 AM
Subject: [PHP] general question...


> Using php3 is there a way to have a page only be access if the user is
> coming from another page?  I don't quite know how to word what I am
thinking
> but for instance...
> Form <-- page that contains a form to submit an email address to a mailing
> list
> Confirm <-- page that confirms the users email address
> Submit <-- page that connects to database and submits users email address
>
> What I want to do is have users not be able to access the submit page
unless
> they are refered from the confirm page...  Using php is this possible? And
> if so could someone point out somewhere that has more info so I may begin
> incorporating this into my scripts.
> Thanks in advance...
> Jas
>
>
>
> --
> 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] Large File Uploads

2002-02-04 Thread Ben Sinclair

I'm having some trouble with a file upload script that runs over SSL. It seems
that the file is kept in memory while being uploaded and then flushed to disk
as a temp file. This is fine, but when you are dealing with large files, you
can run out of memory. Apache (or PHP?) also doesn't seem to recover from large
file uploads very well. After uploading a few large files (30MB to 300MB), the
httpsd process continues to use ~400MB.

If I let it go long enough, with the machine swapping, the script will
eventually come back but it acts like there was no file uploaded.

Does anyone have suggestions? I need for my users to have the ability to upload
large files over a SSL connection using common browsers. I can't make them run
applets or use an insecure method for doing these transfers.

--
Ben Sinclair
[EMAIL PROTECTED]


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




[PHP] general question...

2002-02-04 Thread jas

Using php3 is there a way to have a page only be access if the user is
coming from another page?  I don't quite know how to word what I am thinking
but for instance...
Form <-- page that contains a form to submit an email address to a mailing
list
Confirm <-- page that confirms the users email address
Submit <-- page that connects to database and submits users email address

What I want to do is have users not be able to access the submit page unless
they are refered from the confirm page...  Using php is this possible? And
if so could someone point out somewhere that has more info so I may begin
incorporating this into my scripts.
Thanks in advance...
Jas



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




  1   2   >