[PHP] Re: [PHP-DB] How to add 2 years to todays date ?

2002-03-18 Thread Andrey Hristov

$your_timestamp+=gmmktime(0,0,0,1,1,1972);

Regards,
Andrey

- Original Message - 
From: Dave Carrera [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, March 18, 2002 10:11 AM
Subject: [PHP-DB] How to add 2 years to todays date ?


 Hi All
 I think the subject line says it all.
  
 How to add 2 years to today's date ?
  
 Any helps as always most appreciated.
  
  
  
 Dave Carrera
 Php Developer
 http://davecarrera.freelancers.net
 http://www.davecarrera.com
  
  
 


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




Re: [PHP] Re: [PHP-DB] How to add 2 years to todays date ?

2002-03-18 Thread Martin Schichl



At 10:19 18.03.02 +0200, Andrey Hristov [EMAIL PROTECTED] wrote:
$your_timestamp+=gmmktime(0,0,0,1,1,1972);

Try:

$your_timestamp =
mktime(date(H),date(i),date(s),date(m),date(d),(date(Y)+2));

Is there anything why this would not work?

Martin



-
Dipl.-Ing. Martin Schichl
SCC Software, Communication  Consulting GmbH  Co KEG
Grottenhofstr. 3, A-8053 Graz
Tel. +43/(0)316/265-205, Fax +43/(0)316/265-234
[EMAIL PROTECTED], http://scc.co.at


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




Re: [PHP] Re: [PHP-DB] How to add 2 years to todays date ?

2002-03-18 Thread Andrey Hristov

Isn't the hack with gmmktime() faster? It is clean if the code knows what is 1,1,1970 
and how Unixtime is measured.

Andrey

- Original Message - 
From: Martin Schichl [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, March 18, 2002 10:29 AM
Subject: Re: [PHP] Re: [PHP-DB] How to add 2 years to todays date ?


 
 
 At 10:19 18.03.02 +0200, Andrey Hristov [EMAIL PROTECTED] wrote:
 $your_timestamp+=gmmktime(0,0,0,1,1,1972);
 
 Try:
 
 $your_timestamp =
 mktime(date(H),date(i),date(s),date(m),date(d),(date(Y)+2));
 
 Is there anything why this would not work?
 
 Martin
 
 
 
 -
 Dipl.-Ing. Martin Schichl
 SCC Software, Communication  Consulting GmbH  Co KEG
 Grottenhofstr. 3, A-8053 Graz
 Tel. +43/(0)316/265-205, Fax +43/(0)316/265-234
 [EMAIL PROTECTED], http://scc.co.at
 
 
 -- 
 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: [PHP-DB] How to add 2 years to todays date ?

2002-03-18 Thread Martin Schichl

At 10:35 18.03.02 +0200, Andrey wrote:
Isn't the hack with gmmktime() faster? It is clean if the code knows 
what is 1,1,1970 and how Unixtime is measured.

Seems that you'r right, as 

mktime(date(H),date(i),date(s),date(m),date(d),(date(Y)+2))

calls six times the function date ...

Martin


-
Dipl.-Ing. Martin Schichl
SCC Software, Communication  Consulting GmbH  Co KEG
Grottenhofstr. 3, A-8053 Graz
Tel. +43/(0)316/265-205, Fax +43/(0)316/265-234
[EMAIL PROTECTED], http://scc.co.at


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




Re: [PHP] Re: [PHP-DB] How to add 2 years to todays date ?

2002-03-18 Thread Tom Rogers

Hi
A variation

echo date(d/m/Y,strtotime(+2 years))

Tom

At 06:29 PM 18/03/2002, Martin Schichl wrote:


At 10:19 18.03.02 +0200, Andrey Hristov [EMAIL PROTECTED] wrote:
 $your_timestamp+=gmmktime(0,0,0,1,1,1972);

Try:

$your_timestamp =
mktime(date(H),date(i),date(s),date(m),date(d),(date(Y)+2));

Is there anything why this would not work?

Martin



-
Dipl.-Ing. Martin Schichl
SCC Software, Communication  Consulting GmbH  Co KEG
Grottenhofstr. 3, A-8053 Graz
Tel. +43/(0)316/265-205, Fax +43/(0)316/265-234
[EMAIL PROTECTED], http://scc.co.at


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


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




[PHP] building forms from what the MySQL table looks like

2002-03-18 Thread Justin French

Hi,

I've been thinking about this for a while, and I think I'd get a lot of
value out of a library which builds user-input forms from scratch, based
on the MySQL table.

If I had a simple table for a CD catalogue:

id (INT 4)
artist_id (INT 4)
description (MEDIUM TEXT)
price (VARCHAR 7)


Then I'd love to be able to build a form for entry of each new CD, based
on the column names and types in the above table:

FORM action=blah.php action=post
Bartist_id/B: INPUT type=text name=artist_id value=
length=4 maxlength=4BR
Bdescription/B: TEXTAREA name=description rows=5 cols=40BR
Bprice/B: INPUT type=text name=price value= length=7 maxlength=7BR
INPUT type=submit name=submit value=submit
/FORM


So, my question is, how do efficiently establish the data type, length
and name of each field.


The rest, I think I can handle :)



Thanks in advance,

Justin French

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




[PHP] Timing PHP

2002-03-18 Thread Stig Kronback

Dear ?

I need to see how long it takes for my php-scripts to
execute, what can I do, doesn't PHP include a function
that will show that information?

Regards,
Stig

=
Stig Kronback Andersen
Drejervej 13, st
2400 Koebenhavn NV
Denmark
Phone: +45 35310382
E-mail: [EMAIL PROTECTED]

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

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




[PHP] Re: building forms from what the MySQL table looks like

2002-03-18 Thread David Robley

In article [EMAIL PROTECTED], [EMAIL PROTECTED] 
says...
 Hi,
 
 I've been thinking about this for a while, and I think I'd get a lot of
 value out of a library which builds user-input forms from scratch, based
 on the MySQL table.
 
 If I had a simple table for a CD catalogue:
 
 id (INT 4)
 artist_id (INT 4)
 description (MEDIUM TEXT)
 price (VARCHAR 7)
 
 
 Then I'd love to be able to build a form for entry of each new CD, based
 on the column names and types in the above table:
 
 FORM action=blah.php action=post
 Bartist_id/B: INPUT type=text name=artist_id value=
 length=4 maxlength=4BR
 Bdescription/B: TEXTAREA name=description rows=5 cols=40BR
 Bprice/B: INPUT type=text name=price value= length=7 maxlength=7BR
 INPUT type=submit name=submit value=submit
 /FORM
 
 
 So, my question is, how do efficiently establish the data type, length
 and name of each field.
 
 
 The rest, I think I can handle :)
 
 
 
 Thanks in advance,
 
 Justin French
 
Have a look at mysql_field_type() from which you should be able to build 
something along the lines of what you want. You might also peer into the 
innards of phpMyAdmin, which does the same sort of thing.

Cheers
-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




[PHP] Appropriate headers for Forcing download on IE/Mac and open with stuffit?

2002-03-18 Thread Jimmy Lantz

Hi,
I know it has been discussed before but I havent seen any working solutions.

My problem is that I need to force a dowload for Mac users / IE
and preferably also automatically let them open the file with stuffit expander.
(it works with files downloaded from a webpage/apache without PHP)
So there must be a way to replicate this behaviour in PHP, right?

I've tried endless combinations of orders for the headers and removing 
parts of them. What I've ended up using is the following:

header(Content-type: application/octet-stream\n);
header(Content-disposition: attachment; filename=\$filename\\n);
header(Content-transfer-encoding: binary\n);
header(Content-length:  . $filesize . \n);

But it doesnt result in the desired behaviour though.
Any Ideas?
Cheers
Jimmy

And yes I've RTFM more than twice!

Btw, I use PHP 4.12 as an Apache module on FreeBSD.


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




[PHP] Re: Timing PHP

2002-03-18 Thread David Robley

In article [EMAIL PROTECTED], 
[EMAIL PROTECTED] says...
 Dear ?
 
 I need to see how long it takes for my php-scripts to
 execute, what can I do, doesn't PHP include a function
 that will show that information?
 
 Regards,
 Stig

Not a specific function, but you could build your own; for instance get 
the value of time (for granularity by seconds) or microtime at the start 
and end of the script and calculate the difference.

-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




RE: [PHP] Timing PHP

2002-03-18 Thread Niklas Lampén

microtime() function's manual entry tells you exactly what you want to
do. :)


Niklas

-Original Message-
From: Stig Kronback [mailto:[EMAIL PROTECTED]] 
Sent: 18. maaliskuuta 2002 12:00
To: [EMAIL PROTECTED]
Subject: [PHP] Timing PHP


Dear ?

I need to see how long it takes for my php-scripts to
execute, what can I do, doesn't PHP include a function
that will show that information?

Regards,
Stig

=
Stig Kronback Andersen
Drejervej 13, st
2400 Koebenhavn NV
Denmark
Phone: +45 35310382
E-mail: [EMAIL PROTECTED]

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

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


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




[PHP] Store data in array

2002-03-18 Thread Uma Shankari T.



Hello,

Anyone can please tell me how to store the row details fetched from
database to array so that to sort the same array after storing


-Uma


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




[PHP] dateformat

2002-03-18 Thread Sven Jacobs

hey all

I want to convert 20020211150245 into 2002-02-11 15:02:45.
Does somebody have the correct conversion for this ?




Re: [PHP] Store data in array

2002-03-18 Thread Andrey Hristov

If it is possible do the sorting in the SQL statement by using ORDER BY. SQL sorting 
is much faster than in PHP.
However
while ($row= mysql_fetch_assoc($res)){ $rows[] = $row; }

Then you have many ways to sort. Look at : sort(), asort(), arsort(), usort(), 
uasort() etc.

Best regards,
Andrey Hristov

- Original Message - 
From: Uma Shankari T. [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, March 18, 2002 12:25 PM
Subject: [PHP] Store data in array


 
 
 Hello,
 
 Anyone can please tell me how to store the row details fetched from
 database to array so that to sort the same array after storing
 
 
 -Uma
 
 
 -- 
 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] OBJECT£ºWHAT'S THE RALATION BETWEEN A,B AND C?

2002-03-18 Thread Tim Ward

The line you've marked prints the value attribute of $a-b-a, which is a
pointer to the base object ($a). You have just changed the value attribute
of this to 11 and it prints 11 ... what's wrong?

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

--
From:  Oliver Heinisch [SMTP:[EMAIL PROTECTED]]
Sent:  17 March 2002 12:20
To:  [EMAIL PROTECTED]
Subject:  Re: [PHP] OBJECT£ºWHAT'S THE RALATION  BETWEEN A,B AND C?

At 17.03.2002  10:01, you wrote:

?php
class A
{
 function A($i)
 {
 $this-value = $i;
 // try to figure out why we do not need a reference here
 $this-b = new B($this);
 }

 function createRef()
 {
 $this-c = new B($this);
 }

 function echoValue()
 {
 echo br,class ,get_class($this),': ',$this-value;
 }
}


class B
{
 function B($a)
 {
 $this-a = $a;
 }

 function echoValue()
 {
 echo br,class ,get_class($this),':
',$this-a-value;
 }
}

// try to undestand why using a simple copy here would yield
// in an undesired result in the *-marked line
$a =new A(10);
$a-createRef();

$a-echoValue();
$a-b-echoValue();
$a-c-echoValue();

$a-value = 11;

$a-echoValue();
$a-b-echoValue(); // *
$a-c-echoValue();

?
Even if I don´t understand what your code does, shouldn´t you
give any variable a place to be stored so it schould look like
class foo
{
 var $a;
 var $b;
function fooplus()
{
 $this - a = foofoo;
and so on ??
}
}
HTH Oliver


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




Re: [PHP] Store data in array

2002-03-18 Thread Uma Shankari T.



On Mon, 18 Mar 2002, Andrey Hristov wrote:

AHIf it is possible do the sorting in the SQL statement by using ORDER BY. SQL 
sorting is much faster than in PHP.
AHHowever

I have gone through that manual alreadybut i need to sort by php
sorting.

AHwhile ($row= mysql_fetch_assoc($res)){ $rows[] = $row; }
AH

