[PHP] PhP 4.2.1 (and various)

2002-05-15 Thread Olav Bringedal

Hi! 

I've recently upgraded to 4.2.1, but i have gotten a
lot of problems with it. 

First of all my pbpBB 2.0 forums stopped working
(http://utge.dyndns.org/phpbb2/index.php). When you
try to log in i get an error, malfomed header request?
(im not on the actual machine now :)).

I also have problems with logins to my site
(jaggu.org). 

After messing a lot to get sessions working again, I
have tracked down the consisten problem to the Header
() function. A comment in the manual says  should
be put in front of all function calls before header().
I tried that, to no use. 


So my question is, why has that changed, and what do
we do now to authenticate users and redirect them to
anothe page? And what the hell is this  thingy, i
cant see to find anything on it in the manual, and
search doesnt work for chars like that.

I hope you guys can clarify this for me.

Sincerely

Olav Bringedal
jaggu.org


__
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

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




[PHP] More 4.2.1 (Note to myself:think before pressing send!)

2002-05-15 Thread Olav Bringedal

Sorry about this, but i forgot one thing in my last
post. 

With 4.2.1 (as opposed to 4.2.0), gd2 stopped working.
When i run the server I get could not find
freetype.dll(? Still not on the actual machine) and
then gd2.dll(?) module could not be found. 

phpinfo at http://jaggu.org/info.php

I tried to search both my config files and via google
for freetype.dll, but could not find anything of
slightest enlightenment.

Thanks in advance!

Olav Bringedal
Jaggu.org


=
Raistlin
M041999031

__
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

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




Re: [PHP] PhP 4.2.1 (and various)

2002-05-15 Thread Analysis Solutions

On Wed, May 15, 2002 at 07:34:13AM +0100, Olav Bringedal wrote:
 
 First of all my pbpBB 2.0 forums stopped working

Do they use variables straight up, rather than via the new superglobals such as 
$_POST?  Simple solution, change your php.ini to have register_globals = on.


 (http://utge.dyndns.org/phpbb2/index.php). When you
 try to log in i get an error, malfomed header request?

I guess somewhere, some text is being sent out to the browser before the header()  
functions are being called.  Perhaps due to a different level of error reporting in
your new php.ini setup?


 So my question is, why has that changed, and what do
 we do now to authenticate users and redirect them to
 anothe page? And what the hell is this  thingy, i
 cant see to find anything on it in the manual, and
 search doesnt work for chars like that.

The  represses error messages.  For example:
   mail('', 'subject', 'body');
will produce an error message, that the to address is bad, while
   mail('', 'subject', 'body');
will silently fail.

Rather than doing that, it's better to write your code so that there won't be error
messages in the first place.

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 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 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

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




[PHP] php performance

2002-05-15 Thread Michal Dvoracek

Hello,

what is better syntax (for perfomance option, not code-style)
e.g. html code out of php tags

table
?php
while (...) {
?
tr
td?php echo $something; ?/td
tdtext/td
/tr
?php
}
?
/table

or

?php
$table = 'table';
while (...)
$table .= 'trtd'.$something.'/tdtdtext/td/tr';
$table .= '/table';
?

Thank you.

Regards,
Michal Dvoracek  [EMAIL PROTECTED]


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




[PHP] how to get to POST request from PHP?

2002-05-15 Thread peter tatischev

Help :-)
I am sending a POST request from PHP to another
PHP script through a socket, something like
-
$request = Content-type: text/xml\n;
$request .= blah...blah...blah;
$request .= \n\n--asdlfkjiurwghasf;
// Build the header
$header = POST /post/bot/xml/test.php HTTP 1.1 \r\n;
$header .= Accept: text/*\r\n;
$header .= Accept-Charset: iso-8859-1;\r\n;
$header .= Accept-Encoding: identity\r\n;
$header .= Accept-Language: \r\n;
$header .= User-Agent: Browser/1.1\r\n;
$header .= Connection: keepalive\r\n;
$header .= Host: 127.0.0.1:80\r\n;
$header .= Content-type: text/xml; boundary=asdlfkjiurwghasf;
type=\text/xml\\r\n\r\n;
...
$fp = fsockopen(127.0.0.1, 80, $err1, $err2, 30);
fputs($fp, $header . $request);
---
How can I access the request data in /post/bot/xml/test.php?
Is it possible at all? RAW_POST doesnt't help in this case...
Any suggestions?


Peter Tatischev
Senior Mobile Applications Developer
Sonic Duo http://www.sonicduo.com
Mobile: +7-926-200-1248
Direct: +7-926-200-2248
peter.tatischevatsonicduodotcom


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




Re: [PHP] Newbie challenge to brainiacs

2002-05-15 Thread Josh Edwards

The challenge is to do it without SQL. Which blog do you recommend?


David Jackson [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Jay Blanchard wrote:
 
 The burning issue that begs to be answered is, why reinvent the wheel?
 There is a least a dozen blogs on freshmeat for PHP along...
 Unless your doing it just for kicks, which is OK.

 David


  [snip]
I want to try to find the hour that has the most hits
The day of the week that has the most hits
and the max and ave  no of hits of these.
 
  I haven't given it a whole lot of thought but I'd be tempted to dump the
  whole thing into an appropriately structured sql database and then use
  SELECT's to extract the information you want.  It'll likely end up
  faster and less processor intensive than doing it in php by itself I
  suspect.
  [/snip]
 
  +1
 
  Not only that, but then you will have the ability to create queries for
  other important factors in the logs without having to recode, or create
  code.
 
  Jay



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




[PHP] RE: array_search in 2-d arrays

2002-05-15 Thread Tim Ward

First this is not a 2d array it is a single d array each element of which is
another array.
If you search the array for a value you won't find it as each element is an
array.
$layerDes[1][0] is not an element of $layerDes it is an element of the array
$layerDes[1].

As far as I know there is no built in way to search down this tree. I think
you'll need
To walk the array and check the first element of each e.g.

Foreach($layerDes as $count=$array)
{   if ($array[0] == $searchstring)
{   $key = $count;
break;
}
}

Tim Ward
www.chessish.com http://www.chessish.com 

--
From:  Pushkar Pradhan [SMTP:[EMAIL PROTECTED]]
Sent:  14 May 2002 19:51
To:  [EMAIL PROTECTED]
Subject:  array_search in 2-d arrays

I've a 2 D array and would like to search for vals. in the first
dimension
only i.e.
myArray[0][0]
myArray[1][0]
myArray[2][0]
myArray[3][0]
.
.
.
and not in the elements myArray[0][1]

CODE:
for($l = 0; $l  count($layer); $l++) {
   $key = array_search($layer[$l], $layerDes);   // $layerDes is 2-D
   $layer[$l] = $layerNames[$key];
}
My $key is undefined after execution, is it because the elements are
in
$layerDes[i][0]?
Using $key === also didn't help? Any ideas, thanks.

-Pushkar S. Pradhan



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




[PHP] Session destroy/close

2002-05-15 Thread Ake

I'm trying to close a session without the logged in surfer clicking log out (through 
a onunLoad javascript function which loads i different php document with the otherwise 
working php code for destryoing a session). I have a working Log out link which 
destroys the session and the variables in it but if the surfer doesn't click on it the 
session variables are still there and they can go back through their browser history 
and continue their session as logged in!

So, how to destroy a session wihtout beeing able to control where the surfer clicks? 
I´ve gone through the documents and FAQ's without understanding any solution so I'd be 
most grateful for any help!

Regards,

Ake Svensson, aspiring database designer (MySQL/PHP/Linux)



Re: [PHP] Cool PHP Tricks/Features ?

2002-05-15 Thread Danny Shepherd

No, that's not a problem either!

snip from manual
Before ob_gzhandler() actually sends compressed data, it determines what
type of content encoding the browser will accept (gzip, deflate or none
at all) and will return it's output accordingly. All browsers are supported
since it's up to the browser to send the correct header saying that it
accepts compressed web pages.
/snip from manual

HTH

Danny.

- Original Message -
From: Sqlcoders.com Programming Dept [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, May 15, 2002 1:25 PM
Subject: Re: [PHP] Cool PHP Tricks/Features ?


 Just remember that not every browser understands gzip compression, but
also
 remember that a probably larger percentage of visitors have ECMAScript
 (JavaScript) switched off.
 You takes your chances, you makes your choice...



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




[PHP] can't upload files

2002-05-15 Thread Diana Castillo


I am using this script: to upload a picture file and I get the error below:
Unable to create 'hgh6.gif': Permission denied in
/home/vhtdocs/archipro/do_upload.php on line 13
Couldn't copy the file!  - What am I doing wrong

form enctype=multipart/form-data method=post action=do_upload.php

pstrongFile to Upload:/strongbr
input type=file name=img1 size=30/p

Pinput type=submit name=submit value=Upload File/p

/form
upload file:
?

// if $img_name isn't empty, try to copy the file
if ($img1_name != ) {

   copy($img1, /images/$img1_name)
  or die(Couldn't copy the file!);

} else {

 // if $img_name was empty, die and let us know why
 die(No input file specified);

}

?

Warning: Unable to create 'hgh6.gif': Permission denied in
/home/vhtdocs/archipro/do_upload.php on line 13
Couldn't copy the file!



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




Re: [PHP] PhP 4.2.1 (and various)

2002-05-15 Thread Vincent Oostindie

On Wed, 15 May 2002 08:52:49 +0200, Analysis  Solutions wrote:
 So my question is, why has that changed, and what do we do now to
 authenticate users and redirect them to anothe page? And what the hell
 is this  thingy, i cant see to find anything on it in the manual,
 and search doesnt work for chars like that.
 
 The  represses error messages.  For example:
mail('', 'subject', 'body');
 will produce an error message, that the to address is bad, while
mail('', 'subject', 'body');
 will silently fail.
 
 Rather than doing that, it's better to write your code so that there
 won't be error messages in the first place.

Not only that: if you are running a production server, you will probably
want to log your error messages to a file (or syslog, or whatever),
instead of printing them. So 'display_errors' should be off. If that is
the case, you don't need to use  anymore, because there will be no HTML
output even in case of problems. The advantage of this is that you can
use the exact same code on a development server (with display_errors =
on) and a production server.

Vincent

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




[PHP] counting max word length fails on line brake

2002-05-15 Thread andy

Hi there,

I would like to check user input for to long words. Therefore I did code a
function returning a string seperated by dash if it is more than $maxlength.
If it is 2 times maxlength it returns false.

Works good execept on line brakes. So if the input is:

test
ölakjdfölakjdöfkjaödlfkjöaksdjföl

it asumes thtat the word is: test ölakjdfölakjdöfkjaödlfkjöaksdjföl

Does anybody know why this happens?

Thanx for any help,

andy

function max_word_length($string, $maxlength){
 $word = explode( ,$string);
 for($x=0;$xcount($word);$x++){
   if (strlen($word[$x])  2 * $maxlength)
return false;

   if (strlen($word[$x])  $maxlength){
   echo strlen($word[$x]).' '.$word[$x].'br';
$word[$x] = substr($word[$x],0, $maxlength).'-'.substr($word[$x],
$maxlength);
   echo strlen($word[$x]).' '.$word[$x].'br';
   }
 }
 return implode( , $word);
}



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




[PHP] Newbie - Spot the error

2002-05-15 Thread Josh Edwards

if I have $time = 21  then

$timespread =array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
 if ($time = = 21)
 $timespread[22]=($timespread[22]+1);
 echo $timespread[22] ;

I get 0




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




Re: [PHP] PhP 4.2.1 (and various)

2002-05-15 Thread Olav Bringedal

 --- Vincent Oostindie [EMAIL PROTECTED]
wrote:
 
 Not only that: if you are running a production
 server, you will probably
 want to log your error messages to a file (or
 syslog, or whatever),
 instead of printing them. So 'display_errors' should
 be off. If that is
 the case, you don't need to use @ anymore, because
 there will be no HTML
 output even in case of problems. The advantage of
 this is that you can
 use the exact same code on a development server
 (with display_errors =
 on) and a production server.
 
 Vincent
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

That is all well, but if php 4.2.1 interprets any
output (as errors not only screen errors) as something
that is sent before a header in a redirect, there is
no other way (that i'm aware of) around it. 

Like this:

$user=$Session[user];

if(!$Authorized)
{
header (Location: http://jaggu.org;);
}
this will not work, you have to write:
 
@$user=@$Session[user];

@if(@!$Authorized)
{
header (Location: http://jaggu.org;);
}

To actually get the redirect. 

On http://jaggu.org/info.php, you can see that
display_errors = off

In any case, I think you are onto something. I will
try to narrow down logging, to see if that might be
the problem. 

Thanks for helping!

Olav Bringedal
jaggu.org

__
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

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




Re: [PHP] Newbie - Spot the error

2002-05-15 Thread Olav Bringedal

 --- Josh Edwards [EMAIL PROTECTED] wrote:  if I
have $time = 21  then
 
 $timespread

=array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
  if ($time = = 21)
  $timespread[22]=($timespread[22]+1);
  echo $timespread[22] ;
 
 I get 0


It might be = = which should be ==. If not, try:

 $timespread =array
(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
  if ($time == 21)
{
echo before:.$timespread[22].b ;
$timespread[22]=($timespread[22]+1);
echo after:.$timespread[22].b ;
}
else
{
echo time is not 21 ;
}

Then you can at least establish where things go wrong.




=
Olav Bringedal
jaggu.org

__
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

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




Re: [PHP] DOMXML in 4.2.0 problems

2002-05-15 Thread Danny Shepherd

Well it works just fine for me :)

PHP 4.2.0 / Apache 2.0.36 / FreeBSD 4.5

DOM/XML enabled
libxml Version 2.4.21
HTML Support enabled
XPath Support enabled
XPointer Support enabled

As you can see, I'm using a later version of libxml than you are - maybe
that's the problem.
I am also forced to use the old functions - maybe the new names only apply
in PHP 4.3.0+?

If you need any more info:

http://phpinfo.kyboshed.dyndns.org
http://tests.kyboshed.dyndns.org/domtest.php
http://tests.kyboshed.dyndns.org/domtest-source.php

HTH

Danny.

- Original Message -
From: Thalis A. Kalfigopoulos [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, May 10, 2002 1:05 AM
Subject: [PHP] DOMXML in 4.2.0 problems


 I'm trying to get DOMXML to work with PHP4.2.0. I've compiled
with --with-dom and phpinfo() says it's there:
 DOM/XML enabled
 libxml Version 2.4.18
 HTML Support enabled
 XPath Support enabled
 XPointer Support enabled

 The following program though doesn't seem to work:

 $xmlstring='a valid xml document here';
 $domdoc=xmldoc($xmlstring);
 $root=$doc-document_element(); --- throw error

 I get an error regarding the call to DomDocument-document_element(). Also
I'm forced to use xmldoc() instead of the newer domxml_open_mem() because it
is also not recognized. What am I missing?

 thanks in advance,
 Thalis


 --
 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] Newbie - Spot the error

2002-05-15 Thread Josh Edwards

If I // $time==21 the count goes up by 1 so it's not recognizing the 21.

Any ideas


Olav bringedal [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 --- Josh Edwards [EMAIL PROTECTED] wrote:  if I
 have $time = 21  then
 
  $timespread
 
 =array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
   if ($time = = 21)
   $timespread[22]=($timespread[22]+1);
   echo $timespread[22] ;
 
  I get 0
 

 It might be = = which should be ==. If not, try:

  $timespread =array
 (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
   if ($time == 21)
 {
 echo before:.$timespread[22].b ;
 $timespread[22]=($timespread[22]+1);
 echo after:.$timespread[22].b ;
 }
 else
 {
 echo time is not 21 ;
 }

 Then you can at least establish where things go wrong.




 =
 Olav Bringedal
 jaggu.org

 __
 Do You Yahoo!?
 Everything you'll ever need on one web page
 from News and Sport to Email and Music Charts
 http://uk.my.yahoo.com



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




[PHP] byte order of integers

2002-05-15 Thread John Horton

Hi!
Is there any way of decomposing an integer into it's constituent bytes so
that a new byte order can be created?
tia
JohnH

John Horton
Software Engineer
BITbyBIT International Limited 
[EMAIL PROTECTED]

Tel: + 44 (0) 1865 865400 
Fax: + 44 (0) 1865 865450
www.bitbybit.co.uk 

Disclaimer: 
Internet communications are not secure and BitbyBit does not accept any
legal responsibility for the content of this message.  Any views or opinions
presented are solely those of the author and do not necessarily represent
those of BitbyBit International Limited.  If you have received this email in
error, please reply to the sender or call +44(0)1865 865400 and delete all
copies of this mail.


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




[PHP] HTTPS spoofing and $_SERVER

2002-05-15 Thread George Whiffen

Hi,

I want to know if the user is connected on a secure socket and have two
problems:

1. My  Apache (Stronghold), variables are not turning up in $_SERVER or
$HTTP_SERVER_VARS
although they are in $GLOBALS e.g. I have $GLOBALS[SERVER_PORT] but not
$_SERVER[SERVER_PORT].
This is with track vars and register globals both on.   It seems I have
to rely on the $GLOBALS value and be careful with variables_order.

2. As well as $SERVER_PORT, I also get $HTTPS, but  only if there it is
an HTTPS connect i.e. on a secure connect, $HTTPS == 'on', but on an
insecure connect it is not set.  This makes it easy to spoof even with
variables_order set to ECGPS. I could just use $SERVER_PORT, which is
always set and thus not so easily spoofed but then I have to worry if
the secure port changes.

Any suggestions?

George


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




Re: [PHP] can't upload files

2002-05-15 Thread Jason Wong

On Wednesday 15 May 2002 18:33, Diana Castillo wrote:
 I am using this script: to upload a picture file and I get the error below:
 Unable to create 'hgh6.gif': Permission denied in
 /home/vhtdocs/archipro/do_upload.php on line 13
 Couldn't copy the file!  - What am I doing wrong
 form enctype=multipart/form-data method=post action=do_upload.php

 pstrongFile to Upload:/strongbr
 input type=file name=img1 size=30/p

 Pinput type=submit name=submit value=Upload File/p

 /form
 upload file:
 ?

 // if $img_name isn't empty, try to copy the file
 if ($img1_name != ) {

copy($img1, /images/$img1_name)

You're trying to copy something into the directory /images. Does the 
webserver have permissions to do so?

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
Don't believe everything you hear or anything you say.
*/


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




