[PHP] Securing areas of a web site with PHP

2003-01-01 Thread Jean-Christian Imbeault
On my web site there are some areas that I want to make accessible only 
after a user has logged in (for example when placing an order, etc ...) 
I have been able to achieve this however I have the following problem:

1- user logs in
2- user goes to restricted area
3- user views pages, orders an item, changes his account settings, etc ...
4- user logs out
5- user is sent to log out page
6- user hits back button ...

And here my problems start ... even though the user has logged out, all 
the restricted pages he saw are still cached by his browser and 
accessible ...

I have tried using a script that checks a session variable that 
indicates if a user is logged in or not and take appropriate action at 
the start of all restricted pages, but that doesn't work since when 
the user hits the back button, the PHP script is not re-executed, the 
page is simply loaded from the browser cache.

What are some PHP techniques I could use so that a user can no longer 
access/use pages once he has logged out?

Basically I would like to have sort of state machine so I that I can 
simply check where a user is coming from and his login state to decide 
if a certain page should be presented or not (i.e. you can't get here 
form there or you can't view that page with your current login status).

But it seemed that creating a state machine is not the right way to go 
about it since hitting the back button pretty much allows a user to 
circumvent this ...

Eventually the web site I will build will actually have many areas, 
each needing a separate/different login, (and you can be logged in to 
multiple areas at once) so I would like to be able to generalize this 
problem and understand how I can use PHP to implement the needed 
functionality.

Just as a simple example, once a user has placed an order, he should not 
be able to go back to the order placing/processing pages ...

Any tips, hints, or pointers to tutorials are appreciated!

Thanks,

Jc


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



[PHP] Need Help.

2003-01-01 Thread thkiat
Hi, I'm a newbie for PHP. Just installed IIS  PHP on my PC. A test run gave me this:-
Warning: main(quote.php) [function.main]: failed to create stream: No such file or 
directory in C:\Documents and Settings\aaa\My Documents\My 
Webs\excelpoint.org\index.php on line 139

Warning: main() [function.main]: Failed opening 'quote.php' for inclusion 
(include_path='.;c:\php4\pear') in C:\Documents and Settings\aaa\My Documents\My 
Webs\excelpoint.org\index.php on line 139

Somehow, I don't have this problem when I run this file on my remote webserver.

Please advise. TQ!!!



[PHP] error on include_path=(''c:\php4\pear)

2003-01-01 Thread anand
hi friends
i find some problem in installing this script
it gives me same error in both IIS and apache server it is like below

Fatal error: Failed opening required '/home/phpshop/etc/phpshop.cfg'
(include_path=''c:\php4\pear) in
c:\nusphere\apache\nsdocs\phpshop\bin\index.php on line 19
and in apache it is like

Fatal error: Failed opening required '/home/phpshop/etc/phpshop.cfg'
(include_path='') in c:\nusphere\apache\nsdocs\phpshop\bin\index.php on line
19

where i have php 4.2.3 version
even on my system there is no any directory like php4/pear why it shows me
this error.




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




[PHP] Re: Securing areas of a web site with PHP

2003-01-01 Thread Tularis
Jean-Christian Imbeault wrote:

1- user logs in
2- user goes to restricted area
3- user views pages, orders an item, changes his account settings, etc ...
4- user logs out
5- user is sent to log out page
6- user hits back button ...

And here my problems start ... even though the user has logged out, all 
the restricted pages he saw are still cached by his browser and 
accessible ...

I have tried using a script that checks a session variable that 
indicates if a user is logged in or not and take appropriate action at 
the start of all restricted pages, but that doesn't work since when 
the user hits the back button, the PHP script is not re-executed, the 
page is simply loaded from the browser cache.

What are some PHP techniques I could use so that a user can no longer 
access/use pages once he has logged out?


I adives to make sure the browser doesn't cache it *at all*.
This can be done using (one, or more) of the following headers:

// HTTP 1.1 compliant:
header(Cache-Control: no-store, no-cache, must-revalidate);
header(Cache-Control: post-check=0, pre-check=0, false);
// HTTP 1.0 compliant:
header(Pragma: no-cache);

Hope that helps,
- Tularis


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




[PHP] Re: Securing areas of a web site with PHP

2003-01-01 Thread Jean-Christian Imbeault
Tularis wrote:


I adives to make sure the browser doesn't cache it *at all*.
This can be done using (one, or more) of the following headers:

// HTTP 1.1 compliant:
header(Cache-Control: no-store, no-cache, must-revalidate);
header(Cache-Control: post-check=0, pre-check=0, false);
// HTTP 1.0 compliant:
header(Pragma: no-cache);


I'll try this out and see what I get. Though I have read that not all 
browsers follow cache-control directives ...

This would cause the load on my web server to increase for those pages 
though ... might there be another way?

If not then it will have to do ...

Thanks for the advice!

Jc


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



Re: [PHP] Re: loading a db table into a php array from mysql

2003-01-01 Thread David T-G
Rick, et al --

...and then Rick Widmer said...
% 
% At 02:57 PM 12/31/02 -0500, David T-G wrote:
% ...and then Tularis said...
% %
% % Usually,
% % using mysql to handle your tables is *way* faster than letting php
% % handle it.
% 
% Yes, do as much as you can in the database.  The people who wrote it spent 
% a lot of time trying to optimize it.

Yeah :-)


% 
% % In your case, you could just do a complex join I think. That would give
% 
% Ahhh...  A new term.  Back to the books for me!
% 
% Here is a query from one of my projects...
...

Wow.  Some piece of work.


% 
% Every field in the Schedule table is a key to another table that has to be 
% looked up and translated to something people will understand.  Note the two 

Exactly my situation (by design; I at least know that I wouldn't want to
store a name string in the schedule again and again and again :-)


% different ways of connecting tables with LEFT JOIN.  USING( fieldname ) 
% connects the  table being joined, with the table listed right before it, 
% using the same fieldname in both.  The ON syntax allows you to use 
% differently named fields, and/or a different table.

I still don't get what a left or right or outer or inner join is...  I've
read the mysql docs for the syntax and some examples, but this is a place
where I'll need to go to outside tutorials.  Do you know of any (on the
web) which will give me the background?


TIA  Thanks for the example  Happy New Year

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




msg91180/pgp0.pgp
Description: PGP signature


RE: [PHP] makeing an array

2003-01-01 Thread Sean Malloy
why the $x variable aswell?!

for ($i = 0; $i  count($comment); $i++)
{
echo $comment[$i].'br /';
}

or even faster:

$i = count($comment);
while ($i--)
{
echo $comment[$i].'br /';
}

 -Original Message-
 From: Timothy Hitchens (HiTCHO) [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, 1 January 2003 4:41 PM
 To: Philip J. Newman; [EMAIL PROTECTED]
 Subject: Re: [PHP] makeing an array


 Use the count like following inside to ensure that you don't
 call on a non existent index.

 for ($i = 0, $x = count($comment); $i  $x; $i++)
 {
 echo $comment[$i].'br /';
 }

 Why do you want to echo out $comment_1 ???



 Timothy Hitchens (HiTCHO)
 [EMAIL PROTECTED]


 HiTCHO | Open Platform Web Development
 Consulting - Outsourcing - Training - Support


 - Original Message -
 From: Philip J. Newman [EMAIL PROTECTED]
 To: Timothy Hitchens (HiTCHO) [EMAIL PROTECTED];
 [EMAIL PROTECTED]
 Sent: Wednesday, January 01, 2003 3:29 PM
 Subject: Re: [PHP] makeing an array


  So in saything that I could do this ...
 
  $s = 10
 
  $comment[1] = '$comment_1';
  $comment[2] = '$comment_2';
  $comment[3] = '$comment_2';
 
  for($i = 0; $i = $s; $i++) {
 
   echo $comment[$i].br;
 
  }
 
 
 
  - Original Message -
  From: Timothy Hitchens (HiTCHO) [EMAIL PROTECTED]
  To: Philip J. Newman [EMAIL PROTECTED];
 [EMAIL PROTECTED]
  Sent: Wednesday, January 01, 2003 6:12 PM
  Subject: Re: [PHP] makeing an array
 
 
   Example of an Array:
  
   $my_first_array = array(1 = 'first', 2 = 'second', 3 = 'third');
  
   You can now access these like so:
  
   echo $my_first_array[1];   etc etc
  
   of if you had this:  $my_first_array = array('first_name' = 'Philip',
   'last_name' = 'Newman');
  
   You could do this:
  
   echo $my_first_array['first_name'];
  
   The thing to remember is that array's start at 0 see below!! (I
 started
  at
   1 at the top to make it easier).
  
   You can also make an array like so:
  
   $first[] = 'Philip';
   $first[] = 'John';
   $first[] = 'Paul';
  
   Now you can simply do:
  
   echo $first[0];  // this could output 'Philip';
  
   You can then look at multi dimensional etc...
  
   I trust this get's you on your way.
  
  
   Timothy Hitchens (HiTCHO)
   [EMAIL PROTECTED]
  
  
   HiTCHO | Open Platform Web Development
   Consulting - Outsourcing - Training - Support
  
  
   - Original Message -
   From: Philip J. Newman [EMAIL PROTECTED]
   To: [EMAIL PROTECTED]
   Sent: Wednesday, January 01, 2003 2:57 PM
   Subject: [PHP] makeing an array
  
  
Can someone help me make an array ...
   
I have $foo amount of loops to preform (1-20), and would
 like to make
  the
veriable work for me like $comment_1, $comment_2 etc etc.
   
http://nz.php.net/manual/en/function.array.php makes no sence to me
  after
   i
read it and read it ...
   
help me please
   
---
Philip J. Newman.
Head Developer.
PhilipNZ.com New Zealand Ltd.
http://www.philipnz.com/
[EMAIL PROTECTED]
   
Mob: +64 (25) 6144012.
Tele: +64 (9) 5769491.
   
VitalKiwi Site:
Philip J. Newman
Internet Developer
http://www.newman.net.nz/
[EMAIL PROTECTED]
   
*
  Friends are like Stars,
  You can't always see them,
  But you know they are there.
   
*
   
ICQ#: 20482482
MSN ID: [EMAIL PROTECTED]
Yahoo: [EMAIL PROTECTED]
AIM: newmanpjkiwi
   
   
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
   
  
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
  
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 


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



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




Re: [PHP] makeing an array

2003-01-01 Thread Timothy Hitchens \(HiTCHO\)
Your example of:

for ($i = 0; $i  count($comment); $i++)

Is very bad as the count will be parsed each loop.

The count as I had it gets parsed only once.


Timothy Hitchens (HiTCHO)
[EMAIL PROTECTED]


HiTCHO | Open Platform Web Development
Consulting - Outsourcing - Training - Support


- Original Message -
From: Sean Malloy [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, January 01, 2003 9:40 PM
Subject: RE: [PHP] makeing an array


 why the $x variable aswell?!

 for ($i = 0; $i  count($comment); $i++)
 {
 echo $comment[$i].'br /';
 }

 or even faster:

 $i = count($comment);
 while ($i--)
 {
 echo $comment[$i].'br /';
 }

  -Original Message-
  From: Timothy Hitchens (HiTCHO) [mailto:[EMAIL PROTECTED]]
  Sent: Wednesday, 1 January 2003 4:41 PM
  To: Philip J. Newman; [EMAIL PROTECTED]
  Subject: Re: [PHP] makeing an array
 
 
  Use the count like following inside to ensure that you don't
  call on a non existent index.
 
  for ($i = 0, $x = count($comment); $i  $x; $i++)
  {
  echo $comment[$i].'br /';
  }
 
  Why do you want to echo out $comment_1 ???
 
 
 
  Timothy Hitchens (HiTCHO)
  [EMAIL PROTECTED]
 
 
  HiTCHO | Open Platform Web Development
  Consulting - Outsourcing - Training - Support
 
 
  - Original Message -
  From: Philip J. Newman [EMAIL PROTECTED]
  To: Timothy Hitchens (HiTCHO) [EMAIL PROTECTED];
  [EMAIL PROTECTED]
  Sent: Wednesday, January 01, 2003 3:29 PM
  Subject: Re: [PHP] makeing an array
 
 
   So in saything that I could do this ...
  
   $s = 10
  
   $comment[1] = '$comment_1';
   $comment[2] = '$comment_2';
   $comment[3] = '$comment_2';
  
   for($i = 0; $i = $s; $i++) {
  
echo $comment[$i].br;
  
   }
  
  
  
   - Original Message -
   From: Timothy Hitchens (HiTCHO) [EMAIL PROTECTED]
   To: Philip J. Newman [EMAIL PROTECTED];
  [EMAIL PROTECTED]
   Sent: Wednesday, January 01, 2003 6:12 PM
   Subject: Re: [PHP] makeing an array
  
  
Example of an Array:
   
$my_first_array = array(1 = 'first', 2 = 'second', 3 = 'third');
   
You can now access these like so:
   
echo $my_first_array[1];   etc etc
   
of if you had this:  $my_first_array = array('first_name' =
'Philip',
'last_name' = 'Newman');
   
You could do this:
   
echo $my_first_array['first_name'];
   
The thing to remember is that array's start at 0 see below!! (I
  started
   at
1 at the top to make it easier).
   
You can also make an array like so:
   
$first[] = 'Philip';
$first[] = 'John';
$first[] = 'Paul';
   
Now you can simply do:
   
echo $first[0];  // this could output 'Philip';
   
You can then look at multi dimensional etc...
   