I have tried this but while sorting using php sort it is displaying array
only.If the elements are stored in the array properly i can perform 
sorting.

please tell me how to extract a specific field from mysql database and
store it in array...

AHThen you have many ways to sort. Look at : sort(), asort(), arsort(), usort(), 
uasort() etc.
AH
AHBest regards,
AHAndrey Hristov
AH
AH- Original Message - 
AHFrom: Uma Shankari T. [EMAIL PROTECTED]
AHTo: [EMAIL PROTECTED]
AHSent: Monday, March 18, 2002 12:25 PM
AHSubject: [PHP] Store data in array
AH
AH
AH 
AH 
AH Hello,
AH 
AH Anyone can please tell me how to store the row details fetched from
AH database to array so that to sort the same array after storing
AH 
AH 
AH -Uma
AH 
AH 
AH -- 
AH PHP General Mailing List (http://www.php.net/)
AH To unsubscribe, visit: http://www.php.net/unsub.php
AH 
AH 
AH


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




[PHP] RE: Invalid Argument ??? Not sure how to debug this

2002-03-18 Thread Tim Ward

Try ...

If ($result = ...)
{   ...
...
} else echo(mysql_error());

I always do querying like this anyway (without the error echo in live stuff
obviously)

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

--
From:  Daniel Negron/KBE [SMTP:[EMAIL PROTECTED]]
Sent:  17 March 2002 08:38
To:  [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject:  Invalid Argument ???  Not sure how to debug this

Hi all and Good Morning.

I have been struggling with this code:  I was wondering if someone
could
lend me a hand.

I am working with this code and can't get the error to disappear.

After running I get

|---
--|
| Warning: Supplied argument is not a valid MySQL result resource in
C:\My Documents\My   |
| Webs\php\TMPibtpit3zq0.php on line 12
|

|---
--|


Line 12 happens to be the WHILE statement.  I am not sure if it is
the
while statement or the results its looking for.

TIA  So far, i havent been able to sleep atleast until I get this.

html
?
if (isset($searchstring))
 {

 $db = mysql_connect(localhost,webuser,);
 mysql_select_db(cd_collection,$db);
 $sql= SELECT * FROM cd_list WHERE $searchstring LIKE
'%searchstring%'
ORDER BY artist ASC;
 $result = mysql_query($sql,$db);
 echo TABLE BORDER=2;
 echo
trtdbArtist/btdbTitle/btdbOptions/b/tr;
 while ($myrow = mysql_fetch_array($result))
 {
   echo
trtd.$myrow[artist].td.$myrow[title];
   echo tda href=\edit.php?id=.$myrow[cd_id].
\View/a;
  }
  echo /TABLE;
 }
else
 {
  ?
  form method=POST action=? $PHP_SELF ?
  table border=2 cellspacing=2
  trtdInsert Your Search String Here./td
  tdSearch Type/td/tr
  tr
  tdinput type=text name=searchstring size=28/td
  tdselect size=1 name=searchtype
   option selected value=artistArtist/option
   option value=titleTitle/option
   option value=categoryCategory/option
  /select/td
  /tr
  /table
  pinput type = submit value=Submit name=B1
  input type=reset value=Reset/p
  /form
  ?
 }
 ?

 /html


**DAN**




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




[PHP] object reflection in php?

2002-03-18 Thread Filippo Veneri

Is there a way to get the name of a filed
from a variable pointing to some object?

Just to make myself understood:

class obj {
   var $field;
   function obj( $value ) {
 $this-field = $value;
   }
}

$o = new obj( field value );

How can i know, if possible,  that the instance of
obj pointed to by $o has a field named field?

This would be useful to write an object to a database
without knowing its structure 'a-priori'.

Thanks

fbv


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




[PHP] files upload

2002-03-18 Thread Jena

I need to upload more than one file throught an html form.
I cannot create an archive first and then post it. I need to aperate directly 
with the files the users want to upload.
how can I do this?
ther's any php trick or procedure to help me

many thanks in advance

Jena

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




[PHP] Undeclared Variables

2002-03-18 Thread Mark Williams

Hi,

I am using php 4.1.2 and I have 2 questions. :

1) How do I compile PHP not to depend on declared variables?
2) Assuming the above is possible, is this safe to do?

Regards, Mark

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




[PHP] Re: Undeclared Variables

2002-03-18 Thread Julio Nobrega Trabalhando

error_reporting(); There's also an entry on php.ini to handle.

  It is safe although I personally do not recommend. Undeclared variables
are a unexpected script behavior, it's good to know where your data is
coming from and/or not trust it. For example a GET paramenter might override
the value you were expecting.

--

Julio Nobrega.

Um dia eu chego lá:
http://sourceforge.net/projects/toca

Ajudei? Salvei? Que tal um presentinho?
http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884


Mark Williams [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi,

 I am using php 4.1.2 and I have 2 questions. :

 1) How do I compile PHP not to depend on declared variables?
 2) Assuming the above is possible, is this safe to do?

 Regards, Mark



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




RE: [PHP] Re: [PHP-DB] How to add 2 years to todays date ?

2002-03-18 Thread Ford, Mike [LSS]

 -Original Message-
 From: Andrey Hristov [mailto:[EMAIL PROTECTED]]
 Sent: 18 March 2002 08:20
 
 $your_timestamp+=gmmktime(0,0,0,1,1,1972);

Well, that depends on your definition of year -- the problem here is that it makes 
no allowances for leap years, so (for example) 2-mar-2003 would be converted to 
1-mar-2005 (since 29-feb-2004 would be effectively lost).

Both the other solutions offered would cope with this, but personally I like the 
strtotime(+2 years) one best!

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning  Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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




[PHP] console scripts reading php.ini

2002-03-18 Thread DigitalKoala

Hi folks,

How do i get my script (run from the console and not from the browser) to
set sendmail_path = /var/qmail/bin/qmail-inject ?

Thanks!

DK



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




[PHP] Replacing chars like: º OR ¿

2002-03-18 Thread andy

Hi there,

I am still searching for a function which is replacing all chars not between
[a-z] for exampe a province name like:  minºaqah-ash-shamal¿yah into valid
chars or just deleting them. There seems to be an endless amount of those
chars.

Thanx for any hint,

andy



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




Re: [PHP] Replacing chars like: º OR ¿

2002-03-18 Thread Cameron Bales .:.

I am still searching for a function which is replacing all chars not between
[a-z] for exampe a province name like:  minºaqah-ash-shamal¿yah into valid
chars or just deleting them. There seems to be an endless amount of those
chars.


This grep pattern:  [\x80-\xFF]
will match any high byte character  - you could replace with null 
before displaying if just deleting is all you really need.

why not specify the character set in your html so you can just leave them in?

Cameron .:.

--
Tantramar Interactive
http://www.TantramarInteractive.com/
16 Lorne St., Unit 3, Sackville, NB  E4L 3Z7
Phone (506) 364-1097  Fax (506) 536-2409
All that glitters has a high refractive index.

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




RE: [PHP] Store data in array

2002-03-18 Thread Balaji Ankem

Hi Uma,
you can use as in C language with index. $a[i]= $val;

i is index starts from zero.

For example u want to extract specific field from mysql database and
store it in array..


Let us assume num is a attribute name of the table heap.


=


$sql=select num from heap; 

$result=mysql_query($sql1) or die(Error in query sql.mysql_error());

$n=mysql_numrows($result);
If( $n0)
{
$i=0;
While(($row=mysql_fetch_object($result)))
{
$a[$i]=$row-num;
$i=$i+1;
}
}

=   

Hope this helps.

Best Regards
Balaji

-Original Message-
From: Uma Shankari T. [mailto:[EMAIL PROTECTED]] 
Sent: Monday, March 18, 2002 4:55 PM
To: Andrey Hristov
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Store data in array




On Mon, 18 Mar 2002, Andrey Hristov wrote:

AHIf it is possible do the sorting in the SQL statement by using ORDER 
AHBY. SQL sorting is much faster than in PHP. However

I have gone through that manual alreadybut i need to sort by php
sorting.

AHwhile ($row= mysql_fetch_assoc($res)){ $rows[] = $row; }
AH

I have tried this but while sorting using php sort it is displaying
array only.If the elements are stored in the array properly i can
perform 
sorting.

please tell me how to extract a specific field from mysql database and
store it in array...

AHThen you have many ways to sort. Look at : sort(), asort(), arsort(),

AHusort(), uasort() etc.
AH
AHBest regards,
AHAndrey Hristov
AH
AH- Original Message -
AHFrom: Uma Shankari T. [EMAIL PROTECTED]
AHTo: [EMAIL PROTECTED]
AHSent: Monday, March 18, 2002 12:25 PM
AHSubject: [PHP] Store data in array
AH
AH
AH 
AH 
AH Hello,
AH 
AH Anyone can please tell me how to store the row details fetched from

