Re: [PHP] Re: Date?

2002-06-09 Thread Jason Wong

On Sunday 09 June 2002 12:49, John Taylor-Johnston wrote:
 ? echo date (l., .F. .d., .Y); ?
 Sunday, June 09, 2002

 But I would use:

 ?php echo date (l., .F. .d., .Y); ?

or simply:

echo date (l F d, Y);

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

/*
Condense soup, not books!
*/


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




[PHP] error reporting

2002-06-09 Thread Scott 'INtense!' Reismanis

Hey all,
 
I recently installed Apache2, PHP4.2 on my win2k box as a module. It
works fine however say a script has a syntax error all that happens is a
blank screen is displayed. No errors are shown and thus it is very hard
to debug when I don't know what the error is, and what line it occurs
on. Have I missed some setting when installing apache? I have tried
changing the error reporting levels to no avail. Any more suggestions?
 
Regards, Scott
 



[PHP] Re: Function needed

2002-06-09 Thread Austin Marshall

Gaylen Fraley wrote:
 I am in need of a function/script that will take a directory and search all
 filenames, recursively down, for a given file.  Can anyone point me to a
 source?  Thanks.
 
 
 

$result=`grep -r 'expression' ./`;


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




[PHP] populating list menus with mysql and for statements

2002-06-09 Thread electroteque

hi i am populating a list menu with mysql , i would like to find a way to
populate a form with more than one of the same list menus in a for loop

 select name=type[]
   ?
   while ($sample = $result-fetchRow(DB_FETCHMODE_ASSOC)) {
   $typeID=$sample[typeID];
   $description=$sample[description];
$sample_type[$sample['typeID']] = $sample[description];
echo \noption value=\$typeID\ $selected$description/option;
}
?
/select

i have this within a for loop but the list only shows up once and the second
one is empty because the select from the database is finished ,

is there a way to put the information from mysql into arrays so i can use it
more than once and then i could do multiple populated list boxes ? let me
know





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




Re: [PHP] error reporting

2002-06-09 Thread Jason Wong

On Monday 10 June 2002 09:42, Scott 'INtense!' Reismanis wrote:
 Hey all,

 I recently installed Apache2, PHP4.2 on my win2k box as a module. It
 works fine however say a script has a syntax error all that happens is a
 blank screen is displayed. No errors are shown and thus it is very hard
 to debug when I don't know what the error is, and what line it occurs
 on. Have I missed some setting when installing apache? I have tried
 changing the error reporting levels to no avail. Any more suggestions?

Read php.ini, the section on error reporting and its comments. And the manual 
too.

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

/*
And I doubt complaining to the author gets you anything but a free procmail
 rule.

- Alan Cox on asking authors to document their code
*/


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




[PHP] STDIN/STDOUT in PHP

2002-06-09 Thread Jimmy Lantz

I've been looking for a way to work with stdin/stdout for a mod_rewrite's 
rewritemap.

There's a working example in Perl, (just returning the input)

#!/usr/bin/perl
$| = 1;
while (STDIN) {
   print $_;
}

I've been trying to achieve this with fopen() read and write the 
php://stdin  php://stdout .

#!/usr/local/bin/php -q
?php
$fp = fopen(php://stdin, r);
while (($buf = fgets($fp)) != false) {
 $input .= $buf;
}
fclose($fp);
$fp = fopen(php://stdout, w);
 fputs($fp, $input\n);
fclose($fp);
?


But no success.
In the apache man they say
Avoid one common mistake: never do buffered I/O on stdout! This will cause 
a deadloop!
Hence the ``$|=1'' in the above example

Could sommone give  some pointers how I could achieve the perl script above 
in php?

TIA
Jim.


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




Re: [PHP] Re: Function needed

2002-06-09 Thread Jason Wong

On Sunday 09 June 2002 17:17, Austin Marshall wrote:
 Gaylen Fraley wrote:
  I am in need of a function/script that will take a directory and search
  all filenames, recursively down, for a given file.  Can anyone point me
  to a source?  Thanks.

 $result=`grep -r 'expression' ./`;

This searches for strings within a file.

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

/*
Earth -- mother of the most beautiful women in the universe.
-- Apollo, Who Mourns for Adonais? stardate 3468.1
*/


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




Re: [PHP] Removing ^M

2002-06-09 Thread Michael Hall


As a result of my original request, I now have half a dozen ways of doing
this using php, perl, python and tr :)

I guess this is sort of on topic because there may be PHP
programmers who want to do this without writing a PHP script that
probably has to be run by a web server.

Anyway, someone on the Python list suggested this variety of tr:

tr -d '\015' infile outfile

I haven't tested this. 015 is the numeric code for \r.

Mick


On Sat, 8 Jun 2002, Steve Buehler wrote:

 I get this when running that command:
 tr: only one string may be given when deleting without squeezing repeats
 
 
 I looked at the tr man pages and it didn't help much.  I also tried using 
 '\r' and `\r` and just \r , but always get the same result.
 
 Steve
 
 At 11:07 PM 6/8/2002 +0200, you wrote:
 why not just run
  tr -d \r htmlfile.htm
 
 
 - Original Message -
 From: Michael Hall [EMAIL PROTECTED]
 To: PHP List [EMAIL PROTECTED]
 Sent: Sunday, June 09, 2002 2:40 AM
 Subject: [PHP] Removing ^M
 
 
  
  
   I am trying remove ^M characters (some kind of newline character) from an
   HTML file. I've tried all sorts of ereg_replace and sed possibilities
   but the
   things just won't go away. Does anyone have a way of removing such
   characters?
  
   TIA
  
   Mick
  
  
  
  
   --
   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
 
 
 --
 This message has been scanned for viruses and
 dangerous content by MailScanner, and is
 believed to be clean.
 ow3
 
 
 
 

-- 

n   i   n   t   i  .   c   o   m
php-python-perl-mysql-postgresql

Michael Hall [EMAIL PROTECTED]



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




[PHP] using HTTP-PUT-Method problem

2002-06-09 Thread Wolfram Kriesing

does someone have an example of a _working_ PUT-script?
i was trying $PHP_PUT_FILENAME and even trying to dump all the GLOBALS
but i couldnt find a filename which points to the PUT'-filename
how does it work? obviously not as it is in the manual :-(
copy(  $PHP_PUT_FILENAME , $PATH_TRANSLATED );
$PHP_PUT_FILENAME is always empty.
i am using the amaya to PUT, apache 1.3.19 and php 4.2.1

any ideas?

-- 
Wolfram

 ... translating template system ...
http://sourceforge.net/projects/simpletpl

... authentication system 
  http://sf.net/projects/auth




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




[PHP] Re: populating list menus with mysql and for statements

2002-06-09 Thread Andy

seperate your layers. Create a database, display and action layer. For
example:

include qry_users.inc;
include dsp_users.inc;

in qry_users.inc get your data and store them into an array var:

while($row-user)
user[] = $row-user;
}

Then in dsp_users get them out again:

foreach ($user AS $value)
echo $value;
}