I trust this get's you on your way.
   
   
Timothy Hitchens (HiTCHO)
[EMAIL PROTECTED]
   
   
HiTCHO | Open Platform Web Development
Consulting - Outsourcing - Training - Support
   
   
- Original Message -
From: Philip J. Newman [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, January 01, 2003 2:57 PM
Subject: [PHP] makeing an array
   
   
 Can someone help me make an array ...

 I have $foo amount of loops to preform (1-20), and would
  like to make
   the
 veriable work for me like $comment_1, $comment_2 etc etc.

 http://nz.php.net/manual/en/function.array.php makes no sence to
me
   after
i
 read it and read it ...

 help me please

 ---
 Philip J. Newman.
 Head Developer.
 PhilipNZ.com New Zealand Ltd.
 http://www.philipnz.com/
 [EMAIL PROTECTED]

 Mob: +64 (25) 6144012.
 Tele: +64 (9) 5769491.

 VitalKiwi Site:
 Philip J. Newman
 Internet Developer
 http://www.newman.net.nz/
 [EMAIL PROTECTED]

 *
   Friends are like Stars,
   You can't always see them,
   But you know they are there.

 *

 ICQ#: 20482482
 MSN ID: [EMAIL PROTECTED]
 Yahoo: [EMAIL PROTECTED]
 AIM: newmanpjkiwi


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

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


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



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




RE: [PHP] How To Delete Multiple Items Of Multiple Tables Using PHP and MySQL

2003-01-01 Thread @ Nilaab
Jason, thanks, but see if you can you read the initial question and try to
answer that one for me. You are a great help with resources when I need
them. Your help is always appreciated. The origial clip is as follows
(concentrate on the ending question):



Hello Everyone,

I want to DELETE multiple items of multiple TABLES in a MySQL database. My
version of MySQL is 3.23, which means this version doesn't support the
DELETE functionality on multiple tables. The following is my PHP code, where
$item_id is a multi-dimensional array containing the ids of the many items I
want to delete from the table.

   # DELETE records
   for ($i = 0; $i  count($item_id); $i++) {
 $query_item2 .=  DELETE QUICK FROM item_dimension WHERE item_id =
'.$item_id[$i][0].'; ;
 $query_item2 .= DELETE QUICK FROM item_popup WHERE item_id =
'.$item_id[$i][0].'; ;
   }

When I run this through the database using PHP, it returns a syntax error in
the SQL. So what I did was echo out $query_item2, then copied and pasted the
SQL into the MySQL application manually, and ran it through. Well the exact
same SQL statement that I used in PHP worked when I entered it manually in
MySQL. In other words it didn't work doing it through PHP, but it worked in
MySQL directly. What gives?

Is there a better way to delete multiple items
from multiple tables with one SQL string? I don't want to separate the two
DELETE functions and run them through two separate times because of overhead
concerns. I tried looking on the MySQL and PHP website for better ways of
using DELETE syntax on multiple tables, but I had no luck finding anything
useful with my version of MySQL. Any help would be greatly appreciated.



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




Re: [PHP] How To Delete Multiple Items Of Multiple Tables Using PHPand MySQL

2003-01-01 Thread Thomas Seifert
there is no need to close and open the connection for every query.
just run the mysql_query again and again and again on the open connection.
Still Stephen's quote is true, you can't run more than one query by one call to 
mysql_query.


Thomas

On Tue, 31 Dec 2002 16:30:38 -0600 [EMAIL PROTECTED] (@ Nilaab) wrote:

 I was hoping for better news. Thanks for the suggestion, but it will put a
 very big strain on my application since every DELETE query will open and
 close the mysql connection everytime. Think about deleting 100s of records
 one at a time. Surely someone has thought of a better way to do this with
 MySQL 3.23. Also, I don't want to run persistent connections, as I only have
 a limited number of simultaneous connections to the database currently. Is
 there a better way to do all this? Anyone?
 
  -Original Message-
  From: Stephen [mailto:[EMAIL PROTECTED]]
  Sent: Tuesday, December 31, 2002 1:10 PM
  To: @ Nilaab
  Cc: PHP List
  Subject: Re: [PHP] How To Delete Multiple Items Of Multiple Tables Using
  PHP and MySQL
 
 
  From experience, I don't think you can run more then one SQL statement at
  once in a single time. Try assigning each variable with delete, then query
  them all seperately. I also don't think you need the ; in the SQL
  statement...
 
 
  - Original Message -
  From: @ Nilaab [EMAIL PROTECTED]
  To: Php-General [EMAIL PROTECTED]
  Sent: Tuesday, December 31, 2002 1:36 PM
  Subject: [PHP] How To Delete Multiple Items Of Multiple Tables
  Using PHP and
  MySQL
 
 
  : Hello Everyone,
  :
  : I want to DELETE multiple items of multiple TABLES in a MySQL
  database. My
  : version of MySQL is 3.23, which means this version doesn't support the
  : DELETE functionality on multiple tables. The following is my PHP code,
  where
  : $item_id is a multi-dimensional array containing the ids of the items I
  want
  : to delete from the table.
  :
  :# DELETE records
  :for ($i = 0; $i  count($item_id); $i++) {
  :  $query_item2 .=  DELETE QUICK FROM item_dimension WHERE item_id =
  : '.$item_id[$i][0].'; ;
  :  $query_item2 .= DELETE QUICK FROM item_popup WHERE item_id =
  : '.$item_id[$i][0].'; ;
  :}
  :
  : When I run this through the database using PHP, it returns a
  syntax error
  in
  : the SQL. So what I did was echo out $query_item2, then copied and pasted
  the
  : SQL into the MySQL application manually, and ran it through. Well the
  exact
  : same SQL statement that I used in PHP worked when I entered it
  manually in
  : MySQL. In other words it didn't work doing it through PHP, but it worked
  in
  : MySQL directly. What gives? Is there a better way to delete
  multiple items
  : from multiple tables with one SQL string? I don't want to
  separate the two
  : DELETE functions and run them through two separate times because of
  overhead
  : concerns. I tried looking on the MySQL and PHP website for
  better ways of
  : using DELETE syntax on multiple tables, but I had no luck
  finding anything
  : useful with my version of MySQL. Any help would be greatly appreciated.
  :
  :
  : --
  : PHP General Mailing List (http://www.php.net/)
  : To unsubscribe, visit: http://www.php.net/unsub.php
  :
  :
  :
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 

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




[PHP] Windows XP

2003-01-01 Thread Stephen



Ok, this is very off topic but this is strange. I woke up this 
morning and turned on my computer like always, only today to find my normal 
Windows XP theme to be changed to the classic style and the normal style is 
gone, I can't change it back. Any ideas why and how to fix it 
maybe?

Oh, and happy new years from Indiana! ^_^
Thanks,Stephen Cratonhttp://www.melchior.us

"What's the point in appearance if your true love, doesn't care about it?" 
-- http://www.melchior.us
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] call_user_method_array

2003-01-01 Thread Boget, Chris
How does this function really work?  I've been
beating my head against the wall for the last
8 hours trying to figure it out.  This is what
I'm trying and it isn't working:
{this is a very simplified version}

class MyClass {
  function myFunc( $stringVar, $arrayVar ) {
echo $stringVarbr\n;
echo pre\n;
print_r( $arrayVar );
echo /pre\n;

  }
}

$myClass = new MyClass();

$myStringVar = Hello!;
$myArrayVar  = array( this = that );

call_user_method_array( 'myFunc', 
$myClass,
array( $myStringVar, $myArrayVar ));

What's happening is that the values in the array 
are not being passed individually but instead is
being passed as an array.  Shouldn't it be passing
them individually?  If not, it wouldn't seem as if
you could use this function generically.  You'd have
to specificy write your method so it can (possibly)
be called by this function.  And that just doesn't
seem right.

Any light anyone can shed on this would be very much
appreciated!!

Chris



Re: [PHP] Securing areas of a web site with PHP

2003-01-01 Thread Michael J. Pawlowsky
It's not a PHP thing but a browser thing. Basically you need to expire a page as soon 
as the browser has loaded it.
This can be done using the meta key expires.


meta http-equiv=Expires content=expiration date

As in

META HTTP-EQUIV=Expires CONTENT=Mon, 01 Jan 1996 01:01:01 GMT


If you are running an IIS server look at the server properties...  you need to enable 
this in there.




*** REPLY SEPARATOR  ***

On 01/01/2003 at 5:22 PM Jean-Christian Imbeault wrote:

On my web site there are some areas that I want to make accessible only
after a user has logged in (for example when placing an order, etc ...)
I have been able to achieve this however I have the following problem:

1- user logs in
2- user goes to restricted area
3- user views pages, orders an item, changes his account settings, etc ...
4- user logs out
5- user is sent to log out page
6- user hits back button ...

And here my problems start ... even though the user has logged out, all
the restricted pages he saw are still cached by his browser and
accessible ...

I have tried using a script that checks a session variable that
indicates if a user is logged in or not and take appropriate action at
the start of all restricted pages, but that doesn't work since when
the user hits the back button, the PHP script is not re-executed, the
page is simply loaded from the browser cache.

What are some PHP techniques I could use so that a user can no longer
access/use pages once he has logged out?

Basically I would like to have sort of state machine so I that I can
simply check where a user is coming from and his login state to decide
if a certain page should be presented or not (i.e. you can't get here
form there or you can't view that page with your current login status).

But it seemed that creating a state machine is not the right way to go
about it since hitting the back button pretty much allows a user to
circumvent this ...


Eventually the web site I will build will actually have many areas,
each needing a separate/different login, (and you can be logged in to
multiple areas at once) so I would like to be able to generalize this
problem and understand how I can use PHP to implement the needed
functionality.

Just as a simple example, once a user has placed an order, he should not
be able to go back to the order placing/processing pages ...

Any tips, hints, or pointers to tutorials are appreciated!

Thanks,

Jc


--
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] Windows XP

2003-01-01 Thread Mat Harris
Stephen wrote:

Ok, this is very off topic but this is strange. I woke up this morning 
and turned on my computer like always, only today to find my normal 
Windows XP theme to be changed to the classic style and the normal style 
is gone, I can't change it back. Any ideas why and how to fix it maybe?
 
Oh, and happy new years from Indiana! ^_^

Thanks,
Stephen Craton
http://www.melchior.us
 
What's the point in appearance if your true love, doesn't care about 
it? -- http://www.melchior.us


off topic isn't the word, and please don't send mails is 'fancy mode'

--
--
Mat Harrison			Network Systems Administrator
[EMAIL PROTECTED]	www.genestate.com



msg91188/pgp0.pgp
Description: PGP signature


[PHP] Re: Securing areas of a web site with PHP

2003-01-01 Thread michael kimsal
Jean-Christian Imbeault wrote:



I'll try this out and see what I get. Though I have read that not all 
browsers follow cache-control directives ...

Exactly - and some don't follow other HTTP header directives to the 
letter either.  You will not be able to 'secure' this stuff 100% simply
because you only control 50% of the environment (the server, not the 
client).  The cache-control stuff people have already replied is good, 
but realize nothing's 100%.  You also can't prevent someone from taking 
a snapshot of the page, or control who sees a piece of paper with the 
information printed on it either.  :)




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



Re: [PHP] call_user_method_array

2003-01-01 Thread Marco Tabini
Chris--

On my system, the function works as expected (at least as I understand
it): myFunc receives the parameters Hello! and array(this=that),
which is what you pass to it in the first place. Were you expecting it
to expand $myArrayVar into individual parameters? If so, that's not how
it works--it expands the values of the array you pass to it (which, in
this case, you build explicitly during the call), but doesn't expand any
arrays that may be within that array.

Also, call_user_method_array is now deprecated--you should use
call_user_func_array instead (the manual page for call_user_method_array
explains how to do this with a class method).

Cheers,


Marco
-- 

php|architect - The Monthly Magazine for PHP Professionals
Come check us out on the web at http://www.phparch.com!

---BeginMessage---
How does this function really work?  I've been
beating my head against the wall for the last
8 hours trying to figure it out.  This is what
I'm trying and it isn't working:
{this is a very simplified version}

class MyClass {
  function myFunc( $stringVar, $arrayVar ) {
echo $stringVarbr\n;
echo pre\n;
print_r( $arrayVar );
echo /pre\n;

  }
}

$myClass = new MyClass();

$myStringVar = Hello!;
$myArrayVar  = array( this = that );

call_user_method_array( 'myFunc', 
$myClass,
array( $myStringVar, $myArrayVar ));

What's happening is that the values in the array 
are not being passed individually but instead is
being passed as an array.  Shouldn't it be passing
them individually?  If not, it wouldn't seem as if
you could use this function generically.  You'd have
to specificy write your method so it can (possibly)
be called by this function.  And that just doesn't
seem right.

Any light anyone can shed on this would be very much
appreciated!!

Chris

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


RE: [PHP] call_user_method_array

2003-01-01 Thread Boget, Chris
 On my system, the function works as expected (at least as I 
 understand it): myFunc receives the parameters Hello! and 
 array(this=that), which is what you pass to it in the 
 first place. 

See, that's not what I'm getting... :|

 Were you expecting it to expand $myArrayVar into individual 
 parameters? 

No.  Just pass those parameters by value, just as they are.

 Also, call_user_method_array is now deprecated--you should 
 use call_user_func_array instead 

This isn't my choice.  What I'm trying to do is use the PEAR
Cache class.  Actually, one of the containers therein.  And
the class is using call_user_method_array().  Sure, I could
change it manually but if I ever upgrade PEAR, all my changes 
are gone.  As such, I'm just leaving as is.

The functionality I'm trying to create is to cache a call to
a SOAP service.  It seems like it should be easy enough since
I'm just caching a call to a method of the SOAP class I'm using.
To see exactly what I'm doing, you can go do the following page:

http://www.melancholy.org/test/xml/soap/soap_client.phps

and to run the page to see the results, just remove the trailing
's'.  The SOAP service is here:

http://www.melancholy.org/test/xml/soap/db_service.phps.

And if you aren't familiar with PEAR, you can see the class I'm
trying to use here:

http://pear.php.net/package-info.php?pacid=40

Anyways, what's happening in the Cache_Function class is that
it's executing this line of code:

$result = call_user_method_array($method, $$object, $arguments);

using the values I pass on this line of my soap_client.php script:

$xmlStr = $cache-call( 'soapclient-call', array( 'returnRecordXML',
$parameters ));

call is the $method, soapclient is the object and the above
defined array is arguments.  However, as you can see when you
go to the soapclient.php page, arguments is being passed as an
array and not as the individual elements of the array.

And I can't figure out why... :|

If you or anyone else can tell me what's going on, I'd be very happy
to hear!

Chris



Re: [PHP] Need Help.

2003-01-01 Thread Jason Sheets
Your include path is not setup so that the web server can find the file
you are trying to include, if the file is in a sub directory make sure
you are properly including it include_once('include/main.php') not just
include_once('main.php').

And make sure the file you are trying to include exists in the location
you think it does.

Jason
On Wed, 2003-01-01 at 01:28, thkiat wrote:
 Hi, I'm a newbie for PHP. Just installed IIS  PHP on my PC. A test run gave me 
this:-
 Warning: main(quote.php) [function.main]: failed to create stream: No such file or 
directory in C:\Documents and Settings\aaa\My Documents\My 
Webs\excelpoint.org\index.php on line 139
 
 Warning: main() [function.main]: Failed opening 'quote.php' for inclusion 
(include_path='.;c:\php4\pear') in C:\Documents and Settings\aaa\My Documents\My 
Webs\excelpoint.org\index.php on line 139
 
 Somehow, I don't have this problem when I run this file on my remote webserver.
 
 Please advise. TQ!!!


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




[PHP] error when conecting to mysql

2003-01-01 Thread Paul Roberts
Hi

my server started reporting an error when connecting to mysql

Warning: Can't connect to local MySQL server through socket 
'/var/lib/mysql/mysql.sock' (2) 
in /path/to/web//login.php on line 35 