AH database to array so that to sort the same array after storing
AH 
AH 
AH -Uma
AH 
AH 
AH --
AH PHP General Mailing List (http://www.php.net/)
AH To unsubscribe, visit: http://www.php.net/unsub.php
AH 
AH 
AH


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



**Disclaimer
  


Information contained in this E-MAIL being proprietary to Wipro Limited
is 'privileged' and 'confidential' and intended for use only by the
individual or entity to which it is addressed. You are notified that any
use, copying or dissemination of the information contained in the E-MAIL
in any manner whatsoever is strictly prohibited.



 



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


Re: [PHP] Store data in array

2002-03-18 Thread Andrey Hristov

It is showing Array probably because you do
echo $rows; 
and because $rows is array you receive Array;
try
foreach($rows as $k=$v){
print \n[$k][$v]br;
}

Regards,
Andrey
- Original Message - 
From: Uma Shankari T. [EMAIL PROTECTED]
To: Andrey Hristov [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Monday, March 18, 2002 1:24 PM
Subject: Re: [PHP] Store data in array


 
 
 On Mon, 18 Mar 2002, Andrey Hristov wrote:
 
 AHIf it is possible do the sorting in the SQL statement by using ORDER BY. SQL 
sorting is much faster than in PHP.
 AHHowever
 
 I have gone through that manual alreadybut i need to sort by php
 sorting.
 
 AHwhile ($row= mysql_fetch_assoc($res)){ $rows[] = $row; }
 AH
 
 I have tried this but while sorting using php sort it is displaying array
 only.If the elements are stored in the array properly i can perform 
 sorting.
 
 please tell me how to extract a specific field from mysql database and
 store it in array...
 
 AHThen you have many ways to sort. Look at : sort(), asort(), arsort(), usort(), 
uasort() etc.
 AH
 AHBest regards,
 AHAndrey Hristov
 AH
 AH- Original Message - 
 AHFrom: Uma Shankari T. [EMAIL PROTECTED]
 AHTo: [EMAIL PROTECTED]
 AHSent: Monday, March 18, 2002 12:25 PM
 AHSubject: [PHP] Store data in array
 AH
 AH
 AH 
 AH 
 AH Hello,
 AH 
 AH Anyone can please tell me how to store the row details fetched from
 AH database to array so that to sort the same array after storing
 AH 
 AH 
 AH -Uma
 AH 
 AH 
 AH -- 
 AH PHP General Mailing List (http://www.php.net/)
 AH To unsubscribe, visit: http://www.php.net/unsub.php
 AH 
 AH 
 AH
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 


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




[PHP] PHP session ID not unique or session_register problems

2002-03-18 Thread Matej Kovacic

Hi!

I am a kind of newbie in PHP programming, but I have found an interesting
problem and some php guys I know were unable to help me to solve it. So I am
coming here with my question...

I have written a little more advanced counter, which should be included in
other PHP scripts in website.
It uses cookies, which expire in one year. That helps me to determine which
users are coming back to the website. It also uses sessions (session
cookies) to detect how one user is moving in the website in one session.
Program uses three MySQL tables - table of cookies (cookie ID, number of
visits), table of sessions (session ID, cookie ID, IP, browser,...) and
table of visited subpages in the website (session ID, visited location).

The program flow is simple:
1. Check the cookies. If user do not have a cookie, send it to him. Else
find cookie ID in the database (first table) and increase the counter.
2. Check session ID. If session is not registered, register it and set
'number of session visits counter' to 1, AND save session ID (+ cookie ID,
IP,...) to the second MySQL table.
If session is already registered, just increase the session visits counter.
3. Save session ID and visited location (I use the $REQUEST_URI variable) to
the third MySQL table.

It seems OK, but see what happened.
I explicitely said that if ($sess_visits == 1), variable $sessid is saved to
the second table. That means that $sessid must be unique - it should appear
in a table just once.
But when I exported data from table, I found that some $sessid appeared
twice or three times!

What could be the problem???

See a little bit of my code:

  ini_set(session.cookie_lifetime, 0);

  // Initialize session
  session_start();

  // Register session and set number of session visits variable to 1
  if (!session_is_registered('sess_visits')) {
  session_register('sess_visits');
  $sess_visits = 1;
  }
  else {
$sess_visits++;
  }

  if ($sess_visits == 1) {
...
// Save session, IP, etc. into database
$sql = INSERT INTO wc_sessionident SET sessid = '$sessid', ...;
...
  }

bye, Matej


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




[PHP] Re: Replacing chars like: º OR ¿

2002-03-18 Thread andy

found it:

  # remove all others
  $filename = ereg_replace ([^a-z^0-9^-], , $filename);

cheers,
andy

Andy [EMAIL PROTECTED] schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi there,

 I am still searching for a function which is replacing all chars not
between
 [a-z] for exampe a province name like:  minºaqah-ash-shamal¿yah into valid
 chars or just deleting them. There seems to be an endless amount of those
 chars.

 Thanx for any hint,

 andy





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




Re: [PHP] Replacing chars like: º OR ¿

2002-03-18 Thread Alexander Skwar

»andy« sagte am 2002-03-18 um 14:22:47 +0100 :
 Hi there,
 
 I am still searching for a function which is replacing all chars not between
 [a-z] for exampe a province name like:  minºaqah-ash-shamal¿yah into valid
 chars or just deleting them. There seems to be an endless amount of those
 chars.

preg_replace('|[^a-z]||g', $string)

or somesuch

Alexander Skwar
-- 
How to quote:   http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:   http://www.iso-top.de  | Jabber: [EMAIL PROTECTED]
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
   Uptime: 1 day 2 hours 54 minutes

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




Re: [PHP] object reflection in php?

2002-03-18 Thread Andrey Hristov

get_object_vars(),
get_class_vars(),
get_class_methods()


Andrey

- Original Message - 
From: Filippo Veneri [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, March 18, 2002 1:28 PM
Subject: [PHP] object reflection in php?


 Is there a way to get the name of a filed
 from a variable pointing to some object?
 
 Just to make myself understood:
 
 class obj {
var $field;
function obj( $value ) {
  $this-field = $value;
}
 }
 
 $o = new obj( field value );
 
 How can i know, if possible,  that the instance of
 obj pointed to by $o has a field named field?
 
 This would be useful to write an object to a database
 without knowing its structure 'a-priori'.
 
 Thanks
 
 fbv
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 


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




Re: [PHP] PHP session ID not unique or session_register problems

2002-03-18 Thread Oliver Heinisch

At 18.03.2002  14:54, you wrote:

Even if I did´nt look closely at your code, I would suggest, that
you decrease the amount of data, diferent tables to one table.
You set an cookie, therfor you have the same effect as if you use sesssion 
vars.
So it´s easy to set and find the data, via cookie.
f.e.
table:
cookie   // here the initial cookie, you sent is stored
varname  // what kind of information should be stored
varval // the value of the varname.
timestamp // if you like
now you can save all desired informations according to cookie, have them all
in one place, and can select them to different conditions.
But, what if the user doesn´t allow cookies ??

Hi!

I am a kind of newbie in PHP programming, but I have found an interesting
problem and some php guys I know were unable to help me to solve it. So I am
coming here with my question...

I have written a little more advanced counter, which should be included in
other PHP scripts in website.
It uses cookies, which expire in one year. That helps me to determine which
users are coming back to the website. It also uses sessions (session
cookies) to detect how one user is moving in the website in one session.
Program uses three MySQL tables - table of cookies (cookie ID, number of
visits), table of sessions (session ID, cookie ID, IP, browser,...) and
table of visited subpages in the website (session ID, visited location).

The program flow is simple:
1. Check the cookies. If user do not have a cookie, send it to him. Else
find cookie ID in the database (first table) and increase the counter.
2. Check session ID. If session is not registered, register it and set
'number of session visits counter' to 1, AND save session ID (+ cookie ID,
IP,...) to the second MySQL table.
If session is already registered, just increase the session visits counter.
3. Save session ID and visited location (I use the $REQUEST_URI variable) to
the third MySQL table.

It seems OK, but see what happened.
I explicitely said that if ($sess_visits == 1), variable $sessid is saved to
the second table. That means that $sessid must be unique - it should appear
in a table just once.
But when I exported data from table, I found that some $sessid appeared
twice or three times!

What could be the problem???

See a little bit of my code:

   ini_set(session.cookie_lifetime, 0);

   // Initialize session
   session_start();

   // Register session and set number of session visits variable to 1
   if (!session_is_registered('sess_visits')) {
   session_register('sess_visits');
   $sess_visits = 1;
   }
   else {
 $sess_visits++;
   }

   if ($sess_visits == 1) {
...
 // Save session, IP, etc. into database
 $sql = INSERT INTO wc_sessionident SET sessid = '$sessid', ...;
...
   }

bye, Matej


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


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




Re: [PHP] PHP CGI

2002-03-18 Thread Thalis A. Kalfigopoulos

 Who knows? It might. Its use is growing rapidly, and it's much easier to 
 learn. A few years ago the prospect would have been unthinkable, due to 
 the vastly greater supply of Perl CGI web apps and free libraries in 
 circulation. These days the advantage is not so strong. And PHP is far 
 better optimized for the specific task of web application development.

Yes, but still Perl's CPAN is far more filling than PEAR is, for the moment at least. 
So until PEAR takes off bigtime, PERL will have a very strong card in its favor.

cheers,
--thalis


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




[PHP] PHP3 file on PHP4 server

2002-03-18 Thread kip

Hi,

The extension of my PHP files are saved as .php3 on the server and they were
worked properly before. As the hosting server upgrade to PHP4 server, those
.php3 files seem don't work and only display the blank page.
Anybody know what problem is it? And how to config this problem?

Thanks

Kenny



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




[PHP] cant get image size because of htaccess

2002-03-18 Thread andy

Hi there,

I did put a password via htaccess on my website to hide my testing
environment from other users. Now I discovered, that PHP can't read
imagefile information via getimagesize because it does not get access to
this dir anymore.

How could I add php as a user with propper password ?

Thanx for any help,

Andy





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




Re: [PHP] converting html entities outside of tags

2002-03-18 Thread Erik Price


On Friday, March 15, 2002, at 03:17  PM, Alain Dresse wrote:

 I want to allow the users of my site to insert text with anchors, bold 
 and
 italic html tags. I have filtered out all the other tags. I now want to
 convert the other , , quote, double quote and  to html entities. If 
 I use
 the function htmlspecialchars, it of course also quotes the valid 
 anchors.

I was wondering about a similar scheme to this -- here's my idea:

take all user input, and in addition to running it through 
error-checking functions, run it through htmlentities() to turn all of 
its HTML into entities.  This prevents any user-input HTML from being 
created (it becomes literal).

Then, running str_replace() for each HTML tag that I -want- to enable.  
str_replace is faster than any of the regex functions, from what I hear, 
and if I want to enable just b, i, em, strong, and a tags, it seems like 
I could just str_replace the entities for these to transform them back 
to proper tags (i.e. change lt;bgt; back to b).

This seems like an efficient way to do it, but is it any faster or 
better than just using strip_tags() ?  When I originally thought of 
doing it, it seemed like a good way of getting around the fact that 
user-specified JavaScript attributes are still allowed in 
strip_tags()-parsed text.  But now that I think about it, there's no 
difference

Erik


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




[PHP] PHP run as CGI?

2002-03-18 Thread Team GotFusion

I am developing and testing PHP on my local computer with MySQL server and PWS running 
along with PHP. My hosting site runs PHP as cgi only.

What are the differences between cgi-based PHP and how I am running AND, what 
pitfalls can I avoid in development to be sure I code in a way that the cgi-based 
PHP won't fail on my code?  

Suggestions welcome.

Thanks, T



Re: [PHP] Driving me nuts, need one second of your time

2002-03-18 Thread Erik Price


On Friday, March 15, 2002, at 06:14  PM, cosmin laslau wrote:

 Thanks in advance for whoever sees what I am sure is a glaring and 
 obvious flaw in the coding. I've been looking at it for an hours and 
 just can't get anything from where I'm standing, maybe a different 
 perpective will help.


You're declaring your connection parameter as a string db and you 
probably want it to be a variable $db.  Make sure this variable contains 
a database connection pointer.

Erik





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


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




RE: [PHP] Copy *.*

2002-03-18 Thread Robert V. Zwink

You'll probably have the most success using the system() function to execute
the xcopy command.  You shouldn't need to rewrite xcopy in php, seems like
overkill.

See: http://www.php.net/manual/en/function.system.php

Here's the result of C:\xcopy /?

XCOPY source [destination] [/A | /M] [/D[:date]] [/P] [/S [/E]] [/V] [/W]
   [/C] [/I] [/Q] [/F] [/L] [/H] [/R] [/T] [/U]
   [/K] [/N] [/O] [/X] [/Y] [/-Y] [/Z]
   [/EXCLUDE:file1[+file2][+file3]...]

  source   Specifies the file(s) to copy.
  destination  Specifies the location and/or name of new files.
  /A   Copies only files with the archive attribute set,
   doesn't change the attribute.
  /M   Copies only files with the archive attribute set,
   turns off the archive attribute.
  /D:m-d-y Copies files changed on or after the specified date.
   If no date is given, copies only those files whose
   source time is newer than the destination time.
  /EXCLUDE:file1[+file2][+file3]...
   Specifies a list of files containing strings.  When any of
the
   strings match any part of the absolute path of the file to be
   copied, that file will be excluded from being copied.  For
   example, specifying a string like \obj\ or .obj will exclude
   all files underneath the directory obj or all files with the
   .obj extension respectively.
  /P   Prompts you before creating each destination file.
  /S   Copies directories and subdirectories except empty ones.
  /E   Copies directories and subdirectories, including empty ones.
   Same as /S /E. May be used to modify /T.
  /V   Verifies each new file.
  /W   Prompts you to press a key before copying.
  /C   Continues copying even if errors occur.
  /I   If destination does not exist and copying more than one file,
   assumes that destination must be a directory.
  /Q   Does not display file names while copying.
  /F   Displays full source and destination file names while
copying.
  /L   Displays files that would be copied.
  /H   Copies hidden and system files also.
  /R   Overwrites read-only files.
  /T   Creates directory structure, but does not copy files. Does
not
   include empty directories or subdirectories. /T /E includes
   empty directories and subdirectories.
  /U   Copies only files that already exist in destination.
  /K   Copies attributes. Normal Xcopy will reset read-only
attributes.
  /N   Copies using the generated short names.
  /O   Copies file ownership and ACL information.
  /X   Copies file audit settings (implies /O).
  /Y   Suppresses prompting to confirm you want to overwrite an
   existing destination file.
  /-Y  Causes prompting to confirm you want to overwrite an
   existing destination file.
  /Z   Copies networked files in restartable mode.

The switch /Y may be preset in the COPYCMD environment variable.
This may be overridden with /-Y on the command line.

-Original Message-
From: jtjohnston [mailto:[EMAIL PROTECTED]]
Sent: Sunday, March 17, 2002 3:10 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Copy /


Does anyone know of another snippet any place where I can copy *.*
(files and all sub-directories) from one drive to another? In other
words, a backing-up function. The snippet I got from
http://www.php.net/manual/en/function.copy.php has been a disaster.

John


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




=?x-unknown?q?Re=3A_=5BPHP=5D_Replacing_chars_like=3A_=BA_OR?==?x-unknown?q?_=BF?=

2002-03-18 Thread Rasmus Lerdorf

$new = preg_replace('/[^a-z]/i','',$old);

Note that this will also get rid of the - in this case since you
specifically asked for something that got rid of everything not a-z

-Rasmus

On Mon, 18 Mar 2002, andy wrote:

 Hi there,

 I am still searching for a function which is replacing all chars not between
 [a-z] for exampe a province name like:  minºaqah-ash-shamal¿yah into valid
 chars or just deleting them. There seems to be an endless amount of those
 chars.

 Thanx for any hint,

 andy



 --
 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] XSLT parsing causes passed by reference error

2002-03-18 Thread Erik Price


On Friday, March 15, 2002, at 06:46  PM, Edward Tanguay wrote:

 I have this hosted at my ISP. The phpinfo() shows that they have:

 Linux 2.4.3
 PHP Version 4.0.4pl1
 Sablotron XSLT support: enabled

 Which annotations are you refering to?


Ask them if they will upgrade to a PHP 4.1.x version, preferrably 
4.1.2.  I understand that there was a significant change to the XSLT 
functions in PHP between 4.0.x and 4.1.x (you can check the SourceForge 
CVS changelog for the details, but I'm almost positive of it).  That is 
really the only advice I have, since I know nothing about the inner 
workings of these extensions -- only that in my PHP 4.1.2 installation, 
everything seems to work (though I haven't done any advanced XSLT 
processing).

Good luck Edward, sorry I can't be of better help.  Oh, on second 
thought, maybe I can!  I recorded every step I made in recompiling PHP 
with XSLT (as well as MySQL) on my RH 7.2 Linux box.  If you or your ISP 
would like a copy of this document, I'll send it to you -- it details 
every step I made in setting up PHP with XSLT enabled, as well as my 
(easy) installation of expat and Sablotron (both of which are required 
for these XSLT functions).

Good luck, and btw by annotations I meant the user-input at the bottom 
of every PHP man page.


Erik





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


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




Re: [PHP] new_xmldoc won't work?

2002-03-18 Thread Erik Price


On Friday, March 15, 2002, at 07:04  PM, Edward Tanguay wrote:

 $doc = new_xmldoc('1.0');
 $root = $doc-ad_root('sites');
 $site = $root-ne_child('site','');
 $site-new_child('title','PHP.net');
 $site-new_child('url','http://www.php.net');
 $site-new_child('description','The homepge of PHP');
 $site-new_child('keywords','MySQL, PHP');

 print $doc-dumpmem();

 xslt_output_endtransform();
 ?

 Where can I get new_xmldoc()?


I could be wrong about this, but if you're trying to create a new 
instance of a class called xmldoc, then shouldn't you omit the 
underscore?

Then again, I just read the man page for xmldoc() and it doesn't seem 
like that's what you're using here.  I didn't find any reference to a 
function called new_xmldoc(), though I did see a big disclaimer that 
the DOM-using XML functions in PHP are subject to change and are 
somewhat unstable.

Erik




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


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




Re: [PHP] Replacing chars like: º OR ¿

2002-03-18 Thread Alexander Skwar

»Rasmus Lerdorf« sagte am 2002-03-18 um 07:12:21 -0800 :
 $new = preg_replace('/[^a-z]/i','',$old);
 
 Note that this will also get rid of the - in this case since you
 specifically asked for something that got rid of everything not a-z

Yes.  And to not get rid of the -, you need to specify it as the 1st
charcter, or in your case, as the 2nd:

$new = preg_replace('/[^-a-z]/i','',$old);

How do you allow [ and ]?

$new = preg_replace('/[^[]-a-z]/i','',$old);

Alexander Skwar
-- 
How to quote:   http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:   http://www.iso-top.de  | Jabber: [EMAIL PROTECTED]
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
   Uptime: 1 day 4 hours 22 minutes

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




Re: [PHP] Appropriate headers for Forcing download on IE/Mac and open with stuffit?

2002-03-18 Thread Erik Price


On Monday, March 18, 2002, at 05:03  AM, Jimmy Lantz wrote:

 and preferably also automatically let them open the file with stuffit 
 expander.
 (it works with files downloaded from a webpage/apache without PHP)

This feature depends on how the user has their browser preferences 
configured.  In IE5.1, it's Explorer - Preferences - File Helpers, 
then choose the suffix/extension of the file in particular and make sure 
that it is set to process with application or whatever, and that the 
application is Stuffit Expander.

Note I am referring only to the Mac IE 5.1 and have no experience with 
IE on Windows.


Erik






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


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




[PHP] phpinfo() printing old ./configure arguments

2002-03-18 Thread Markus Bertheau

Hello,

We recently upgraded the php apache modules to include some bugfixes and
the wddx module, but phpinfo() does still show a compilation time of
August 1 2001 and the old compilation infos.

Where do I have to dig about that?

Please cc me as I'm not on the list.

Markus Bertheau




signature.asc
Description: This is a digitally signed message part


[PHP] Re: T_CONSTANT_ENCAPSED_STRING error

2002-03-18 Thread Mahmoud

 I'm receiving Parse error: parse error, expecting
 `T_CONSTANT_ENCAPSED_STRING' in /host/plugged/index.php on line 3 error

This parse error states that the path to the script that generates the error
is /host/plugged...

 contents of homedir.php is
 ?php
 if (getenv(SERVER_ADDR) == 127.0.0.1)
 {
  $homeDir = C:/home/plugged;
 }else{
 // $homeDir = dirname(__FILE__);
  $homeDir = /home/plugged;
 }
 ?

... while this file uses the directory /home/plugged.

Is this intentional or are they both meant to be the same?

A  parse error will be reported on the line AFTER a require(_once) if the
required file does not exist. That's why I'm suspecting that file
homedir.php does not exist in the same directory as index.php.

Regards,

Mahmoud







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




Re: [PHP] object reflection in php?

2002-03-18 Thread Erik Price


On Monday, March 18, 2002, at 06:28  AM, Filippo Veneri wrote:

 Just to make myself understood:

 class obj {
   var $field;
   function obj( $value ) {
 $this-field = $value;
   }
 }

 $o = new obj( field value );

 How can i know, if possible,  that the instance of
 obj pointed to by $o has a field named field?

 This would be useful to write an object to a database
 without knowing its structure 'a-priori'.

Couldn't you just add another method called return_field_name() to the 
class?  Then you could run this method from the script and you will be 
given the value of the field name.  Your code would look like this:

class obj
{
   var $field;

   function obj($value)
   {
 $this-field = $value;
   }

   function return_field_name()
   {
 return $this-field;
   }
}

then in your code you would do something like:
?php
   $o = new obj(field value);
   print $o-return_field_name();
?

This might not work, I don't know much about OO.


Erik





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


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




[PHP] Re: T_CONSTANT_ENCAPSED_STRING error

2002-03-18 Thread Mahmoud

 I'm receiving Parse error: parse error, expecting
 `T_CONSTANT_ENCAPSED_STRING' in /host/plugged/index.php on line 3 error

This parse error states that the path to the script that generates the error
is /host/plugged...

 contents of homedir.php is
 ?php
 if (getenv(SERVER_ADDR) == 127.0.0.1)
 {
  $homeDir = C:/home/plugged;
 }else{
 // $homeDir = dirname(__FILE__);
  $homeDir = /home/plugged;
 }
 ?

... while this file uses the directory /home/plugged.

Is this intentional or are they both meant to be the same?

A  parse error will be reported on the line AFTER a require(_once) if the
required file does not exist. That's why I'm suspecting that file
homedir.php does not exist in the same directory as index.php.

Regards,

Mahmoud





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




Re: [PHP] object reflection in php?

2002-03-18 Thread Michael Kimsal

Erik Price wrote:
 
 On Monday, March 18, 2002, at 06:28  AM, Filippo Veneri wrote:
 
 Just to make myself understood:

 class obj {
   var $field;
   function obj( $value ) {
 $this-field = $value;
   }
 }

 $o = new obj( field value );

 How can i know, if possible,  that the instance of
 obj pointed to by $o has a field named field?

 This would be useful to write an object to a database
 without knowing its structure 'a-priori'.
 
 
 Couldn't you just add another method called return_field_name() to the 
 class?  Then you could run this method from the script and you will be 
 given the value of the field name.  Your code would look like this:

snip

I think you missed his point.  With your example, you still need
to know the field name, which is what he's trying to avoid.


Filippo, I think what you're looking for is:
get_object_vars
more info at
http://www.php.net/manual/en/function.get-object-vars.php

Does that help?


Michael Kimsal
http://www.phphelpdesk.com
Taking the ? out of ?php support
734-480-9961


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




Re: [PHP] Replacing chars like: º OR ¿

2002-03-18 Thread andy

so whats the difference between yours and :
$filename = ereg_replace ([^a-z^0-9^/.^=^/-], , $filename);

Andy

Alexander Skwar [EMAIL PROTECTED] schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
»Rasmus Lerdorf« sagte am 2002-03-18 um 07:12:21 -0800 :
 $new = preg_replace('/[^a-z]/i','',$old);

 Note that this will also get rid of the - in this case since you
 specifically asked for something that got rid of everything not a-z

Yes.  And to not get rid of the -, you need to specify it as the 1st
charcter, or in your case, as the 2nd:

$new = preg_replace('/[^-a-z]/i','',$old);

How do you allow [ and ]?

$new = preg_replace('/[^[]-a-z]/i','',$old);

Alexander Skwar
--
How to quote: http://learn.to/quote (german) http://quote.6x.to (english)
Homepage: http://www.iso-top.de  | Jabber: [EMAIL PROTECTED]
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
   Uptime: 1 day 4 hours 22 minutes



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




[PHP] How to get the IP of a visitor

2002-03-18 Thread Ulrik Witschass

Hi, I am new to this list and to PHP, so please excuse any newbie questions
:)

Want I need to know is how to get either the ISP or the IP of the visitor of
a page. I guess this is a environment variable, but I don't know which.
Any help is greatly appreciated :)

Thanx!

Ulrik


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




RE: [PHP] How to get the IP of a visitor

2002-03-18 Thread Darren Gamble

Good day,

You'll need to check the documentation of your web server for that (or post
on the appropriate list).

You can use the phpinfo() function to see all of the environment values that
PHP sees.

Off the top of my head, I think Apache stores it in REMOTE_IP .


Darren Gamble
Planner, Regional Services
Shaw Cablesystems GP
630 - 3rd Avenue SW
Calgary, Alberta, Canada
T2P 4L4
(403) 781-4948


-Original Message-
From: Ulrik Witschass [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 18, 2002 9:57 AM
To: [EMAIL PROTECTED]
Subject: [PHP] How to get the IP of a visitor


Hi, I am new to this list and to PHP, so please excuse any newbie questions
:)

Want I need to know is how to get either the ISP or the IP of the visitor of
a page. I guess this is a environment variable, but I don't know which.
Any help is greatly appreciated :)