Of course you have to built your code around the foreach in dsp_user;

Hope this helps

Andy

--

http://www.globosapiens.net
Global Travellers Network!





Electroteque [EMAIL PROTECTED] schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 hi i am populating a list menu with mysql , i would like to find a way to
 populate a form with more than one of the same list menus in a for loop

  select name=type[]
?
while ($sample = $result-fetchRow(DB_FETCHMODE_ASSOC)) {
$typeID=$sample[typeID];
$description=$sample[description];
 $sample_type[$sample['typeID']] = $sample[description];
 echo \noption value=\$typeID\ $selected$description/option;
 }
 ?
 /select

 i have this within a for loop but the list only shows up once and the
second
 one is empty because the select from the database is finished ,

 is there a way to put the information from mysql into arrays so i can use
it
 more than once and then i could do multiple populated list boxes ? let me
 know







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




[PHP] Re: MyCC Problem

2002-06-09 Thread Andy

maybe you do not have the propper rights set. Check your grant privillegs on
the db.

Andy

--

http://www.globosapiens.net
Global Travellers Network!



César l . aracena [EMAIL PROTECTED] schrieb im Newsbeitrag
002a01c20e80$743a3650$14ed0dd1@gateway">news:002a01c20e80$743a3650$14ed0dd1@gateway...
Hi all. I know that this isn't probably the best place to make this
question, but I uses that some of you uses MyCC to connect to a remote
MySQL DB. My connection is no problem, but when I issue a SQL command,
which tells the DB to INSERT multiple rows into one table, It gives me
an error every time. Imagine what it takes to pass a 1000 rows to the
live DB one each time. Does anyone who uses MyCC had this problem
before? Know how to solve this?

Thanks in advance,

Cesar mailto:[EMAIL PROTECTED]  Aracena
CE / MCSE+I
Neuquen, Argentina
+54.299.6356688
+54.299.4466621





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




Re: [PHP] restricting files

2002-06-09 Thread Justin French

Have you got a link for somewhere to look for a base set of functions for me
to build on?

Thx,
Justin


on 08/06/02 5:39 PM, Miguel Cruz ([EMAIL PROTECTED]) wrote:

 On Sat, 8 Jun 2002, Justin French wrote:
 When you say serve the files through a script, I assume you mean
 download.php force-feeds an MP3 (or whatever) to the browser.
 
 Is this correct?
 
 I read people have lots of problems with this...
 
 Only until they get it working (I should hope). We use it for many, many
 sites and I can't think of any problems it's caused.
 
 miguel
 


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




php-general Digest 9 Jun 2002 15:11:40 -0000 Issue 1395

2002-06-09 Thread php-general-digest-help


php-general Digest 9 Jun 2002 15:11:40 - Issue 1395

Topics (messages 101306 through 101330):

Re: Removing ^M
101306 by: Miguel Cruz
101326 by: Michael Hall

Re: how to test if rewrite rule is working
101307 by: Miguel Cruz

Function needed
101308 by: Gaylen Fraley
101321 by: Austin Marshall
101325 by: Jason Wong

PHPMyAdmin Alternative?
101309 by: John Taylor-Johnston
101314 by: César L. Aracena
101317 by: John Taylor-Johnston

Date?
101310 by: Jeremy Bowen
101311 by: John Taylor-Johnston
101316 by: John Taylor-Johnston
101319 by: Jason Wong

Re: Javascript  PHP cookies
101312 by: John Taylor-Johnston

PHP function for listing number of columns in table
101313 by: webmaster.tececo.com
101318 by: hugh danaher

Re: PHP Compile with sun 5.7
101315 by: Moussa Dahadha

error reporting
101320 by: Scott 'INtense!' Reismanis
101323 by: Jason Wong

populating list menus with mysql and for statements
101322 by: electroteque
101328 by: Andy

STDIN/STDOUT in PHP
101324 by: Jimmy Lantz

using HTTP-PUT-Method problem
101327 by: Wolfram Kriesing

Re: MyCC Problem
101329 by: Andy

Re: restricting files
101330 by: Justin French

Administrivia:

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

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

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


--

---BeginMessage---

I don't think tr expects to receive a filename on the command line. Try:

   tr -d \r  oldfile.html  newfile.html

miguel

On Sat, 8 Jun 2002, Steve Buehler wrote:
 I get this when running that command:
 tr: only one string may be given when deleting without squeezing repeats
 
 
 I looked at the tr man pages and it didn't help much.  I also tried using 
 '\r' and `\r` and just \r , but always get the same result.
 
 Steve
 
 At 11:07 PM 6/8/2002 +0200, you wrote:
 why not just run
  tr -d \r htmlfile.htm
 
 
 - Original Message -
 From: Michael Hall [EMAIL PROTECTED]
 To: PHP List [EMAIL PROTECTED]
 Sent: Sunday, June 09, 2002 2:40 AM
 Subject: [PHP] Removing ^M
 
 
  
  
   I am trying remove ^M characters (some kind of newline character) from an
   HTML file. I've tried all sorts of ereg_replace and sed possibilities
   but the
   things just won't go away. Does anyone have a way of removing such
   characters?
  
   TIA
  
   Mick
  
  
  
  
   --
   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
 
 
 --
 This message has been scanned for viruses and
 dangerous content by MailScanner, and is
 believed to be clean.
 ow3
 
 
 
 


---End Message---
---BeginMessage---


As a result of my original request, I now have half a dozen ways of doing
this using php, perl, python and tr :)

I guess this is sort of on topic because there may be PHP
programmers who want to do this without writing a PHP script that
probably has to be run by a web server.

Anyway, someone on the Python list suggested this variety of tr:

tr -d '\015' infile outfile