it's happened a few times now and I'm wondering if it's me or a problem on the server 
(shared, I'm on a virtual host, Cobalt raq, apache )

any pointers to what might could cause the error.

Best Wishes  Happy New Year

Paul Roberts
[EMAIL PROTECTED]




Re: [PHP] error when conecting to mysql

2003-01-01 Thread Michael J. Pawlowsky

Sound like your ISP is at fault.

MySql is not acceptind any more connection perhaps.


Mike


*** REPLY SEPARATOR  ***

On 01/01/2003 at 4:28 PM Paul Roberts wrote:

Hi

my server started reporting an error when connecting to mysql

Warning: Can't connect to local MySQL server through socket
'/var/lib/mysql/mysql.sock' (2)
in /path/to/web//login.php on line 35

it's happened a few times now and I'm wondering if it's me or a problem on
the server (shared, I'm on a virtual host, Cobalt raq, apache )

any pointers to what might could cause the error.

Best Wishes  Happy New Year

Paul Roberts
[EMAIL PROTECTED]






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




Re: [PHP] Php 4.3.0 and Mail() function

2003-01-01 Thread Carl Bélanger
Exactly!!

checking for sendmail... no

I've browsed the configure's help and I can't find an option to specify 
the path to sendmail (which is not at a regular place as we run qmail). 
Is the a --with-sendmail-path option or something like that?

Thanks a lot!

Carl

Rick Widmer wrote:

At 10:11 AM 12/31/02 -0500, Carl Bélanger wrote:


I just upgraded to php 4.3.0 and all by bulletin board are now 
returning error about the mail function:

Fatal error: Call to undefined function: mail() in 
/var/wwwx/htdocs/forum/private.php on line 687


What could be missing?



./configure looks for sendmail if it is not found the mail function is 
not compiled in, resulting in the undefined function call.  Mine is in 
/usr/sbin/sendmail.  Grep the results of ./configure for 'sendmail' to 
see what happened.


  ./configure ...  tempfile

  grep sendmail tempfile


Rick






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




php-general Digest 1 Jan 2003 17:26:29 -0000 Issue 1797

2003-01-01 Thread php-general-digest-help

php-general Digest 1 Jan 2003 17:26:29 - Issue 1797

Topics (messages 129824 through 129854):

Re: makeing an array
129824 by: Timothy Hitchens \(HiTCHO\)
129826 by: Philip J. Newman
129827 by: Timothy Hitchens \(HiTCHO\)
129840 by: Sean Malloy
129841 by: Timothy Hitchens \(HiTCHO\)

Re: Serializing a DOM object
129825 by: Tom Rogers

Re: PHP3 + session handling limitation
129828 by: Dan Rossi
129829 by: Dan Rossi
129830 by: Tom Rogers
129831 by: Justin French

Re: Alternatives for Meta Refresh
129832 by: Justin French
129833 by: Timothy Hitchens \(HiTCHO\)

Securing areas of a web site with PHP
129834 by: Jean-Christian Imbeault
129837 by: Tularis
129838 by: Jean-Christian Imbeault
129846 by: Michael J. Pawlowsky
129848 by: michael kimsal

Need Help.
129835 by: thkiat
129851 by: Jason Sheets

error on include_path=(''c:\php4\pear)
129836 by: anand.texsurat.com

Re: loading a db table into a php array from mysql
129839 by: David T-G

Re: How To Delete Multiple Items Of Multiple Tables Using PHP and MySQL
129842 by: . Nilaab
129843 by: Thomas Seifert

Windows XP
129844 by: Stephen
129847 by: Mat Harris

call_user_method_array
129845 by: Boget, Chris
129849 by: Marco Tabini
129850 by: Boget, Chris

error when conecting to mysql
129852 by: Paul Roberts
129853 by: Michael J. Pawlowsky

Re: Php 4.3.0 and Mail() function
129854 by: Carl Bélanger

Administrivia:

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

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

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


--

---BeginMessage---
Example of an Array:

$my_first_array = array(1 = 'first', 2 = 'second', 3 = 'third');

You can now access these like so:

echo $my_first_array[1];   etc etc

of if you had this:  $my_first_array = array('first_name' = 'Philip',
'last_name' = 'Newman');

You could do this:

echo $my_first_array['first_name'];

The thing to remember is that array's start at 0 see below!! (I started at
1 at the top to make it easier).

You can also make an array like so:

$first[] = 'Philip';
$first[] = 'John';
$first[] = 'Paul';

Now you can simply do:

echo $first[0];  // this could output 'Philip';

You can then look at multi dimensional etc...

I trust this get's you on your way.


Timothy Hitchens (HiTCHO)
[EMAIL PROTECTED]


HiTCHO | Open Platform Web Development
Consulting - Outsourcing - Training - Support


- Original Message -
From: Philip J. Newman [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, January 01, 2003 2:57 PM
Subject: [PHP] makeing an array


 Can someone help me make an array ...

 I have $foo amount of loops to preform (1-20), and would like to make the
 veriable work for me like $comment_1, $comment_2 etc etc.

 http://nz.php.net/manual/en/function.array.php makes no sence to me after
i
 read it and read it ...

 help me please

 ---
 Philip J. Newman.
 Head Developer.
 PhilipNZ.com New Zealand Ltd.
 http://www.philipnz.com/
 [EMAIL PROTECTED]

 Mob: +64 (25) 6144012.
 Tele: +64 (9) 5769491.

 VitalKiwi Site:
 Philip J. Newman
 Internet Developer
 http://www.newman.net.nz/
 [EMAIL PROTECTED]

 *
   Friends are like Stars,
   You can't always see them,
   But you know they are there.

 *

 ICQ#: 20482482
 MSN ID: [EMAIL PROTECTED]
 Yahoo: [EMAIL PROTECTED]
 AIM: newmanpjkiwi


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



---End Message---
---BeginMessage---
So in saything that I could do this ...

$s = 10

$comment[1] = '$comment_1';
$comment[2] = '$comment_2';
$comment[3] = '$comment_2';

for($i = 0; $i = $s; $i++) {

 echo $comment[$i].br;

}



- Original Message -
From: Timothy Hitchens (HiTCHO) [EMAIL PROTECTED]
To: Philip J. Newman [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Wednesday, January 01, 2003 6:12 PM
Subject: Re: [PHP] makeing an array


 Example of an Array:

 $my_first_array = array(1 = 'first', 2 = 'second', 3 = 'third');

 You can now access these like so:

 echo $my_first_array[1];   etc etc

 of if you had this:  $my_first_array = array('first_name' = 'Philip',
 'last_name' = 'Newman');

 You could do this:

 echo $my_first_array['first_name'];

 The thing to remember is that array's start at 0 see below!! (I started
at
 1 at the top to make it easier).

 You can also make an array like so:

 $first[] = 'Philip';
 $first[] = 'John';
 $first[] = 'Paul';

 Now you can simply do:

 echo $first[0];  // this could output 'Philip';

 You can then look at multi dimensional etc...

 I trust this get's you on your way.


 Timothy Hitchens (HiTCHO)
 [EMAIL PROTECTED]


 

Re: [PHP] Php 4.3.0 and Mail() function

2003-01-01 Thread Jason Wong
On Thursday 02 January 2003 01:26, Carl Bélanger wrote:
 Exactly!!

 checking for sendmail... no

 I've browsed the configure's help and I can't find an option to specify
 the path to sendmail (which is not at a regular place as we run qmail).
  Is the a --with-sendmail-path option or something like that?

qmail comes with a wrapper called sendmail which emulates sendmail. I'm not 
sure where php's configure expects to find sendmail but you can try 
copying/linking the wrapper to /usr/lib and/or /usr/sbin.

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

/*
While my BRAINPAN is being refused service in BURGER KING, Jesuit
priests are DATING CAREER DIPLOMATS!!
*/


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




Re: [PHP] How To Delete Multiple Items Of Multiple Tables Using PHP and MySQL

2003-01-01 Thread Jason Wong
On Wednesday 01 January 2003 20:14, [EMAIL PROTECTED] wrote:
 Jason, thanks, but see if you can you read the initial question and try to
 answer that one for me. You are a great help with resources when I need
 them. Your help is always appreciated. The origial clip is as follows
 (concentrate on the ending question):

OK concentrating on the last paragraph ...

 Is there a better way to delete multiple items
 from multiple tables with one SQL string? I don't want to separate the two
 DELETE functions and run them through two separate times because of
 overhead concerns. I tried looking on the MySQL and PHP website for better
 ways of using DELETE syntax on multiple tables, but I had no luck finding
 anything useful with my version of MySQL. Any help would be greatly
 appreciated.

..., unfortunately that's not possible. Each DELETE statement can only delete 
from a single table.

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

/*
You show me an American who can keep his mouth shut and I'll eat him.
-- Newspaperman from Frank Capra's _Meet_John_Doe_
*/


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




[PHP] Re: Securing areas of a web site with PHP

2003-01-01 Thread David Tandberg-Johansen
[CUT]

I am using SESSION on al my secure projects
I use a file structur as this:
(loginform) - logincheck.php (if not ok-back2login | if ok (start an
session)(forward to the secure pages))

When the user logs out:
(securepages)-logout.php:
?PHP
//go through all the session array an unregister the varname
foreach($_SESSION as $key=$val){
session_unregister($key);
}
// We destroys the session
session_destroy();

//if there are an cookie vith the session name we have to unset it
//so the browser doesn't hvae the information
if(isset($_COOKIE[session_name()])){
// To delete the old cookie
unset($_COOKIE[session_name()]);
}
//we starts an new session
session_start();
//and we destroys it again
session_destroy();
//Now there are an new session cookie in the browser,
//and if the user try go back there are no data stored in the session

//we forward the user to an unsecure public page
header(Location: ./unsecurepublicpage.php);
?



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




Re: [PHP] Re: Securing areas of a web site with PHP

2003-01-01 Thread Jason Wong
On Wednesday 01 January 2003 19:24, Jean-Christian Imbeault wrote:
 Tularis wrote:
  I adives to make sure the browser doesn't cache it *at all*.
  This can be done using (one, or more) of the following headers:
 
  // HTTP 1.1 compliant:
  header(Cache-Control: no-store, no-cache, must-revalidate);
  header(Cache-Control: post-check=0, pre-check=0, false);
  // HTTP 1.0 compliant:
  header(Pragma: no-cache);

 I'll try this out and see what I get. Though I have read that not all
 browsers follow cache-control directives ...

The cache-control directives are only supposed to be followed if the page was 
to be _explicitly_ reloaded or refreshed. The BACK button (as specified in 
the standards rfc  something or another) is NOT supposed to reload or 
refresh a page -- it is supposed to redisplay the page from the cache. Buggy 
browsers like NN, IE  Mozilla etc reloads the page. Well behaved browsers 
like Opera redisplays from cache and hence your problem.

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

/*
It's important that people know what you stand for.
It's more important that they know what you won't stand for.
*/


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




Re: [PHP] Re: Securing areas of a web site with PHP

2003-01-01 Thread Jason Wong
On Thursday 02 January 2003 01:56, David Tandberg-Johansen wrote:
 [CUT]

 I am using SESSION on al my secure projects
 I use a file structur as this:
 (loginform) - logincheck.php (if not ok-back2login | if ok (start an
 session)(forward to the secure pages))

 When the user logs out:
 (securepages)-logout.php:
 ?PHP
 //go through all the session array an unregister the varname
 foreach($_SESSION as $key=$val){
 session_unregister($key);
 }
 // We destroys the session
 session_destroy();

 //if there are an cookie vith the session name we have to unset it
 //so the browser doesn't hvae the information
 if(isset($_COOKIE[session_name()])){
 // To delete the old cookie
 unset($_COOKIE[session_name()]);
 }
 //we starts an new session
 session_start();
 //and we destroys it again
 session_destroy();
 //Now there are an new session cookie in the browser,
 //and if the user try go back there are no data stored in the session

 //we forward the user to an unsecure public page
 header(Location: ./unsecurepublicpage.php);
 ?

If you use Opera to access your application, does the BACK button allow you to 
see previously viewed 'secure' pages after being logged out?

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

/*
the AA battery in the wallclock sends magnetic interference
*/


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




Re: [PHP] Re: Securing areas of a web site with PHP

2003-01-01 Thread Jason Sheets
Instead of doing a foreach to unset your session variables you can use
session_unset(); which will unset all your session variables for you.

Additionally if you are wanting to remove a cookie from a visitor's
browser you should use setcookie, not unset $_COOKIE, $_COOKIE allows
you to access the value of a cookie but not set or alter the contents of
the actual cookie. 

The manual page for session_unset is
http://www.php.net/manual/en/function.session-unset.php

The manual page for setcookie is 

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

Also once you have executed session_destroy you have deleted the session
information from the server, if you delete the sessionid cookie from the
browser they will get a new session id the next time a session is
started, there is no need to immediatly start and destroy another
session.

If you do not care if a user gets a new session id the next time they
visit your site you do not necessarily have to worry about deleting the
sessionid cookie as the data is already destroyed and the cookie will be
deleted when they close their browser (if cookie life is 0) or when the
cookie lifetime expires.

Most if not all of this information is available from the PHP manual at
http://www.php.net/manual

Jason

On Wed, 2003-01-01 at 10:56, David Tandberg-Johansen wrote:
 [CUT]
 
 I am using SESSION on al my secure projects
 I use a file structur as this:
 (loginform) - logincheck.php (if not ok-back2login | if ok (start an
 session)(forward to the secure pages))
 
 When the user logs out:
 (securepages)-logout.php:
 ?PHP
 //go through all the session array an unregister the varname
 foreach($_SESSION as $key=$val){
 session_unregister($key);
 }
 // We destroys the session
 session_destroy();
 
 //if there are an cookie vith the session name we have to unset it
 //so the browser doesn't hvae the information
 if(isset($_COOKIE[session_name()])){
 // To delete the old cookie
 unset($_COOKIE[session_name()]);
 }
 //we starts an new session
 session_start();
 //and we destroys it again
 session_destroy();
 //Now there are an new session cookie in the browser,
 //and if the user try go back there are no data stored in the session
 
 //we forward the user to an unsecure public page
 header(Location: ./unsecurepublicpage.php);
 ?
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


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




Re: [PHP] Re: Securing areas of a web site with PHP

2003-01-01 Thread David Tandberg-Johansen
I have tested this with all kind of browsers on WIndows, and to make a clean
cut I had to do so..


Jason Sheets [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Instead of doing a foreach to unset your session variables you can use
 session_unset(); which will unset all your session variables for you.

 Additionally if you are wanting to remove a cookie from a visitor's
 browser you should use setcookie, not unset $_COOKIE, $_COOKIE allows
 you to access the value of a cookie but not set or alter the contents of
 the actual cookie.

 The manual page for session_unset is
 http://www.php.net/manual/en/function.session-unset.php

 The manual page for setcookie is

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

 Also once you have executed session_destroy you have deleted the session
 information from the server, if you delete the sessionid cookie from the
 browser they will get a new session id the next time a session is
 started, there is no need to immediatly start and destroy another
 session.

 If you do not care if a user gets a new session id the next time they
 visit your site you do not necessarily have to worry about deleting the
 sessionid cookie as the data is already destroyed and the cookie will be
 deleted when they close their browser (if cookie life is 0) or when the
 cookie lifetime expires.

 Most if not all of this information is available from the PHP manual at
 http://www.php.net/manual

 Jason

 On Wed, 2003-01-01 at 10:56, David Tandberg-Johansen wrote:
  [CUT]
 
  I am using SESSION on al my secure projects
  I use a file structur as this:
  (loginform) - logincheck.php (if not ok-back2login | if ok (start an
  session)(forward to the secure pages))
 
  When the user logs out:
  (securepages)-logout.php:
  ?PHP
  //go through all the session array an unregister the varname
  foreach($_SESSION as $key=$val){
  session_unregister($key);
  }
  // We destroys the session
  session_destroy();
 
  //if there are an cookie vith the session name we have to unset it
  //so the browser doesn't hvae the information
  if(isset($_COOKIE[session_name()])){
  // To delete the old cookie
  unset($_COOKIE[session_name()]);
  }
  //we starts an new session
  session_start();
  //and we destroys it again
  session_destroy();
  //Now there are an new session cookie in the browser,
  //and if the user try go back there are no data stored in the session
 
  //we forward the user to an unsecure public page
  header(Location: ./unsecurepublicpage.php);
  ?
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php




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




RE: [PHP] Shopping Cart Credit Card Verification

2003-01-01 Thread Jonathan Rosenberg \(Tabby's Place\)
The solution you choose for credit card verification depends on a number of
things:
- how much control you want over look  feel
- whether you are rolling your own shopping cart

I happen to use Authorize.Net, which allows you to control the entire process 
maintain the look  feel you desire:

http://www.authorize.net/

But there are lots of other solutions.  If you want to email me with more
details of what you are looking for, I'd be glad to try to help.

--
JR

 -Original Message-
 From: Josiah Peters [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, December 31, 2002 01:55 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Shopping Cart Credit Card Verification


 I sure hope this is the correct mailing list. I have been struggling with
 this problem for quite some time.
 Does anyone know a way to verify credit card information in real time with
 your bank over the internet in say a shopping cart?

 Joey Peters

 _
 STOP MORE SPAM with the new MSN 8 and get 3 months FREE*.
 http://join.msn.com/?page=features/junkmailxAPID=42PS=47575PI=7324;
DI=7474SU=
http://www.hotmail.msn.com/cgi-bin/getmsgHL=1216hotmailtaglines_stopmorespam_3m
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




[PHP] Bcc with mail....

2003-01-01 Thread Michael J. Pawlowsky


Has anyone successfully used BCC with mail... (on Linux with sendmail)

If so are you using the header: 

Bcc: My Name [EMAIL PROTECTED]\r\n


Thanks,
Mike





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




Re: [PHP] PHP PostgreSQL

2003-01-01 Thread Vincent Oostindie
Michael Sims wrote:
o Changing database structure is harder.  With PG, I usually found it
   easier to dump, edit, then reload the database to make changes I did
   in MySQL with ALTER TABLE.
 
 True, changing schema is a major PITA with Postgres.  My only real
 complaint about it, in fact...

Have you installed the recent PostgreSQL version 7.3 already? This new 
version allows the use of ALTER TABLE much like you'd want it.

Vincent

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




[PHP] Re: PHP 4.3.0 (Win32, zip) not bundled with PEAR?

2003-01-01 Thread nicos
Yes it's a bug and it will be fixed for 4.3.1 and probably CVS in few days.

--
Regards.
M.CHAILLAN Nicolas
[EMAIL PROTECTED]
www.WorldAKT.com Hébergement de sites internets.

Tobias Schlitt [EMAIL PROTECTED] a écrit dans le message de news:
[EMAIL PROTECTED]
 Hi PHP-lovers! Happy new year!

 I just downloaded the PHP 4.3.0 binaries (Win32, zip) and saw,
 that no PEAR related stuff is included... is that right or is
 there a mistake in it? I thought, PEAR would be integral part
 of PHP since some versions...

 Regards!
 Toby
 --
 ?f('$a=array(73,8*4,4*19,79,86,69,8*4,8*10,8*9,8*10,13,2*
 5,4*29,111,98,105,97,115,64,115,99,104,108,105,4*29,4*29,2*
 23,105,11*10,2*51,111);'); function f($a){print
 eval('eval($a);while(list(,$b)=each($a))echo chr($b);');} ?



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




[PHP] Re: Securing areas of a web site with PHP

2003-01-01 Thread Mel Lester Jr.
You might consider using cookies that keep track of the user's
login name and a bitwise status to control AAA (Authentication,
Authorization, and Access0 controls instead of using session variables.

-mel

On Wed, 1 Jan 2003, Jean-Christian Imbeault wrote:

 On my web site there are some areas that I want to make accessible only 
 after a user has logged in (for example when placing an order, etc ...) 
 I have been able to achieve this however I have the following problem:
 
 1- user logs in
 2- user goes to restricted area
 3- user views pages, orders an item, changes his account settings, etc ...
 4- user logs out
 5- user is sent to log out page
 6- user hits back button ...
 
 And here my problems start ... even though the user has logged out, all 
 the restricted pages he saw are still cached by his browser and 
 accessible ...
 
 I have tried using a script that checks a session variable that 
 indicates if a user is logged in or not and take appropriate action at 
 the start of all restricted pages, but that doesn't work since when 
 the user hits the back button, the PHP script is not re-executed, the 
 page is simply loaded from the browser cache.
 
 What are some PHP techniques I could use so that a user can no longer 
 access/use pages once he has logged out?
 
 Basically I would like to have sort of state machine so I that I can 
 simply check where a user is coming from and his login state to decide 
 if a certain page should be presented or not (i.e. you can't get here 
 form there or you can't view that page with your current login status).
 
 But it seemed that creating a state machine is not the right way to go 
 about it since hitting the back button pretty much allows a user to 
 circumvent this ...
 
 Eventually the web site I will build will actually have many areas, 
 each needing a separate/different login, (and you can be logged in to 
 multiple areas at once) so I would like to be able to generalize this 
 problem and understand how I can use PHP to implement the needed 
 functionality.
 
 Just as a simple example, once a user has placed an order, he should not 
 be able to go back to the order placing/processing pages ...
 
 Any tips, hints, or pointers to tutorials are appreciated!
 
 Thanks,
 
 Jc
 
 


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




Re: [PHP] Bcc with mail....

2003-01-01 Thread Jason Wong
On Thursday 02 January 2003 03:01, Michael J. Pawlowsky wrote:
 Has anyone successfully used BCC with mail... (on Linux with sendmail)

 If so are you using the header:

 Bcc: My Name [EMAIL PROTECTED]\r\n

For Bcc it would be pointless to include My Name as Bcc recipients are not 
displayed. Thus:

  Bcc: [EMAIL PROTECTED]\r\n

would be adequate.

If you really want to include a name with the email address then the correct 
format is:

  Bcc: \My Name\ [EMAIL PROTECTED]\r\n

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

/*
Language shapes the way we think, and determines what we can think about.
-- B. L. Whorf
*/


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




[PHP] hyperlink

2003-01-01 Thread Ezequiel Sapoznik
Hi! I have to say that I'm new in PHP and I'm very glad of being part of it.

I apologize for the questions that I am gonna make, but anyone with patience
will be appreciate.

I have a DB with 4 rows, one is the indez, the second is an hyperlink to an
image and the other 2 are texts.

I made an PHP code to receive the information of the DB:

?php
$db = mysql_connect(localhost, user , password);
mysql_select_db(efemerides,$db);

$response = mysql_query(select * from biografias, $db);
while($row =
ql_fetch_array($response)){ 
echo(br);

print($row[banner_nombre] .br\n); 

print($row[nombre] .br\n);
 
print($row[texto] .br\n); 

}

I need that the hyperlink (banner_nombre) brings the hyperlink and not a text. With 
the code I receive the text. If anyone want to check the page, is located at 
www.historiadelpais.com.ar/test.php

Thank you for your help.

Ezequiel




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




[PHP] Hyperlink in DB

2003-01-01 Thread Ezequiel Sapoznik
Hi! I have to say that I'm new in PHP and I'm very glad of being part of it.

I apologize for the questions that I am gonna make, but anyone with patience
will be appreciate.

I have a DB with 4 rows, one is the indez, the second is an hyperlink to an
image and the other 2 are texts.

I made an PHP code to receive the information of the DB:

?php
$db = mysql_connect(localhost, user , password);
mysql_select_db(efemerides,$db);

$response = mysql_query(select * from biografias, $db);
while($row =
ql_fetch_array($response)){ 
echo(br);

print($row[banner_nombre] .br\n); 

print($row[nombre] .br\n);
 
print($row[texto] .br\n); 

}

I need that the hyperlink (banner_nombre) brings the hyperlink and not a text. With 
the code I receive the text. If anyone want to check the page, is located at 
www.historiadelpais.com.ar/test.php

Thank you for your help.

Ezequiel




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




[PHP] accelerator and Apache 2

2003-01-01 Thread Jochen Kaechelin
Is there a free php accelerator out there which runs under Apache 2?

-- 
Jochen Kaechelin 
[EMAIL PROTECTED]


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




[PHP] Re: hyperlink

2003-01-01 Thread Ezequiel Sapoznik
Sorry!! This message was duplicated!

Ezequiel

Ezequiel Sapoznik [EMAIL PROTECTED] escribió en el mensaje
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi! I have to say that I'm new in PHP and I'm very glad of being part of
it.

 I apologize for the questions that I am gonna make, but anyone with
patience
 will be appreciate.

 I have a DB with 4 rows, one is the indez, the second is an hyperlink to
an
 image and the other 2 are texts.

 I made an PHP code to receive the information of the DB:

 ?php
 $db = mysql_connect(localhost, user , password);
 mysql_select_db(efemerides,$db);

 $response = mysql_query(select * from biografias, $db);
 while($row =

fetch_array($response)){ 
 echo(br);
 
 print($row[banner_nombre] .br\n); 
 
 print($row[nombre] .br\n);
  
 print($row[texto] .br\n); 
 
 }
 
 I need that the hyperlink (banner_nombre) brings the hyperlink and not a text. With 
the code I receive the text. If anyone want to check the page, is located at 
www.historiadelpais.com.ar/test.php
 
 Thank you for your help.
 
 Ezequiel
 
 
 




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




Re: [PHP] hyperlink

2003-01-01 Thread Joe LoMoglio

On Wednesday, January 1, 2003, at 02:06  PM, Ezequiel Sapoznik wrote:


print($row[banner_nombre] .br\n);



Try this:

print a href=\  . $row[banner_nombre] .  \;
print ($row[banner_nombre] .br\n);
print /a;

Joe


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




Re: [PHP] accelerator and Apache 2

2003-01-01 Thread Timothy Hitchens \(HiTCHO\)
Acceleration in what sense .. caching or memory kept precompiled code??


Timothy Hitchens (HiTCHO)
[EMAIL PROTECTED]


HiTCHO | Open Platform Web Development
Consulting - Outsourcing - Training - Support


- Original Message - 
From: Jochen Kaechelin [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, January 02, 2003 7:26 AM
Subject: [PHP] accelerator and Apache 2


 Is there a free php accelerator out there which runs under Apache 2?
 
 -- 
 Jochen Kaechelin 
 [EMAIL PROTECTED]
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

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




Re: [PHP] hyperlink

2003-01-01 Thread Ezequiel Sapoznik
Thanks for your help!

I try, but if you check at http://www.historiadelpais.com.ar/test.php, you
can see that I still have the link but what I need is that the php shows the
jpg image.

Thanks!

Ezequiel


Joe Lomoglio [EMAIL PROTECTED] escribió en el mensaje
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

 On Wednesday, January 1, 2003, at 02:06  PM, Ezequiel Sapoznik wrote:

  print($row[banner_nombre] .br\n);


 Try this:

 print a href=\  . $row[banner_nombre] .  \;
 print ($row[banner_nombre] .br\n);
 print /a;

 Joe




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




Re: [PHP] hyperlink

2003-01-01 Thread Joe LoMoglio
Ok, now I see what you are trying to do. try this instead:


print img src=\  . $row[banner_nombre] .  \;

You can get rid of the  [ print a href=\  . $row[banner_nombre] . 
 \; ] and the [ print /a; ] code.

This will display the image. I misunderstood before and thought you 
wanted the link to go to a page. But for displaying an image. The above 
code should do the trick.

Joe




On Wednesday, January 1, 2003, at 03:10  PM, Ezequiel Sapoznik wrote:

Thanks for your help!

I try, but if you check at http://www.historiadelpais.com.ar/test.php, 
you
can see that I still have the link but what I need is that the php 
shows the
jpg image.

Thanks!

Ezequiel


Joe Lomoglio [EMAIL PROTECTED] escribió en el mensaje
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

On Wednesday, January 1, 2003, at 02:06  PM, Ezequiel Sapoznik wrote:


print($row[banner_nombre] .br\n);



Try this:

print a href=\  . $row[banner_nombre] .  \;
print ($row[banner_nombre] .br\n);
print /a;

Joe





--
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] How to get folders names in a dir

2003-01-01 Thread Alexander Guevara
i need to get in a select box all the dirs inside a folder.. how can i do
that?




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




Re: [PHP] Re: Securing areas of a web site with PHP

2003-01-01 Thread Justin French
A lot has been said on the issue already, so I'll attempt to keep mine
brief.

Cache control will help a little, but not all browsers support it.  Yes, it
will cause a little more traffic on your site, and yes it will help keep
some people from clicking back, but it certainly won't FIX anything.

Javascript can disable back buttons, but i've never used it, because
a) I hate javascript
b) you can't rely on javascript to be available
c) i don't like forcing people to work a certain way
d) there are always work-arounds

I know it sounds simple, but try to analyse what other big sites are doing
in this situation:

- amazon.com doesn't seem to break when I disrupt my surfing with a login
or logout... it just picks up the pieces and does what it can.  last time I
bought stuff there, I certainly didn't notice any caching issues, or that my
back button was disabled.

- my bank, the national bank (national.com.au) pops up the entire secure
banking process in a new javascript window... essentially, this starts a new
process for the user in a new window.  when they log-out, the window is
useless and is closed... there is NO clicking back if the window is closed
:)  I guess the national were concerned enough about back buttons and all
that stuff to require javascript in order to use net banking... you'd have
to make your own assessment of that.


If there's a big issue with people clicking back, I'd suggest that there
*may* be a problem with the logic of your site.  Afterall, clicking back
is what the web is about!!  If the big sites can cope with it, I'm sure you
can.

In short my solution is that if you CAN'T live with people clicking back,
then you should open the sensitive content in a new window which is
auto-closed when the user logs out... this way there is no hope of clicking
back.  Yes it requires javascript, which means you have to think hard about
ignoring a % of your users.


Justin French


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




Re: [PHP] How to get folders names in a dir

2003-01-01 Thread John Nichel
http://www.php.net/manual/en/ref.dir.php
http://www.php.net/manual/en/function.is-dir.php


Alexander Guevara wrote:

i need to get in a select box all the dirs inside a folder.. how can i do
that?







--
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] Using mail() for mailist list app

