Re: [PHP] HTTP or HTTPS

2003-04-05 Thread Rasmus Lerdorf
I usually just use $_SERVER['SERVER_PORT']

-Rasmus

On Sat, 5 Apr 2003, Alexander Weber wrote:

 Unfortunally is not set. It's like the variable does not exist, because when
 I extract the varaible $_SERVER with foreach I don't get HTTPS as key, only
 SERVER_PROTOCOL.

 I'm using PHP 4.3.1 as Apache2 Module on Win2k SP3.
 register_globals OFF
 safe:mode OFF

 stunnel 4.04 on x86-pc-mingw32-gnu WIN32 with OpenSSL 0.9.7 31 Dec 2002

 If you need more info:

 ICQ 46858764.

 Thanx

 Alex

 John W. Holmes [EMAIL PROTECTED] schrieb im Newsbeitrag
 news:[EMAIL PROTECTED]
   anybody knows how to find out the connection type (http or httpS)?
  Tried
   out
   $HTTP_SERVER_VARS.
 
  $_SERVER['HTTPS'] will be set if it's over HTTPS.
 
  ---John W. Holmes...
 
  PHP Architect - A monthly magazine for PHP Professionals. Get your copy
  today. http://www.phparch.com/
 
 



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


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



RE: [PHP] Re: Found a bug in 4.2.3 re: TD and echo vs. ?php? [solved]

2003-04-05 Thread Daevid Vincent
HH! Now that makes perfect sense. 
Thank you Rasmus for that indepth reply and also the , vs . trick

 -Original Message-
 From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED] 
 Sent: Friday, April 04, 2003 10:11 PM
 To: Daevid Vincent
 Cc: [EMAIL PROTECTED]
 Subject: RE: [PHP] Re: Found a bug in 4.2.3 re: TD and echo 
 vs. ?php?
 
 
 You are getting completely mixed up.  Simplifying your example:
 
 function foo() { echo foo; }
 
 $a = TD.foo()./TD;
 
 Will you agree that this is bogus code?  foo() is not going to return
 anything, so the resulting value of $a is going to be TD/TD.
 Correct?  But while that assignment is happening the foo() 
 function echoes
 something, so you will see foo in the output, but it has 
 nothing to do
 with what ends up in $a.  Nothing changes when you change the 
 code to be:
 
 function foo() { echo foo; }
 
 echo TD.foo()./TD;
 
 The parser is going to build a string to be echoed since you used the
 string concatenation operator (dot).  While building that 
 string one of
 the components happen to output something, so that something will get
 output.  Then the string that was built will be output.  So 
 what you see
 is:
 
 fooTD/TD
 
 Perhaps it is clearer if we make the function return something:
 
 function foo() { echo foo; return bar; }
 
 echo TD.foo()./TD;
 
 What do you think the output will be here?  We build a string 
 out of the
 components, but while building, foo() happens to echo foo, then we
 finish constructing the string and output the final string.  
 So the result
 is:
 
fooTDbar/TD
 
 As someone else pointed out, if you use commas here, things 
 change a bit:
 
 function foo() { echo foo; }
 
 echo TD,foo(),/TD;
 
 The comma syntax for echo is basically a shortcut for executing echo
 multiple times.  The above is equivalent to writing:
 
 echo TD;
 echo foo();
 echo /TD;
 
 In this case things will be output in the correct order as we are no
 concatenating a bunch of parts to make a single string before 
 echoing it
 in this case.
 
 -Rasmus
 
 On Fri, 4 Apr 2003, Daevid Vincent wrote:
 
  Mmm. I'm still not following and not completely convinced.
 
  Changing echo alarmLightYMD(); to simply 
 alarmLightYMD(); in the bottom
  function doesn't print anything in the table cell at all 
 (for the first test
  case).
 
  While your idea at first makes sense and does seem like a 
 newbie mistake
  (and you are correct, I do have nested echo statements 
 come to think of
  it). What I don't get is why it's not consistent. 
 Expanding the relevant
  lines, it should be like this:
 
  echo TD.(echo IMG SRC='images/light_red.gif')./TD;
 
  Which fails, and the other line would be (which works):
 
  TD?php echo (echo IMG SRC='images/light_red.gif'); ?/TD
 
  In my book, they're both double echoing the output if you 
 will... Are you
  with me on that?
 
  So again, why does the second one work and the first one doesn't?
 
   -Original Message-
   From: Philip Hallstrom [mailto:[EMAIL PROTECTED]
   Sent: Friday, April 04, 2003 5:20 PM
   To: Daevid Vincent
   Cc: [EMAIL PROTECTED]
   Subject: [PHP] Re: Found a bug in 4.2.3 re: TD and echo 
 vs. ?php?
  
  
   It's a coding error... at least I think so.
  
   change alarmLightMySQL just return the results not echo
   them... echoing
   them doesn't make much sense inside another echo statement...
  
   On Fri, 4 Apr 2003, Daevid Vincent wrote:
  
Here, try this bullshit...
   
I can't upgrade to a more recent version as I'm not in
   control of the
server, but I've tried it with both 4.1.2 and 4.2.3 on
   linux with a RH
install. Can anyone confirm or dispute this bug exists in
   later versions?
   
How does a parsing error like this go un-noticed for so long?
   
Obviously I took out all the interesting stuff in the page
   and so that can't
be blamed. This is about as bare skeleton test case as 
 you can get.
   
*sigh*
   
snip
   
?php
function alarmLightYMD()
{
return IMG SRC='images/light_red.gif';
}
   
function alarmLightMySQL()
{
echo alarmLightYMD();
}
?
html
head
titleFUCKED UP PHP Bug #1234170238741023/title
/head
   
body
PHP Version 4.1.2BR
PHP Version 4.2.3BR
BR
Why the FUCK doesn't this work
P
TABLE BORDER=1
?php
for ($i = 0; $i  10; $i++ ) {
 echo TR;
echo TD.alarmLightMySQL()./TD;
echo TDthis fails!/TD;
 echo /TR;
}
?
/TABLE
   
HR
   
YET THIS DOES!
P
TABLE BORDER=1
?php for ($i = 0; $i  10; $i++ ) { ?
 TR
TD?php echo alarmLightMySQL(); ?/TD
TDthis works/TD
 /TR
?php } ?
 

[PHP] Query

2003-04-05 Thread Ajay Lal
 Can you please spend some time with my doubt...
 My query is that ...
 Is there any option or function in PHP to implement
 automatic updation of web pages with the latest
 contents from other sites. Like news from news sites etc.
 Or do you have any idea about doing it.
 Thank you for spending your valuable time for me
 Expecting your helpful reply

Ajay Lal C M
iPath India Pvt.Ltd
G-358, Panampilly Nagar
Cochin-36
www.ipathindia.com

Re: [PHP] Bug ?

2003-04-05 Thread David Otton
On Sat, 5 Apr 2003 09:40:19 +0300, you wrote:

I tried something like this:

?
$arrayA = array(5,4,3,2,1);
$arrayB = $arrayA;
array_multisort($arrayA);
echo $arrayA[0], br;
echo $arrayB[0];
?


The output is:
1
1

I think it should be:
1
5

It's not a bug (ie this is expected behaviour in PHP4 for various
sensible reasons), but it can sometimes throw up odd effects if you're
not expecting it.

What you're running into here is the difference between a deep copy
(make a copy of a piece of memory) and a shallow copy (make two
variables point to the same piece of memory).

The way to think of it is that $arrayA doesn't actually contain your
array values - it contains a reference (a pointer in C-speak) to the
memory location where the array values are stored. The line

$arrayB = $arrayA;

is copying the reference, not the values. You can run up against this
behaviour in quite a few of the post-C++ languages, and it can be
disconcerting if you're used to languages where copies are all deep
unless flagged otherwise.

To add insult to injury, some array operations can implicitly cause a
deep copy to be made. Try this, which adds one extra line:

?
function echo_array($a) {
foreach ($a as $v) {
echo ($v);
echo (', ');
}
echo (br);
}
$arrayA = array(5,4,3,2,1);
$arrayB = $arrayA;
$arrayA[] = 6; // this line added
array_multisort($arrayA);
echo_array($arrayA);
echo_array($arrayB);
?

More details (maybe) here:

http://www.zend.com/zend/art/ref-count.php


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



Re: [PHP] Apache SetHandler

2003-04-05 Thread Zoff
Tom Rogers wrote:
Hi,

Saturday, April 5, 2003, 6:29:50 AM, you wrote:
Z Hi !
Z what i want is to write something in PHP which does authentication
Z (not basic auth but my own DB driven stuff) and after that something
Z apache resumes normal operation so that whatever is served afterwards
Z does not need to know anything of the auth process.
You would probably be better off using an apache module for this.
Something like Mod Auth MySQL It would be easy to make the module
set a few enviroment variables if you need to pass info to php.
yeah but my question is:
is it possible to write an apache module in PHP.
or do something real close to that ?
please some answer my question and don't give me something else i could do.
I am not a newbie i know what i need, and i also know what else i could use.
	thanks

	Zoff.

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


[PHP] Finding the height of a JPG in pixels using PHP

2003-04-05 Thread Phil Schwarzmann
I have JPG files stored as binary in a MySQL database.  I am displaying the
JPGs on the screen and also want to know the height (in pixels) of the JPG.
Can PHP do this?

 

Thanks!



Re: [PHP] Apache SetHandler

2003-04-05 Thread Rasmus Lerdorf
This can be done using the apache_hooks sapi module.  Look in
sapi/apache_hooks in the 4.3 sources for details.

-Rasmus

On Sat, 5 Apr 2003, Zoff wrote:

 Tom Rogers wrote:
  Hi,
 
  Saturday, April 5, 2003, 6:29:50 AM, you wrote:
  Z Hi !
 
  Z what i want is to write something in PHP which does authentication
  Z (not basic auth but my own DB driven stuff) and after that something
  Z apache resumes normal operation so that whatever is served afterwards
  Z does not need to know anything of the auth process.
 
  You would probably be better off using an apache module for this.
  Something like Mod Auth MySQL It would be easy to make the module
  set a few enviroment variables if you need to pass info to php.
 

 yeah but my question is:
 is it possible to write an apache module in PHP.
 or do something real close to that ?

 please some answer my question and don't give me something else i could do.
 I am not a newbie i know what i need, and i also know what else i could use.

   thanks

   Zoff.


 --
 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[2]: [PHP] Bug ?

2003-04-05 Thread Ciprian Trofin
David, thank you very much. I suspected smth. like this, but still, it is
weird: PHP already has the  operator (?) for assigning by reference. And
there is more: I noticed that if I use the sort function instead of
array_multisort, it works as expected.

I still think there is a bug involved :(

I tried something like this:

?
$arrayA = array(5,4,3,2,1);
$arrayB = $arrayA;
array_multisort($arrayA);
echo $arrayA[0], br;
echo $arrayB[0];
?


The output is:
1
1

I think it should be:
1
5

DO It's not a bug (ie this is expected behaviour in PHP4 for various
DO sensible reasons), but it can sometimes throw up odd effects if you're
DO not expecting it.

DO What you're running into here is the difference between a deep copy
DO (make a copy of a piece of memory) and a shallow copy (make two
DO variables point to the same piece of memory).

DO The way to think of it is that $arrayA doesn't actually contain your
DO array values - it contains a reference (a pointer in C-speak) to the
DO memory location where the array values are stored. The line

DO $arrayB = $arrayA;

DO is copying the reference, not the values. You can run up against this
DO behaviour in quite a few of the post-C++ languages, and it can be
DO disconcerting if you're used to languages where copies are all deep
DO unless flagged otherwise.

DO To add insult to injury, some array operations can implicitly cause a
DO deep copy to be made. Try this, which adds one extra line:

DO ?
DO function echo_array($a) {
DO foreach ($a as $v) {
DO echo ($v);
DO echo (', ');
DO }
DO echo (br);
DO }
DO $arrayA = array(5,4,3,2,1);
DO $arrayB = $arrayA;
DO $arrayA[] = 6; // this line added
DO array_multisort($arrayA);
DO echo_array($arrayA);
DO echo_array($arrayB);
?

DO More details (maybe) here:

DO http://www.zend.com/zend/art/ref-count.php




-- 
 Ciprian

 Un cuvant de sfarsit:
 A cynic knows the price of everything  value of nothing


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



[PHP] unsubscribe chris@lank.com

2003-04-05 Thread Chris Roumbanis
unsubscribe [EMAIL PROTECTED]
 
 
 
 


Re: Re[2]: [PHP] Bug ?

2003-04-05 Thread David Otton
On Sat, 5 Apr 2003 13:18:08 +0300, you wrote:

David, thank you very much. I suspected smth. like this, but still, it is
weird: PHP already has the  operator (?) for assigning by reference.

The reference operator

$b = $a;

forces $b and $a to be references to the same variable now and forever,
but the assignment operator

$b = $a;

may make $b and $a reference the same variable, but will make deep
copies of them when their values diverge.

At least that is my understanding.

And
there is more: I noticed that if I use the sort function instead of
array_multisort, it works as expected.
I still think there is a bug involved :(

Well... I hesitate to call it a bug because each function is working as
intended by its author. Idiosyncratic language design, maybe :)


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



Re: [PHP] Finding the height of a JPG in pixels using PHP

2003-04-05 Thread Andrew Brampton
You can use getimagesize on a jpg file to read its size, so either save the
jpg in MySQL to a file and then do a getImageSize, or before you place the
jpg in to the database read its size and store its dimensions with it in the
db.