I haven't tested this. 015 is the numeric code for \r.

Mick


On Sat, 8 Jun 2002, Steve Buehler wrote:

 I get this when running that command:
 tr: only one string may be given when deleting without squeezing repeats
 
 
 I looked at the tr man pages and it didn't help much.  I also tried using 
 '\r' and `\r` and just \r , but always get the same result.
 
 Steve
 
 At 11:07 PM 6/8/2002 +0200, you wrote:
 why not just run
  tr -d \r htmlfile.htm
 
 
 - Original Message -
 From: Michael Hall [EMAIL PROTECTED]
 To: PHP List [EMAIL PROTECTED]
 Sent: Sunday, June 09, 2002 2:40 AM
 Subject: [PHP] Removing ^M
 
 
  
  
   I am trying remove ^M characters (some kind of newline character) from an
   HTML file. I've tried all sorts of ereg_replace and sed possibilities
   but the
   things just won't go away. Does anyone have a way of removing such
   characters?
  
   TIA
  
   Mick
  
  
  
  
   --
   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
 
 
 --
 This message has been scanned for viruses and
 dangerous content by MailScanner, and is
 believed to be clean.
 ow3
 
 
 
 

-- 

n   i   n   t   i  .   c   o   m
php-python-perl-mysql-postgresql

Michael Hall [EMAIL PROTECTED]



---End Message---
---BeginMessage---

On Sat, 8 Jun 2002, Nicole Lallande wrote:
 I have created the following htaccess file using rewrite 

Re: [PHP] Re: Function needed

2002-06-09 Thread Chris Hewitt

$result=`ls -R | grep 'expression' ./`;

HTH
Chris

Jason Wong wrote:

On Sunday 09 June 2002 17:17, Austin Marshall wrote:

Gaylen Fraley wrote:

I am in need of a function/script that will take a directory and search
all filenames, recursively down, for a given file.  Can anyone point me
to a source?  Thanks.

$result=`grep -r 'expression' ./`;


This searches for strings within a file.




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




Re: [PHP] Re: Function needed

2002-06-09 Thread Gaylen Fraley

This resricts to *nix and can be disallowed due to security constraints, but
thanks anyway.  I just wrote my own PHP routine.

--
Gaylen
PHP KISGB v4.0.5 Guest Book http://www.gaylenandmargie.com/phpwebsite/

Chris Hewitt [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 $result=`ls -R | grep 'expression' ./`;

 HTH
 Chris

 Jason Wong wrote:

 On Sunday 09 June 2002 17:17, Austin Marshall wrote:
 
 Gaylen Fraley wrote:
 
 I am in need of a function/script that will take a directory and search
 all filenames, recursively down, for a given file.  Can anyone point me
 to a source?  Thanks.
 
 $result=`grep -r 'expression' ./`;
 
 
 This searches for strings within a file.
 





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




[PHP] Formatting XML Data

2002-06-09 Thread Sebastian A.

Hello,

I have been working with XML in the recent weeks and I have recently come
across the need to format some of the data in my XML. For example I might
have a large XML file and I would like some of the text to be bold, or maybe
I would like to insert a hyper-link. Unfortunately it does not seem I can do
this with ordinary HTML tags because they will be interpreted as XML tags. I
am sure, however that there is another way of doing this. Does anyone know
how?

Thanks



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




RE: [PHP] Re: Date?

2002-06-09 Thread Bruce Karstedt

? echo date(l, F j, Y); ? works just fine for me.

Bruce Karstedt
President
Technology Consulting Associates, Ltd.
Tel: 847-735-9488
Fax: 847-735-9474


-Original Message-
From: John Taylor-Johnston [mailto:[EMAIL PROTECTED]]
Sent: Saturday, June 08, 2002 11:50 PM
To: [EMAIL PROTECTED]
Cc: Jeremy Bowen
Subject: [PHP] Re: Date?


? echo date (l., .F. .d., .Y); ?
Sunday, June 09, 2002

But I would use:

?php echo date (l., .F. .d., .Y); ?

Don't know why, but someone told me once it had something to do with
versions.

John

Jeremy Bowen wrote:

 I am having nothing but trouble with the date function. I want it to print
 out a date like this: Saturday June 8, 2002 but as soon as I put spaces or
 comma's in the string I get parse errors. I can get it to print
 SaturdayJune082002 with  ? echo date (lFdY); ? I have tried escaping
with
 \ but it seems to make no difference.



--
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] Formatting XML Data

2002-06-09 Thread Dan Hardiker

 I would like some of the text to be
 bold, or maybe I would like to insert a hyper-link. Unfortunately it
 does not seem I can do this with ordinary HTML tags because they will
 be interpreted as XML tags. I am sure, however that there is another
 way of doing this. Does anyone know how?

Have a look into XSLT... its all in the manual.


-- 
Dan Hardiker [[EMAIL PROTECTED]]
ADAM Software  Systems Engineer
First Creative Ltd



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




[PHP] Fw: Excel Spreadsheet

2002-06-09 Thread Jeremy Bowen

Hello All,

I was working on a little php today and I remembered that I had another
project that I wanted to do. I have a fairly complicated excel spreadsheet
that helps me price a service I provide and I would like to be able to have
fields on my website that can be filled in and the data passed throught the
spreadsheet (through whatever manner) and the pricing info delivered back to
the client.

I have no idea how to do this and I thought that maybe some of you have done
projects like this and would have an idea of where I should start.

 Thanks,

Jeremy



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




RE: [PHP] PHP function for listing number of columns in table

2002-06-09 Thread John Holmes

No. There is, however, a function that'll tell you how many columns are
in a result set. So, if you select all columns, then you can use that
function to find out how many columns are in the table.

www.php.net/mysql_num_fields

---John Holmes...

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, June 09, 2002 12:54 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] PHP function for listing number of columns in table
 
 Pardon the probably stupid question but,
 
 Is there a PHP function for listing number of columns in a mySQL
table?
 
 Thanks in advance
 
 JJ Harrison
 [EMAIL PROTECTED]
 www.tececo.com



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




RE: [PHP] Fw: Excel Spreadsheet

2002-06-09 Thread John Holmes

It would be better to just have PHP do the calculating for you, instead
of trying to figure out how to pass data back and forth between a
spreadsheet. You can maybe use COM for passing the data, if you still
need to do it that way.