Thanx!

Ulrik


-- 
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] object reflection in php?

2002-03-18 Thread Coggeshall, John


Why are you going through all of this trouble, exactly?

If you are looking to store the instance of the object in the databaes,
why not just use serialize()/unserialize()?? 

John




-Original Message-
From: Erik Price [mailto:[EMAIL PROTECTED]] 
Sent: Monday, March 18, 2002 10:43 AM
To: Filippo Veneri
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] object reflection in php?



On Monday, March 18, 2002, at 06:28  AM, Filippo Veneri wrote:

 Just to make myself understood:

 class obj {
   var $field;
   function obj( $value ) {
 $this-field = $value;
   }
 }

 $o = new obj( field value );

 How can i know, if possible,  that the instance of
 obj pointed to by $o has a field named field?

 This would be useful to write an object to a database
 without knowing its structure 'a-priori'.

Couldn't you just add another method called return_field_name() to the

class?  Then you could run this method from the script and you will be 
given the value of the field name.  Your code would look like this:

class obj
{
   var $field;

   function obj($value)
   {
 $this-field = $value;
   }

   function return_field_name()
   {
 return $this-field;
   }
}

then in your code you would do something like:
?php
   $o = new obj(field value);
   print $o-return_field_name();
?

This might not work, I don't know much about OO.


Erik





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


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


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




RE: [PHP] How to get the IP of a visitor

2002-03-18 Thread Drew Lopucki

use ? phpinfo() ?.  you'll see all the variable in the http request
header.