Re: [PHP] Newbie challenge to brainiacs

2002-05-15 Thread Jason Wong

On Wednesday 15 May 2002 16:20, Josh Edwards wrote:
 The challenge is to do it without SQL. Which blog do you recommend?


 David Jackson [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

  Jay Blanchard wrote:
 
  The burning issue that begs to be answered is, why reinvent the wheel?
  There is a least a dozen blogs on freshmeat for PHP along...
  Unless your doing it just for kicks, which is OK.

Not sure what blogs have to do with this? IIRC the OP was trying to analyse 
webserver log files.

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
Your computer hasn't been returning all the bits it gets from the Internet.
*/


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




Re: [PHP] Session destroy/close

2002-05-15 Thread 1LT John W. Holmes

Look at the session manual page and maybe set a shorter time limit for the
session cookie. If the user isn't going to click on the Logout link, then
there's really nothing you can do until they close the browser (which will
stop the session / delete cookie automatically).

Maybe you can check for a certain period of inactivity and automatically log
them out if they come back after that time.

---John Holmes...

- Original Message -
From: Ake [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, May 15, 2002 5:11 AM
Subject: [PHP] Session destroy/close


I'm trying to close a session without the logged in surfer clicking log
out (through a onunLoad javascript function which loads i different php
document with the otherwise working php code for destryoing a session). I
have a working Log out link which destroys the session and the variables
in it but if the surfer doesn't click on it the session variables are still
there and they can go back through their browser history and continue their
session as logged in!

So, how to destroy a session wihtout beeing able to control where the surfer
clicks? I´ve gone through the documents and FAQ's without understanding any
solution so I'd be most grateful for any help!

Regards,

Ake Svensson, aspiring database designer (MySQL/PHP/Linux)



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




Re: [PHP] HTTPS spoofing and $_SERVER

2002-05-15 Thread 1LT John W. Holmes

Well, if you fix #1, that will fix #2 because you can use $_SERVER[HTTPS],
which can't be spoofed by the user. What versions of PHP and Apache are you
using, on what OS?

---John Holmes...

- Original Message -
From: George Whiffen [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, May 15, 2002 7:35 AM
Subject: [PHP] HTTPS spoofing and $_SERVER


 Hi,

 I want to know if the user is connected on a secure socket and have two
 problems:

 1. My  Apache (Stronghold), variables are not turning up in $_SERVER or
 $HTTP_SERVER_VARS
 although they are in $GLOBALS e.g. I have $GLOBALS[SERVER_PORT] but not
 $_SERVER[SERVER_PORT].
 This is with track vars and register globals both on.   It seems I have
 to rely on the $GLOBALS value and be careful with variables_order.

 2. As well as $SERVER_PORT, I also get $HTTPS, but  only if there it is
 an HTTPS connect i.e. on a secure connect, $HTTPS == 'on', but on an
 insecure connect it is not set.  This makes it easy to spoof even with
 variables_order set to ECGPS. I could just use $SERVER_PORT, which is
 always set and thus not so easily spoofed but then I have to worry if
 the secure port changes.

 Any suggestions?

 George


 --
 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] Cool PHP Tricks/Features ?

2002-05-15 Thread George Whiffen

Ummm,

This output compression sounded cool to me when I came across it,
but I wasn't sure it really helped or was appropriate for us to use:

1. My biggest concern is the slowest user i.e. at the end of a modem
on the other side of the planet.  I thought they would almost certainly
have modem compression so doing our own compression doesn't
really help them at all i.e. actual download speeds stay the same, it's
just we/they do the work rather than the modems.

2. I was surprised when I got ISDN dial-up that it didn't seem
to have automatic compression on the line, but assumed that was
going to change.  Am I too hopeful?

3. But surely, ASDL, cable, the backbone and decent intranets
must all do hardware compression, don't they?  Or are they
secretly not very keen on decreasing network traffic?

4. Finally, if the network hardware isn't handling compression
for us, I would have thought it was a good job for a web server.
I guess I'd have to ask the Apache guys, but I would guess this
can be really neatly done with some fancy mod_rewrite, custom
extension or whatever.

In summary, I can't agree more that all pages should be compressed,
but  don't feel it should be our job.   Maybe I'm wrong and this is another
case of the poor old application developer having to do all the * work,
just because the rest of the computing industry is too busy counting its
profits to do its own job properly ;).


What's everyone else think?

George


