Re: [PHP] Re: Algorithm....

2004-02-16 Thread Bob Eldred
Clearly, I'm going to have to get on the PHP short bus.  I was never any
good at bitmasking.

In the meantime, I've got it working.  Not elegant, mind you, but working
nonetheless.  Thanks.

Bob

- Original Message - 
From: "Manuel Vázquez Acosta" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, February 16, 2004 9:47 PM
Subject: [PHP] Re: Algorithm


> I suggest a bit's mask technique; since max(i)=96, you can represent a day
> by 96/8 = 12 bytes = 3 (32-bits integers).
>
> TimeFrameA is an integer representing the first 32 15-minutes
chunks(0-31),
> TimeFrameB represents 32-63, and TimeFrameC 64-95.
>
> If a bit is 1 the you that 15-minutes chunk is marked as "busy", 0
> otherwise. It is easy to find which is the first 'busy'bit in each
> TimeFrame:
> // at least one bit is marked as busy
> if (TimeFrame <> 0)
> {
> mask = 0x8000;
> while (mask & TimeFrame == 0)
> mask = mask >> 1;
> }
>
> Hope this helps (I think it saves both memory and time)
>
> Manu.
>
>
> "Bob Eldred" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > I'm working on a calendaring script right now, and am stuck on a
> > programmatic way to figure something out.
> >
> > Basically, the work day is broken down into 15-minute intervals, where
the
> > value of a given interval can be figured as $hour=floor($i/4) and the
> > minutes can be figured as $minutes=($i%4)*15.  So 32 = 8:00, 33=8:15,
etc.
> >
> > Currently, it's relatively easy to pull up a day, and block out those
> times
> > that are already taken up with appointments.  I'm throwing them all into
> an
> > array ($available_times).  So, that array would look like:
> >
> > 32=>yes
> > 33=>yes
> > 34=>yes
> > 35=>yes
> > 36=>no
> > 37=>no
> > 38=>yes
> > 39=>yes
> >
> > etc, for someone who has a meeting from 9:00 to 9:30.
> >
> > Now, what I'm trying to do is check when they schedule a new meeting so
> that
> > they don't overlap their times with something that's already taken up.
> So,
> > in the array given above, if they select 8:30 as the start time, I'd
like
> > them to be able to select 8:45 or 9:00 as the end time, but nothing
later
> > than that, as the time from 9:00 to 9:30 is already taken up.
> >
> > And I'm stuck trying to figure out an approach to this.  Preferably one
> that
> > I can throw into javascript so they can fix their errors before it ever
> hits
> > the server.
> >
> > Any help appreciated.
> >
> > Bob
>
> -- 
> 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: Algorithm....

2004-02-16 Thread Manuel Vázquez Acosta
I suggest a bit's mask technique; since max(i)=96, you can represent a day
by 96/8 = 12 bytes = 3 (32-bits integers).

TimeFrameA is an integer representing the first 32 15-minutes chunks(0-31),
TimeFrameB represents 32-63, and TimeFrameC 64-95.

If a bit is 1 the you that 15-minutes chunk is marked as "busy", 0
otherwise. It is easy to find which is the first 'busy'bit in each
TimeFrame:
// at least one bit is marked as busy
if (TimeFrame <> 0)
{
mask = 0x8000;
while (mask & TimeFrame == 0)
mask = mask >> 1;
}

Hope this helps (I think it saves both memory and time)

Manu.


"Bob Eldred" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I'm working on a calendaring script right now, and am stuck on a
> programmatic way to figure something out.
>
> Basically, the work day is broken down into 15-minute intervals, where the
> value of a given interval can be figured as $hour=floor($i/4) and the
> minutes can be figured as $minutes=($i%4)*15.  So 32 = 8:00, 33=8:15, etc.
>
> Currently, it's relatively easy to pull up a day, and block out those
times
> that are already taken up with appointments.  I'm throwing them all into
an
> array ($available_times).  So, that array would look like:
>
> 32=>yes
> 33=>yes
> 34=>yes
> 35=>yes
> 36=>no
> 37=>no
> 38=>yes
> 39=>yes
>
> etc, for someone who has a meeting from 9:00 to 9:30.
>
> Now, what I'm trying to do is check when they schedule a new meeting so
that
> they don't overlap their times with something that's already taken up.
So,
> in the array given above, if they select 8:30 as the start time, I'd like
> them to be able to select 8:45 or 9:00 as the end time, but nothing later
> than that, as the time from 9:00 to 9:30 is already taken up.
>
> And I'm stuck trying to figure out an approach to this.  Preferably one
that
> I can throw into javascript so they can fix their errors before it ever
hits
> the server.
>
> Any help appreciated.
>
> Bob

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



Re: [PHP] Headers Again

2004-02-16 Thread Jason Wong
On Tuesday 17 February 2004 09:57, PETCOL wrote:

> I have authenticated a user, after that I want to take them to another
> page:
>
> Header("Location: welcome.php");
>
> But I get the following error?
>
> error
> Cannot modify header information - headers already sent
> error
>
> Suggestions?

google?

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
I don't want to achieve immortality through my work.  I want to achieve
immortality through not dying.
-- Woody Allen
*/

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



RE: [PHP] Algorithm....

2004-02-16 Thread Martin Towell
Hiya,

Work out the start array position, keep incrementing by 1 until you find a
"yes"
>From this you'll know the allowable end times.

HTH
Martin

> -Original Message-
> From: Bob Eldred [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, 17 February 2004 4:04 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Algorithm
> 
> 
> I'm working on a calendaring script right now, and am stuck on a
> programmatic way to figure something out.
> 
> Basically, the work day is broken down into 15-minute 
> intervals, where the
> value of a given interval can be figured as $hour=floor($i/4) and the
> minutes can be figured as $minutes=($i%4)*15.  So 32 = 8:00, 
> 33=8:15, etc.
> 
> Currently, it's relatively easy to pull up a day, and block 
> out those times
> that are already taken up with appointments.  I'm throwing 
> them all into an
> array ($available_times).  So, that array would look like:
> 
> 32=>yes
> 33=>yes
> 34=>yes
> 35=>yes
> 36=>no
> 37=>no
> 38=>yes
> 39=>yes
> 
> etc, for someone who has a meeting from 9:00 to 9:30.
> 
> Now, what I'm trying to do is check when they schedule a new 
> meeting so that
> they don't overlap their times with something that's already 
> taken up.  So,
> in the array given above, if they select 8:30 as the start 
> time, I'd like
> them to be able to select 8:45 or 9:00 as the end time, but 
> nothing later
> than that, as the time from 9:00 to 9:30 is already taken up.
> 
> And I'm stuck trying to figure out an approach to this.  
> Preferably one that
> I can throw into javascript so they can fix their errors 
> before it ever hits
> the server.
> 
> Any help appreciated.
> 
> Bob
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> __ Information from NOD32 1.617 (20040206) __
> 
> This message was checked by NOD32 for Exchange e-mail monitor.
> http://www.nod32.com
> 
> 
> 
> 

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



[PHP] Algorithm....

2004-02-16 Thread Bob Eldred
I'm working on a calendaring script right now, and am stuck on a
programmatic way to figure something out.

Basically, the work day is broken down into 15-minute intervals, where the
value of a given interval can be figured as $hour=floor($i/4) and the
minutes can be figured as $minutes=($i%4)*15.  So 32 = 8:00, 33=8:15, etc.

Currently, it's relatively easy to pull up a day, and block out those times
that are already taken up with appointments.  I'm throwing them all into an
array ($available_times).  So, that array would look like:

32=>yes
33=>yes
34=>yes
35=>yes
36=>no
37=>no
38=>yes
39=>yes

etc, for someone who has a meeting from 9:00 to 9:30.

Now, what I'm trying to do is check when they schedule a new meeting so that
they don't overlap their times with something that's already taken up.  So,
in the array given above, if they select 8:30 as the start time, I'd like
them to be able to select 8:45 or 9:00 as the end time, but nothing later
than that, as the time from 9:00 to 9:30 is already taken up.

And I'm stuck trying to figure out an approach to this.  Preferably one that
I can throw into javascript so they can fix their errors before it ever hits
the server.

Any help appreciated.

Bob

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



[PHP] Re: Are variables persistent?

2004-02-16 Thread André Cerqueira
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


Paul Furman wrote:
When I refresh a script using a form, it goes through & resets all my 
custom Constants but presumably all my variables should still hold their 
values from the last run, right? THere are no functions involved.
wrong

What would cause a variable or even a $POST[] value to be erased?
the script exiting
thats what happens when it finishes running
if you want persistency, try session
http://www.php.net/session
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.4 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFAMZADaxdA/5C8vH8RAjaUAJwP/auFvfSc4QPfcSQkRAJJpqPaRgCfVtEz
KFZglAix8zxhnOwu0H1xdnE=
=DoaG
-END PGP SIGNATURE-
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] PowerPoint to html converter, server-side

2004-02-16 Thread Andrew Warner
I'm looking for a PowerPoint to html/slides converter that can work 
server-side and on Linux. Does such a thing exist?  Most of the 
converters I've come across are desktop apps.

Andrew

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


Re: [PHP] Problems with authentication (I think)

2004-02-16 Thread Leif Gregory
Hello Leif,

Monday, February 16, 2004, 7:13:30 PM, you wrote:
LG>PHPTest http://www.resynthesize.com/code/phptest_info.php

Just a followup. I found out that the PHPTest showing just a blank
page was a mistype in my config.inc.php file. It now shows me the
login screen, but when I login it does not do it. If I create a new
user via the PHPTest interface, it does indeed create the new user,
but I can't login with that one either.