Andrew
- Original Message -
From: Phil Schwarzmann [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, April 05, 2003 10:46 AM
Subject: [PHP] Finding the height of a JPG in pixels using PHP


 I have JPG files stored as binary in a MySQL database.  I am displaying
the
 JPGs on the screen and also want to know the height (in pixels) of the
JPG.
 Can PHP do this?



 Thanks!




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



[PHP] If else.. display no picture..

2003-04-05 Thread fkeessen
Hi,

I'm trying to do the following.. When $stadpict is filled in it must display the 
picture (only the path to the picture is stored in Mysql). But when the string 
($stadpict) is empty then it must not display the picture (and also not display a box 
with a red cross in it (can't display picture! ;). The only thing i'm getting is an 
error message...

Parse error: parse error, unexpected T_STRING, expecting ',' or ';' 

Code;
?
// includes
include(../conf/config.php);

// open database connection
$connection = mysql_connect($host, $user, $pass) or die (Unable to connect!);

// select database
mysql_select_db($db) or die (Unable to select database!);
$stedenid=$_GET['stedenid'];

// generate and execute query
$query2 = SELECT stedenid, naamstad, stadomschrijvk, stadpict FROM steden WHERE 
stedenid = $stedenid;
$result2 = mysql_query($query2) or die (Error in query: $query2.  . mysql_error());
$row2 = mysql_fetch_object($result2);
if (mysql_num_rows($result2)  0)
{
?

font class=bold? echo $row2-naamstad; ? /font
brbr? echo $row2-stadpict; 
?

/td
/tr
 /table
 table cellspacing=0  width=405 cellpadding=0 border=0
tr style=padding-top:10
td width=139 valign=top style=padding-left:20
 ? 
   
while($row-$stadpict  0)
{
?
img src=../steden/images/? echo $row-stadpict; ? border=0 width=108 
height=160 alt=/td
?
}
 ?
td width=266 valign=top style=padding-right:10;padding-left:10? echo 
$row2-stadomschrijvk; 
}
else

{
Echo Geen informatie beschikbaar;
}
?


Thanks for helping me out!

Frank

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

[PHP] error while quering from MSSQL server from a Linux box

2003-04-05 Thread Dhaval
Hi All,

I m trying to build a drop down dynamically. I m quering fields from MSSQL
2000 Server. Now look wat is happning when i run my php from a Win2K PC and
from a Linux Box.

Linux Machine
ABIDA PARVEEN
AHMED HUSSAIN MOHD.HUSSAIN
AHMED HUSSAIN,MOHAMMED HUSSAIN
ANWAR USSAI
ARVINDER SINGHOHAMMED HUSSA
ASHA BHOSLEGHOHAMMED
ASHA BHOSLE ,GHULAM ALIUSSAN
ASHA BHOSLE,GHULAM ALIUSSAN
ASHOK KHOSLAHULAM ALI
ASHOK KHOSLA,SUMITA CHAKRABORTY SAME
BEGUM AKHTAR UMITA CHAKRA
BHUPINDER SINGHITA CHAKRAORT
BHUPINDER SINGH, MITHALEE SINGHSAME
BHUPINDER SINGH,MITALEEE SINGHSAME
C.H. ATMASINGH,MI
C.H.ATMASINGH,
CHHAYA GANGULI,IALEEE SI
CHITRA SINGHI,IALEE
CHITRA SINGH,JAGJIT SINGHSIGHSAME
DILRAAJ KAURJAGJIT SING


Win 2K Server

ABIDA PARVEEN
AHMED HUSSAIN MOHD.HUSSAIN
AHMED HUSSAIN,MOHAMMED HUSSAIN
ANWAR
ARVINDER SINGH
ASHA BHOSLE
ASHA BHOSLE ,GHULAM ALI
ASHA BHOSLE,GHULAM ALI
ASHOK KHOSLA
ASHOK KHOSLA,SUMITA CHAKRABORTY SAME
BEGUM AKHTAR
BHUPINDER SINGH
BHUPINDER SINGH, MITHALEE SINGH
BHUPINDER SINGH,MITALEE
C.H. ATMA
C.H.ATMA
CHHAYA GANGULI
CHITRA SINGH
CHITRA SINGH,JAGJIT SINGH
DILRAAJ KAUR


Values are getting cat after the original value. Can any one help in this.
I have tried using both sybase and mssql functions the results are the same.




Regards
Dhaval




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



RE: [PHP] If else.. display no picture..

2003-04-05 Thread John W. Holmes
 I'm trying to do the following.. When $stadpict is filled in it must
 display the picture (only the path to the picture is stored in Mysql).
But
 when the string ($stadpict) is empty then it must not display the
picture
 (and also not display a box with a red cross in it (can't display
picture!
 ;). The only thing i'm getting is an error message...
 
 Parse error: parse error, unexpected T_STRING, expecting ',' or ';'
 
 Code;
 ?
 // includes
 include(../conf/config.php);
 
 // open database connection
 $connection = mysql_connect($host, $user, $pass) or die (Unable to
 connect!);
 
 // select database
 mysql_select_db($db) or die (Unable to select database!);
 $stedenid=$_GET['stedenid'];
 
 // generate and execute query
 $query2 = SELECT stedenid, naamstad, stadomschrijvk, stadpict FROM
steden
 WHERE stedenid = $stedenid;
 $result2 = mysql_query($query2) or die (Error in query: $query2.  .
 mysql_error());
 $row2 = mysql_fetch_object($result2);
 if (mysql_num_rows($result2)  0)
 {
 ?
 
 font class=bold? echo $row2-naamstad; ? /font
 brbr? echo $row2-stadpict;
 ?
 
 /td
 /tr
  /table
  table cellspacing=0  width=405 cellpadding=0 border=0
 tr style=padding-top:10
 td width=139 valign=top style=padding-left:20
  ?
 
  while($row-$stadpict  0)
 {
 ?
 img src=../steden/images/? echo $row-stadpict; ? border=0
 width=108 height=160 alt=/td
 ?
 }
  ?
 td width=266 valign=top
style=padding-right:10;padding-left:10?
 echo $row2-stadomschrijvk;
 }
 else
 
 {
 Echo Geen informatie beschikbaar;

What is this line supposed to do? You're missing some quotes around your
string...

Next time it would be more helpful if you posted the _exact_ error
message along with the relevant line mentioned in the message and 5 or
so lines before that one. 

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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



[PHP] Force no Cache

2003-04-05 Thread Davíð Örn Jóhannsson
Is there any way in php to disable the users cache so that every time
you reload you fetch the newest version of the site?
 
 
Regards, David


Re: [PHP] Force no Cache

2003-04-05 Thread Rasmus Lerdorf
header('Cache-Control: no-cache, must-revalidate');
header('Pragma: no-cache');
header('Expires: Mon,26 Jul 1980 05:00:00 GMT');


On Sat, 5 Apr 2003, [iso-8859-1] Davíð Örn Jóhannsson wrote:

 Is there any way in php to disable the users cache so that every time
 you reload you fetch the newest version of the site?


 Regards, David


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



Re: [PHP] If else.. display no picture..

2003-04-05 Thread Rasmus Lerdorf
I would help if you told us which line the error was on

On Sat, 5 Apr 2003 [EMAIL PROTECTED] wrote:

 Hi,

 I'm trying to do the following.. When $stadpict is filled in it must display the 
 picture (only the path to the picture is stored in Mysql). But when the string 
 ($stadpict) is empty then it must not display the picture (and also not display a 
 box with a red cross in it (can't display picture! ;). The only thing i'm getting 
 is an error message...

 Parse error: parse error, unexpected T_STRING, expecting ',' or ';'

 Code;
 ?
 // includes
 include(../conf/config.php);

 // open database connection
 $connection = mysql_connect($host, $user, $pass) or die (Unable to connect!);

 // select database
 mysql_select_db($db) or die (Unable to select database!);
 $stedenid=$_GET['stedenid'];

 // generate and execute query
 $query2 = SELECT stedenid, naamstad, stadomschrijvk, stadpict FROM steden WHERE 
 stedenid = $stedenid;
 $result2 = mysql_query($query2) or die (Error in query: $query2.  . mysql_error());
 $row2 = mysql_fetch_object($result2);
 if (mysql_num_rows($result2)  0)
 {
 ?

 font class=bold? echo $row2-naamstad; ? /font
 brbr? echo $row2-stadpict;
 ?

 /td
 /tr
  /table
  table cellspacing=0  width=405 cellpadding=0 border=0
 tr style=padding-top:10
 td width=139 valign=top style=padding-left:20
  ?
  
 while($row-$stadpict  0)
 {
 ?
 img src=../steden/images/? echo $row-stadpict; ? border=0 width=108 
 height=160 alt=/td
 ?
 }
  ?
 td width=266 valign=top style=padding-right:10;padding-left:10? echo 
 $row2-stadomschrijvk;
 }
 else

 {
 Echo Geen informatie beschikbaar;
 }
 ?


 Thanks for helping me out!

 Frank



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



RE: [PHP] Force no Cache

2003-04-05 Thread John W. Holmes
 header('Cache-Control: no-cache, must-revalidate');
 header('Pragma: no-cache');
 header('Expires: Mon,26 Jul 1980 05:00:00 GMT');

Kind of a follow on question to this. If you use a method like this on
public web pages, does anyone know if it'll affect how search engines
index your page? Will they ignore it because it's expired? Thanks. 

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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



RE: [PHP] Force no Cache

2003-04-05 Thread Rasmus Lerdorf
On Sat, 5 Apr 2003, John W. Holmes wrote:

  header('Cache-Control: no-cache, must-revalidate');
  header('Pragma: no-cache');
  header('Expires: Mon,26 Jul 1980 05:00:00 GMT');

 Kind of a follow on question to this. If you use a method like this on
 public web pages, does anyone know if it'll affect how search engines
 index your page? Will they ignore it because it's expired? Thanks.

No, as far as I know at least google does not ignore cache-expired pages
like that.  There is a No-Archive meta tag you can put in your page to
tell it not to archive, or of course, you can robots.txt it.

-Rasmus

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



[PHP] Uploading a file from a specific directory

2003-04-05 Thread José RELLAND
With :
FORM ENCTYPE=multipart/form-data ACTION=_URL_ METHOD=POST
...
Envoyez ce fichier : INPUT NAME=userfile TYPE=file
...
/FORM

Is there a parameter wich indicates the directory
where the file must be uploaded ?

For example, from the root of my site.

Thank You




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



Re: [PHP] Redirect

2003-04-05 Thread Ron Rudman
I believe you can also prevent the header error by using ob_start();

Jean-Louis Letortorec [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 To work around that headers already sent problem, I use:

 if ($condition == true) { echo
 scriptlocation.href=('http://...');/script; }

 That works great all the time (unless the javascript has been disabled at
 the browser side, but usually it's enabled).


 Jean-Louis



 At 15:55 3-4-2003, you wrote:
 Hi,
 
 How would one redirect a user to a different page if a certain
 condition was met?
 
 i.e.
 
 if($condition == true){
  goTo newPage.php
 }

 if  ($condition == true)
  {
  Header(Location:

http://www.sense.nl/index.php?module=ContentExpressfunc=displayceid=15;);
  }

 take care that your script does not create any output before this,because
 then you will get an error (headers already sent)


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



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



[PHP] Re: file upload

2003-04-05 Thread Alexander Weber
Seems correct to me, try to upload the file with different browsers. Opera,
Netscape, M$. e.g. Rich Text could be: application/MSword, text/richtext,
and some other nice applications ;-)

Cheers,

Alex

Anders Thoresson [EMAIL PROTECTED] schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
 Am I making any obvious mistakes here, in my upload script? I want to
 upload text-files only, they should end up in the directory from which the
 script is executed and be names __traningsmatcher.txt.

 HTML-form:

 FORM ENCTYPE=multipart/form-data METHOD=POST ACTION=store.php
 TABLE
 INPUT NAME=max_file_size TYPE=hidden VALUE=300
 TR
 TDFil: /TD
 TDINPUT NAME=userfile TYPE=file/TD
 /TR
 TR
 TD/TD
 TDINPUT TYPE=submit VALUE= skicka /TD
 /TR
 /TABLE
 /FORM


 And php, on the recieving end:
 ?php

 // check and validate uploaded file

 if($_FILES['userfile'] == none) {
 die(Problem: Ingen fil uppladdad.);
 }


 if($_FILES['userfile']['size'] == 0) {
 die(Problem: Filen är tom.);
 }

 if($_FILES['userfile']['type'] != text/plain) {
 die(Problem: Filen är inte en textfil.);
 }


 if(!is_uploaded_file($_FILES['userfile']['tmp_name'])) {
 die(Problem: Filen är inte uppladdad);
 }

 $upfile = __traningsmatcher.txt;

 if(!copy($_FILES['userfile']['tmp_name'], $upfile)) {
 die(Kunde inte spara filen);
 }

 echo(Filen är sparad!);


 ?

 --
 anders thoresson



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



[PHP] Problems with fread()

2003-04-05 Thread MCConniffe
For some reason I can't seem to get fread() to work proeprly. Every time I
try to use it, my script simply exits with no output, errors, or logs of any
kind that I can find. It seems to work with fgets() just fine, but I need to
read in binary files. I'm currently running PHP 4.2.2 on Apache 2.0.40. I
have another server with a very similar configuration that works just fine
with the same scripts.

If anyone has any idea as to a possible solution to this problem please
e-mail me ([EMAIL PROTECTED]). I have already tried reinstalling Apache
AND PHP.



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



Re: [PHP] HTTP or HTTPS

2003-04-05 Thread Alexander Weber
But SERVER PORT is not always 80 using HTTP (not HTTPS). So this way is not
really secure.

Alex

Rasmus Lerdorf [EMAIL PROTECTED] schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
 I usually just use $_SERVER['SERVER_PORT']

 -Rasmus

 On Sat, 5 Apr 2003, Alexander Weber wrote:

  Unfortunally is not set. It's like the variable does not exist, because
when
  I extract the varaible $_SERVER with foreach I don't get HTTPS as key,
only
  SERVER_PROTOCOL.
 
  I'm using PHP 4.3.1 as Apache2 Module on Win2k SP3.
  register_globals OFF
  safe:mode OFF
 
  stunnel 4.04 on x86-pc-mingw32-gnu WIN32 with OpenSSL 0.9.7 31 Dec 2002
 
  If you need more info:
 
  ICQ 46858764.
 
  Thanx
 
  Alex
 
  John W. Holmes [EMAIL PROTECTED] schrieb im Newsbeitrag
  news:[EMAIL PROTECTED]
anybody knows how to find out the connection type (http or httpS)?
   Tried
out
$HTTP_SERVER_VARS.
  
   $_SERVER['HTTPS'] will be set if it's over HTTPS.
  
   ---John W. Holmes...
  
   PHP Architect - A monthly magazine for PHP Professionals. Get your
copy
   today. http://www.phparch.com/
  
  
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 



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



Re: [PHP] HTTP or HTTPS

2003-04-05 Thread Rasmus Lerdorf
Presumably you know the HTTPS port on your server.  Anything not SSL is
going to be straight HTTP.  The point here is that SSL happens a layer
below PHP.  PHP doesn't care whether it is running over SSL or not.  In
fact it has no idea what transport layer is below it.  So your only way to
tell is to depend on whatever the web server tells you.  Look at a
phpinfo() for both an SSL and a non-SSL request and see what the
differences are on your server.  For me, checking SERVER_PORT has been the
most portable/reliable mechanism.

-Rasmus



On Sat, 5 Apr 2003, Alexander Weber wrote:

 But SERVER PORT is not always 80 using HTTP (not HTTPS). So this way is not
 really secure.

 Alex

 Rasmus Lerdorf [EMAIL PROTECTED] schrieb im Newsbeitrag
 news:[EMAIL PROTECTED]
  I usually just use $_SERVER['SERVER_PORT']
 
  -Rasmus
 
  On Sat, 5 Apr 2003, Alexander Weber wrote:
 
   Unfortunally is not set. It's like the variable does not exist, because
 when
   I extract the varaible $_SERVER with foreach I don't get HTTPS as key,
 only
   SERVER_PROTOCOL.
  
   I'm using PHP 4.3.1 as Apache2 Module on Win2k SP3.
   register_globals OFF
   safe:mode OFF
  
   stunnel 4.04 on x86-pc-mingw32-gnu WIN32 with OpenSSL 0.9.7 31 Dec 2002
  
   If you need more info:
  
   ICQ 46858764.
  
   Thanx
  
   Alex
  
   John W. Holmes [EMAIL PROTECTED] schrieb im Newsbeitrag
   news:[EMAIL PROTECTED]
 anybody knows how to find out the connection type (http or httpS)?
Tried
 out
 $HTTP_SERVER_VARS.
   
$_SERVER['HTTPS'] will be set if it's over HTTPS.
   
---John W. Holmes...
   
PHP Architect - A monthly magazine for PHP Professionals. Get your
 copy
today. http://www.phparch.com/
   
   
  
  
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
  



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


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



[PHP] oci8

2003-04-05 Thread Paul Dymecki
Hello,
   Sorry for cross posting but i thought i'd get a better response.  I was 
just wondering if anyone has gotten oci8 working successfully on windows?  
I've been trying with not much luck.
thx,
Paul Dymecki



_
Protect your PC - get McAfee.com VirusScan Online  
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963

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


[PHP] mysl_connect question

2003-04-05 Thread [EMAIL PROTECTED]
When I use myssql to connect to a db with anything besides root I get an
error that I cannot connect.  I created a user that has access to one
databse called 'menu'. The user has SELECT, UPDATE, and DELETE permissions
for that database. 

I can connect on the command line: mysql-u newuser -p.  But no luck using
mysql_connect().

Anyone have this problem?


.T


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



[PHP] please help,newbie to sessions..

2003-04-05 Thread Kelly Meeks
Hi all,

I've pulled my hair out on this, so I'm turning to the experts.

I'm trying to make a directory of a site password protected:

http://www.ivepulledmyhairout.com/protected

I'm getting there from:

http://www.ivepulledmyhairout.com

I've got a login.php page that gets a username and password from dear valued users

It then posts that info to checklogin.php:

I'm using an older version of php 4.03 (please don't ask).

checklogin code 
---
?
session_start();
$connect=mysql_connect($bshostname,$bsusername,$bspassword);
$thedb=mysql_select_db($bsdatabase);
$thequery=select * from customer_acct_info where customer_password='$dealer_password' 
;
$thequery.= and customer_username='$dealer_username';
//query database based on submitted form vars..
$theresults=mysql_query($thequery) or die (mysql_error());
$row_count=mysql_num_rows($theresults);
$dealer_info=mysql_fetch_assoc($theresults);
if ($row_count!=0)
{
session_register('wholesaler');
$HTTP_SESSION_VARS['wholesaler']=$dealer_info;
header(Location:protected/index.php);
}
else
{
header(Location:login.php);
}

?
--

Once it goes to the protected directory, that directory's index page checks for the 
existence of that session var, if it doesn't find it, it jumps you back to the login 
screen.

index.php of protected directory:
?
session_start();
header(Cache-control: private);
if (isset($HTTP_SESSION_VARS['wholesaler']))
{
require('manage/bsinclude.inc'); 
require('manage/bsmenus.inc');
include ($bstemplate);
}
else
{
header(Location:../index.php?catcont=login);
} 
?

No matter what I do, I can't get the session variable to survive the transition from 
the checklogin.php page, to the index.php page of the protected directory!

On the checklogin.php page, instead of redirecting, i've tried 
print_r($HTTP_SESSION_VARS) after setting the session I need, and it seems to be there 
no problem.

If someone has been willing to read thru this tome, and can be of any help, I'd truly 
appreciate it.

Other questions re: sessions:

If you have a page that looks like

?
session_start();
include 'bla.php';
include 'bla2.php';
?

and you need to check for the exisistence of session data on the included pages, do 
you have to include session_start(); commands on the included pages?

Can you:

session_start();
$HTTP_SESSION_VARS['bla']=bla  

or do you have to 

session_start();
session_register('bla');
$HTTP_SESSION_VARS['bla']=bla

And:

Does using something header(Location:bla.php) screw up sessions somehow, even if you 
start the destination page with session_start() ?

Kelly









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



[PHP] Re: If else.. display no picture..

2003-04-05 Thread BAROILLER Pierre-Emmanuel

May be this line is wrong :
Echo Geen informatie beschikbaar;

may be use this instead...

echo 'Geen informatie beschikbaar';

no?

:)

regards.





[EMAIL PROTECTED] a écrit dans le message de news:
[EMAIL PROTECTED]
 Hi,

 I'm trying to do the following.. When $stadpict is filled in it must
display the picture (only the path to the picture is stored in Mysql). But
when the string ($stadpict) is empty then it must not display the picture
(and also not display a box with a red cross in it (can't display picture!
;). The only thing i'm getting is an error message...

 Parse error: parse error, unexpected T_STRING, expecting ',' or ';'

 Code;
 ?
 // includes
 include(../conf/config.php);

 // open database connection
 $connection = mysql_connect($host, $user, $pass) or die (Unable to
connect!);

 // select database
 mysql_select_db($db) or die (Unable to select database!);
 $stedenid=$_GET['stedenid'];

 // generate and execute query
 $query2 = SELECT stedenid, naamstad, stadomschrijvk, stadpict FROM steden
WHERE stedenid = $stedenid;
 $result2 = mysql_query($query2) or die (Error in query: $query2.  .
mysql_error());
 $row2 = mysql_fetch_object($result2);
 if (mysql_num_rows($result2)  0)
 {
 ?

 font class=bold? echo $row2-naamstad; ? /font
 brbr? echo $row2-stadpict;
 ?

 /td
 /tr
  /table
  table cellspacing=0  width=405 cellpadding=0 border=0
 tr style=padding-top:10
 td width=139 valign=top style=padding-left:20
  ?
while($row-$stadpict  0)
 {
 ?
 img src=../steden/images/? echo $row-stadpict; ? border=0
width=108 height=160 alt=/td
 ?
 }
  ?
 td width=266 valign=top style=padding-right:10;padding-left:10?
echo $row2-stadomschrijvk;
 }
 else

 {
 Echo Geen informatie beschikbaar;
 }
 ?


 Thanks for helping me out!

 Frank




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



[PHP] RE: newbie alternate row colours in dynamic table

2003-04-05 Thread Bobby Rahman


Hiya I have a dynamic table and am trying to get the rows to be two 
different alternate colours. well Ive looked at a couple of snippets of this 
colour code and previous mails regarding this. Im having major troubles 
intergrating any of these suggestions with my code. Can anyone suggest where 
I am going wrong. Main problems are
1. where to put the loop for changing the colour (complicated due to the 
loop retrieving data from db)i.e in the do loopin the while loop?

2. Also how to echo my rows in the colours.(something like this I think)
print tr bgcolor='$trcolor'$db_fetch['bugid']; ?/td;
e.g here is the code snippet for alternate coloured rows
$trcolor=#F0F8FF;
while ($myrow = mysql_fetch_array($result)){
$colorset=0;
if ($trcolor=='#F0F8FF'){
$trcolor='#B0C4DE';
$colorset=1;
}
if ($colorset==0){
if ($trcolor=='#B0C4DE'){
$trcolor='#F0F8FF';}
}
print tr bgcolor='$trcolor';
}


I have included my table file.  Any suggestions would be great (even further 
suggestions of code snippets I can look at)

thanx

here is my table.:
?
require_once('db_api.php');
db_connect();
$querystring= SELECT * FROM bug;
$db_result = mysql_query($querystring) or die(mysql_error());
$db_fetch = mysql_fetch_assoc($db_result);
$db_totalrows = mysql_num_rows($db_result);
//echo $db_totalrows;
?
html
head
titleUntitled Document/title
meta http-equiv=Content-Type content=text/html; charset=iso-8859-1
/head
body bgcolor=#FF text=#00
pnbsp;/p
table  border=2 cellspacing=2 bgcolor=#FF
 tr
   td colspan=9 bgcolor=#FFnbsp;/td
 /tr
 tr
   td bordercolor=#99font size=-1 face=Verdana, Arial, 
Helvetica, sans-serifbugid/font/td
   td bordercolor=#99font size=-1 face=Verdana, Arial, 
Helvetica, sans-serifstatus/font/td
   td bordercolor=#99font size=-1 face=Verdana, Arial, 
Helvetica, sans-serifseverity/font/td
   td bordercolor=#99font size=-1 face=Verdana, Arial, 
Helvetica, sans-serifsummary/font/td
   td bordercolor=#99font size=-1 face=Verdana, Arial, 
Helvetica, sans-serifdescription/font/td
   td bordercolor=#99font size=-1 face=Verdana, Arial, 
Helvetica, sans-serifdate_opened/font/td
   td bordercolor=#99font size=-1 face=Verdana, Arial, 
Helvetica, sans-serifestimation_completion/font/td
   td bordercolor=#99font size=-1 face=Verdana, Arial, 
Helvetica, sans-serifrelated_file/font/td
   td bordercolor=#99font size=-1 face=Verdana, Arial, 
Helvetica, sans-serifcreated_by/font/td
 /tr
 ? do { ?

td? echo $db_fetch['bugid']; ?/td
   td? echo $db_fetch['status']; ?/td
   td? echo $db_fetch['severity']; ?/td
   td? echo $db_fetch['summary']; ?/td
   td? echo $db_fetch['description']; ?/td
   td? echo $db_fetch['date_opened']; ?/td
   td? echo $db_fetch['estimated_completion']; ?/td
   td? echo $db_fetch['related_file']; ?/td
   td? echo $db_fetch['created_by']; ?/td
  tr
?
 } while ($db_fetch = mysql_fetch_assoc($db_result));
 ?
td colspan=9 bgcolor=#FFnbsp;/td
/table

pnbsp;/p
pnbsp;/p
/body
/html
?
mysql_free_result($db_result);
?


_
Overloaded with spam? With MSN 8, you can filter it out 
http://join.msn.com/?page=features/junkmailpgmarket=en-gbXAPID=32DI=1059

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


[PHP] RedHat

2003-04-05 Thread John Taylor-Johnston
Where would I go on the redHat site to ask when they are going to upgrade to PHP 4.3 
and MySQL 4.x (now in production). Our CS dept. won't install them for me until RedHat 
bundles it. I'm using RH 7.3.

http://www.netcraft.com/?host=compcanlit.usherbrooke.caposition=limited

Suggestions where to ask, to give them a nudge :) ?

--
John Taylor-Johnston
-
If it's not open-source, it's Murphy's Law.
Université de Sherbrooke:
http://compcanlit.ca/


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



Re: [PHP] RE: newbie alternate row colours in dynamic table

2003-04-05 Thread Chris Hayes
At 22:14 5-4-2003, you wrote:


Hiya I have a dynamic table and am trying to get the rows to be two 
different alternate colours. well Ive looked at a couple of snippets of 
this colour code and previous mails regarding this. Im having major 
troubles intergrating any of these suggestions with my code. Can anyone 
suggest where I am going wrong. Main problems are
1. where to put the loop for changing the colour (complicated due to the 
loop retrieving data from db)i.e in the do loopin the while loop?
Within the loop that prints the rows, whcih is usually a while loop. But 
that depends on your preferences.


2. Also how to echo my rows in the colours.(something like this I think)
print tr bgcolor='$trcolor'$db_fetch['bugid']; ?/td;
e.g here is the code snippet for alternate coloured rows
$trcolor=#F0F8FF;
while ($myrow = mysql_fetch_array($result)){
$colorset=0;
if ($trcolor=='#F0F8FF'){
$trcolor='#B0C4DE';
$colorset=1;
}
if ($colorset==0){
if ($trcolor=='#B0C4DE'){
$trcolor='#F0F8FF';}
}
print tr bgcolor='$trcolor';
}
I see that you are using a helping variable $colorset.
I have a problem reading your code in email, as i do not see hte indents 
well, so i restructure it here with _ underscores to make the indents 
survive the email program.

$trcolor=#F0F8FF; //1

while ($myrow = mysql_fetch_array($result))
{
___$colorset=0;
___if ($trcolor=='#F0F8FF')//1
___{$trcolor='#B0C4DE'; //2
$colorset=1;
___}
___if ($colorset==0)
___{ if ($trcolor=='#B0C4DE')   //2
__{$trcolor='#F0F8FF';   //1
__}
___}
print tr bgcolor='$trcolor';
}
Lets walk through.
In the 1st walk,
1a) you enter with color#1 and colorset=0.
2b) the first 'if' then sets it to color#2 and colorset=1
3c) The second if sees that both conditions are true and set the color back 
to color#1.

So the first row prints color1.

Ok. The code remembers the values, which are color#1 and colorset1.
In the next walkthrough,
2a) the colorset is set to 0 to start with.
At this moment you have the exact situation as with 1a).
do you see that? it would be much easier to see what is happening if you 
would have only colorset toggling its value and just before printing, 
decide what the color is as a result of the value of colorset.
Give it a try!

Basically:

$colorset=0;

while ()
{ toggle collorset (toggle: if 1 then 0 and opposite)
 if colorser=0 color=ff else color=a
 print color.
}
Chris Hayes













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


Re: [PHP] RE: newbie alternate row colours in dynamic table

2003-04-05 Thread Chris Hayes
sorry i see i made a bit too many ambiguous typing errors.

Hiya I have a dynamic table and am trying to get the rows to be two 
different alternate colours. well Ive looked at a couple of snippets of 
this colour code and previous mails regarding this. Im having major 
troubles intergrating any of these suggestions with my code. Can anyone 
suggest where I am going wrong. Main problems are
1. where to put the loop for changing the colour (complicated due to the 
loop retrieving data from db)i.e in the do loopin the while loop?
Within the loop that prints the rows, whcih is usually a while loop. But 
that depends on your preferences.


2. Also how to echo my rows in the colours.(something like this I think)
print tr bgcolor='$trcolor'$db_fetch['bugid']; ?/td;
e.g here is the code snippet for alternate coloured rows
$trcolor=#F0F8FF;
while ($myrow = mysql_fetch_array($result)){
$colorset=0;
if ($trcolor=='#F0F8FF'){
$trcolor='#B0C4DE';
$colorset=1;
}
if ($colorset==0){
if ($trcolor=='#B0C4DE'){
$trcolor='#F0F8FF';}
}
print tr bgcolor='$trcolor';
}
I see that you are using a helping variable $colorset.
I have a problem reading your code in email, as i do not see hte indents 
well, so i restructure it here with _ underscores to make the indents 
survive the email program.

$trcolor=#F0F8FF; //color#1

while ($myrow = mysql_fetch_array($result))
{
___$colorset=0;
___if ($trcolor=='#F0F8FF')//color#1
___{$trcolor='#B0C4DE'; //color#2
$colorset=1;
___}
___if ($colorset==0)
___{ if ($trcolor=='#B0C4DE')   //color#2
__{$trcolor='#F0F8FF';   //color#1
__}
___}
print tr bgcolor='$trcolor';
}
Lets walk through.
In the 1st walk,
1a) you enter with $trcolor=#1 and colorset=0.
2b) the first 'if' then sets it to $trcolor=#2 and colorset=1
3c) The second if sees that both conditions are true and set the color back 
to $trcolor=#1.