Sqlcoders.Com Programming Dept wrote:

 I've seen real-life examples of 100k pages going down to around 30k,
 considering that decrease in size, when you remember that CPU time is
 relatively cheap compared to bandwidth, it's worth the processing overhead
 in my opinion.

 Small (20k) pages probably aren't worth it,
 for anything larger then as it's been mentioned, even if visitors have no
 idea the pages are smaller, if they load in 1/3 of the time it's useful,
 wanted, and definitely cool.

 Just remember that not every browser understands gzip compression, but also
 remember that a probably larger percentage of visitors have ECMAScript
 (JavaScript) switched off.
 You takes your chances, you makes your choice...

 William.

 - Original Message -
 From: SP [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]; 'Girish Nath' [EMAIL PROTECTED];
 [EMAIL PROTECTED]
 Sent: May 14 2002 06:29 PM
 Subject: RE: [PHP] Cool PHP Tricks/Features ?

  Well if his normal page is 100k and he can cut the
  size down to 50k with gzip then instead of having
  a monthly transfer of 100 GB for example, he would
  only be paying for 50 GB.  Seems like it's useful
  for extremely large sites.
 
 
 
  -Original Message-
  From: John Holmes
  [mailto:[EMAIL PROTECTED]]
  Sent: May 14, 2002 6:43 PM
  To: 'Girish Nath'; [EMAIL PROTECTED]
  Subject: RE: [PHP] Cool PHP Tricks/Features ?
 
 
  Why do you think this is useful to you? I remember
  reading an article on
  this and its conclusion was that zipping the
  output was only beneficial
  for large data between fast computers over a slow
  pipe. You have to look
  at who your clients are and if it's beneficial to
  have their machine use
  up extra time (processing power) unzipping things
  or not. Also, you're
  using more processing time on your computer having
  to do the zipping for
  every request, too.
 
  ---John Holmes...
 
   -Original Message-
   From: Girish Nath
  [mailto:[EMAIL PROTECTED]]
   Sent: Tuesday, May 14, 2002 9:28 AM
   To: [EMAIL PROTECTED]
   Subject: [PHP] Cool PHP Tricks/Features ?
  
   Hi
  
   I've been using PHP for about 2 years now but
  only just discovered
   ob_gzhandler and gzip/compressing http output.
   It's something i wish i'd found out about
  earlier because even though
  it's
   a
   simple concept the result blew me away :)
  
   Anyway, i just wanted to know of any other cool
  tricks/features that
  you
   guys are using that others could have
  overlooked.
  
   Thanks
  
  
   Girish
   --
   www.girishnath.co.uk
  
  
  
  
   --
   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
 
 
  ---
  Incoming mail is certified Virus Free.
  Checked by AVG anti-virus system
  (http://www.grisoft.com).
  Version: 6.0.361 / Virus Database: 199 - Release
  Date: 07/05/02
 
  ---
  Outgoing mail is certified Virus Free.
  Checked by AVG anti-virus system
  (http://www.grisoft.com).
  Version: 6.0.361 / Virus Database: 199 - Release
  Date: 07/05/02
 
 
  --
  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] HTTPS spoofing and $_SERVER

2002-05-15 Thread George Whiffen

1LT John W. Holmes wrote:

 Well, if you fix #1, that will fix #2 because you can use $_SERVER[HTTPS],
 which can't be spoofed by the user. What versions of PHP and Apache are you
 using, on what OS?

 ---John Holmes...


Oops,

Just run up phpinfo and this appears to be php 4.0.1pl2, Stronghold 3.0/Apache
1.13.9
and Debian 2.2.20.

I guess the 4.0.1pl2 explains the absence of $_SERVER, but I would still have
expected
it in $HTTP_SERVER_VARS, wouldn't I?

Anyway, it sounds like you've answered my key concern  that HTTPS, and all the
other
Apache variables SHOULD be in $_SERVER, even  if with this stupid *** build
they
aren't.  I suppose I'll just have to rely on $SERVER_PORT not changing for  the
SSL
port until I can manage to persuade the System Administrators to upgrade the
php again.

(My main problem with getting them to keep up to date is that Debian's php
package lags so far
behind, and they really don't like upgrading unless Debian have rubber stamped
it).

Kind regards,

George


 - Original Message -
 From: George Whiffen [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Wednesday, May 15, 2002 7:35 AM
 Subject: [PHP] HTTPS spoofing and $_SERVER

  Hi,
 
  I want to know if the user is connected on a secure socket and have two
  problems:
 
  1. My  Apache (Stronghold), variables are not turning up in $_SERVER or
  $HTTP_SERVER_VARS
  although they are in $GLOBALS e.g. I have $GLOBALS[SERVER_PORT] but not
  $_SERVER[SERVER_PORT].
  This is with track vars and register globals both on.   It seems I have
  to rely on the $GLOBALS value and be careful with variables_order.
 
  2. As well as $SERVER_PORT, I also get $HTTPS, but  only if there it is
  an HTTPS connect i.e. on a secure connect, $HTTPS == 'on', but on an
  insecure connect it is not set.  This makes it easy to spoof even with
  variables_order set to ECGPS. I could just use $SERVER_PORT, which is
  always set and thus not so easily spoofed but then I have to worry if
  the secure port changes.
 
  Any suggestions?
 
  George
 
 
  --
  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] How YaBB logs in

2002-05-15 Thread Matthew Ward

I'm currently integrating my site with YaBB so that when you log into my
YaBB forums it also logs you into the whole site. I'm also developing a
script that I'm integrating into my main page that checks the password in
the cookie with the one in the database as a security check.

The problem is, the crypted password stored in the database is seeded with
the password itself, however the crypted password that the YaBB login script
stores in the cookie is seeded with ys, producing two completely different
passwords. So how am I (and how does YaBB) compare these two passwords to
make sure their the same, if their completely different?



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




[PHP] PHP and HTML

2002-05-15 Thread Alia Mikati

Hi everybody
Plz can u help me with this? I have an html file that diplays images. And 
I want to use PHP to parse this file: i.e. to display those images and 
their sources. How can this be done?
Thx a lot
Alia



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




Re: [PHP] How YaBB logs in

2002-05-15 Thread Rasmus Lerdorf

You can't.

You have to have the non-crypted password which you then run the crypt()
function on.  Say the password is banana.  You then run:

  crypt('banana','ba')   =  baGGlRhhSFzk2
  crypt('banana','ys')   =  ysu0jnfX9fp2.

You make sure these two match the two crypted strings stored in the DB.
There is no way to compare baGGlRhhSFzk2 directly to ysu0jnfX9fp2.

-Rasmus

On Wed, 15 May 2002, Matthew Ward wrote:

 I'm currently integrating my site with YaBB so that when you log into my
 YaBB forums it also logs you into the whole site. I'm also developing a
 script that I'm integrating into my main page that checks the password in
 the cookie with the one in the database as a security check.

 The problem is, the crypted password stored in the database is seeded with
 the password itself, however the crypted password that the YaBB login script
 stores in the cookie is seeded with ys, producing two completely different
 passwords. So how am I (and how does YaBB) compare these two passwords to
 make sure their the same, if their completely different?



 --
 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] Cool PHP Tricks/Features ?

2002-05-15 Thread David Freeman


It's quite some time since I dealt directly with modems and packets
moving over networks per se so some of this may well prove wrong - feel
free to point it out if I am someone.

  3. But surely, ASDL, cable, the backbone and decent 
  intranets must all do hardware compression, don't they?  Or 
  are they secretly not very keen on decreasing network traffic?

Perhaps there's an element of confusion in technologies.  A modem is an
analogue device.  It converts a digital signal into an analogue one to
transfer it over a phone line as audio.  As such, it is capable of being
compressed due to the nature of the signal (being audio and all).  A
digital network link (which includes ISDN, ADSL and the backbone link
stuff) is just that - a digital link.  No conversion to analogue takes
place.  On a digital link you're moving packets of data.  I doubt
there's much scope of a packet of data that would typically be under 1k
in size (going purely from memory here and quite happy to be told
otherwise).

Different technologies involve different concepts basically.

CYA, Dave



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




[PHP] GD and Freetype on Win2k.

2002-05-15 Thread Michael Barker

I'm using the phpdev distribution on Win2k which shows Freetype Linkage = 
with freetype under GD in phpinfo().

When I try to use a freetype font with ImageTTFText() I get an error stating 
that php could not find/open font.

Do I need to obtain Freetype seperately as I would on linux or am I doing 
something wrong?

If I need to install Freetype could some one point me to a good source with 
win32 documentation?

Thanks

-Michael

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




Re: [PHP] Cool PHP Tricks/Features ?

2002-05-15 Thread Danny Shepherd

Modem compression will only affect data between the modem and the ISP.

A point you don't appear to have considered is that by compressing at the
server a host can significantly reduce outgoing bandwidth (i.e. the stuff
they pay for) - the less you use, the less you pay. Compressing pages is
very lightweight on a cpu and i'd advise enabling compression by default,
only disabling it if there is a noticable decrease in server performance.
Processing power is probably cheaper today than bandwidth is.

HTH.

Danny.

- Original Message -
From: George Whiffen [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; Sqlcoders.Com Programming Dept
[EMAIL PROTECTED]
Sent: Wednesday, May 15, 2002 1:24 PM
Subject: Re: [PHP] Cool PHP Tricks/Features ?


 Ummm,

 This output compression sounded cool to me when I came across it,
 but I wasn't sure it really helped or was appropriate for us to use:

 1. My biggest concern is the slowest user i.e. at the end of a modem
 on the other side of the planet.  I thought they would almost certainly
 have modem compression so doing our own compression doesn't
 really help them at all i.e. actual download speeds stay the same, it's
 just we/they do the work rather than the modems.

 2. I was surprised when I got ISDN dial-up that it didn't seem
 to have automatic compression on the line, but assumed that was
 going to change.  Am I too hopeful?

 3. But surely, ASDL, cable, the backbone and decent intranets
 must all do hardware compression, don't they?  Or are they
 secretly not very keen on decreasing network traffic?

 4. Finally, if the network hardware isn't handling compression
 for us, I would have thought it was a good job for a web server.
 I guess I'd have to ask the Apache guys, but I would guess this
 can be really neatly done with some fancy mod_rewrite, custom
 extension or whatever.

 In summary, I can't agree more that all pages should be compressed,
 but  don't feel it should be our job.   Maybe I'm wrong and this is
another
 case of the poor old application developer having to do all the *
work,
 just because the rest of the computing industry is too busy counting its
 profits to do its own job properly ;).


 What's everyone else think?

 George


 Sqlcoders.Com Programming Dept wrote:

  I've seen real-life examples of 100k pages going down to around 30k,
  considering that decrease in size, when you remember that CPU time is
  relatively cheap compared to bandwidth, it's worth the processing
overhead
  in my opinion.
 
  Small (20k) pages probably aren't worth it,
  for anything larger then as it's been mentioned, even if visitors have
no
  idea the pages are smaller, if they load in 1/3 of the time it's useful,
  wanted, and definitely cool.
 
  Just remember that not every browser understands gzip compression, but
also
  remember that a probably larger percentage of visitors have ECMAScript
  (JavaScript) switched off.
  You takes your chances, you makes your choice...
 
  William.
 
  - Original Message -
  From: SP [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]; 'Girish Nath'
[EMAIL PROTECTED];
  [EMAIL PROTECTED]
  Sent: May 14 2002 06:29 PM
  Subject: RE: [PHP] Cool PHP Tricks/Features ?
 
   Well if his normal page is 100k and he can cut the
   size down to 50k with gzip then instead of having
   a monthly transfer of 100 GB for example, he would
   only be paying for 50 GB.  Seems like it's useful
   for extremely large sites.
  
  
  
   -Original Message-
   From: John Holmes
   [mailto:[EMAIL PROTECTED]]
   Sent: May 14, 2002 6:43 PM
   To: 'Girish Nath'; [EMAIL PROTECTED]
   Subject: RE: [PHP] Cool PHP Tricks/Features ?
  
  
   Why do you think this is useful to you? I remember
   reading an article on
   this and its conclusion was that zipping the
   output was only beneficial
   for large data between fast computers over a slow
   pipe. You have to look
   at who your clients are and if it's beneficial to
   have their machine use
   up extra time (processing power) unzipping things
   or not. Also, you're
   using more processing time on your computer having
   to do the zipping for
   every request, too.
  
   ---John Holmes...
  
-Original Message-
From: Girish Nath
   [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 14, 2002 9:28 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Cool PHP Tricks/Features ?
   
Hi
   
I've been using PHP for about 2 years now but
   only just discovered
ob_gzhandler and gzip/compressing http output.
It's something i wish i'd found out about
   earlier because even though
   it's
a
simple concept the result blew me away :)
   
Anyway, i just wanted to know of any other cool
   tricks/features that
   you
guys are using that others could have
   overlooked.
   
Thanks
   
   
Girish
--
www.girishnath.co.uk
   
   
   
   
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
   http://www.php.net/unsub.php
  
  

[PHP] SQL Server test tool

2002-05-15 Thread Scott St. John

Has anyone seen or know if it is possible to use PHP to test if a SQL 
server is alive on port 1433?  I know I could run a query, but was looking 
for something to actually test on the port.

Thanks,

-Scott


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




Re: [PHP] can't upload files

2002-05-15 Thread heinisch

At 15.05.2002  12:33, you wrote:

I am using this script: to upload a picture file and I get the error below:
Unable to create 'hgh6.gif': Permission denied in
/home/vhtdocs/archipro/do_upload.php on line 13
Couldn't copy the file!  - What am I doing wrong

form enctype=multipart/form-data method=post action=do_upload.php

pstrongFile to Upload:/strongbr
input type=file name=img1 size=30/p

Pinput type=submit name=submit value=Upload File/p

/form
upload file:
?

// if $img_name isn't empty, try to copy the file

You files name is in the var $img1, your refering to $img1_name !!

if ($img1_name != ) {

copy($img1, /images/$img1_name)

you should use absolute pathes
copy(/tmp/.$img1,/home/yourpath_to_virt_server/images/.$img_name)

   or die(Couldn't copy the file!);

} else {

  // if $img_name was empty, die and let us know why
  die(No input file specified);

}

?

Warning: Unable to create 'hgh6.gif': Permission denied in
/home/vhtdocs/archipro/do_upload.php on line 13
Couldn't copy the file!
HTH Oliver


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




[PHP] The Apache PHP problem

2002-05-15 Thread Eric

Hi
Just a couple of hours ago I had Apache 1.3 on windows 95 going (with the
PWS switched off), I could get the HTML content of a index.php file to
work, by typing in http://localhost/index.php  (and http://localhost/ worked
well with the Apache notice)  but the code in the PHP file did not work (to
display the server time) , in trying to solve that now I can not get Apache
to work,
with message

can not load ...php4apache.dll  in to server