I know I'm asking about a specific app here, but the problem spans a
few apps, and the problem is the same with all of them (namely,
authentication won't work).

Thanks again.


Cheers,
Leif Gregory 

--
TB Lists Moderator (and fellow registered end-user)
PCWize Editor  /  ICQ 216395  /  PGP Key ID 0x7CD4926F
Web Site 

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



[PHP] Problems with authentication (I think)

2004-02-16 Thread Leif Gregory
Hello all,

What I have:

Windows webserver running PHP 4.34 and MySQL 4.0.17.


The knowns:

Doing the PHP test works and I get back all sorts of information,
and PHPBB2 works as advertised with no problems, so does PHPMyAdmin.


My Problem:

I've tried a number of PHP scripts to do various things (some just to
play around and learn, and some because I really want them on my web
server.) The three problems I usually encounter with the problematic
PHP scripts are:

1. When I hit the page, it just returns a blank page. This happens
   with:

   PHPTest http://www.resynthesize.com/code/phptest_info.php
   Proxy http://sourceforge.net/projects/sbp/

   
2. When I hit the page, it needs some authentication for login, and
   even though it appears to take the login, nothing really happens
   (i.e. it didn't log me in, so I can't go anywhere. This happens
   with:

   Scubaman Dive Log http://www.ivains.com/scubaman
   Directory Indexer http://autoindex.sourceforge.net (only when I
 enable the authentication for user logon,
 otherwise it works fine) 
   
   
3. Parts of the PHP script work, but others don't. This happens with:

   GoRedirector http://www.studentplatinum.com/scripts/ (It will
   return the values from MySQL that are in there, but I can't delete,
   add, or administer it in any way, nor does the actual PHP
   redirector itself work.)
   

I don't know enough about PHP yet to really know where to start
looking. Any help would be greatly appreciated. I thought it had
something to do with Global Variables being disabled in the php.ini
file, but I re-enabled that to test it, but it didn't help.



Cheers,
Leif Gregory 

-- 
TB Lists Moderator (and fellow registered end-user)
PCWize Editor  /  ICQ 216395  /  PGP Key ID 0x7CD4926F
Web Site 

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



Re: [PHP] Headers Again

2004-02-16 Thread John Nichel
PETCOL wrote:
Hi,

I have authenticated a user, after that I want to take them to another page:

Header("Location: welcome.php");

But I get the following error?

error
Cannot modify header information - headers already sent
error
Suggestions?
Don't send output to the browser before you try to send headers().

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Headers Again

2004-02-16 Thread PETCOL
Hi,

I have authenticated a user, after that I want to take them to another page:

Header("Location: welcome.php");

But I get the following error?

error
Cannot modify header information - headers already sent
error

Suggestions?

Col

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



Re: [PHP] pdflib alternatives

2004-02-16 Thread James Kaufman
On Mon, Feb 16, 2004 at 09:35:10PM -0300, Fernando M. Maresca wrote:
> Hello everybody:
> Is there are any alternatives to the pdflib for on the fly generation of
> printable documents? May be a postcript lib?
> I need no fancy things, just speed and minimal formating facilities,
> even no graphics support is ok.
> Any sugestions?
> Thanks in advance to all of you
> -- 
> 
> Fernando M. Maresca
> 

http://www.fpdf.org/?lang=en

-- 
Jim Kaufman
Linux Evangelist
public key 0x6D802619
http://www.linuxforbusiness.net

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



[PHP] Re: Opening a popup window?

2004-02-16 Thread memoimyself
Hello Shaun,

On 16 Feb 2004 at 22:23, Shaun wrote:

> I have a form on a page. If certain options are selected on that page
> I need a popup window with a select option on there to appear. How can
> I make this happen with PHP, or do I need to use some JavaScript?

PHP is a server side scripting language, which means it is parsed by software on the 
server before anything is sent to the client. That's why you don't see any PHP code if 
you look at the source of a web page on a client machine.

The opening and closing of windows, on the other hand, is something that happens on 
the client side and depend on the client's browser, among other things. PHP has 
*nothing* to do with the client's browser other than the fact that it receives some 
identification information from the browser. In order to pop open windows or do 
anything 
else on the client's computer, you'll need a client-side scripting language, i.e. one 
that is 
processed on the client's computer. One such language is JavaScript, which will take 
care of all your window-opening needs.

Hope this helps,

Erik

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



[PHP] pdflib alternatives

2004-02-16 Thread Fernando M. Maresca
Hello everybody:
Is there are any alternatives to the pdflib for on the fly generation of
printable documents? May be a postcript lib?
I need no fancy things, just speed and minimal formating facilities,
even no graphics support is ok.
Any sugestions?
Thanks in advance to all of you
-- 

Fernando M. Maresca

Cel: (54) 221 15 502 3938
Cel: 0221-15-502-3938

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



Re[2]: [PHP] Steps to installin PHP on apache 2

2004-02-16 Thread Richard Davey
Hello Stuart,

Tuesday, February 17, 2004, 12:10:49 AM, you wrote:

S> all you ever wanted to know about PHP in one convenient location in
S> several formats and many many languages...

... except "lazy arse-eese" :)

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

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



Re: [PHP] Steps to installin PHP on apache 2

2004-02-16 Thread Stuart
Philip J. Newman wrote:
Can someone send me a link to where i can find easy to read docs on 
getting php set up on Apache ...
You're kidding right?!?!?!?

http://php.net/install.apache2

Introducing the PHP Documentation - all you ever wanted to know about 
PHP in one convenient location in several formats and many many 
languages: http://php.net/docs

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


[PHP] Steps to installin PHP on apache 2

2004-02-16 Thread Philip J. Newman
Can someone send me a link to where i can find easy to read docs on 
getting php set up on Apache ...

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



[PHP] Re: Ora_Parse failed

2004-02-16 Thread Matt Hillebrand
I modified that code to make it more readable. You may be wondering why the $columns 
variable looks like a string and then later like an array. Don't worrythere's no 
bug there. The $query variable actually equals "select ${columns_imploded} from 
${state}_spell where ${where_clauses}";
 
Matt

Matt Hillebrand <[EMAIL PROTECTED]> wrote:
I have an Oracle 8 problem. Unfortunately, I can't use the OCI functions and must use 
the ORA functions. The code below looks fine to me. It will return *almost* all of the 
rows, but then the script just dies with no warnings or errors, even though I have 
called error_reporting(E_ALL). I do get the following error message in an Apache error 
log:
 
Ora_Parse failed (ORA-00936: missing expression -- while processing OCI function 
OPARSE).

Here's my code:

ora_parse() failed: ".ora_error());
   ora_exec($cursor) or die("ora_exec() failed: ".ora_error());

   print '';
   $rowcount = 0;

   while(ora_fetch($cursor)) {
  print '';
  for($i=0; $i$cell_data";
  }
  print "\n";
   }

   print '';
?>

Thanks for any advice.
Matt

 


Re: [PHP] How many days between two dates

2004-02-16 Thread Marek Kilimajer
Shaun wrote:
"Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Shaun wrote:

Hi,

how can I check how many days are between two given dates?

Thanks for your help

There are many ways, it would help if you tell us what form are the
dates in - timestamp, formated string, sql date column ...


Sorry,

The dates are retrieved from the database so are stored as -MM-DD
HH-MM-SS in MySQL
Thanks for your help

Let mysql do it:

SELECT TO_DAYS(date1) - TO_DAYS(date2) AS number_of_days ...

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


[PHP] Ora_Parse failed

2004-02-16 Thread Matt Hillebrand
I have an Oracle 8 problem. Unfortunately, I can't use the OCI functions and must use 
the ORA functions. The code below looks fine to me. It will return *almost* all of the 
rows, but then the script just dies with no warnings or errors, even though I have 
called error_reporting(E_ALL). I do get the following error message in an Apache error 
log:
 
Ora_Parse failed (ORA-00936: missing expression -- while processing OCI function 
OPARSE).

Here's my code:

ora_parse() failed: ".ora_error());
   ora_exec($cursor) or die("ora_exec() failed: ".ora_error());

   print '';
   $rowcount = 0;

   while(ora_fetch($cursor)) {
  print '';
  for($i=0; $i$cell_data";
  }
  print "\n";
   }

   print '';
?>

Thanks for any advice.
Matt

 


RE: [PHP] How many days between two dates

2004-02-16 Thread Ralph
Use KronoClass:

http://lafucina.holosoft.it/kronoclass/index.html

example:

// Now calc how days are between date_from and date_to
echo 'How many days are between 03/20/2003 and 04/21/2003 ?: ';
echo $k->days_diff('03/20/2003','04/21/2003');
echo '';


-Original Message-
From: Shaun [mailto:[EMAIL PROTECTED] 
Sent: Monday, February 16, 2004 2:55 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] How many days between two dates


"Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Shaun wrote:
> > Hi,
> >
> > how can I check how many days are between two given dates?
> >
> > Thanks for your help
> >
>
> There are many ways, it would help if you tell us what form are the
> dates in - timestamp, formated string, sql date column ...

Sorry,

The dates are retrieved from the database so are stored as -MM-DD
HH-MM-SS in MySQL

Thanks for your help

-- 
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] Are variables persistent?

2004-02-16 Thread Paul Furman
Ugh, I think I'm done for the day. header() requires output buffering 
which would span several files and sounds like another mess.

Paul Furman wrote:

Matt Matijevich wrote:


 I'm guessing this is not a sensible approach. Every place I construct 
a url, I'd have to remember to add this.


Have you looked into sessions and/or cookies?


I'm taking a class & we are probably not going there for a while. It 
looks involved.



I think you want to use $_POST not $POST


Yep, thanks. I guess I can add the $_REQUEST in the template file so 
maybe it's not too compicated.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] How many days between two dates

2004-02-16 Thread Shaun

"Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Shaun wrote:
> > Hi,
> >
> > how can I check how many days are between two given dates?
> >
> > Thanks for your help
> >
>
> There are many ways, it would help if you tell us what form are the
> dates in - timestamp, formated string, sql date column ...