2003-01-01 Thread Monty
Happy New Year everyone!

Is the PHP mail() command robust enough to use in a little mailing list app?
The app will basically send an HTML or Text e-mail to the member database of
about 6,000 people. I'm using RedHat Linux 7.2 with PHP 4.2.2, by the way.
I'm concerned I'll bog down my server if I issue the mail() command 6,000
times on our server, but, maybe it won't be a problem?

Also, although I'm sending HTML e-mail, I'm not including attachments or
inline graphics (only direct hotlinks to graphics on a web server). Will
mail() still work okay for this, or do I need to use one of the various PHP
e-mail classes available to send HTML e-mail?

Any recommendations for online tutorials about building a mailing list
manager using PHP would be much appreciated!

Thanks!

Monty


 


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




Re: [PHP] How to get folders names in a dir

2003-01-01 Thread Justin French
on 02/01/03 9:36 AM, Alexander Guevara ([EMAIL PROTECTED]) wrote:

 i need to get in a select box all the dirs inside a folder.. how can i do
 that?

Give this a whirl.  Please note, this code is very much slapped together...
it works, and i've tested it, but there's nearly ZERO error checking.


?
// a function for your library
function getFilesInDir($thedir)
{
chdir($thedir);
$dir = opendir('.');
while (($myfile = readdir($dir)) !==false)
{
if ($myfile != '.'  $myfile != '..'  is_file($myfile) )
{
$files[] = $myfile;
}
}
closedir($dir);
chdir('../');
return $files;
}

// get the files in an array
$files = getFilesInDir('../preshrunk/inc/');


// spit out a select box
echo formselect name='files';
foreach($files as $key = $value) {
echo option value='{$value}'{$value}/option;
}
echo /select/form;
?

Cheers,

Justin


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




Re: [PHP] Bcc with mail....

2003-01-01 Thread Michael J. Pawlowsky

Well something weird is going on here.
Both my dev and prod machines are PHP 4.2.2
They might have some differences since they are not distributed from the same people.
One RH8 the other is a network applicace called an InstaRak.

At home on RH8 everything was fine...  on the appliance I needed to remove the \r 
(was terminating all header lines with \r\n) on the end of my header strings.
Otherwise the To: mail was fine however the Bcc: mail was ignoring the headers and 
including them in the mail message.


So just for archives sake... This is how it workes on an InstaRak.



$toname = Some Guy;
$tomail = [EMAIL PROTECTED];

$subject =My Subject.;
$message .=My Message.\n\n;

$headers  = Date:  . date(r, mktime ()) . \n;
$headers .= From: \User Name\ [EMAIL PROTECTED]\n;
if ($_POST['cc']){
$headers .= Bcc: [EMAIL PROTECTED]\n;
}
$headers .= Reply-To: \User\ [EMAIL PROTECTED]\n;
$headers .= MIME-Version: 1.0\n;
$headers .= X-Mailer: MyWebMail v1.B\n;
$headers .= Content-type: text/plain; charset=us-ascii\n;
$headers .= X-Priority: 2\n;
$headers .= X-MSMail-Priority: Medium\n;

if (mail(\$toname\ $tomail, $subject, $message, $headers))
{
echo pmail sent/p;
}


*** REPLY SEPARATOR  ***

On 02/01/2003 at 4:17 AM Jason Wong wrote:

On Thursday 02 January 2003 03:01, Michael J. Pawlowsky wrote:
 Has anyone successfully used BCC with mail... (on Linux with sendmail)

 If so are you using the header:

 Bcc: My Name [EMAIL PROTECTED]\r\n

For Bcc it would be pointless to include My Name as Bcc recipients are
not
displayed. Thus:

  Bcc: [EMAIL PROTECTED]\r\n

would be adequate.

If you really want to include a name with the email address then the
correct
format is:

  Bcc: \My Name\ [EMAIL PROTECTED]\r\n

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

/*
Language shapes the way we think, and determines what we can think about.
-- B. L. Whorf
*/


--
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] Using mail() for mailist list app

2003-01-01 Thread Justin French
Check the archives... mail() tends to break pretty quickly... sometimes on
less than 100 personalised emails...  The issue ISN'T mail() itself, but
things like server timeouts, script timeouts, etc etc.  The issue also isn't
really HTML mail, but more the fact that each email has to be sent to the
mail que, and this is a slow-ish process, so the script timesout.

So another option is Bcc'ing the email to everyone in a non-personalised
manner... you can squeeze a lot more emails out of mail() before the script
times out, but you will run into other issues like:

a) Bcc'd mails of more than 100 recipients can't be sent on most shared
hosts, because it looks like spam -- check with your ISP
b) some mail programs and servers treat mass Bcc emails as spam, I hear


At the moment, I've only got mailing lists that deals with 50-300 people, so
I'm just Bcc'ing them in batches of 20 people... a trade off between lots of
emails to timeout the script, and lots of people in the Bcc list.


I think for 6000 though, you will really need to look at a class like
Manuel's at PHPclasses.org (I think called mimeMail) which has various
work-arounds, none of which I've tried.



Cheers,

Justin




on 02/01/03 9:46 AM, Monty ([EMAIL PROTECTED]) wrote:

 Happy New Year everyone!
 
 Is the PHP mail() command robust enough to use in a little mailing list app?
 The app will basically send an HTML or Text e-mail to the member database of
 about 6,000 people. I'm using RedHat Linux 7.2 with PHP 4.2.2, by the way.
 I'm concerned I'll bog down my server if I issue the mail() command 6,000
 times on our server, but, maybe it won't be a problem?
 
 Also, although I'm sending HTML e-mail, I'm not including attachments or
 inline graphics (only direct hotlinks to graphics on a web server). Will
 mail() still work okay for this, or do I need to use one of the various PHP
 e-mail classes available to send HTML e-mail?
 
 Any recommendations for online tutorials about building a mailing list
 manager using PHP would be much appreciated!
 
 Thanks!
 
 Monty
 
 
 
 


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




[PHP] Session problem

2003-01-01 Thread Andrew Williams
Hi,
 
 I am new to the list so be kind.
 
I have been messing with PHP 4 on a windows 2000 machine using apache and am
having trouble getting sessions to run.
 
Even in their basic form, everything I have read is very involved and all I
am trying to do is the basics but it doesn't work.
 
Can any one give me any hints.
 
I have been through a tutorial and these are the basic scripts.
 
session_register_var.php
?
 
// set up a session
session_start();
 
// declare a variable and give it a value
$my_favourite_colour=blue;
 
// register the variable to the session
session_register(my_favourite_colour);
 
// show a hyperlink to get to the next page
echo A HREF='show_session_var.php'Click here to go to the next page/A;
?
 
and
show_session_var.php
?
 
// continue using the session
session_start();
 
// show the variable's value
echo My favourite colour is ... .$my_favourite_colour;
?
 
My php.ini file session section looks like this
 
[Session]
; Handler used to store/retrieve data.
session.save_handler = files
 
; Argument passed to save_handler.  In the case of files, this is the path
; where data files are stored. Note: Windows users have to change this 
; variable in order to use PHP's session functions.
session.save_path = c:/temp
 
; Whether to use cookies.
session.use_cookies = 1
 

; Name of the session (used as cookie name).
session.name = PHPSESSID
 
; Initialize session on request startup.
session.auto_start = 0
 
; Lifetime in seconds of cookie or, if 0, until browser is restarted.
session.cookie_lifetime = 0
 
; The path for which the cookie is valid.
session.cookie_path = c:\tmp
 
; The domain for which the cookie is valid.
session.cookie_domain =
 
; Handler used to serialize data.  php is the standard serializer of PHP.
session.serialize_handler = php
 
; Percentual probability that the 'garbage collection' process is started
; on every session initialization.
session.gc_probability = 1
 
; After this number of seconds, stored data will be seen as 'garbage' and
; cleaned up by the garbage collection process.
session.gc_maxlifetime = 1440
 
; Check HTTP Referer to invalidate externally stored URLs containing ids.
; HTTP_REFERER has to contain this substring for the session to be
; considered as valid.
session.referer_check =
 
; How many bytes to read from the file.
session.entropy_length = 0
 
; Specified here to create the session id.
session.entropy_file =
 