I checked on the web (the last time got me into this trouble) I have try one
version of Apache and then another version  (from ZIP to EXE) then download
one version of PHP install and another version I have bits of  folders all
over the hard drive, changed the REGEDIT because I had PWS and that did not
work, I have gone for one book to another, it's driving crazy, and it's
almost 1.00am in New Zealand,  maybe if there is no idea for the group I
might uninstall everything and if I can remember which versions worked the
best start again

Have a happy day, sorry to be a worry

From Eric



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.361 / Virus Database: 199 - Release Date: 07-05-02



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




[PHP] shell command

2002-05-15 Thread Roman Duriancik

How to execute dos\winnt command in php script, i need disk map in php

excample :
? some code . and now i need do this : 'net use I:
\\server\shere_folder\' ..?




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




Re: [PHP] shell command

2002-05-15 Thread Juan Pablo Aqueveque

http://www.php.net/manual/en/ref.exec.php

At 09:30 15/05/02, you wrote:
How to execute dos\winnt command in php script, i need disk map in php

excample :
? some code . and now i need do this : 'net use I:
\\server\shere_folder\' ..?




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


Juan Pablo Aqueveque [EMAIL PROTECTED]
Ingeniero de Sistemas
Departamento de Redes y Comunicaciones http://www.drc.uct.cl
Universidad Católica de Temuco.
Tel:(5645) 205 630 Fax:(5645) 205 628




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




Re: [PHP] Cool PHP Tricks/Features ?

2002-05-15 Thread Michael Kimsal

George Whiffen wrote:

 
 1. My biggest concern is the slowest user i.e. at the end of a modem
 on the other side of the planet.  I thought they would almost certainly
 have modem compression so doing our own compression doesn't
 really help them at all i.e. actual download speeds stay the same, it's
 just we/they do the work rather than the modems.
 

Have you tried it?



 In summary, I can't agree more that all pages should be compressed,
 but  don't feel it should be our job.   Maybe I'm wrong and this is another
 case of the poor old application developer having to do all the * work,
 just because the rest of the computing industry is too busy counting its
 profits to do its own job properly ;).


Apache isn't making any profits directly from its technology, but there
is a mod_gzip module for Apache.

Why is it so hard to put in *one line* of code (probably in an include 
file?)  Why do you consider this all the  work?  You probably
spend more time fiddling with TABLE CELLPADDING than you would on 
putting this line in one place, but you seem to think it's *another 
burden*.  I look at it the other way - I love having more things under 
my control, and regardless of whether a webserver has configured 
outgoing compression or not, I can control it.


 
 
 What's everyone else think?
 
See above. :)

Michael Kimsal
http://www.logicreate.com
734-480-9961


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




Re: [PHP] shell command

2002-05-15 Thread 1LT John W. Holmes

Read the manual. 

www.php.net/exec

among others...

---John Holmes...

- Original Message - 
From: Roman Duriancik [EMAIL PROTECTED]
To: PHP-General [EMAIL PROTECTED]
Sent: Wednesday, May 15, 2002 9:30 AM
Subject: [PHP] shell command


 How to execute dos\winnt command in php script, i need disk map in php
 
 excample :
 ? some code . and now i need do this : 'net use I:
 \\server\shere_folder\' ..?
 
 
 
 
 -- 
 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] shell command

2002-05-15 Thread Jared Boelens

Here are the functions you need:

http://www.php.net/manual/en/ref.exec.php

-Jared

-Original Message-
From: Roman Duriancik [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 15, 2002 9:30 AM
To: PHP-General
Subject: [PHP] shell command


How to execute dos\winnt command in php script, i need disk map in php

excample :
? some code . and now i need do this : 'net use I:
\\server\shere_folder\' ..?




-- 
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] SQL Server test tool

2002-05-15 Thread Jared Boelens

I would imagine that you could use fsockopen to open a socket connection on
that port in order to test it.

-Jared

-Original Message-
From: Scott St. John [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 15, 2002 8:53 AM
To: [EMAIL PROTECTED]
Subject: [PHP] SQL Server test tool


Has anyone seen or know if it is possible to use PHP to test if a SQL
server is alive on port 1433?  I know I could run a query, but was looking
for something to actually test on the port.

Thanks,

-Scott


--
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] Cool PHP Tricks/Features ?

2002-05-15 Thread Michael Kimsal

Danny Shepherd wrote:
 No, that's not a problem either!
 
 snip from manual
 Before ob_gzhandler() actually sends compressed data, it determines what
 type of content encoding the browser will accept (gzip, deflate or none
 at all) and will return it's output accordingly. All browsers are supported
 since it's up to the browser to send the correct header saying that it
 accepts compressed web pages.
 /snip from manual
 


It is a problem if you're bothering to support NS4 users,
because they can't handle it properly.

NS has a useful habit of re-requesting a 'page' from the server
under many conditions (used to be even when resizing the window). 
Currently, the browser will issue another GET against the same URL,
even if the page had been POSTed.  It will not bring back the same info,
so VIEWSOURCE and PRINTing are already messed up.  But even PRINTing
a regular page that is gzipped is hosed, because NS tells the
server it can handle zipped data, but it doesn't unzip before printing,
so you'll be printing out compressed data to your printer.

Don't even bother flaming me about x% of your users still use NS4
and it's a great browser and IE sucks etc.


Michael Kimsal
http://www.logicreate.com
734-480-9961


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




[PHP] Striphigh in PHP?

2002-05-15 Thread Steven Apostolou

Hello Everybody,

Is there a function/library in PHP that does this?


The module striphigh.pm (Perl module):

The Text::Striphigh module exports a single function: Cstriphigh. This
function takes one argument, a string possibly containing high ASCII
characters in the ISO-8859-1 character set, and transforms this into a
string containing only 7 bits ASCII characters, by substituting every
high bit character with a similar looking standard ASCII character, or
with a sequence of standard ASCII characters.

http://theoryx5.uwinnipeg.ca/CPAN/data/Text-Striphigh/Striphigh.html


Greetings,

-- 
Steven Apostolou [EMAIL PROTECTED]


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




Re: [PHP] Newbie - Spot the error

2002-05-15 Thread Shaun Thomas

On Wed, 15 May 2002, Josh Edwards wrote:

 $timespread =array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
  if ($time = = 21)
  $timespread[22]=($timespread[22]+1);
  echo $timespread[22] ;

It should be ==, not = =.  Secondly, you don't need to quote the 21, 
it's a number.  You should use PHP's array_fill function to make your 
array of 0's.  Finally, remember the ++ syntax, too.  Try this:

$timespread = array_fill(0, 24, 0);
if ($time == 21)
  $timespread[22]++;
echo $timespread[22];


-- 
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+
| Shaun M. ThomasINN Database Administrator   |
| Phone: (309) 743-0812  Fax  : (309) 743-0830|
| Email: [EMAIL PROTECTED]AIM  : trifthen  |
| Web  : www.townnews.com |
| |
| Most of our lives are about proving something, either to   |
|  ourselves or to someone else. |
|   -- Anonymous  |
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+



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




[PHP] Tellwhich browser

2002-05-15 Thread Diana Castillo

What is the code to tell whether the user is on IE or Netscape?



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




[PHP] IF Statements

2002-05-15 Thread Jon Yates

People, hope you can help. The below IF statement is getting a PARSE error.
Can anyone spot why?

Cheers.

Jon
  
  if (($this-checkReferralCB($this-benefitRef, $this-benefitNo,
$this-childDOB)) 
   (!$this-checkLocation($this-post, W))  (!empty($this-childDOB)))
  || ($this-checkPregnancy($this-benefitRef, $this-benefitNo))


 JYvCard.vcf 



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


Re: [PHP] IF Statements

2002-05-15 Thread Rasmus Lerdorf

Your brackets don't match up.  Use an editor that lets you do
bracket-matching.  Hit '%' in vi, for example.

-Rasmus

On Wed, 15 May 2002, Jon Yates wrote:

 People, hope you can help. The below IF statement is getting a PARSE error.
 Can anyone spot why?

 Cheers.

 Jon

   if (($this-checkReferralCB($this-benefitRef, $this-benefitNo,
 $this-childDOB))
(!$this-checkLocation($this-post, W))  (!empty($this-childDOB)))
   || ($this-checkPregnancy($this-benefitRef, $this-benefitNo))


  JYvCard.vcf




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




Re: [PHP] IF Statements

2002-05-15 Thread Steven Apostolou

if (($this-checkReferralCB($this-benefitRef, $this-benefitNo,
$this-childDOB)) 
   (!$this-checkLocation($this-post, W))  (!empty($this-childDOB)))
  || ($this-checkPregnancy($this-benefitRef, $this-benefitNo))
  
  must be:
  
if (($this-checkReferralCB($this-benefitRef, $this-benefitNo, $this-childDOB)) 
(!$this-checkLocation($this-post, W)) 
(!empty($this-childDOB)) ||
($this-checkPregnancy($this-benefitRef, $this-benefitNo))
)

-- 
Steven Apostolou [EMAIL PROTECTED]


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




Re: [PHP] IF Statements

2002-05-15 Thread Michal Dvoracek

Hello,

try this version :)

if (($this-checkReferralCB($this-benefitRef, $this-benefitNo, $this-childDOB))   
(!$this-checkLocation($this-post, W))  (!empty($this-childDOB)) || 
($this-checkPregnancy($this-benefitRef, $this-benefitNo)))

Regards,
Michal Dvoracek  [EMAIL PROTECTED]


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




RE: [PHP] IF Statements

2002-05-15 Thread Jay Blanchard

[snip]
People, hope you can help. The below IF statement is getting a PARSE error.
Can anyone spot why?

  if (($this-checkReferralCB($this-benefitRef, $this-benefitNo,
$this-childDOB))
   (!$this-checkLocation($this-post, W))  (!empty($this-childDOB)))
  || ($this-checkPregnancy($this-benefitRef, $this-benefitNo))
[/snip]

It's not complete, where is the {} curly braces? And you're parentheses are
out of order by one...

  if (($this-checkReferralCB($this-benefitRef, $this-benefitNo,
$this-childDOB))
   (!$this-checkLocation($this-post, W))  (!empty($this-childDOB))
  || ($this-checkPregnancy($this-benefitRef, $this-benefitNo)))

standard...

If((this)  (that)  (theother) || (something else)){
do this
}

Jay



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




RE: [PHP] Sessions Without Cookies or SID Passing...

2002-05-15 Thread Garth Dahlstrom

 maintain state accross requests.  This is done in 3 different ways.

 1. Cookies
 2. URL Mangling
 3. HTTP Authentication

#4 Passing a SID/Session info in hidden fields, but it means 
you must push every page move through a submit (which can be 
done with Javascript, image buttons, etc), depending on what you 
are trying to do it might be alright...

-GED



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




Re: [PHP] IF Statements

2002-05-15 Thread 1LT John W. Holmes

When in doubt, add in some carriage returns to space everything out to see
if your braces match up.

 if
(
($this-checkReferralCB($this-benefitRef, $this-benefitNo,
$this-childDOB))

(!$this-checkLocation($this-post, W))

(!empty($this-childDOB))
)
||
($this-checkPregnancy($this-benefitRef, $this-benefitNo))

You can see from that, that there is a brace missing around the entire
statement. So your logic probably isn't working how you thought it would,
either. You'll have to put it all back together to actually execute the
code, but this will help you on large statements like this to make sure your
logic and syntax is correct.

---John Holmes...

- Original Message -
From: Jon Yates [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, May 15, 2002 10:03 AM
Subject: [PHP] IF Statements


 People, hope you can help. The below IF statement is getting a PARSE
error.
 Can anyone spot why?

 Cheers.

 Jon

   if (($this-checkReferralCB($this-benefitRef, $this-benefitNo,
 $this-childDOB))
(!$this-checkLocation($this-post, W)) 
(!empty($this-childDOB)))
   || ($this-checkPregnancy($this-benefitRef, $this-benefitNo))


  JYvCard.vcf








 --
 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] PhP 4.2.1 (and various)

2002-05-15 Thread Analysis Solutions

Olav:

On Wed, May 15, 2002 at 11:53:06AM +0100, Olav Bringedal wrote:

 $user=$Session[user];
 
 if(!$Authorized)
 {
   header (Location: http://jaggu.org;);
 }

As I was saying before, write your code in a way that doesn't generate error
messages.  For example, the above passage would be error free if you did this...

  if( empty($Authorized) ) {
 header ('Location: http://jaggu.org');
  } else {
 $user = $Session['user'];
  }

Enjoy,

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 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 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

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




[PHP] PHP editor (win)

2002-05-15 Thread Juan Pablo Aqueveque

Hi guys

I know this question it's very recurrent but the problem of Jon Yates make 
me think again this stuff.

Somebody knows a quick editor, simply and with highlight?

:) Jp