Sorry,

The dates are retrieved from the database so are stored as -MM-DD
HH-MM-SS in MySQL

Thanks for your help

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



Re: [PHP] Opening a popup window?

2004-02-16 Thread Marek Kilimajer
Shaun wrote:
Hi,

I have a form on a page. If certain options are selected on that page I need
a popup window with a select option on there to appear. How can I make this
happen with PHP, or do I need to use some JavaScript?
Thanks for your help

javascript

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


Re: [PHP] How many days between two dates

2004-02-16 Thread Marek Kilimajer
Shaun wrote:
Hi,

how can I check how many days are between two given dates?

Thanks for your help

There are many ways, it would help if you tell us what form are the 
dates in - timestamp, formated string, sql date column ...

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


Re: [PHP] Are variables persistent?

2004-02-16 Thread Paul Furman
Matt Matijevich wrote:

 I'm guessing this is not a sensible approach. 
Every place I construct a url, I'd have to remember to add this.


Have you looked into sessions and/or cookies?


I'm taking a class & we are probably not going there for a while. It 
looks involved.



I think you want to use $_POST not $POST
Yep, thanks. I guess I can add the $_REQUEST in the template file so 
maybe it's not too compicated.

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


[PHP] How many days between two dates

2004-02-16 Thread Shaun
Hi,

how can I check how many days are between two given dates?

Thanks for your help

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



[PHP] Opening a popup window?

2004-02-16 Thread Shaun
Hi,

I have a form on a page. If certain options are selected on that page I need
a popup window with a select option on there to appear. How can I make this
happen with PHP, or do I need to use some JavaScript?

Thanks for your help

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



Re: [PHP] Are variables persistent?

2004-02-16 Thread Matt Matijevich

 I'm guessing this is not a sensible approach. 
Every place I construct a url, I'd have to remember to add this.


Have you looked into sessions and/or cookies?

I think you want to use $_POST not $POST

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



Re: [PHP] Are variables persistent?

2004-02-16 Thread Paul Furman
Paul Furman wrote:
OK I'm confused. I want to set a variable with a form. How do I do that? 
I guess I need to put it in the url? I did a mail form & that worked by 
putting stuff in the $POST and when it refreshed to the same mail page, 
I grabbed the stuff back out of that (at least that's what I thought I 
was doing.

Maybe I just put the new value in the url with the action property of 
the form and forget about the $POST part. I guess I don't know how that 
worked for the mail script.


I had the script below working to extract the results of $POST[thumbs]. 
Assuming I can get that going again, would I then redirect with header() 
putting the new value in the url? The problem is I want it to stick to 
the pictures page (not this settings page) every time I go to that page 
so I'd have to tack it on to any page on my site and keep checking for 
it everywhere to keep it. I'm guessing this is not a sensible approach. 
Every place I construct a url, I'd have to remember to add this.



Change Settings



  "
method="post">
  number of thumbnails per page: 
  
  OK
  


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


Re: [PHP] An HTML alternative to submit button to look like anchor??

2004-02-16 Thread Marek Kilimajer
Scott Fletcher wrote:
Hi!

I'm wondering if there is such a thing as an alternative to the HTML
submit button that would instead look like an anchor and yet act like a
submit with POST action.  Just wondering...
Scott F.

Instead of javascript and image magic, I would style the button to look 
like regular text:



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


Re: [PHP] An HTML alternative to submit button to look like anchor??

2004-02-16 Thread Marek Kilimajer
Scott Fletcher wrote:
Hi!

I'm wondering if there is such a thing as an alternative to the HTML
submit button that would instead look like an anchor and yet act like a
submit with POST action.  Just wondering...
Scott F.

Instead of javascript and image magic, I would style the button to look 
like regular text:



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


[PHP] crack extension and gecos info

2004-02-16 Thread Seth Hollyman

One of the really handy things that the cracklib library does is
evaluate whether a password is based on a user's gecos information.


The php crack extension (--with-crack) allows me to test password
strength, but it doesn't allow me to specify the users name/gecos
information.  Instead, it uses the information of the current user (in
this case, the uid of the webserver process).

Is there a way to provide the equivalent of the gecos data to
crack_check() somehow?


Seth

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



Re: [PHP] Are variables persistent?

2004-02-16 Thread Paul Furman
Jay Blanchard wrote:

[snip]
$_REQUEST is the only way to go without getting into sessions? 
[/snip]

Nope, $_REQUEST (as its name implies) contains variables that are part
of the request process. If you refresh the form the $_REQUEST array will
essentially be empty for those vraibles that would be passed from form
to process.


OK I'm confused. I want to set a variable with a form. How do I do that? 
I guess I need to put it in the url? I did a mail form & that worked by 
putting stuff in the $POST and when it refreshed to the same mail page, 
I grabbed the stuff back out of that (at least that's what I thought I 
was doing.

Maybe I just put the new value in the url with the action property of 
the form and forget about the $POST part. I guess I don't know how that 
worked for the mail script.

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


Re: [PHP] An HTML alternative to submit button to look like anchor??

2004-02-16 Thread Scott Fletcher
Not a problem!!   :-)  I had a morning brain freeze until lunch.  Thanks...

"Jay Blanchard" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
[snip]
You can do it with an image.
[/snip]

Dang! I was thinking picture of an anchor. Monday afternoon brain
freeze!

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



Re: [PHP] An HTML alternative to submit button to look like anchor??

2004-02-16 Thread Scott Fletcher
Impressive   :-)  Thanks...

"Shaunak Kashyap" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Yes, you can use elementary javascript to achieve that goal.
>
> Just make a link (anchor) as you normally would and make the value of its
> href attribute "javascript:document.formName.submit()" where formName is
the
> name of the form you wish to submit. As with a lot of client-side
scripting
> languages, I cannot guarantee that this solution is cross-browser
> compatible.
>
> Shaunak
>
> > -Original Message-
> > From: Scott Fletcher [mailto:[EMAIL PROTECTED]
> > Sent: Monday, February 16, 2004 4:41 PM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] An HTML alternative to submit button to look like
> > anchor??
> >
> >
> > Hi!
> >
> > I'm wondering if there is such a thing as an alternative to the HTML
> > submit button that would instead look like an anchor and yet act like a
> > submit with POST action.  Just wondering...
> >
> > Scott F.
> >
> > --
> > 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] An HTML alternative to submit button to look like anchor??

2004-02-16 Thread Jay Blanchard
[snip]
You can do it with an image.
[/snip]

Dang! I was thinking picture of an anchor. Monday afternoon brain
freeze!

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



RE: [PHP] Are variables persistent?

2004-02-16 Thread Jay Blanchard
[snip]
$_REQUEST is the only way to go without getting into sessions? 
[/snip]

Nope, $_REQUEST (as its name implies) contains variables that are part
of the request process. If you refresh the form the $_REQUEST array will
essentially be empty for those vraibles that would be passed from form
to process.

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



Re: [PHP] Are variables persistent?

2004-02-16 Thread Paul Furman
Paul Furman wrote:
So...

$_REQUEST is the only way to go without getting into sessions? 


OK I see, it either goes in the url or a cookie.

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


RE: [PHP] An HTML alternative to submit button to look like anchor??

2004-02-16 Thread Shaunak Kashyap
Yes, you can use elementary javascript to achieve that goal.

Just make a link (anchor) as you normally would and make the value of its
href attribute "javascript:document.formName.submit()" where formName is the
name of the form you wish to submit. As with a lot of client-side scripting
languages, I cannot guarantee that this solution is cross-browser
compatible.

Shaunak

> -Original Message-
> From: Scott Fletcher [mailto:[EMAIL PROTECTED]
> Sent: Monday, February 16, 2004 4:41 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] An HTML alternative to submit button to look like
> anchor??
>
>
> Hi!
>
> I'm wondering if there is such a thing as an alternative to the HTML
> submit button that would instead look like an anchor and yet act like a
> submit with POST action.  Just wondering...
>
> Scott F.
>
> --
> 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] An HTML alternative to submit button to look like anchor??

2004-02-16 Thread Jay Blanchard
[snip]
I'm wondering if there is such a thing as an alternative to the HTML
submit button that would instead look like an anchor and yet act like a
submit with POST action.  Just wondering...
[/snip]

You can do it with an image.

http://www.w3.org/TR/html4/interact/forms.html#h-17.4

Google is your friend

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



Re: [PHP] Are variables persistent?

2004-02-16 Thread Paul Furman
Jay Blanchard wrote:
What would cause a variable or even a $POST[] value to be erased?
[/snip]
Refreshing the script causes the variable arrays to be repopulated with
empty or blank variables unless a session was used to hold the
variables. Refreshing is essentially calling the script without passing
any variables.


Ah ha!

So...

$_REQUEST is the only way to go without getting into sessions? Hidden or 
other form methods will not work with out sessions, I guess. Damn, I 
wish I knew that four hours ago!

: - )

I thought I didn't want to clutter the URL this time so I'd try that. Ha!

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


[PHP] An HTML alternative to submit button to look like anchor??

2004-02-16 Thread Scott Fletcher
Hi!

I'm wondering if there is such a thing as an alternative to the HTML
submit button that would instead look like an anchor and yet act like a
submit with POST action.  Just wondering...

Scott F.

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



RE: [PHP] Are variables persistent?

2004-02-16 Thread Jay Blanchard
[snip]
When I refresh a script using a form, it goes through & resets all my 
custom Constants but presumably all my variables should still hold their

values from the last run, right? THere are no functions involved.

What would cause a variable or even a $POST[] value to be erased?
[/snip]

Refreshing the script causes the variable arrays to be repopulated with
empty or blank variables unless a session was used to hold the
variables. Refreshing is essentially calling the script without passing
any variables.

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



[PHP] Are variables persistent?