-Original Message-
From: Ulrik Witschass [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 18, 2002 11:57 AM
To: [EMAIL PROTECTED]
Subject: [PHP] How to get the IP of a visitor


Hi, I am new to this list and to PHP, so please excuse any newbie questions
:)

Want I need to know is how to get either the ISP or the IP of the visitor of
a page. I guess this is a environment variable, but I don't know which.
Any help is greatly appreciated :)

Thanx!

Ulrik


--
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] object reflection in php?

2002-03-18 Thread Michael Kimsal

John Coggeshall wrote:
 Why are you going through all of this trouble, exactly?
 
 If you are looking to store the instance of the object in the databaes,
 why not just use serialize()/unserialize()?? 
 
 John
 
 


If you're trying to map each object property to a specific table column 
in a database, serializing wouldn't help.




Michael Kimsal
http://www.phphelpdesk.com
Taking the ? out of ?php
734-480-9961



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




Re: [PHP] Timing PHP

2002-03-18 Thread Mika Tuupola

On Mon, 18 Mar 2002, Stig Kronback wrote:

 I need to see how long it takes for my php-scripts to
 execute, what can I do, doesn't PHP include a function
 that will show that information?

PEAR has a benchmark class which does just that:

http://chora.php.net/cvs.php/pear/Benchmark

-- 
Mika Tuupola  http://www.appelsiini.net/~tuupola/


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




RE: [PHP] How to get the IP of a visitor

2002-03-18 Thread Sean @ InterConnect.is.it

$HTTP_SERVER_VARS['REMOTE_ADDR']
getenv(REMOTE_ADDR)
$REMOTE_ADDR
... there are others too

On the same topic, what do you folks think is the best way? meaning most
cross-platform functional, fastest (if at all important for this), anything
else that could help make a decision.

Sean

-Original Message-
From: Drew Lopucki [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 18, 2002 12:08 PM
To: Ulrik Witschass; [EMAIL PROTECTED]
Subject: RE: [PHP] How to get the IP of a visitor


use ? phpinfo() ?.  you'll see all the variable in the http request
header.

-Original Message-
From: Ulrik Witschass [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 18, 2002 11:57 AM
To: [EMAIL PROTECTED]
Subject: [PHP] How to get the IP of a visitor


Hi, I am new to this list and to PHP, so please excuse any newbie questions
:)

Want I need to know is how to get either the ISP or the IP of the visitor of
a page. I guess this is a environment variable, but I don't know which.
Any help is greatly appreciated :)

Thanx!

Ulrik


--
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] Saving data with cookies

2002-03-18 Thread Mika Tuupola

On Sun, 17 Mar 2002 [EMAIL PROTECTED] wrote:

 input type=text name=name_of_var[] -- this is an arrayvaraible every 
 field the same name !
 the form will then submit an (one) array, which could be stored in your 
 database
 (For I´m not shure how it will be saved, I would save this array as an
 something separated text.)

serialize() is your friend.

http://www.php.net/manual/en/function.serialize.php


-- 
Mika Tuupola  http://www.appelsiini.net/~tuupola/


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




Re: [PHP] How to get the IP of a visitor

2002-03-18 Thread mnc

On Mon, 18 Mar 2002, Ulrik Witschass wrote:
 Hi, I am new to this list and to PHP, so please excuse any newbie questions
 :)
 
 Want I need to know is how to get either the ISP or the IP of the visitor of
 a page. I guess this is a environment variable, but I don't know which.
 Any help is greatly appreciated :)

It's $REMOTE_ADDR.

The quickest way to see which variables are available is to stick the 
function phpinfo() into your page.

miguel


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




RE: [PHP] $_SESSION / Windows doesn't work!?

2002-03-18 Thread Ford, Mike [LSS]

 -Original Message-
 From: Hiroshi Ayukawa [mailto:[EMAIL PROTECTED]]
 Sent: 18 March 2002 05:11
 
 I'm trying to use $_SESSION on Windows2000+PHP4.1.2 binary version.
 But it seems that $_SESSION doesn't work, even in the 
 simplest samples 
 like;

I think this is acknowledged as broken in version 4.1.2 in general.  As you 
discovered, sticking to the old behaviour is the best workaround.

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning  Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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




Re: [PHP] Replacing chars like: º OR ¿

2002-03-18 Thread Alexander Skwar

»andy« sagte am 2002-03-18 um 17:00:16 +0100 :
 so whats the difference between yours and :
 $filename = ereg_replace ([^a-z^0-9^/.^=^/-], , $filename);

You've got quite some ^ to much in there, I'd think.  If I understand it
correctly, you'd also not remove the ^ character, because you've mentioned
this char quite sume times.  The ^ has only a special meaning, if it's
the 1st character in a [] group.

Alexander Skwar
-- 
How to quote:   http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:   http://www.iso-top.de  | Jabber: [EMAIL PROTECTED]
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
   Uptime: 1 day 6 hours 26 minutes

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




[PHP] Sablotron and LINUX trouble

2002-03-18 Thread Mike Eynon

Howdy all.

I have got the Sablotron XSLT extension working in Windows, but now am
having trouble getting it to work on my LINUX servers.

I have tried reading http://www.devshed.com/Server_Side/XML/XSLTrans/print
to find the answers (which I got from earlier posts), but it doesn't seem to
give me what I need.

I have downloaded the latest 4.1.2 php from php.net, which is supposed to
contain the Sablotron stuff.  When I configure before the build with the
line:
./configure' '--with-mysql' '--with-gd' '--with-xslt-sablot'
'--enable-xslt-sablot' '--with-xslt' '--with-apxs=/usr/local/apache/bin/apxs

I get no errors.  I then make without errors, and finally 'make install'
without errors.

BUT!  When I do a phpinfo(), I do not see the xslt extension being loaded,
and when I make a call to xslt_create(), I get the following error:
Fatal error: Call to undefined function: xslt_create() in
/usr/local/apache/htdocs/help/index.php on line 45

When I go and look into the config.status file, I see the following:
checking whether to enable xslt support... no
checking whether to enable the XSLT Sablotron backend... yes
checking libexpat dir for Sablotron XSL support... no

When I try to just have --enable-xslt, I get an error in the configure
script:
configure: error: not found. Please re-install the Sablotron distribution

What am I doing wrong?

// Mike Eynon
// www.MikeEynon.com
// 1366 Bulb Ave
// Santa Cruz, CA  95062
// [EMAIL PROTECTED]
// 831.588.2388 (cell)



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




[PHP] Sessions

2002-03-18 Thread Morten Nielsen

Hi,

I got a page that is being reloaded a lot. In the bigging I register a
Session variable with the SESSION_START and SESSION_REGISTER functions.
Is it wrong that I keep registering the session?
Should I also unregister the session at the bottom of the page?

Regards,
Morten



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




Re: [PHP] Sessions

2002-03-18 Thread Andrey Hristov

not the session is registered but a variable in the session jar.


Andrey