I have tried : PHPEdit, DevPad



Juan Pablo Aqueveque [EMAIL PROTECTED]
Ingeniero de Sistemas
Departamento de Redes y Comunicaciones http://www.drc.uct.cl
Universidad Católica de Temuco.
Tel:(5645) 205 630 Fax:(5645) 205 628




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




Re: [PHP] counting max word length fails on line brake

2002-05-15 Thread Analysis Solutions

On Wed, May 15, 2002 at 12:49:30PM +0200, andy wrote:
 
 test
 ölakjdfölakjdöfkjaödlfkjöaksdjföl
 
 it asumes thtat the word is: test ölakjdfölakjdöfkjaödlfkjöaksdjföl
 
  $word = explode( ,$string);

Because you're splitting on spaces only.  If you want to split on more than just 
spaces, you need to use a regular expression split function.
   $word = preg_split('/\s+/', $string);

That will split on any whitespace character, such as space, tabs, and line breaks.  
Note, putting in the + makes the expression kind enough to only do one split in cases
where more than one space character are next to each other.

Enjoy,

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 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 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

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




Re: [PHP] counting max word length fails on line brake

2002-05-15 Thread 1LT John W. Holmes

You might want to look into wordwrap(), too

www.php.net/wordwrap

---John Holmes...

- Original Message -
From: Analysis  Solutions [EMAIL PROTECTED]
To: PHP List [EMAIL PROTECTED]
Sent: Wednesday, May 15, 2002 10:42 AM
Subject: Re: [PHP] counting max word length fails on line brake


 On Wed, May 15, 2002 at 12:49:30PM +0200, andy wrote:
 
  test
  ölakjdfölakjdöfkjaödlfkjöaksdjföl
 
  it asumes thtat the word is: test ölakjdfölakjdöfkjaödlfkjöaksdjföl
 
   $word = explode( ,$string);

 Because you're splitting on spaces only.  If you want to split on more
than just
 spaces, you need to use a regular expression split function.
$word = preg_split('/\s+/', $string);

 That will split on any whitespace character, such as space, tabs, and line
breaks.
 Note, putting in the + makes the expression kind enough to only do one
split in cases
 where more than one space character are next to each other.

 Enjoy,

 --Dan

 --
PHP classes that make web design easier
 SQL Solution  |   Layout Solution   |  Form Solution
 sqlsolution.info  | layoutsolution.info |  formsolution.info
  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 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 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




[PHP] Newbie help please!

2002-05-15 Thread John

Hello,

I am about 3 hrs old with php and have a very simple question. I
have a test.html page that is just an href and I want to put the variables
into php variables on the next page but I get an error. Could someone please
correct my code or tell me what is wrong. We use IIS NT 4.0 MySQL. We have
installed PHPBB and it works great!  Thanks in advance for your time.

test.html code
html
head
 titleUntitled/title
/head
body
/body
a href=test.php?user=adminpass=123456Click here/a
/html


test.php code
?php
$username = user;
$password = pass;
echo $username;
echo $password;
?

error messages---
Notice: Use of undefined constant user - assumed 'user' in
\\SERVER\web\phpBB2\test.php on line 3

Notice: Use of undefined constant pass - assumed 'pass' in
\\SERVER\web\phpBB2\test.php on line 4
userpass



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




RE: [PHP] Newbie help please!

2002-05-15 Thread Tommy Claasens - Q Data KZN

Hi, 


Try this 
?php
$username = $_GET['user'];
$password = $_GET['pass'];
echo $username;
echo $password;
?

-Original Message-
From: John [mailto:[EMAIL PROTECTED]]
Sent: Wed, 15 May 2002 16:46
To: [EMAIL PROTECTED]
Subject: [PHP] Newbie help please!


Hello,

I am about 3 hrs old with php and have a very simple question. I
have a test.html page that is just an href and I want to put the variables
into php variables on the next page but I get an error. Could someone please
correct my code or tell me what is wrong. We use IIS NT 4.0 MySQL. We have
installed PHPBB and it works great!  Thanks in advance for your time.

test.html code
html
head
 titleUntitled/title
/head
body
/body
a href=test.php?user=adminpass=123456Click here/a
/html


test.php code
?php
$username = user;
$password = pass;
echo $username;
echo $password;
?

error messages---
Notice: Use of undefined constant user - assumed 'user' in
\\SERVER\web\phpBB2\test.php on line 3

Notice: Use of undefined constant pass - assumed 'pass' in
\\SERVER\web\phpBB2\test.php on line 4
userpass



-- 
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] Newbie help please!

2002-05-15 Thread Jay Blanchard

[snip]
test.html code
html
head
 titleUntitled/title
/head
body
/body
a href=test.php?user=adminpass=123456Click here/a
/html

test.php code
?php
$username = user;
$password = pass;
echo $username;
echo $password;
?
[/snip]

$user will be 'admin'
$pass will be '123456'

You made an attempt to change the variable names, so you should have done
this;

?php
$username = $user; //note the variable designation
$password = $pass; //note the variable designation
echo $username;
echo $password;
?

HTH!

Jay



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




RE: [PHP] Newbie help please!

2002-05-15 Thread Collins, Robert

this will do it:
?php
$username = $_GET['user'];
$password = $_GET['pass'];
echo $username;
echo $password;
?

Robert W. Collins II 
Webmaster 
New Orleans Regional Transit Authority 
Phone : (504) 248-3826 
Email : [EMAIL PROTECTED] 



-Original Message-
From: John [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 15, 2002 9:46 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Newbie help please!


Hello,

I am about 3 hrs old with php and have a very simple question. I
have a test.html page that is just an href and I want to put the variables
into php variables on the next page but I get an error. Could someone please
correct my code or tell me what is wrong. We use IIS NT 4.0 MySQL. We have
installed PHPBB and it works great!  Thanks in advance for your time.

test.html code
html
head
 titleUntitled/title
/head
body
/body
a href=test.php?user=adminpass=123456Click here/a
/html


test.php code
?php
$username = user;
$password = pass;
echo $username;
echo $password;
?

error messages---
Notice: Use of undefined constant user - assumed 'user' in
\\SERVER\web\phpBB2\test.php on line 3

Notice: Use of undefined constant pass - assumed 'pass' in
\\SERVER\web\phpBB2\test.php on line 4
userpass



-- 
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] Security in virtual host server

2002-05-15 Thread James Arthur

Hi

I have a server with multiple users, each with user space that may contain a 
public_html directory. The main site also has a web page, but I'm having 
trouble configuring PHP securely.

Anyone with access to PHP can write a script to find and print out any file 
in the main page, and one of these files may contain secure information, like 
passwords etc.

It seems that the only way to get around this is to use php in cgi-bin mode. 
What I want to do is make this transparent to users, so that they don't need 
to make their files executable and put the #!/usr/bin/php4 -q on the top of 
each php file. If I can make it so they don't even realise that they're using 
cgi-bin php, then that's perfect. Is there any way I can do this?

I'm using php 4.2.x with apache 1.3.x on top of Debian GNU/Linux 
potato/stable.

Thanks

--jaa

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




RE: [PHP] PHP editor (win)

2002-05-15 Thread Brian McGarvie

html-kit... http://www.chami.com/html-kit/

-Original Message-
From: Juan Pablo Aqueveque [mailto:[EMAIL PROTECTED]]
Sent: 15 May 2002 15:39
To: [EMAIL PROTECTED]
Subject: [PHP] PHP editor (win)


Hi guys

I know this question it's very recurrent but the problem of Jon Yates
make 
me think again this stuff.

Somebody knows a quick editor, simply and with highlight?

:) Jp

I have tried : PHPEdit, DevPad



Juan Pablo Aqueveque [EMAIL PROTECTED]
Ingeniero de Sistemas
Departamento de Redes y Comunicaciones http://www.drc.uct.cl
Universidad Católica de Temuco.
Tel:(5645) 205 630 Fax:(5645) 205 628




-- 
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] Newbie help please!

2002-05-15 Thread Brian McGarvie

or this 
?php
echo $user;
echo $pass;
?

-Original Message-
From: Tommy Claasens - Q Data KZN [mailto:[EMAIL PROTECTED]]
Sent: 15 May 2002 15:57
To: John; [EMAIL PROTECTED]
Subject: RE: [PHP] Newbie help please!


Hi, 


Try this 
?php
$username = $_GET['user'];
$password = $_GET['pass'];
echo $username;
echo $password;
?

-Original Message-
From: John [mailto:[EMAIL PROTECTED]]
Sent: Wed, 15 May 2002 16:46
To: [EMAIL PROTECTED]
Subject: [PHP] Newbie help please!


Hello,

I am about 3 hrs old with php and have a very simple question. I
have a test.html page that is just an href and I want to put the
variables
into php variables on the next page but I get an error. Could someone
please
correct my code or tell me what is wrong. We use IIS NT 4.0 MySQL. We
have
installed PHPBB and it works great!  Thanks in advance for your time.

test.html code
html
head
 titleUntitled/title
/head
body
/body
a href=test.php?user=adminpass=123456Click here/a
/html


test.php code
?php
$username = user;
$password = pass;
echo $username;
echo $password;
?

error messages---
Notice: Use of undefined constant user - assumed 'user' in
\\SERVER\web\phpBB2\test.php on line 3

Notice: Use of undefined constant pass - assumed 'pass' in
\\SERVER\web\phpBB2\test.php on line 4
userpass



-- 
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] Newbie help please!

2002-05-15 Thread John

Tommy,
Thanks that was it.
Tommy Claasens - Q Data Kzn [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi,


 Try this
 ?php
 $username = $_GET['user'];
 $password = $_GET['pass'];
 echo $username;
 echo $password;
 ?

 -Original Message-
 From: John [mailto:[EMAIL PROTECTED]]
 Sent: Wed, 15 May 2002 16:46
 To: [EMAIL PROTECTED]
 Subject: [PHP] Newbie help please!


 Hello,

 I am about 3 hrs old with php and have a very simple question. I
 have a test.html page that is just an href and I want to put the variables
 into php variables on the next page but I get an error. Could someone
please
 correct my code or tell me what is wrong. We use IIS NT 4.0 MySQL. We have
 installed PHPBB and it works great!  Thanks in advance for your time.

 test.html code
 html
 head
  titleUntitled/title
 /head
 body
 /body
 a href=test.php?user=adminpass=123456Click here/a
 /html


 test.php code
 ?php
 $username = user;
 $password = pass;
 echo $username;
 echo $password;
 ?

 error messages---
 Notice: Use of undefined constant user - assumed 'user' in
 \\SERVER\web\phpBB2\test.php on line 3

 Notice: Use of undefined constant pass - assumed 'pass' in
 \\SERVER\web\phpBB2\test.php on line 4
 userpass



 --
 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] Compiling PHP on Solaris 7

2002-05-15 Thread Thomas Finley


Pleas help. I'm installing php on a Solaris 7 server that is running
iplanet 4.1.

PHP Version 4.2.1

Configure: (I had more compiled in (gd, gdbm...) but error below
occured so I cut it down)

./configure --with-nsapi=/usr/netscape/server4 --enable-libgcc \
--prefix=/usr --with-mysql=/usr/local/mysql --enable-track-vars

The Error:

bash-2.05# make
Making all in Zend
make[1]: Entering directory `/usr/share/src/php-4.2.1/Zend'
/bin/sh ../libtool --silent --mode=compile gcc -DHAVE_CONFIG_H -I. -I.
-I../main   -D_POSIX_PTHREAD_SEMANTICS -D_POSIX_PTHREAD_SEMANTICS
-D_REENTRANT -I../TSRM  -g -O2 -pthreads -DZTS -prefer-pic -c -o
zend_language_parser.lo `test -f zend_language_parser.c || echo
'./'`zend_language_parser.c
In file included from zend_compile.h:24,
 from zend_language_parser.c:147:
zend.h:55: unix.h: No such file or directory
make[1]: *** [zend_language_parser.lo] Error 1
make[1]: Leaving directory `/usr/share/src/php-4.2.1/Zend'
make: *** [all-recursive] Error 1

Thomas Finley
[EMAIL PROTECTED]


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




[PHP] make install

2002-05-15 Thread Shanti Kunchaparty

Hello
I am trying to install PHP version 4.2.1 on redhat linus version 7.2
with mysql and apache version 2.0.35
The configure command used was:
./configure --prefix=/usr/local/php/
--with-mysql=/srv/local/mysql/mysql-3.23.49a-pc-linux-gnu-i686
--with-xml\ 
--with-apxs2=/usr/local/apache/bin/apxs --enable-shared-pdflib
--enable-track-vars
the make command ran fine but when I try to do a make install I get the
following error:

make[1]: Entering directory `/eve/dist/saxs/php/php-4.2.1'
make[1]: *** [install-sapi] Error 1
make[1]: Leaving directory `/eve/dist/saxs/php/php-4.2.1'
make: *** [install-recursive] Error 1

Any help will be appreciated!
Shanti
-- 
Shanti Kunchaparty,

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




Re: [PHP] Tellwhich browser

2002-05-15 Thread Mark Gallagher

Diana Castillo wrote:
  What is the code to tell whether the user is on IE or Netscape?

It's slightly more complicated than that (I'm a newbie too, but I know a
very little about user-agent strings), but it *will* involve using
http://www.php.net/manual/en/function.get-browser.php

As you may be aware, IE's user-agent string was originally designed to
look as similar to Netscape's as possible to avoid the idiots who block
non-Netscape users[0], but there are some differences.

Usually checking for MSIE in the string is enough.  Here's a sample IE 
string:

   Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Hotbar 2.0)

This tells us it's IE6, running on Windows '98, and the user has Hotbar 
installed.

And here's a sample Netscape Navigator 4:

   Mozilla/4.5 [en] (Win98; I)

This tells us it's Navigator 4.5, looking for english pages, running on 
Windows '98.  Anyone who tells me what the I stands for wins 3 cool 
points.

Of course, sometimes browsers (like Konqueror, or Opera) are set up to 
spoof IE or Netscape, for the same reason IE was given the Mozilla/4.0 
string in the first place.  In the case of Konqueror, the entire 
UA-string is configurable by the user, but for Opera, the browser's name 
is always included somewhere.  Here's one for Opera:

   Mozilla/4.0 (compatible; MSIE 5.0; Linux 2.4.2-2 i686) Opera 5.0  [en]

This tells us it's Opera 5, looking for english pages, running on Linux 
(kernel 2.4.2, Intel), and pretending to be IE5.

It's easy to work out what a browser's user-agent string is.  What's 
/not/ easy is telling a computer to work out what *browser* it is.

You can just do a simple search for MSIE in the string, which will 
prevent you from blocking out spoofers[1] from your script and give you 
less accuracy, but would also provide relatively little work and 
successfully separate Netscape from IE-and-spoofers :o).

One thing to remember: there's more than just Netscape out there. 
There's Mozilla, there's Opera, there's Dillo, there's Lynx, there's 
Links, there's Konqueror, there may even be a few poor fools stuck on 
Mosaic or Cello.  And what if someone has no browser, and just uses wget 
and their favourite text viewer?



[0] Oh, the irony!  Look at what clueless designers are doing to block
 non-IE users today :o)
[1] But then, I doubt you'd want to do that anyway... right?

-- 
Mark Gallagher
http://cyberfuddle.com/infinitebabble/



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




Re: [PHP] Tellwhich browser

2002-05-15 Thread Danny Shepherd

$_SERVER['HTTP_USER_AGENT']

That's the variable which holds the browser's user agent string (browser
name, version, platform etc);

You may also find this helpful

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

HTH

Danny.

- Original Message -
From: Diana Castillo [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, May 15, 2002 3:09 PM
Subject: [PHP] Tellwhich browser


 What is the code to tell whether the user is on IE or Netscape?



 --
 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] Logging Errors to a File

2002-05-15 Thread Jonathan Rosenberg

I am using an Apache webserver w/ PHP provided by a hosting company  I can't seem to 
get PHP errors logged to a file.

From reading the docs, my understanding is that I need to set error_log to the name 
of a file  set log_errors to on in the php.ini file (.htaccess, in my case).  Is 
this correct?

I tried setting these two parameters in my .htaccess file.  When I do a phpinfo() I 
see that error_log has been set, but the error_log value doesn't seem to change.  It 
remains off no matter what I do.

I'm wondering whether the hosting company may not allow this value to be overridden.  
Does this make sense?

Any other thoughts?

--
JR


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




[PHP] trans-sid .. help

2002-05-15 Thread Joshua E Minnie

I have been using some simple session management for some of my pages.  I am
inquiring about the use of transparent session id usage.  I have read the
manual and I am still a little confused on how to go about using it.

I did run phpinfo() to make sure that trans-id was enabled.  It outputed:
session.use_trans_id[local value] 1[master value] 1

I am assuming that this means it is enabled.  Now my question is how do I go
about using a trans-id?  I've seen session id appended to the URL (i.e.
this.php?PHPSESSID=a2604374903c616c9cd34e13c0ceed98), but would like to use
it without disclosing the session id in the URL.  If anyone could give me
some sample code to help me alleviate the confusion, it will be greatly
appreciated.


I am using PHP 4.1.2 compiled as CGI on Windows NT 4.0

--
Joshua E Minnie/CIO
[EMAIL PROTECTED]
Don't work for recognition, but always do work worthy of recognition.



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




[PHP] Using Sessions under Win98/Apache

2002-05-15 Thread Edward Marczak

I've been developing a PHP driven site that will ultimately run under
Solaris and Linux - no problems there.

But I set up a small development/test environment on my laptop running
Win98.  Downloaded the PHP binary (v 4.1.2) along with Apache (v 1.3.24) and
MySQL.  Everything works greatalmost.

Sessions aren't working for some reason.  Yes, they're enabled in my php.ini
file (and running a php_info() confirms that session support is enabled).
The odd thing is, is that it will create the 'sess_038d7' file.  Just no
data goes into it.

Yes, I'm running the exact same code against it that I'm running against the
Solaris and Linux PHP.

Is there something different about the Windows version that I don't know
that is causing my sessions to not work?

Thanks!
-- 
Ed Marczak
[EMAIL PROTECTED]


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




[PHP] Re: Need help with Arrays

2002-05-15 Thread Michael Virnstein

1. your while loop should have {} brackets
i can't see where it starts and where it ends.
   so does PHP. leaving brackets away tells PHP
   that only the next line is part of the while loop.
   i don't know if your file has only the three lines
   ($cust_name, $cust_area, $cust_code) or if more
   than one customer is in your file and every customer
   has these three lines. if you only have one customer with
   these three lines, you don't need the while loop, just leave
   while(!feof($fp2)) away.
   if there are multiple customers in the file and every customer
   has these three lines, you should close the while brackets after the
   switch but before the return.

2. if($cust_code==$code[$index]) is wrong here.
you haven't initilized $index as far as i can see,
   so you get: if($cust_code==$code[null])
   what you want to do is checking the array $code for the
   content $cust_code and getting the index of that element.
   so it'd be better to do:
   $row=array_search($cust_code, $code);


so try this:(assuming that you have more than one customer
in the file and every customer has the three lines.

function inquiry($fp2,$date,$name,$code)
{
while(!feof($fp2)) {
  $cust_name=trim(fgets($fp2,12));
  $cust_area=trim(fgets($fp2,9));
  $cust_code=trim(fgets($fp2,6));

  if(in_array($cust_code, $code)) {
  $row=array_search($cust_code, $code);
  }

switch($cust_area)
{
case National:
print nationalbr;

printf(%1s %1f, $name[$row], $cust_cost[$row][1]);
break;

case East:
printEastbr;

printf(%1s %1f, $name[$row], $cust_cost[$row][2]);
break;

case Midwest:
printmidwestbr;

printf(%1s %1f, $name[$row], $cust_cost[$row][3]);
break;

case Pacific:
 printpacificbr;

printf(%1s %1f, $name[$row], $cust_cost[$row][4]);
break;
}
 }
 return;
 }

Tony [EMAIL PROTECTED] schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

 Hello, I'm new to this group and already have a problem (actually the
 problem is the reason I found the group). I'm taking a Fundamentals of
 Programming class, and they are using PHP to get the message across. I'm
 having a lot of trouble passing the values in the first array to the
second
 array. I included the code (below). If anyone would be so kind as to give