So the first row prints color1.

Ok. The code remembers the values, which are color#1 and colorset1.
In the next walkthrough,
2a) the colorset is set to 0 to start with.
At this moment you have the exact situation as with 1a). So the rest of the 
code will lead inevitably to the same color.
Do you see that?

It would be much easier to see what is happening if you would have only 
colorset toggling its value and just before printing, decide what the color 
is as a result of the value of colorset. You are doing trest on the color 
as well as the $colorset which is making the code very sensitive to errors, 
as well as difficult to understand.

Give it a try!

Basically:
(pseudocode)
$colorset=0;

while ()
{ toggle $colorset (toggle: if 1 then 0 and opposite)
 if ($colorset==0)  $trcolor=#ff;
 else   $trcolor=#a;
 print $trcolor.
}
Chris Hayes



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


RE: [PHP] Uploading a file from a specific directory

2003-04-05 Thread John W. Holmes
 With :
 FORM ENCTYPE=multipart/form-data ACTION=_URL_ METHOD=POST
 ...
 Envoyez ce fichier : INPUT NAME=userfile TYPE=file
 ...
 /FORM
 
 Is there a parameter wich indicates the directory
 where the file must be uploaded ?

The file is uploaded to the directory specified in php.ini. You must
move/copy it from there before the script ends. 

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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