2004-02-16 Thread Paul Furman
When I refresh a script using a form, it goes through & resets all my 
custom Constants but presumably all my variables should still hold their 
values from the last run, right? THere are no functions involved.

What would cause a variable or even a $POST[] value to be erased?

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


[PHP] Re: Scope: global $GLOBALS[]

2004-02-16 Thread Paul Furman
None of them need global, just that initial config that calls them up 
with includes, that's where the variable is killed. I print the in & out 
value for every page & that's where it ends.

I have no idea why.

What would destroy the variable? All the other pages get it from that 
page just fine but that page it comes up as undefined and global simply 
defines it as empty. I tried static so it doesn't go away. I'm 
re-setting $pics from the settings page where I put it in a $POST, 
refresh, get it from the $POST & assign it to $pics. I even tried 
grabbing it from $POST in the config file to jump the gap but it's 
killed in $POST too! I thought $POST was a superglobal. What would make 
that lose it's value?

Any ideas?

Paul Furman wrote:

The template wipes it out on the second round through after changing in 
settings. Coming into the template the second time it prints out empty. 
If I don't use global, the template gives an error that the variable 
doesn't exist.

OK, well what I'm calling the template is really the configuration file 
which does an include on the template that includes the screens. I set 
global in all of those.

Paul Furman wrote:

Help.
After changing $pics on the setting screen, the picture screen will 
not recognize the new value.

I'm just not clear where I need to set global (where it's being 
initially set or where it's being picked up later) especially where it 
bounces back & forth several times. For now I have global $pics 
everywhere. Is that bad?

Paul Furman wrote:

template:

global $pics;
if (!isset($pics)){$pics = 8;}
picture screen:

global $pics;
# works fine with the setting 8 from the template
settings screen:

global $pics;
print $pics; #for debugging, always follows template setting
if (!isset($pics)){$pics = 5;}
  if ($_POST){
if (isset ($_POST['thumbs'])){
  $pics = $_POST['thumbs'];
  print "settings have been changed";
}
}
?>

  " 
method="post">
  number of thumbnails per page: 
  
 value="">
  OK
  
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] diskusage

2004-02-16 Thread David Otton
On Mon, 16 Feb 2004 15:17:52 -0500, you wrote:

>Chakravarthy Cuddapah wrote:
>> In php I want to know space used (du) by user on a remote system. Can 
>> anyone pls tell me how this can be done.
>
>Just call du through exec().

He said "remote system", which I read to mean "on the client"[?]. In that
case, it can't be done. Security.

http://uk2.php.net/manual/en/function.disk-free-space.php

will give you disc free space in a portable way (PHP => 4.1).

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



[PHP] Re: Scope: global $GLOBALS[]

2004-02-16 Thread Paul Furman
The template wipes it out on the second round through after changing in 
settings. Coming into the template the second time it prints out empty. 
If I don't use global, the template gives an error that the variable 
doesn't exist.

OK, well what I'm calling the template is really the configuration file 
which does an include on the template that includes the screens. I set 
global in all of those.

Paul Furman wrote:

Help.
After changing $pics on the setting screen, the picture screen will not 
recognize the new value.

I'm just not clear where I need to set global (where it's being 
initially set or where it's being picked up later) especially where it 
bounces back & forth several times. For now I have global $pics 
everywhere. Is that bad?

Paul Furman wrote:

template:

global $pics;
if (!isset($pics)){$pics = 8;}
picture screen:

global $pics;
# works fine with the setting 8 from the template
settings screen:

global $pics;
print $pics; #for debugging, always follows template setting
if (!isset($pics)){$pics = 5;}
  if ($_POST){
if (isset ($_POST['thumbs'])){
  $pics = $_POST['thumbs'];
  print "settings have been changed";
}
}
?>

  " 
method="post">
  number of thumbnails per page: 
  
 value="">
  OK
  
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] empty file's content?

2004-02-16 Thread Marek Kilimajer
Mike Mapsnac wrote:
How can I empty a file's content through php defined functions?
Thanks
_
Check out the great features of the new MSN 9 Dial-up, with the MSN 
Dial-up Accelerator. 
http://click.atdmt.com/AVE/go/onm00200361ave/direct/01/

http://www.php.net/ftruncate

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


Re: [PHP] diskusage

2004-02-16 Thread John W. Holmes
Chakravarthy Cuddapah wrote:
In php I want to know space used (du) by user on a remote system. Can 
anyone pls tell me how this can be done.
Just call du through exec().

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com

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


Re: [PHP] PHP REDIRECT

2004-02-16 Thread Lowell Allen
> --- Lowell Allen <[EMAIL PROTECTED]> wrote:

[snip]

>> Am I overlooking a better solution?
> 
> I'm not sure. To be clear, you're saying that the following two things do
> not behave the same for you:
> 
> header('Refresh: ...');
> 
> 
> 
> Is this right? I suspect that you might be comparing these instead:
> 
> header('Location: ...');
> 
> 

Your suspicion is correct, as pointed out earlier by Stuart. Thanks to both
of you for the explanation, and sorry for the confusion.

--
Lowell Allen

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



[PHP] Re: Scope: global $GLOBALS[]

2004-02-16 Thread Paul Furman
Help.
After changing $pics on the setting screen, the picture screen will not 
recognize the new value.

I'm just not clear where I need to set global (where it's being 
initially set or where it's being picked up later) especially where it 
bounces back & forth several times. For now I have global $pics 
everywhere. Is that bad?

Paul Furman wrote:
template:

global $pics;
if (!isset($pics)){$pics = 8;}
picture screen:

global $pics;
# works fine with the setting 8 from the template
settings screen:

global $pics;
print $pics; #for debugging, always follows template setting
if (!isset($pics)){$pics = 5;}
  if ($_POST){
if (isset ($_POST['thumbs'])){
  $pics = $_POST['thumbs'];
  print "settings have been changed";
}
}
?>

  " 
method="post">
  number of thumbnails per page: 
  
 value="">
  OK
  
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] diskusage

2004-02-16 Thread Chakravarthy Cuddapah
In php I want to know space used (du) by user on a remote system. Can anyone 
pls tell me how this can be done.

Thanks !

_
Check out the great features of the new MSN 9 Dial-up, with the MSN Dial-up 
Accelerator. http://click.atdmt.com/AVE/go/onm00200361ave/direct/01/

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


Re: [PHP] * populate menu from directory *

2004-02-16 Thread Matt Matijevich

 I want to be able to simply FTP a new movie 
onto the server, and then have the menu update itself. possible? I 
would also be looking to do something similar with JPGS.


take a look at 

http://www.php.net/readdir 
http://www.php.net/opendir

here is some code to help start you


echo '';
if ($handle = opendir('moviesdirectory')) {

   while (false !== ($file = readdir($handle))) {
  if (preg_match("/\.mov$/i", $file)) { //the regular expression
might have to be modified to allow for the file extensions you want to
use
echo "$file\n";
  }
   }



   closedir($handle);
}
echo '';

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



Re: [PHP] * populate menu from directory *

2004-02-16 Thread David T-G
Dustin --

You have started a new thread by taking an existing message and replying
to it while merely changing the Subject: line.

That is bad, because it breaks threading.  When you reply to a message,
your mail client generates a "References:" header that tells everyone
to which posting(s) your posting refers.  A good mail client uses this
information to build a "thread tree" of the postings so that it is easy
to see just how they relate to each other.

With your posting style you successfully torpedoed this useful feature;
your posting shows up within an existing thread even though it is
completely unrelated.

Always do a fresh post when you want to start a new thread.  That means
that you do not select any sort of "Reply" when you start your message.
You can save the list address in your address book (or equivalent) for
convenience.

...and then Dustin Krysak said...
% 
% Hi there - I am a REAL new PHP coder (yeah I mostly use dreamweaver). I 

Welcome, and hang on for a great ride :-)


% was wondering if anyone could point me in the right direction... What I 
% want to do is have a generic template page for say a bunch of quicktime 

Good enough.


% movies... it would have a movie embedded, and a drop down menu below to 
% select the movie you want to watch.. what I was hoping to do was have 
% the menu populated by pulling the file names from the movies in the 

Easy enough, especially depending on where they live.


% directory on the server. I want to be able to simply FTP a new movie 
% onto the server, and then have the menu update itself. possible? I 
% would also be looking to do something similar with JPGS.

1) There are lots of gallery scripts out there, so you might look around
and avoid reinventing the wheel.

2) If the files are in the same directory as the script, just open the
dir and walk through it.  Be sure to not present '.' or '..' in the menu
(but still check whatever input you get back anyway).  If they're off in
some master directory, then do the same thing but look over there.

3) If the file paths are stored in a database, just connect to the DB and
pull the list and then loop through it just as in #2.


% 
% 
% d


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


RE: [PHP] * populate menu from directory *