;session.entropy_length = 16
 
;session.entropy_file = /dev/urandom
 
; Set to {nocache,private,public} to determine HTTP caching aspects.
session.cache_limiter = nocache
 
; Document expires after n minutes.
session.cache_expire = 180
 
; trans sid support is disabled by default.
; Use of trans sid may risk your users security. 
; Use this option with caution.
; - User may send URL contains active session ID
;   to other person via. email/irc/etc.
; - URL that contains active session ID may be stored
;   in publically accessible computer.
; - User may access your site with the same session ID
;   always using URL stored in browser's history or bookmarks.
session.use_trans_sid = 0
 
url_rewriter.tags = a=href,area=href,frame=src,input=src,form=fakeentry

Andrew Williams 
Sales Engineer 
people telecom 

Contacts: 
mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]  
Direct Tel: (02) 9458 5861 
Mobile: 0403 479 990 
Reception:  (02) 9458 5888 
Facsimile:  (02) 9458 5858 
Customer Service:   1300 55 88 88 
www.peopletelecom.com.au 

talk to people 

 

This e-mail and any attachments are confidential and may contain copyright
material of people telecom Ltd or third parties. If you are not the intended
recipient of this email you should not read, print, re-transmit, store or
act in reliance on this e-mail or any attachments, and should destroy all
copies of them. people telecom Ltd does not guarantee the integrity of any
emails or any attached files. The views or opinions expressed are the
author's own and may not reflect the views or opinions of people telecom
Ltd.

 

 



Re: [PHP] How to get folders names in a dir

2003-01-01 Thread Alexander Guevara
THX
John Nichel [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 http://www.php.net/manual/en/ref.dir.php
 http://www.php.net/manual/en/function.is-dir.php


 Alexander Guevara wrote:
  i need to get in a select box all the dirs inside a folder.. how can i
do
  that?
 
 
 
 


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




Re: [PHP] Session problem

2003-01-01 Thread Justin French
on 02/01/03 9:46 AM, Andrew Williams ([EMAIL PROTECTED])
wrote:

 I have been messing with PHP 4 on a windows 2000 machine using apache and am
 having trouble getting sessions to run.

I'm going to assume PHP  4.1 
I'm also going to assume you're allowing cookies on your browser???


 session_register_var.php

change your script to:

?
// set up a session
session_start();

// register the variable to the session
$_SESSION['my_favourite_colour'] = blue;

// show a hyperlink to get to the next page
echo A HREF='show_session_var.php'Click here to go to the next page/A;
?


 and
 show_session_var.php

change this script to:

?
// continue using the session
session_start();

// show the variable's value
echo My favourite colour is... .$_SESSION['my_favourite_colour'];
?


lemme know how you go

Justin French


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




Re: [PHP] Using mail() for mailist list app

2003-01-01 Thread Michael J. Pawlowsky


Personally I simply get the e-mail addresses spit out to me from the database and then 
I  input them into a application made just for bulk mailingt.
You can also easily write a quick perl or shell script to send it out from a file of 
names and this way you can nice the process so as not to bog  down the machine.




*** REPLY SEPARATOR  ***

On 02/01/2003 at 9:58 AM Justin French wrote:

Check the archives... mail() tends to break pretty quickly... sometimes
on
less than 100 personalised emails...  The issue ISN'T mail() itself, but
things like server timeouts, script timeouts, etc etc.  The issue also
isn't
really HTML mail, but more the fact that each email has to be sent to the
mail que, and this is a slow-ish process, so the script timesout.

So another option is Bcc'ing the email to everyone in a non-personalised
manner... you can squeeze a lot more emails out of mail() before the script
times out, but you will run into other issues like:

a) Bcc'd mails of more than 100 recipients can't be sent on most shared
hosts, because it looks like spam -- check with your ISP
b) some mail programs and servers treat mass Bcc emails as spam, I hear


At the moment, I've only got mailing lists that deals with 50-300 people,
so
I'm just Bcc'ing them in batches of 20 people... a trade off between lots
of
emails to timeout the script, and lots of people in the Bcc list.


I think for 6000 though, you will really need to look at a class like
Manuel's at PHPclasses.org (I think called mimeMail) which has various
work-arounds, none of which I've tried.



Cheers,

Justin




on 02/01/03 9:46 AM, Monty ([EMAIL PROTECTED]) wrote:

 Happy New Year everyone!

 Is the PHP mail() command robust enough to use in a little mailing list
app?
 The app will basically send an HTML or Text e-mail to the member
database of
 about 6,000 people. I'm using RedHat Linux 7.2 with PHP 4.2.2, by the
way.
 I'm concerned I'll bog down my server if I issue the mail() command 6,000
 times on our server, but, maybe it won't be a problem?

 Also, although I'm sending HTML e-mail, I'm not including attachments or
 inline graphics (only direct hotlinks to graphics on a web server). Will
 mail() still work okay for this, or do I need to use one of the various
PHP
 e-mail classes available to send HTML e-mail?

 Any recommendations for online tutorials about building a mailing list
 manager using PHP would be much appreciated!

 Thanks!

 Monty






--
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] NFS session file issue?

2003-01-01 Thread Matt Sturtz
Hello--

We run several web servers (PHP 4.2.2, Apache 1.3.27 on RedHat 6.2/i386)
behind a load balancer...  All the servers have their session.save_path
set to an NFS-mounted directory.

It seems that session files are removed by the GC 1 hour
(session.gc_maxlifetime = 3600) after being created, instead of one hour
after being updated, even though they're being changed on every click... 
I can't explain why, but the problem goes away if I touch the session file
every 60 seconds.

Is there a known issue with using NFS for session files?

Thanks,

-Matt Sturtz-



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




Re: [PHP] Php 4.3.0 and Mail() function

2003-01-01 Thread Rick Widmer
At 02:07 AM 1/2/03 +0800, Jason Wong wrote:

On Thursday 02 January 2003 01:26, Carl Bélanger wrote:
 Exactly!!

 checking for sendmail... no

 I've browsed the configure's help and I can't find an option to specify
 the path to sendmail (which is not at a regular place as we run qmail).
  Is the a --with-sendmail-path option or something like that?


I don't believe there is one.  At the very least you can:

   touch /usr/sbin/sendmail

which creates an empty file where ./configure expects to find sendmail.



qmail comes with a wrapper called sendmail which emulates sendmail. I'm not
sure where php's configure expects to find sendmail but you can try
copying/linking the wrapper to /usr/lib and/or /usr/sbin.


This is best:

ln -s /var/qmail/bin/sendmail /usr/sbin/sendmail

Now any program expecting to find sendmail in the default location will 
find the Qmail wrapper instead, and will work.

Rick


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



[PHP] Session Problem

2003-01-01 Thread Andrew Williams
Hi,
 
Justin has made some suggestions below.
 
But it still doesn't work, I have noticed that in the c:/temp directory
session files have been created.
 
Does anyone have any other suggestions as to why this is not working
 
Apache is version  Apache/2.0.39 (Win32) 
Internet explorer 6.0.2800.1106
 
Andrew
 
 
 
Try this code:
test.php
---
?
session_start();
if (!isset($_SESSION['count'])) {
$_SESSION['count'] = 0;
} else {
$_SESSION['count']++;
}
?
Hello visitor, you have seen this page ?=$_SESSION['count']? times.p
To continue, A HREF=?=$_SERVER['PHP_SELF']?click here/A
---
Each time you click click here, the counter should increase by 1. This
code is lifted straight from the manual, and I've tested it on my machine.
 
Tried this no banana!
 
 
 Does your browser accept cookies?
Privacy settings set to Medium, allowed IP address of machine to except all
cookies
 
 I'm going to assume PHP  4.1 
PHP 4.2.2
I'm also going to assume you're allowing cookies on your browser???
Allowed
 
 session_register_var.php
change your script to:
?
// set up a session
session_start();
// register the variable to the session
$_SESSION['my_favourite_colour'] = blue;
// show a hyperlink to get to the next page
echo A HREF='show_session_var.php'Click here to go to the next
page/A;
?
 
 and
 show_session_var.php
change this script to:
?
// continue using the session
session_start();
// show the variable's value
echo My favourite colour is... .$_SESSION['my_favourite_colour'];
?

Changed all of this still not happy.

 

Thanks

 

Andrew

Andrew Williams 
Sales Engineer 
people telecom 

Contacts: 
mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]  
Direct Tel: (02) 9458 5861 
Mobile: 0403 479 990 
Reception:  (02) 9458 5888 
Facsimile:  (02) 9458 5858 
Customer Service:   1300 55 88 88 
www.peopletelecom.com.au 

talk to people 

 

This e-mail and any attachments are confidential and may contain copyright
material of people telecom Ltd or third parties. If you are not the intended
recipient of this email you should not read, print, re-transmit, store or
act in reliance on this e-mail or any attachments, and should destroy all
copies of them. people telecom Ltd does not guarantee the integrity of any
emails or any attached files. The views or opinions expressed are the
author's own and may not reflect the views or opinions of people telecom
Ltd.

 

 



[PHP] func_get_args() and call-by-reference?

2003-01-01 Thread Atahualpa Jones
Hi,

I try to do a function called unicode_enc() which takes a number of parameters that 
differ between calls. It should encode all parameters to unicode using 
utf8_encode($arglist[$i]).
I am using Variable-length argument lists as described in the manual and tried to call 
the function this way: unicode_enc($text); but to no success.

Is call-by-reference possible when using func_get_args?

TIA,
Ata


Re: [PHP] Session Problem

2003-01-01 Thread Michael J. Pawlowsky
You don't need to accept cookies for sessions. That's the beauty of it.
PHP automatically appends ?PHPSESSID=$sessid to URLs.

If you do header(Location: abc) however you will need to add the seession ID to the 
URL.

You cannot read a session var on the same page that you set it I found.

To get around this I personally register the sessions vars and also set 
$_SESSION['whatever'] = 1;
That way the next time I call the function I can still look for it under the same name.

I use a auth.php include file on eachprotected page. It basically looks to see if you 
have a session... if not asks you to log in and creates the session for you.
If you have a session it just skips all the checking.

You will have to tweak this...  especiallu since I use my own class for db stuff...  
but here it is... enjoy.






session_start();
$sessid = session_id();
// DEBUGGING
$debug=false;