Re: [PHP] RedHat

2003-04-05 Thread Larry E. Ullman
Where would I go on the redHat site to ask when they are going to 
upgrade to PHP 4.3 and MySQL 4.x (now in production). Our CS dept. 
won't install them for me until RedHat bundles it. I'm using RH 7.3.
This question would probably be best directed towards:
1) The RedHat site
2) A RedHat newsgroup
3) A RedHat mailing list
4) A RedHat forum
5) A RedHat __, not the PHP general mailing list (since your 
question concerns RedHat packages).

I expect that a RedHat support would be much more qualified to answer 
this question and your original one (when they'll upgrade).

Larry

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


Re: [PHP] RedHat

2003-04-05 Thread Scott St. John
John-

This would best be asked on a Red Hat list, but I can tell you that if you 
are using Red Hat 7.3 I would not really count on getting them to release 
PHP 4.3 as once a major Red Hat release is out they usually only provide 
security updates - NOT feature updates.

Red Hat also modifies the version numbers to reflect the security updates 
so if you have PHP 4.1 on Red Hat 7.3 it might be PHP 4.1.25 which is the 
Red Hat number.

You can look around on www.rpmfind.net or www.freshrpms.net for an updated 
PHP, but it may not be compatible with the Red Hat version you are 
running.

In the future if you want to count on program feature updates you would be 
best to install Apache, PHP and MySQL from source.

-Scott




On Sat, 5 Apr 2003, John Taylor-Johnston wrote:

 Where would I go on the redHat site to ask when they are going to upgrade to PHP 4.3 
 and MySQL 4.x (now in production). Our CS dept. won't install them for me until 
 RedHat bundles it. I'm using RH 7.3.
 
 http://www.netcraft.com/?host=compcanlit.usherbrooke.caposition=limited
 
 Suggestions where to ask, to give them a nudge :) ?

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



Re: [PHP] oci8

2003-04-05 Thread Jim Lucas
Just after we had a long discussion about off topic questions.  This one
doesn't even refer to a programming language problem.

Or am I missing someting?

Jim
- Original Message -
From: Paul Dymecki [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, April 05, 2003 10:30 AM
Subject: [PHP] oci8


 Hello,
 Sorry for cross posting but i thought i'd get a better response.  I
was
 just wondering if anyone has gotten oci8 working successfully on windows?
 I've been trying with not much luck.
 thx,
 Paul Dymecki




 _
 Protect your PC - get McAfee.com VirusScan Online
 http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963


 --
 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] mysl_connect question

2003-04-05 Thread Jim Lucas
did you reload mysql so it will have the new user?

Jim
- Original Message -
From: [EMAIL PROTECTED] [EMAIL PROTECTED]
To: php mailing list list [EMAIL PROTECTED]
Sent: Saturday, April 05, 2003 10:40 AM
Subject: [PHP] mysl_connect question


 When I use myssql to connect to a db with anything besides root I get an
 error that I cannot connect.  I created a user that has access to one
 databse called 'menu'. The user has SELECT, UPDATE, and DELETE permissions
 for that database.

 I can connect on the command line: mysql-u newuser -p.  But no luck using
 mysql_connect().

 Anyone have this problem?


 .T


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

2003-04-05 Thread Pete James
John,

I'm not sure if you've noticed, but pretty much every question you've 
asked on this list of late has received at least one comment about 
finding the appropriate resource.  If I were in your situation, I'd 
start to see a theme.

The PHP General mailing list is for questions about development with 
PHP, not about open source, licenses, distributions, or research papers. 
 If you develop with PHP and want to know why your code doesn't work, 
then you're in the right venue.  If you're researching options for a 
paper, or wondering how to do something not directly related to PHP 
coding, then you're not in the right venue.

The internet is a large place with lots of sources of information.  I 
would take a good look at what you're about to ask when you feel the 
urge to post here.  If you did that, you might see that it would be 
better to contact the PHP group about their licenses, or RedHat about 
their releases.

Pete.

Larry E. Ullman wrote:
Where would I go on the redHat site to ask when they are going to 
upgrade to PHP 4.3 and MySQL 4.x (now in production). Our CS dept. 
won't install them for me until RedHat bundles it. I'm using RH 7.3.


This question would probably be best directed towards:
1) The RedHat site
2) A RedHat newsgroup
3) A RedHat mailing list
4) A RedHat forum
5) A RedHat __, not the PHP general mailing list (since your 
question concerns RedHat packages).

I expect that a RedHat support would be much more qualified to answer 
this question and your original one (when they'll upgrade).

Larry




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


Re: [PHP] oci8

2003-04-05 Thread Paul Dymecki
Well i'm on php4.2.3 Apache and windows xp, and i'm trying to get oci8 
working.  If this isn't the correct list could you point me in the right 
direction?
thx,
Paul



From: Jim Lucas [EMAIL PROTECTED]
To: Paul Dymecki [EMAIL PROTECTED],[EMAIL PROTECTED]
Subject: Re: [PHP] oci8
Date: Sat, 5 Apr 2003 13:03:38 -0800
Just after we had a long discussion about off topic questions.  This one
doesn't even refer to a programming language problem.
Or am I missing someting?

Jim
- Original Message -
From: Paul Dymecki [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, April 05, 2003 10:30 AM
Subject: [PHP] oci8
 Hello,
 Sorry for cross posting but i thought i'd get a better response.  I
was
 just wondering if anyone has gotten oci8 working successfully on 
windows?
 I've been trying with not much luck.
 thx,
 Paul Dymecki




 _
 Protect your PC - get McAfee.com VirusScan Online
 http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963


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





_
STOP MORE SPAM with the new MSN 8 and get 2 months FREE*   
http://join.msn.com/?page=features/junkmail

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


[PHP] Right Click

2003-04-05 Thread Shantenese Williams
Does anyone know if there is a function in PHP that allows you to
right-click on an item, and from there a drop down menu pops
up and you can go to another screen, preserving that value that was
clicked on?



If there is no function for right-clicking, then is there a way that
when you are selecting something, not on a form, but in a tree,
that you can get the value of what you clicked on into the PHP file?

Thanks


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



Re: [PHP] Right Click

2003-04-05 Thread Chris Hayes
At 02:23 6-4-2003, you wrote:
Does anyone know if there is a function in PHP that allows you to
right-click on an item, and from there a drop down menu pops
up and you can go to another screen, preserving that value that was
clicked on?


If there is no function for right-clicking, then is there a way that
when you are selecting something, not on a form, but in a tree,
that you can get the value of what you clicked on into the PHP file?
Thanks
I think you are missing an essential thing about PHP: PHP is being executed 
on the server. All PHP code you put on a page, is parsed on the server. It 
arrives at the user without all PHP code but only with the result of it.

That means that if you want to have interaction with the user, you need to 
create a page that in some way interacts with the user and then will send a 
request for a next page to the server.
Yor options are, among others:
 - put information in a link
 - use a form in the page
 - use javascript to juggle with information

For right-clicking you need to use javascript.

If you make a tree you could put information in the links that you put in 
the tree, for example

* a href=nextpage.php?location=0 main node/a
*-- a href=nextpage.php?location=1 child1/a
* -- a href=nextpage.php?location=11 grandchild 1 of child 1/a
*-- a href=nextpage.php?location=2 child2/a
* -- a href=nextpage.php?location=21 grandchild 1 of child 2/a
or whatever way and the in the nextpage.php look at $_GET['location']' 
value to see what link was used.





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


Re: [PHP] RE: newbie alternate row colours in dynamic table

2003-04-05 Thread Bobby Rahman


Hiya people

After a lot of soul searching, exploring the web and help from many people I 
came up with this simple solution:

Thank you Chris for explaining the toggle $colorset. In the end I decided 
this made life alot simplier.

(clearly the brackets have to be correctly aligned)

while( $row = mysql_fetch_array($db_result) )
{
echo(
tr $c
td . $row['bugid'] . /td
/tr
);
if ( !isset($c) )
{
$c = bgcolor=#FF;
echo $c;
}
else
{
unset($c);
}
}



From: Chris Hayes [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Re: [PHP] RE: newbie alternate row colours in dynamic table
Date: Sat, 05 Apr 2003 22:32:17 +0200
At 22:14 5-4-2003, you wrote:


Hiya I have a dynamic table and am trying to get the rows to be two 
different alternate colours. well Ive looked at a couple of snippets of 
this colour code and previous mails regarding this. Im having major 
troubles intergrating any of these suggestions with my code. Can anyone 
suggest where I am going wrong. Main problems are
1. where to put the loop for changing the colour (complicated due to the 
loop retrieving data from db)i.e in the do loopin the while loop?
Within the loop that prints the rows, whcih is usually a while loop. But 
that depends on your preferences.


2. Also how to echo my rows in the colours.(something like this I think)
print tr bgcolor='$trcolor'$db_fetch['bugid']; ?/td;
e.g here is the code snippet for alternate coloured rows
$trcolor=#F0F8FF;
while ($myrow = mysql_fetch_array($result)){
$colorset=0;
if ($trcolor=='#F0F8FF'){
$trcolor='#B0C4DE';
$colorset=1;
}
if ($colorset==0){
if ($trcolor=='#B0C4DE'){
$trcolor='#F0F8FF';}
}
print tr bgcolor='$trcolor';
}
I see that you are using a helping variable $colorset.
I have a problem reading your code in email, as i do not see hte indents 
well, so i restructure it here with _ underscores to make the indents 
survive the email program.

$trcolor=#F0F8FF; //1

while ($myrow = mysql_fetch_array($result))
{
___$colorset=0;
___if ($trcolor=='#F0F8FF')//1
___{$trcolor='#B0C4DE'; //2
$colorset=1;
___}
___if ($colorset==0)
___{ if ($trcolor=='#B0C4DE')   //2
__{$trcolor='#F0F8FF';   //1
__}
___}
print tr bgcolor='$trcolor';
}
Lets walk through.
In the 1st walk,
1a) you enter with color#1 and colorset=0.
2b) the first 'if' then sets it to color#2 and colorset=1
3c) The second if sees that both conditions are true and set the color back 
to color#1.

So the first row prints color1.

Ok. The code remembers the values, which are color#1 and colorset1.
In the next walkthrough,
2a) the colorset is set to 0 to start with.
At this moment you have the exact situation as with 1a).
do you see that? it would be much easier to see what is happening if you 
would have only colorset toggling its value and just before printing, 
decide what the color is as a result of the value of colorset.
Give it a try!

Basically:

$colorset=0;

while ()
{ toggle collorset (toggle: if 1 then 0 and opposite)
 if colorser=0 color=ff else color=a
 print color.
}
Chris Hayes













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


_
Surf together with new Shared Browsing 
http://join.msn.com/?page=features/browsepgmarket=en-gbXAPID=74DI=1059

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


Re: [PHP] HTTP or HTTPS

2003-04-05 Thread Alexander Weber
So far so good, the next problem is now, that the port changes with every
new request. Tried this on my personal server an my hoster's one.

Perhaps there is another way? JScript, xml or anything other?

Thanx so far,

Alex


Rasmus Lerdorf [EMAIL PROTECTED] schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
 Presumably you know the HTTPS port on your server.  Anything not SSL is
 going to be straight HTTP.  The point here is that SSL happens a layer
 below PHP.  PHP doesn't care whether it is running over SSL or not.  In
 fact it has no idea what transport layer is below it.  So your only way to
 tell is to depend on whatever the web server tells you.  Look at a
 phpinfo() for both an SSL and a non-SSL request and see what the
 differences are on your server.  For me, checking SERVER_PORT has been the
 most portable/reliable mechanism.

 -Rasmus



 On Sat, 5 Apr 2003, Alexander Weber wrote:

  But SERVER PORT is not always 80 using HTTP (not HTTPS). So this way is
not
  really secure.
 
  Alex
 
  Rasmus Lerdorf [EMAIL PROTECTED] schrieb im Newsbeitrag
  news:[EMAIL PROTECTED]
   I usually just use $_SERVER['SERVER_PORT']
  
   -Rasmus
  
   On Sat, 5 Apr 2003, Alexander Weber wrote:
  
Unfortunally is not set. It's like the variable does not exist,
because
  when
I extract the varaible $_SERVER with foreach I don't get HTTPS as
key,
  only
SERVER_PROTOCOL.
   
I'm using PHP 4.3.1 as Apache2 Module on Win2k SP3.
register_globals OFF
safe:mode OFF
   
stunnel 4.04 on x86-pc-mingw32-gnu WIN32 with OpenSSL 0.9.7 31 Dec
2002
   
If you need more info:
   
ICQ 46858764.
   
Thanx
   
Alex
   
John W. Holmes [EMAIL PROTECTED] schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
  anybody knows how to find out the connection type (http or
httpS)?
 Tried
  out
  $HTTP_SERVER_VARS.

 $_SERVER['HTTPS'] will be set if it's over HTTPS.

 ---John W. Holmes...

 PHP Architect - A monthly magazine for PHP Professionals. Get your
  copy
 today. http://www.phparch.com/


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



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



php-general Digest 5 Apr 2003 22:27:49 -0000 Issue 1981

2003-04-05 Thread php-general-digest-help

php-general Digest 5 Apr 2003 22:27:49 - Issue 1981

Topics (messages 142502 through 142537):

unsubscribe [EMAIL PROTECTED]
142502 by: Chris Roumbanis

Re: Bug ?
142503 by: David Otton

Re: Finding the height of a JPG in pixels using PHP
142504 by: Andrew Brampton

If  else.. display no picture..
142505 by: fkeessen.planet.nl
142507 by: John W. Holmes
142510 by: Rasmus Lerdorf
142522 by: BAROILLER Pierre-Emmanuel