2004-02-16 Thread Shaunak Kashyap
Yes, it is possible. Use PHP's filesystem functions
(http://us2.php.net/manual/en/ref.filesystem.php).

Shaunak

> -Original Message-
> From: Dustin Krysak [mailto:[EMAIL PROTECTED]
> Sent: Monday, February 16, 2004 2:33 PM
> To: PHP
> Subject: [PHP] * populate menu from directory *
>
>
> Hi there - I am a REAL new PHP coder (yeah I mostly use dreamweaver). I
> was wondering if anyone could point me in the right direction... What I
> want to do is have a generic template page for say a bunch of quicktime
> movies... it would have a movie embedded, and a drop down menu below to
> select the movie you want to watch.. what I was hoping to do was have
> the menu populated by pulling the file names from the movies in the
> directory on the server. I want to be able to simply FTP a new movie
> onto the server, and then have the menu update itself. possible? I
> would also be looking to do something similar with JPGS.
>
>
> d
>
> --
> 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] * populate menu from directory *

2004-02-16 Thread Dustin Krysak
Hi there - I am a REAL new PHP coder (yeah I mostly use dreamweaver). I 
was wondering if anyone could point me in the right direction... What I 
want to do is have a generic template page for say a bunch of quicktime 
movies... it would have a movie embedded, and a drop down menu below to 
select the movie you want to watch.. what I was hoping to do was have 
the menu populated by pulling the file names from the movies in the 
directory on the server. I want to be able to simply FTP a new movie 
onto the server, and then have the menu update itself. possible? I 
would also be looking to do something similar with JPGS.

d

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


[PHP] zip problem

2004-02-16 Thread marc serra
Hi,

 

I want to know if it's possible to extract a zip file in PHP. 

 

I've read php documentation on ZZIPlib but i don't find any solution to
extract file.

 

Can you please help me to solve it.

 

Thx in advance,

 

Marc



[PHP] Re: PHP/ MySQL Login Module

2004-02-16 Thread zerof
If you can use Dreamweaver, you must use one extension to make this. Is very simple.
http://www.macromedia.com/cfusion/exchange/index.cfm
-
zerof
-
"Pushpinder Singh" <[EMAIL PROTECTED]> escreveu na mensagem
news:[EMAIL PROTECTED]
> hello everyone.
>  I am using PHP and MySQL on my website. Till now I was using a
> Login module with sessions, but the look and feel was not quite up to
--

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



Re: [PHP] PHP REDIRECT

2004-02-16 Thread Chris Shiflett
--- Lowell Allen <[EMAIL PROTECTED]> wrote:
> You must do authorization, then force a file download, and you want to
> also display a link to the file with the typical "click the link below
> if the download does not start automatically". I couldn't figure out how
> to display a page (after authorization), then use the PHP header
> redirect to force the download while keeping the same page display.
> However, using a meta refresh to a script that forced the download
> (without producing any display) was an easy solution.
> 
> Am I overlooking a better solution?

I'm not sure. To be clear, you're saying that the following two things do
not behave the same for you:

header('Refresh: ...');



Is this right? I suspect that you might be comparing these instead:

header('Location: ...');



If this is the case, the difference in behavior is due to:

1. Different headers.
2. Different response status codes (setting a Location header also changes
the status code from 200 to 302).

If this is not the case, I'm honestly not sure why the behavior would be
any different, since browsers that support http-equiv are supposed to
interpret these exactly as if they were real headers.

Hope that helps.

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly
 Coming mid-2004
HTTP Developer's Handbook - Sams
 http://httphandbook.org/
PHP Community Site
 http://phpcommunity.org/

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



Re: [PHP] PHP REDIRECT

2004-02-16 Thread Chris Shiflett
--- Raditha Dissanayake <[EMAIL PROTECTED]> wrote:
> What happens is that the gateways include your page instead of posting 
> to your page.
> 
> For example if you visit a site that uses worldpay as a payment service 
> provider you will see their banner on the thank you page after
> payment is made.  In such cases the header functions will not work 
> because it's too late to send them.

In case this wasn't clear, I can elaborate...

Let's use some fake domains:

1. payment.org - the payment processor
2. yoursite.org - your Web site

As a user, I want to buy something from yoursite.org, and you use a
payment processor for this purpose. I click a link from your site to
theirs, so http://payment.org/... is displayed in my browser. I enter some
credit card ifnormation, and click the button, and this happens:

1. payment.org verifies my information, charges my credit card, etc.
2. payment.org sends an HTTP request (typically a POST) to a URL at
yoursite.org, where you receive payment notifications. You make the output
of this page appropriate for the end user.
3. payment.org displays the output of your page to the user.

So, after I (the user) click the submit button, I see a "thank you" page
of some sort that was generated by yoursite.org. However, my browser still
shows that I am on payment.org's Web site.

To recap, payment.org is playing the role of a Web client (browser, for
example) when communicating with yoursite.org's payment notification page.
It uses the output of this page (the HTTP content) to use when it
communicates back to the user, at which time it is playing the more
typical role of a Web server.

Hope that helps.

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly
 Coming mid-2004
HTTP Developer's Handbook - Sams
 http://httphandbook.org/
PHP Community Site
 http://phpcommunity.org/

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



Re: [PHP] PHP REDIRECT

2004-02-16 Thread Chris Shiflett
--- Raditha Dissanayake <[EMAIL PROTECTED]> wrote:
> It's not often that i disagree with the other chris but one occaision 
> where meta refresh turns out to be the only solution is when working 
> with some payment gateways where instead of doing a simple old post to 
> your return page they include it inside their own thank you page so the 
> headers will not work.
> 
> Lame? well some of the best known gateways are doing it.

You're right, but I don't think this means that we must disagree. :-)

In my opinion, this simply falls into the narrow category for which the
http-equiv attribute was created. If you want to specify an HTTP header in
the content, it's your only option. This is such a case. Because the
payment processor is the one acting as the Web client, it is they who
receive your HTTP response. They only display the content of this response
to the end user, so any headers you set are probably discarded (or maybe
the payment processor is redirected?).

However, this has lead to people using this same approach in the 99% of
situations where it is not necessary. If the user's Web client is
receiving your HTTP response in its entirety (the usual situation), you
can set any HTTP header you want the "right" way.

I don't have the URL handy, but there is a site somewhere that has been
conducting extensive tests to determine which headers have good http-equiv
support among various browsers. While Refresh is pretty well supported,
other headers are not, and the most consistent support for any header
definitely lies with it being sent within the protocol where it is
intended.

Hope that helps.

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly
 Coming mid-2004
HTTP Developer's Handbook - Sams
 http://httphandbook.org/
PHP Community Site
 http://phpcommunity.org/

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



RE: [PHP] PHP REDIRECT

2004-02-16 Thread Chris
Ahh, ok, I understand. Thanks

Chris

> -Original Message-
> From: Raditha Dissanayake [mailto:[EMAIL PROTECTED]
> Sent: Monday, February 16, 2004 10:51 AM
> To: Chris; [EMAIL PROTECTED]
> Subject: Re: [PHP] PHP REDIRECT
>
>
> Nopes,
>
> What happens is that the gateways include your page instead of posting
> to your page.
>
> For example if you visit a site that uses worldpay as a payment service
> provider you will see their banner on the thank you page after
> payment is made.  In such cases the header functions will not work
> because it's too late to send them.
>
> hope this is a better explaination.
>
> best regards
> raditha
>
>
> Chris wrote:
>
> >I'm not quite following you here. I understand that no solution is always
> >the correct one. Everything has exceptions...
> >
> >If the page you want to redirect from has PHP, just dont' use the  >http-equiv=...>, set the header with PHP instead. As far as I
> can see that
> >should always be possible.
> >
> >
> >
> >>-Original Message-
> >>From: Raditha Dissanayake [mailto:[EMAIL PROTECTED]
> >>Sent: Monday, February 16, 2004 10:07 AM
> >>To: [EMAIL PROTECTED]
> >>Subject: Re: [PHP] PHP REDIRECT
> >>
> >>
> >>Hi Chris and Chris and et al.
> >>
> >>It's not often that i disagree with the other chris but one occaision
> >>where meta refresh turns out to be the only solution is when working
> >>with some payment gateways where instead of doing a simple old post to
> >>your return page they include it inside their own thank you page so the
> >>headers will not work.
> >>
> >>Lame? well some of the best known gateways are doing it.
> >>
> >>
> >>
> >>Chris wrote:
> >>
> >>
> >>
> >>>Heh, I was on my way to bed and didn't think about that. (And
> my 'answer'
> >>>was a bit abrupt as well)
> >>>
> >>>Ah well, booboo's happen. I've always been an advocater of doing
> >>>
> >>>
> >>things the
> >>
> >>
> >>>*right way*, and in this case, the Refresh header would seem to
> >>>
> >>>
> >>be the right
> >>
> >>
> >>>way.
> >>>
> >>>JUST SAY NO to meta http-equiv tags! :)
> >>>
> >>>Chris (the other one)
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> -Original Message-
> From: Chris Shiflett [mailto:[EMAIL PROTECTED]
> 
> 
> 
> >>--
> >>Raditha Dissanayake.
> >>
> >>http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
> >>Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
> >>Graphical User Inteface. Just 150 KB | with progress bar.
> >>
> >>--
> >>PHP General Mailing List (http://www.php.net/)
> >>To unsubscribe, visit: http://www.php.net/unsub.php
> >>
> >>
> >
> >
> >
>
>
> --
> Raditha Dissanayake.
> 
> http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
> Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
> Graphical User Inteface. Just 150 KB | with progress bar.
>
> --
> 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] empty file's content?

2004-02-16 Thread Raditha Dissanayake
Hi,
not sure why you want to do that when removing is so much easier but 
here goes:

open the file for writing and close it without writing anything to it.

Mike Mapsnac wrote:

How can I empty a file's content through php defined functions?
Thanks




--
Raditha Dissanayake.

http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 150 KB | with progress bar.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] PHP REDIRECT

2004-02-16 Thread Raditha Dissanayake
Nopes,

What happens is that the gateways include your page instead of posting 
to your page.

For example if you visit a site that uses worldpay as a payment service 
provider you will see their banner on the thank you page after
payment is made.  In such cases the header functions will not work 
because it's too late to send them.

hope this is a better explaination.

best regards
raditha
Chris wrote:

I'm not quite following you here. I understand that no solution is always
the correct one. Everything has exceptions...
If the page you want to redirect from has PHP, just dont' use the , set the header with PHP instead. As far as I can see that
should always be possible.
 

-Original Message-
From: Raditha Dissanayake [mailto:[EMAIL PROTECTED]
Sent: Monday, February 16, 2004 10:07 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] PHP REDIRECT
Hi Chris and Chris and et al.