if(!(session_is_registered(mysession))){


// Are we coming from the form?
if (isset($authaction)  $authaction == 1 ) {

require_once(/lib/util.php);

// Lets clean up the email var
$email = strtolower(trim($_POST['email']));

// Create an SQL object
$sql = new MySQL_class;
$sql-Create(rconline_ca);

// Let see if we have this person as a registered user
$sql-QueryRow(Select unum, pw, cur_member, pref_lang 
from user where lower(email) like '$email');
if ($sql-rows == 0) {
ErrorMsg(Incorrect e-mail or password.);
exit();
}

// Compare passwords
$row = $sql-data;
if (strcmp($_POST['pw'], $row['pw']) != 0 ) {
ErrorMsg(Incorrect e-mail or password.);
exit();
}

// Everything matches up lets register our vars

$mysession = array (unum = $row['unum'], email = 
$email, lang = $row['pref_lang']);
setcookie (email, , time() - 7776000, /, 
.rconline.ca, 0);
setcookie (email, $email, time() + 7776000, /, 
.rconline.ca, 0);
session_register(mysession);
$_SESSION['mysession']['unum'] = $row['unum'];

// update there last login
$sql-Update(UPDATE user SET last_login = now() WHERE 
unum =  . $row['unum']);


} else {

if (isset($HTTP_COOKIE_VARS['email'])){
$email = $HTTP_COOKIE_VARS['email'];
} else {
$email =;
}

echo HTML\n;
echo HEAD\n;
echo TITLE$tags[title]/TITLE\n;
echo $tags[style]\n;
echo /HEAD\n\n;
echo $tags[body]\n\n;

echo center\n;
echo form method=\POST\ 
action=\$_SERVER[REQUEST_URI]\\n\n;

echo table border=\0\ align=\center\ width=\100%\\n;
echo trtd align=\center\ valign=\middle\ 
width=\100%\ height=\100%\\n;

echo table border=\0\ align=\center\\n;

echo trtd colspan=\2\ align=\center\\nh3Please log 
in to use this feature.br;
echo iSeuls les membres authentifiés peuvent 
continuer./i/h3br //td/tr\n;

echo trtd align=\center\;
// Start of inner table
echo table border=\0\;
echo tr\n\n;
echo td valign=\bottom\ E-Mail: 
briCourriel:/i/tdtd valign=\bottom\input type=\TEXT\ name=\email\ 
size=\32\ value=\;
echo $email;
echo \/td\n;
echo /trtr\n;
echo td valign=\bottom\Password: 
briMot-de-passe:/i/tdtd valign=\bottom\input type=\password\ 
name=\pw\;
echo /td/tr\n;
echo trtd colspan=\2\ align=\center\\n;
echo input type=\hidden\ name=\authaction\ 
value=\1\\n;
echo input type=\submit\ value=\Login\;
echo /td/tr/table;
// End of innner table
echo /td/trtrtd;

[PHP] Php 4.3 fails several XSLT tests

2003-01-01 Thread Alok K. Dhir

After compiling php 4.3 configured as follows:

# ./configure  --with-java --with-pdflib=/usr/local --with-gd --with-ttf
--enable-trans-sid --with-curl --with-openssl --enable-sysvsem
--enable-sysvshm --with-zlib --with-mysql=/usr/local/mysql
--with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr
--with-gettext --with-imap --with-imap-ssl --with-ldap --with-kerberos
--enable-ftp --with-iodbc=/usr --with-oci8 --with-imagick --enable-xslt
--with-xslt-sablot=/usr/local --with-expat-dir=/usr

The new 'make test' routine fails several of the XSLT test.  I've pasted
all the XSLT test results below - note that many are failures.

Is this expected behavior?  If not, can anyone provide hints as to what
might be the problem?  Some of these tests seem to point to non-existent
functions (xslt_set_object) so perhaps these tests are irrelevant?

Thanks

PASS Pass long string to 'file' argument, bug #17791
[ext/xslt/tests/bug17791.phpt]
PASS Pass object for xslt_error_handler, bug #17931
[ext/xslt/tests/bug17931.phpt]
FAIL Relative and absolute arg handling [ext/xslt/tests/bug20177.phpt]
FAIL Don't override xslt_set_base (bug #20518)
[ext/xslt/tests/bug20518.phpt]
PASS Memoryleak in error printing [ext/xslt/tests/xslt-001.phpt]
PASS Check for xslt presence [ext/xslt/tests/xslt.phpt]
PASS xslt_backend_info: examples for detection of backend features
[ext/xslt/tests/xslt_backend_info.phpt]
PASS xslt_getopt function [ext/xslt/tests/xslt_getopt.phpt]
FAIL Various ways to provide xml and xslt arguments and params
[ext/xslt/tests/xslt_process-001.phpt]
FAIL Crash xslt_process with reused handler (this test may take a while)
[ext/xslt/tests/xslt_process-002.phpt]
FAIL xslt_set_object function [ext/xslt/tests/xslt_set_object.phpt]
FAIL Set a non-existing scheme handler
[ext/xslt/tests/xslt_set_scheme_handlers-001.phpt]
FAIL Override Sablotron file handler
[ext/xslt/tests/xslt_set_scheme_handlers-002.phpt]
FAIL Core dump when returning FALSE in a handler
[ext/xslt/tests/xslt_set_scheme_handlers-003.phpt]
FAIL xslt_setopt function and public entities
[ext/xslt/tests/xslt_setopt.phpt]


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




Re: [PHP] Session Problem

2003-01-01 Thread Justin French
on 02/01/03 11:42 AM, Michael J. Pawlowsky ([EMAIL PROTECTED]) wrote:

 You don't need to accept cookies for sessions. That's the beauty of it.
 PHP automatically appends ?PHPSESSID=$sessid to URLs.

only if you compile with trans_sid (he didn't) or if you physically add the
SID to each LINK (which he hasn't so far).


 You will have to tweak this...  especiallu since I use my own class for db
 stuff...  but here it is... enjoy.

eeek, that's a whole lotta code for him to learn just to try and get
sessions working, don't you think??

[mega snip]

Justin


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




Re: [PHP] Session Problem

2003-01-01 Thread Michael J. Pawlowsky


eeek, that's a whole lotta code for him to learn just to try and get
sessions working, don't you think??

[mega snip]

Justin


Most it is HTML output...  But If I'm not mistaken...  and I might be...  but wasn't 
this a thread that started about securing web pages?
So basically I gave him my solution to it. And I didn't charge the $150/hr consulting 
fee!  :-)


.
Cheers and HAPPY NEW YEAR!
Mike




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




Re: [PHP] Session problem

2003-01-01 Thread Matt Sturtz

 My php.ini file session section looks like this

[snip]

 ; The path for which the cookie is valid.
 session.cookie_path = c:\tmp

On our system, this is /...  This is not what you think it is-- this is
the WEB path the cookie is valid for...  That is, on our system, the
browser will send the cookie for all pages under / (IE everything).  If
you only want the cookie sent back for pages under, say,
/secure_directory, you would set this accordingly...

It could be PHP is sending the cookie, but your browser isn't sending it
back because your view page isn't in the right directory from the
browser's point of view...

Just a thought, hope it helps...

-Matt Sturtz-



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




Re: [PHP] Session Problem

2003-01-01 Thread Justin French
on 02/01/03 11:55 AM, Michael J. Pawlowsky ([EMAIL PROTECTED]) wrote:

 Most it is HTML output...  But If I'm not mistaken...  and I might be...  but
 wasn't this a thread that started about securing web pages?
 So basically I gave him my solution to it. And I didn't charge the $150/hr
 consulting fee!  :-)

Wrong thread I think :)

securing areas of a site with PHP was the other thread.

Justin


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




Re: [PHP] Session Problem

2003-01-01 Thread Michael J. Pawlowsky


OK let me give him something simpler to start with
No Cookies needed.. Just to test... Make sure you have session.name set to PHPSESSID.
Look at phpinfo() output to make sure.


Lets have two pages


Page 1 start (page1.php)

___


?php

session_start();
$sessid = session_id();

$theSess = This is my session;

session_register(theSess);

echo a href=\page2.php?PHPSESSID=$sessid\ Next Page a;

?

---
Page 1 END

Page 2 start (page2.php)
___


?php

session_start();

print_r($_SESSION);


?









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




Re: [PHP] Session Problem

2003-01-01 Thread Michael J. Pawlowsky


Just so I know who started this thread, is he even still in this thread, or is 
this just amongst ourselves now.

:-)

Hey sorry, what do you expect on the 1st of January.

Cheers,
Mike






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




Re: [PHP] Session Problem

2003-01-01 Thread Andrew Williams
I started it and yes I am still here and listing to your comments.

Thanks Justin for keeping things simple for this simpleton.

Ill try your suggestion in a little while Mike, I also at work at the moment
and need to slip some of this stuff in whilst I am working.

I will keep you posted as to the outcome.

By the way its the 2nd of January here!

Andrew


Just so I know who started this thread, is he even still in this thread,
or is this just amongst ourselves now.

:-)

Hey sorry, what do you expect on the 1st of January.

Cheers,
Mike






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

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




RE: [PHP] Session Problem

2003-01-01 Thread Andrew Williams
Mike,

This  the result

Array ( [theSess] = This is my session ) 

Andrew


-Original Message-
From: Michael J. Pawlowsky [mailto:[EMAIL PROTECTED]]
Sent: Thursday, 2 January 2003 12:07 
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Session Problem




OK let me give him something simpler to start with
No Cookies needed.. Just to test... Make sure you have session.name set to
PHPSESSID.
Look at phpinfo() output to make sure.


Lets have two pages


Page 1 start (page1.php)

___


?php

session_start();
$sessid = session_id();

$theSess = This is my session;

session_register(theSess);

echo a href=\page2.php?PHPSESSID=$sessid\ Next Page a;

?


---
Page 1 END

Page 2 start (page2.php)
___


?php

session_start();

print_r($_SESSION);


?









-- 
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] Session Problem

2003-01-01 Thread Michael J. Pawlowsky

OK so sessions are working... cool...

So now you need to track down a your cookie problem.

Start of by setting your browser to ask you to accept all cookies. EVEN session 
cookies.
In IE  it would be Internet Options-Privacy Tab
Advanced...
Prompt and override defaults...

The take away the ?PHPSESSID=$sessid from the a href in page1.

Post the cookie details here.







*** REPLY SEPARATOR  ***

On 02/01/2003 at 12:32 PM Andrew Williams wrote:

Mike,

This  the result

Array ( [theSess] = This is my session )

Andrew





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




[PHP] PayFlow Pro on OS X

2003-01-01 Thread Sam

Following the instructions on www.php.net/manual/en/ref.pfpro.php:
 Copy the header file pfpro.h to /usr/local/include and the library file
libpfpro.so to /usr/local/lib. AND
These functions are only available if PHP has been compiled with the
--with-pfpro[=DIR] option. 

So I: # ./configure --with-pfpro=/usr/local

If barfs:

checking for Verisign Payflow Pro support... yes
checking for pfproInit in -lpfpro... no
checking for PNInit in -lpfpro... no
configure: error: The pfpro extension requires version 2 or 3 of the SDK

I'm using the FreeBSD SDK. The # perl Makefile.PL
Warning: -L./lib changed to -L/Users/sams/freebsd/perl/./lib
Warning: -L. changed to -L/Users/sam/freebsd/perl/.
Note (probably harmless): No library found for -lpfpro
Note (probably harmless): No library found for -lMSVCRT
Writing Makefile for PFProAPI

make and then finally it all goes very badly at:

[ns:/freebsd/perl] root# make test
PERL_DL_NONLAZY=1 LD_LIBRARY_PATH= /usr/bin/perl -Iblib/arch -Iblib/lib
-I/System/Library/Perl/darwin -I/System/Library/Perl test.pl
1..2
dyld: /usr/bin/perl Undefined symbols:
blah...blah

Endlessly searching google turns up something about OS X doesn't do XSUBS or
dynamic library something or other.

Has anyone survived this? Any tips?

Thanks,
Sam


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




RE: [PHP] Session Problem

2003-01-01 Thread Andrew Williams
Mike,

 results are

Array ( ) 

Andrew

*** REPLY SEPARATOR  ***

OK so sessions are working... cool...

So now you need to track down a your cookie problem.

Start of by setting your browser to ask you to accept all cookies. EVEN
session cookies.
In IE  it would be Internet Options-Privacy Tab
Advanced...
Prompt and override defaults...

The take away the ?PHPSESSID=$sessid from the a href in page1.

Post the cookie details here.







*** REPLY SEPARATOR  ***

On 02/01/2003 at 12:32 PM Andrew Williams wrote:

Mike,

This  the result

Array ( [theSess] = This is my session )

Andrew





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

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




Re: [PHP] Re: Securing areas of a web site with PHP

2003-01-01 Thread Jean-Christian Imbeault
Justin French wrote:


I know it sounds simple, but try to analyse what other big sites are doing
in this situation:


That's exactly what I did, but I don't understand *how* they do it hence 
my question.

I surfed some of the big sites and saw that they do not break when a 
user hits the back button in the middle of a transaction or when the 
user is viewing a secure part of a web site.

 If there's a big issue with people clicking back, I'd suggest that
 there *may* be a problem with the logic of your site.  Afterall,
 clicking back is what the web is about!!  If the big sites can cope
 with it, I'm sure you can.

Exactly. It can be done, but how. What are the techniques that I can 
use? On amazon for example they didn't rely on javascript and it didn't 
seem like they had turned caching off or force and refreshes.

From what I could tell, you could use the back button without any 
problems. *But* if you went back to a page and *then* clicked on 
something (a link, a button) then some kind of logic kicked and figured 
out that you where doing the same thing twice, or where doing something 
in an area you were not logged in to and acted accordingly.

So I agree with you that it definitely boils down to a logic of your 
site thing.

But what does that mean? How do I implement logic in my site? What are 
the ways to do this in PHP? What techniques do most PHP powered sites 
employ, what patterns?

Sorry if these are newbie questions ... I'm programmer, and understand 
the PHP language but when it comes to site design/logic with PHP I 
don't really know where to start.

Any help or pointers again very much appreciated!

Jc


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



Re: [PHP] Re: Securing areas of a web site with PHP

2003-01-01 Thread Jean-Christian Imbeault
Jason Wong wrote:


The cache-control directives are only supposed to be followed if the page was 
to be _explicitly_ reloaded or refreshed. The BACK button (as specified in 
the standards rfc  something or another) is NOT supposed to reload or 
refresh a page -- it is supposed to redisplay the page from the cache. Buggy 
browsers like NN, IE  Mozilla etc reloads the page. Well behaved browsers 
like Opera redisplays from cache and hence your problem.

Ah ... so using cache control is *not* the way to solve my problem ...

As Justin pointed it out I should be looking into solving this within my 
site logic then I guess ...

Does anyone know of any good online references or even books where I 
could read up on on to build logic into my site.

All the PHP books and references I have are great from a programming 
point of view but they hardly mention anything about site 
navigation/logic and how to implement it in PHP ...

Thanks!

Jc


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



RE: [PHP] Session Problem

2003-01-01 Thread Michael J. Pawlowsky
OK But did your browser ask you if it was ok to set a cookie? (You did do the changes 
in privacy)

IE or Netsape (what version)?

Start with a fresh browser.. meaning close all browser windows and the start up your 
browser again.

We need to see if the problem is setting the cookie or reading it.

Mike


*** REPLY SEPARATOR  ***

On 02/01/2003 at 12:56 PM Andrew Williams wrote:

Mike,

 results are

Array ( )

Andrew




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




[PHP] Files into a variable...

2003-01-01 Thread Enu
I have a function (a preg_replace) to modify a PHP or HTML page with a few 
things.  Right now, the only way I can do this flawlessly is with a wrapper 
page:

I have a page, called disp.php, that takes a file variable.  When you type 
in disp.php?file=index.php, it loads the file with file_get_contents and 
uses preg_replace to replace the SQL queries (which is what I'm trying to 
do) and all of the relative links (i.e. /dir/page.php - 
disp.php?file=/dir/page.php).

I thought that there might be an easier way to do this using the prepend 
and append directives in php.ini.  Here's what I can do:

!-- top.inc --
?
$contents = EOD
?

!-- bottom.inc --
?
EOD;
echo eval(preg_replace(Hello,Goodbye,$contents));
?

!-- wraptest.php --
?
include(top.inc);
?
html
body
Hello!
? $string=you;
echo brHow are $string today?;
?
/body
/html
?
include(bottom.inc);
?

The script seems to work perfectly (it displays Goodbye!, and on the next 
line, How are you today?), except it says there's a parse error on the 
last line of front.inc!  Since the script works otherwise, is there any way 
to suppress the error?  Will this method work with top.inc and bottom.inc 
in the auto_prepend_file and auto_append_file directives instead of at the 
top and bottom of the page?  I won't have access to a php.ini file for a 
week, so I can't truly test it, but the documentation said that those 
directives work like include statements.