error while quering from MSSQL server from a Linux box
142506 by: Dhaval

Force no Cache
142508 by: Davíð Örn Jóhannsson
142509 by: Rasmus Lerdorf
142511 by: John W. Holmes
142512 by: Rasmus Lerdorf

Uploading a file from a specific directory
142513 by: José RELLAND
142527 by: John W. Holmes

Re: Redirect
142514 by: Ron Rudman

Re: file upload
142515 by: Alexander Weber

Problems with fread()
142516 by: MCConniffe

Re: HTTP or HTTPS
142517 by: Alexander Weber
142518 by: Rasmus Lerdorf
142537 by: Alexander Weber

oci8
142519 by: Paul Dymecki
142530 by: Jim Lucas
142533 by: Paul Dymecki

mysl_connect question
142520 by: Info.Best-IT
142531 by: Jim Lucas

please help,newbie to sessions..
142521 by: Kelly Meeks

Re: newbie alternate row colours in dynamic table
142523 by: Bobby Rahman
142525 by: Chris Hayes
142526 by: Chris Hayes
142536 by: Bobby Rahman

RedHat
142524 by: John Taylor-Johnston
142528 by: Larry E. Ullman
142529 by: Scott St. John
142532 by: Pete James

Right Click
142534 by: Shantenese Williams
142535 by: Chris Hayes

Administrivia:

To subscribe to the digest, e-mail:
[EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]

To post to the list, e-mail:
[EMAIL PROTECTED]


--
---BeginMessage---
unsubscribe [EMAIL PROTECTED]
 
 
 
 
---End Message---
---BeginMessage---
On Sat, 5 Apr 2003 13:18:08 +0300, you wrote:

David, thank you very much. I suspected smth. like this, but still, it is
weird: PHP already has the  operator (?) for assigning by reference.

The reference operator

$b = $a;

forces $b and $a to be references to the same variable now and forever,
but the assignment operator

$b = $a;

may make $b and $a reference the same variable, but will make deep
copies of them when their values diverge.

At least that is my understanding.

And
there is more: I noticed that if I use the sort function instead of
array_multisort, it works as expected.
I still think there is a bug involved :(

Well... I hesitate to call it a bug because each function is working as
intended by its author. Idiosyncratic language design, maybe :)

---End Message---
---BeginMessage---
You can use getimagesize on a jpg file to read its size, so either save the
jpg in MySQL to a file and then do a getImageSize, or before you place the
jpg in to the database read its size and store its dimensions with it in the
db.

Andrew
- Original Message -
From: Phil Schwarzmann [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, April 05, 2003 10:46 AM
Subject: [PHP] Finding the height of a JPG in pixels using PHP


 I have JPG files stored as binary in a MySQL database.  I am displaying
the
 JPGs on the screen and also want to know the height (in pixels) of the
JPG.
 Can PHP do this?



 Thanks!



---End Message---
---BeginMessage---
Hi,

I'm trying to do the following.. When $stadpict is filled in it must display the 
picture (only the path to the picture is stored in Mysql). But when the string 
($stadpict) is empty then it must not display the picture (and also not display a box 
with a red cross in it (can't display picture! ;). The only thing i'm getting is an 
error message...

Parse error: parse error, unexpected T_STRING, expecting ',' or ';' 

Code;
?
// includes
include(../conf/config.php);

// open database connection
$connection = mysql_connect($host, $user, $pass) or die (Unable to connect!);

// select database
mysql_select_db($db) or die (Unable to select database!);
$stedenid=$_GET['stedenid'];

// generate and execute query
$query2 = SELECT stedenid, naamstad, stadomschrijvk, stadpict FROM steden WHERE 
stedenid = $stedenid;
$result2 = mysql_query($query2) or die (Error in query: $query2.  . mysql_error());
$row2 = mysql_fetch_object($result2);
if (mysql_num_rows($result2)  0)
{
?

font class=bold? echo $row2-naamstad; ? /font
brbr? echo $row2-stadpict; 
?

/td
/tr
 /table
 table cellspacing=0  width=405 cellpadding=0 border=0
tr style=padding-top:10
td width=139 valign=top style=padding-left:20
 ? 
   
while($row-$stadpict  0)
{
?
img src=../steden/images/? echo $row-stadpict; ? 

Re: [PHP] HTTP or HTTPS

2003-04-05 Thread Rasmus Lerdorf
No, the destination port will not change.  You must be looking at the
source port.

-Rasmus

On Sat, 5 Apr 2003, Alexander Weber wrote:

 So far so good, the next problem is now, that the port changes with every
 new request. Tried this on my personal server an my hoster's one.

 Perhaps there is another way? JScript, xml or anything other?

 Thanx so far,

 Alex


 Rasmus Lerdorf [EMAIL PROTECTED] schrieb im Newsbeitrag
 news:[EMAIL PROTECTED]
  Presumably you know the HTTPS port on your server.  Anything not SSL is
  going to be straight HTTP.  The point here is that SSL happens a layer
  below PHP.  PHP doesn't care whether it is running over SSL or not.  In
  fact it has no idea what transport layer is below it.  So your only way to
  tell is to depend on whatever the web server tells you.  Look at a
  phpinfo() for both an SSL and a non-SSL request and see what the
  differences are on your server.  For me, checking SERVER_PORT has been the
  most portable/reliable mechanism.
 
  -Rasmus
 
 
 
  On Sat, 5 Apr 2003, Alexander Weber wrote:
 
   But SERVER PORT is not always 80 using HTTP (not HTTPS). So this way is
 not
   really secure.
  
   Alex
  
   Rasmus Lerdorf [EMAIL PROTECTED] schrieb im Newsbeitrag
   news:[EMAIL PROTECTED]
I usually just use $_SERVER['SERVER_PORT']
   
-Rasmus
   
On Sat, 5 Apr 2003, Alexander Weber wrote:
   
 Unfortunally is not set. It's like the variable does not exist,
 because
   when
 I extract the varaible $_SERVER with foreach I don't get HTTPS as
 key,
   only
 SERVER_PROTOCOL.

 I'm using PHP 4.3.1 as Apache2 Module on Win2k SP3.
 register_globals OFF
 safe:mode OFF

 stunnel 4.04 on x86-pc-mingw32-gnu WIN32 with OpenSSL 0.9.7 31 Dec
 2002

 If you need more info:

 ICQ 46858764.

 Thanx

 Alex

 John W. Holmes [EMAIL PROTECTED] schrieb im Newsbeitrag
 news:[EMAIL PROTECTED]
   anybody knows how to find out the connection type (http or
 httpS)?
  Tried
   out
   $HTTP_SERVER_VARS.
 
  $_SERVER['HTTPS'] will be set if it's over HTTPS.
 
  ---John W. Holmes...
 
  PHP Architect - A monthly magazine for PHP Professionals. Get your
   copy
  today. http://www.phparch.com/
 
 



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

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



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


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



[PHP] Re: error while quering from MSSQL server from a Linux box

2003-04-05 Thread Alexander Weber
Tell us more about your script please.

Cheers, Alex


Dhaval [EMAIL PROTECTED] schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
 Hi All,

 I m trying to build a drop down dynamically. I m quering fields from MSSQL
 2000 Server. Now look wat is happning when i run my php from a Win2K PC
and
 from a Linux Box.

 Linux Machine
 ABIDA PARVEEN
 AHMED HUSSAIN MOHD.HUSSAIN
 AHMED HUSSAIN,MOHAMMED HUSSAIN
 ANWAR USSAI
 ARVINDER SINGHOHAMMED HUSSA
 ASHA BHOSLEGHOHAMMED
 ASHA BHOSLE ,GHULAM ALIUSSAN
 ASHA BHOSLE,GHULAM ALIUSSAN
 ASHOK KHOSLAHULAM ALI
 ASHOK KHOSLA,SUMITA CHAKRABORTY SAME
 BEGUM AKHTAR UMITA CHAKRA
 BHUPINDER SINGHITA CHAKRAORT
 BHUPINDER SINGH, MITHALEE SINGHSAME
 BHUPINDER SINGH,MITALEEE SINGHSAME
 C.H. ATMASINGH,MI
 C.H.ATMASINGH,
 CHHAYA GANGULI,IALEEE SI
 CHITRA SINGHI,IALEE
 CHITRA SINGH,JAGJIT SINGHSIGHSAME
 DILRAAJ KAURJAGJIT SING


 Win 2K Server

 ABIDA PARVEEN
 AHMED HUSSAIN MOHD.HUSSAIN
 AHMED HUSSAIN,MOHAMMED HUSSAIN
 ANWAR
 ARVINDER SINGH
 ASHA BHOSLE
 ASHA BHOSLE ,GHULAM ALI
 ASHA BHOSLE,GHULAM ALI
 ASHOK KHOSLA
 ASHOK KHOSLA,SUMITA CHAKRABORTY SAME
 BEGUM AKHTAR
 BHUPINDER SINGH
 BHUPINDER SINGH, MITHALEE SINGH
 BHUPINDER SINGH,MITALEE
 C.H. ATMA
 C.H.ATMA
 CHHAYA GANGULI
 CHITRA SINGH
 CHITRA SINGH,JAGJIT SINGH
 DILRAAJ KAUR


 Values are getting cat after the original value. Can any one help in this.
 I have tried using both sybase and mssql functions the results are the
same.




 Regards
 Dhaval






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



RE: [PHP] RE: newbie alternate row colours in dynamic table

2003-04-05 Thread Daevid Vincent
Wow you guys are going about that way more complicated than it needs to
be:

$i = 0;
echo TR BGCOLOR='#. (($i++ % 2 == 0) ? 'E3E3E3 : FF) .';

Then it just alternates and takes care of itself (plus you get a nice
little index counter as well  as a bonus if you want to use $i 

DÆVID.

A good friend will come and bail you out of jail...but a true friend
will be sitting next to you in the holding cell, laughing and saying
-'That was fucking awesome!' 

 -Original Message-
 From: Bobby Rahman [mailto:[EMAIL PROTECTED] 
 Sent: Saturday, April 05, 2003 2:09 PM
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Subject: Re: [PHP] RE: newbie alternate row colours in dynamic table
 
 
 
 
 Hiya people
 
 After a lot of soul searching, exploring the web and help 
 from many people I 
 came up with this simple solution:
 
 Thank you Chris for explaining the toggle $colorset. In the 
 end I decided 
 this made life alot simplier.
 
 (clearly the brackets have to be correctly aligned)
 
 while( $row = mysql_fetch_array($db_result) )
 {
 echo(
  tr $c
  td . $row['bugid'] . /td
  /tr
  );
 if ( !isset($c) )
 {
 $c = bgcolor=#FF;
 echo $c;
 }
 else
 {
 unset($c);
 }
 }
 
 
 
 
 From: Chris Hayes [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] RE: newbie alternate row colours in dynamic table
 Date: Sat, 05 Apr 2003 22:32:17 +0200
 
 At 22:14 5-4-2003, you wrote:
 
 
 Hiya I have a dynamic table and am trying to get the rows to be two 
 different alternate colours. well Ive looked at a couple of 
 snippets of 
 this colour code and previous mails regarding this. Im having major 
 troubles intergrating any of these suggestions with my 
 code. Can anyone 
 suggest where I am going wrong. Main problems are
 1. where to put the loop for changing the colour 
 (complicated due to the 
 loop retrieving data from db)i.e in the do loopin the 
 while loop?
 Within the loop that prints the rows, whcih is usually a 
 while loop. But 
 that depends on your preferences.
 
 
 2. Also how to echo my rows in the colours.(something like 
 this I think)
 print tr bgcolor='$trcolor'$db_fetch['bugid']; ?/td;
 
 
 e.g here is the code snippet for alternate coloured rows
 $trcolor=#F0F8FF;
 while ($myrow = mysql_fetch_array($result)){
 $colorset=0;
 if ($trcolor=='#F0F8FF'){
 $trcolor='#B0C4DE';
 $colorset=1;
 }
 if ($colorset==0){
 if ($trcolor=='#B0C4DE'){
 $trcolor='#F0F8FF';}
 }
 print tr bgcolor='$trcolor';
 }
 I see that you are using a helping variable $colorset.
 I have a problem reading your code in email, as i do not see 
 hte indents 
 well, so i restructure it here with _ underscores to make 
 the indents 
 survive the email program.
 
 
 $trcolor=#F0F8FF; //1
 
 while ($myrow = mysql_fetch_array($result))
 {
 ___$colorset=0;
 ___if ($trcolor=='#F0F8FF')//1
 ___{$trcolor='#B0C4DE'; //2
 $colorset=1;
 ___}
 
 ___if ($colorset==0)
 ___{ if ($trcolor=='#B0C4DE')   //2
 __{$trcolor='#F0F8FF';   //1
 __}
 ___}
 
 print tr bgcolor='$trcolor';
 }
 
 Lets walk through.
 In the 1st walk,
 1a) you enter with color#1 and colorset=0.
 2b) the first 'if' then sets it to color#2 and colorset=1
 3c) The second if sees that both conditions are true and set 
 the color back 
 to color#1.
 
 So the first row prints color1.
 
 Ok. The code remembers the values, which are color#1 and colorset1.
 In the next walkthrough,
 2a) the colorset is set to 0 to start with.
 At this moment you have the exact situation as with 1a).
 
 do you see that? it would be much easier to see what is 
 happening if you 
 would have only colorset toggling its value and just before 
 printing, 
 decide what the color is as a result of the value of colorset.
 Give it a try!
 
 Basically:
 
 $colorset=0;
 
 while ()
 { toggle collorset (toggle: if 1 then 0 and opposite)
   if colorser=0 color=ff else color=a
   print color.
 }
 
 Chris Hayes
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
 _
 Surf together with new Shared Browsing 
 http://join.msn.com/?page=features/browsepgmarket=en-gbXAPID
 =74DI=1059
 
 
 -- 
 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] HTTP or HTTPS

2003-04-05 Thread Alexander Weber
For sure, and this port changes every time I make a new request.

Alex

Rasmus Lerdorf [EMAIL PROTECTED] schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
 No, the destination port will not change.  You must be looking at the
 source port.

 -Rasmus

 On Sat, 5 Apr 2003, Alexander Weber wrote:

  So far so good, the next problem is now, that the port changes with
every
  new request. Tried this on my personal server an my hoster's one.
 
  Perhaps there is another way? JScript, xml or anything other?
 
  Thanx so far,
 
  Alex
 
 
  Rasmus Lerdorf [EMAIL PROTECTED] schrieb im Newsbeitrag
  news:[EMAIL PROTECTED]
   Presumably you know the HTTPS port on your server.  Anything not SSL
is
   going to be straight HTTP.  The point here is that SSL happens a layer
   below PHP.  PHP doesn't care whether it is running over SSL or not.
In
   fact it has no idea what transport layer is below it.  So your only
way to
   tell is to depend on whatever the web server tells you.  Look at a
   phpinfo() for both an SSL and a non-SSL request and see what the
   differences are on your server.  For me, checking SERVER_PORT has been