It's not often that i disagree with the other chris but one occaision
where meta refresh turns out to be the only solution is when working
with some payment gateways where instead of doing a simple old post to
your return page they include it inside their own thank you page so the
headers will not work.
Lame? well some of the best known gateways are doing it.



Chris wrote:

   

Heh, I was on my way to bed and didn't think about that. (And my 'answer'
was a bit abrupt as well)
Ah well, booboo's happen. I've always been an advocater of doing
 

things the
   

*right way*, and in this case, the Refresh header would seem to
 

be the right
   

way.

JUST SAY NO to meta http-equiv tags! :)

Chris (the other one)



 

-Original Message-
From: Chris Shiflett [mailto:[EMAIL PROTECTED]
   

--
Raditha Dissanayake.

http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 150 KB | with progress bar.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
   

 



--
Raditha Dissanayake.

http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 150 KB | with progress bar.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] empty file's content?

2004-02-16 Thread Mike Mapsnac
How can I empty a file's content through php defined functions?
Thanks
_
Check out the great features of the new MSN 9 Dial-up, with the MSN Dial-up 
Accelerator. http://click.atdmt.com/AVE/go/onm00200361ave/direct/01/

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


RE: [PHP] PHP REDIRECT

2004-02-16 Thread Chris
I'm not quite following you here. I understand that no solution is always
the correct one. Everything has exceptions...

If the page you want to redirect from has PHP, just dont' use the , set the header with PHP instead. As far as I can see that
should always be possible.

> -Original Message-
> From: Raditha Dissanayake [mailto:[EMAIL PROTECTED]
> Sent: Monday, February 16, 2004 10:07 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] PHP REDIRECT
>
>
> Hi Chris and Chris and et al.
>
> It's not often that i disagree with the other chris but one occaision
> where meta refresh turns out to be the only solution is when working
> with some payment gateways where instead of doing a simple old post to
> your return page they include it inside their own thank you page so the
> headers will not work.
>
> Lame? well some of the best known gateways are doing it.
>
>
>
> Chris wrote:
>
> >Heh, I was on my way to bed and didn't think about that. (And my 'answer'
> >was a bit abrupt as well)
> >
> >Ah well, booboo's happen. I've always been an advocater of doing
> things the
> >*right way*, and in this case, the Refresh header would seem to
> be the right
> >way.
> >
> >JUST SAY NO to meta http-equiv tags! :)
> >
> >Chris (the other one)
> >
> >
> >
> >
> >>-Original Message-
> >>From: Chris Shiflett [mailto:[EMAIL PROTECTED]
> >>
>
>
> --
> Raditha Dissanayake.
> 
> http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
> Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
> Graphical User Inteface. Just 150 KB | with progress bar.
>
> --
> 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] Header+location+sessions

2004-02-16 Thread Jason Wong
On Tuesday 17 February 2004 01:57, Natalia Sensini wrote:
> I've been using
> header("Location: http://www.example.com/";);
> before writing this sentence i create a session and
> register a session var, but when i go to the redirected page the session
> var doesn't exist.

session_write_close() before you redirect.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
"I'd love to go out with you, but I'm attending the opening of my garage 
door."
*/

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



Re: [PHP] PHP REDIRECT

2004-02-16 Thread Raditha Dissanayake
Hi Chris and Chris and et al.

It's not often that i disagree with the other chris but one occaision 
where meta refresh turns out to be the only solution is when working 
with some payment gateways where instead of doing a simple old post to 
your return page they include it inside their own thank you page so the 
headers will not work.

Lame? well some of the best known gateways are doing it.



Chris wrote:

Heh, I was on my way to bed and didn't think about that. (And my 'answer'
was a bit abrupt as well)
Ah well, booboo's happen. I've always been an advocater of doing things the
*right way*, and in this case, the Refresh header would seem to be the right
way.
JUST SAY NO to meta http-equiv tags! :)

Chris (the other one)

 

-Original Message-
From: Chris Shiflett [mailto:[EMAIL PROTECTED]


--
Raditha Dissanayake.

http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 150 KB | with progress bar.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Header+location+sessions

2004-02-16 Thread Natalia Sensini
I've been using
header("Location: http://www.example.com/";);
before writing this sentence i create a session and
register a session var, but when i go to the redirected page the session var
doesn't exist.
Someone could help me?






[PHP] Scope: global $GLOBALS[]

2004-02-16 Thread Paul Furman
I checked the manual but I still don't get it.
http://us2.php.net/manual/en/language.variables.scope.php
I'm setting a variable $pics with a form by post method. It's on a 
"screen" that is included, then it needs to be applied to another 
"screen" that will take it's place when it's all re-processed.

template
  include header
  include SCREEN (picture or settings)
  include footer
Now, the template sets $pics to a default and then I can pull up the 
picture screen and setting $pics global makes it work but if I go to the 
settings screen to change $pic, it doesn't stick, even if I set it 
global there. I'm not sure if I need to set global once in the template 
or not there but in each screen I want to use it.



template:

global $pics;
if (!isset($pics)){$pics = 8;}
picture screen:

global $pics;
# works fine with the setting 8 from the template
settings screen:

global $pics;
print $pics; #for debugging, always follows template setting
if (!isset($pics)){$pics = 5;}
  if ($_POST){
if (isset ($_POST['thumbs'])){
  $pics = $_POST['thumbs'];
  print "settings have been changed";
}
}
?>

  " 
method="post">
  number of thumbnails per page: 
  
 value="">
  OK
  

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


RE: [PHP] File input in form

2004-02-16 Thread Shaunak Kashyap
Sounds like a scope problem. I suggest using $_FILES['fichier'] inside the
function since $_FILES is a superglobal and is accessible everywhere. If you
use this method, you won't need to pass anything to the function.

Shaunak

> -Original Message-
> From: marc serra [mailto:[EMAIL PROTECTED]
> Sent: Monday, February 16, 2004 12:47 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] File input in form
>
>
> Hi,
>
>
>
> I'm designing a form with an file upload process.
>
>
>
> So I've wrote something like this:
>
>
>
> 
>
>  
>
>  
>
> 
>
>
>
>
>
> This work perfectly and now I got my file valid_form.php which receive the
> data:
>
>
>
> In that page I want to call a function to store file like this
>
> storeFile($fichier);
>
> ps :when I write : "echo $fichier_name" the name of the file is displayed.
>
>
>
> My problem is that in the function storeFile when I want to save
> data I got
> an error and when I write:
>
> "echo $fichier_name;" nothing appear like if it
> doesn't know my
> file..
>
>
>
> So can you please tell me how to call a function with file in parameter to
> store it.
>
>
>
> Thx in advance,
>
>
>
> Marc.
>
>
>
>

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



[PHP] File input in form

2004-02-16 Thread marc serra
Hi, 

 

I'm designing a form with an file upload process.

 

So I've wrote something like this:

 



 

 



 

 

This work perfectly and now I got my file valid_form.php which receive the
data:

 

In that page I want to call a function to store file like this

storeFile($fichier);

ps :when I write : "echo $fichier_name" the name of the file is displayed.

 

My problem is that in the function storeFile when I want to save data I got
an error and when I write:

"echo $fichier_name;" nothing appear like if it doesn't know my
file..

 

So can you please tell me how to call a function with file in parameter to
store it.

 

Thx in advance,

 

Marc.

 



Re: [PHP] PHP REDIRECT

2004-02-16 Thread Stuart
Lowell Allen wrote:
You must do authorization, then force a file download, and you want to also
display a link to the file with the typical "click the link below if the
download does not start automatically". I couldn't figure out how to display
a page (after authorization), then use the PHP header redirect to force the
download while keeping the same page display. However, using a meta refresh
to a script that forced the download (without producing any display) was an
easy solution.
You're missing the point of what Chris is saying.

http://example.org/";>

and

header('Refresh: 10;URL=http://example.org/');

are both doing the same thing just in different ways. The http-equiv 
meta tag was created to allow static HTML pages to specify HTTP headers. 
With PHP you don't need to use that, you can actually send the browser 
the actual header. IMHO it's a better way to do it, but I can't actually 
see a reason why I feel that way.

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


RE: [PHP] PHP REDIRECT

2004-02-16 Thread Chris
Heh, I was on my way to bed and didn't think about that. (And my 'answer'
was a bit abrupt as well)

Ah well, booboo's happen. I've always been an advocater of doing things the
*right way*, and in this case, the Refresh header would seem to be the right
way.

JUST SAY NO to meta http-equiv tags! :)

Chris (the other one)


