Re: [PHP] When did $_SERVER become the preferred syntax?

2002-05-18 Thread Jason Wong

On Saturday 18 May 2002 13:47, Brad Hubbard wrote:
 What's the idea behind this syntax $_SERVER and when did it become the
 preferred method (are there docs on this)?

Read the changelogs for php 4.1.X and above. 
Search the archives.
Read the sample php.ini files included with the distributions.

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

/*
Where's th' DAFFY DUCK EXHIBIT??
*/


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




[PHP] Upgraded, now sessions aren't working. Please help :)

2002-05-18 Thread Stephen Bolinger

Something catastrophic happened to my webserver and while I had the data of
the database and site content backed up, I'm having trouble getting it all
back up and working.

Prior to the server crash I was using Apache 1.3.2x (can't remember exactly)
and PHP 4.1.x (not sure on this one either, last time I upgraded was a few
months ago).  Everything was working perfectly.  I was using a lot of
start_session(), session_is_registered(), etc...session stuff.

Now I've compiled PHP 4.2.1 and tried both Apache 1.3.24 and Apache 2.0.36
and got them up and working (for the most part).  But everything that has
sessions in it is screwed.  Just hangs, no error, just hangs.  Is there
something I need to set in either php.ini or httpd.conf to get sessions
working again?

I've read that there are other, more preferred ways to do sessions now, and
I'm going to start porting to that, but right now I need to get the server
up.

Can anyone offer me some advice?  I've been doing this for years now and I
feel like I'm losing my mind...I must just be overlooking something.

Thanks.


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




Re: [PHP] Upgraded, now sessions aren't working. Please help :)

2002-05-18 Thread Richard Baskett

Did you look at: 
http://www.php.net/manual/fi/reserved.variables.php#reserved.variables.sessi
on

That is the new way.. And within that block of text there is a couple other
links to other pages you might want to take a look at.

Cheers!

Rick

The glory of friendship is not the outstretched hand, nor the kindly smile,
nor the joy of companionship; it is the spiritual inspiration that comes to
one when he discovers that someone else believes in him and is willing to
trust him with his friendship.  - Ralph Waldo Emerson

 From: Stephen Bolinger [EMAIL PROTECTED]
 Reply-To: [EMAIL PROTECTED]
 Date: Fri, 17 May 2002 23:41:01 -0700
 To: [EMAIL PROTECTED]
 Subject: [PHP] Upgraded, now sessions aren't working.  Please help :)
 
 Something catastrophic happened to my webserver and while I had the data of
 the database and site content backed up, I'm having trouble getting it all
 back up and working.
 
 Prior to the server crash I was using Apache 1.3.2x (can't remember exactly)
 and PHP 4.1.x (not sure on this one either, last time I upgraded was a few
 months ago).  Everything was working perfectly.  I was using a lot of
 start_session(), session_is_registered(), etc...session stuff.
 
 Now I've compiled PHP 4.2.1 and tried both Apache 1.3.24 and Apache 2.0.36
 and got them up and working (for the most part).  But everything that has
 sessions in it is screwed.  Just hangs, no error, just hangs.  Is there
 something I need to set in either php.ini or httpd.conf to get sessions
 working again?
 
 I've read that there are other, more preferred ways to do sessions now, and
 I'm going to start porting to that, but right now I need to get the server
 up.
 
 Can anyone offer me some advice?  I've been doing this for years now and I
 feel like I'm losing my mind...I must just be overlooking something.
 
 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] When did $_SERVER become the preferred syntax?

2002-05-18 Thread Richard Baskett

This page will tell you everything you need to know about the new global
arrays :)

http://www.php.net/manual/fi/reserved.variables.php

Rick

Do all the good you can, By all the means you can, In all the ways you can,
In all the places you can, At all the times you can, To all the people you
can, As long as ever you can. - John Wesley

 From: Brad Hubbard [EMAIL PROTECTED]
 Organization: Congo Systems
 Reply-To: [EMAIL PROTECTED]
 Date: Sat, 18 May 2002 15:47:58 +1000
 To: [EMAIL PROTECTED]
 Subject: [PHP] When did $_SERVER become the preferred syntax?
 
 What's the idea behind this syntax $_SERVER and when did it become the
 preferred method (are there docs on this)?
 
 Cheers,
 Brad
 
 -- 
 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] When did $_SERVER become the preferred syntax?

2002-05-18 Thread Brad Hubbard

On Sat, 18 May 2002 15:47, Brad Hubbard did align ASCII characters thusly:
 What's the idea behind this syntax $_SERVER and when did it become the
 preferred method (are there docs on this)?

Thanks to all who replied. I understand this now.

Cheers,
Brad

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




[PHP] parsing CSV, updating MySQL table

2002-05-18 Thread Justin French

Hi,

I have a client with an Excel file of products / prices / etc.  For
arguments sake, let's keep it simple:

id,title,description

if they were to export this as a CSV, then it could be used to update a
mysql table (for existing ID's), and to insert any new ID's.


So, I guess what I'm after is a group of functions which parse a CSV file,
and update a MySQL table to match... rather than messing around in a web
based GUI, the client could just upload a new CSV every couple of days.


I've checked out fgetcsv() etc, and I *think* i've got a picture of how the
code would look, but before I start, I figure a set of functions probably
already exists out there to do this... so why reinvent the wheel

If anyone can point me to a URL, class, function, article, etc, I'd be
pretty happy :)


Justin French


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




[PHP] Re: $answers[answer$n]

2002-05-18 Thread Michael Virnstein

answers$n. php tries to concate the constant answers with the variable
$n, but you forgot the concatenation operator ..
i assume that answers should be a string and
is not a constant, therefore $answer[answers.$n] is right.
if answers is a constant use $answer[answers.$n];
but a better way of what you try to accomplish would be a array
using two dimensions:
$answer[answers][$n]
$answer[question][$n] ...etc
or if you only have answers as key use:
$answer[$n]

if you want to send form data as array, using more than one dimension,
do the following:

input type=text name=answers[answer][1] value=
input type=text name=answers[answer][2] value=
input type=text name=answers[answer][3] value=

or

input type=text name=answers[answer][] value=
input type=text name=answers[answer][] value=
input type=text name=answers[answer][] value=

Which is pretty much the same.
now on the processing page you can do:

ForEach($answers as $val) {
Foreach ($val as $answer) {
// do something with one of the answers
}
}

Regards Michael

Jule [EMAIL PROTECTED] schrieb im Newsbeitrag
02051716404700.28871@localhost">news:02051716404700.28871@localhost...
Hey guys,
i'm getting this error whe i try to access this variable. $answers[answer$n]