me
 some advice (I'm NOT looking for someone to write it for me, just some
 helpful advice). The data is being read in correctly (for the first array
 anyway). The first function works wonderfully, the second function is
 supposed to handle customer inqueries, working from the $code/$cust_code
 variables. I need to match the numbers in these two arrays, and use switch
 on $cust_area to let it know what to print.


 Thanks

 Tony
 +

 html
 head /head
 body
 pre
 ?php

 $fp1=fopen(proj10b.dat,r);
 $fp2=fopen(proj10b2.dat,r);
 $date=date(m-d-Y);

 headers($date);
 main($fp1,$name,$code);
 inquiry($fp2,$date,$name,$code);
 fclose($fp1);
 fclose($fp2);

 function headers($date)
 {
 printDENTAL FEES BY REGION as of Date: $datebr;
 print  Printed by: Tony Hallbr;
 print br;
 print   National
 Newbr;
 printCode -Procedure Median
 EnglandMidwest   Pacificbr;
 print br;
 return;
 }

 function main($fp1,$name,$code)
 {
 for($index=0;$index43;$index++)
 {
 $name[$index]=(string)fgets($fp1,42);
 $code[$index]=(string)fgets($fp1,6);
 $nat_cost[$index][1]=(integer)fgets($fp1,4);
 $east_cost[$index][2]=(integer)fgets($fp1,4);
 $mid_cost[$index][3]=(integer)fgets($fp1,4);
 $pac_cost[$index][4]=(integer)fgets($fp1,4);
 printf(%1s - %10s %10s %10s %10s %10s, $code[$index],
 $name[$index], $nat_cost[$index][1], $east_cost[$index][2],
 $mid_cost[$index][3], $pac_cost[$index][4]);
 print br;
 }
 return;
 }

 function inquiry($fp2,$date,$name,$code)
 {
   while(!feof($fp2))

   $cust_name=trim(fgets($fp2,12));
   $cust_area=trim(fgets($fp2,9));
   $cust_code=trim(fgets($fp2,6));

   if($cust_code==$code[$index])
   {
   $row=$index;
   }

 switch($cust_area)
 {
 case National:
 print nationalbr;

 printf(%1s %1f, $name[$row], $cust_cost[$row][1]);
 break;

 case East:
 printEastbr;

 printf(%1s %1f, $name[$row], $cust_cost[$row][2]);
 break;

 case Midwest:
 printmidwestbr;

 printf(%1s %1f, $name[$row], $cust_cost[$row][3]);
 break;

 case Pacific:
 printpacificbr;

 printf(%1s %1f, 

[PHP] Re: byte order of integers

2002-05-15 Thread Austin Marshall

decbin() will convert an integer to it's corresponding binary 
representation of 32 bits.  Divide that into 4 groups and you have it 
separated into bytes.

John Horton wrote:
 Hi!
 Is there any way of decomposing an integer into it's constituent bytes so
 that a new byte order can be created?
 tia
 JohnH
 
 John Horton
 Software Engineer
 BITbyBIT International Limited 
 [EMAIL PROTECTED]
 
 Tel: + 44 (0) 1865 865400 
 Fax: + 44 (0) 1865 865450
 www.bitbybit.co.uk 
 
 Disclaimer: 
 Internet communications are not secure and BitbyBit does not accept any
 legal responsibility for the content of this message.  Any views or opinions
 presented are solely those of the author and do not necessarily represent
 those of BitbyBit International Limited.  If you have received this email in
 error, please reply to the sender or call +44(0)1865 865400 and delete all
 copies of this mail.
 




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




Re: [PHP] trans-sid .. help

2002-05-15 Thread Jason Wong

On Thursday 16 May 2002 00:04, Joshua E Minnie wrote:
 I have been using some simple session management for some of my pages.  I
 am inquiring about the use of transparent session id usage.  I have read
 the manual and I am still a little confused on how to go about using it.

 I did run phpinfo() to make sure that trans-id was enabled.  It outputed:
 session.use_trans_id[local value] 1[master value] 1

 I am assuming that this means it is enabled.  Now my question is how do I
 go about using a trans-id?  I've seen session id appended to the URL (i.e.
 this.php?PHPSESSID=a2604374903c616c9cd34e13c0ceed98), but would like to use
 it without disclosing the session id in the URL.  If anyone could give me
 some sample code to help me alleviate the confusion, it will be greatly
 appreciated.

The whole point of transparent session id is that it doesn't rely on cookies 
being set on the client browser. Thus it /has/ to propagate the session id 
via the URL and through hidden values in forms. Both of these happens 
automatically.

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
Fascinating, a totally parochial attitude.
-- Spock, Metamorphosis, stardate 3219.8
*/


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




[PHP] security checks with sessions...

2002-05-15 Thread Jas

I am wondering if someone can help me understand a good way to use sessions
to check to see if a user has entered a user name and password before
allowing them to view the rest of the page.  I need to have this check on
each page, just not sure how I can pass the sessions to each page, as of yet
I can get the variables I have registered to pass from the login form to the
login check, and from there it seems to drop the session variable I
registered.  Any pointers would be great!
Thanks in advance,
Jas



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




[PHP] Finding out what week it is

2002-05-15 Thread David Orn Johannsson

Is there any way to determin what week of the year it is, for example to
day it is the 20th week of the year.
 
Thanks
 
 http://www.atom.is/ 
Davíð Örn Jóhannssson
Vefforritari

Atómstöðin hf.
Austurstræti 12
101 Reykjavík

sími: 520-8105 
 mailto:[EMAIL PROTECTED] [EMAIL PROTECTED]
 http://www.atom.is/ http://www.atom.is

 



Re: [PHP] Finding out what week it is

2002-05-15 Thread PHP lists

$week = date(W);

DOJ Is there any way to determin what week of the year it is, for example to
DOJ day it is the 20th week of the year.
 
DOJ Thanks
 
DOJ  http://www.atom.is/ 
DOJ Davíð Örn Jóhannssson
DOJ Vefforritari
DOJ 
DOJ Atómstöðin hf.
DOJ Austurstræti 12
DOJ 101 Reykjavík
DOJ 
DOJ sími: 520-8105 
DOJ  mailto:[EMAIL PROTECTED] [EMAIL PROTECTED]
DOJ  http://www.atom.is/ http://www.atom.is
DOJ 


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




Re[2]: [PHP] PHP 4.2.1 release announcement

2002-05-15 Thread Olexandr Vynnychenko

Hello Steve,

Tuesday, May 14, 2002, 6:28:06 PM, you wrote:

SB Sorry, I forgot to move my php4ts.dll to the windows/system32 directory.

SB Steve
SB ---snip---
SB I know that I just saw something like this last week on the list, but can't 
SB find it now.  Anyway, I have just installed PHP 4.2.1 on my WinXP laptop 
SB running Apache 1.3.23.  phpinfo() is still showing 4.1.2.  I think I 
SB remember something about a dll that needs to be deleted or something like 
SB that.  Can anybody let me know how to fix this?
SB ---snip---

The best way is not to move any .dll from php directory. Just add all
the directories containing needed dlls in the PATH environment
variable. And it will be ok with upgrading.

-- 
Best regards,
 Olexandrmailto:[EMAIL PROTECTED]


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




Re: [PHP] Finding out what week it is

2002-05-15 Thread PHP List

but remember, this wasn't added until PHP version 4.1.0

Jim Lucas
www.zonedzero.net
www.giantmaps.com

- Original Message -
From: PHP lists [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, May 15, 2002 9:43 AM
Subject: Re: [PHP] Finding out what week it is


 $week = date(W);

 DOJ Is there any way to determin what week of the year it is, for example
to
 DOJ day it is the 20th week of the year.

 DOJ Thanks

 DOJ  http://www.atom.is/ 
 DOJ Davíð Örn Jóhannssson
 DOJ Vefforritari
 DOJ 
 DOJ Atómstöðin hf.
 DOJ Austurstræti 12
 DOJ 101 Reykjavík
 DOJ 
 DOJ sími: 520-8105
 DOJ  mailto:[EMAIL PROTECTED] [EMAIL PROTECTED]
 DOJ  http://www.atom.is/ http://www.atom.is
 DOJ 


 --
 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] building php

2002-05-15 Thread Michal Dvoracek

Hello,

i can't get php binary when installing php on my server.
my configure:
./configure --prefix=/usr/local \
--with-config-file-path=/usr/local/etc \
--with-openssl=/usr/local \
--with-zlib-dir=/usr/local \
--with-zlib=/usr/local \
--with-bz2=/usr/local \
--with-mysql=/usr/local \
--with-apache=../apache_1.3.24 \
--with-zip=/usr/local \
--enable-calendar \
--enable-sockets \
--with-mod_charset \
--without-pear


configure pass with no errors, make too
make install - module is installed, everything is ok but no php binary
is installed.

when i type make php i got:
/bin/sh /usr/local/src/php-4.2.0/libtool --silent --mode=link gcc -I. 
-I/usr/local/src/php-4.2.0/ -I/usr/local/src/php-4.2.0/main -I/usr/local/src/php-4.2.0 
-I/usr/local/src/apache_1.3.24/src/include -I/usr/local/src/apache_1.3.24/src/os/unix 
-I/usr/local/src/php-4.2.0/Zend -I/usr/local/include -I/usr/local/include/mysql 
-I/usr/local/src/php-4.2.0/ext/xml/expat  -I/usr/local/src/php-4.2.0/TSRM -g -O2   -o 
php -export-dynamicstub.lo libphp4.la
/usr/lib/crt1.o: In function `_start':
/usr/lib/crt1.o(.text+0x18): undefined reference to `main'
collect2: ld returned 1 exit status
make: *** [php] Error 1


Can you help me please ? (I urgent need php binary to execute some
scripts from crontab)

Thank you.

Regards,
Michal Dvoracek  [EMAIL PROTECTED]


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




[PHP] header() -- function failed to due caching.

2002-05-15 Thread Scott Fletcher

I tried to use this script but it failed due to the caching.  Does
anyone know the way around hte problem or have a solution to the problem?

--- example script 
  $url_address = $GLOBALS[HTTP_HOST];

   switch ($url_address) {
   case www.php.net:
   $url_address = http://www.php.net/db2admin/db2_cleanup.php;;
   break;
   case test.php.net:
   $url_address = https://test.php.net/db2admin/db2_cleanup.php;;
   break;
   default:
   $url_address =  Undefined Url Address ;
   echo $url_address;
   break;
   }
header(Location: $url_address);

--- example script end 



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




[PHP] php-4.2.1-Win32.zip has been changed

2002-05-15 Thread Olexandr Vynnychenko

  I noticed that php-4.2.1-Win32.zip on www.php.net has been changed
  since I began downloading. So I downloaded it again. But what for?
  And why wasn't we all notified about that? If I completed
  downloading a little bit earlier I had a different release. I think
  people must be notified about such things.

-- 
Best regards,
 Olexandr  mailto:[EMAIL PROTECTED]


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




[PHP] tag img and php

2002-05-15 Thread Maciej Przybycien


Hi,
I included php file as html img:
img src=/smtMonitoring/jpgraph_cache/try_param.php width=340
height=240 
and Netscape brawser seems not to interpret that. However if I change 
try_param.php - try_param.png then image can be desplayed. 

According to the documentation 'try_param.php' should be interpereted
fine. 
What could be the problem?

 Thank you,
Maciek



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




RE: [PHP] XML: Similiar Multiple Tags With Different Data

2002-05-15 Thread Sebastian A.

I hope I didn't sound impolite, I really didn't mean to offend you, because
if it weren't for your tutorial I would probably still be trying to figure
out how to parse attributes and get XML Content into variables. Anyway, the
performance and efficiency doesn't really interest me at this point. I just
want to get the thing working before I work on improving it. What I really
want to do is build up to a full time XML Database application. I know a
flat file XML DB won't be as fast as mySQL, but the entries can be edited
with any text editor, and ported to any platform, and it will be fairly easy
to do. I just have to get the hang of XML Parsing and I will be half way
there.
Anyway, you asked What's the point of doing the if == 'LIST_ITEM' check in
the character handler rather
than the end handler?, well the point is that if it is LIST_ITEM I want to
the content in a variable. As far as I know this cannot be done in the end
handler. Second of all the array_push is there for a reason I am not even
sure about, but when I try to remove it the code doesn't work. I will
experiment later with alternatives, but for now my main concern is what I
previously mentioned: Getting the different values from the same XML tag
into an array.

PS:  Please be polite.  Don't top post and only include immediately
relevant portions
from prior emails.




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




Re: [PHP] security checks with sessions...

2002-05-15 Thread Edward Marczak

On 5/15/02 12:38 PM, Jas [EMAIL PROTECTED] pressed the keys forming the
message:

 I am wondering if someone can help me understand a good way to use sessions
 to check to see if a user has entered a user name and password before
 allowing them to view the rest of the page.  I need to have this check on
 each page, just not sure how I can pass the sessions to each page, as of yet
 I can get the variables I have registered to pass from the login form to the
 login check, and from there it seems to drop the session variable I
 registered.  Any pointers would be great!
 Thanks in advance,

You need to use session_start(); on each page (in fact, it has to be the
very first thing).  That'll tell PHP to either look for an existing session,
or to start a new one.

To store variables for later use by the session, use $_SESSION[varname];

Now, when you say, I can get the variables I have registered to pass from
the login form to the login check, and from there it seems to drop the
session variable I registered, without looking at your code, it's tough to
tell what's going on.

I'm having a problem with Windows right now that is causing that same
problem.  Other problems would be:

- Not using session_start()

- Not storing the variables correctly for later retrieval (e.g. Using
$_SESSION).

- Not passing the session ID, either yourself or letting PHP do it.

Check the manual for the section on sessions.  It explains a lot.
-- 
Ed Marczak
[EMAIL PROTECTED]

P.S.  Some of this assumes PHP v 4.10 or greater.


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




Re: [PHP] XML: Similiar Multiple Tags With Different Data

2002-05-15 Thread Analysis Solutions

On Wed, May 15, 2002 at 07:49:58PM +0200, Sebastian A. wrote:

 performance and efficiency doesn't really interest me at this point. I just
 want to get the thing working before I work on improving it.

But your haste is making waste.  Even funnier, in your haste, you're making more work 
for yourself.


 Anyway, you asked What's the point of doing the if == 'LIST_ITEM' check in
 the character handler rather
 than the end handler?, well the point is that if it is LIST_ITEM I want to
 the content in a variable. As far as I know this cannot be done in the end
 handler.

That's why I temporarily store the content in the $CData array.  Then, when I get to 
the end handler, I extract the data from the $CData array, and do what is necessary 
with it.


 Second of all the array_push is there for a reason I am not even
 sure about, but when I try to remove it the code doesn't work.

But your code isn't working with it either.  It's adds a whole series of unnecessary 
steps.

Again, look at the tutorial, http://www.analysisandsolutions.com/code/phpxml.htm, and
modify ONLY what you need to.  In your case, the only thing you need to change is
adding a special case for 'LIST_ITEM' to the switch in the end handler function.  
THAT'S where you'll stick that stuff into the $p object you were trying to do in the
content handler.  Oh, of course, drop the case in that switch statement that don't
apply to your DTD, but that goes without saying.

Good luck,

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 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 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

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




RE: [PHP] XML: Similiar Multiple Tags With Different Data

2002-05-15 Thread Sebastian A.

Ok I see where you're going with this. Thanks a lot. I will be sure to
improvise my code.

-Original Message-
From: Analysis  Solutions [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 15, 2002 8:10 PM
To: PHP List
Subject: Re: [PHP] XML: Similiar Multiple Tags With Different Data

On Wed, May 15, 2002 at 07:49:58PM +0200, Sebastian A. wrote:

 performance and efficiency doesn't really interest me at this point. I
just
 want to get the thing working before I work on improving it.

But your haste is making waste.  Even funnier, in your haste, you're making
more work
for yourself.


 Anyway, you asked What's the point of doing the if == 'LIST_ITEM' check
in
 the character handler rather
 than the end handler?, well the point is that if it is LIST_ITEM I want
to
 the content in a variable. As far as I know this cannot be done in the end
 handler.

That's why I temporarily store the content in the $CData array.  Then, when
I get to
the end handler, I extract the data from the $CData array, and do what is
necessary
with it.


 Second of all the array_push is there for a reason I am not even
 sure about, but when I try to remove it the code doesn't work.

But your code isn't working with it either.  It's adds a whole series of
unnecessary
steps.

Again, look at the tutorial,
http://www.analysisandsolutions.com/code/phpxml.htm, and
modify ONLY what you need to.  In your case, the only thing you need to
change is
adding a special case for 'LIST_ITEM' to the switch in the end handler
function.
THAT'S where you'll stick that stuff into the $p object you were trying to
do in the
content handler.  Oh, of course, drop the case in that switch statement that
don't
apply to your DTD, but that goes without saying.

Good luck,

--Dan

--
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 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 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 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




[PHP] How program automatic 'filler forms' robots?

2002-05-15 Thread M

Hello, I am interested on some info - how do robots  work to fill web
forms authomatically?
Sometimes I notice a blurr code to be manually writen to avoid these
robots when filling forms, but I am interested in programm just one of
these machines. Is it necessary PHP of another script for this task?

Thank for any info

Mig




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




[PHP] newbie: dynamically building associative arrays

2002-05-15 Thread ROBERT MCPEAK

I'm trying to build what I think is an associative array from a set of
mySQL results.

It looks like this:

//First, a mySQL results loop for a select statement return unique
occurrences of data in the field term:

for ($i=0; $i $num_results; $i++)
 {
 $row = mysql_fetch_array($result);

echo $row[term];

//Then, within the loop, another search to find the number of
occurrences //of that result

$this_term[$i]=$row[term];
$this_query = select term from photoqueries where term = '$this_term'
order by term;
$this_result = mysql_query($this_query);
$this_num_results[$i] = mysql_num_rows($this_result);

}

//so, now I have 2 vars corresponding to each term value from the
table:  $this_term[i], and $this_num_results[i].  

That's where I get stuck!  How do I stick all of my $this_term and
$this_num_results values together in an array.  Once that is
accomplished, how do I then sort the array (descending) by the
$this_num_results values?

In short, what I'm trying to do is display a list of all term values
and the number of times that data appears in the table.  If I had a
table names containg these values:

bob
bob
joe
sue
fred
bob
sue
jane

The display I'm trying to build would look like this:

bob 3
sue 2
jane 1
joe 1

Any help is greatly appreciated, sincerely!

Thanks!



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




[PHP] array search in 2-D arrays

2002-05-15 Thread Pushkar Pradhan

I've a 2 D array and would like to search for vals. in the first dimension
only i.e.
myArray[0][0]
myArray[1][0]
myArray[2][0]
myArray[3][0]
.
.
.
and not in the elements myArray[0][1]

CODE:
for($l = 0; $l  count($layer); $l++) {
   $key = array_search($layer[$l], $layerDes);   // $layerDes is 2-D
   $layer[$l] = $layerNames[$key];
}
My $key is FALSE/0 after execution, is it because the elements are in
$layerDes[i][0]?
Using $key === also didn't help? Any ideas, thanks.


-Pushkar S. Pradhan


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




Re: [PHP] Using Sessions under Win98/Apache

2002-05-15 Thread 1LT John W. Holmes

You probably want to get 4.2, or 4.2.1 if it's out.

How are you registering variables for the session? Is register_globals on or
off in your php.ini.

If it's off, you register a variables just by using
$_SESSION[var] = value;
instead of using
session_register(var);
$var = value;

If register globals is on, then use the second method with
session_register().

This is all after you call session_start, of course.

---John Holmes...

- Original Message -
From: Edward Marczak [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, May 15, 2002 12:04 PM
Subject: [PHP] Using Sessions under Win98/Apache


 I've been developing a PHP driven site that will ultimately run under
 Solaris and Linux - no problems there.

 But I set up a small development/test environment on my laptop running
 Win98.  Downloaded the PHP binary (v 4.1.2) along with Apache (v 1.3.24)
and
 MySQL.  Everything works greatalmost.

 Sessions aren't working for some reason.  Yes, they're enabled in my
php.ini
 file (and running a php_info() confirms that session support is enabled).
 The odd thing is, is that it will create the 'sess_038d7' file.  Just
no
 data goes into it.

 Yes, I'm running the exact same code against it that I'm running against
the
 Solaris and Linux PHP.

 Is there something different about the Windows version that I don't know
 that is causing my sessions to not work?

 Thanks!
 --
 Ed Marczak
 [EMAIL PROTECTED]


 --
 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] tag img and php

2002-05-15 Thread 1LT John W. Holmes

Yes, that does work, but the big question is if try_param.php is outputting
an image? How are you doing it? Are you setting the appropriate headers()?

---John Holmes...

- Original Message -
From: Maciej Przybycien [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, May 15, 2002 1:38 PM
Subject: [PHP] tag img and php



 Hi,
 I included php file as html img:
 img src=/smtMonitoring/jpgraph_cache/try_param.php width=340
 height=240 
 and Netscape brawser seems not to interpret that. However if I change
 try_param.php - try_param.png then image can be desplayed.

 According to the documentation 'try_param.php' should be interpereted
 fine.
 What could be the problem?

  Thank you,
 Maciek



 --
 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] newbie: dynamically building associative arrays

2002-05-15 Thread 1LT John W. Holmes

Heh...you have to learn some SQL!!

Try this query:

SELECT term, count(*) AS cnt FROM table GROUP BY term;

---John Holmes...

- Original Message - 
From: ROBERT MCPEAK [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, May 15, 2002 2:16 PM
Subject: [PHP] newbie: dynamically building associative arrays


 I'm trying to build what I think is an associative array from a set of
 mySQL results.
 
 It looks like this:
 
 //First, a mySQL results loop for a select statement return unique
 occurrences of data in the field term:
 
 for ($i=0; $i $num_results; $i++)
  {
  $row = mysql_fetch_array($result);
 
 echo $row[term];
 
 //Then, within the loop, another search to find the number of
 occurrences //of that result
 
 $this_term[$i]=$row[term];
 $this_query = select term from photoqueries where term = '$this_term'
 order by term;
 $this_result = mysql_query($this_query);
 $this_num_results[$i] = mysql_num_rows($this_result);
 
 }
 
 //so, now I have 2 vars corresponding to each term value from the
 table:  $this_term[i], and $this_num_results[i].  
 
 That's where I get stuck!  How do I stick all of my $this_term and
 $this_num_results values together in an array.  Once that is
 accomplished, how do I then sort the array (descending) by the
 $this_num_results values?
 
 In short, what I'm trying to do is display a list of all term values
 and the number of times that data appears in the table.  If I had a
 table names containg these values:
 
 bob
 bob
 joe
 sue
 fred
 bob
 sue
 jane
 
 The display I'm trying to build would look like this:
 
 bob 3
 sue 2
 jane 1
 joe 1
 
 Any help is greatly appreciated, sincerely!
 
 Thanks!
 
 
 
 -- 
 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] Uploading JPEG's - Security Issues?

2002-05-15 Thread Miguel Cruz

On Tue, 14 May 2002, Andre Dubuc wrote:
 My question will probably expose my woeful lack understanding of security 
 breaches, but perhaps someone can enlighten me.
 
 On my site, registered members will be allowed to upload jpg/jpeg 
 pictures. I'm concerned about possible security problems. First, is there a 
 way to ensure that a picture (and not some other malicious stuff) has been 
 uploaded? 
 
 Aside from checking the mime type info associated with the file, is there any 
 way of verifying what's in the file that has been uploaded? (I'm using Linux 
 LM8.2) Would it be possible to fake info to fool this check? Would 
 verification checks for html/scripts/commands be of any use?

You can pass the path to the unix command 'file' which looks at the file's 
prologue to attempt to figure out what it is. This is usually a pretty 
good way to weed out trouble.

  http://www.doc.ic.ac.uk/lab/labman/lookup-man.cgi?file

miguel


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




Re: [PHP] array search in 2-D arrays

2002-05-15 Thread Pushkar Pradhan

Oops! Sorry I got a reply for this but didn't read my mail carefully
enough. Thanks to Tim Ward for pointing out the problem.
 I've a 2 D array and would like to search for vals. in the first dimension
 only i.e.
 myArray[0][0]
 myArray[1][0]
 myArray[2][0]
 myArray[3][0]
 .
 .
 .
 and not in the elements myArray[0][1]

 CODE:
 for($l = 0; $l  count($layer); $l++) {
$key = array_search($layer[$l], $layerDes);   // $layerDes is 2-D
$layer[$l] = $layerNames[$key];
 }
 My $key is FALSE/0 after execution, is it because the elements are in
 $layerDes[i][0]?
 Using $key === also didn't help? Any ideas, thanks.


 -Pushkar S. Pradhan


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


-Pushkar S. Pradhan



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




[PHP] Re: header() -- function failed to due caching.

2002-05-15 Thread Scott Fletcher

Never mind, I'll just javascript instead!   location.replace('url');
Scott Fletcher [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I tried to use this script but it failed due to the caching.  Does
 anyone know the way around hte problem or have a solution to the problem?

 --- example script 
   $url_address = $GLOBALS[HTTP_HOST];

switch ($url_address) {
case www.php.net:
$url_address = http://www.php.net/db2admin/db2_cleanup.php;;
break;
case test.php.net:
$url_address = https://test.php.net/db2admin/db2_cleanup.php;;
break;
default:
$url_address =  Undefined Url Address ;
echo $url_address;
break;
}
 header(Location: $url_address);

 --- example script end 





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




Re: [PHP] How program automatic 'filler forms' robots?

2002-05-15 Thread 1LT John W. Holmes

Well, the robots we have in the Army are controlled by wireless neural
networks run by tiny chips implanted into our brains while at basic
training. This controls the army of robots hidden under the mountains of
Colorado that actually do all of our typing for us...

anyway...

You need to get a little more specific. Is this a specific form, or do you
want to be able to post any form? What kind of script is processing the
form? Is it looking for GET or POST data? GET data is as simple as creating
a URL with the nec. fields. POST is a little harder, but just required you
to send the appropriate headers with the data. filling out a form isn't
much different than any other web request. The data just included in the
URL or in the headers, and the action page of the form processes that
data...

---John Holmes...

- Original Message -
From: M [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, May 15, 2002 2:20 PM
Subject: [PHP] How program automatic 'filler forms' robots?


 Hello, I am interested on some info - how do robots  work to fill web
 forms authomatically?
 Sometimes I notice a blurr code to be manually writen to avoid these
 robots when filling forms, but I am interested in programm just one of
 these machines. Is it necessary PHP of another script for this task?

 Thank for any info

 Mig




 --
 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] Formatting Time

2002-05-15 Thread Devin Atencio


I want to a kewl script that will format time from seconds. I have a script
that returns the number of seconds a person has been an employee and
I want to format it in human readable format like:

1 year 6 months 14 days, etc.

Any help would be appreciated it.





Re: [PHP] building php

2002-05-15 Thread Miguel Cruz

On Wed, 15 May 2002, Michal Dvoracek wrote:
 i can't get php binary when installing php on my server.
 my configure:
 ./configure --prefix=/usr/local \
 --with-apache=../apache_1.3.24 \

 configure pass with no errors, make too
 make install - module is installed, everything is ok but no php binary
 is installed.

When you say --with-apache, that's telling it you want to build a module 
for Apache rather than a standalone binary. Take that parameter out of 
your configure line.

miguel


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




[PHP] php and servlets (fwd)

2002-05-15 Thread Maciej Przybycien



The problem seems to come because I generate html and include 
img src=/smtMonitoring/jpgraph_cache/try_param.php  ...
from Java servlets. 

If my 'img src=/smtMonitoring/jpgraph_cache/try_param.php ..'
is included in html file and I load that html the image appears on the
screen with no problem.

Do I need any special php compilation or support for Java servlets?

   Thanks,
 Maciej


On Wed, 15 May 2002, 1LT John W. Holmes wrote:

 Yes, that does work, but the big question is if try_param.php is outputting
 an image? How are you doing it? Are you setting the appropriate headers()?
 
 ---John Holmes...
 
 - Original Message -
 From: Maciej Przybycien [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Wednesday, May 15, 2002 1:38 PM
 Subject: [PHP] tag img and php
 
 
 
  Hi,
  I included php file as html img:
  img src=/smtMonitoring/jpgraph_cache/try_param.php width=340
  height=240 
  and Netscape brawser seems not to interpret that. However if I change
  try_param.php - try_param.png then image can be desplayed.
 
  According to the documentation 'try_param.php' should be interpereted
  fine.
  What could be the problem?
 
   Thank you,
  Maciek
 
 
 
  --
  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] PhP 4.2.1 (and various)

2002-05-15 Thread Miguel Cruz

On Wed, 15 May 2002, Olav Bringedal wrote:
 That is all well, but if php 4.2.1 interprets any
 output (as errors not only screen errors) as something
 that is sent before a header in a redirect, there is
 no other way (that i'm aware of) around it. 
 
 Like this:
 
 $user=$Session[user];
 if(!$Authorized)
 {
   header (Location: http://jaggu.org;);
 }
 this will not work, you have to write:
  
 $user=@$Session[user];
 if(!$Authorized)
 {
   header (Location: http://jaggu.org;);
 }
 
 To actually get the redirect. 

That's not new to 4.2.1.

The solution remains the same as always: Choose between either:

A) Using output buffering; or

B) Make sure you don't generate any output before sending headers. You 
don't need to stick  in front of everything, just eliminate all errors 
from your code and then make sure you aren't printing stuff.

For better or worse, there's no scapegoat here.

miguel


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




  1   2   >