> -Original Message-
> From: Chris Shiflett [mailto:[EMAIL PROTECTED]
> Sent: Monday, February 16, 2004 8:51 AM
> To: Chris; ajay; [EMAIL PROTECTED]
> Subject: RE: [PHP] PHP REDIRECT
>
>
> --- Chris <[EMAIL PROTECTED]> wrote:
> > You can't view the page and have PHP redirect it. You would need to
> > use a  refresh tag or JavaScript.
>
> I assume by meta refresh tag, you mean this:
>
> http://example.org/";>
>
> What most people seem to not realize, is that the http-equiv attribute is
> just a way to specify HTTP headers in a meta tag. This is handy when you
> want to do so in static pages, but PHP has a more proper way to specify
> headers:
>
> http://www.php.net/header
>
> This creates a real HTTP header, and there is no reason for any PHP
> developer to use a meta tag for this purpose.
>
> Hope that helps.
>
> Chris
>
> =
> Chris Shiflett - http://shiflett.org/
>
> PHP Security - O'Reilly
>  Coming mid-2004
> HTTP Developer's Handbook - Sams
>  http://httphandbook.org/
> PHP Community Site
>  http://phpcommunity.org/

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



Re: [PHP] PHP REDIRECT

2004-02-16 Thread Lowell Allen
> --- Chris <[EMAIL PROTECTED]> wrote:
>> You can't view the page and have PHP redirect it. You would need to
>> use a  refresh tag or JavaScript.
> 
> I assume by meta refresh tag, you mean this:
> 
> http://example.org/";>
> 
> What most people seem to not realize, is that the http-equiv attribute is
> just a way to specify HTTP headers in a meta tag. This is handy when you
> want to do so in static pages, but PHP has a more proper way to specify
> headers:
> 
> http://www.php.net/header
> 
> This creates a real HTTP header, and there is no reason for any PHP
> developer to use a meta tag for this purpose.

Well, how about this situation as a reason:

You must do authorization, then force a file download, and you want to also
display a link to the file with the typical "click the link below if the
download does not start automatically". I couldn't figure out how to display
a page (after authorization), then use the PHP header redirect to force the
download while keeping the same page display. However, using a meta refresh
to a script that forced the download (without producing any display) was an
easy solution.

Am I overlooking a better solution?

--
Lowell Allen

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



RE: [PHP] Resource id #1

2004-02-16 Thread Shaunak Kashyap
It's probably a database result set or a connection object or something
similar.

Shaunak

> -Original Message-
> From: Mike Mapsnac [mailto:[EMAIL PROTECTED]
> Sent: Monday, February 16, 2004 11:53 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Resource id #1
>
>
> I print variable to the screen and get the result "Resource id #1". Any
> ideas waht Resource id #1 is?
> Thanks
>
> _
> Plan your next US getaway to one of the super destinations here.
> http://special.msn.com/local/hotdestinations.armx
>
> --
> 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] Resource id #1

2004-02-16 Thread Mike Mapsnac
I print variable to the screen and get the result "Resource id #1". Any 
ideas waht Resource id #1 is?
Thanks

_
Plan your next US getaway to one of the super destinations here. 
http://special.msn.com/local/hotdestinations.armx

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


RE: [PHP] PHP REDIRECT

2004-02-16 Thread Chris Shiflett
--- Chris <[EMAIL PROTECTED]> wrote:
> You can't view the page and have PHP redirect it. You would need to
> use a  refresh tag or JavaScript.

I assume by meta refresh tag, you mean this:

http://example.org/";>

What most people seem to not realize, is that the http-equiv attribute is
just a way to specify HTTP headers in a meta tag. This is handy when you
want to do so in static pages, but PHP has a more proper way to specify
headers:

http://www.php.net/header

This creates a real HTTP header, and there is no reason for any PHP
developer to use a meta tag for this purpose.

Hope that helps.

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly
 Coming mid-2004
HTTP Developer's Handbook - Sams
 http://httphandbook.org/
PHP Community Site
 http://phpcommunity.org/

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



Re: [PHP] PHP/ MySQL Login Module

2004-02-16 Thread Raditha Dissanayake
hotscripts and freshmeat have plenty

Pushpinder Singh wrote:

hello everyone.

I am using PHP and MySQL on my website. Till now I was using a 
Login module with sessions, but the look and feel was not quite up to 
the mark. I have the functionality working just fine. I was wondering 
if I cold get my hands on a 'Login' module like www.zend.com (and 
other sites as well ) uses on their site.  i.e. the small rectangular 
box in the top frame on the right hand corner.  I am also looking at 
google.com , but have not come across anything till now. Pl let me 
know if you guys have anything, that might be useful.

Thanks in advance
Pushpinder


--
Raditha Dissanayake.

http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 150 KB | with progress bar.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] PHP REDIRECT

2004-02-16 Thread Chris Shiflett
--- ajay <[EMAIL PROTECTED]> wrote:
> i'd like to redirect a person to another page but after a certain time
> interval has elapsed. this is because i have a generic error displaying
> page and i would like the person to go to this page, stay there for like
> 10 seconds and then be redirected to the index page.
> 
> i was using header("url") to redirect the user. but how do i get that to
> happen after a certain time interval.

Use the Refresh header:

header('Refresh: 10;URL=http://example.org/');

Hope that helps.

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly
 Coming mid-2004
HTTP Developer's Handbook - Sams
 http://httphandbook.org/
PHP Community Site
 http://phpcommunity.org/

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



[PHP] PHP/ MySQL Login Module

2004-02-16 Thread Pushpinder Singh
hello everyone.

I am using PHP and MySQL on my website. Till now I was using a 
Login module with sessions, but the look and feel was not quite up to 
the mark. I have the functionality working just fine. I was wondering 
if I cold get my hands on a 'Login' module like www.zend.com (and other 
sites as well ) uses on their site.  i.e. the small rectangular box in 
the top frame on the right hand corner.  I am also looking at 
google.com , but have not come across anything till now. Pl let me know 
if you guys have anything, that might be useful.

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


Re: [PHP] mySQL SQL Conversion

2004-02-16 Thread Raditha Dissanayake
hi,

this is a php message board.

Logan McKinley wrote:

I am using MySQL (4.0.17) and am getting errors with the following SQL
statement originally writen for MS products.
SELECT
survey_questions.Question_ID,
First(survey_questions.Question_Text) AS FirstOfQuestion_Text, <== this line
returns errors i believe it is the AS
Avg(survey_responses.Response) AS AvgOfResponse,
Count(survey_responses.Response) AS CountOfResponse,
survey_questions.survey_num
FROM
survey_questions INNER JOIN survey_responses ON survey_questions.Question_ID
= survey_responses.QuestionID
GROUP BY survey_questions.Question_ID, survey_questions.survey_num

HAVING (((Avg(survey_responses.Response))<>-1) AND
((survey_questions.survey_num)=0));
Thanks in advance,
~Logan
 



--
Raditha Dissanayake.

http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 150 KB | with progress bar.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] mySQL SQL Conversion

2004-02-16 Thread Logan McKinley
I am using MySQL (4.0.17) and am getting errors with the following SQL
statement originally writen for MS products.

SELECT
survey_questions.Question_ID,
First(survey_questions.Question_Text) AS FirstOfQuestion_Text, <== this line
returns errors i believe it is the AS
Avg(survey_responses.Response) AS AvgOfResponse,
Count(survey_responses.Response) AS CountOfResponse,
survey_questions.survey_num

FROM
survey_questions INNER JOIN survey_responses ON survey_questions.Question_ID
= survey_responses.QuestionID

GROUP BY survey_questions.Question_ID, survey_questions.survey_num

HAVING (((Avg(survey_responses.Response))<>-1) AND
((survey_questions.survey_num)=0));

Thanks in advance,
~Logan


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



Re: [PHP] Re: phps and iis

2004-02-16 Thread zerof
Another useful resource:
http://www.php.net/manual/en/install.iis.php
-
zerof
-
"Scott Fletcher" <[EMAIL PROTECTED]> escreveu na mensagem
news:[EMAIL PROTECTED]
> Well, the instruction at macromedia website is not accurate.  It is only for
>

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



Re: [PHP] php as cgi with static libraries?

2004-02-16 Thread Marten Lehmann
Hello,

You will need to build php yourself, take a look at configure --help:

$ ./configure --help | grep static
  --enable-static[=PKGS]  build static libraries [default=yes]
that's what I already did (--enable-static=db4), but after that a 'ldd 
php' still showed me references to libdb.so. I don't want to build php 
with absolutely no dynamic libaries, only certain libaries shall be 
compiled in statically.

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


Re[4]: [PHP] problems with spam

2004-02-16 Thread Richard Davey
Hello mayo,

Monday, February 16, 2004, 3:51:30 PM, you wrote:

m> As for my email being harvested because I wrote it out
m> ([EMAIL PROTECTED]). Well I'll change it to
m> something else. :-)

There are other ways - spam bots can actually subscribe to the list
and then just reap the email address of anyone who posts. Or of course
just scan the web version of the list archives.

m> As it is members of one listserv has gotten swamped. The response there was
m> a deluge of "me too!"

I bet. It's annoying, but not as annoying as when you post to the list
and get a stack of Delivery Reports, Out of office replies, user
mailbox full errors and various other things back again from the
actual "subscribers".

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

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



RE: Re[2]: [PHP] problems with spam

2004-02-16 Thread mayo
well,

Interestingly enough I found the listserv. It's not one of the PHP lists in
case you're interested.

As for my email being harvested because I wrote it out
([EMAIL PROTECTED]). Well I'll change it to
something else. :-)

Regarding deleteing and filtering. You bet like everyone else who belongs to
numerous listservs I hit the delete button often. It wasn't surprise -- it
was trying to pinpoint the listserv and give a heads up.

As it is members of one listserv has gotten swamped. The response there was
a deluge of "me too!"