---John Holmes...

 -Original Message-
 From: Jeremy Bowen [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, June 09, 2002 1:09 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Fw: Excel Spreadsheet
 
 Hello All,
 
 I was working on a little php today and I remembered that I had
another
 project that I wanted to do. I have a fairly complicated excel
spreadsheet
 that helps me price a service I provide and I would like to be able to
 have
 fields on my website that can be filled in and the data passed
throught
 the
 spreadsheet (through whatever manner) and the pricing info delivered
back
 to
 the client.
 
 I have no idea how to do this and I thought that maybe some of you
have
 done
 projects like this and would have an idea of where I should start.
 
  Thanks,
 
 Jeremy
 
 
 
 --
 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] restricting files

2002-06-09 Thread Jason Wong

On Sunday 09 June 2002 23:08, Justin French wrote:
 Have you got a link for somewhere to look for a base set of functions for
 me to build on?

Search the archives, I'm sure I've posted some download code on the list 
before, as have others. 

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

/*
The vast majority of successful major crimes against property are
perpetrated by individuals abusing positions of trust.
-- Lawrence Dalzell
*/


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




Re: [PHP] populating list menus with mysql and for statements

2002-06-09 Thread Jason Wong

On Sunday 09 June 2002 17:27, electroteque wrote:
 hi i am populating a list menu with mysql , i would like to find a way to
 populate a form with more than one of the same list menus in a for loop

  select name=type[]
?
while ($sample = $result-fetchRow(DB_FETCHMODE_ASSOC)) {
$typeID=$sample[typeID];
$description=$sample[description];
 $sample_type[$sample['typeID']] = $sample[description];
 echo \noption value=\$typeID\ $selected$description/option;
 }
 ?
 /select

 i have this within a for loop but the list only shows up once and the
 second one is empty because the select from the database is finished ,

 is there a way to put the information from mysql into arrays so i can use
 it more than once and then i could do multiple populated list boxes ? let
 me know

use mysql_data_seek() to reset the row pointer.

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

/*
QOTD:
She's about as smart as bait.
*/


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




[PHP] Date functions Unic Epoch

2002-06-09 Thread Juan Antonio Ruiz Zwollo

Hi!

Say, has anybody re-written the date funtions so they work with any date and
not be crippled by the unix timestamp range limit?

I am looking for a function which will do the equivalent of
   date(w,mktime(0,0,0,8,30,1934))
but that will actually *work*.

Does anybody know a way to return which day of the week (0-7) it is for
dates outside the unix timestamp range?

I wish this stuff would be build into PHP.

Saludos,


Juan Antonio Ruiz Zwollo






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




Re: [PHP] Re: Date?

2002-06-09 Thread Gerard Samuel

Speaking of which.  I was thinking about this this morning.
Is there a part of the Unix timestamp that tells php what timezone to 
report.
Reason why I ask, is I would like to offset the unix timestamp relative 
to where a server is to a particular user.
So lets say the user is in Europe, and the server is in USA and the 
script is set to display date as 'H:i T', and
I offset the unix timestamp to the user in Europe, would the timezone 
adjust to the European timezone...
Im going to try on a windows box where I can change the date easily and 
see what happens...

John Taylor-Johnston wrote:

I added a comment to the FAQ:
http://www.php.net/manual/en/function.date.php


  


-- 
Gerard Samuel
http://www.trini0.org:81/
http://dev.trini0.org:81/




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




[PHP] Getting users monitor size

2002-06-09 Thread Tom Ray

Is there a way to do this with PHP? I couldn't find it in the online 
docs and the archive search is offline :(

thanks!


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




Re: [PHP] Re: Date?

2002-06-09 Thread Miguel Cruz

On Sun, 9 Jun 2002, John Taylor-Johnston wrote:
 ? echo date (l., .F. .d., .Y); ?
 Sunday, June 09, 2002
 
 But I would use:
 
 ?php echo date (l., .F. .d., .Y); ?
 
 Don't know why, but someone told me once it had something to do with versions.

date() just wants a plain ordinary string for the first argument (as the
manual clearly says). I don't know what all that concatenation is for (I
guess with permissive parsing it will provide the same thing), but as the
examples in the manual also clearly show, you can just use:

   date ('l, F d, Y');

miguel


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




Re: [PHP] Getting users monitor size

2002-06-09 Thread Miguel Cruz