the
   most portable/reliable mechanism.
  
   -Rasmus
  
  
  
   On Sat, 5 Apr 2003, Alexander Weber wrote:
  
But SERVER PORT is not always 80 using HTTP (not HTTPS). So this way
is
  not
really secure.
   
Alex
   
Rasmus Lerdorf [EMAIL PROTECTED] schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
 I usually just use $_SERVER['SERVER_PORT']

 -Rasmus

 On Sat, 5 Apr 2003, Alexander Weber wrote:

  Unfortunally is not set. It's like the variable does not exist,
  because
when
  I extract the varaible $_SERVER with foreach I don't get HTTPS
as
  key,
only
  SERVER_PROTOCOL.
 
  I'm using PHP 4.3.1 as Apache2 Module on Win2k SP3.
  register_globals OFF
  safe:mode OFF
 
  stunnel 4.04 on x86-pc-mingw32-gnu WIN32 with OpenSSL 0.9.7 31
Dec
  2002
 
  If you need more info:
 
  ICQ 46858764.
 
  Thanx
 
  Alex
 
  John W. Holmes [EMAIL PROTECTED] schrieb im
Newsbeitrag
  news:[EMAIL PROTECTED]
anybody knows how to find out the connection type (http or
  httpS)?
   Tried
out
$HTTP_SERVER_VARS.
  
   $_SERVER['HTTPS'] will be set if it's over HTTPS.
  
   ---John W. Holmes...
  
   PHP Architect - A monthly magazine for PHP Professionals. Get
your
copy
   today. http://www.phparch.com/
  
  
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
   
   
   
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
   
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 



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



Re: [PHP] Right Click

2003-04-05 Thread Leif K-Brooks
There NEEDS to be a manual page for this!  PHP is SERVER-SIDE!  That 
means that once the page loads (actually, a little before that), PHP is 
done.  IT DOES NOT KEEP RUNNING!  IT RUNS ON THE SERVER'S MACHINE, NOT 
THE CLIENT!  RTFA!

Shantenese Williams wrote:

Does anyone know if there is a function in PHP that allows you to
right-click on an item, and from there a drop down menu pops
up and you can go to another screen, preserving that value that was
clicked on?


If there is no function for right-clicking, then is there a way that
when you are selecting something, not on a form, but in a tree,
that you can get the value of what you clicked on into the PHP file?
Thanks

 

--
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt 
to decrypt it will be prosecuted to the full extent of the law.


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


[PHP] Prefix question

2003-04-05 Thread Sparky Kopetzky
Does anyone know of a prefix convention used for PHP? What I'm talking about is using 
a type of Hungarian notation for PHP variables. I know they use 'g', 'm', and 'r' for 
global, method and reference variables but for other variable types. I get confused 
once and a while, while I am coding and want to make things clearer than mud...

Just a thought...

Robin Kopetzky
Black Mesa Computers/Internet Services



RE: [PHP] RE: newbie alternate row colours in dynamic table

2003-04-05 Thread Chris Hayes
At 00:42 6-4-2003, you wrote:
Wow you guys are going about that way more complicated than it needs to
be:
$i = 0;
echo TR BGCOLOR='#. (($i++ % 2 == 0) ? 'E3E3E3 : FF) .';
Then it just alternates and takes care of itself (plus you get a nice
little index counter as well  as a bonus if you want to use $i
DÆVID.
Or in my belief even faster, (without the bonus):

$i = TRUE;
{$i=!$i;
 echo TR BGCOLOR='#. (($i) ? 'E3E3E3 : FF) .';
}
Since your code has these steps:
1. increment $i
2. divide $i by 2 and keep the remains
3. compare remains with 0
4. make the true/false decision
And the TRUE type:
1. toggle boolean
4. make the true/false decision






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


Re: [PHP] RE: newbie alternate row colours in dynamic table

2003-04-05 Thread Don Read

On 05-Apr-2003 Bobby Rahman wrote:
 
 
 Hiya people
 
 After a lot of soul searching, exploring the web and help from many
 people I 
 came up with this simple solution:
 

Okey-doke. simple is in the eye of the beholder.

$bgcolor = ($bgcolor == '#E3E8F0' ? '#C7D0E2' : '#E3E8F0');

snip

Regards,
-- 
Don Read   [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.

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



Re: [PHP] Prefix question

2003-04-05 Thread Chris Hayes
At 01:12 6-4-2003, you wrote:
Does anyone know of a prefix convention used for PHP? What I'm talking 
about is using a type of Hungarian notation for PHP variables. I know they 
use 'g', 'm', and 'r' for global, method and reference variables but for 
other variable types. I get confused once and a while, while I am coding 
and want to make things clearer than mud...
In a nutshell: it is entirely up to you.

There are some coding standards out there, but there is not such as thing 
as The Standard. You might be interested in reading
http://pear.php.net/manual/en/standards.php (coding standards) with as a 
paragraph of it http://pear.php.net/manual/en/standards.naming.php (naming 
conventions, but as far as i see it does not go much further than
$_UNDERSCORE_WITH_CAPITALS means it is global. )

or another site:
http://utvikler.start.no/code/php_coding_standard.html#stacknames.
I can see the use of such conventions especially when you are working in a 
group.

And when you are combining several applications, it is very usefull if the 
global variables are called $APP1_name and $APP2_name in stead of both 
being called $name That's why module developers in the nuketype CMSes 
are asked not to use globals and if they must, use reserved prefixes.

In VBA conventions are much stricter, and go a bit in your direction, e.g. 
strname would be a string variable. I found some 
sites,  http://www.triadconsulting.com/Resources/Reddick.htm and 
http://www.mvps.org/access/general/gen0012.htm, that list their standards.



Chris





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


RE: [PHP] RE: newbie alternate row colours in dynamic table -- timed tests

2003-04-05 Thread Daevid Vincent
I had to know... ;-)

Output:

version one:0.56761503219604 seconds
version two:0.3099730014801 seconds
version three:  0.36320495605469 secondss

So the boolean (V2)is faster:

Mine is slightly slower by a 'smidge' (0.06 seconds)

Top one is cleanest but slower.

--- test ---

?php
function getmicrotime(){ 
list($usec, $sec) = explode( ,microtime()); 
return ((float)$usec + (float)$sec); 
} 

$ITERATIONS = 10;

$time_start = getmicrotime();
for ($i = 1; $i  $ITERATIONS; $i++)
{
$bgcolor = ($bgcolor == '#E3E8F0') ? '#C7D0E2' : '#E3E8F0';
}
$time_end = getmicrotime();
$time1 = $time_end - $time_start;
echo version one: \t$time1 secondsP\n;

$time_start = getmicrotime();
$tf = TRUE;
for ($i = 1; $i  $ITERATIONS; $i++)
{
$tf=!$tf;
($tf) ? 'C7D0E2 : E3E8F0;
}
$time_end = getmicrotime();
$time2 = $time_end - $time_start;
echo version two: \t$time2 secondsP\n;

$time_start = getmicrotime();
$r = 0;
for ($i = 1; $i  $ITERATIONS; $i++)
{
(($r++ % 2 == 0) ? 'C7D0E2 : E3E8F0);
}
$time_end = getmicrotime();
$time3 = $time_end - $time_start;
echo version three: \t$time3 secondsP\n;
?


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



[PHP] Roadblock When One Page Calls ANother to Log In Users

2003-04-05 Thread Stephen Tiano
When accessing a page called Create Users, it checks that the user 
doing just that is properly logged in--this is part of the admin section 
of the site, not the public end. If not, it sends one to a page created 
by login.php. There one is met by instructions to type in a username 
and password, then press a button labeled Login. Upon pressing the 
latter, a box lowers from the top of the screen; it contains the 
instruction to select a username from a list [of all the usernames I'd 
previously used in the books earlier exercise]. When I choose one, it 
and a password appear in the appropriate fields. I then press Login 
again and the process repeats--i.e., the fields are cleared and the box 
lowers from above with the instructions to type in a username and 
password, then press a button labeled Login.

I'm using Netscape 7, and when I go to Tools -- Password Manager -- 
Manage Stored Passwords and clear the stored passwords, I am no closer 
to anything working. In fact, after pressing the login button after 
filling in the username and password fields produces nothing at all 
until I try a few times and some usernames accumulate and thereby send 
the window down from the top of the screen.

Would anyone be willing to take a look at the coupla files to see if 
I've messed up the code?

Thank you.

Steve Tiano

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


[PHP] Timing test of the parser... Makes no difference

2003-04-05 Thread Daevid Vincent
It seems that it makes almost no difference if you switch in and out of
the parser or stay within it...
Does this seem like a fair test? Having said that, I would suggest
always using the first method as it's much cleaner to read and color
coding works in most editors.

-- output ---

version one:0.098537087440491 seconds
version two:0.096035003662109 seconds

--- test ---

?php
function getmicrotime(){ 
list($usec, $sec) = explode( ,microtime()); 
return ((float)$usec + (float)$sec); 
} 

$ITERATIONS = 1;

$time_start = getmicrotime();
for ($i = 1; $i  $ITERATIONS; $i++)
{
?
blah ?=$i?
?php
}
$time_end = getmicrotime();
$time1 = $time_end - $time_start;

$time_start = getmicrotime();
$tf = TRUE;
for ($i = 1; $i  $ITERATIONS; $i++)
{
echo blah .$i.\n;
}
$time_end = getmicrotime();
$time2 = $time_end - $time_start;

echo Pversion one: \t$time1 secondsP\n;
echo version two: \t$time2 secondsP\n;
?



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



RE: [PHP] Right Click

2003-04-05 Thread daniel
man chill out , message me off list and i can give you a jscript example , as 
the description says , hypertext processor, i dont think jscript even html 
is OT !
= Original Message From Leif K-Brooks [EMAIL PROTECTED] =
There NEEDS to be a manual page for this!  PHP is SERVER-SIDE!  That
means that once the page loads (actually, a little before that), PHP is
done.  IT DOES NOT KEEP RUNNING!  IT RUNS ON THE SERVER'S MACHINE, NOT
THE CLIENT!  RTFA!

Shantenese Williams wrote:

Does anyone know if there is a function in PHP that allows you to
right-click on an item, and from there a drop down menu pops
up and you can go to another screen, preserving that value that was
clicked on?



If there is no function for right-clicking, then is there a way that
when you are selecting something, not on a form, but in a tree,
that you can get the value of what you clicked on into the PHP file?

Thanks





--
The above message is encrypted with double rot13 encoding.  Any unauthorized 
attempt to decrypt it will be prosecuted to the full extent of the law.




--
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] Right Click

2003-04-05 Thread Leif K-Brooks
OF COURSE IT'S OT!  The name is PHP: hypertext PREprocessor!  This is a 
list for PHP, not HTML, javascript, or house decorating!

daniel wrote:

man chill out , message me off list and i can give you a jscript example , as 
the description says , hypertext processor, i dont think jscript even html 
is OT !
 

= Original Message From Leif K-Brooks [EMAIL PROTECTED] =
There NEEDS to be a manual page for this!  PHP is SERVER-SIDE!  That
means that once the page loads (actually, a little before that), PHP is
done.  IT DOES NOT KEEP RUNNING!  IT RUNS ON THE SERVER'S MACHINE, NOT
THE CLIENT!  RTFA!
Shantenese Williams wrote:

   

Does anyone know if there is a function in PHP that allows you to
right-click on an item, and from there a drop down menu pops
up and you can go to another screen, preserving that value that was
clicked on?


If there is no function for right-clicking, then is there a way that
when you are selecting something, not on a form, but in a tree,
that you can get the value of what you clicked on into the PHP file?
Thanks



 

--
The above message is encrypted with double rot13 encoding.  Any unauthorized 
   

attempt to decrypt it will be prosecuted to the full extent of the law.
 



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



 

--
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt 
to decrypt it will be prosecuted to the full extent of the law.



[PHP] Design - Database, Hard File, Combination?

2003-04-05 Thread Mike
Hi,

So I'm working on a CMS that has the ability to move pages from one
category to another, and whole sub-categories (and all their pages) to a
different categories. I have a file that defines the hierarchy of the
menu:

.|Something
..|sub-something
..|sub-something else
.|something -else
..|sub-something-else
...|etc.
.|else-something
..|it's children

the ones with 1 dot are 1st level, 2 dots, second level, and so on...
the menu is defined in order that it is shown (it doesn't check each
item, it just replaces the periods with the correct items). So if I
wanted to move, say, something -else under sub-something else (the
child of Something) and all the stuff under it without affecting
else-something and it's children how could I move it in the text file?

Sorry if I don't make sense. Please ask for clarification if you need.
My other question is if there is an easier way to do this? With a
database or something? I would still need to output a file with the same
format from that for my menu...

Thanks in advance.

-Michael
-- 
Mike [EMAIL PROTECTED]


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



RE: [PHP] RE: newbie alternate row colours in dynamic table -- timedtests

2003-04-05 Thread Philip Olson

If you really want to be optimal, use bitwise instead 
of modulus :)  And ++$i instead of $i++ :)  And,
use single not double quotes :)  Silly, but true.

  http://www.faqts.com/knowledge_base/view.phtml/aid/783/fid/9

And, write less code, so:
  
  $bgcolor = (++$i  1) ? '#ff' : '#ee';

Regards,
Philip


On Sat, 5 Apr 2003, Daevid Vincent wrote:

 I had to know... ;-)
 
 Output:
 
 version one:  0.56761503219604 seconds
 version two:  0.3099730014801 seconds
 version three:0.36320495605469 secondss
 
 So the boolean (V2)is faster:
 
 Mine is slightly slower by a 'smidge' (0.06 seconds)
 
 Top one is cleanest but slower.
 
 --- test ---
 
 ?php
 function getmicrotime(){ 
 list($usec, $sec) = explode( ,microtime()); 
 return ((float)$usec + (float)$sec); 
 } 
 
 $ITERATIONS = 10;
 
 $time_start = getmicrotime();
 for ($i = 1; $i  $ITERATIONS; $i++)
 {
   $bgcolor = ($bgcolor == '#E3E8F0') ? '#C7D0E2' : '#E3E8F0';
 }
 $time_end = getmicrotime();
 $time1 = $time_end - $time_start;
 echo version one: \t$time1 secondsP\n;
 
 $time_start = getmicrotime();
 $tf = TRUE;
 for ($i = 1; $i  $ITERATIONS; $i++)
 {
   $tf=!$tf;
   ($tf) ? 'C7D0E2 : E3E8F0;
 }
 $time_end = getmicrotime();
 $time2 = $time_end - $time_start;
 echo version two: \t$time2 secondsP\n;
 
 $time_start = getmicrotime();
 $r = 0;
 for ($i = 1; $i  $ITERATIONS; $i++)
 {
   (($r++ % 2 == 0) ? 'C7D0E2 : E3E8F0);
 }
 $time_end = getmicrotime();
 $time3 = $time_end - $time_start;
 echo version three: \t$time3 secondsP\n;
 ?
 
 
 -- 
 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] combining text with $_POST