Gil Midonnet


 > -Original Message-
 > From: Richard Davey [mailto:[EMAIL PROTECTED]
 > Sent: Monday, February 16, 2004 10:46 AM
 > To: mayo
 > Cc: php-general
 > Subject: Re[2]: [PHP] problems with spam
 >
 >
 > Hello mayo,
 >
 > Monday, February 16, 2004, 3:36:55 PM, you wrote:
 >
 > m> I expected it. That's why I use a variety of email. However
 > for over a year
 > m> this address has been clean and then wham -- I get slammed.
 > To me it's an
 > m> indication that at least one of the listserv has been
 > harvested. I'm trying
 > m> to locate the listserv and contact the admin.
 >
 > There are probably spam bots out there that harvest the PHP list
 > daily. I'm not sure what you expect any listserv admin to do about it
 > though, by their very nature this is unavoidable.
 >
 > --
 > Best regards,
 >  Richard Davey
 >  http://www.phpcommunity.org/wiki/296.html
 >
 > --
 > PHP General Mailing List (http://www.php.net/)
 > To unsubscribe, visit: http://www.php.net/unsub.php
 >

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



Re[2]: [PHP] problems with spam

2004-02-16 Thread Richard Davey
Hello mayo,

Monday, February 16, 2004, 3:36:55 PM, you wrote:

m> I expected it. That's why I use a variety of email. However for over a year
m> this address has been clean and then wham -- I get slammed. To me it's an
m> indication that at least one of the listserv has been harvested. I'm trying
m> to locate the listserv and contact the admin.

There are probably spam bots out there that harvest the PHP list
daily. I'm not sure what you expect any listserv admin to do about it
though, by their very nature this is unavoidable.

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

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



Re: [PHP] PHP IDE

2004-02-16 Thread Richard Davey
Hello Alex,

Monday, February 16, 2004, 3:35:32 PM, you wrote:

AH> I was just wondering what different IDEs everyone is using and why.  I am
AH> asking to see if there are advantages in working in one over the other,
AH> other than personal preference of course.

Zend IDE 3.0.2

The biggest benefits for me:

Code Profiler - find out which parts of your code are running slowly.
Debugger - find out why.

Both accessible from the IE toolbar plugin (browse to the page/form
you want to profile and hit the button).

Very nice editor. Powerful search/replace (although no better than
Homesites which is what DW uses IIRC). Syntax checker, good Project
and CVS support, auto-complete and the very very useful function
in-sight feature which will give you pop-up suggestions to finish off
your function - i.e. type in "str" and as well as showing you stuff
like striptags or str_replace it'll also should you any functions you
have that start with "str" (stream_file for example). This is very
neat in big projects with loads of functions. Works across classes
too.

It's quite expensive, but the code profiler has paid for itself
several times over already and hey - it's by Zend, so you're kinda
supporting PHPs future too in a way.

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

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



RE: [PHP] problems with spam

2004-02-16 Thread mayo

I expected it. That's why I use a variety of email. However for over a year
this address has been clean and then wham -- I get slammed. To me it's an
indication that at least one of the listserv has been harvested. I'm trying
to locate the listserv and contact the admin.

Gil Midonnet


 > -Original Message-
 > From: Stuart [mailto:[EMAIL PROTECTED]
 > Sent: Monday, February 16, 2004 9:49 AM
 > To: mayo
 > Cc: php-general
 > Subject: Re: [PHP] problems with spam
 >
 >
 > mayo wrote:
 > > Has anybody else been getting spammed with penis and breast
 > enlargeners to
 > > their listserv email?
 >
 > Always.
 >
 > > I use [EMAIL PROTECTED] solely for listservs and in the
 > past week I've
 > > started getting 5-10 spams a day.
 >
 > What did you expect when you posted to a public mailing list?
 >
 > --
 > Stuart
 >
 > --
 > PHP General Mailing List (http://www.php.net/)
 > To unsubscribe, visit: http://www.php.net/unsub.php
 >

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



[PHP] PHP IDE

2004-02-16 Thread Alex Hogan
Hi All,

 

I was just wondering what different IDEs everyone is using and why.  I am
asking to see if there are advantages in working in one over the other,
other than personal preference of course.

 

I currently work in DW MX 04.  But I would like to know the pros and cons in
the others being used in production environments.

 

 

 

Thanks,

 

alex hogan

 



** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




Re[4]: [PHP] isset() question

2004-02-16 Thread Richard Davey
Hello Jason,

Monday, February 16, 2004, 2:21:01 PM, you wrote:

>> Consistency.
JW> With what? With whose idea of style/formatting?

If you hadn't chopped off the rest of my paragraph you'd have the
answer.

JW> I doubt you will find consistency in the real between different 
JW> programmers/organisations. If such consistency was there then PHP would've
JW> have only had to support a single formatting style/syntax.

You won't, but you will find standards that some people adhere to. Feel
free to do whatever you like, I don't have to debug your code so it
doesn't bother me :)

JW> To me the alternative of escaping in and out of php over 3 or more lines is
JW> even more of a mess.

How is clearly structured code a mess? The line count is irrelevant.
Your preferred version is a scramble of tags and code, mine is clearly
defined per line, works in my IDE of choice (as well as others with
brace matching) and follows the attempts out there of PHP coding standards
(mostly inherited from the C++ fraternity). That's why *I* like it.

We're not going to agree on this, but you're still wrong in saying the
version I posted is "messy"; it couldn't get any cleaner even in an
html escaping context. Each to their own.

JW> It should be judged by its substance (ie the other factors) and not style. All

That's like saying a piece of art should not be judged in its use of
colour, but on the image itself - when in actual fact, they're both
as important as each other.

Children (and indeed adults) pick up bad writing habits by reading
"sloppy" prose, you implicitly learn the style in-front of you even if
the message itself comes across loud and clear. I see no difference
with code. You're saying "if it works, what does it matter what it
looks like". I don't agree, it matters a lot.

JW> Good coding techniques/practices/styles have their own books.

Everything has its own book, that doesn't mean it shouldn't be
encouraged/implied in the more "beginner" titles out there. It's their
responsibility as well. They should teach how to avoid spaghetti
coding and how to structure code so you can return to it a few years
down the line and not think "wtf is going on here?".

JW> Just as you can't judge a book by its cover, you should not judge a
JW> programming language book by its coding style.

We can leave this here because this will continue going around in
circles - but I strongly disagree. You can tell a LOT about the
overall quality of a script by its coding style and structure - just
because its printed in the pages of book I see no reason why they
should be treated any differently.

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

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



Re: [PHP] How to access $_GET while using mod_rewrite

2004-02-16 Thread Chris Hayes



I am using mod_rewrite which makes it impossible to use the $_GET function.
that depends...
if you would translate the fake url
  www.yoursite.org/par1/val1/parameter2/value2
to
  www.yoursite.org?page.php?par1=val1¶meter2=value2
you are ready.
Check the net for quite some examples.
Here is what it looks like:
cc=br&pr=04&lcarray=1&idarray=816083
Has anybody an idea on how to put this into an array to make it accesible 
like this:

$para[cc]
$para[pr]
etc.
Ok if you want to do it that way, what about this idea:

$array1= explode ('&','cc=br&pr=04&lcarray=1&idarray=816083');
then walk through array 1
and for each item in it array1
{
list ($key,$val)=explode ('=',$array1[$i]);
$$key=$val;
}
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] How to access $_GET while using mod_rewrite

2004-02-16 Thread Ford, Mike [LSS]
On 16 February 2004 15:19, Merlin wrote:

> Hi there,
> 
> I am using mod_rewrite which makes it impossible to use the $_GET
> function. 
> 
> However, it should be possible to do the same with a function.
> 
> I figured out how to get the parameter string out of the url, now I am
> stuck in splitting those values into associated array elements.
> 
> Here is what it looks like:
> cc=br&pr=04&lcarray=1&idarray=816083
> 
> Has anybody an idea on how to put this into an array to make it
> accesible like this: 
> 
> $para[cc]
> $para[pr]
> etc.

Try parse_str() (http://www.php.net/parse-str).

Cheers!

Mike

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

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



[PHP] PHP + Oracle and UK locale

2004-02-16 Thread Harry Sufehmi
(Redirected by "Harry Sufehmi" <[EMAIL PROTECTED]>)

First sorry if this email was already received by you, I sent this originally on the 
weekend but didn't seem to be showing up in the list, so trying to repost again today.

I've setup phpBB in my company using Oracle as its backend. Everyone's happy with it, 
but there's one small annoyance - the pound sign (british currency symbol) kept on 
getting stored as hash sign (#).

Anyone encountered this problem before?

I've tried a lot of things - searching on web and newsgroups (not easy when everyone 
else referred to pound sign and it turned out to be the hash sign..!), installed the 
latest version of PHP, setting up the proper environment variable (especially 
NLS_LANG="ENGLISH.UNITED KINGDOM.UTF8") in .profile & httpd.conf & using putenv() in 
the script itself, and so on - still no joy.

The database itself uses UTF8 charset and AMERICA.AMERICAN locale.

If I use sqlplus, it's correctly entered as the pound sign. But using a PHP test 
script, it was still fine just before it's submitted to Oracle, INSERT it, then it's 
suddenly turned into hash.

Please feel free to enlighten me on this matter.


Thanks!
Harry

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



[PHP] How to access $_GET while using mod_rewrite

2004-02-16 Thread Merlin
Hi there,

I am using mod_rewrite which makes it impossible to use the $_GET function.

However, it should be possible to do the same with a function.

I figured out how to get the parameter string out of the url, now I am 
stuck in splitting those values into associated array elements.

Here is what it looks like:
cc=br&pr=04&lcarray=1&idarray=816083
Has anybody an idea on how to put this into an array to make it 
accesible like this:

$para[cc]
$para[pr]
etc.
Thanx for any ideas on that,

Merlin

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


Re: [PHP] problems with spam

2004-02-16 Thread Stuart
Stuart wrote:
mayo wrote:
What did you expect when you posted to a public mailing list?
Oh, and it's worth mentioning that you've made that address an easier 
target by including it in the body of the message. It means that email 
harvesters that miss the encoded ones in archives will probably get it 
now. For example: 
http://marc.theaimsgroup.com/?l=php-general&m=107694254623812&w=2

HAND! :)

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


Re: [PHP] problems with spam

2004-02-16 Thread Marek Kilimajer
mayo wrote:

Has anybody else been getting spammed with penis and breast enlargeners to
their listserv email?
I use [EMAIL PROTECTED] solely for listservs and in the past week I've
started getting 5-10 spams a day.
Gil Midonnet

Set up a filter that will delete all emails not containing [PHP], 
[another-list] etc in the subject line. And you are done :)

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


Re: [PHP] problems with spam

2004-02-16 Thread Stuart
mayo wrote:
Has anybody else been getting spammed with penis and breast enlargeners to
their listserv email?
Always.

I use [EMAIL PROTECTED] solely for listservs and in the past week I've
started getting 5-10 spams a day.
What did you expect when you posted to a public mailing list?

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


  1   2   >