- Original Message - 
From: Morten Nielsen [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, March 18, 2002 7:45 PM
Subject: [PHP] Sessions


 Hi,
 
 I got a page that is being reloaded a lot. In the bigging I register a
 Session variable with the SESSION_START and SESSION_REGISTER functions.
 Is it wrong that I keep registering the session?
 Should I also unregister the session at the bottom of the page?
 
 Regards,
 Morten
 
 
 
 -- 
 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: building forms from what the MySQL table looks like

2002-03-18 Thread Chris Seymour

Hi Justin,
You might want to take a look at CodeCharge (www.codecharge.com).

Thanks.

Chris


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




[PHP] Parse Error Suggestions?

2002-03-18 Thread Mike At Spy


Anyone have any suggestions for getting better reporting on a generic Parse
Error?  Code is falling to the end of the script, and I can't find a problem
anywhere.

I looked on the PHP site for error reporting functions, but apparently they
do not handle Parse Errors.

Thanks,

-Mike



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




[PHP] Retrieving Windows 98/NT/XP Login with PHP - Possible?

2002-03-18 Thread Shaun :p

I have created a simple intranet server within my home for my family. I am
running Apache 1.3.23 and PHP 4. Everything works fine, except that I would
like to be able to tailor the main webpage to whichever person visits it -
but by using their windows login ID instead of having to get them to enter a
username when the page is visited... Is this possible? Basically, all I need
to know is:

Can I use php to retrieve any user information that will be unique to each
persons login?

Any help appeciated,

Shaun



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




Re: [PHP] Sessions

2002-03-18 Thread pong-TC

[EMAIL PROTECTED] writes:
Hi,

I got a page that is being reloaded a lot. In the bigging I register a
Session variable with the SESSION_START and SESSION_REGISTER functions.
Is it wrong that I keep registering the session?
Should I also unregister the session at the bottom of the page?

Regards,
Morten


I think you should register a variable once.  I keep checking its value on
other pages that you want to.  You can use session_destroy when you don't
want to keep track of session ie. logout page.

Hope, this would help.


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




Re: [PHP] Parse Error Suggestions?

2002-03-18 Thread mnc

On Mon, 18 Mar 2002, Mike At Spy wrote:
 Anyone have any suggestions for getting better reporting on a generic
 Parse Error?  Code is falling to the end of the script, and I can't find
 a problem anywhere.

I'd guess you left a curly brace open. Try opening the file in an editor 
that lets you balance your braces.

miguel


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




RE: [PHP] Parse Error Suggestions?

2002-03-18 Thread Darren Gamble

Good day,

It's not really possible to have an error reporting function on a parse
error.  If there is a parse error, then the program can not be run, period.


Darren Gamble
Planner, Regional Services
Shaw Cablesystems GP
630 - 3rd Avenue SW
Calgary, Alberta, Canada
T2P 4L4
(403) 781-4948


-Original Message-
From: Mike At Spy [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 18, 2002 10:53 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Parse Error Suggestions?



Anyone have any suggestions for getting better reporting on a generic Parse
Error?  Code is falling to the end of the script, and I can't find a problem
anywhere.

I looked on the PHP site for error reporting functions, but apparently they
do not handle Parse Errors.

Thanks,

-Mike



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

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




[PHP] help with date formatting

2002-03-18 Thread Ryan

Hi, I'm trying to create an events page, where it shows the posted
events.  I enter data using phpmyadmin.  Currently, the ouput is like
this:


Conference in New York
2002-03-06

There is going to be a conference in New York next week.


I'm having trouble with the formatting of the date.  I'm using the type
date with the function now, so it shows the current date when I post an
event.  Here is what I would like:


Conference in New York
Wednesday, March 5th, 2002

There is going to be a conference in New York next week.


Thanks for any help.

-- 
Ryan Spangler
428 N Harmony Ln, Apt. 3
Whitewater, WI 53190
(262) 473-8392
[EMAIL PROTECTED]

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




Re: [PHP] pdflib

2002-03-18 Thread Ben Edwards

This looks good, however when I try the examples I get:

%PDF-1.3 3 0 obj  endobj 4 0 obj  stream 2.834646 0 0 2.834646 0 841.89 
cm 2 J 0.2 w BT /F1 5.64 Tf ET BT 11 -16.692 Td (Hello World !) Tj ET 
endstream endobj 5 0 obj  endobj 1 0 obj  endobj 2 0 obj   endobj 
6 0 obj  endobj 7 0 obj  endobj xref 0 8 00 65535 f 000337 
0 n 000424 0 n 09 0 n 87 0 n 000236 
0 n 000512 0 n 000586 0 n trailer  startxref 664 %%EOF

Rather than acrobat being started.  Any ideas?

ben

At 03:19 18/03/2002, Richard Baskett wrote:

Or look into fpdf.org.. I have it dynamically generate my invoices every
month :)  Great class indeed!

Rick

When one door closes, another opens; but we often look so long and so
regretfully upon the closed door that we do not see the one which has opened
for us. - Alexander Graham Bell

  From: Ben Edwards [EMAIL PROTECTED]
  Date: Sun, 17 Mar 2002 20:03:55 +
  To: [EMAIL PROTECTED]
  Subject: [PHP] pdflib
 
  I have a html report and am looking into using phplib to generate a pdf
  instead.  I have got it installed and started experimenting with it but
  ether it is extremely convoluted or I am missing something.  How would I
  create a simple list report (the type you would do in a table).  It seems
  all I can to is specify X/Y coordinates and print text.  Don't know how
  many pages the report will be for a start.
 
  Ben
 
  
  * Ben Edwards  +44 (0)117 9400 636 *
  * Critical Site Builderhttp://www.criticaldistribution.com *
  * online collaborative web authoring content management system *
  * i-Contact Progressive Video  http://www.videonetwork.org *
  * Smashing the Corporate image   http://www.subvertise.org *
  * Bristol Indymedia   http://bristol.indymedia.org *
  * Bristol's radical news http://www.bristle.org.uk *
  * PGP : F0CA 42B8 D56F 28AD 169B  49F3 3056 C6DB 8538 EEF8 *
  
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php


* Ben Edwards  +44 (0)117 9400 636 *
* Critical Site Builderhttp://www.criticaldistribution.com *
* online collaborative web authoring content management system *
* i-Contact Progressive Video  http://www.videonetwork.org *
* Smashing the Corporate image   http://www.subvertise.org *
* Bristol Indymedia   http://bristol.indymedia.org *
* Bristol's radical news http://www.bristle.org.uk *
* PGP : F0CA 42B8 D56F 28AD 169B  49F3 3056 C6DB 8538 EEF8 *




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


RE: [PHP] Parse Error Suggestions?

2002-03-18 Thread Mike At Spy



 On Mon, 18 Mar 2002, Mike At Spy wrote:
  Anyone have any suggestions for getting better reporting on a generic
  Parse Error?  Code is falling to the end of the script, and I can't find
  a problem anywhere.

 I'd guess you left a curly brace open. Try opening the file in an editor
 that lets you balance your braces.


I thought the same thing exactly - but I have gone over them a dozen times
and I am getting nothing!

In fact, shouldn't any script run before the error?  i.e. - shouldn't a
print or echo before any script runs produce something?  Mine isn't!

-Mike



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




Re: [PHP] help with date formatting

2002-03-18 Thread Mark Heintz PHP Mailing Lists


Since you're using phpmyadmin, I'm assuming you're using mysql.  You could
use the built-in date and time functions to do the formatting when
selecting your date field.  Check here:

http://www.mysql.com/doc/D/a/Date_and_time_functions.html

mh.

On Mon, 18 Mar 2002, Ryan wrote:

 Hi, I'm trying to create an events page, where it shows the posted
 events.  I enter data using phpmyadmin.  Currently, the ouput is like
 this:

 
 Conference in New York
 2002-03-06

 There is going to be a conference in New York next week.
 

 I'm having trouble with the formatting of the date.  I'm using the type
 date with the function now, so it shows the current date when I post an
 event.  Here is what I would like:

 
 Conference in New York
 Wednesday, March 5th, 2002

 There is going to be a conference in New York next week.
 

 Thanks for any help.

 --
 Ryan Spangler
 428 N Harmony Ln, Apt. 3
 Whitewater, WI 53190
 (262) 473-8392
 [EMAIL PROTECTED]


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




[PHP] permission denied using COPY function?

2002-03-18 Thread Paul Garton

Trying to use the COPY function to allow user uploads to a site,
along the lines of: 

copy(temp directory, directory on my server). 

However, I'm getting an error: 

Warning: Unable to create 'directory/image name': Permission denied
in myPHPfile on line x (where x is the COPY function).

I've set owner permission to RWX on both the PHP file where the
function is, and the directory to which the files are being uploaded.
Any ideas why I'm still getting permission denied?

Apologies if this question has come around before.

__
Do You Yahoo!?
Yahoo! Sports - live college hoops coverage
http://sports.yahoo.com/

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




Re: [PHP] help with date formatting

2002-03-18 Thread Ben Edwards

I use string manipulation on the date, basically split it into $day, $month 
and $year and use this to product formatted output.

Ben

At 17:51 18/03/2002, Ryan wrote:

Hi, I'm trying to create an events page, where it shows the posted
events.  I enter data using phpmyadmin.  Currently, the ouput is like
this:


Conference in New York
2002-03-06

There is going to be a conference in New York next week.


I'm having trouble with the formatting of the date.  I'm using the type
date with the function now, so it shows the current date when I post an
event.  Here is what I would like:


Conference in New York
Wednesday, March 5th, 2002

There is going to be a conference in New York next week.


Thanks for any help.

--
Ryan Spangler
428 N Harmony Ln, Apt. 3
Whitewater, WI 53190
(262) 473-8392
[EMAIL PROTECTED]

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


* Ben Edwards  +44 (0)117 9400 636 *
* Critical Site Builderhttp://www.criticaldistribution.com *
* online collaborative web authoring content management system *
* i-Contact Progressive Video  http://www.videonetwork.org *
* Smashing the Corporate image   http://www.subvertise.org *
* Bristol Indymedia   http://bristol.indymedia.org *
* Bristol's radical news http://www.bristle.org.uk *
* PGP : F0CA 42B8 D56F 28AD 169B  49F3 3056 C6DB 8538 EEF8 *




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


Re: [PHP] help with date formatting

2002-03-18 Thread mnc

On Mon, 18 Mar 2002, Ryan wrote:
 Hi, I'm trying to create an events page, where it shows the posted
 events.  I enter data using phpmyadmin.  Currently, the ouput is like
 this:
 
 2002-03-06
 
 I'm having trouble with the formatting of the date.  I'm using the type
 date with the function now, so it shows the current date when I post an
 event.  Here is what I would like:
 
 Wednesday, March 5th, 2002

I'm guessing you're fetching the date out of a MySQL table.

Use strtotime() to convert that into a timestamp, then use date() to 
convert that into the format you want. Both are well-documented in the 
manual.

miguel


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




RE: [PHP] Parse Error Suggestions?

2002-03-18 Thread Ben Edwards

Not sure exactly what your code is but if you try to pass a literal where a 
reference type parameter is defined this produces a blank page.

function test( $var ) { echo $var }

if you call with test( hello ) you get NO output.

Ben

At 18:01 18/03/2002, Mike At Spy wrote:


 
  On Mon, 18 Mar 2002, Mike At Spy wrote:
   Anyone have any suggestions for getting better reporting on a generic
   Parse Error?  Code is falling to the end of the script, and I can't find
   a problem anywhere.
 
  I'd guess you left a curly brace open. Try opening the file in an editor
  that lets you balance your braces.


I thought the same thing exactly - but I have gone over them a dozen times
and I am getting nothing!

In fact, shouldn't any script run before the error?  i.e. - shouldn't a
print or echo before any script runs produce something?  Mine isn't!

-Mike



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


* Ben Edwards  +44 (0)117 9400 636 *
* Critical Site Builderhttp://www.criticaldistribution.com *
* online collaborative web authoring content management system *
* i-Contact Progressive Video  http://www.videonetwork.org *
* Smashing the Corporate image   http://www.subvertise.org *
* Bristol Indymedia   http://bristol.indymedia.org *
* Bristol's radical news http://www.bristle.org.uk *
* PGP : F0CA 42B8 D56F 28AD 169B  49F3 3056 C6DB 8538 EEF8 *




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


Re: [PHP] pdflib

2002-03-18 Thread mnc

On Mon, 18 Mar 2002, Ben Edwards wrote:
 This looks good, however when I try the examples I get:
 
 %PDF-1.3 3 0 obj  endobj 4 0 obj  stream 2.834646 0 0 2.834646 0 841.89 
 cm 2 J 0.2 w BT /F1 5.64 Tf ET BT 11 -16.692 Td (Hello World !) Tj ET 
 endstream endobj 5 0 obj  endobj 1 0 obj  endobj 2 0 obj   endobj 
 6 0 obj  endobj 7 0 obj  endobj xref 0 8 00 65535 f 000337 
 0 n 000424 0 n 09 0 n 87 0 n 000236 
 0 n 000512 0 n 000586 0 n trailer  startxref 664 %%EOF
 
 Rather than acrobat being started.  Any ideas?

  header('Content-Type: application/pdf');

miguel


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




[PHP] Re: help with date formatting

2002-03-18 Thread Joshua E Minnie


Ryan [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi, I'm trying to create an events page, where it shows the posted
 events.  I enter data using phpmyadmin.  Currently, the ouput is like
 this:

 
 Conference in New York
 2002-03-06

 There is going to be a conference in New York next week.
 

 I'm having trouble with the formatting of the date.  I'm using the type
 date with the function now, so it shows the current date when I post an
 event.  Here is what I would like:

 
 Conference in New York
 Wednesday, March 5th, 2002

 There is going to be a conference in New York next week.
 


If you are using the mktime() to make a UNIX timestamp you could do
something like this:

?
$conftime = mktime($hour, $minute, $seconds, $month, $day, $year);

echo date(l, F jS, Y, $conftime);
?


--
Joshua E Minnie
CIO
[EMAIL PROTECTED]

Don't work for recognition, but always do work worthy of recognition.




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




[PHP] Creating arrays using results from MySQL query

2002-03-18 Thread Mullin, Reginald

Hi Guys,

I've been experiencing some problems when trying to build 3 arrays with the
ID values of all of the groups a user belongs to.  (I then want to register
these arrays into the current session).  The arrays only appear to be
getting the first value (group ID) instead of all of the values the user
belongs to.  What am I doing wrong here?

My code looks like this:

File: login.php
# if $employee_1, query db workgroups table to check if $emp_login_id
belongs to any groups
$sql_2 = SELECT * FROM workgroups WHERE emp_id='$emp_login_id';
$result_2 = @mysql_query($sql_2) or die (mysql_error());
$rows = mysql_num_rows($result_2);
$employee_2 = mysql_fetch_array($result_2);
# if match, set workgroups login variables in array, then register
workgroups login variables in session
if ($employee_2){
$emp_login_wkgrp_id = array ();
$emp_login_grp_id = array ();
$emp_login_role_id = array ();
for ($i=0; $i$rows; $i++){
$emp_login_wkgrp_id[$i] = $employee_2[wkgrp_id];
$emp_login_grp_id[$i] = $employee_2[grp_id];
$emp_login_role_id[$i] = $employee_2[role_id];
}
session_register('emp_login_wkgrp_id');
session_register('emp_login_grp_id');
session_register('emp_login_role_id');
}

O  From Now 'Till Then,
\-Reginald Alex Mullin
/\  212-894-1690



**
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the postmaster at [EMAIL PROTECTED]


www.sothebys.com
**


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




[PHP] FPDF (was Re: [PHP] pdflib)

2002-03-18 Thread Ben Edwards

sorry, should of made it clear I amusing FPDF (http://fpdf.org/) library 
which looks like it douse the headers for you.

Ben

At 18:05 18/03/2002, [EMAIL PROTECTED] wrote:

On Mon, 18 Mar 2002, Ben Edwards wrote:
  This looks good, however when I try the examples I get:
 
  %PDF-1.3 3 0 obj  endobj 4 0 obj  stream 2.834646 0 0 2.834646 0 
 841.89
  cm 2 J 0.2 w BT /F1 5.64 Tf ET BT 11 -16.692 Td (Hello World !) Tj ET
  endstream endobj 5 0 obj  endobj 1 0 obj  endobj 2 0 obj   endobj
  6 0 obj  endobj 7 0 obj  endobj xref 0 8 00 65535 f 000337
  0 n 000424 0 n 09 0 n 87 0 n 
 000236
  0 n 000512 0 n 000586 0 n trailer  startxref 664 
 %%EOF
 
  Rather than acrobat being started.  Any ideas?

   header('Content-Type: application/pdf');

miguel


* Ben Edwards  +44 (0)117 9400 636 *
* Critical Site Builderhttp://www.criticaldistribution.com *
* online collaborative web authoring content management system *
* i-Contact Progressive Video  http://www.videonetwork.org *
* Smashing the Corporate image   http://www.subvertise.org *
* Bristol Indymedia   http://bristol.indymedia.org *
* Bristol's radical news http://www.bristle.org.uk *
* PGP : F0CA 42B8 D56F 28AD 169B  49F3 3056 C6DB 8538 EEF8 *




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


[PHP] Re: help with date formatting

2002-03-18 Thread Ryan

On Mon, 18 Mar 2002 11:51:07 -0600
Ryan [EMAIL PROTECTED] wrote:

By, the way I'm getting the date from a MySQL database.  The posted date
variable is stored as the date type in the MySQL database so it comes
out like this 2002-03-06.  Should I convert the date into a time stamp
or how should I do this.  Let me know what would be the most efficient
and best way to do this.  Thanks.



 Hi, I'm trying to create an events page, where it shows the posted
 events.  I enter data using phpmyadmin.  Currently, the ouput is like
 this:
 
 
 Conference in New York
 2002-03-06
 
 There is going to be a conference in New York next week.
 
 
 I'm having trouble with the formatting of the date.  I'm using the
 type date with the function now, so it shows the current date when I
 post an event.  Here is what I would like:
 
 
 Conference in New York
 Wednesday, March 5th, 2002
 
 There is going to be a conference in New York next week.
 
 
 Thanks for any help.
 
 -- 
 Ryan Spangler
 428 N Harmony Ln, Apt. 3
 Whitewater, WI 53190
 (262) 473-8392
 [EMAIL PROTECTED]


-- 
Ryan Spangler
428 N Harmony Ln, Apt. 3
Whitewater, WI 53190
(262) 473-8392
[EMAIL PROTECTED]

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




Re: [PHP] Creating arrays using results from MySQL query

2002-03-18 Thread Mark Heintz PHP Mailing Lists


You have to call mysql_fetch_array for each record in your result set...

$emp_login_wkgrp_id = array ();
$emp_login_grp_id = array ();
$emp_login_role_id = array ();
$i = 0;
while($employee_2 = mysql_fetch_array($result_2)){
  $emp_login_wkgrp_id[$i] = $employee_2[wkgrp_id];
  $emp_login_grp_id[$i] = $employee_2[grp_id];
  $emp_login_role_id[$i] = $employee_2[role_id];
  $i++;
}

mysql_fetch_array will return false when you run out of results, breaking
the while loop.

Check the manual for more info:
http://www.php.net/manual/en/function.mysql-fetch-array.php


mh.


On Mon, 18 Mar 2002, Mullin, Reginald wrote:

 Hi Guys,

 I've been experiencing some problems when trying to build 3 arrays with the
 ID values of all of the groups a user belongs to.  (I then want to register
 these arrays into the current session).  The arrays only appear to be
 getting the first value (group ID) instead of all of the values the user
 belongs to.  What am I doing wrong here?

 My code looks like this:

 File: login.php
 # if $employee_1, query db workgroups table to check if $emp_login_id
 belongs to any groups
 $sql_2 = SELECT * FROM workgroups WHERE emp_id='$emp_login_id';
 $result_2 = @mysql_query($sql_2) or die (mysql_error());
 $rows = mysql_num_rows($result_2);
 $employee_2 = mysql_fetch_array($result_2);
 # if match, set workgroups login variables in array, then register
 workgroups login variables in session
 if ($employee_2){
   $emp_login_wkgrp_id = array ();
   $emp_login_grp_id = array ();
   $emp_login_role_id = array ();
   for ($i=0; $i$rows; $i++){
   $emp_login_wkgrp_id[$i] = $employee_2[wkgrp_id];
   $emp_login_grp_id[$i] = $employee_2[grp_id];
   $emp_login_role_id[$i] = $employee_2[role_id];
   }
   session_register('emp_login_wkgrp_id');
   session_register('emp_login_grp_id');
   session_register('emp_login_role_id');
 }

 O  From Now 'Till Then,
 \-Reginald Alex Mullin
 /\  212-894-1690



 **
 This email and any files transmitted with it are confidential and
 intended solely for the use of the individual or entity to whom they
 are addressed. If you have received this email in error please notify
 the postmaster at [EMAIL PROTECTED]


 www.sothebys.com
 **


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




[PHP] Two easy HTML/CSS questions

2002-03-18 Thread Phil Schwarzmann

I know I shouldn't be asking these questions on this mailing list but
you guys are ALWAYS EXTREMELY helpful...
 
1) I want a a text link to change color when the mouse is hovering over
top of it.  How do I do this?  Im sure it's some CSS thingy.
 
2) Is it possible to make a text field smaller when using forms. 
Let's say I'm using font size 1, I want the text field to be just as
small as the rest of text.
 
Thanks again



Re: [PHP] Parse Error Suggestions?

2002-03-18 Thread Jason Wong

On Tuesday 19 March 2002 02:01, Mike At Spy wrote:
  On Mon, 18 Mar 2002, Mike At Spy wrote:
   Anyone have any suggestions for getting better reporting on a generic
   Parse Error?  Code is falling to the end of the script, and I can't
   find a problem anywhere.
 
  I'd guess you left a curly brace open. Try opening the file in an editor
  that lets you balance your braces.

 I thought the same thing exactly - but I have gone over them a dozen times
 and I am getting nothing!

 In fact, shouldn't any script run before the error?  i.e. - shouldn't a
 print or echo before any script runs produce something?  Mine isn't!

The *whole* file gets parsed *before* any code is executed.

Check that you don't have any missing semi-colons (;)   -- no, that's not a 
smiley.



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

/*
Style may not be the answer, but at least it's a workable alternative.
*/

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




Re: [PHP] Re: help with date formatting

2002-03-18 Thread JSheble


I always use the mySQL DATE_FORMAT function in my queries themselves...

SELECT DATE_FORMAT( someDatField, %m/%d/%Y ) as thedate FROM someTable


At 12:23 PM 3/18/2002 -0600, Ryan wrote:
On Mon, 18 Mar 2002 11:51:07 -0600
Ryan [EMAIL PROTECTED] wrote:

By, the way I'm getting the date from a MySQL database.  The posted date
variable is stored as the date type in the MySQL database so it comes
out like this 2002-03-06.  Should I convert the date into a time stamp
or how should I do this.  Let me know what would be the most efficient
and best way to do this.  Thanks.



  Hi, I'm trying to create an events page, where it shows the posted
  events.  I enter data using phpmyadmin.  Currently, the ouput is like
  this:
 
  
  Conference in New York
  2002-03-06
 
  There is going to be a conference in New York next week.
  
 
  I'm having trouble with the formatting of the date.  I'm using the
  type date with the function now, so it shows the current date when I
  post an event.  Here is what I would like:
 
  
  Conference in New York
  Wednesday, March 5th, 2002
 
  There is going to be a conference in New York next week.
  
 
  Thanks for any help.
 
  --
  Ryan Spangler
  428 N Harmony Ln, Apt. 3
  Whitewater, WI 53190
  (262) 473-8392
  [EMAIL PROTECTED]


--
Ryan Spangler
428 N Harmony Ln, Apt. 3
Whitewater, WI 53190
(262) 473-8392
[EMAIL PROTECTED]

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


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




RE: [PHP] Two easy HTML/CSS questions

2002-03-18 Thread Hunter, Ray

Answers:

1. Yes you can do it with css.  http://www.w3schools.com/css/default.asp

2. The text field area is defined by the browse...You cannot change the size
of the actual box that is the text field...



Thank you,

Ray Hunter
Firmware Engineer

ENTERASYS NETWORKS


-Original Message-
From: Phil Schwarzmann [mailto:[EMAIL PROTECTED]] 
Sent: Monday, March 18, 2002 11:18 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Two easy HTML/CSS questions


I know I shouldn't be asking these questions on this mailing list but you
guys are ALWAYS EXTREMELY helpful...
 
1) I want a a text link to change color when the mouse is hovering over top
of it.  How do I do this?  Im sure it's some CSS thingy.
 