2003-04-05 Thread David McGlone
Hi all, how can I combine this line to use just 1 echo statement?

echo Name: ; echo $_POST['name']

Am I being too picky here?

Thanks,
-- 
David M.
Edification Web Solutions
http://www.edificationweb.com

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



RE: [PHP] RE: newbie alternate row colours in dynamic table -- timed tests

2003-04-05 Thread John W. Holmes
Darn you Phillip! ;) I was just about to post that. Also, since we're
being picky, you should also assign the result to $bgcolor in each of
your tests like you are the first one, instead of just testing a
condition. Here are the results with the fourth method that Phillip
mentioned (along with single quotes, etc, to make each test the same):

version one: 0.400743961334 seconds
version two: 0.331864953041 seconds
version three: 0.322684049606 seconds
version four: 0.293377041817 seconds

There's really not much a difference between any of them. Use the one
you understand.

Complete _new_ code included below.

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/

?php
function getmicrotime(){ 
list($usec, $sec) = explode( ,microtime()); 
return ((float)$usec + (float)$sec); 
} 

$ITERATIONS = 10;

//METHOD ONE
$time_start1 = getmicrotime();
$bgcolor = '';
for ($i = 1; $i  $ITERATIONS; $i++)
{
$bgcolor = ($bgcolor == '#E3E8F0') ? '#C7D0E2' : '#E3E8F0';
}
$time_end1 = getmicrotime();
$time1 = $time_end1 - $time_start1;
echo version one: \t$time1 secondsP\n;

//METHOD TWO
$time_start2 = getmicrotime();
$tf = TRUE;
for ($i = 1; $i  $ITERATIONS; $i++)
{
$tf=!$tf;
$bgcolor = ($tf) ? '#C7D0E2' : '#E3E8F0';
}
$time_end2 = getmicrotime();
$time2 = $time_end2 - $time_start2;
echo version two: \t$time2 secondsP\n;

//METHOD THREE
$time_start3 = getmicrotime();
$r = 0;
for ($i = 1; $i  $ITERATIONS; $i++)
{
$bgcolor = (($r++ % 2 == 0) ? '#C7D0E2' : '#E3E8F0');
}
$time_end3 = getmicrotime();
$time3 = $time_end3 - $time_start3;
echo version three: \t$time3 secondsP\n;

//METHOD FOUR
$time_start4 = getmicrotime();
$z = 0;
for ($i = 1; $i  $ITERATIONS; $i++)
{
$bgcolor = ((++$z  1) ? '#C7D0E2' : '#E3E8F0');
}
$time_end4 = getmicrotime();
$time4 = $time_end4 - $time_start4;
echo version four: \t$time4 secondsp\n;

?


 -Original Message-
 From: Philip Olson [mailto:[EMAIL PROTECTED]
 Sent: Saturday, April 05, 2003 7:42 PM
 To: Daevid Vincent
 Cc: [EMAIL PROTECTED]
 Subject: RE: [PHP] RE: newbie alternate row colours in dynamic table
--
 timed tests
 
 
 If you really want to be optimal, use bitwise instead
 of modulus :)  And ++$i instead of $i++ :)  And,
 use single not double quotes :)  Silly, but true.
 
   http://www.faqts.com/knowledge_base/view.phtml/aid/783/fid/9
 
 And, write less code, so:
 
   $bgcolor = (++$i  1) ? '#ff' : '#ee';
 
 Regards,
 Philip
 
 
 On Sat, 5 Apr 2003, Daevid Vincent wrote:
 
  I had to know... ;-)
 
  Output:
 
  version one:0.56761503219604 seconds
  version two:0.3099730014801 seconds
  version three:  0.36320495605469 secondss
 
  So the boolean (V2)is faster:
 
  Mine is slightly slower by a 'smidge' (0.06 seconds)
 
  Top one is cleanest but slower.
 
  --- test ---
 
  ?php
  function getmicrotime(){
  list($usec, $sec) = explode( ,microtime());
  return ((float)$usec + (float)$sec);
  }
 
  $ITERATIONS = 10;
 
  $time_start = getmicrotime();
  for ($i = 1; $i  $ITERATIONS; $i++)
  {
  $bgcolor = ($bgcolor == '#E3E8F0') ? '#C7D0E2' : '#E3E8F0';
  }
  $time_end = getmicrotime();
  $time1 = $time_end - $time_start;
  echo version one: \t$time1 secondsP\n;
 
  $time_start = getmicrotime();
  $tf = TRUE;
  for ($i = 1; $i  $ITERATIONS; $i++)
  {
  $tf=!$tf;
  ($tf) ? 'C7D0E2 : E3E8F0;
  }
  $time_end = getmicrotime();
  $time2 = $time_end - $time_start;
  echo version two: \t$time2 secondsP\n;
 
  $time_start = getmicrotime();
  $r = 0;
  for ($i = 1; $i  $ITERATIONS; $i++)
  {
  (($r++ % 2 == 0) ? 'C7D0E2 : E3E8F0);
  }
  $time_end = getmicrotime();
  $time3 = $time_end - $time_start;
  echo version three: \t$time3 secondsP\n;
  ?
 
 
  --
  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] combining text with $_POST

2003-04-05 Thread John W. Holmes
 Hi all, how can I combine this line to use just 1 echo statement?
 
 echo Name: ; echo $_POST['name']

The period is used for string concatenation:

echo Name:  . $_POST['name'];

Many ways you can do it:

echo Name: {$_POST['name']};
echo 'Name: ' . $_POST['name'];
echo Name: $_POST[name];
echo 'Name: ' . $_POST[name];
etc...

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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



Re: [PHP] Design - Database, Hard File, Combination?

2003-04-05 Thread Burhan Khalid
Mike wrote:
Hi,

So I'm working on a CMS that has the ability to move pages from one
category to another, and whole sub-categories (and all their pages) to a
different categories. I have a file that defines the hierarchy of the
menu:
.|Something
..|sub-something
..|sub-something else
.|something -else
..|sub-something-else
...|etc.
.|else-something
..|it's children
[ snip ]

I think if you were to change you menu definition file to XML, it would 
make this a lot easier. Then you can use the domxml functions to grab 
your parent/child relationships.

--
Burhan Khalid
phplist[at]meidomus[dot]com


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


RE: [PHP] combining text with $_POST

2003-04-05 Thread Don Read

On 06-Apr-2003 David McGlone wrote:
 Hi all, how can I combine this line to use just 1 echo statement?
 
 echo Name: ; echo $_POST['name']
 

echo 'Name: ', $_POST['name'];

-or-

echo 'Name: ' .$_POST['name'];


Regards,
-- 
Don Read   [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.

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



Re: [PHP] Query

2003-04-05 Thread Burhan Khalid
Ajay Lal wrote:
 Can you please spend some time with my doubt...
 My query is that ...
 Is there any option or function in PHP to implement
 automatic updation of web pages with the latest
 contents from other sites. Like news from news sites etc.
 Or do you have any idea about doing it.
 Thank you for spending your valuable time for me
 Expecting your helpful reply
Ajay :

There are a few ways to go about this :

1. Use cURL to read the pages and their relevant data, parse it, and 
stick it on your site.

2. If the site that you want has an RSS/RDF feed, PHP can parse that 
information using the xml/rss functions.

3. If you are on a unix box, you can copy a page on that site, and then 
at an iterval copy another page, and run diff on it to see if it changes 
(this is the most rediculous way of doing it, but I have seen it done).

--
Burhan Khalid
phplist[at]meidomus[dot]com


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


Re: [PHP] combining text with $_POST

2003-04-05 Thread David McGlone
On Saturday 05 April 2003 08:00 pm, John W. Holmes wrote:
  Hi all, how can I combine this line to use just 1 echo statement?
 
  echo Name: ; echo $_POST['name']

 The period is used for string concatenation:

 echo Name:  . $_POST['name'];

 Many ways you can do it:

 echo Name: {$_POST['name']};
 echo 'Name: ' . $_POST['name'];
 echo Name: $_POST[name];
 echo 'Name: ' . $_POST[name];
 etc...

Thank you all for the quick response. I was using this method and now I 
finally see my error which was I forgot to put the  .  before  $_POST

As you all can see, im relativly new to PHP and I think I'll thank you all for 
putting up with me now instead of later.. : - )
-- 
David M.
Edification Web Solutions
http://www.edificationweb.com

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



Re: [PHP] combining text with $_POST

2003-04-05 Thread Sebastian
you also really don't need single quotes in the $_POST...

echo Name: $_POST[name];

.. should work.

cheers,
- Sebastian


- Original Message - 
From: Don Read [EMAIL PROTECTED]


| 
| On 06-Apr-2003 David McGlone wrote:
|  Hi all, how can I combine this line to use just 1 echo statement?
|  
|  echo Name: ; echo $_POST['name']
|  
| 
| echo 'Name: ', $_POST['name'];
| 
| -or-
| 
| echo 'Name: ' .$_POST['name'];
| 
| 
| Regards,
| -- 
| Don Read   [EMAIL PROTECTED]
| -- It's always darkest before the dawn. So if you are going to 
|steal the neighbor's newspaper, that's the time to do it.
| 
| -- 
| 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] combining text with $_POST

2003-04-05 Thread John W. Holmes
 you also really don't need single quotes in the $_POST...

(if the variable is within a string delimited by _double_ quotes)
 
 echo Name: $_POST[name];
 
 .. should work.

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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



[PHP] Problem with mysql versions. help

2003-04-05 Thread NeXaS
Hello, I wrote the code for deleting the oldest string in the mysql if
it reaches over 15 strings, but it works only under 4.x.x series of MySQL and i have
3.x.x. What should I change in the code that it would work under 3.x.x
version of MySQL? Here`s the code:


$quer = SELECT COUNT(id) FROM logai;
$rez = mysql_query($quer);
$sk = mysql_result($rez,0);
if ( $sk  15 ) {
  $wad = $sk - 15;
  $queryz = DELETE FROM logai WHERE id  'a nu nakuj' ORDER BY id LIMIT $wad;
  mysql_query($queryz);
}*/



Thank You. Sorry for my bad english :-(



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



[PHP] Another problem with mysql version coding

2003-04-05 Thread NeXaS
Hey all, the next code i wrote is for deleting users who don`t login
for 60 days. This script should work under 4.x.x series of MySQL DB,
but i have 3.x.x version. What should i change in this code that it
should work on 3.x.x version of MySQL. ( time is given as a timestamp
( saved as time() in mysql ) ).

The Code:

$GLOBALS['data'] = date (Y-m-d,$timelt);
$GLOBALS['laik'] = date(H:i:s,$timelt);
$queriz = SELECT vartotojas, laikas FROM useriai WHERE (CAST(UNIX_TIMESTAMP(NOW()) AS 
SIGNED) - CAST(UNIX_TIMESTAMP(laikas) AS SIGNED))5184000 AND admin != '1';
$rezult = mysql_query($queriz);
if (mysql_num_rows($rezult) != 0) {
  while ($row2 = mysql_fetch_array($rezult)) {
   $ka = $row2['vartotojas'];
   $query = INSERT INTO logai SET kas='SISTEMA', ka='$ka', 
data='$GLOBALS[data]', laikas='$GLOBALS[laik]';
   echo mysql_error();
   mysql_query($query);
   $delete = DELETE FROM useriai WHERE (CAST(UNIX_TIMESTAMP(NOW()) AS SIGNED) 
- CAST(UNIX_TIMESTAMP(laikas) AS SIGNED))5184000 AND admin != '1';
   $del = mysql_query($delete);
  }
}


P.S. It Also add info to mysql db as logo who delete the user ;-)

Thanks if someone could help! NeXaS



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



RE: [PHP] Another problem with mysql version coding

2003-04-05 Thread John W. Holmes
You should be asking these questions on a MySQL list...

DELETE FROM table WHERE laikas  NOW() - INTERVAL 60 DAY AND admin != 1