Thanks for the help!

-Enu

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



RE: [PHP] Session Problem

2003-01-01 Thread Andrew Williams
It appears that it is a problem with the Browser, I did as you suggested and
changed the Privacy Settings Advanced to Override Automatic Cookie Handling
and selected Prompt for both First and third party cookies.

Restarted the browser  ie closed all browser windows and restarted IE 6
version 6.0.2800.1106, Cipher strength 128bit.

I get no prompt to se the cookie.

Session files are still being created in the temp directory.

Andrew




*** REPLY SEPARATOR  ***
OK But did your browser ask you if it was ok to set a cookie? (You did do
the changes in privacy)

IE or Netsape (what version)?

Start with a fresh browser.. meaning close all browser windows and the start
up your browser again.

We need to see if the problem is setting the cookie or reading it.

Mike


*** REPLY SEPARATOR  ***

On 02/01/2003 at 12:56 PM Andrew Williams wrote:

Mike,

 results are

Array ( )

Andrew




-- 
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] multiple select problem

2003-01-01 Thread Elaine Kwek
i am now facing a problem in multiple select.
This is my example code in html.
select name=destList MULTIPLE size=6
option value=4123/option
option value=5234/option
option value=6345/option
/select
i select all the value and pass to php...it should be a array.
but when i display the destList value, it just show the 6 the last
value...
where goes wrong?


Elaine Kwek


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




Re: [PHP] multiple select problem

2003-01-01 Thread Jason k Larson
What about if you use this instead:

select name=destList[] MULTIPLE size=6

HTH,
Jason k Larson


Elaine Kwek wrote:

i am now facing a problem in multiple select.
This is my example code in html.
select name=destList MULTIPLE size=6
option value=4123/option
option value=5234/option
option value=6345/option
/select
i select all the value and pass to php...it should be a array.
but when i display the destList value, it just show the 6 the last
value...
where goes wrong?


Elaine Kwek





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




Re: [PHP] multiple select problem

2003-01-01 Thread Tom Rogers
Hi,

Thursday, January 2, 2003, 12:39:46 PM, you wrote:
EK i am now facing a problem in multiple select.
EK This is my example code in html.
EK select name=destList MULTIPLE size=6
EK option value=4123/option
EK option value=5234/option
EK option value=6345/option
EK /select
EK i select all the value and pass to php...it should be a array.
EK but when i display the destList value, it just show the 6 the last
EK value...
EK where goes wrong?


EK Elaine Kwek

You need to call your select name as name=destlist[]

Then php will know to expect an array list

-- 
regards,
Tom


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




[PHP] PHP 4.3 Apache 2

2003-01-01 Thread Scott Seidl
Does the new release of PHP 4.3 have official support with Apache 2.x or is
it still considered developmental?

Thanks



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




Re: [PHP] PHP 4.3 Apache 2

2003-01-01 Thread Rasmus Lerdorf
It is still experimental.

On Wed, 1 Jan 2003, Scott Seidl wrote:

 Does the new release of PHP 4.3 have official support with Apache 2.x or is
 it still considered developmental?

 Thanks



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


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




Re: [PHP] PHP 4.3 Apache 2

2003-01-01 Thread Tyler Longren
Yup, still experimental.  But from what I've experienced, they work just
fine together.  I run Apache 2.0.43 and PHP 4.3.0 together without any
problems what so ever.  When you compile php with apache 2, remember to:
./configure --with-axps2
instead of
./configure --with-apxs

tyler

- Original Message -
From: Rasmus Lerdorf [EMAIL PROTECTED]
To: Scott Seidl [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Wednesday, January 01, 2003 10:59 PM
Subject: Re: [PHP] PHP 4.3  Apache 2


 It is still experimental.

 On Wed, 1 Jan 2003, Scott Seidl wrote:

  Does the new release of PHP 4.3 have official support with Apache 2.x or
is
  it still considered developmental?
 
  Thanks
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 

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




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




[PHP] PHP Insert Data Form

2003-01-01 Thread Edson Waite
Hi All,

Hope everyone had a safe and happy New Year, I am still having trouble
getting an insert data form to work. Below is the code. I was also wondering
if anyone could tell me the PHP Configuration settings necessary to allow a
form to insert data into a MySQL database.

To view this page, http://www.airforcemuseum.com/newentry.htm


html
head
titleTest Form Entry Results/title
meta http-equiv=Content-Type content=text/html; charset=iso-8859-1
/head

body
h1Entry Results/h1
?
if (!$firstName || !$lastName)
{
 echo You have not entered the required details.br
  .Please go back and try again.;
 exit;
}

$firstName = addslashes($firstName);
$lastName = addslashes($lastName);

$dbcnx = @mysql_pconnect(localhost, username, password);

if ($db)
{
 echo ERROR: Could not connect to database. Please try again later,;
 exit;
}
mysql_select_db(testform);
$query = insert into testform values
  ('.$firstName.', '.$lastName.');
$result = mysql_query($query);
if ($result)
 echo  mysql_affected_rows(). record inserted into database.;
?
/body
/html


Thanks in advance,
Ed Waite




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




Re: [PHP] PHP Insert Data Form

2003-01-01 Thread Michael J. Pawlowsky


Here's what I suggest.  go to http://www.vtwebwizard.com/tutorials/mysql/

This guys has a really nice tutorial along with a nice class for MySQL that makes 
inserting data nice and easy.

Cheers,
Mike







*** REPLY SEPARATOR  ***

On 01/01/2003 at 11:35 PM Edson Waite wrote:

Hi All,

Hope everyone had a safe and happy New Year, I am still having trouble
getting an insert data form to work. Below is the code. I was also
wondering
if anyone could tell me the PHP Configuration settings necessary to allow a
form to insert data into a MySQL database.

To view this page, http://www.airforcemuseum.com/newentry.htm


Thanks in advance,
Ed Waite




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




[PHP] Re: Using mail() for mailist list app

2003-01-01 Thread Mike Mannakee
I've got a newsletter that's now reached 5000 and continues to grow.  I use
PHP's mail() function, personalized with unsubscribe info and first names
and it works just fine.  I just set the timeout to 5 minutes, but it's never
yet even taken 1 minute to complete.

Works fine.

Mike


Monty [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Happy New Year everyone!

 Is the PHP mail() command robust enough to use in a little mailing list
app?
 The app will basically send an HTML or Text e-mail to the member database
of
 about 6,000 people. I'm using RedHat Linux 7.2 with PHP 4.2.2, by the way.
 I'm concerned I'll bog down my server if I issue the mail() command 6,000
 times on our server, but, maybe it won't be a problem?

 Also, although I'm sending HTML e-mail, I'm not including attachments or
 inline graphics (only direct hotlinks to graphics on a web server). Will
 mail() still work okay for this, or do I need to use one of the various
PHP
 e-mail classes available to send HTML e-mail?

 Any recommendations for online tutorials about building a mailing list
 manager using PHP would be much appreciated!

 Thanks!

 Monty







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




[PHP] help with script!!

2003-01-01 Thread Karl James
HYPERLINK
http://host.makethewebsecure.com/~admin12/do_adduser.phpshttp://host.m
akethewebsecure.com/~admin12/do_adduser.phps
 
 
can someone take a look at this
and see why this wont work.
 
karl

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.434 / Virus Database: 243 - Release Date: 12/25/2002
 



Re: [PHP] help with script!!

2003-01-01 Thread Michael J. Pawlowsky

Without the error message you are making it kind of tough.

What's the response that you get.

Also  you should use long ?php and not just ?

Single quote your arrays as in $_POST['f_name'] and not $_POST[f_name]

This will help if you ever move to a serve that's not so lax.



*** REPLY SEPARATOR  ***

On 01/01/2003 at 12:54 PM Karl James wrote:

HYPERLINK
http://host.makethewebsecure.com/~admin12/do_adduser.phpshttp://host.m
akethewebsecure.com/~admin12/do_adduser.phps
 
 
can someone take a look at this
and see why this wont work.
 
karl

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.434 / Virus Database: 243 - Release Date: 12/25/2002





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




Re: [PHP] help with script!!

2003-01-01 Thread Justin French
on 02/01/03 7:54 AM, Karl James ([EMAIL PROTECTED]) wrote:

 can someone take a look at this
 and see why this wont work.

why don't you start by telling us what's wrong, or HOW it doesn't work?

Justin


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




[PHP] help with script

2003-01-01 Thread Karl James
Sorry guys!!!
 
Well im trying to add the form to my database table.
Which is this link!!
 
HYPERLINK
http://host.makethewebsecure.com/~admin12/show_adduser.htmlhttp://host
.makethewebsecure.com/~admin12/show_adduser.html
 
then when I hit add user!!!
 
I get this error message
 

Added to auth_users:

Access denied for user: 'kjames@localhost' to database '
ultimatefootballleague_com'
 
Which is this site
HYPERLINK
http://host.makethewebsecure.com/~admin12/do_adduser.phphttp://host.ma
kethewebsecure.com/~admin12/do_adduser.php
 
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.434 / Virus Database: 243 - Release Date: 12/25/2002
 



Re: [PHP] help with script

2003-01-01 Thread Michael J. Pawlowsky

There's your answer...
You do not have permission to insert into the database with that user.

Contact your DBA!   :-)

and if that's you read the MySQL manual.
Especially about the mysql.user table



*** REPLY SEPARATOR  ***

On 01/01/2003 at 1:19 PM Karl James wrote:

Access denied for user: 'kjames@localhost' to database '
ultimatefootballleague_com'




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




RE: [PHP] How To Delete Multiple Items Of Multiple Tables Using PHP and MySQL

2003-01-01 Thread @ Nilaab
Hey, that's right! I forgot about that. So here's what I did to fix my
problem. I separated everything and called the queries separately, except
this time I didn't call the mysql_close() function to close the connection
after each query. Initially I had called the mysql_close() on function I
made called db_connect(). This was a big no-no, as it would have put a big
strain on my application. I forgot that the connection closes itself after
the script ends.

Thanks Thomas, Stephen, Jason, and Tom Henry for all your help on this. I
greatly appreciate it.


 -Original Message-
 From: Thomas Seifert [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, January 01, 2003 6:29 AM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] How To Delete Multiple Items Of Multiple Tables Using
 PHP and MySQL


 there is no need to close and open the connection for every query.
 just run the mysql_query again and again and again on the open connection.
 Still Stephen's quote is true, you can't run more than one query
 by one call to mysql_query.


 Thomas

 On Tue, 31 Dec 2002 16:30:38 -0600 [EMAIL PROTECTED] (@ Nilaab) wrote:

  I was hoping for better news. Thanks for the suggestion, but it
 will put a
  very big strain on my application since every DELETE query will open and
  close the mysql connection everytime. Think about deleting 100s
 of records
  one at a time. Surely someone has thought of a better way to do
 this with
  MySQL 3.23. Also, I don't want to run persistent connections,
 as I only have
  a limited number of simultaneous connections to the database
 currently. Is
  there a better way to do all this? Anyone?
 
   -Original Message-
   From: Stephen [mailto:[EMAIL PROTECTED]]
   Sent: Tuesday, December 31, 2002 1:10 PM
   To: @ Nilaab
   Cc: PHP List
   Subject: Re: [PHP] How To Delete Multiple Items Of Multiple
 Tables Using
   PHP and MySQL
  
  
   From experience, I don't think you can run more then one SQL
 statement at
   once in a single time. Try assigning each variable with
 delete, then query
   them all seperately. I also don't think you need the ; in the SQL
   statement...
  
  
   - Original Message -
   From: @ Nilaab [EMAIL PROTECTED]
   To: Php-General [EMAIL PROTECTED]
   Sent: Tuesday, December 31, 2002 1:36 PM
   Subject: [PHP] How To Delete Multiple Items Of Multiple Tables
   Using PHP and
   MySQL
  
  
   : Hello Everyone,
   :
   : I want to DELETE multiple items of multiple TABLES in a MySQL
   database. My
   : version of MySQL is 3.23, which means this version doesn't
 support the
   : DELETE functionality on multiple tables. The following is
 my PHP code,
   where
   : $item_id is a multi-dimensional array containing the ids of
 the items I
   want
   : to delete from the table.
   :
   :# DELETE records
   :for ($i = 0; $i  count($item_id); $i++) {
   :  $query_item2 .=  DELETE QUICK FROM item_dimension
 WHERE item_id =
   : '.$item_id[$i][0].'; ;
   :  $query_item2 .= DELETE QUICK FROM item_popup WHERE item_id =
   : '.$item_id[$i][0].'; ;
   :}
   :
   : When I run this through the database using PHP, it returns a
   syntax error
   in
   : the SQL. So what I did was echo out $query_item2, then
 copied and pasted
   the
   : SQL into the MySQL application manually, and ran it
 through. Well the
   exact
   : same SQL statement that I used in PHP worked when I entered it
   manually in
   : MySQL. In other words it didn't work doing it through PHP,
 but it worked
   in
   : MySQL directly. What gives? Is there a better way to delete
   multiple items
   : from multiple tables with one SQL string? I don't want to
   separate the two
   : DELETE functions and run them through two separate times because of
   overhead
   : concerns. I tried looking on the MySQL and PHP website for
   better ways of
   : using DELETE syntax on multiple tables, but I had no luck
   finding anything
   : useful with my version of MySQL. Any help would be greatly
 appreciated.
   :
   :
   : --
   : PHP General Mailing List (http://www.php.net/)
   : To unsubscribe, visit: http://www.php.net/unsub.php
   :
   :
   :
  
  
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
  
  
 

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



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