2) Is it possible to make a text field smaller when using forms. 
Let's say I'm using font size 1, I want the text field to be just as small
as the rest of text.
 
Thanks again



RE: [PHP] Two easy HTML/CSS questions

2002-03-18 Thread Darren Gamble

Good day,

Just to clarify, yes, you can set the size of a text field, as well as its
color, text font, border, and so on.  This is also done with css and is
outside the scope of this mailing list.


Darren Gamble
Planner, Regional Services
Shaw Cablesystems GP
630 - 3rd Avenue SW
Calgary, Alberta, Canada
T2P 4L4
(403) 781-4948


-Original Message-
From: Hunter, Ray [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 18, 2002 11:31 AM
To: 'Phil Schwarzmann'; [EMAIL PROTECTED]
Subject: RE: [PHP] Two easy HTML/CSS questions


Answers:

1. Yes you can do it with css.  http://www.w3schools.com/css/default.asp

2. The text field area is defined by the browse...You cannot change the size
of the actual box that is the text field...



Thank you,

Ray Hunter
Firmware Engineer

ENTERASYS NETWORKS


-Original Message-
From: Phil Schwarzmann [mailto:[EMAIL PROTECTED]] 
Sent: Monday, March 18, 2002 11:18 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Two easy HTML/CSS questions


I know I shouldn't be asking these questions on this mailing list but you
guys are ALWAYS EXTREMELY helpful...
 
1) I want a a text link to change color when the mouse is hovering over top
of it.  How do I do this?  Im sure it's some CSS thingy.
 
2) Is it possible to make a text field smaller when using forms. 
Let's say I'm using font size 1, I want the text field to be just as small
as the rest of text.
 
Thanks again

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




[PHP] preg_replace on digit word boundry help

2002-03-18 Thread Joe Rice


hi,
  i'm trying to replace ever digit nondigit boundary with a ,
  in a string.  i'm trying to get \d\D to be replaced with \d,\D
  and the reverse \D\d with \D,\d ... i'm not having any luck.  

$digiword = 123joe123
$replace = preg_replace(/(\d)(\D)/,\\1,\\2,$digiword);

this ends up with $replace being 123,joe456

how can i also catch the joe456 to end up with 

123,joe,456


any help would appreciated.

thanks,
joe


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




RE: [PHP] Two easy HTML/CSS questions

2002-03-18 Thread Hunter, Ray

Actually,

If I understand correctly, you want the actual text field box to be the same
size as the text (as in height)...You can only change the width of the text
field which is done by size= and this is based on characters...

Example:  input type=text name=stuff size=25  

Then the width of the text field will be 25 characters...This is for the
text and password fields...


Thank you,

Ray Hunter
Firmware Engineer

ENTERASYS NETWORKS


-Original Message-
From: Darren Gamble [mailto:[EMAIL PROTECTED]] 
Sent: Monday, March 18, 2002 11:32 AM
To: 'Hunter, Ray'; 'Phil Schwarzmann'; [EMAIL PROTECTED]
Subject: RE: [PHP] Two easy HTML/CSS questions


Good day,

Just to clarify, yes, you can set the size of a text field, as well as its
color, text font, border, and so on.  This is also done with css and is
outside the scope of this mailing list.


Darren Gamble
Planner, Regional Services
Shaw Cablesystems GP
630 - 3rd Avenue SW
Calgary, Alberta, Canada
T2P 4L4
(403) 781-4948


-Original Message-
From: Hunter, Ray [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 18, 2002 11:31 AM
To: 'Phil Schwarzmann'; [EMAIL PROTECTED]
Subject: RE: [PHP] Two easy HTML/CSS questions


Answers:

1. Yes you can do it with css.  http://www.w3schools.com/css/default.asp

2. The text field area is defined by the browse...You cannot change the size
of the actual box that is the text field...



Thank you,

Ray Hunter
Firmware Engineer

ENTERASYS NETWORKS


-Original Message-
From: Phil Schwarzmann [mailto:[EMAIL PROTECTED]] 
Sent: Monday, March 18, 2002 11:18 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Two easy HTML/CSS questions


I know I shouldn't be asking these questions on this mailing list but you
guys are ALWAYS EXTREMELY helpful...
 
1) I want a a text link to change color when the mouse is hovering over top
of it.  How do I do this?  Im sure it's some CSS thingy.
 
2) Is it possible to make a text field smaller when using forms. 
Let's say I'm using font size 1, I want the text field to be just as small
as the rest of text.
 
Thanks again



Re: [PHP] preg_replace on digit word boundry in 2 lines how about 1?

2002-03-18 Thread Joe Rice


i can do this if i do it in two line..i'm wondering if it can
be done in 1 line.

the two lines:
$replace = preg_replace(/(\d)(\D)/,\\1,\\2,$digiword);
$replace = preg_replace(/(\D)(\d)/,\\1,\\2,$replace);

tia,
joe