On Sun, 9 Jun 2002, Tom Ray wrote:
 Is there a way to do this with PHP? I couldn't find it in the online 
 docs and the archive search is offline :(

Use JavaScript to detect it, and then you can set a cookie or add it to a 
request posted to the server. In either case your PHP program can then 
pick up the info.

miguel


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




Re: [PHP] Getting users monitor size

2002-06-09 Thread Rad0s-aw Gajewski

On Sun, 9 Jun 2002, Tom Ray wrote:
++Is there a way to do this with PHP? I couldn't find it in the online
++docs and the archive search is offline :(
oh..You couldn't?
echo 'form action=index.php
pWhat's your monitor size? input type=text name=size
p
input type=submit
/form';
Users monitor size is in $HTTP_GET_VARS[size];
And this is funny but true answer to your question.
-- 
--
 pozdr
Rad0s

Radek Gajewski [EMAIL PROTECTED] GG:694459 ICQ:110153822



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




[PHP] phpDocumentor version 1.1.0rc1 RELEASE ANNOUNCEMENT

2002-06-09 Thread Greg Beaver

June 9, 2002
RELEASE ANNOUNCEMENT
phpDocumentor version 1.1.0rc1
http://www.phpdoc.org
Download: http://phpdocu.sourceforge.net/downloads.php

The phpDocumentor Development team would like to announce the release of
phpDocumentor version 1.1.0rc1.  This is a release candidate for 1.1.0 to
ensure
that all bugs have been fixed before release

phpDocumentor is the most advanced auto-documentation system available for
PHP.  Similar to the auto-documentor included with PEAR, phpDocumentor
parses documentation comments in the PHP source to create hyperlinked API
references for projects.  Unlike the PEAR auto-documentor, phpDocumentor is
extremely fast, has excellent documentation included, and the ability to
parse any legal PHP syntax.

phpDocumentor is the only auto-documentor written specifically for PHP that
supports output to formats other than HTML.  With 1.1.0rc1 comes a pre-
alpha PDF Converter to demonstrate the facility.  Through the use of
Converters
similar to JavaDoc's doclets, phpDocumentor can interface parsing output to
any template with minimal coding.  In addition, 6 HTML templates come
standard with phpDocumentor.

Other features include:
  --fully 25% faster than version 1.0.0
  --able to directly parse a CVS repository
  --parses any php file, with multiple classes and functions in the same
file
  --fully compliant with even the most esoteric php syntax
   ($string =  EOF, for example)
  --greatly improved ease of Converter programming
  --parsing of global and static variables
  --documentation of name conflicts between packages
  --auto-linking to elements in any package
  --error/warnings by line number and file to allow for debugging of
 documentation tags
  --extensive documentation of the package, including a detailed
specification
 for tags and templates
  --open source, GPL

phpDocumentor is fast becoming the standard auto-documentor, and is
used by several PHP projects including PostNuke
Content Management (http://www.postnuke.com), phpRPC
(http://phprpc.sourceforge.net/), and XMap
(http://opensource.under.com.br/xmap/docs/)

To Download, go to http://phpdocu.sourceforge.net/downloads.php

The phpDocumentor development team
Joshua Eichorn
Gregory Beaver




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




[PHP] Re: Date functions Unic Epoch

2002-06-09 Thread David Robley

In article [EMAIL PROTECTED], [EMAIL PROTECTED] 
says...
 Hi!
 
 Say, has anybody re-written the date funtions so they work with any date and
 not be crippled by the unix timestamp range limit?
 
 I am looking for a function which will do the equivalent of
date(w,mktime(0,0,0,8,30,1934))
 but that will actually *work*.
 
 Does anybody know a way to return which day of the week (0-7) it is for
 dates outside the unix timestamp range?
 
 I wish this stuff would be build into PHP.

You might look at the Calendar functions for this - you may need to 
recompile your php to include them.

-- 
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] Getting users monitor size

2002-06-09 Thread Miva Guy

Currently, I'm developing a site that makes full use of a 1024 x 768 display
since 90% of my users have that config.

In the off chance they have a smaller display, I have this in the header of
my HTML template:

SCRIPT LANGUAGE=JavaScript
var smallver = {SCREEN_SIZE};
if(!smallver  screen.width  1000)
self.location.replace({RESIZED_SMALL});
else if(smallver  screen.width  1000)
self.location.replace({RESIZED_LARGE});
/SCRIPT

Where:
'SCREEN_SIZE' = $sessiondata['session_small'] ? 1 : 0,
'RESIZED_SMALL' = $PHP_SELF.?resize=1.$QUERY_STRING,
'RESIZED_LARGE' = $PHP_SELF.?resize=0.$QUERY_STRING

What all this means is that I store a Boolean variable in a sessions table
for 'session_small'. In the php header of each page, I simply look at that
variable to decide how to draw the page.

The JavaScript is necessary since only client-side scripting can pick up
that value for you automatically. If it sees that the screen size is set to
normal (large) and the display won't allow it, it runs the page again with
'resize=1' in the query string to allow the change of the variable in the
sessions table. Alternatively, if the 'session_small' variable true and the
display will allow more, the page is reloaded with the correct value in the
table.

Hope this helps,
Mark

-Original Message-
From: Tom Ray [mailto:[EMAIL PROTECTED]]
Sent: Sunday, June 09, 2002 2:39 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Getting users monitor size


Is there a way to do this with PHP? I couldn't find it in the online
docs and the archive search is offline :(

thanks!


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


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




RE: [PHP] Re: Date?

2002-06-09 Thread David Freeman


  Speaking of which.  I was thinking about this this morning.
  Is there a part of the Unix timestamp that tells php what 
  timezone to 
  report.

You could use the gmt-based date manipulation to do this.

  Reason why I ask, is I would like to offset the unix 
  timestamp relative 
  to where a server is to a particular user.
  So lets say the user is in Europe, and the server is in USA and the 
  script is set to display date as 'H:i T', and

Your main problem will be in identifying where the user is.  Probably
the only truly reliable way is to ask them to tell you what their time
zone is.  Pretty much every other method will result in a percentage of
inaccurate reporting - the degree of error will be dependant on the
method chosen.

CYA, Dave



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




[PHP] Another Flat File question.

2002-06-09 Thread Tom Ray

I know I've asked this before but I don't believe I asked the question 
correctly.

I have a flat file database that is delimited with colons. This file 
will have new records added to it on a regular basis. What I want to do 
is be able to search that file based on a keyword that is inputted by a 
user, then it will search that database comparing each record for that 
value, if that value returns true, I want it to display the results of 
that record.

How would I do this when I don't know the number of records that will be 
searched (since it will rise and fall almost daily)? Also, how would I 
create a dynamic array?

I hope this makes sense to someone, I've been pulling my hair out on this.


Thanks!


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




Re: [PHP] Re: Date?

2002-06-09 Thread Gerard Samuel

Ill look into gmdate.  I was going to get the timezone from the user to 
store in the database..

David Freeman wrote:

  Speaking of which.  I was thinking about this this morning.
  Is there a part of the Unix timestamp that tells php what 
  timezone to 
  report.

You could use the gmt-based date manipulation to do this.

  Reason why I ask, is I would like to offset the unix 
  timestamp relative 
  to where a server is to a particular user.
  So lets say the user is in Europe, and the server is in USA and the 
  script is set to display date as 'H:i T', and

Your main problem will be in identifying where the user is.  Probably
the only truly reliable way is to ask them to tell you what their time
zone is.  Pretty much every other method will result in a percentage of
inaccurate reporting - the degree of error will be dependant on the
method chosen.

CYA, Dave




  


-- 
Gerard Samuel
http://www.trini0.org:81/
http://dev.trini0.org:81/




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




RE: [PHP] Getting users monitor size

2002-06-09 Thread Mark

He asked about detecting monitor size, not screen resolution. I don't
think any javascript will ever be able to do this.

On Sun, 09 Jun 2002 20:42:58 -0400, Miva Guy wrote:
Currently, I'm developing a site that makes full use of a 1024 x 768
display
since 90% of my users have that config.

In the off chance they have a smaller display, I have this in the
header of
my HTML template:

SCRIPT LANGUAGE=JavaScript
var smallver = {SCREEN_SIZE};
if(!smallver  screen.width  1000)
self.location.replace({RESIZED_SMALL});
else if(smallver  screen.width  1000)
self.location.replace({RESIZED_LARGE});
/SCRIPT

Where:
'SCREEN_SIZE' = $sessiondata['session_small'] ? 1 : 0,
'RESIZED_SMALL' = $PHP_SELF.?resize=1.$QUERY_STRING,
'RESIZED_LARGE' = $PHP_SELF.?resize=0.$QUERY_STRING

What all this means is that I store a Boolean variable in a sessions
table
for 'session_small'. In the php header of each page, I simply look
at that
variable to decide how to draw the page.

The JavaScript is necessary since only client-side scripting can
pick up
that value for you automatically. If it sees that the screen size is
set to
normal (large) and the display won't allow it, it runs the page
again with
'resize=1' in the query string to allow the change of the variable
in the
sessions table. Alternatively, if the 'session_small' variable true
and the
display will allow more, the page is reloaded with the correct value
in the
table.

Hope this helps,
Mark

-Original Message-
From: Tom Ray [mailto:[EMAIL PROTECTED]]
Sent: Sunday, June 09, 2002 2:39 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Getting users monitor size


Is there a way to do this with PHP? I couldn't find it in the online
docs and the archive search is offline :(

thanks!


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






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




[PHP] simplicity with 2 queries..

2002-06-09 Thread Jule Slootbeek

Hey guys and gals,

I have the following function which accesses the following tables, now i want to 
know if there is a way to get the quiz_id from table quiz without runnning both 
these queries...
thanks,

Jule

--tables--

mysql describe user;
++--+--+-+-++
| Field  | Type | Null | Key | Default | Extra  |
++--+--+-+-++
| user_id| int(10) unsigned |  | PRI | NULL| auto_increment |
| first_name | varchar(10)  |  | | ||
| last_name  | varchar(20)  |  | | ||
| email  | varchar(100) |  | | ||
| username   | varchar(16)  |  | | ||
| password   | varchar(32)  |  | | ||
++--+--+-+-++

mysql describe quiz;
+-+--+--+-+-++
| Field   | Type | Null | Key | Default | Extra  |
+-+--+--+-+-++
| quiz_id | int(10) unsigned |  | PRI | NULL| auto_increment |
| user_id | int(10) unsigned |  | | 0   ||
| title   | varchar(255) |  | | ||
| noa | tinyint(2)   |  | | 0   ||
+-+--+--+-+-++

--function--

function addquiz_get_quiz_id() {

global $valid_user, $valid_password;

mysql_select_db($db_glob, $link_glob);

$table_user = user;
$table_quiz = quiz;
$query = SELECT * FROM $table_user WHERE username='$valid_user' AND 
password='$valid_password';
$result = mysql_query($query);
$user_info = mysql_fetch_array($result);
$user_id = $user_info[user_id];

$query = SELECT * FROM $table_quiz WHERE user_id='$user_id';
$result = mysql_query($query);
$user_info = mysql_fetch_array($result);
$quiz_id = $user_info[quiz_id];

mysql_close($link_glob);
return $quiz_id;
}
-- 
Jule Slootbeek  
[EMAIL PROTECTED] 

http://blindtheory.cjb.net 



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




php-general Digest 10 Jun 2002 03:28:04 -0000 Issue 1396

2002-06-09 Thread php-general-digest-help


php-general Digest 10 Jun 2002 03:28:04 - Issue 1396

Topics (messages 101331 through 101354):

Re: Function needed
101331 by: Chris Hewitt
101332 by: Gaylen Fraley

Formatting XML Data
101333 by: Sebastian A.
101335 by: Dan Hardiker

Re: Date?
101334 by: Bruce Karstedt
101342 by: Gerard Samuel
101344 by: Miguel Cruz
101350 by: David Freeman
101352 by: Gerard Samuel

Re: Excel Spreadsheet
101336 by: Jeremy Bowen
101338 by: John Holmes

Re: PHP function for listing number of columns in table
101337 by: John Holmes

Re: restricting files
101339 by: Jason Wong

Re: populating list menus with mysql and for statements
101340 by: Jason Wong

Date functions  Unic Epoch
101341 by: Juan Antonio Ruiz Zwollo
101348 by: David Robley

Getting users monitor size
101343 by: Tom Ray
101345 by: Miguel Cruz
101346 by: Rad0s-³aw Gajewski
101349 by: Miva Guy
101353 by: Mark

phpDocumentor version 1.1.0rc1 RELEASE ANNOUNCEMENT
101347 by: Greg Beaver

Another Flat File question.
101351 by: Tom Ray

simplicity with 2 queries..
101354 by: Jule Slootbeek

Administrivia:

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

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

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


--

---BeginMessage---

$result=`ls -R | grep 'expression' ./`;

HTH
Chris

Jason Wong wrote:

On Sunday 09 June 2002 17:17, Austin Marshall wrote:

Gaylen Fraley wrote:

I am in need of a function/script that will take a directory and search
all filenames, recursively down, for a given file.  Can anyone point me
to a source?  Thanks.

$result=`grep -r 'expression' ./`;


This searches for strings within a file.




---End Message---
---BeginMessage---

This resricts to *nix and can be disallowed due to security constraints, but
thanks anyway.  I just wrote my own PHP routine.

--
Gaylen
PHP KISGB v4.0.5 Guest Book http://www.gaylenandmargie.com/phpwebsite/

Chris Hewitt [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 $result=`ls -R | grep 'expression' ./`;

 HTH
 Chris

 Jason Wong wrote:

 On Sunday 09 June 2002 17:17, Austin Marshall wrote:
 
 Gaylen Fraley wrote:
 
 I am in need of a function/script that will take a directory and search
 all filenames, recursively down, for a given file.  Can anyone point me
 to a source?  Thanks.
 
 $result=`grep -r 'expression' ./`;
 
 
 This searches for strings within a file.
 





---End Message---
---BeginMessage---

Hello,

I have been working with XML in the recent weeks and I have recently come
across the need to format some of the data in my XML. For example I might
have a large XML file and I would like some of the text to be bold, or maybe
I would like to insert a hyper-link. Unfortunately it does not seem I can do
this with ordinary HTML tags because they will be interpreted as XML tags. I
am sure, however that there is another way of doing this. Does anyone know
how?

Thanks



---End Message---
---BeginMessage---

 I would like some of the text to be
 bold, or maybe I would like to insert a hyper-link. Unfortunately it
 does not seem I can do this with ordinary HTML tags because they will
 be interpreted as XML tags. I am sure, however that there is another
 way of doing this. Does anyone know how?

Have a look into XSLT... its all in the manual.


-- 
Dan Hardiker [[EMAIL PROTECTED]]
ADAM Software  Systems Engineer
First Creative Ltd



---End Message---
---BeginMessage---

? echo date(l, F j, Y); ? works just fine for me.

Bruce Karstedt
President
Technology Consulting Associates, Ltd.
Tel: 847-735-9488
Fax: 847-735-9474


-Original Message-
From: John Taylor-Johnston [mailto:[EMAIL PROTECTED]]
Sent: Saturday, June 08, 2002 11:50 PM
To: [EMAIL PROTECTED]
Cc: Jeremy Bowen
Subject: [PHP] Re: Date?


? echo date (l., .F. .d., .Y); ?
Sunday, June 09, 2002

But I would use:

?php echo date (l., .F. .d., .Y); ?

Don't know why, but someone told me once it had something to do with
versions.

John

Jeremy Bowen wrote:

 I am having nothing but trouble with the date function. I want it to print
 out a date like this: Saturday June 8, 2002 but as soon as I put spaces or
 comma's in the string I get parse errors. I can get it to print
 SaturdayJune082002 with  ? echo date (lFdY); ? I have tried escaping
with
 \ but it seems to make no difference.



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


---End Message---
---BeginMessage---

Speaking of which.  I was thinking about this this morning.
Is there a part of the Unix timestamp that tells php what timezone to 
report.
Reason why I ask, is I would like to offset the unix timestamp relative 
to where a server is to a particular 

RE: [PHP] simplicity with 2 queries..

2002-06-09 Thread John Holmes

Read the JOIN chapter of the MySQL manual and it'll tell you how to do
it. It's not a PHP issue.

(watch for line wrapping)
http://www.mysql.com/documentation/mysql/bychapter/manual_Reference.html
#JOIN

---John Holmes...

 -Original Message-
 From: Jule Slootbeek [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, June 09, 2002 11:35 PM
 To: php-general
 Subject: [PHP] simplicity with 2 queries..
 
 Hey guys and gals,
 
 I have the following function which accesses the following tables, now
i
 want to
 know if there is a way to get the quiz_id from table quiz without
runnning
 both
 these queries...
 thanks,
 
 Jule
 
 --tables--
 
 mysql describe user;

++--+--+-+-+
+
 | Field  | Type | Null | Key | Default | Extra
|

++--+--+-+-+
+
 | user_id| int(10) unsigned |  | PRI | NULL|
auto_increment |
 | first_name | varchar(10)  |  | | |
|
 | last_name  | varchar(20)  |  | | |
|
 | email  | varchar(100) |  | | |
|
 | username   | varchar(16)  |  | | |
|
 | password   | varchar(32)  |  | | |
|

++--+--+-+-+
+
 
 mysql describe quiz;
 +-+--+--+-+-++
 | Field   | Type | Null | Key | Default | Extra  |
 +-+--+--+-+-++
 | quiz_id | int(10) unsigned |  | PRI | NULL| auto_increment |
 | user_id | int(10) unsigned |  | | 0   ||
 | title   | varchar(255) |  | | ||
 | noa | tinyint(2)   |  | | 0   ||
 +-+--+--+-+-++
 
 --function--
 
 function addquiz_get_quiz_id() {
 
   global $valid_user, $valid_password;
 
   mysql_select_db($db_glob, $link_glob);
 
   $table_user = user;
   $table_quiz = quiz;
   $query = SELECT * FROM $table_user WHERE username='$valid_user'
AND
 password='$valid_password';
   $result = mysql_query($query);
   $user_info = mysql_fetch_array($result);
   $user_id = $user_info[user_id];
 
   $query = SELECT * FROM $table_quiz WHERE user_id='$user_id';
   $result = mysql_query($query);
   $user_info = mysql_fetch_array($result);
   $quiz_id = $user_info[quiz_id];
 
   mysql_close($link_glob);
   return $quiz_id;
 }
 --
 Jule Slootbeek
 [EMAIL PROTECTED]
 
 http://blindtheory.cjb.net
 
 
 
 --
 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] simplicity with 2 queries..

2002-06-09 Thread Bogdan Stancescu

SELECT
  quiz_id
FROM
  $table_quiz AS q,
  $table_user AS u
WHERE
  q.user_id=u.user_id AND
  u.username='$valid_user' AND
  u.password='$valid_password';

Bogdan

Jule Slootbeek wrote:

 Hey guys and gals,

 I have the following function which accesses the following tables, now 
 i want to know if there is a way to get the quiz_id from table quiz 
 without runnning both these queries...
 thanks,

 Jule

 --tables--

 mysql describe user;
 ++--+--+-+-++
 | Field  | Type | Null | Key | Default | Extra  |
 ++--+--+-+-++
 | user_id| int(10) unsigned |  | PRI | NULL| auto_increment |
 | first_name | varchar(10)  |  | | ||
 | last_name  | varchar(20)  |  | | ||
 | email  | varchar(100) |  | | ||
 | username   | varchar(16)  |  | | ||
 | password   | varchar(32)  |  | | ||
 ++--+--+-+-++

 mysql describe quiz;
 +-+--+--+-+-++
 | Field   | Type | Null | Key | Default | Extra  |
 +-+--+--+-+-++
 | quiz_id | int(10) unsigned |  | PRI | NULL| auto_increment |
 | user_id | int(10) unsigned |  | | 0   ||
 | title   | varchar(255) |  | | ||
 | noa | tinyint(2)   |  | | 0   ||
 +-+--+--+-+-++

 --function--

 function addquiz_get_quiz_id() {

 global $valid_user, $valid_password;

 mysql_select_db($db_glob, $link_glob);
 
 $table_user = user;
 $table_quiz = quiz;
 $query = SELECT * FROM $table_user WHERE username='$valid_user' 
 AND password='$valid_password';
 $result = mysql_query($query);
 $user_info = mysql_fetch_array($result);
 $user_id = $user_info[user_id];
 
 $query = SELECT * FROM $table_quiz WHERE user_id='$user_id';
 $result = mysql_query($query);
 $user_info = mysql_fetch_array($result);
 $quiz_id = $user_info[quiz_id];
 
 mysql_close($link_glob);
 return $quiz_id;   
 }






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




Re: [PHP] Re: Date?

2002-06-09 Thread Bogdan Stancescu

JavaScript's getTimezoneOffset seems to be working just right, as shown 
here: http://www.tyzo.com/tools/timezone.html

I think assuming that the user's computer has the correct time zone set 
shouldn't be too far-fetched - and you can always provide the user with 
a way to override that default.

Just my 2c.

Bogdan

David Freeman wrote:

  Speaking of which.  I was thinking about this this morning.
  Is there a part of the Unix timestamp that tells php what 
  timezone to 
  report.

You could use the gmt-based date manipulation to do this.

  Reason why I ask, is I would like to offset the unix 
  timestamp relative 
  to where a server is to a particular user.
  So lets say the user is in Europe, and the server is in USA and the 
  script is set to display date as 'H:i T', and

Your main problem will be in identifying where the user is.  Probably
the only truly reliable way is to ask them to tell you what their time
zone is.  Pretty much every other method will result in a percentage of
inaccurate reporting - the degree of error will be dependant on the
method chosen.

CYA, Dave



  






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




[PHP] fputs/fgets working irregularly

2002-06-09 Thread Kris

Hi all,

I'm having some trouble getting my basic news script to work. Here is the
code:

 $fp = fopen(data/prev.txt,r);
 while (!feof ($fp)) {
 $pr = fgets($fp, 4096);
 }
 fclose($fp);

 $fp = fopen(data/news.txt,r);
 while (!feof ($fp)) {
 $ag = fgets($fp, 4096);
 }
 fclose($fp);

 $fp = fopen(data/news.txt,w);
 $np = fputs($fp,$pr);
 fclose($fp);

 $fp = fopen(data/news.txt,a);
 $ng = fputs($fp,$ag);
 fclose($fp);

The news.txt does not append what is stored in $pr for some reason. I can't
put my finger on what the problem is, the file is chmod correctly as well.
Can anyone help?

Thanks,
Kris



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




Re: [PHP] fputs/fgets working irregularly

2002-06-09 Thread Tom Rogers

Hi
Why not just do it in one call?

$fp = fopen(data/news.txt,w);
  $np = fputs($fp,$pr.$ag);
  fclose($fp);


Tom


At 04:17 AM 10/06/2002, Kris wrote:
Hi all,

I'm having some trouble getting my basic news script to work. Here is the
code:

  $fp = fopen(data/prev.txt,r);
  while (!feof ($fp)) {
  $pr = fgets($fp, 4096);
  }
  fclose($fp);

  $fp = fopen(data/news.txt,r);
  while (!feof ($fp)) {
  $ag = fgets($fp, 4096);
  }
  fclose($fp);

  $fp = fopen(data/news.txt,w);
  $np = fputs($fp,$pr);
  fclose($fp);

  $fp = fopen(data/news.txt,a);
  $ng = fputs($fp,$ag);
  fclose($fp);

The news.txt does not append what is stored in $pr for some reason. I can't
put my finger on what the problem is, the file is chmod correctly as well.
Can anyone help?

Thanks,
Kris



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

2002-06-09 Thread Jason Soza

I'm wondering how PHP handles result sets and other info gathered from
MySQL.

The reason I ask is I've been messing with mysql_connect() functions all
day, finally found a solution (or so I thought), then a couple hours later I
returned to my site and got an Unable to connect error.

When I make a change to the mysql_connect() function in my PHP script, then
save and reload that page, it doesn't seem to have any effect at the time.
For example, I don't allow any anonymous access to my MySQL server, but I
can take out host, user, and password information from mysql_connect(), save
and reload and it still loads as if the function worked.

I've already tried deleting all cached info through my browser (IE) and I've
made other PHP changes that do take effect, it's just the mysql_connect()
that doesn't seem to want to work.

The site is www.miatapix.net - I have it showing as working fine on my side,
someone else want to take a look at it and see what they get? And any help
for this? It's hard to troubleshoot things when results aren't immediately
available.

Thanks in advance,

Jason Soza


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




Re: [PHP] Another Flat File question.

2002-06-09 Thread Miguel Cruz

On Sun, 9 Jun 2002, Tom Ray wrote:
 I have a flat file database that is delimited with colons. This file 
 will have new records added to it on a regular basis. What I want to do 
 is be able to search that file based on a keyword that is inputted by a 
 user, then it will search that database comparing each record for that 
 value, if that value returns true, I want it to display the results of 
 that record.

  http://php.net/file
  http://php.net/preg_grep

miguel


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




Re: [PHP] PHP/MySQL

2002-06-09 Thread Miguel Cruz

On Sun, 9 Jun 2002, Jason Soza wrote:
 When I make a change to the mysql_connect() function in my PHP script,
 then save and reload that page, it doesn't seem to have any effect at
 the time. For example, I don't allow any anonymous access to my MySQL
 server, but I can take out host, user, and password information from
 mysql_connect(), save and reload and it still loads as if the function
 worked.

Apache spawns a bunch of processes, and with each http request you are 
(sort of) randomly assigned one. If you get one that you've had before, it 
may have some bits of state hanging around from previous requests.

One way to avoid this during debugging is to run Apache in the slower -x 
single process mode.

miguel


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




Re: [PHP] phpDocumentor version 1.1.0rc1 RELEASE ANNOUNCEMENT

2002-06-09 Thread Miguel Cruz

On Sun, 9 Jun 2002, Greg Beaver wrote:
 June 9, 2002
 RELEASE ANNOUNCEMENT
 phpDocumentor version 1.1.0rc1
 http://www.phpdoc.org

Best of all, with OSX IE 5.14, the page comes up completely blank.

miguel


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




[PHP] Running PHP script within stylesheet?

2002-06-09 Thread William S.

I am very new to PHP, Sablotron, XSLT, and MySql.
Right now I have created a web page that is the
result of a transformation (through php) of an
xsl and xml file.

What I would like to do is run a PHP script so
that the result is displayed within a table on my
web page. How do I do this? Here is an example:

$myvar = Hello World;
echo $myvar;

In which file do I put this script?
Here is a link to my page.

http://213.84.71.105/

This is just the first step in my learning process.
Ultimately, I would like to be able to query
a mysql database through a web interface.

Thank you,
-- 
Bill
Amsterdam, NL

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