Works on MySQL 3 and 4. 

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/

 -Original Message-
 From: NeXaS [mailto:[EMAIL PROTECTED]
 Sent: Saturday, April 05, 2003 10:37 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Another problem with mysql version coding
 
 Hey all, the next code i wrote is for deleting users who don`t login
 for 60 days. This script should work under 4.x.x series of MySQL DB,
 but i have 3.x.x version. What should i change in this code that it
 should work on 3.x.x version of MySQL. ( time is given as a timestamp
 ( saved as time() in mysql ) ).
 
 The Code:
 
 $GLOBALS['data'] = date (Y-m-d,$timelt);
 $GLOBALS['laik'] = date(H:i:s,$timelt);
 $queriz = SELECT vartotojas, laikas FROM useriai WHERE
 (CAST(UNIX_TIMESTAMP(NOW()) AS SIGNED) - CAST(UNIX_TIMESTAMP(laikas)
AS
 SIGNED))5184000 AND admin != '1';
 $rezult = mysql_query($queriz);
 if (mysql_num_rows($rezult) != 0) {
   while ($row2 = mysql_fetch_array($rezult)) {
$ka = $row2['vartotojas'];
$query = INSERT INTO logai SET kas='SISTEMA', ka='$ka',
 data='$GLOBALS[data]', laikas='$GLOBALS[laik]';
echo mysql_error();
mysql_query($query);
$delete = DELETE FROM useriai WHERE
 (CAST(UNIX_TIMESTAMP(NOW()) AS SIGNED) - CAST(UNIX_TIMESTAMP(laikas)
AS
 SIGNED))5184000 AND admin != '1';
$del = mysql_query($delete);
   }
 }
 
 
 P.S. It Also add info to mysql db as logo who delete the user ;-)
 
 Thanks if someone could help! NeXaS
 
 
 
 --
 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] When to use a text file rather then a database

2003-04-05 Thread Charles Kline
Hello all,

I have a text blurb that is on the home page of a site. I need to make 
this block of text editable through a form in  the admin section of the 
site. Is it worth having a table in the db or would I be better off 
writing to a file for this?

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


RE: [PHP] When to use a text file rather then a database

2003-04-05 Thread John W. Holmes
 I have a text blurb that is on the home page of a site. I need to make
 this block of text editable through a form in  the admin section of
the
 site. Is it worth having a table in the db or would I be better off
 writing to a file for this?

Just use a file. The only problem you'll have is if two people try to
edit the file at the same time, but it doesn't sound like that'll be an
issue. 

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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



[PHP] array_unique wierdness

2003-04-05 Thread Greg Robillard
I would like to remove duplicate array values, and I
presume that array_unique should do this, but the
results are not what I am expecting
Anyone see this before:
$dayarray=(9,22,22);
$duparray = array_unique($dayarray);
$darray = count($duparray);
for($d=0;$d$darray;$d++){
  echo $d: .$duparray[$d].br;
}
## returns:
0: 9
1: 
rather than
0: 9
1: 22

Is that what it is supposed to do? Does array_unique
remove all instances of duplicate values? 
If so, is there a way to remove every instance but the
first?
Thanks, 

gr





__
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more
http://tax.yahoo.com

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



[PHP] array_unique wierdness -addendum

2003-04-05 Thread Greg Robillard
Oh yeah - I'm using Version 4.2.3 on Linux

__
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more
http://tax.yahoo.com

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



RE: [PHP] array_unique wierdness

2003-04-05 Thread John W. Holmes
I cut and pasted your code and it worked fine for me with PHP 4.3.0

(assuming the first line is really $dayarray = array(9,22,22); )

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/

 -Original Message-
 From: Greg Robillard [mailto:[EMAIL PROTECTED]
 Sent: Saturday, April 05, 2003 10:27 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] array_unique wierdness
 
 I would like to remove duplicate array values, and I
 presume that array_unique should do this, but the
 results are not what I am expecting
 Anyone see this before:
 $dayarray=(9,22,22);
 $duparray = array_unique($dayarray);
 $darray = count($duparray);
 for($d=0;$d$darray;$d++){
   echo $d: .$duparray[$d].br;
 }
 ## returns:
 0: 9
 1:
 rather than
 0: 9
 1: 22
 
 Is that what it is supposed to do? Does array_unique
 remove all instances of duplicate values?
 If so, is there a way to remove every instance but the
 first?
 Thanks,
 
 gr
 
 
 
 
 
 __
 Do you Yahoo!?
 Yahoo! Tax Center - File online, calculators, forms, and more
 http://tax.yahoo.com
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




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



Re: [PHP] Finding the height of a JPG in pixels using PHP

2003-04-05 Thread De deco
snip from Andrew Brampton [EMAIL PROTECTED]
You can use getimagesize on a jpg file to read its size, so either
save the jpg in MySQL to a file and then do a getImageSize, or before you place the 
jpg in to the database read its size and store its dimensions with it in the db.
/

I disagree with Andrew. In my humble opinion, I don't think you need to duplicate 
information. Before you decide, have a better viewing of the problem.
Not a good solution for me.
I know little about JPEG files, but I know they have a HEADER. This header may contain 
the value (binary, o' course) you need, and even more info than you think. :) So, 
search a for JPG file's spec before you continue. Very easy to find.
After you know about the files you work with, you have to know how to tell PHP to do 
what you want to do. I am not a good person to tell you that, as I am such a newbie to 
PHP. I can only tell that this would be pisso chocka cake in assembly. (VERY VERY 
easy =)

snip from Phil Schwarzmann [EMAIL PROTECTED]
I have JPG files stored as binary in a MySQL database.  I am
displaying the JPGs on the screen and also want to know the height (in pixels) of the 
JPG.
/

Another solution would be if PHP *already* has integrated processing of JPG files, 
wich maybe true, judging by the intricate relation of PHP and internet, and JPG being 
this commom. I think a file extension wouldn't stand in the way (wich I think is what 
you, Phil, meant by stored as binary - no extension) Just check that.

Also, Phil, snipets of the code you use, help you and us much better.

Regards,

-- 
__
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup


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



Re[2]: [PHP] Finding the height of a JPG in pixels using PHP

2003-04-05 Thread Tom Rogers
Hi,

Sunday, April 6, 2003, 2:51:36 PM, you wrote:
Dd snip from Andrew Brampton [EMAIL PROTECTED]
Dd You can use getimagesize on a jpg file to read its size, so either
Dd save the jpg in MySQL to a file and then do a getImageSize, or before you place 
the jpg in to the database read its size and store its dimensions with it in the db.
Dd /

Dd I disagree with Andrew. In my humble opinion, I don't think you need to duplicate 
information. Before you decide, have a better viewing of the problem.
Dd Not a good solution for me.
Dd I know little about JPEG files, but I know they have a HEADER. This header may 
contain the value (binary, o' course) you need, and even more info than you think. :) 
So, search a for JPG file's
Dd spec before you continue. Very easy to find.
Dd After you know about the files you work with, you have to know how to tell PHP to 
do what you want to do. I am not a good person to tell you that, as I am such a newbie 
to PHP. I can only tell
Dd that this would be pisso chocka cake in assembly. (VERY VERY easy =)

Dd snip from Phil Schwarzmann [EMAIL PROTECTED]
Dd I have JPG files stored as binary in a MySQL database.  I am
Dd displaying the JPGs on the screen and also want to know the height (in pixels) of 
the JPG.
Dd /

Dd Another solution would be if PHP *already* has integrated processing of JPG files, 
wich maybe true, judging by the intricate relation of PHP and internet, and JPG being 
this commom. I think a
Dd file extension wouldn't stand in the way (wich I think is what you, Phil, meant by 
stored as binary - no extension) Just check that.

Dd Also, Phil, snipets of the code you use, help you and us much better.

Dd Regards,

Dd -- 
Dd __
Dd Sign-up for your own FREE Personalized E-mail at Mail.com
Dd http://www.mail.com/?sr=signup

You will find it much easier to store the size info at the time of upload than dicking 
around with
binary files. In fact I would store the whole serialized array that is returned by 
getimagesize()
so all info would be available later.

-- 
regards,
Tom


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



[PHP] Great Opportunity for all group members!!!

2003-04-05 Thread Chinmoy Barua

Great Opportunity for all group members!!!

Please Join its free!!! You will have $50 extra Bonuses and earnings 
only with sign up this progam.

Bonuses and Earnings:

A $50.00 sign-up bonus will be awarded to each new member of Platinum-
Mails. This bonus will become payable when the member has earned 
$200.00. A member will receive a $15.00 bonus for each new member who
joins Platinum-Mails through their referral link. This bonus will 
become payable when that new member has earned $200.00. It is real 

Limited number of new user will accepted. Good luck!!!

For join please visit:
http://platinum-mails.ebiz-enterprises.com/?r=chinmoy



-
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more

RE: [PHP] Great Opportunity for all group members!!!

2003-04-05 Thread Matt Giddings
?php

  $user = Chinmoy Barua [mailto:[EMAIL PROTECTED];

  function spam-o-meter( $sender ) {
return( is_real($sender) ? 'not spam' : 'spam' );
  }

  if( spam-o-meter($user) == 'spam' ) {
echo punt user!;
  }

?

This sender is correct; this was a great opportunity for me to brush up
on some PHP programming and code analysis.  For example if we were to
study this simple script we'll discover that it will always return SPAM
and suggests that the user should be punted.


  
 -Original Message-
 From: Chinmoy Barua [mailto:[EMAIL PROTECTED]
 Sent: Sunday, April 06, 2003 1:43 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Great Opportunity for all group members!!!
 
 
 Great Opportunity for all group members!!!
 
 Please Join its free!!! You will have $50 extra Bonuses and earnings
 only with sign up this progam.
 
 Bonuses and Earnings:
 
 A $50.00 sign-up bonus will be awarded to each new member of Platinum-
 Mails. This bonus will become payable when the member has earned
 $200.00. A member will receive a $15.00 bonus for each new member who
 joins Platinum-Mails through their referral link. This bonus will
 become payable when that new member has earned $200.00. It is real
 
 Limited number of new user will accepted. Good luck!!!
 
 For join please visit:
 http://platinum-mails.ebiz-enterprises.com/?r=chinmoy
 
 
 
 -
 Do you Yahoo!?
 Yahoo! Tax Center - File online, calculators, forms, and more
 
 ---
 Incoming mail is certified Virus Free.
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.467 / Virus Database: 266 - Release Date: 4/1/2003
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.467 / Virus Database: 266 - Release Date: 4/1/2003
 


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



Re: [PHP] Great Opportunity for all group members!!!

2003-04-05 Thread Sebastian
hehe. i should get me one of those ;)

cheers,
- Sebastian


- Original Message - 
From: Matt Giddings [EMAIL PROTECTED]


| ?php
| 
|   $user = Chinmoy Barua [mailto:[EMAIL PROTECTED];
| 
|   function spam-o-meter( $sender ) {
| return( is_real($sender) ? 'not spam' : 'spam' );
|   }
| 
|   if( spam-o-meter($user) == 'spam' ) {
| echo punt user!;
|   }
| 
| ?
| 
| This sender is correct; this was a great opportunity for me to brush up
| on some PHP programming and code analysis.  For example if we were to
| study this simple script we'll discover that it will always return SPAM
| and suggests that the user should be punted.
| 
| 
|   
|  -Original Message-
|  From: Chinmoy Barua [mailto:[EMAIL PROTECTED]
|  Sent: Sunday, April 06, 2003 1:43 AM
|  To: [EMAIL PROTECTED]
|  Subject: [PHP] Great Opportunity for all group members!!!
|  
|  
|  Great Opportunity for all group members!!!
|  
|  Please Join its free!!! You will have $50 extra Bonuses and earnings
|  only with sign up this progam.
|  
|  Bonuses and Earnings:
|  
|  A $50.00 sign-up bonus will be awarded to each new member of Platinum-
|  Mails. This bonus will become payable when the member has earned
|  $200.00. A member will receive a $15.00 bonus for each new member who
|  joins Platinum-Mails through their referral link. This bonus will
|  become payable when that new member has earned $200.00. It is real
|  
|  Limited number of new user will accepted. Good luck!!!
|  
|  For join please visit:
|  http://platinum-mails.ebiz-enterprises.com/?r=chinmoy
|  
|  
|  
|  -
|  Do you Yahoo!?
|  Yahoo! Tax Center - File online, calculators, forms, and more
|  
|  ---
|  Incoming mail is certified Virus Free.
|  Checked by AVG anti-virus system (http://www.grisoft.com).
|  Version: 6.0.467 / Virus Database: 266 - Release Date: 4/1/2003
|  
| 
| ---
| Outgoing mail is certified Virus Free.
| Checked by AVG anti-virus system (http://www.grisoft.com).
| Version: 6.0.467 / Virus Database: 266 - Release Date: 4/1/2003
|  
| 
| 
| -- 
| 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] RedHat

2003-04-05 Thread John Taylor-Johnston
John I'm not sure if you've noticed, ...

Larry, Pete et al.,

Point taken.  I won't exacerbate the point, but php.net does point out the lists, and 
this general group in particular, are for talking about PHP.

There are a number of mailing lists devoted to talking about PHP and related 
projects (http://www.php.net/support.php)

If the general list is meant to be for coding questiosn only, so be it.
I'll try to be good :) But I am not the only one off-topic. Indeed, 99% of
my questions are about coding. Indeed, I try my hand at answering a few
questions from time to time as well.

Thanks for the posted info and sorry.

John

Larry E. Ullman wrote:

  Where would I go on the redHat site to ask when they are going to
  upgrade to PHP 4.3 and MySQL 4.x (now in production). Our CS dept.
  won't install them for me until RedHat bundles it. I'm using RH 7.3.

 This question would probably be best directed towards:
 1) The RedHat site
 2) A RedHat newsgroup
 3) A RedHat mailing list
 4) A RedHat forum
 5) A RedHat __, not the PHP general mailing list (since your
 question concerns RedHat packages).

 I expect that a RedHat support would be much more qualified to answer
 this question and your original one (when they'll upgrade).

 Larry


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



RE: [PHP] Great Opportunity for all group members!!!

2003-04-05 Thread daniel
lol this would have to be the first i got from this list, i get dozens of 
korean spam everyday , the encoding is all wrong and all comes out is 
gibberish characters , how do i stop this ?
= Original Message From Sebastian [EMAIL PROTECTED] =
hehe. i should get me one of those ;)

cheers,
- Sebastian


- Original Message -
From: Matt Giddings [EMAIL PROTECTED]


| ?php
|
|   $user = Chinmoy Barua [mailto:[EMAIL PROTECTED];
|
|   function spam-o-meter( $sender ) {
| return( is_real($sender) ? 'not spam' : 'spam' );
|   }
|
|   if( spam-o-meter($user) == 'spam' ) {
| echo punt user!;
|   }
|
| ?
|
| This sender is correct; this was a great opportunity for me to brush up
| on some PHP programming and code analysis.  For example if we were to
| study this simple script we'll discover that it will always return SPAM
| and suggests that the user should be punted.
|
|
|
|  -Original Message-
|  From: Chinmoy Barua [mailto:[EMAIL PROTECTED]
|  Sent: Sunday, April 06, 2003 1:43 AM
|  To: [EMAIL PROTECTED]
|  Subject: [PHP] Great Opportunity for all group members!!!
| 
| 
|  Great Opportunity for all group members!!!
| 
|  Please Join its free!!! You will have $50 extra Bonuses and earnings
|  only with sign up this progam.
| 
|  Bonuses and Earnings:
| 
|  A $50.00 sign-up bonus will be awarded to each new member of Platinum-
|  Mails. This bonus will become payable when the member has earned
|  $200.00. A member will receive a $15.00 bonus for each new member who
|  joins Platinum-Mails through their referral link. This bonus will
|  become payable when that new member has earned $200.00. It is real
| 
|  Limited number of new user will accepted. Good luck!!!
| 
|  For join please visit:
|  http://platinum-mails.ebiz-enterprises.com/?r=chinmoy
| 
| 
| 
|  -
|  Do you Yahoo!?
|  Yahoo! Tax Center - File online, calculators, forms, and more
| 
|  ---
|  Incoming mail is certified Virus Free.
|  Checked by AVG anti-virus system (http://www.grisoft.com).
|  Version: 6.0.467 / Virus Database: 266 - Release Date: 4/1/2003
| 
|
| ---
| Outgoing mail is certified Virus Free.
| Checked by AVG anti-virus system (http://www.grisoft.com).
| Version: 6.0.467 / Virus Database: 266 - Release Date: 4/1/2003
|
|
|
| --
| 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] Timing test of the parser... Makes no difference

2003-04-05 Thread daniel
here is the trick the solaris guy showed me , i've intergrated it into a 
webpage for showing the results

time php somebenchmark.php  /dev/null time will show u the results of the 
compiling , the microtime version has to allow time for running through apache 
:)
= Original Message From Daevid Vincent [EMAIL PROTECTED] =
It seems that it makes almost no difference if you switch in and out of
the parser or stay within it...
Does this seem like a fair test? Having said that, I would suggest
always using the first method as it's much cleaner to read and color
coding works in most editors.

-- output ---

version one:   0.098537087440491 seconds
version two:   0.096035003662109 seconds

--- test ---

?php
function getmicrotime(){
list($usec, $sec) = explode( ,microtime());
return ((float)$usec + (float)$sec);
}

$ITERATIONS = 1;

$time_start = getmicrotime();
for ($i = 1; $i  $ITERATIONS; $i++)
{
   ?
   blah ?=$i?
   ?php
}
$time_end = getmicrotime();
$time1 = $time_end - $time_start;

$time_start = getmicrotime();
$tf = TRUE;
for ($i = 1; $i  $ITERATIONS; $i++)
{
   echo blah .$i.\n;
}
$time_end = getmicrotime();
$time2 = $time_end - $time_start;

echo Pversion one: \t$time1 secondsP\n;
echo version two: \t$time2 secondsP\n;
?



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