Joe Rice([EMAIL PROTECTED])@Mon, Mar 18, 2002 at 12:39:17PM -0600:
 
 hi,
   i'm trying to replace ever digit nondigit boundary with a ,
   in a string.  i'm trying to get \d\D to be replaced with \d,\D
   and the reverse \D\d with \D,\d ... i'm not having any luck.  
 
 $digiword = 123joe123
 $replace = preg_replace(/(\d)(\D)/,\\1,\\2,$digiword);
 
 this ends up with $replace being 123,joe456
 
 how can i also catch the joe456 to end up with 
 
 123,joe,456
 
 
 any help would appreciated.
 
 thanks,
 joe
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

-- 
How do i get rid of those words in my screen that are coming from you?

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




RE: [PHP] Two easy HTML/CSS questions

2002-03-18 Thread Adam Plocher

CSS Hover example:

style type=text/css
a:link,a:visited,a:active {color: #213C4D; text-decoration: none;}
a:hover {color: #213C4D; text-decoration: underline; }
/style

As for the size of a text field, you can set it with SIZE= but note,
netscape and IE both interpret size VERY differently... Not sure about NS6,
but NS4 will make it a lot larger than IE will.

-Original Message-
From: Hunter, Ray [mailto:[EMAIL PROTECTED]] 
Sent: Monday, March 18, 2002 10:39 AM
To: 'Darren Gamble'; Hunter, Ray; 'Phil Schwarzmann';
[EMAIL PROTECTED]
Subject: RE: [PHP] Two easy HTML/CSS questions


Actually,

If I understand correctly, you want the actual text field box to be the same
size as the text (as in height)...You can only change the width of the text
field which is done by size= and this is based on characters...

Example:  input type=text name=stuff size=25  

Then the width of the text field will be 25 characters...This is for the
text and password fields...


Thank you,

Ray Hunter
Firmware Engineer

ENTERASYS NETWORKS


-Original Message-
From: Darren Gamble [mailto:[EMAIL PROTECTED]] 
Sent: Monday, March 18, 2002 11:32 AM
To: 'Hunter, Ray'; 'Phil Schwarzmann'; [EMAIL PROTECTED]
Subject: RE: [PHP] Two easy HTML/CSS questions


Good day,

Just to clarify, yes, you can set the size of a text field, as well as its
color, text font, border, and so on.  This is also done with css and is
outside the scope of this mailing list.


Darren Gamble
Planner, Regional Services
Shaw Cablesystems GP
630 - 3rd Avenue SW
Calgary, Alberta, Canada
T2P 4L4
(403) 781-4948


-Original Message-
From: Hunter, Ray [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 18, 2002 11:31 AM
To: 'Phil Schwarzmann'; [EMAIL PROTECTED]
Subject: RE: [PHP] Two easy HTML/CSS questions


Answers:

1. Yes you can do it with css.  http://www.w3schools.com/css/default.asp

2. The text field area is defined by the browse...You cannot change the size
of the actual box that is the text field...



Thank you,

Ray Hunter
Firmware Engineer

ENTERASYS NETWORKS


-Original Message-
From: Phil Schwarzmann [mailto:[EMAIL PROTECTED]] 
Sent: Monday, March 18, 2002 11:18 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Two easy HTML/CSS questions


I know I shouldn't be asking these questions on this mailing list but you
guys are ALWAYS EXTREMELY helpful...
 
1) I want a a text link to change color when the mouse is hovering over top
of it.  How do I do this?  Im sure it's some CSS thingy.
 
2) Is it possible to make a text field smaller when using forms. 
Let's say I'm using font size 1, I want the text field to be just as small
as the rest of text.
 
Thanks again



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


[PHP] Testing for NULL

2002-03-18 Thread Jesse Warden

Hi, I am new... hope I am using this list correctly.

I am trying to test for a null value, and if it is null, then to use a
default value instead.  The login page that I have, I want to show nothing
in the username field unless it is passed a username from another PHP page
via the header function.  However, every time I write:

if($username == null){
echo Username is null;
}

It executes the echo, but only after giving me an error.  Is there a way to
suppress this error or check for an undefined instead?

J


** Scanned for Viruses **

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




Re: [PHP] Testing for NULL

2002-03-18 Thread Andrey Hristov

if (!isset($login)){
echo login undefined;
}

Best regards,
Andrey Hristov

- Original Message - 
From: Jesse Warden [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, March 18, 2002 9:09 PM
Subject: [PHP] Testing for NULL


 Hi, I am new... hope I am using this list correctly.
 
 I am trying to test for a null value, and if it is null, then to use a
 default value instead.  The login page that I have, I want to show nothing
 in the username field unless it is passed a username from another PHP page
 via the header function.  However, every time I write:
 
 if($username == null){
 echo Username is null;
 }
 
 It executes the echo, but only after giving me an error.  Is there a way to
 suppress this error or check for an undefined instead?
 
 J
 
 
 ** Scanned for Viruses **
 
 -- 
 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] Sessions and enable-trans-sid

2002-03-18 Thread Erik Price


On Saturday, March 16, 2002, at 09:04  PM, [EMAIL PROTECTED] wrote:

 I have compiled php with the enable-trans-sid (for the site I am using I
 can NOT use cookies)

 when I start a session or store something in _SESSION['varname']  
 varname
 can not be accessed on other pages

 nor is there a file in the /tmp file

 nor does my URI change with a session id

Are you forgetting to put the buck ($) in front of 
_SESSION['varname'] ?  Looks like it from the example you give above, 
unless that's a typo.

Erik




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


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




[PHP] U.S. Section 508 Guidelines

2002-03-18 Thread pong-TC

Hello All

It is quite off the topic.  I think most of you work with form while you
are using PHP.  Does anyone need to conform your form webpage to ADA
compliance?  It is a U.S. Section 508 Guidelines for handicap people to
access the webpage.  However, when it applies to the webpage that has many
form elements, it seems to be clumsy for me.  For example, I have to put
all labels in fron of text boxes, radio box, select boxes.  Does anyone
has any idea to get around and to make it pass the compliance?  I am using
the www.cast.org/bobby to test my webpage.

Thank you.
Pong



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




RE: [PHP] Creating arrays using results from MySQL query

2002-03-18 Thread Mullin, Reginald

Mark,

I'm still experiencing the same problem.  Only one record is being added to
the arrays.  There are currently two records in the DB workgroups table
matching the WHERE emp_id='$emp_login_id criteria. 

Here's the 2 records in the DB workgroups table:
FIELDS  Value#1 Value#2
wkgrp_id1   4
grp_id  111 222
emp_id  39  39
wkgrp_create_date   2002-03-16 23:45:43 -00-00 00:00:00
wkgrp_change_date   2002-03-16 23:45:43 -00-00 00:00:00
wkgrp_change_by webmaster   webmaster
wkgrp_create_by webmaster   webmaster
role_id 1   1

I'm only getting back Value#2.

Here's the modified PHP code:
File: login.php
if ($employee_2){
$emp_login_wkgrp_id = array();
$emp_login_grp_id = array();
$emp_login_role_id = array();
$i = 0;
while($employee_2 = mysql_fetch_array($result_2)){
$emp_login_wkgrp_id[$i] = $employee_2[wkgrp_id];
$emp_login_grp_id[$i] = $employee_2[grp_id];
$emp_login_role_id[$i] = $employee_2[role_id];
$i++;
}
session_register('emp_login_wkgrp_id');
session_register('emp_login_grp_id');
session_register('emp_login_role_id');
}

O  From Now 'Till Then,
\-Reginald Alex Mullin
/\  212-894-1690

 -Original Message-
 From: Mark Heintz PHP Mailing Lists [SMTP:[EMAIL PROTECTED]]
 Sent: Monday, March 18, 2002 1:26 PM
 To:   Mullin, Reginald
 Cc:   [EMAIL PROTECTED]
 Subject:  Re: [PHP] Creating arrays using results from MySQL query
 
 
 You have to call mysql_fetch_array for each record in your result set...
 
 $emp_login_wkgrp_id = array ();
 $emp_login_grp_id = array ();
 $emp_login_role_id = array ();
 $i = 0;
 while($employee_2 = mysql_fetch_array($result_2)){
   $emp_login_wkgrp_id[$i] = $employee_2[wkgrp_id];
   $emp_login_grp_id[$i] = $employee_2[grp_id];
   $emp_login_role_id[$i] = $employee_2[role_id];
   $i++;
 }
 
 mysql_fetch_array will return false when you run out of results, breaking
 the while loop.
 
 Check the manual for more info:
 http://www.php.net/manual/en/function.mysql-fetch-array.php
 
 
 mh.
 
 
 On Mon, 18 Mar 2002, Mullin, Reginald wrote:
 
  Hi Guys,
 
  I've been experiencing some problems when trying to build 3 arrays with
 the
  ID values of all of the groups a user belongs to.  (I then want to
 register
  these arrays into the current session).  The arrays only appear to be
  getting the first value (group ID) instead of all of the values the user
  belongs to.  What am I doing wrong here?
 
  My code looks like this:
 
  File: login.php
  # if $employee_1, query db workgroups table to check if $emp_login_id
  belongs to any groups
  $sql_2 = SELECT * FROM workgroups WHERE emp_id='$emp_login_id';
  $result_2 = @mysql_query($sql_2) or die (mysql_error());
  $rows = mysql_num_rows($result_2);
  $employee_2 = mysql_fetch_array($result_2);
  # if match, set workgroups login variables in array, then register
  workgroups login variables in session
  if ($employee_2){
  $emp_login_wkgrp_id = array ();
  $emp_login_grp_id = array ();
  $emp_login_role_id = array ();
  for ($i=0; $i$rows; $i++){
  $emp_login_wkgrp_id[$i] = $employee_2[wkgrp_id];
  $emp_login_grp_id[$i] = $employee_2[grp_id];
  $emp_login_role_id[$i] = $employee_2[role_id];
  }
  session_register('emp_login_wkgrp_id');
  session_register('emp_login_grp_id');
  session_register('emp_login_role_id');
  }
 
  O  From Now 'Till Then,
  \-Reginald Alex Mullin
  /\  212-894-1690
 
 
 
  **
  This email and any files transmitted with it are confidential and
  intended solely for the use of the individual or entity to whom they
  are addressed. If you have received this email in error please notify
  the postmaster at [EMAIL PROTECTED]
 
 
  www.sothebys.com
  **

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




[PHP] Re: Two easy HTML/CSS questions

2002-03-18 Thread Marcel Besancon

Hi Phil,

here's an answer to your first question. You can use colorchanging links
when put formatting code like this one:

a:link { font-family:Arial Narrow, helvetica; font-variant:small-caps;
color:black; text-decoration:none; font-size:13pt; }
a:hover { font-family:Arial Narrow, helvetica; font-variant:small-caps;
color:blue; text-decoration:underline; font-size:13pt;
background:darkgray; }
a:visited { font-family:Arial Narrow, helvetica; font-variant:small-caps;
color:black; text-decoration:none; font-size:13pt; }

into a css-file.

I'm sorry, but i don't know an answer for your second question. But like I
remember this must be possible with CSS too. But I don't know exactly how.

Hope this helps

Marcel Besancon


--
registered Fli4l-User #0388
Phil Schwarzmann [EMAIL PROTECTED] schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I know I shouldn't be asking these questions on this mailing list but
 you guys are ALWAYS EXTREMELY helpful...

 1) I want a a text link to change color when the mouse is hovering over
 top of it.  How do I do this?  Im sure it's some CSS thingy.

 2) Is it possible to make a text field smaller when using forms.
 Let's say I'm using font size 1, I want the text field to be just as
 small as the rest of text.

 Thanks again




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




Re: [PHP] unscriber please

2002-03-18 Thread Erik Price


On Sunday, March 17, 2002, at 12:20  AM, [EMAIL PROTECTED] wrote:


 Roy Daniel , ST
 IT Developer System - PT BERCA COMPUTEL
 My E-mail : [EMAIL PROTECTED]
 and : [EMAIL PROTECTED] / [EMAIL PROTECTED]
 My ICQNumber : # 103507581
 My Phone Cell : 0816-1192832


What embarrassing information to attach to an unsuccessful UNSUBSCRIBE 
request!  :)

If you still wish to unsubscribe, see the very last line of this email.


Erik






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


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




  1   2   >