Parse error: parse error, expecting `']'' in
/home/blindtheory/web/quiz/add_quiz/add_quiz_process_2.php on line 36

the variable $answer[answers$n] comes from a form on the preceding page in
which a number of answers has been entered. the number of answers is up to
the user and can vary from 2 to 15. not the $n comes from a for loop whcih
enteres the answers into a database since i do not know how many answers
each
user has used.

why am i getting this error?
and is there a way around it?
following is the for() loop in which this story takes place.

thanks
Jule

--SCRIPT--

for ($n = 1; $n = $quiz[number_answers]; $n++) {
$table = $quiz[code]_answers;
$value = $answers[answer$n];
$query_alter_table = ALTER table $table ADD answer$n TEXT NUT NULL;
$query_add_answers = INSERT INTO $table (answer$n) VALUES($value);
if (mysql_db_query($database_glob, $query_alter_table, $link_glob) AND
(mysql_db_query($database_glob, $query_add_answer, $link_glob));
echo Answer $n has successfully been added to the Quizbr\n;
} else {
echo mysql_error();
}
echo Click here to continue;
}

--SCRIPT--

--
|\/\__/\/|
|   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




RE: [PHP] PHP+MySQL - Excel ?

2002-05-18 Thread savaidis

I use the ODBC connection with no problem, I get about 1000 rows to Excel in
seconds.
First row contains the colums names.
But I wonder if there is a way to write back the data to MySQL database from
Excel.
(with ODBC connection, becouse with files I think is possible)


Makis


 -Original Message-
 From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
 Sent: Friday, May 17, 2002 7:54 PM
 To: Chris Boget
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] PHP+MySQL - Excel ?


 No, this has nothing to do with PHP.  You can run MySQL on Windows or
 UNIX, doesn't matter, and set up a connection directly from Excel to
 MySQL.

 PHP can of course run anywhere you want and manipulate the data in MySQL
 which will then be reflected in Excel.

 -Rasmus

 On Fri, 17 May 2002, Chris Boget wrote:

   It is also possible to connect directly to MySQL from Excel
 via MyODBC.
 
  True, but only if you are running PHP on a windows platform, yes?
 
  Chris
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 


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



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




[PHP] Bulletin Boards

2002-05-18 Thread Richard Baskett

Has anybody used phpBB  Phorum?  And if so, which did you like better and
why?  And if you've used other systems.. Which did you like best and why?
Thanks! :)

Rick

We should be taught not to wait for inspiration to start a thing.  Action
always generates inspiration.  Inspiration seldom generates action. - Frank
Tibolt


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




[PHP] blank screen on parse errors after creating php.ini on linux

2002-05-18 Thread andy

Hi there,

I did recently activat php.ini on suse7.2 (copyed the php.ini-recommended
inot the propper dir) to increase the time out.

Now I did experiance a serious problem. Working on my code, I did produce an
error. I did forget to include a . The screen on my browser was blank after
I refreshed. This went through my whole application. So I figured out that I
do have a check for user_info on each of those site. And before the if
statement the php code was parsed ok.

I did remove the php.ini file.

Then suddenly the error msg came up, I fixed the error and I was ok.

Parse error: parse error, unexpected T_STRING in /include/user.php on line
208
Fatal error: Call to undefined function: get_userdata_2() in /index.php on
line 29

So whats wrong with my php.ini? It does return a blank screen on parse
erorrs.

Thanx for any help on that,

Andy



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




Re: [PHP] Bulletin Boards

2002-05-18 Thread Liam MacKenzie

Phorum is nice and simple.
phpBB has more features, generally better.

Both are very good systems.  I'd recommend phpBB for a more 'fun' type of
site and phorum for a more serious atmosphere.  But both can be configured
accordingly.

Cheers,
Liam

- Original Message -
From: Richard Baskett [EMAIL PROTECTED]
To: PHP General [EMAIL PROTECTED]
Sent: Saturday, May 18, 2002 6:51 PM
Subject: [PHP] Bulletin Boards


Has anybody used phpBB  Phorum?  And if so, which did you like better and
why?  And if you've used other systems.. Which did you like best and why?
Thanks! :)

Rick

We should be taught not to wait for inspiration to start a thing.  Action
always generates inspiration.  Inspiration seldom generates action. - Frank
Tibolt


--
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] blank screen on parse errors after creating php.ini on linux

2002-05-18 Thread Jason Wong

On Saturday 18 May 2002 17:27, andy wrote:
 Hi there,

 I did recently activat php.ini on suse7.2 (copyed the php.ini-recommended
 inot the propper dir) to increase the time out.

 Now I did experiance a serious problem. Working on my code, I did produce
 an error. I did forget to include a . The screen on my browser was blank
 after I refreshed. This went through my whole application. So I figured out
 that I do have a check for user_info on each of those site. And before the
 if statement the php code was parsed ok.

 I did remove the php.ini file.

 Then suddenly the error msg came up, I fixed the error and I was ok.

 Parse error: parse error, unexpected T_STRING in /include/user.php on line
 208
 Fatal error: Call to undefined function: get_userdata_2() in /index.php on
 line 29

 So whats wrong with my php.ini? It does return a blank screen on parse
 erorrs.

READ through the php.ini (the one copied from php.ini-recommended). It has 
comments on what option does what and whether the default was changed from 
the previous versions of php.

You want to look at the Error handling and logging group of settings and in 
particular the display_errors setting.

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

/*
Outside of a dog, a book is a man's best friend.  Inside a dog it's too
dark to read.
-- Groucho Marx
*/


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




[PHP] PHP,Apache disabled FTP?

2002-05-18 Thread r

Hi Guys,
I'm a newbie so please forgive the question,
I have reciently setup apache and PHP and now FTP does not work!
I am running a win2k pro machine, is this because of PHP or APACHE or what?
am going crazy and have searched google like crap without any damn
answer...then went to microsoft.com searching...still no #$#$# answer.

PLEASE PLEASE PLEASE HELPP.

-Ryan A.


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




[PHP] Any Ideas @ becomes _Xy

2002-05-18 Thread Henry

Hi All,

I don't think this is a PHP specific issue but I want to use PHP to solve
it.

I'm using GetResponse to supply my autoresponders. They provide an
unsubscribe link at the bottom of the emails as follows:

http://GetResponse.com/k.cgi?a=blahblahf=henry_Xyteacake.force9.co.uk

I subscribed using the email address [EMAIL PROTECTED]

They appear to have translated the @ symbol to _Xy.

Any guess why? Is there a PHP function that does this translation for me? Is
it some sort of standard?

Henry



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




RE: [PHP] PHP,Apache disabled FTP?

2002-05-18 Thread Craig Vincent

 I'm a newbie so please forgive the question,
 I have reciently setup apache and PHP and now FTP does not work!
 I am running a win2k pro machine, is this because of PHP or
 APACHE or what?
 am going crazy and have searched google like crap without any damn
 answer...then went to microsoft.com searching...still no #$#$# answer.

Unless you did something totally off the wall I seriously doubt Apache or
PHP are affecting your FTP server.  Perhaps you should check the
documentation at your FTP provider's site.  Perhaps it can assist you in
troubleshooting why the server isn't working.

Sincerely,

Craig Vincent



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




RE: [PHP] PHP,Apache disabled FTP?

2002-05-18 Thread Dan Hardiker

 I have reciently setup apache and PHP and now FTP does not work! I am
 running a win2k pro machine, is this because of PHP or
 APACHE or what?
[..]
 Unless you did something totally off the wall I seriously doubt Apache
 or PHP are affecting your FTP server.

Unless your using IIS to serve your FTP ;) That would go belly up if youve
got another http processes running. More information about your setup is
required for us to help further.

-- 
Dan Hardiker [[EMAIL PROTECTED]]
ADAM Software  Systems Engineer



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




[PHP] need help on a ereg stmt. validating website adress

2002-05-18 Thread andy

Hi there,

I would like to validate a website adress. Unfortunatelly my eregi stmt does
not work:

 if (eregi(^([0-9a-z][0-9a-z-\.]+)\.([a-z]{2,3})), $website)){ // not a
link

I am getting the error msg:
Warning: REG_ERANGE in extend.inc on line 94

does anybody know whats wroong with that?

Thanx, Andy



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




Re: [PHP] PHP,Apache disabled FTP?

2002-05-18 Thread r

Hey,
Thank you for replying.
Nope am not using IIS, I just have a plain win2k machine that used to ftp
without any problems before.now i cant even find ftp.dll but can find
ftp://ftp.exe
I am unable to connect to 5 sites owned by the company i work for but am
able to connect to them when i go to a cyber cafe I have tried stopping
apache no use...tried to go to the php.ini file and see if there is
anything about enableing FTP...none...going crazy.

Any help or ideas.
-Ryan.


 Unless your using IIS to serve your FTP ;) That would go belly up if youve
 got another http processes running. More information about your setup is
 required for us to help further.

 --
 Dan Hardiker [[EMAIL PROTECTED]]
 ADAM Software  Systems Engineer



 --
 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: Newbie - create image error URGENT

2002-05-18 Thread Henry

Do you have GD Installed?

Dani [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi everyone!

 I'm still learning PHP and MYSQL using windows98, MYSQL, PHP 4 in my
 local hard drive.

 I want to learn uploading image and resizing image in my local machine.

 when I execute this code:

 ?PHP
 //setup image
 $height = 200;
 $width = 200;

 $im = ImageCreate($width,$height);
 $white = ImageCreateAllocate ($im, 255, 255, 255);
 $black = ImageCreateAllocate ($im, 0, 0, 0);

 //Draw on image
 ImageFill($im, 0, 0, $black);
 ImageLine($im, 0, 0, $width, $height, $white);
 ImageString($im, 4, 50, 150, Sales, $white);

 //output image
 Header (Content-type: image/png);
 ImagePng ($im);

 //Clean up
 ImageDestroy($im);

 I get error message: Fatal error: Call to undefined function:
 imagecreate() in D:\graphic_practise\index.php on line 15

 What did I do wrong?

 any advice/ help is greatly appriciated.

 Thanks,

 Ardani






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




[PHP] Bundled php mysql library vs mysql extension

2002-05-18 Thread Pentothal

Which are the differences between the php bundled mysql
library and the external standard extension? Is the
bundled one faster? How much?



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




php-general Digest 18 May 2002 13:00:44 -0000 Issue 1352

2002-05-18 Thread php-general-digest-help


php-general Digest 18 May 2002 13:00:44 - Issue 1352

Topics (messages 98197 through 98250):

HTTP_ACCEPT_LANGUAGE
98197 by: Gerard Samuel
98199 by: Miguel Cruz

Re: Alter table and add cell at a time.
98198 by: Miguel Cruz

Re: Q:Anybody using PHP directly on Mac-OSX???
98200 by: Justin French

mktime()
98201 by: Josh Edwards
98202 by: Rasmus Lerdorf

character conversion problem
98203 by: darcy w.christ
98209 by: Tom Rogers

Feelin' dumb...
98204 by: Jason Soza
98205 by: Jule
98206 by: Richard Baskett
98207 by: Jule
98208 by: Jason Soza
98210 by: Craig Vincent
98211 by: Richard Baskett
98212 by: Tom Rogers
98213 by: Jason Soza
98214 by: Craig Vincent
98215 by: Jason Soza
98216 by: Richard Baskett
98217 by: Jason Soza
98219 by: Jason Soza
98221 by: Richard Baskett
98222 by: Jason Soza
98223 by: Richard Baskett
98224 by: Craig Vincent
98225 by: Craig Vincent
98226 by: Richard Baskett

Re: ob_start() and ob_gzhandler
98218 by: Jason Wong

Re: Strange behavior with imap, php and apache
98220 by: Jason Wong

virtual coin toss 55%
98227 by: Randy Johnson
98228 by: Richard Baskett
98229 by: Jason Wong

When did $_SERVER become the preferred syntax?
98230 by: Brad Hubbard
98231 by: Jason Wong
98234 by: Richard Baskett
98235 by: Brad Hubbard

Upgraded, now sessions aren't working.  Please help :)
98232 by: Stephen Bolinger
98233 by: Richard Baskett

parsing CSV, updating MySQL table
98236 by: Justin French

Re: $answers[answer$n]
98237 by: Michael Virnstein

Re: PHP+MySQL - Excel ?
98238 by: savaidis

Bulletin Boards
98239 by: Richard Baskett
98241 by: Liam MacKenzie

blank screen on parse errors after creating php.ini on linux
98240 by: andy
98242 by: Jason Wong

PHP,Apache disabled FTP?
98243 by: r
98245 by: Craig Vincent
98246 by: Dan Hardiker
98248 by: r

Any Ideas @ becomes _Xy
98244 by: Henry

need help on a ereg stmt. validating website adress
98247 by: andy

Re: Newbie - create image error URGENT
98249 by: Henry

Bundled php mysql library vs mysql extension
98250 by: Pentothal

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

Im looking to know how to handle it.
HTTP_ACCEPT_LANGUAGE = en-us, en;q=0.75, th;q=0.50, yi;q=0.25
What are the 'q' values for?

Thanks...


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

On Fri, 17 May 2002, Gerard Samuel wrote:
 Im looking to know how to handle it.
 HTTP_ACCEPT_LANGUAGE = en-us, en;q=0.75, th;q=0.50, yi;q=0.25
 What are the 'q' values for?

How much they'd like to receive one of those other languages. The closer
the number is to 1, the more excited they are about it.

miguel


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

update table set answer3=5 where id=2;

miguel

On Fri, 17 May 2002, Jule wrote:
 a question:
 
 if i have this:
 
 for ($n = 1; $n = $quiz[number_answers]; $n++) {
   $table = $qcode._answers;
   $value = $answers[answer.$n];
   $value2 = answer.$n;
 
   $query_alter_table = ALTER TABLE $table ADD $value2 TEXT NOT NULL;
   $query_add_answers = INSERT INTO $table ($value2) VALUES('$value');
   if (mysql_db_query($database_glob, $query_alter_table, $link_glob)) {
   if (mysql_db_query($database_glob, $query_add_answers, $link_glob)) {
   echo Answer $n: $value has successfully been added to the 
Quizbr\n;
   } else {
   echo mysql_error() . 1br;
   }
   } else {
   echo mysql_error(). 2br;
   }
 }
 
 How do I get the $value to be in the same row as the preceding one?
 now it comes like this:
 ++-+-+-+-+
 
 | id | answer1 | answer2 | answer3 | answer4 |
 
 ++-+-+-+-+
 
 |  1 | answer1 | | | |
 |  2 | | answer2 | | |
 |  3 | | | answer3 | |
 |  4 | | | | answer4 |
 
 ++-+-+-+-+
 
 so it's like this?
 ++-+-+-+-+
 
 | id | answer1 | answer2 | answer3 | answer4 |
 
 ++-+-+-+-+
 
 |  1 | answer1 | answer2 | answer3 | answer4 |
 
 ++-+-+-+-+
 
 thanks,
 
 Jule
 
 On Friday 17 May 2002 19:17, you wrote:
  Hello,
 
  Try using NOT NULL.  As weird as MySQL can be, don't think it 

[PHP] How do I get rid of session id (test purposes)

2002-05-18 Thread Henry

Hello All

Love Sessions! BUT

how do I clear it so that when I execute session_start() again I get a new
one? Help.

I'm sure I should have RTFM more but I'm a newbie.

Henry



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




[PHP] (newbi)mySQL query question

2002-05-18 Thread webmaster



This doesn't have a huge amount to do with PHP 
but,

I have the following code for my SQL 
query:

$query = "SELECT code FROM links WHERE sort_text = $letter*";
I get an error.
What I want to do is be able to specify 
a letter and have the rest be undefined eg
if $letter was t
I would get TecEco, Tiny, and 
Trailer
and if $letter was b I would get Basket 
and Ball.
Could any one show me the correct 
syntax off their heads?JJ Harrison[EMAIL PROTECTED]www.tececo.com


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


[PHP] How can I ammend the session_id

2002-05-18 Thread Henry

Dear All,

I want to use the session id that session_start would create but I wish to
modify it as well! Suggestions?

I'm currently trying:

$sessionID = uniqid();
session_id($sessionID.u.$u.c.$c.z);
session_start();

where $u and $c are passed in the URL


Thanks in advance

Henry



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




[PHP] Complex(ish) Question for Newbie

2002-05-18 Thread webmaster



How can I return the last five lines of a mySQL 
database table?

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] Bulletin Boards

2002-05-18 Thread Jeff Lewis

Never used Phorums as it didn't have what I was looking for.  Tried phpBB
but the admins ection is awful IMHO.  I currently use YaBB SE which has a
very fast development time.

Jeff
- Original Message -
From: Richard Baskett [EMAIL PROTECTED]
To: PHP General [EMAIL PROTECTED]
Sent: Saturday, May 18, 2002 4:51 AM
Subject: [PHP] Bulletin Boards


 Has anybody used phpBB  Phorum?  And if so, which did you like better
and
 why?  And if you've used other systems.. Which did you like best and why?
 Thanks! :)

 Rick

 We should be taught not to wait for inspiration to start a thing.  Action
 always generates inspiration.  Inspiration seldom generates action. -
Frank
 Tibolt


 --
 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] (newbi)mySQL query question

2002-05-18 Thread The_RadiX

try this:

$query = SELECT code FROM links WHERE sort_text LIKE '$letter%';


Note there are now single quotes (') identifying the string of the LIKE operator and 
also the assignment operator (=) has been replaced with the proper LIKE mySQL operator 
that allows for string search arguments.



:::
:  Julien Bonastre [The-Spectrum.org CEO]
:  A.K.A. The_RadiX
:  [EMAIL PROTECTED]
:  ABN: 64 235 749 494
:  QUT Student #: 04475739
:::
  - Original Message - 
  From: [EMAIL PROTECTED] 
  To: [EMAIL PROTECTED] 
  Sent: Saturday, May 18, 2002 11:27 PM
  Subject: [PHP] (newbi)mySQL query question


  This doesn't have a huge amount to do with PHP but,

  I have the following code for my SQL query:
  $query = SELECT code FROM links WHERE sort_text = $letter*;

  I get an error.

  What I want to do is be able to specify a letter and have the rest be undefined eg

  if $letter was t

  I would get TecEco, Tiny, and Trailer

  and if $letter was b I would get Basket and Ball.

  Could any one show me the correct syntax off their heads?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] Complex(ish) Question for Newbie

2002-05-18 Thread The_RadiX

Goody another easy to answer one :) no harm intended.. it's a perfectly good question


Okay first is it sorted how you want?

if so you can use the LIMIT start,len feature of mysql..


for example:

select * from table_name order by col_name limit 5,10

will select records 5 to 15 (5+10) if of course there are 10 more to collect otherwise 
it will just return whatever it finds from the select that is ordered by col_name..


quite simple..


:::
:  Julien Bonastre [The-Spectrum.org CEO]
:  A.K.A. The_RadiX
:  [EMAIL PROTECTED]
:  ABN: 64 235 749 494
:  QUT Student #: 04475739
:::
  - Original Message - 
  From: [EMAIL PROTECTED] 
  To: [EMAIL PROTECTED] 
  Sent: Sunday, May 19, 2002 12:01 AM
  Subject: [PHP] Complex(ish) Question for Newbie


  How can I return the last five lines of a mySQL database table?

  JJ Harrison
  [EMAIL PROTECTED]
  www.tececo.com


--


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



[PHP] How can I access the value in a variable whos name is in a string

2002-05-18 Thread Henry

Dear All,

$variablename=variable;
eval(\$.$variablename.=13;);
echo $variable;

This works fine!! It echoes 13;

But this doesn't -

echo eval(\$variablename\);

Why??


Henry




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




[PHP] Re: How can I access the value in a variable whos name is in a string

2002-05-18 Thread Henry

I found one way I can do the following

eval(\$val=\$.$variation.;);
echo $val;

Is there a better way?
Henry

Henry [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Dear All,

 $variablename=variable;
 eval(\$.$variablename.=13;);
 echo $variable;

 This works fine!! It echoes 13;

 But this doesn't -

 echo eval(\$variablename\);

 Why??


 Henry






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




Re: [PHP] PHP,Apache disabled FTP?

2002-05-18 Thread r

Hi,
I tried to use ftp via the command prompt it didnt work, got a timed out
error.
Tried to use it via cuteFTPtimed out error..will try after 30
seconds5 minutes later...10 timeouts.


Any ideas?

-Ryan

- Original Message -
From: Michael Geier [EMAIL PROTECTED]
To: r [EMAIL PROTECTED]
Sent: Saturday, May 18, 2002 7:29 AM
Subject: Re: [PHP] PHP,Apache disabled FTP?


 More information about the ftp daemon would be needed
 for us to make an informed opinion.  Neither PHP, nor
 Apache is, or ever has been, and ftp daemon*

 * - well, you could write a socket program with PHP to
 listen to port 21 and receive and transmit files,
 but IMHO is probably not the best tool for the job.

 ftp.exe is the ftp client for windows, not a daemon.
 If you were previously using IIS, that web server comes
 bundled with a FTP server.  If not, what ftpd were you
 using?  There are several free|commercial packages that
 could be used to suit your needs.

 --
 Michael Geier
 CDM Sports, Inc. - Systems Administrator
 email: [EMAIL PROTECTED]
 phone: 314.991.1511 x 6505


 Quoting r [EMAIL PROTECTED]:

  Hey,
  Thank you for replying.
  Nope am not using IIS, I just have a plain win2k machine that used to
ftp
  without any problems before.now i cant even find ftp.dll but can
find
  ftp://ftp.exe
  I am unable to connect to 5 sites owned by the company i work for but am
  able to connect to them when i go to a cyber cafe I have tried
stopping
  apache no use...tried to go to the php.ini file and see if there is
  anything about enableing FTP...none...going crazy.
 
  Any help or ideas.
  -Ryan.
 
 
   Unless your using IIS to serve your FTP ;) That would go belly up if
  youve
   got another http processes running. More information about your setup
is
   required for us to help further.
  
   --
   Dan Hardiker [[EMAIL PROTECTED]]
   ADAM Software  Systems Engineer
  
  
  
   --
   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 mail sent through CDM Sports Webmail.



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




[PHP] Apache(webserver) question, sorry if somebody won't like it

2002-05-18 Thread Mantuks

Hey!
i am having problems with my apache server. Im runnin 
PHPTriad thing with mysql and apache 
webserver..everything seems to be ok... but...the thing 
is that im runnin on my win2k platform which i also use 
for stuff...and i have webcam uploadin pic every 
sec..also java applet refreshing every 5 seconds so when 
few people connects to watch or surfes some webpages on 
the server because i have few of them..the apache stops 
responding..y? is there some trick that i don't know of? 
or its just my pc is too busy? sorry again about of 
topic but i have to reload that server very often

thanks
Mantas Kriauciunas


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




Re: [PHP] Complex(ish) Question for Newbie

2002-05-18 Thread The_RadiX

well personally I have never had a good time with mysql_num_rows.. dunno why.. never 
seemed to have worked the way it should for me..


anyway point is if it works for you good, otherwise do what I do to get a rowcount and 
just:
$sql_count=mysql_fetch_array(mysql_query(SELECT count(*) FROM table_name,$DB));


and then you can just refer to it via $sql_count[0]...


anyways after that it depends.. what do you want to do?


if for example you want a page listing system in which you have say 1000 records and 
you want to display only 30 per page or something and users can browse through by 
hitting prev page and next page etc.. that's easy to do...



just be more specific on what you want to do..






:::
:  Julien Bonastre [The-Spectrum.org CEO]
:  A.K.A. The_RadiX
:  [EMAIL PROTECTED]
:  ABN: 64 235 749 494
:  QUT Student #: 04475739
:::
- Original Message - 
From: [EMAIL PROTECTED]
To: The_RadiX [EMAIL PROTECTED]
Sent: Sunday, May 19, 2002 12:39 AM
Subject: Re: [PHP] Complex(ish) Question for Newbie


 Thanks.
 
 What is the best way to make the limit update it self as I add more entires.
 
 I am thinking of using a blank query (SELECT code FROM links)
 and then counting the number of rows with mysql_num_rows().
 
 But wouldn't this be a little slow if the database was big?
 
 - Original Message -
 From: The_RadiX [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Sunday, May 19, 2002 12:07 AM
 Subject: Re: [PHP] Complex(ish) Question for Newbie
 
 
 Goody another easy to answer one :) no harm intended.. it's a perfectly good
 question
 
 
 Okay first is it sorted how you want?
 
 if so you can use the LIMIT start,len feature of mysql..
 
 
 for example:
 
 select * from table_name order by col_name limit 5,10
 
 will select records 5 to 15 (5+10) if of course there are 10 more to collect
 otherwise it will just return whatever it finds from the select that is
 ordered by col_name..
 
 
 quite simple..
 
 
 :::
 :  Julien Bonastre [The-Spectrum.org CEO]
 :  A.K.A. The_RadiX
 :  [EMAIL PROTECTED]
 :  ABN: 64 235 749 494
 :  QUT Student #: 04475739
 :::
   - Original Message -
   From: [EMAIL PROTECTED]
   To: [EMAIL PROTECTED]
   Sent: Sunday, May 19, 2002 12:01 AM
   Subject: [PHP] Complex(ish) Question for Newbie
 
 
   How can I return the last five lines of a mySQL database table?
 
   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] How can I access the value in a variable whos name is in a string

2002-05-18 Thread The_RadiX

simple..


try this:
echo eval($variablename);

then again why are you eval()ing at all??


why can't you do this:

$var1=var2;
$$var1=13;
echo $var2;

//or perhaps even better:
//echo $$var1;

seems simple enough.. haven't tested but theory is there I think..

HTH

:::
:  Julien Bonastre [The-Spectrum.org CEO]
:  A.K.A. The_RadiX
:  [EMAIL PROTECTED]
:  ABN: 64 235 749 494
:  QUT Student #: 04475739
:::
- Original Message -
From: Henry [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, May 19, 2002 12:29 AM
Subject: [PHP] How can I access the value in a variable whos name is in a
string


 Dear All,

 $variablename=variable;
 eval(\$.$variablename.=13;);
 echo $variable;

 This works fine!! It echoes 13;

 But this doesn't -

 echo eval(\$variablename\);

 Why??


 Henry




 --
 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] need help on a ereg stmt. validating website adress

2002-05-18 Thread andy

 andy [EMAIL PROTECTED] wrote:

  Hi there,
 
  I would like to validate a website adress. Unfortunatelly my eregi stmt
does
  not work:
 
   if (eregi(^@([0-9a-z][0-9a-z-\.]+)\.([a-z]{2,3})), $website)){ // not
a
  link
 
  I am getting the error msg:
  Warning: REG_ERANGE in extend.inc on line 94

 The second charset: [0-9a-z-\.] has an errant hyphen (-). In this case
 the hyphen should be the first or last character. Also, the . char loses
 its meaning inside square brackets, so you don't need to escape it.
 Eg: [0-9a-z.-]

 --
 Richard Heyes
 ___
 This mail sent using V-webmail - http://www.v-webmail.co.uk



I did change the comment to what you suggested:
 if (eregi(^@([0-9a-z][0-9a-z-.]+)\.([a-z]{2,3})), $website)){ // not a
link

but this seams not to work as well. It is still possible to post a website
like this: http://website
So somehow the last part does not work checking for dot and 2 or 3 char.

does somebody have an idea on that?

Thanx, Andy


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




[PHP] Re: Confused about which function to use with forms/database

2002-05-18 Thread Dennis Gearon

I appreciate all the good info on this subject, everybody. 

In looking the archives, I am still confused on one issue. Do **ALL**
databases treat \' or \ as escaped? Isn't the SQL standard character to
escape with a ' ?
-- 
-
Joy is just a thing (to be).. raised on,
Love is just the way to Live and Die,
John Denver.
-
He lost a friend, but kept his Memory (also John Denver),
Thank you...John Corones...my friend always.
-
Look lovingly upon the present,
for it holds the only things that are forever true.
-
Sincerely, Dennis Gearon (Kegley)

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




Re: [PHP] Bundled php mysql library vs mysql extension

2002-05-18 Thread Rasmus Lerdorf

Nope, it isn't faster.  You should use your own if you have one installed
on your machine.  Chances are your will match your server better than the
bundled one.  The typical mismatch being the location of the mysql
unix-domain socket.

We bundled one so that the default PHP install will always be able to talk
to a remote MySQL server and because we got tired of answering the dozens
of mysql_connect undefined function questions we got every day.

-Rasmus

On Sat, 18 May 2002, Pentothal wrote:

 Which are the differences between the php bundled mysql
 library and the external standard extension? Is the
 bundled one faster? How much?



 --
 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] Whats the best way?

2002-05-18 Thread Gerard Samuel

Well this is the first time actually creating a regex.
It works, but was wondering if the regex was created properly.

HTTP_ACCEPT_LANGUAGE is 'en-us, en;q=0.75, nl;q=0.50, fr;q=0.25'

/* Explode the browser report to get each language */
$foo = split(',', $_SERVER['HTTP_ACCEPT_LANGUAGE'] );

/* Perform a regex to get the first 2 letters for each language reported */
foreach ($foo as $bar) {
$string = 
preg_replace(/([a-z]{2})|(-[a-z]{2})|(;q=[0-9]\.[0-9]{2})/i, $1, 
trim($bar));
$array[] = $string;
}

Thanks


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




[PHP] Netscape6 and Javascript

2002-05-18 Thread wolf

Hi, I need help for an non-php-problem.

I've a frameset with 2 frames.
There is a TOPframe with the name topframe
who contains an input-Field.
  input type=text name=txt
in the form named mainform.

The BOTTOMframe contains a link.
With the link I have to change the value
of the input field in the TOPframe.
The Javascript command
parent.topframe.mainform.txt.value=val;
doesn't work in Netscape 6.

Tell me the correct syntax.

Thanx



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




Re: [PHP] Free Hosting /w PHP/MySQL {!?}

2002-05-18 Thread Olexandr Vynnychenko

Hello Liam,

Monday, May 06, 2002, 6:00:07 AM, you wrote:

LM Free hosting for PHP Developers.

LM As many MySQL Databases as you need
LM PHP with all the bits http://scripts.operationenigma.net/phpinfo.php
LM FTP Access
LM Subdomain or Your own Domain
LM Tech Support over MSN if needed
LM 98% Uptime
LM 512/512 Connection based in Brisbane, Australia


LM Only catch is that I can't have downloads on my servers.  
LM I have a 3 Gig Monthty transfer limit, so no MP3s or 
LM thereabouts please.

LM Contact me if you're interested.

I have a problem. I have to place my site (my term work) on some host.
I thought I had it, but I was wrong. They have PHP 4.1.2 without xslt
and domxml extensions. But my site won't work without xslt bacause all
inner data is stored in XML. They said it could take at least a week
to include these modules. But I can't wait for a week. Can you help
me? I saw you have PHP 4.2.1, but there is no xslt and domxml. Is it
possible to include them in some way? I would appreciate deeply, if
you could solve this stupid problem. Thanks in advance.

-- 
Best regards,
 Olexandrmailto:[EMAIL PROTECTED]


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




Re: [PHP] header-sending misbehaving

2002-05-18 Thread erich

jason wong

what is meant by output buffering? what PHP function(s) can
support output buffer?

thanks

erich



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




RE: [PHP] Feelin' dumb...

2002-05-18 Thread Jason Soza

Thanks everyone for your help on this, this is the final code:

if ($num_pages = 2) {
for ($i=0, $p=1; $i$num_pages; $i++, $p++) {
$j = ($i==0) ? $i : $j+20;
printf(| a href=\test.php?type=allpage=%s\Page 
%s/a | ,
$j, $p);
}
}

Because of the way MySQL uses LIMIT, I found that using LIMIT 1, 20 and
LIMIT 21, 20 leaves out the 1st and 20th records. So I had to change $i to 0
to get them back. However, this left me with Page 0 | Page 1 - not cool,
so I added $p into the loop, but started it at 1 so I'd have a variable to
use for correct page numbers.

Oh and I had to change $i=$num_pages to just $i$num_pages because with
$i=0, I was getting an extra iteration. What a learning experience!

Thanks again,

Jason Soza

-Original Message-
From: Richard Baskett [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 17, 2002 8:47 PM
To: Jason Soza; PHP General
Subject: Re: [PHP] Feelin' dumb...


Ok Im feeling dumb also now *hehe*  What I said about putting the $number
line below the printf line.. Don¹t listen to me :)  Now that I know what you
want.. I know there is cleaner and better code, but it works :)

if ($num_pages = 2) {
  for ($i=1; $i=$num_pages; $i++) {
$j = ($i==1) ? $i : $j+20;
echo | a href=\test.php?page=$j\Page $i/a | ;
  }
}

Rick

Be kind. Everyone you meet is fighting a hard battle - John Watson

 From: Jason Soza [EMAIL PROTECTED]
 Date: Fri, 17 May 2002 20:44:30 -0800
 To: Richard Baskett [EMAIL PROTECTED], PHP General
 [EMAIL PROTECTED]
 Subject: RE: [PHP] Feelin' dumb...

 The 20 is inserted into a MySQL LIMIT query. Page 1 = LIMIT 1,20 to get
the
 first 20 records from 1, then Page 2 = LIMIT 21,20 to get the next 20,
etc.

 I think I see the error here.

if ($num_pages = 2) {
for ($i=1; $i=$num_pages; $i++) {
$number = ($i * 20) + 1;
printf(| a href=\test.php?page=%s\Page %s/a | , $number,
 $i);
 }
 }

 Is ALMOST right... Except that the I need the first iteration to return 1.
 In this case, it returns 21, so the next iteration is 41. Follow me? I
need
 1, 21, not 21, 41. Almost there I think, unfortunately, I need to jet.
I'll
 be thinkin' on this one while DJing, definitely!

 Thanks again for everyone's help.


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




RE: [PHP] How can I access the value in a variable whos name is in a string

2002-05-18 Thread Jonathan Rosenberg

I'm a PHP amateur, but a quick perusal of Eval in the manual says

In PHP 4, eval() returns FALSE unless return() is
called in the evaluated code, in which case the
value passed to return() is returned. In PHP 3,
eval() does not return a value.

 -Original Message-
 From: Henry [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, May 18, 2002 10:30 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] How can I access the value in a 
 variable whos name is in
 a string
 
 
 Dear All,
 
 $variablename=variable;
 eval(\$.$variablename.=13;);
 echo $variable;
 
 This works fine!! It echoes 13;
 
 But this doesn't -
 
 echo eval(\$variablename\);
 
 Why??
 
 
 Henry
 
 
 
 
 -- 
 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] CGI / Apache module session permissions

2002-05-18 Thread Steve Clay

Hello,

To perform a certain task I have to run one of my PHP scripts as a
CGI, which works fine except that the CGI doesn't have permissions to
my sessions that were saved running under the Apache module. I
expected different permissions, but I thought my user would have
/more/ permission to those files than the PHP user since they're saved
under my account..  Since I'm moving the user to a secure server with
this script I want to start a new session anyway, but I at least need
to read in the old session.

ideas anyone?  I do pass the script the SID so could I manually change
the permissions on the session file?

Any advice on transfering a session variable to a 2nd session?

Thanks for any help..

Please CC me as I'm on digest..

Running Linux, shared-hosting :(
Apache module: PHP 4.1.2
CGI module: PHP 4.0.6 :(

Steve
-- 
[EMAIL PROTECTED] ** http://mrclay.org


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




Re: [PHP] header-sending misbehaving

2002-05-18 Thread Jason Wong

On Sunday 19 May 2002 00:54, erich wrote:

 what is meant by output buffering? what PHP function(s) can
 support output buffer?

The standard behaviour of PHP is to output stuff to the browser as soon as 
it's ready (more or less). By using the Output Control Functions (see 
manual) you can buffer this output in memory, manipulate it if necessary, 
then output to the browser.

The manual will probably explain better than I can.

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

/*
Your computer account is overdrawn.  Please see Big Brother.
*/


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




[PHP] Using PHP for NULLs

2002-05-18 Thread Jason Soza

I thought this was a MySQL question, or something that could be solved using
a creative SQL string, but after looking through the MySQL manual, I don't
think I can handle this with the database alone. According to the manual,
MySQL always sorts NULL values first - I want them last. I have a last_name
field that sometimes contains people's last names, sometimes they choose not
to enter their last names. I want those who don't enter a last name to end
up last on the list.

Right now I have: $result = mysql_query(SELECT * FROM new_miatapix ORDER BY
last_name LIMIT $page, 20);

Am I going to have to do two queries here, then store them somehow using an
array? It seems like I'm going to have to do one query to get all NULL
values for last_name, then do another query to get all NOT NULL values for
last_name, but how would I handle that after I get it to PHP?

Or can I use some PHP function to sort $result to place all NULL values
last? I'd check the PHP manual, but it seems to not be responding well at
the moment.

Thanks,

Jason Soza


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




[PHP] passing ARRAYs through GET strings

2002-05-18 Thread Navid Y.

Hello   :)

Can anyone suggest of another way, an easier way, to send arrays through
get strings, or through any other process, without having to serializing
it? For example, would it be better to use sessions in this case? Any
help would be greatful, thanks.  :)

Navid


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




Re: [PHP] passing ARRAYs through GET strings

2002-05-18 Thread Richard Baskett

In your html input just add [] to the name of your variable so for example:

input type=text name=firstvar[] /

Rick

Not one of them who took up in his youth with this opinion that there are
no gods, ever continued until old age faithful to his conviction. - Plato

 From: Navid Y. [EMAIL PROTECTED]
 Reply-To: [EMAIL PROTECTED]
 Date: Sat, 18 May 2002 13:26:11 -0500
 To: [EMAIL PROTECTED]
 Subject: [PHP] passing ARRAYs through GET strings
 
 Hello   :)
 
 Can anyone suggest of another way, an easier way, to send arrays through
 get strings, or through any other process, without having to serializing
 it? For example, would it be better to use sessions in this case? Any
 help would be greatful, thanks.  :)
 
 Navid
 
 
 -- 
 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] passing ARRAYs through GET strings

2002-05-18 Thread SP

Hi Navid

Don't you have to serialize it to put it in
sessions?

-Original Message-
From: Navid Y. [mailto:[EMAIL PROTECTED]]
Sent: May 18, 2002 2:26 PM
To: [EMAIL PROTECTED]
Subject: [PHP] passing ARRAYs through GET strings


Hello   :)

Can anyone suggest of another way, an easier way,
to send arrays through
get strings, or through any other process, without
having to serializing
it? For example, would it be better to use
sessions in this case? Any
help would be greatful, thanks.  :)

Navid


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


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

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


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




Re: [PHP] passing ARRAYs through GET strings

2002-05-18 Thread Richard Baskett

Oh sorry I read your message wrong.. But the idea still stands..

a href=nextpage.php?var[]=1var[]=2var[]=3Link/a

Rick

Sir my concern is not whether God is on our side. My great concern is to be
on God's side. - Abraham Lincoln

 From: Navid Y. [EMAIL PROTECTED]
 Reply-To: [EMAIL PROTECTED]
 Date: Sat, 18 May 2002 13:26:11 -0500
 To: [EMAIL PROTECTED]
 Subject: [PHP] passing ARRAYs through GET strings
 
 Hello   :)
 
 Can anyone suggest of another way, an easier way, to send arrays through
 get strings, or through any other process, without having to serializing
 it? For example, would it be better to use sessions in this case? Any
 help would be greatful, thanks.  :)
 
 Navid
 
 
 -- 
 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] passing ARRAYs through GET strings

2002-05-18 Thread Navid Y.

Thanks SP and Richard,

Well, I tested it and it works fine with sessions, without serializing
it. The only problem with sending it through GET url strings is that you
can only send about 255 characters of data through to the next page. I
was just looking to see how others pass their array values through their
URLs. So far sessions is a winner, but maybe there's another way. Like
what Richard suggested. But that method seems too time consuming and
will be confusing later on since it uses enumerated arrays. Just need
some suggestions and hints.   :)

-Original Message-
From: SP [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, May 18, 2002 1:31 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: [PHP] passing ARRAYs through GET strings


Hi Navid

Don't you have to serialize it to put it in
sessions?

-Original Message-
From: Navid Y. [mailto:[EMAIL PROTECTED]]
Sent: May 18, 2002 2:26 PM
To: [EMAIL PROTECTED]
Subject: [PHP] passing ARRAYs through GET strings


Hello   :)

Can anyone suggest of another way, an easier way,
to send arrays through
get strings, or through any other process, without
having to serializing
it? For example, would it be better to use
sessions in this case? Any
help would be greatful, thanks.  :)

Navid


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


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

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


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




Re: [PHP] passing ARRAYs through GET strings

2002-05-18 Thread Richard Baskett

Well what I normally do to pass very large arrays through strings.. when NOT
using sessions, I use serialize, but it sounds like you didn¹t want to
serialize..  If you give me an idea of what you are doing I might be able to
figure out the best way to pass those variables :)

And no you don't need to serialize the data when using sessions.  Sessions
themselves are serialized automatically, you don¹t need to worry about that.

Rick

We do not have to visit a mad house to find disordered minds; our planet is
the mental institution of the universe. - Unknown

 From: Navid Y. [EMAIL PROTECTED]
 Reply-To: [EMAIL PROTECTED]
 Date: Sat, 18 May 2002 13:51:38 -0500
 To: [EMAIL PROTECTED]
 Subject: RE: [PHP] passing ARRAYs through GET strings
 
 Thanks SP and Richard,
 
 Well, I tested it and it works fine with sessions, without serializing
 it. The only problem with sending it through GET url strings is that you
 can only send about 255 characters of data through to the next page. I
 was just looking to see how others pass their array values through their
 URLs. So far sessions is a winner, but maybe there's another way. Like
 what Richard suggested. But that method seems too time consuming and
 will be confusing later on since it uses enumerated arrays. Just need
 some suggestions and hints.   :)
 
 -Original Message-
 From: SP [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, May 18, 2002 1:31 PM
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Subject: RE: [PHP] passing ARRAYs through GET strings
 
 
 Hi Navid
 
 Don't you have to serialize it to put it in
 sessions?
 
 -Original Message-
 From: Navid Y. [mailto:[EMAIL PROTECTED]]
 Sent: May 18, 2002 2:26 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] passing ARRAYs through GET strings
 
 
 Hello   :)
 
 Can anyone suggest of another way, an easier way,
 to send arrays through
 get strings, or through any other process, without
 having to serializing
 it? For example, would it be better to use
 sessions in this case? Any
 help would be greatful, thanks.  :)
 
 Navid
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit:
 http://www.php.net/unsub.php
 
 
 ---
 Incoming mail is certified Virus Free.
 Checked by AVG anti-virus system
 (http://www.grisoft.com).
 Version: 6.0.361 / Virus Database: 199 - Release
 Date: 07/05/02
 
 ---
 Outgoing mail is certified Virus Free.
 Checked by AVG anti-virus system
 (http://www.grisoft.com).
 Version: 6.0.361 / Virus Database: 199 - Release
 Date: 07/05/02
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


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




[PHP] Re: Using PHP for NULLs

2002-05-18 Thread Dan Koken

I do believe it is a MySql question!!

What's wrong with the old standard way as:

$result = mysql_query(
SELECT *,
if (last_name is NULL,'zzz end',last_name) as last_name_sort
FROM   new_miatapix
ORDER BY last_name_sort
LIMIT $page, 20);


Good Luck.. HTH..
Dan..
===
Jason Soza wrote:

 I thought this was a MySQL question, or something that could be solved using
 a creative SQL string, but after looking through the MySQL manual, I don't
 think I can handle this with the database alone. According to the manual,
 MySQL always sorts NULL values first - I want them last. I have a last_name
 field that sometimes contains people's last names, sometimes they choose not
 to enter their last names. I want those who don't enter a last name to end
 up last on the list.
 
 Right now I have: $result = mysql_query(SELECT * FROM new_miatapix ORDER BY
 last_name LIMIT $page, 20);
 
 Am I going to have to do two queries here, then store them somehow using an
 array? It seems like I'm going to have to do one query to get all NULL
 values for last_name, then do another query to get all NOT NULL values for
 last_name, but how would I handle that after I get it to PHP?
 
 Or can I use some PHP function to sort $result to place all NULL values
 last? I'd check the PHP manual, but it seems to not be responding well at
 the moment.
 
 Thanks,
 
 Jason Soza
 
 


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




RE: [PHP] passing ARRAYs through GET strings

2002-05-18 Thread SP

Okay let me clarify, if I had an array like this I
would just use sessions this way:

$myarray = array( array('1', '2'),
  array('3', '4') );
$_SESSION['myarray'] = serialize($myarray);

Then you can use the array on any page the user
goes to by doing this:

$myarray = unserialize($_SESSION['myarray']);





-Original Message-
From: Navid Y. [mailto:[EMAIL PROTECTED]]
Sent: May 18, 2002 2:52 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] passing ARRAYs through GET
strings


Thanks SP and Richard,

Well, I tested it and it works fine with sessions,
without serializing
it. The only problem with sending it through GET
url strings is that you
can only send about 255 characters of data through
to the next page. I
was just looking to see how others pass their
array values through their
URLs. So far sessions is a winner, but maybe
there's another way. Like
what Richard suggested. But that method seems too
time consuming and
will be confusing later on since it uses
enumerated arrays. Just need
some suggestions and hints.   :)

-Original Message-
From: SP [mailto:[EMAIL PROTECTED]]
Sent: Saturday, May 18, 2002 1:31 PM
To: [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: RE: [PHP] passing ARRAYs through GET
strings


Hi Navid

Don't you have to serialize it to put it in
sessions?

-Original Message-
From: Navid Y. [mailto:[EMAIL PROTECTED]]
Sent: May 18, 2002 2:26 PM
To: [EMAIL PROTECTED]
Subject: [PHP] passing ARRAYs through GET strings


Hello   :)

Can anyone suggest of another way, an easier way,
to send arrays through
get strings, or through any other process, without
having to serializing
it? For example, would it be better to use
sessions in this case? Any
help would be greatful, thanks.  :)

Navid


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


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

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


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


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

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


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




RE: [PHP] passing ARRAYs through GET strings

2002-05-18 Thread Navid Y.

Well Rick,

Let's say I had a form with a text box and an textarea box. The text box
won't contain that many strings, but the textarea box can contain
thousands of characters, if the user wished to write that much. Both of
the fields will be contained in a single array. If I send this array
through a GET string, it will only pass 255 characters through to the
next page, and the rest of the content will be cut out of the picture as
if it never existed. Then, I thought maybe sessions would do the trick,
and it does a great job so far. So now I'm stuck with the idea that
using sessions to pass arrays, in the particular situation, would be the
best thing to do. But, out of curiousity, I wanted to know how other
people sent their arrays back and forth from one page to another. That's
all  :)   Thanks for your patience, I really appreciate it.

-Original Message-
From: Richard Baskett [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, May 18, 2002 2:12 PM
To: [EMAIL PROTECTED]; PHP General
Subject: Re: [PHP] passing ARRAYs through GET strings


Well what I normally do to pass very large arrays through strings.. when
NOT using sessions, I use serialize, but it sounds like you didn¹t want
to serialize..  If you give me an idea of what you are doing I might be
able to figure out the best way to pass those variables :)

And no you don't need to serialize the data when using sessions.
Sessions themselves are serialized automatically, you don¹t need to
worry about that.

Rick

We do not have to visit a mad house to find disordered minds; our
planet is the mental institution of the universe. - Unknown

 From: Navid Y. [EMAIL PROTECTED]
 Reply-To: [EMAIL PROTECTED]
 Date: Sat, 18 May 2002 13:51:38 -0500
 To: [EMAIL PROTECTED]
 Subject: RE: [PHP] passing ARRAYs through GET strings
 
 Thanks SP and Richard,
 
 Well, I tested it and it works fine with sessions, without serializing

 it. The only problem with sending it through GET url strings is that 
 you can only send about 255 characters of data through to the next 
 page. I was just looking to see how others pass their array values 
 through their URLs. So far sessions is a winner, but maybe there's 
 another way. Like what Richard suggested. But that method seems too 
 time consuming and will be confusing later on since it uses enumerated
arrays. Just need
 some suggestions and hints.   :)
 
 -Original Message-
 From: SP [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, May 18, 2002 1:31 PM
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Subject: RE: [PHP] passing ARRAYs through GET strings
 
 
 Hi Navid
 
 Don't you have to serialize it to put it in
 sessions?
 
 -Original Message-
 From: Navid Y. [mailto:[EMAIL PROTECTED]]
 Sent: May 18, 2002 2:26 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] passing ARRAYs through GET strings
 
 
 Hello   :)
 
 Can anyone suggest of another way, an easier way,
 to send arrays through
 get strings, or through any other process, without
 having to serializing
 it? For example, would it be better to use
 sessions in this case? Any
 help would be greatful, thanks.  :)
 
 Navid
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit:
 http://www.php.net/unsub.php
 
 
 ---
 Incoming mail is certified Virus Free.
 Checked by AVG anti-virus system
 (http://www.grisoft.com).
 Version: 6.0.361 / Virus Database: 199 - Release
 Date: 07/05/02
 
 ---
 Outgoing mail is certified Virus Free.
 Checked by AVG anti-virus system
 (http://www.grisoft.com).
 Version: 6.0.361 / Virus Database: 199 - Release
 Date: 07/05/02
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 



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




[PHP] Re: CGI / Apache module session permissions

2002-05-18 Thread Steve Clay

Saturday, May 18, 2002, 1:05:30 PM, I wrote:
SC CGI, which works fine except that the CGI doesn't have permissions to
SC my sessions that were saved running under the Apache module. I

Figured it out:

from Apache mod script before CGI script:

//allow CGI to access session
$sess_file = session_save_path()./sess_.session_id();
chmod($sess_file,0666);

Sorry for the noise..

Steve
-- 
[EMAIL PROTECTED] ** http://mrclay.org


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




RE: [PHP] passing ARRAYs through GET strings

2002-05-18 Thread Navid Y.

No need to serialize arrays in PHP 4.0. They work seamlessly, as if
you've passed a regular variable through. Thanks for your help and
patience  :)

-Original Message-
From: SP [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, May 18, 2002 2:27 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: [PHP] passing ARRAYs through GET strings


Okay let me clarify, if I had an array like this I
would just use sessions this way:

$myarray = array( array('1', '2'),
  array('3', '4') );
$_SESSION['myarray'] = serialize($myarray);

Then you can use the array on any page the user
goes to by doing this:

$myarray = unserialize($_SESSION['myarray']);





-Original Message-
From: Navid Y. [mailto:[EMAIL PROTECTED]]
Sent: May 18, 2002 2:52 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] passing ARRAYs through GET
strings


Thanks SP and Richard,

Well, I tested it and it works fine with sessions,
without serializing
it. The only problem with sending it through GET
url strings is that you
can only send about 255 characters of data through
to the next page. I
was just looking to see how others pass their
array values through their
URLs. So far sessions is a winner, but maybe
there's another way. Like
what Richard suggested. But that method seems too
time consuming and
will be confusing later on since it uses
enumerated arrays. Just need
some suggestions and hints.   :)

-Original Message-
From: SP [mailto:[EMAIL PROTECTED]]
Sent: Saturday, May 18, 2002 1:31 PM
To: [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: RE: [PHP] passing ARRAYs through GET
strings


Hi Navid

Don't you have to serialize it to put it in
sessions?

-Original Message-
From: Navid Y. [mailto:[EMAIL PROTECTED]]
Sent: May 18, 2002 2:26 PM
To: [EMAIL PROTECTED]
Subject: [PHP] passing ARRAYs through GET strings


Hello   :)

Can anyone suggest of another way, an easier way,
to send arrays through
get strings, or through any other process, without
having to serializing
it? For example, would it be better to use
sessions in this case? Any
help would be greatful, thanks.  :)

Navid


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


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

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


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


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

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



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




RE: [PHP] Re: Using PHP for NULLs

2002-05-18 Thread Jason Soza

Thanks for the help! I spent more time looking at IFNULL() when I should've
just been looking at IF(). Thanks again, sorry for the off-topic!

Jason Soza

-Original Message-
From: Dan Koken [mailto:[EMAIL PROTECTED]]
Sent: Saturday, May 18, 2002 11:16 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: Using PHP for NULLs


I do believe it is a MySql question!!

What's wrong with the old standard way as:

$result = mysql_query(
SELECT *,
if (last_name is NULL,'zzz end',last_name) as last_name_sort
FROM   new_miatapix
ORDER BY last_name_sort
LIMIT $page, 20);


Good Luck.. HTH..
Dan..
===
Jason Soza wrote:

 I thought this was a MySQL question, or something that could be solved
using
 a creative SQL string, but after looking through the MySQL manual, I don't
 think I can handle this with the database alone. According to the manual,
 MySQL always sorts NULL values first - I want them last. I have a
last_name
 field that sometimes contains people's last names, sometimes they choose
not
 to enter their last names. I want those who don't enter a last name to end
 up last on the list.

 Right now I have: $result = mysql_query(SELECT * FROM new_miatapix ORDER
BY
 last_name LIMIT $page, 20);

 Am I going to have to do two queries here, then store them somehow using
an
 array? It seems like I'm going to have to do one query to get all NULL
 values for last_name, then do another query to get all NOT NULL values for
 last_name, but how would I handle that after I get it to PHP?

 Or can I use some PHP function to sort $result to place all NULL values
 last? I'd check the PHP manual, but it seems to not be responding well at
 the moment.

 Thanks,

 Jason Soza




--
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] passing ARRAYs through GET strings

2002-05-18 Thread Richard Baskett

Hey no problem.. That's what this list is for.. Asking questions and
answering them :)

I just use sessions to pass a lot of variables to a lot of pages.. Or some
variables to a lot of pages.. Usually for site authorization that's about
it.  When I just want to pass arrays to another page, I use serialization,
it's the fastest easiest way in my opinion and you don¹t have to mess with
sessions since in my opinion it would be overkill :)

Rick

Nobody will ever win the Battle of the Sexes. There's just too much
fraternizing with the enemy. - Henry Kissinger

 From: Navid Y. [EMAIL PROTECTED]
 Reply-To: [EMAIL PROTECTED]
 Date: Sat, 18 May 2002 14:43:27 -0500
 To: 'PHP General' [EMAIL PROTECTED]
 Subject: RE: [PHP] passing ARRAYs through GET strings
 
 Well Rick,
 
 Let's say I had a form with a text box and an textarea box. The text box
 won't contain that many strings, but the textarea box can contain
 thousands of characters, if the user wished to write that much. Both of
 the fields will be contained in a single array. If I send this array
 through a GET string, it will only pass 255 characters through to the
 next page, and the rest of the content will be cut out of the picture as
 if it never existed. Then, I thought maybe sessions would do the trick,
 and it does a great job so far. So now I'm stuck with the idea that
 using sessions to pass arrays, in the particular situation, would be the
 best thing to do. But, out of curiousity, I wanted to know how other
 people sent their arrays back and forth from one page to another. That's
 all  :)   Thanks for your patience, I really appreciate it.
 
 -Original Message-
 From: Richard Baskett [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, May 18, 2002 2:12 PM
 To: [EMAIL PROTECTED]; PHP General
 Subject: Re: [PHP] passing ARRAYs through GET strings
 
 
 Well what I normally do to pass very large arrays through strings.. when
 NOT using sessions, I use serialize, but it sounds like you didn¹t want
 to serialize..  If you give me an idea of what you are doing I might be
 able to figure out the best way to pass those variables :)
 
 And no you don't need to serialize the data when using sessions.
 Sessions themselves are serialized automatically, you don¹t need to
 worry about that.
 
 Rick
 
 We do not have to visit a mad house to find disordered minds; our
 planet is the mental institution of the universe. - Unknown
 
 From: Navid Y. [EMAIL PROTECTED]
 Reply-To: [EMAIL PROTECTED]
 Date: Sat, 18 May 2002 13:51:38 -0500
 To: [EMAIL PROTECTED]
 Subject: RE: [PHP] passing ARRAYs through GET strings
 
 Thanks SP and Richard,
 
 Well, I tested it and it works fine with sessions, without serializing
 
 it. The only problem with sending it through GET url strings is that
 you can only send about 255 characters of data through to the next
 page. I was just looking to see how others pass their array values
 through their URLs. So far sessions is a winner, but maybe there's
 another way. Like what Richard suggested. But that method seems too
 time consuming and will be confusing later on since it uses enumerated
 arrays. Just need
 some suggestions and hints.   :)
 
 -Original Message-
 From: SP [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, May 18, 2002 1:31 PM
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Subject: RE: [PHP] passing ARRAYs through GET strings
 
 
 Hi Navid
 
 Don't you have to serialize it to put it in
 sessions?
 
 -Original Message-
 From: Navid Y. [mailto:[EMAIL PROTECTED]]
 Sent: May 18, 2002 2:26 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] passing ARRAYs through GET strings
 
 
 Hello   :)
 
 Can anyone suggest of another way, an easier way,
 to send arrays through
 get strings, or through any other process, without
 having to serializing
 it? For example, would it be better to use
 sessions in this case? Any
 help would be greatful, thanks.  :)
 
 Navid
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit:
 http://www.php.net/unsub.php
 
 
 ---
 Incoming mail is certified Virus Free.
 Checked by AVG anti-virus system
 (http://www.grisoft.com).
 Version: 6.0.361 / Virus Database: 199 - Release
 Date: 07/05/02
 
 ---
 Outgoing mail is certified Virus Free.
 Checked by AVG anti-virus system
 (http://www.grisoft.com).
 Version: 6.0.361 / Virus Database: 199 - Release
 Date: 07/05/02
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


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




RE: [PHP] passing ARRAYs through GET strings

2002-05-18 Thread SP

Hey cool, didn't know that.

-Original Message-
From: Navid Y. [mailto:[EMAIL PROTECTED]]
Sent: May 18, 2002 3:45 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] passing ARRAYs through GET
strings


No need to serialize arrays in PHP 4.0. They work
seamlessly, as if
you've passed a regular variable through. Thanks
for your help and
patience  :)

-Original Message-
From: SP [mailto:[EMAIL PROTECTED]]
Sent: Saturday, May 18, 2002 2:27 PM
To: [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: RE: [PHP] passing ARRAYs through GET
strings


Okay let me clarify, if I had an array like this I
would just use sessions this way:

$myarray = array( array('1', '2'),
  array('3', '4') );
$_SESSION['myarray'] = serialize($myarray);

Then you can use the array on any page the user
goes to by doing this:

$myarray = unserialize($_SESSION['myarray']);





-Original Message-
From: Navid Y. [mailto:[EMAIL PROTECTED]]
Sent: May 18, 2002 2:52 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] passing ARRAYs through GET
strings


Thanks SP and Richard,

Well, I tested it and it works fine with sessions,
without serializing
it. The only problem with sending it through GET
url strings is that you
can only send about 255 characters of data through
to the next page. I
was just looking to see how others pass their
array values through their
URLs. So far sessions is a winner, but maybe
there's another way. Like
what Richard suggested. But that method seems too
time consuming and
will be confusing later on since it uses
enumerated arrays. Just need
some suggestions and hints.   :)

-Original Message-
From: SP [mailto:[EMAIL PROTECTED]]
Sent: Saturday, May 18, 2002 1:31 PM
To: [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: RE: [PHP] passing ARRAYs through GET
strings


Hi Navid

Don't you have to serialize it to put it in
sessions?

-Original Message-
From: Navid Y. [mailto:[EMAIL PROTECTED]]
Sent: May 18, 2002 2:26 PM
To: [EMAIL PROTECTED]
Subject: [PHP] passing ARRAYs through GET strings


Hello   :)

Can anyone suggest of another way, an easier way,
to send arrays through
get strings, or through any other process, without
having to serializing
it? For example, would it be better to use
sessions in this case? Any
help would be greatful, thanks.  :)

Navid


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


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

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


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


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

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



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


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

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


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




RE: [PHP] passing ARRAYs through GET strings

2002-05-18 Thread SP

Rick, what exactly do you mean by using
serialization without sessions?  how do you do
that?

-Original Message-
From: Richard Baskett
[mailto:[EMAIL PROTECTED]]
Sent: May 18, 2002 4:31 PM
To: [EMAIL PROTECTED]; PHP General
Subject: Re: [PHP] passing ARRAYs through GET
strings


Hey no problem.. That's what this list is for..
Asking questions and
answering them :)

I just use sessions to pass a lot of variables to
a lot of pages.. Or some
variables to a lot of pages.. Usually for site
authorization that's about
it.  When I just want to pass arrays to another
page, I use serialization,
it's the fastest easiest way in my opinion and you
don¹t have to mess with
sessions since in my opinion it would be overkill
:)

Rick

Nobody will ever win the Battle of the Sexes.
There's just too much
fraternizing with the enemy. - Henry Kissinger

 From: Navid Y. [EMAIL PROTECTED]
 Reply-To: [EMAIL PROTECTED]
 Date: Sat, 18 May 2002 14:43:27 -0500
 To: 'PHP General' [EMAIL PROTECTED]
 Subject: RE: [PHP] passing ARRAYs through GET
strings

 Well Rick,

 Let's say I had a form with a text box and an
textarea box. The text box
 won't contain that many strings, but the
textarea box can contain
 thousands of characters, if the user wished to
write that much. Both of
 the fields will be contained in a single array.
If I send this array
 through a GET string, it will only pass 255
characters through to the
 next page, and the rest of the content will be
cut out of the picture as
 if it never existed. Then, I thought maybe
sessions would do the trick,
 and it does a great job so far. So now I'm stuck
with the idea that
 using sessions to pass arrays, in the particular
situation, would be the
 best thing to do. But, out of curiousity, I
wanted to know how other
 people sent their arrays back and forth from one
page to another. That's
 all  :)   Thanks for your patience, I really
appreciate it.

 -Original Message-
 From: Richard Baskett
[mailto:[EMAIL PROTECTED]]
 Sent: Saturday, May 18, 2002 2:12 PM
 To: [EMAIL PROTECTED]; PHP General
 Subject: Re: [PHP] passing ARRAYs through GET
strings


 Well what I normally do to pass very large
arrays through strings.. when
 NOT using sessions, I use serialize, but it
sounds like you didn¹t want
 to serialize..  If you give me an idea of what
you are doing I might be
 able to figure out the best way to pass those
variables :)

 And no you don't need to serialize the data when
using sessions.
 Sessions themselves are serialized
automatically, you don¹t need to
 worry about that.

 Rick

 We do not have to visit a mad house to find
disordered minds; our
 planet is the mental institution of the
universe. - Unknown

 From: Navid Y. [EMAIL PROTECTED]
 Reply-To: [EMAIL PROTECTED]
 Date: Sat, 18 May 2002 13:51:38 -0500
 To: [EMAIL PROTECTED]
 Subject: RE: [PHP] passing ARRAYs through GET
strings

 Thanks SP and Richard,

 Well, I tested it and it works fine with
sessions, without serializing

 it. The only problem with sending it through
GET url strings is that
 you can only send about 255 characters of data
through to the next
 page. I was just looking to see how others pass
their array values
 through their URLs. So far sessions is a
winner, but maybe there's
 another way. Like what Richard suggested. But
that method seems too
 time consuming and will be confusing later on
since it uses enumerated
 arrays. Just need
 some suggestions and hints.   :)

 -Original Message-
 From: SP [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, May 18, 2002 1:31 PM
 To: [EMAIL PROTECTED];
[EMAIL PROTECTED]
 Subject: RE: [PHP] passing ARRAYs through GET
strings


 Hi Navid

 Don't you have to serialize it to put it in
 sessions?

 -Original Message-
 From: Navid Y. [mailto:[EMAIL PROTECTED]]
 Sent: May 18, 2002 2:26 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] passing ARRAYs through GET
strings


 Hello   :)

 Can anyone suggest of another way, an easier
way,
 to send arrays through
 get strings, or through any other process,
without
 having to serializing
 it? For example, would it be better to use
 sessions in this case? Any
 help would be greatful, thanks.  :)

 Navid


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


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

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


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




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



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


---
Incoming mail is certified Virus Free.
Checked by 

Re: [PHP] passing ARRAYs through GET strings

2002-05-18 Thread Richard Baskett

Well you can serialize an array using the serialize function then pass it
through the url then unserialize it on the next page using the unserialize
function.  If you check out http://www.php.net/serialize it will give you
some examples.  It is quite similar to sessions in that sessions also
serialize the data, but there are subtle differences.  You will need to use
a couple other functions with serialize when passing through the URL, but
that is documented on the page I just gave you :)

If you have any other questions concerning it please do not hesitate to ask
me :)

Rick

Until you have learned to be tolerant with those who do not always agree
with you; until you have cultivated the habit of saying some kind word of
those whom you do not admire; until you have formed the habit of looking for
the good instead of the bad there is in others, you will be neither
successful nor happy. - Napolean Hill


 From: SP [EMAIL PROTECTED]
 Date: Sat, 18 May 2002 16:35:00 -0400
 To: Richard Baskett [EMAIL PROTECTED], [EMAIL PROTECTED], PHP
 General [EMAIL PROTECTED]
 Subject: RE: [PHP] passing ARRAYs through GET strings
 
 Rick, what exactly do you mean by using
 serialization without sessions?  how do you do
 that?
 
 -Original Message-
 From: Richard Baskett
 [mailto:[EMAIL PROTECTED]]
 Sent: May 18, 2002 4:31 PM
 To: [EMAIL PROTECTED]; PHP General
 Subject: Re: [PHP] passing ARRAYs through GET
 strings
 
 
 Hey no problem.. That's what this list is for..
 Asking questions and
 answering them :)
 
 I just use sessions to pass a lot of variables to
 a lot of pages.. Or some
 variables to a lot of pages.. Usually for site
 authorization that's about
 it.  When I just want to pass arrays to another
 page, I use serialization,
 it's the fastest easiest way in my opinion and you
 don¹t have to mess with
 sessions since in my opinion it would be overkill
 :)
 
 Rick
 
 Nobody will ever win the Battle of the Sexes.
 There's just too much
 fraternizing with the enemy. - Henry Kissinger
 
 From: Navid Y. [EMAIL PROTECTED]
 Reply-To: [EMAIL PROTECTED]
 Date: Sat, 18 May 2002 14:43:27 -0500
 To: 'PHP General' [EMAIL PROTECTED]
 Subject: RE: [PHP] passing ARRAYs through GET
 strings
 
 Well Rick,
 
 Let's say I had a form with a text box and an
 textarea box. The text box
 won't contain that many strings, but the
 textarea box can contain
 thousands of characters, if the user wished to
 write that much. Both of
 the fields will be contained in a single array.
 If I send this array
 through a GET string, it will only pass 255
 characters through to the
 next page, and the rest of the content will be
 cut out of the picture as
 if it never existed. Then, I thought maybe
 sessions would do the trick,
 and it does a great job so far. So now I'm stuck
 with the idea that
 using sessions to pass arrays, in the particular
 situation, would be the
 best thing to do. But, out of curiousity, I
 wanted to know how other
 people sent their arrays back and forth from one
 page to another. That's
 all  :)   Thanks for your patience, I really
 appreciate it.
 
 -Original Message-
 From: Richard Baskett
 [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, May 18, 2002 2:12 PM
 To: [EMAIL PROTECTED]; PHP General
 Subject: Re: [PHP] passing ARRAYs through GET
 strings
 
 
 Well what I normally do to pass very large
 arrays through strings.. when
 NOT using sessions, I use serialize, but it
 sounds like you didn¹t want
 to serialize..  If you give me an idea of what
 you are doing I might be
 able to figure out the best way to pass those
 variables :)
 
 And no you don't need to serialize the data when
 using sessions.
 Sessions themselves are serialized
 automatically, you don¹t need to
 worry about that.
 
 Rick
 
 We do not have to visit a mad house to find
 disordered minds; our
 planet is the mental institution of the
 universe. - Unknown
 
 From: Navid Y. [EMAIL PROTECTED]
 Reply-To: [EMAIL PROTECTED]
 Date: Sat, 18 May 2002 13:51:38 -0500
 To: [EMAIL PROTECTED]
 Subject: RE: [PHP] passing ARRAYs through GET
 strings
 
 Thanks SP and Richard,
 
 Well, I tested it and it works fine with
 sessions, without serializing
 
 it. The only problem with sending it through
 GET url strings is that
 you can only send about 255 characters of data
 through to the next
 page. I was just looking to see how others pass
 their array values
 through their URLs. So far sessions is a
 winner, but maybe there's
 another way. Like what Richard suggested. But
 that method seems too
 time consuming and will be confusing later on
 since it uses enumerated
 arrays. Just need
 some suggestions and hints.   :)
 
 -Original Message-
 From: SP [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, May 18, 2002 1:31 PM
 To: [EMAIL PROTECTED];
 [EMAIL PROTECTED]
 Subject: RE: [PHP] passing ARRAYs through GET
 strings
 
 
 Hi Navid
 
 Don't you have to serialize it to put it in
 sessions?
 
 -Original Message-
 From: Navid Y. [mailto:[EMAIL PROTECTED]]
 

[PHP] Register_Shutdown_Function ??

2002-05-18 Thread Jason Caldwell

I'm playing with the register_shutdown_function -- it's seems to work fine
if I call exit() within my script -- however, it doesn't seem to work when
the script times-out.  Anyone know why?  It's supposed to work in the event
of an error, time-out, user-abort, or script-exit.

Thanks
Jason




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




[PHP] random order by id

2002-05-18 Thread Jule


Hey guys,
i have a db and a table with id and questions
now i want these questions to be listed in a random order, is there a way
to format my SQL query or do i need some PHP work to?
i can ofcourse select a random one, that's no problem, but how do i make
sure that that one does not get chosen again. and that after it has printed
all the records it stops
any ideas?

Jule

-- 
|\/\__/\/|
|   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




RE: [PHP] passing ARRAYs through GET strings

2002-05-18 Thread SP

Thanks Rick, that's what I thinking.  Thought I
was missing something.


-Original Message-
From: Richard Baskett [mailto:[EMAIL PROTECTED]]
Sent: May 18, 2002 4:49 PM
To: SP; PHP General
Subject: Re: [PHP] passing ARRAYs through GET
strings


Well you can serialize an array using the
serialize function then pass it
through the url then unserialize it on the next
page using the unserialize
function.  If you check out
http://www.php.net/serialize it will give you
some examples.  It is quite similar to sessions in
that sessions also
serialize the data, but there are subtle
differences.  You will need to use
a couple other functions with serialize when
passing through the URL, but
that is documented on the page I just gave you :)

If you have any other questions concerning it
please do not hesitate to ask
me :)

Rick

Until you have learned to be tolerant with those
who do not always agree
with you; until you have cultivated the habit of
saying some kind word of
those whom you do not admire; until you have
formed the habit of looking for
the good instead of the bad there is in others,
you will be neither
successful nor happy. - Napolean Hill


 From: SP [EMAIL PROTECTED]
 Date: Sat, 18 May 2002 16:35:00 -0400
 To: Richard Baskett [EMAIL PROTECTED],
[EMAIL PROTECTED], PHP
 General [EMAIL PROTECTED]
 Subject: RE: [PHP] passing ARRAYs through GET
strings

 Rick, what exactly do you mean by using
 serialization without sessions?  how do you do
 that?

 -Original Message-
 From: Richard Baskett
 [mailto:[EMAIL PROTECTED]]
 Sent: May 18, 2002 4:31 PM
 To: [EMAIL PROTECTED]; PHP General
 Subject: Re: [PHP] passing ARRAYs through GET
 strings


 Hey no problem.. That's what this list is for..
 Asking questions and
 answering them :)

 I just use sessions to pass a lot of variables
to
 a lot of pages.. Or some
 variables to a lot of pages.. Usually for site
 authorization that's about
 it.  When I just want to pass arrays to another
 page, I use serialization,
 it's the fastest easiest way in my opinion and
you
 don¹t have to mess with
 sessions since in my opinion it would be
overkill
 :)

 Rick

 Nobody will ever win the Battle of the Sexes.
 There's just too much
 fraternizing with the enemy. - Henry Kissinger

 From: Navid Y. [EMAIL PROTECTED]
 Reply-To: [EMAIL PROTECTED]
 Date: Sat, 18 May 2002 14:43:27 -0500
 To: 'PHP General' [EMAIL PROTECTED]
 Subject: RE: [PHP] passing ARRAYs through GET
 strings

 Well Rick,

 Let's say I had a form with a text box and an
 textarea box. The text box
 won't contain that many strings, but the
 textarea box can contain
 thousands of characters, if the user wished to
 write that much. Both of
 the fields will be contained in a single array.
 If I send this array
 through a GET string, it will only pass 255
 characters through to the
 next page, and the rest of the content will be
 cut out of the picture as
 if it never existed. Then, I thought maybe
 sessions would do the trick,
 and it does a great job so far. So now I'm
stuck
 with the idea that
 using sessions to pass arrays, in the
particular
 situation, would be the
 best thing to do. But, out of curiousity, I
 wanted to know how other
 people sent their arrays back and forth from
one
 page to another. That's
 all  :)   Thanks for your patience, I really
 appreciate it.

 -Original Message-
 From: Richard Baskett
 [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, May 18, 2002 2:12 PM
 To: [EMAIL PROTECTED]; PHP General
 Subject: Re: [PHP] passing ARRAYs through GET
 strings


 Well what I normally do to pass very large
 arrays through strings.. when
 NOT using sessions, I use serialize, but it
 sounds like you didn¹t want
 to serialize..  If you give me an idea of what
 you are doing I might be
 able to figure out the best way to pass those
 variables :)

 And no you don't need to serialize the data
when
 using sessions.
 Sessions themselves are serialized
 automatically, you don¹t need to
 worry about that.

 Rick

 We do not have to visit a mad house to find
 disordered minds; our
 planet is the mental institution of the
 universe. - Unknown

 From: Navid Y. [EMAIL PROTECTED]
 Reply-To: [EMAIL PROTECTED]
 Date: Sat, 18 May 2002 13:51:38 -0500
 To: [EMAIL PROTECTED]
 Subject: RE: [PHP] passing ARRAYs through GET
 strings

 Thanks SP and Richard,

 Well, I tested it and it works fine with
 sessions, without serializing

 it. The only problem with sending it through
 GET url strings is that
 you can only send about 255 characters of data
 through to the next
 page. I was just looking to see how others
pass
 their array values
 through their URLs. So far sessions is a
 winner, but maybe there's
 another way. Like what Richard suggested. But
 that method seems too
 time consuming and will be confusing later on
 since it uses enumerated
 arrays. Just need
 some suggestions and hints.   :)

 -Original Message-
 From: SP [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, May 18, 2002 1:31 PM
 To: [EMAIL 

Re: [PHP] random order by id

2002-05-18 Thread Richard Baskett

If you are using MySQL try looking at this page for the function rand():

http://www.mysql.com/doc/M/a/Mathematical_functions.html

Here's a little overview of what it says:

In MySQL Version 3.23, you can, however, do: SELECT * FROM table_name ORDER
BY RAND() This is useful to get a random sample of a set SELECT * FROM
table1,table2 WHERE a=b AND cd ORDER BY RAND() LIMIT 1000. Note that a
RAND() in a WHERE clause will be re-evaluated every time the WHERE is
executed. RAND() is not meant to be a perfect random generator, but instead
a fast way to generate ad hoc random numbers that will be portable between
platforms for the same MySQL version. 

Cheers!

Rick

Nobody will ever win the Battle of the Sexes. There's just too much
fraternizing with the enemy. - Henry Kissinger

 From: Jule [EMAIL PROTECTED]
 Date: Sat, 18 May 2002 17:41:59 -0400
 To: [EMAIL PROTECTED]
 Subject: [PHP] random order by id
 
 
 Hey guys,
 i have a db and a table with id and questions
 now i want these questions to be listed in a random order, is there a way
 to format my SQL query or do i need some PHP work to?
 i can ofcourse select a random one, that's no problem, but how do i make
 sure that that one does not get chosen again. and that after it has printed
 all the records it stops
 any ideas?
 
 Jule
 
 -- 
 |\/\__/\/|
 |   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] How can I access the value in a variable whos name is ina string

2002-05-18 Thread Miguel Cruz

On Sat, 18 May 2002, Henry wrote:
 $variablename=variable;
 eval(\$.$variablename.=13;);
 echo $variable;
 
 This works fine!! It echoes 13;
 
 But this doesn't -
 
 echo eval(\$variablename\);
 
 Why??

Because a variable just standing there on its own doesn't have a return 
value. You can echo eval(return \$variablename\);

or you can just echo $$variablename;

miguel


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




Re: [PHP] need help on a ereg stmt. validating website adress

2002-05-18 Thread Miguel Cruz

On Sat, 18 May 2002, andy wrote:
 I would like to validate a website adress. Unfortunatelly my eregi stmt does
 not work:
 
  if (eregi(^([0-9a-z][0-9a-z-\.]+)\.([a-z]{2,3})), $website)){ // not a
 link
 
 I am getting the error msg:
 Warning: REG_ERANGE in extend.inc on line 94
 
 does anybody know whats wroong with that?

For one thing, your regex doesn't match any definition of website 
address that I've ever seen.

Look up the spec for URLs at http://www.w3.org/Addressing/ .

In the very least, you should not arbitrarily exclude valid domains just 
because the last part is not 2 or 3 characters - what about .info, 
.museum, etc.? And what's the  for? 

As for your error, I'd guess it's because you wrote [0-9a-z-\.] rather 
than [0-9a-z\-\.] (escaping the -).

miguel


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




Re: [PHP] Re: Confused about which function to use with forms/database

2002-05-18 Thread Miguel Cruz

On Sat, 18 May 2002, Dennis Gearon wrote:
 I appreciate all the good info on this subject, everybody. 
 
 In looking the archives, I am still confused on one issue. Do **ALL**
 databases treat \' or \ as escaped? Isn't the SQL standard character to
 escape with a ' ?

I know that Oracle (at least as of v8) doesn't treat \' as escaped; you
need to use the option magic_quotes_sybase. And I know that MySQL is 
perfectly happy with either \' or ''.

miguel


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




Re: [PHP] Re: reindexing an array after unset()

2002-05-18 Thread Daniel Grace


Erik Price [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]...

 On Wednesday, May 8, 2002, at 03:28  PM, Kyle Gibson wrote:

  What do you think?
 
  Try
 
  array_pop($array);
 

 array_pop() is perfect, except that I don't want to take the last
 element off the end.  Otherwise I would definitely use it.

 Erik


$array = array_values($array) will re-index your array without the need for
array_pop and array_push.

-- Daniel Grace



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




[PHP] random quote script with flat file? (PHP Vault: Random Quote Script)

2002-05-18 Thread Timothy J. Luoma


I've been searching for some a little bit of PHP that will pull out one
line from a flat text file and display it, changing it on reload.

So far most of them use MySQL and the links that I did find all turn up
404... but one was called PHP Vault: Random Quote Script and it seemed
like it would do exactly what I was after.

(these next two links work, but the 'download' part comes up 404)

http://www.hotscripts.com/Detailed/4613.html

http://www.hotscripts.com/PHP/Scripts_and_Programs/Quote_Display/

Thanks for your help

TjL


-- 
Site: www.tntluoma.com   mailto:[EMAIL PROTECTED]



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




RE: [PHP] random order by id

2002-05-18 Thread David Freeman


  i have a db and a table with id and questions
  now i want these questions to be listed in a random order, 
  is there a way to format my SQL query or do i need some PHP 
  work to?

It's best achieved in sql:

SELECT ID, Question FROM Questions WHERE Some = Condition ORDER BY
RAND() LIMIT 10

Will get you up to ten randomised questions based on your 'where'
condition.

CYA, Dave



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




[PHP] PHPBB2

2002-05-18 Thread r

Hi Guys and Girls,
I have reciently set up PHPbb2 on our site, its great and no problems with
the software but
I am using frames so that a person can at any time jump out of the forum and
came right back to the site but
because of the frames the forum is pushed a lot to the right...(you have to
scroll sideways to read everything) I know i hate when that happens if I
visit a website and i'm pretty sure a lot of other people do too.
Does anybody have any ideas on how i can make PHPBB's width a bit shorter?
Its set up here:
http://jumac.com/forums/
feel free to poke around and if you want post or write something etcnote
though that I have not enabled a link to this location as yet because of
the width thingso this section is not opened/dead/unknown

I dont really know if this is a PHP question but I presume to make any
changes I will have to dig into the PHP part right?

ANY advise or help appreciated,
Thanks in advance,
-Ryan.

/*Work...The sooner you fall behind, the more time you'll have to catch
up.*/


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




[PHP] Re: How do I get rid of session id (test purposes)

2002-05-18 Thread Jason Morehouse

http://www.php.net/manual/en/function.session-destroy.php

On Sun, 19 May 2002 01:15:15 +1200, Henry wrote:

 Hello All
 
 Love Sessions! BUT
 
 how do I clear it so that when I execute session_start() again I get a
 new one? Help.
 
 I'm sure I should have RTFM more but I'm a newbie.
 
 Henry
 

-- 
 Jason Morehouse ([EMAIL PROTECTED])
 Netconcepts LTD, Auckland, New Zealand
 * Linux: because rebooting is for adding hardware.

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




[PHP] Re: Comon guys, please help.

2002-05-18 Thread Jason Morehouse

I've used both Cybercash and PayFlow.  Both work fine,  however you'll still
need a merchant account.

Cheers,
-J

On Sat, 18 May 2002 14:42:04 +1200, R wrote:

  Hi Guys,
  Special greetings to all of you who have helped me in the past.
 
  As some of you know i just bought a PHP book called Php Blackbook
  which i heard is really good.
  Anyway, In chapter 4 it talks about credit cardsand then CyberCash
 which
  is owned by verisign and payflow which too is owned by verisign. The
  book also gave me some url and RFCs to look up. I dont know if its coz
  i'm a newbie to PHP or just dumb but I just cant understand this...its
  too damn high funda for me, I know google is my pal so I went there,
  read up on differient RFCs and got even more confused!
 
  I just want to know have any of you worked on these systems? eg
  CyberCash and PayFlow?
  Does this mean that if i want to start accepting credit cards on my
  site i wont have to pay for a credit card merchant account?
 
  PLEASE HELP if you know the answer or can offer any
  suggestions,comments ANYTHING.
 
  Have a great day,
  -Ryan.
 
  /*If you see me getting beated up by the cops, put down the camera and
  come
 and help me! */
 

-- 
 Jason Morehouse ([EMAIL PROTECTED])
 Netconcepts LTD, Auckland, New Zealand
 * Linux: because rebooting is for adding hardware.

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




[PHP] date functions

2002-05-18 Thread Josh Edwards

Does anyone know  a good way to count the days between two dates. ie how
many Mondays fall between two dates. As a starting  point I have calculated
the start and end dates and the no of days b/w them.





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




[PHP] Re: parsing CSV, updating MySQL table

2002-05-18 Thread Jason Morehouse

You could use mysql import / outfile:

http://www.mysql.com/doc/S/E/SELECT.html

See the section  * The SELECT ... INTO OUTFILE.

Hope that helps.
-J

On Sat, 18 May 2002 20:41:39 +1200, Justin French wrote:

 Hi,
 
 I have a client with an Excel file of products / prices / etc.  For
 arguments sake, let's keep it simple:
 
 id,title,description
 
 if they were to export this as a CSV, then it could be used to update a
 mysql table (for existing ID's), and to insert any new ID's.
 
 
 So, I guess what I'm after is a group of functions which parse a CSV
 file, and update a MySQL table to match... rather than messing around in
 a web based GUI, the client could just upload a new CSV every couple of
 days.
 
 
 I've checked out fgetcsv() etc, and I *think* i've got a picture of how
 the code would look, but before I start, I figure a set of functions
 probably already exists out there to do this... so why reinvent the
 wheel
 
 If anyone can point me to a URL, class, function, article, etc, I'd be
 pretty happy :)
 
 
 Justin French
 

-- 
 Jason Morehouse ([EMAIL PROTECTED])
 Netconcepts LTD, Auckland, New Zealand
 * Linux: because rebooting is for adding hardware.

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




[PHP] Re: Register_Shutdown_Function ??

2002-05-18 Thread Jason Caldwell

Here's my code:

?
 set_time_limit(1);
 function clean_up()
 {
  if(connection_status()  TIMEOUT)
   print(Script timed out.\n);
 }
register_shutdown_function(clean_up);
while(1);
?

Here's the message I get:  (I should get Script timed out.)
---
br
bFatal error/b:  Maximum execution time of 1 second exceeded in
bC:\test999.php/b on line b14/bbr

br
bFatal error/b:  Maximum execution time of 1 second exceeded in
bC:\test999.php/b on line b7/bbr
--


Jason Caldwell [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I'm playing with the register_shutdown_function -- it's seems to work fine
 if I call exit() within my script -- however, it doesn't seem to work when
 the script times-out.  Anyone know why?  It's supposed to work in the
event
 of an error, time-out, user-abort, or script-exit.

 Thanks
 Jason






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




Re: [PHP] date functions

2002-05-18 Thread Richard Baskett

Well you could do two str2time() calls like this:

# Two Dates to Compare #
$date1 = strtotime(Oct 18, 2002);
$date2 = strtotime(Jan 18, 2002);

# Assign the earliest date and laterdate to variables #
$earlyDate = ($date1  $date2) ? $date1 : $date2;
$laterDate = ($earlyDate == $date1) ? $date2 : $date1;

# Computes to find how many days are between the two dates #
$daysBetween = ceil(($laterDate - $earlyDate)/(60*60*24));
echo $daysBetween;

There's probably an easier way of doing this, but hey it works! ;)

Rick

You will never be happy if you continue to search for what happiness
consists of. You will never live if you are looking for the meaning of life.
- Albert Camus

 From: Josh Edwards [EMAIL PROTECTED]
 Date: Sun, 19 May 2002 10:22:28 +1000
 To: [EMAIL PROTECTED]
 Subject: [PHP] date functions
 
 Does anyone know  a good way to count the days between two dates. ie how
 many Mondays fall between two dates. As a starting  point I have calculated
 the start and end dates and the no of days b/w them.
 
 
 
 
 
 -- 
 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] random quote script with flat file? (PHP Vault: Random Quote Script)

2002-05-18 Thread Evan Nemerson

list($usec,$sec)=explode( ,microtime());
mt_srand($sec * $usec);
$quotes = file(quotes);
echo $quotes[mt_rand(0, (sizeof($quotes)-1))];

Should do the trick nicely.


-Evan


-- 
All religions are founded on the fear of the many and the cleverness of the 
few.

Stendhal


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




Re: [PHP] PHPBB2

2002-05-18 Thread Ashley M. Kirchner

r wrote:

 Does anybody have any ideas on how i can make PHPBB's width a bit shorter?

Use PHPBB2's forums for these kind of questions.

--
H | Life is the art of drawing without an eraser. - John Gardner
  +
  Ashley M. Kirchner mailto:[EMAIL PROTECTED]   .   303.442.6410 x130
  Director of Internet Operations / SysAdmin. 800.441.3873 x130
  Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave, #6
  http://www.pcraft.com . .  ..   Boulder, CO 80303, U.S.A.



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




Re: [PHP] random quote script with flat file? (PHP Vault: Random Quote Script)

2002-05-18 Thread Timothy J. Luoma

 list($usec,$sec)=explode( ,microtime());
 mt_srand($sec * $usec);
 $quotes = 
file(quotes);
 echo $quotes[mt_rand(0, (sizeof($quotes)-1))];

Yes!!!  That 
works exactly!  I love PHP! I love this list and look forward to the day when I 
can 
contribute something more than fascinating questions ;-)

Thank you!

TjL




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




[PHP] file upload problem

2002-05-18 Thread Rodney Davis

I am trying to use the move_uploaded_file() function to upload files to
a specific directory. It works fine with small .jpgs .txt etc etc but
won't work with a large .mp3 file.  Is this because it is too large?
What can I do?

Thanks


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




[PHP] Classifieds Program

2002-05-18 Thread Andrés de la Varga

I want to add a Classifieds script to my Website. Any recomendation?

Andrés



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




[PHP] xml parsing

2002-05-18 Thread Gerard Samuel

I got this example from Beginning PHP 4.  Unfortunately, I cant get to 
wrox's site to see if there were any errata updates for this piece of 
code, but for the life of me, I dont know whats wrong with it.  All its 
displaying is '-'.  If anyone could direct me to where its broken, Ill 
be very grateful..

?php

if (!($fp = fopen(http://freshmeat.net/backend/fm.rdf;, r))) 
die(Cant fetch);

$item_counter = 0;
$in_item_tag = 0;
$fm_current_tag_state = '';
$fm_headline_data = array();

function startElementHandler($parser, $element_name, $element_attribs) {
global $item_counter, $in_item_tag, $fm_current_tag_state, 
$fm_headline_data;
if ($element_name == ITEM) {
$in_item_tag = 1;
}

if ($in_item_tag == 1) {
$fm_curent_tag_state = $element_name;
} else {
$fm_current_tag_state = '';
}
}

function endElementHandler($parser, $element_name) {
global $item_counter, $in_item_tag, $fm_current_tag_state, 
$fm_headline_data;
$fm_current_tag_state = '';
if ($element_name == ITEM) {
$item_counter++;
$in_item_tag = 0;
}
}

function characterDataHandler($parser, $data) {
global $itme_counter, $in_item_tag, $fm_current_tag_state, 
$fm_headline_data;

if ($fm_current_tag_state == '' || $in_item_tag == 0) return;

if ($fm_current_tag_state == TITLE) 
$fm_headline_data[$item_counter]['title'] = $data;

if ($fm_current_tag_state == LINK) 
$fm_headline_data[$item_counter]['link'] = $data;

if ($fm_current_tag_state == DESCRIPTION) 
$fm_headline_data[$item_counter]['description'] = $data;
}

if (!($xml_parser = xml_parser_create())) die(Parser Problem);

xml_set_element_handler($xml_parser, startElementHandler, 
endElementHandler);
xml_set_character_data_handler($xml_parser, characterDataHandler);

while ($data = fread($fp, 4096)) {
if (!xml_parse($xml_parser, $data, feof($fp))) {
break;
}
}

xml_parser_free($xml_parser);

for($i=0; $i  $item_counter; $i++) {
printf(a href=\%s\%s/a - %sbr\n, 
$fm_headlines_data[$i]['link'],
   
$fm_headlines_data[$i]['title'],
   
$fm_headlines_data[$i]['description']
   );
}

?


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




[PHP] Re: Register_Shutdown_Function ??

2002-05-18 Thread CC Zona

In article [EMAIL PROTECTED],
 [EMAIL PROTECTED] (Jason Caldwell) wrote:

 Here's my code:
 
 ?
  set_time_limit(1);
  function clean_up()
  {
   if(connection_status()  TIMEOUT)
print(Script timed out.\n);
  }
 register_shutdown_function(clean_up);
 while(1);
 ?
 
 Here's the message I get:  (I should get Script timed out.)

No, you shouldn't/wouldn't, because--as is noted in the docs 
http://php.net/register-shutdown-function--no more output (print is 
specifically mentioned as an example) can be sent to the browser at that 
stage.  Try sending youself an email, or logging to a file instead.

-- 
CC

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




[PHP] Read a var from stdin

2002-05-18 Thread Rafael Perazzo

Is there any way to ask the user to type the value of
a variable from stdin ? (like read in Pascal, or scanf
in C). I'm using PHP from command line. 

Thanks 

Rafael Perazzo

__
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com

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




RE: [PHP] Classifieds Program

2002-05-18 Thread David Freeman


  I want to add a Classifieds script to my Website. Any recomendation?

1.  http://www.google.com/

2.  classifieds web php mysql in the search box.

3.  Click the search button.

4.  The 3rd link on the resulting list looks good.

5.  http://www.hotscripts.com/PHP/Scripts_and_Programs/Classified_Ads/
(which would be the 3rd link mentioned in step 4).

6.  Pick whichever one of the 36 choices mentioned starting on the above
page.

Simple really, and I've never even thought about looking for a
classifieds script before.

CYA, Dave



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




[PHP] Problem with

2002-05-18 Thread webmaster



I have the following code for a mySQL query in 
php:


$text = "sort_text";
$query = "SELECT code FROM links ORDER BY $text WHERE ".$text." like 
'".$l."%'";
$result = mysql_query($query) or die("Query failed");
When I do the query I get Query 
failed.
When I remove the sort parameter they 
are all printed correctly(except the fact the aren't in alphabetical 
order)
I am a newbie so be nice.
Any Ideas?
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] Problem with

2002-05-18 Thread Richard Baskett

Well the ORDER BY is supposed to be after the WHERE statement.. Try that :)

Rick

It is my ambition to say in ten sentences; what others say in a whole
book. - Friedrich Nietzsche

 From: [EMAIL PROTECTED]
 Date: Sun, 19 May 2002 13:05:19 +1000
 To: [EMAIL PROTECTED]
 Subject: [PHP] Problem with
 
 I have the following code for a mySQL query in php:
 
 $text = sort_text;
 
 $query = SELECT code FROM links ORDER BY $text WHERE .$text. like
 '.$l.%';
 
 $result = mysql_query($query) or die(Query failed);
 
 When I do the query I get Query failed.
 
 When I remove the sort parameter they are all printed correctly(except the
 fact the aren't in alphabetical order)
 
 I am a newbie so be nice.
 
 Any Ideas?
 
 JJ Harrison
 [EMAIL PROTECTED]
 www.tececo.com
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


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




Re: [PHP] date functions

2002-05-18 Thread Tom Rogers

Hi
I think this works :)

?
$date1 = 1/1/2002;
$date2 = date(m/d/Y);
$time1 = strtotime($date1);
$time2 = strtotime($date2);
//get the first monday after date1
$first_monday = strtotime(first monday,$time1);
//check if its within date2
if($first_monday  $time2):
 //set count to 0 as we will go through the loop at least once
 $mondays = 0;
 $next_monday = $first_monday;
 //keep adding 7 days till we pass date2
 while($next_monday  $time2):
 $next_monday = strtotime(+7 days,$next_monday);
 $mondays ++;
 endwhile;
 echo There are $mondays Mondays between $date1 and $date2 and the 
following monday is on .date(m/d/Y,$next_monday).br;
else:
 echo there are no Mondays between $date1 and $date2 br;
endif;
?
Tom



At 10:22 AM 19/05/2002, Josh Edwards wrote:
Does anyone know  a good way to count the days between two dates. ie how
many Mondays fall between two dates. As a starting  point I have calculated
the start and end dates and the no of days b/w them.





--
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: Register_Shutdown_Function ??

2002-05-18 Thread Jason Caldwell

It doesn't matter.  I'm setting the output *not* to the browser, but to the
command shell, where I am running the script from.  If you look at the
errors, you'll see 2 of them, one points to line 7, where the IF() command
is -- the script terminates there...

I've put error_log() and exec() functions in place of the print()
function -- it doesn't make a difference -- the script just won't execute
the function in the register_shutdown_function() --

The following script works great (see below) -- it seems that for some
reason its a TIMEOUT issue (bug).

Running the script below, I will get the output of the print() function --
as stated, from the command line.  I understand that it wouldn't show up in
the browser.

If I replace the exit; command with say a while(1); where the script
will loop indefinitely, the timeout, set by the set_time_limit(1) will stop
the script, but again -- register_shutdown_function() seems to want to
work as the function IS CALLED, but NEVER executed, and instead errors on
the 1st line in the FUNCTION -- always on a TIMEOUT.

Run this script from your command line (ie. C:php test.php) -- then change
the set_time_limit(30) to set_time_limit(1), and replace the exit with
a while(1) -- run the script again, you'll see what I mean.

And, if you still don't believe me, replace the print() in the function with
error_log('Script Terminated', 3, 'errorlog.txt'); and see if the
errorlog.txt file is ever created -- it isn't.

?
set_time_limit(30);
 function clean_up()
 {
  print(Script Terminated);
 }
register_shutdown_function(clean_up);
 exit;
?

If anyone can offer any reason why its doing this, please help -- thanks.

Jason




Cc Zona [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 In article [EMAIL PROTECTED],
  [EMAIL PROTECTED] (Jason Caldwell) wrote:

  Here's my code:
  
  ?
   set_time_limit(1);
   function clean_up()
   {
if(connection_status()  TIMEOUT)
 print(Script timed out.\n);
   }
  register_shutdown_function(clean_up);
  while(1);
  ?
 
  Here's the message I get:  (I should get Script timed out.)

 No, you shouldn't/wouldn't, because--as is noted in the docs
 http://php.net/register-shutdown-function--no more output (print is
 specifically mentioned as an example) can be sent to the browser at that
 stage.  Try sending youself an email, or logging to a file instead.

 --
 CC



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




[PHP] Augmenting an old date

2002-05-18 Thread Andre Dubuc

Two columns in my PostgreSQL db are type 'date' (formatted '-mm-dd'): 
'start_date' and 'expiry_date'. What I cannot seem to figure out is how to 
augment the 'expiry_date' either by 30 days, 60 days, or 1 year.

I've tried the date function in PHP (getdate) but the problem is that it 
appears to need a timestamp of today. The dates that I'm trying to augment 
are sometimes a year or two ago.

This doesn't work:

$new_expiry_date = $expiry_date(Y-m-d, mktime(0,0,0, date(Y), date(m), 
date(d) + 60)));

I assume it's because the '$expiry_date' should be simply 'date', but that 
would give the current date which is not what is wanted. Is there anyway to 
set 'date' as '$expiry_date'?

Suggestions, admonitions, and general advice will be greatly appreciated. 
Btw, I've searched the archives, and haven't found anything quite on this 
topic.

Tia,
Andre

 
-- 
Please pray the Holy Rosary to end the holocaust of abortion.
Remember in your prayers the Holy Souls in Purgatory.

May God bless you abundantly in His love!
For a free Cenacle Scriptural Rosary Booklet: http://www.webhart.net/csrb/

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




[PHP] bug in SLEEP() function...

2002-05-18 Thread Jason Caldwell

Dunno if this has been mentioned or fixed in the latest release (I'm using
PHP version 4.1.1) -- but, a script will not timeout until the sleep()
function has finished it's duration -- for example:

In my script, if I set set_time_limit(30) -- then later in the script I
call a sleep(45) -- the script will not timeout until 45 seconds later,
from the point at which the sleep() function was called.

Now, being a conscious programmer -- I'd probably never set my sleep()
function to exceed my default or defined timeout setting.  However, the
sleep value can be set via a $var -- and depending on what functions are
performed -- I can see how, when a programmer wants his script to timeout
within a certain amount of time and then it doesn't; can cause a problem --
in-fact, I can foree some sort of sleep-attack whereby a malicious hacker
figures out that a particular script on a particular website has a dynamic
$var for the sleep() function -- then s/he writes a script which calls the
page many times --- injecting the $var (say for example:
http://www.whateverweb.goo/home.php?t=65536, where $t is the time $var in
the script; sleep($t);

Effectively; in this case, the scripts won't timeout for 18 some hours.
Filling up memory fast.

Just FYI.
Jason




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




RE: [PHP] Augmenting an old date

2002-05-18 Thread SP

Here's a nice article all about dates
http://www.phpbuilder.com/columns/akent2610.ph
p3

On page 6 of that article it shows a function for
adding years, months, days ... to a date.

function DateAdd ($interval,  $number, $date)
{
$date_time_array  = getdate($date);

$hours =  $date_time_array[hours];
$minutes =  $date_time_array[minutes];
$seconds =  $date_time_array[seconds];
$month =  $date_time_array[mon];
$day =  $date_time_array[mday];
$year =  $date_time_array[year];

switch ($interval)
{
  case :
$year +=$number;
break;
  case q:
$year +=($number*3);
break;
  case m:
$month +=$number;
break;
  case y:
  case d:
  case w:
$day+=$number;
break;
  case ww:
$day+=($number*7);
break;
  case h:
$hours+=$number;
break;
  case n:
$minutes+=$number;
break;
  case s:
$seconds+=$number;
break;
}

$timestamp =  mktime($hours ,$minutes,
$seconds,$month ,$day, $year);
return $timestamp;
}

-Original Message-
From: Andre Dubuc [mailto:[EMAIL PROTECTED]]
Sent: May 19, 2002 12:03 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Augmenting an old date


Two columns in my PostgreSQL db are type 'date'
(formatted '-mm-dd'):
'start_date' and 'expiry_date'. What I cannot seem
to figure out is how to
augment the 'expiry_date' either by 30 days, 60
days, or 1 year.

I've tried the date function in PHP (getdate) but
the problem is that it
appears to need a timestamp of today. The dates
that I'm trying to augment
are sometimes a year or two ago.

This doesn't work:

$new_expiry_date = $expiry_date(Y-m-d,
mktime(0,0,0, date(Y), date(m),
date(d) + 60)));

I assume it's because the '$expiry_date' should be
simply 'date', but that
would give the current date which is not what is
wanted. Is there anyway to
set 'date' as '$expiry_date'?

Suggestions, admonitions, and general advice will
be greatly appreciated.
Btw, I've searched the archives, and haven't found
anything quite on this
topic.

Tia,
Andre


--
Please pray the Holy Rosary to end the holocaust
of abortion.
Remember in your prayers the Holy Souls in
Purgatory.

May God bless you abundantly in His love!
For a free Cenacle Scriptural Rosary Booklet:
http://www.webhart.net/csrb/

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


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

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


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




Re: [PHP] Augmenting an old date

2002-05-18 Thread Tom Rogers

Hi
You need to use the strtodate function which converts to a time stamp a 
date string and you can offset it by a number of days or whatever
something like this
?

$start = 2002-01-01;
$expire = date(Y-m-d,strtotime(+30 days,strtotime($start)));
echo $expire.br;
?

Tom



At 02:03 PM 19/05/2002, Andre Dubuc wrote:
Two columns in my PostgreSQL db are type 'date' (formatted '-mm-dd'):
'start_date' and 'expiry_date'. What I cannot seem to figure out is how to
augment the 'expiry_date' either by 30 days, 60 days, or 1 year.

I've tried the date function in PHP (getdate) but the problem is that it
appears to need a timestamp of today. The dates that I'm trying to augment
are sometimes a year or two ago.

This doesn't work:

$new_expiry_date = $expiry_date(Y-m-d, mktime(0,0,0, date(Y), date(m),
date(d) + 60)));

I assume it's because the '$expiry_date' should be simply 'date', but that
would give the current date which is not what is wanted. Is there anyway to
set 'date' as '$expiry_date'?

Suggestions, admonitions, and general advice will be greatly appreciated.
Btw, I've searched the archives, and haven't found anything quite on this
topic.

Tia,
Andre


--
Please pray the Holy Rosary to end the holocaust of abortion.
Remember in your prayers the Holy Souls in Purgatory.

May God bless you abundantly in His love!
For a free Cenacle Scriptural Rosary Booklet: http://www.webhart.net/csrb/

--
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] Augmenting an old date

2002-05-18 Thread Tom Rogers

Hi
A slightly more efficeint way :)
?

$start = 2002-01-01;
$expire = date(Y-m-d,strtotime($start +30 days));
echo $expire.br;
?

Tom



At 02:03 PM 19/05/2002, Andre Dubuc wrote:
Two columns in my PostgreSQL db are type 'date' (formatted '-mm-dd'):
'start_date' and 'expiry_date'. What I cannot seem to figure out is how to
augment the 'expiry_date' either by 30 days, 60 days, or 1 year.

I've tried the date function in PHP (getdate) but the problem is that it
appears to need a timestamp of today. The dates that I'm trying to augment
are sometimes a year or two ago.

This doesn't work:

$new_expiry_date = $expiry_date(Y-m-d, mktime(0,0,0, date(Y), date(m),
date(d) + 60)));

I assume it's because the '$expiry_date' should be simply 'date', but that
would give the current date which is not what is wanted. Is there anyway to
set 'date' as '$expiry_date'?

Suggestions, admonitions, and general advice will be greatly appreciated.
Btw, I've searched the archives, and haven't found anything quite on this
topic.

Tia,
Andre


--
Please pray the Holy Rosary to end the holocaust of abortion.
Remember in your prayers the Holy Souls in Purgatory.

May God bless you abundantly in His love!
For a free Cenacle Scriptural Rosary Booklet: http://www.webhart.net/csrb/

--
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: Confused about which function to use with forms/database

2002-05-18 Thread Dennis Gearon

I think I will try to standardize on the '' version, then. thank you.

Miguel Cruz wrote:
 
 On Sat, 18 May 2002, Dennis Gearon wrote:
  I appreciate all the good info on this subject, everybody.
 
  In looking the archives, I am still confused on one issue. Do **ALL**
  databases treat \' or \ as escaped? Isn't the SQL standard character to
  escape with a ' ?
 
 I know that Oracle (at least as of v8) doesn't treat \' as escaped; you
 need to use the option magic_quotes_sybase. And I know that MySQL is
 perfectly happy with either \' or ''.
 
 miguel

-- 
-
Joy is just a thing (to be).. raised on,
Love is just the way to Live and Die,
John Denver.
-
He lost a friend, but kept his Memory (also John Denver),
Thank you...John Corones...my friend always.
-
Look lovingly upon the present,
for it holds the only things that are forever true.
-
Sincerely, Dennis Gearon (Kegley)

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




Re: [PHP] date functions

2002-05-18 Thread Miguel Cruz

On Sun, 19 May 2002, Josh Edwards wrote:
 Does anyone know  a good way to count the days between two dates. ie how
 many Mondays fall between two dates. As a starting  point I have calculated
 the start and end dates and the no of days b/w them.

Pretty much common sense, right? How about something like this:

  // $timestamp1 = starting date (unix timestamp)
  // $timestamp2 = ending date (unix timestamp)
  // $weekday = day we're counting (0 = Sunday, 1 = Monday, etc.)
  function weekdaysBetween ($timestamp1, $timestamp2, $weekday)
  {
return floor(intval(($timestamp2 - $timestamp1) / 86400) / 7)
  + ((date('w', $timestamp1) = $weekday) ? 1 : 0);
  }

miguel


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




[PHP] regex (preg_replace)

2002-05-18 Thread Gerard Samuel

Im trying to get a final output to be 'item' but Im unable to get 
working.  Could someone point me where Im going wrong.
Thanks

?php

$a = 'item rdf:about=http://www.trini0.org;';

$b = preg_replace(/(item)(\s.*)()/i, $1 . $3, $a );
echo $b;

?


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




  1   2   >