[PHP] Control over your Session

2003-03-10 Thread Gerard Samuel
Got a problem thats baffling me.
I have a form that includes a file that starts a session.
Creating sessions are no problem, but deleting the session variable is 
not working as its supposed to.
Sudo code -
?php
include('some_file.php');  // This file starts the session via 
session_start();

switch( $bar )
{
   case 'post':
   // do logic and insert into db
   unset($_SESSION['foo']);  // we are finished with session variable, 
so delete it
   break;

   case 'preview':
   // preview form contents and set session to persist
   $_SESSION['foo'] = 'some data';
   break;
   default:
   if (isset($_SESSION['foo']))
   {
unset($_SESSION['foo']);
   }
   // display form here
   break;
}
?

For some reason thats beyond me, using unset() to kill the session 
variable isn't working.
Does anyone know what could be causing this type of behaviour??
Any help would be appreciated.
Thanks

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


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


Re: [PHP] Control over your Session

2003-03-10 Thread Leif K-Brooks
If you have register_globals on, you'll need to session_unregister it.

Gerard Samuel wrote:

Got a problem thats baffling me.
I have a form that includes a file that starts a session.
Creating sessions are no problem, but deleting the session variable is 
not working as its supposed to.
Sudo code -
?php
include('some_file.php');  // This file starts the session via 
session_start();

switch( $bar )
{
   case 'post':
   // do logic and insert into db
   unset($_SESSION['foo']);  // we are finished with session variable, 
so delete it
   break;

   case 'preview':
   // preview form contents and set session to persist
   $_SESSION['foo'] = 'some data';
   break;
   default:
   if (isset($_SESSION['foo']))
   {
unset($_SESSION['foo']);
   }
   // display form here
   break;
}
?

For some reason thats beyond me, using unset() to kill the session 
variable isn't working.
Does anyone know what could be causing this type of behaviour??
Any help would be appreciated.
Thanks

--
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt 
to decrypt it will be prosecuted to the full extent of the law.


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


Re: [PHP] Control over your Session

2003-03-10 Thread Gerard Samuel
Thanks for saving my sanity.  The best answer is the simplest one.
Im testing my code on a domain where register_globals were on.  Never 
would have thought of checking that.
Thanks once again, now I can go to sleep...

Leif K-Brooks wrote:

If you have register_globals on, you'll need to session_unregister it.

Gerard Samuel wrote:

Got a problem thats baffling me.
I have a form that includes a file that starts a session.
Creating sessions are no problem, but deleting the session variable 
is not working as its supposed to.
Sudo code -
?php
include('some_file.php');  // This file starts the session via 
session_start();

switch( $bar )
{
   case 'post':
   // do logic and insert into db
   unset($_SESSION['foo']);  // we are finished with session 
variable, so delete it
   break;

   case 'preview':
   // preview form contents and set session to persist
   $_SESSION['foo'] = 'some data';
   break;
   default:
   if (isset($_SESSION['foo']))
   {
unset($_SESSION['foo']);
   }
   // display form here
   break;
}
?

For some reason thats beyond me, using unset() to kill the session 
variable isn't working.
Does anyone know what could be causing this type of behaviour??
Any help would be appreciated.
Thanks


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


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


RE: [PHP] Images out side the wwwroot

2003-03-10 Thread Don Read

On 10-Mar-2003 Philip J. Newman wrote:
 If i was to use PHP to call all my images from out side the wwwroot, dose
 anyone have a method that they use?
 

show.php
-
?php

$rcsid='$Id: show.php,v 1.1 2002/02/14 21:20:26 dread Exp dread $';

// $Log: show.php,v 2002/02/14 21:20:26 dread $
// Revision 1.1dread
// Initial revision
//

error_reporting(0);

// where is the base directory of the images?
$imgdir='/usr/local/private/image';

//  Allow a sub-directory from $imgdir?
$allowpath= 0;

// Allow searching for extention ? *not implemented*
$allowsearch= 0;

$mimetype=array(
'jpeg' = 'image/jpeg',
'jpg'  = 'image/jpeg',
'gif'  = 'image/gif',
'mpeg' = 'video/mpeg',
'mpg'  = 'video/mpeg',
'mov'  = 'video/quicktime',
//  'avi'  = 'video/avi',
'avi'  = 'video/x-msvideo',
'wmv'  = 'video/x-ms-wmv',
'asf'  = 'video/x-ms-asf',
'png'  = 'image/png'
);


if (! isset($id))
die('no id.');

$id= urldecode($id);
$id= str_replace('../', '', $id); // fix the dodgy stuff
$id= trim($id);

if (! ($allowpath) )
$id= basename($id);

$ext= substr(strrchr($id, '.'), 1);
$path= $imgdir .'/' .$id;

if ($handle= fopen($path, 'r')) {

Header('Content-type: ' .$mimetype[$ext]);
Header(Content-Disposition: inline; filename= .basename($id));

fpassthru($handle);
fclose($handle);
}
?


call it as 'show.php?id=secretimg.jpeg' or use 
IMG SRC=show.php?id=secretimg.jpeg 

Regards,
-- 
Don Read   [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.

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



Re: [PHP] Displaying a file

2003-03-10 Thread Ernest E Vogelsinger
At 03:17 10.03.2003, Todd Cary said:
[snip]
I want to display a file under program control in the same manner as one 
would with using an a tag e.g.

Click a href=files/raceschedule.pdf Name=Race Schedule 
Target=_blankhere/a to open the Race Schedule

In other words, if certain conditions are met, then I want to display 
the file.  What is the best way to do that?
[snip] 

Have a look at http://www.vogelsinger.at/protected.html. If you can't use
this little gadget I'm sure there's a lot of information in it how to serve
any file under program control.


-- 
   O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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



[PHP] sessions

2003-03-10 Thread Shaun van den Berg
Hi,

Tell me , is sessions safe - why is it really used ? Is it important te
delete the session variables after u use it ? When a user logs on to my site
, he enters the password , i then encrypt the password and verify it with
the one in the database ! Will someone be able to hijack the session getting
the password before i encrypt it ?

Thanks
Shaun

--
Novtel Consulting
Tel: +27 21 9822373
Fax: +27 21 9815846
Please visit our website:
www.novtel.co.za



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



[PHP] while loop with mysql

2003-03-10 Thread Richard Kurth
 Can somebody look at this and tell me way the first while loop will
 only loop through the database once when there is more than one record
 that should be processed.


while($members = @mysql_fetch_object($result)) {
$logged_email=$members-email;
$logged_title=$members-title;
$logged_first_name=$members-first_name;
$logged_last_name=$members-last_name;
$logged_time=$members-mtime;
$logged_date=$members-signdate ;
$logged_sent=$members-sent;
$current_time = time();
$high_level = $current_time - $logged_time;
$low_level = $high_level - 86400;
$result1=safe_query(Select * from email);
while ($emails = @mysql_fetch_object($result1)) {
$keys= $emails-days_send;
$keys=trim($keys);
$sendoff = $keys * 86400;
if ($sendoff  $low_level) {
if ($sendoff  $high_level) {
$logged_sent=trim($logged_sent);
if ($logged_sent==$keys){
}else{
//update the members table sent field with the key #
$sql1=Update members set  sent='$keys' where 
email='$logged_email';
$result=safe_query($sql1);
send_email();
}}}//end of all three if statements
}//end of $emails while loop

} //end $members while loop
  

-- 
Best regards,
 Richard  mailto:[EMAIL PROTECTED]


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



Re: [PHP] while loop with mysql

2003-03-10 Thread Tom Rogers
Hi,

Monday, March 10, 2003, 7:20:37 PM, you wrote:
RK  Can somebody look at this and tell me way the first while loop will
RK  only loop through the database once when there is more than one record
RK  that should be processed.


RK while($members = @mysql_fetch_object($result)) {
RK $logged_email=$members-email;
RK $logged_title=$members-title;
RK $logged_first_name=$members-first_name;
RK $logged_last_name=$members-last_name;
RK $logged_time=$members-mtime;
RK $logged_date=$members-signdate ;
RK $logged_sent=$members-sent;
RK $current_time = time();
RK $high_level = $current_time - $logged_time;
RK $low_level = $high_level - 86400;
RK $result1=safe_query(Select * from email);
RK while ($emails = @mysql_fetch_object($result1)) {
RK $keys= $emails-days_send;
RK $keys=trim($keys);
RK $sendoff = $keys * 86400;
RK if ($sendoff  $low_level) {
RK if ($sendoff  $high_level) {
RK $logged_sent=trim($logged_sent);
RK if ($logged_sent==$keys){
RK }else{
RK //update the members table sent field with the key #
RK $sql1=Update members set  sent='$keys' where 
email='$logged_email';
RK $result=safe_query($sql1);
RK send_email();
RK }}}//end of all three if statements
RK }//end of $emails while loop

RK } //end $members while loop
  

RK -- 
RK Best regards,
RK  Richard  mailto:[EMAIL PROTECTED]



This resets $result

//update the members table sent field with the key #
$sql1=Update members set  sent='$keys' where 
email='$logged_email';
$result=safe_query($sql1);
send_email();


needs $result3 or something

-- 
regards,
Tom


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



Re[2]: [PHP] while loop with mysql

2003-03-10 Thread Richard Kurth
Hello Tom,
I have been looking at this for an hour and thought it was something
like that but I could not see it. I guess it is time to go to bed.

Thanks

Monday, March 10, 2003, 1:47:27 AM, you wrote:


TR Hi,

TR Monday, March 10, 2003, 7:20:37 PM, you wrote:
RK  Can somebody look at this and tell me way the first while loop will
RK  only loop through the database once when there is more than one record
RK  that should be processed.


RK while($members = @mysql_fetch_object($result)) {
RK $logged_email=$members-email;
RK $logged_title=$members-title;
RK $logged_first_name=$members-first_name;
RK $logged_last_name=$members-last_name;
RK $logged_time=$members-mtime;
RK $logged_date=$members-signdate ;
RK $logged_sent=$members-sent;
RK $current_time = time();
RK $high_level = $current_time - $logged_time;
RK $low_level = $high_level - 86400;
RK $result1=safe_query(Select * from email);
RK while ($emails = @mysql_fetch_object($result1)) {
RK $keys= $emails-days_send;
RK $keys=trim($keys);
RK $sendoff = $keys * 86400;
RK if ($sendoff  $low_level) {
RK if ($sendoff  $high_level) {
RK $logged_sent=trim($logged_sent);
RK if ($logged_sent==$keys){
RK }else{
RK //update the members table sent field with the key #
RK $sql1=Update members set  sent='$keys' where 
email='$logged_email';
RK $result=safe_query($sql1);
RK send_email();
RK }}}//end of all three if statements
RK }//end of $emails while loop

RK } //end $members while loop
  

RK -- 
RK Best regards,
RK  Richard  mailto:[EMAIL PROTECTED]



TR This resets $result

TR //update the members table sent field with the key #
TR $sql1=Update members set  sent='$keys' where 
email='$logged_email';
TR $result=safe_query($sql1);
TR send_email();


TR needs $result3 or something




-- 
Best regards,
 Richardmailto:[EMAIL PROTECTED]


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



[PHP] Problem with apache php and SSL

2003-03-10 Thread Keil
Hi, I'm a newbie with php and I have a big problem with the use of PHP 4.1.1
with apache/1.3.26, mod_ssl/2.8.10 and OpenSSL/0.9.6d. (Tested on Windows
and Linux)

For a demonstration I have to get the user certificate of an SSL connection
to identify the user.
I try to get information's about the client with the following script:
?php
echo Info: \;
echo getenv(REMOTE_USER)  . \br;
echo \ . getenv(SSL_USER) .\br;
echo \ . getenv(LOCAL_USER) .\br;

echo pSSL Version used:  .getenv(SSL_VERSION_LIBRARY);
echo pYour Name:  .getenv(SSL_CLIENT_S_DN_CN);
echo pYour Certificate are signed by:  . getenv(SSL_CLIENT_I_DN_CN);

echo CLIENT br;
echo Issuer:  . $_SERVER['SSL_CLIENT_I_DN'] . br;
echo Subject:  . $_SERVER['SSL_CLIENT_S_DN'] .  br;
echo Validity Start:  . $_SERVER['SSL_CLIENT_V_START'] . br;
echo Validity End:  . $_SERVER['SSL_CLIENT_V_END'];
?
The SSL connection work properly (I debug the client info from apache in a
file) but none of the parameters I used above are set to anything.
Are there special settings in a configuration file or have I compile one
package with special parameters to get an access to the SSL client
certificate information's?

Thaks a lot for every answert!
Werner



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



Re: [PHP] dynamic/multidimensional arrays in classes

2003-03-10 Thread James Holden
$this-$arr[] 

should be

$this-arr[] 

You are using a variable defined within the class - since it is a class variable you can reference it as you would anything else within the class, using '$this-'





Patrick Teague wrote:

I'm having problems figuring this out.  This first way gives me a 'Fatal
Error: Cannot use [] for reading in class.php on line xx'
class myClass
{
  var $arr = array();
  function add_something( $value )
  {
 $this-$arr[] = $value;  // this is the line causing the error
  }
}
I've also tried using count() to find out how many items are in $arr, but it
keeps saying that $r == 0...  i.e.
function add_something( $value )
{
  $r = count($arr);
/*
  if( is_null( $r )
  {
 $r = 0;
  }
*/
  //print( $r );
  $this-$arr[$r] = $value;
}
I've tried this both with  without the commented section  still $r = 0
even if you use '$class-add_something(my value);' 50 times.  I'm guessing
once this problem is solved it will work for multidimensional arrays as
well?
Patrick



 





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


Re: [PHP] timestamp to english

2003-03-10 Thread James Holden
In mysql use

DATE_FORMAT(FROM_UNIXTIME(time),%H ... etc)

In PHP use

echo date(, time());

Read the manuals at mysql.com and php.net.

jim

Lord Loh. wrote:

How do I convert the unix time stamp (the one I get by the time()) to a
readable English language time
I am getting data from mySQL by the now() function

Please Help
Thank You.
Lord Loh.



 





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


Re: [PHP] sessions

2003-03-10 Thread Justin French
Nothing is safe unless it goes over SSL, and even then, NOTHING is 100%
secure :)

The point is that you shouldn't have the plain text password as a session
var...

Your login form (and the script that varifies the login) should be secure
(see note), and should establish a session var like logged_in NOT session
vars like password.  This way, IF the session is hijacked, the hijacker
can only hijack that session NOT find out what the user's password is.

Note: The real issue you have is that the password can be seen in plain text
when the login form is submitted... therefor, you need to be concerned about
running the login process under SSL.


Justin French




on 10/03/03 7:36 PM, Shaun van den Berg ([EMAIL PROTECTED]) wrote:

 Hi,
 
 Tell me , is sessions safe - why is it really used ? Is it important te
 delete the session variables after u use it ? When a user logs on to my site
 , he enters the password , i then encrypt the password and verify it with
 the one in the database ! Will someone be able to hijack the session getting
 the password before i encrypt it ?
 
 Thanks
 Shaun
 
 --
 Novtel Consulting
 Tel: +27 21 9822373
 Fax: +27 21 9815846
 Please visit our website:
 www.novtel.co.za
 
 


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



Re: [PHP] Forcing page refresh with http headers?

2003-03-10 Thread adrian [EMAIL PROTECTED]
a trick i use is with the time() function
e.g. 
$var = time();
then
header('location: .page.php?var=' .$var);
This forces the browser to retrive the page again from the server.
might be of some use.
adrian.
- Original Message - 
From: Daniel Joyce [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, March 07, 2003 5:34 PM
Subject: [PHP] Forcing page refresh with http headers?


 I've used the HTTP Location, Expire, and Refresh headers to no effect. 
 What's the magic order to
 
 1) Refer a browser to a new location
 2) Ensure that the location is refreshed?
 
 I want to avoid using meta http-equiv tags, as this complicates things 
   in the system I am designing
 
 -Daniel
 
 
 -- 
 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] eval error

2003-03-10 Thread Alawi

what problem I want to use eval in my script but its generate this error : 
Parse error: parse error, unexpected T_LNUMBER in 
C:\Projects\phpmag\admin\functions\admin_cont.php(22) : eval()'d code on line 4

Parse error: parse error, unexpected T_LNUMBER in 
C:\Projects\phpmag\admin\functions\admin_cont.php(22) : eval()'d code on line 4

Parse error: parse error, unexpected T_LNUMBER in 
C:\Projects\phpmag\admin\functions\admin_cont.php(40) : eval()'d code on line 4

Parse error: parse error, unexpected T_LNUMBER in 
C:\Projects\phpmag\admin\functions\admin_cont.php(40) : eval()'d code on line 4

Parse error: parse error, unexpected T_LNUMBER in 
C:\Projects\phpmag\admin\functions\admin_cont.php(40) : eval()'d code on line 4

Parse error: parse error, unexpected T_LNUMBER in 
C:\Projects\phpmag\admin\functions\admin_cont.php(40) : eval()'d code on line 4
A { font-style : normal;text-decoration : none;}
this is the cod from line 18

WHILE (!$ALL_TYPES_RS-EOF) {
   //vars
 extract($ALL_TYPES_RS-fields,EXTR_OVERWRITE);
//eval
eval (\$all_types_list .= \$all_types_list\;);
$ALL_TYPES_RS-MoveNext();
}
 $contform = put_sun_in_father(ALL_TYPES, $all_types_list, contform);




-
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, and more

[PHP] Calling Multi-Row Result PHP Variable in Flash

2003-03-10 Thread Rahul.Brenda
Hi,

I used a script to generate some result from a
database, which i want to display in flash.

In Flash, i created the Dynamic Text and declared
newsbits as Vars, and set it to Multiline.
I also loaded the PHP variables with the following
command in the ActionScript of the Frame :
loadVariablesNum (newsbits.php, 0);

The problem is.. my PHP Script generates a multiline
result.. that is, 4 rows are returned.. however, in my
Flash file, only the Last Row is displayed.. the first
3 are not.. how do i do this?

In my PHP file (newsbits.php), i'm running the
following code..

?php
$db = mysql_connect(localhost,user,pass);
mysql_select_db(myDB,$db);

$result = mysql_query(SELECT substring_index(title,'
', 6) FROM news ORDER BY ID desc limit 4,$db);
if (!mysql_num_rows($result)) {
print 'no results';
} else {
while (list($title) = mysql_fetch_row($result)) {
print newsbits=$title...;
}
}
?


When i run newsbits.php on my server, i get perfect
result.. 4 rows are returned, but in my Flash only the
last record is appearing.. What do i have to do so
that all 4 rows appear? 
I tried the following in my php : print
newsbits=$title...br; 
which obviously will seem silly to those who know
something about this.. but hey, 'm desperate. :0)not
to mention it didnt work!!

Rahul S. Johari

__
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/

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



[PHP] Re: google-apis

2003-03-10 Thread Peter Clarke
Jens Lehmann wrote:
James wrote:

LWP is a perl thing.  Curl is probably the best thing to use.
Have you tried using googles php api which they provide free?
http://www.google.com/apis/


I had a look at the API, but I'm not sure if it's appropriate and easy 
to use with PHP. It's still beta and might change again (or maybe I've 
to pay for every query soon). Has anyone already used the api? Is it 
simple to (for instance) find out all listed pages of www.foo.com which 
are in the Top 1000?

Jens


You'll need to have PEAR::SOAP installed (very easy with php-4.3).
Get SOAP_Google.php from http://www.sebastian-bergmann.de/?page=google
You'll need to register with google to get an licenseKey.
Then a simple search:
?php
require_once 'SOAP_Google.php';
$google = new SOAP_Google('your license key');

$result = $google-search(
  array(
'query' = 'sebastian bergmann'
  )
);
if (false !== $result) {
  print_r($result);
} else {
  echo 'Query failed.';
}
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] eval error

2003-03-10 Thread Marek Kilimajer
try
echo \$all_types_list .= \$all_types_list\;;
there should be a syntax error
Alawi wrote:

what problem I want to use eval in my script but its generate this error : 
Parse error: parse error, unexpected T_LNUMBER in C:\Projects\phpmag\admin\functions\admin_cont.php(22) : eval()'d code on line 4

Parse error: parse error, unexpected T_LNUMBER in C:\Projects\phpmag\admin\functions\admin_cont.php(22) : eval()'d code on line 4

Parse error: parse error, unexpected T_LNUMBER in C:\Projects\phpmag\admin\functions\admin_cont.php(40) : eval()'d code on line 4

Parse error: parse error, unexpected T_LNUMBER in C:\Projects\phpmag\admin\functions\admin_cont.php(40) : eval()'d code on line 4

Parse error: parse error, unexpected T_LNUMBER in C:\Projects\phpmag\admin\functions\admin_cont.php(40) : eval()'d code on line 4

Parse error: parse error, unexpected T_LNUMBER in 
C:\Projects\phpmag\admin\functions\admin_cont.php(40) : eval()'d code on line 4
A { font-style : normal;text-decoration : none;}
this is the cod from line 18
   WHILE (!$ALL_TYPES_RS-EOF) {
  //vars
extract($ALL_TYPES_RS-fields,EXTR_OVERWRITE);
   //eval
   eval (\$all_types_list .= \$all_types_list\;);
   $ALL_TYPES_RS-MoveNext();
   }
$contform = put_sun_in_father(ALL_TYPES, $all_types_list, contform);


-
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, and more
 



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


Re: [PHP] MySQL or PHP question?

2003-03-10 Thread Marek Kilimajer
Should not it be:
$SQL = SELECT * FROM table ORDER BY id asc LIMIT .($autoindex -5). ,5;;
John Taylor-Johnston wrote:

I don't know whether this is a MySQL or PHP quesiton.

$SQL = SELECT * FROM table ORDER BY id asc LIMIT $autoindex -5 ,5;;

I would like to get the autoindex value of my table and use it in my SQL. Can I get the autoindex? :) How?

 



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


[PHP] array question

2003-03-10 Thread Diana Castillo
If I sort an array, and now the keys are not in numerical order, how can I
get the key of the first element?
If I do array_shift I get the first element but I want that key.
Thanks,
Diana



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



Re: [PHP] eval error

2003-03-10 Thread Chris Hayes
At 12:54 10-3-03, you wrote:

what problem I want to use eval in my script but its generate this error :
Parse error: parse error, unexpected T_LNUMBER in 
C:\Projects\phpmag\admin\functions\admin_cont.php(22) : eval()'d code on line 4
   eval (\$all_types_list .= \$all_types_list\;);


For those who do not know what all the CAPITALIZED secret words in error 
messages mean: i found a list of them on 
http://www.zend.com/manual/tokens.php. A T_LNUMBER is an integer.

I __suppose__ that $all_types_list contains a number, maybe 144, and while 
you mean to do
$all_types_list.=144;
the eval function somehow evaluates
$all_types_list.=144;

And .= expects a string on the right side, not an integer.

Maybe someone who is more experienced with eval() can shed more light on this.



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


[PHP] session

2003-03-10 Thread Shaun van den Berg
When does the carbadge collector start ?

Thanks
Shaun

--
Novtel Consulting
Tel: +27 21 9822373
Fax: +27 21 9815846
Please visit our website:
www.novtel.co.za



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



Re: [PHP] session

2003-03-10 Thread Marek Kilimajer
When you load a php page there is a session.gc_probability % chance it 
will start.
session.gc_probability is set in php.ini

Shaun van den Berg wrote:

When does the carbadge collector start ?

Thanks
   Shaun
--
Novtel Consulting
Tel: +27 21 9822373
Fax: +27 21 9815846
Please visit our website:
www.novtel.co.za


 



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


Re: [PHP] session

2003-03-10 Thread Petre Agenbag
Garbage collection is a random process. You can however set the
probability of it starting on every session call in the php.ini file,
along with the elapsed time of a session variable, after which it is
considered garbage.
On my system, my probability is set to 1, meaning there is a 1% chance
of the garbage process starting when I call a new session, and my
garbage define time is 1440, meaning if the data is older than that
amount of seconds, then it is to be considered garbage by the next
garbage process, and hence, destroyed...

On Mon, 2003-03-10 at 15:30, Shaun van den Berg wrote:
 When does the carbadge collector start ?
 
 Thanks
 Shaun
 
 --
 Novtel Consulting
 Tel: +27 21 9822373
 Fax: +27 21 9815846
 Please visit our website:
 www.novtel.co.za
 
 
 
 -- 
 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] html mail

2003-03-10 Thread Ian A. Gray
Hi,
I am quite new to php and I am trying to find a way of
sending details of a web form over e-mail in both text
and html format.  There are numerous sites on the web
that try and explain how to do this but they are
worded very complicated and to be honest I haven't
found one that is particularly good.

I want to send an e-mail that contains html code, with
the option of attatching images and other files as
well as a text version of the email so that the viewer
can read the same e-mail whether or not he can view
html email or not.

Any ideas?

Ian Gray.

=

-
Ian A. Gray
Manchester, UK
Telephone: +44 (0) 161 224 1635 - Fax: +44 (0) 870 135 0061 - Mobile: +44 (0) 7900 996 
328
US Fax no.:  707-885-3582
E-mail: [EMAIL PROTECTED] - Websites: www.baritone.uk.com (performance)  
www.vocalstudio.co.uk (Tuition)
-


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

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



[PHP] MySQL and PHP arrays

2003-03-10 Thread {R}ichard Ashton

Is there a generally recommended way of storing an array created by PHP
in a MySQL database field ?

What type of field should it be, and how do you get the whole array 
back in one go without reconstructing it row by row, if that is
possible?

{R} 


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



Re: [PHP] MySQL and PHP arrays

2003-03-10 Thread Jason Wong
On Monday 10 March 2003 22:30, {R}ichard Ashton wrote:
 Is there a generally recommended way of storing an array created by PHP
 in a MySQL database field ?

serialize() and unserialize().

 What type of field should it be, and how do you get the whole array
 back in one go without reconstructing it row by row, if that is
 possible?

Any text field will do, just make sure it's large enough for your data.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
QOTD:
I'm not bald -- I'm hair challenged.

[I thought that was differently haired. Ed.]
*/


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



[PHP] Connection Report

2003-03-10 Thread guslist
Hello All,

I have some data in a MySQL table and I need to format it better. I have some 
thousands of data from my users connections like this:

++-+-++--+---++
| id | unixtime| ip  | porta_snmp | porta_switch | ip_cliente  
  | mac_cliente|
++-+-++--+---++
|  1 | 2003-01-07 12:23:24 | AAA.BBB.CCC.DDD | 1604   | 1| 
192.168.1.248 | 0x0090f50e1a5c |
|  2 | 2003-01-07 12:24:11 | AAA.BBB.CCC.DDD | 1604   | 1| 
192.168.1.248 | 0x0090f50e1a5c |
|  3 | 2003-01-07 12:25:34 | AAA.BBB.CCC.DDD | 1604   | 1| 
192.168.1.248 | 0x0090f50e1a5c |
|  4 | 2003-01-07 12:21:19 | AAA.BBB.CCC.DDD | 1604   | 1| 
192.168.1.248 | 0x0090f50e1a5c |
|  5 | 2003-01-07 12:32:01 | AAA.BBB.CCC.DDD | 1604   | 1| 
192.168.1.248 | 0x0090f50e1a5c |
++-+-++--+---++

I want to generate a report with the total time connected, but the most important is 
to get the connection periods.
Example:

Report 1)
User:  0x0090f50e1a5c  
IP:AAA.BBB.CCC.DDD
Day:   01/0
Start: 2003-01-07 12:23:24
Stop:  2003-01-07 12:25:34
Start: 2003-01-07 12:21:19
Stop:  2003-01-07 12:32:01 
Total:00:12:52

Report 2)
UserIPStartStop
TotalDay
0x0090f50e1a5c  AAA.BBB.CCC.DDD   2003-01-07 12:23:24  2003-01-07 12:25:34 
00:02:10 01/07/2003
0x0090f50e1a5c  AAA.BBB.CCC.DDD   2003-01-07 12:21:19  2003-01-07 12:32:01 
00:10:42 01/07/2003
Overall 
Total: 00:12:52



Any help on how I could manage this data ?

Thank's in advance,
Gustavo



RE: [PHP] MySQL and PHP arrays

2003-03-10 Thread Messay W Asfaw
Serializing it would be the best way: seralize($myArray) 
then you can get the array back using unseralize($serializedarray)

-Original Message-
From: {R}ichard Ashton [mailto:[EMAIL PROTECTED]
Sent: 10 March 2003 14:31
To: [EMAIL PROTECTED]
Subject: [PHP] MySQL and PHP arrays



Is there a generally recommended way of storing an array created by PHP
in a MySQL database field ?

What type of field should it be, and how do you get the whole array 
back in one go without reconstructing it row by row, if that is
possible?

{R} 


-- 
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] html mail

2003-03-10 Thread Mark Heintz PHP Mailing Lists
The PEAR Mail_mime class tends to take the headache out of this sort of
thing.  See the example at the bottom of the manual page:
http://pear.php.net/manual/en/core.mail.mime.php

mh.

On Mon, 10 Mar 2003, [iso-8859-1] Ian A. Gray wrote:

 Hi,
 I am quite new to php and I am trying to find a way of
 sending details of a web form over e-mail in both text
 and html format.  There are numerous sites on the web
 that try and explain how to do this but they are
 worded very complicated and to be honest I haven't
 found one that is particularly good.

 I want to send an e-mail that contains html code, with
 the option of attatching images and other files as
 well as a text version of the email so that the viewer
 can read the same e-mail whether or not he can view
 html email or not.

 Any ideas?

 Ian Gray.


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



[PHP] html mail

2003-03-10 Thread Ian A. Gray
The pear class looks great, unfortunately my server
doesn't have pear yet. :-(
I didn't realise it was an either/or situation for
sending html or text only e-mails.  I thought you
could send one e-mail which has the content in
text-only and html-format so that the person's e-mail
programme can decide how to read it.

Ian Gray

=

-
Ian A. Gray
Manchester, UK
Telephone: +44 (0) 161 224 1635 - Fax: +44 (0) 870 135 0061 - Mobile: +44 (0) 7900 996 
328
US Fax no.:  707-885-3582
E-mail: [EMAIL PROTECTED] - Websites: www.baritone.uk.com (performance)  
www.vocalstudio.co.uk (Tuition)
-


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

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



Re: [PHP] html mail

2003-03-10 Thread Jason Wong
On Monday 10 March 2003 22:46, Ian A. Gray wrote:
 The pear class looks great, unfortunately my server
 doesn't have pear yet. :-(
 I didn't realise it was an either/or situation for
 sending html or text only e-mails.  I thought you
 could send one e-mail which has the content in
 text-only and html-format so that the person's e-mail
 programme can decide how to read it.

Look in www.phpclasses.org, there's at least one class available which will do 
the job.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Unquestionably, there is progress.  The average American now pays out
twice as much in taxes as he formerly got in wages.
-- H. L. Mencken
*/


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



RE: [PHP] Cleaning up HTML table structure

2003-03-10 Thread Beau Hartshorne
Jens,

I would suggest that you try writing a script that keeps track of how
many tags have been opened (look for ), versus how many tags have
been closed ([^]*/) on a line-by-line basis. Using that number, you
should be able to indent the code properly.

Let us know what you've got so far.

Beau

 table ... 
tr ... 
  td ... 
table ...
  tr ... 
td ... 
  ...
/td
td ... 
  ...
/td
  /tr
/table
  /td
/tr
 /table



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



Re: [PHP] html mail

2003-03-10 Thread Dickon Newman
There is a technique to make a large comment at the top of your html based
email, which would be your content readable by the users who have text-only.

Granted all the html code would be at the bottom.  I saw it done in a
newsletter or two, very cleaver and effective!

Dickon...

- Original Message -
From: Ian A. Gray [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, March 10, 2003 9:46 AM
Subject: [PHP] html mail


 The pear class looks great, unfortunately my server
 doesn't have pear yet. :-(
 I didn't realise it was an either/or situation for
 sending html or text only e-mails.  I thought you
 could send one e-mail which has the content in
 text-only and html-format so that the person's e-mail
 programme can decide how to read it.

 Ian Gray

 =

 -
 Ian A. Gray
 Manchester, UK
 Telephone: +44 (0) 161 224 1635 - Fax: +44 (0) 870 135 0061 - Mobile: +44
(0) 7900 996 328
 US Fax no.:  707-885-3582
 E-mail: [EMAIL PROTECTED] - Websites: www.baritone.uk.com
(performance)  www.vocalstudio.co.uk (Tuition)
 -


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

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




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



Re: [PHP] array question

2003-03-10 Thread Jason Wong
On Monday 10 March 2003 21:13, Diana Castillo wrote:
 If I sort an array, and now the keys are not in numerical order, how can I
 get the key of the first element?
 If I do array_shift I get the first element but I want that key.

Not very elegant -- there must be a better way?

foreach ($doo as $key = $value) {
  print Key:$key Value:$value;  
  break;
}

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Questionable day.

Ask somebody something.
*/


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



Re: [PHP] array question

2003-03-10 Thread Ernest E Vogelsinger
At 16:35 10.03.2003, Jason Wong said:
[snip]
Not very elegant -- there must be a better way?

foreach ($doo as $key = $value) {
  print Key:$key Value:$value;  
  break;
}
[snip] 

Possibly using array_keys()?

$keys = array_keys($doo);
echo First key is \{$keys[0]}\;

array_keys() comes in handy if you want to have random access to an
associtive array without knowing the keys.


-- 
   O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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



[PHP] standard html, hidden table's row and controls

2003-03-10 Thread enediel
good day to all readers.
It's specifically a javascript question.

I've a form containing a hidden table, and inside of this last, controls
that contain useful information invisible to the user, for example, hidden
select tags that contains set of items, only subsets of it are visible to
the user.

form name=form_HiddenSets
table
 tr style=display:none
   td
 select name=R_InstitutionsSet_Institutions
  ... option tags
/select
   /td
  /tr
/table
/form

if the row is invisible I receive this message
  frm.R_InstitutionsSet_Institutions has no properties.

changing tr style=display:none to tr the program works correctly.

Any suggestion?
?why this error, when no matter if the row is visible or not, the object
R_InstitutionsSet_Institutions should be part of the form?

I use only the most standard html specifications, using NetScape navigator
to test my program; over IE, this solution works perfectly.

Thanks in advance

Enediel
Linux user 300141

Happy who can penetrate the secret causes of the things
¡Use Linux!


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



Re: [PHP] Cleaning up HTML table structure

2003-03-10 Thread Jens Lehmann
Beau Hartshorne wrote:
Jens,

I would suggest that you try writing a script that keeps track of how
many tags have been opened (look for ), versus how many tags have
been closed ([^]*/) on a line-by-line basis. Using that number, you
should be able to indent the code properly.
I need to count how often the important tags (table, tr, td) have been 
opened, but that's only a part of the solution. It doesn't make sense to 
count every  and  because most of the tags don't play a role (in the 
script I should write).

Let us know what you've got so far.
I solved the problem by first getting all position of the table, tr and 
td-tags. After that I go serially from the first to the last occurence 
of a tag and keep track how often it was opened and closed. Additionally 
I have a variable which counts the numbers of bytes I added to the text. 
After that I reduce the linelength to less than $maxlength chars.

Jens

PS: If you want a tool which really cleans up HTML you should use 
HTMLTidy of course. :)

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


RE: [PHP] array question

2003-03-10 Thread Ford, Mike [LSS]
 -Original Message-
 From: Jason Wong [mailto:[EMAIL PROTECTED]
 Sent: 10 March 2003 15:35
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] array question
 
 
 On Monday 10 March 2003 21:13, Diana Castillo wrote:
  If I sort an array, and now the keys are not in numerical 
 order, how can I
  get the key of the first element?
  If I do array_shift I get the first element but I want that key.
 
 Not very elegant -- there must be a better way?
 
 foreach ($doo as $key = $value) {
   print Key:$key Value:$value;  
   break;
 }

How about

   reset($doo);
   $first_key = key($doo);

?

Cheers!

Mike

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

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



Re: [PHP] Cleaning up HTML table structure

2003-03-10 Thread Chris Hayes

PS: If you want a tool which really cleans up HTML you should use HTMLTidy 
of course. :)
http://tidy.sourceforge.net/#source 

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


Re: [PHP] MySQL and PHP arrays

2003-03-10 Thread {R}ichard Ashton
On Mon, 10 Mar 2003 22:34:44 +0800, Jason Wong wrote:

On Monday 10 March 2003 22:30, {R}ichard Ashton wrote:
 Is there a generally recommended way of storing an array created by PHP
 in a MySQL database field ?

serialize() and unserialize().

 What type of field should it be, and how do you get the whole array
 back in one go without reconstructing it row by row, if that is
 possible?

Any text field will do, just make sure it's large enough for your data.

Thanks that now makes much more sense. So when I look at the data in
the database I see
a:142:{i:1;s:52:[52characters];i:2;s:37:[37characters] and so on for
the 142 elements of the array.

But getting it out is not so easy.

$result = mysql_query(  select post from posts where id = '$id' )

Gives $result as a Resource id #6 which is OK but I cant find the PHP
MySQL command to get the whole field back to unserialize it :(

{R}



-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
QOTD:
   I'm not bald -- I'm hair challenged.

   [I thought that was differently haired. Ed.]
*/


-- 
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] New mailing list

2003-03-10 Thread Ron Clark
http://betterphp.org

The Better PHP mailing list is available for anyone who wants to learn
how to write secure, efficient web applications. We focus on the LAMP
(Linux-Apache-MySQL-PHP) platform but welcome other questions.

This list is intended for people who use PHP, and who want feedback on
code style, security, and other more advanced PHP topics.

Please note: this list is moderated. Anything you can find in standard
documentation will not be forwarded to the list, as we are trying to
keep the discussion about style, not syntax.

Everyone is welcome to join and learn, the goal is to get programmers
thinking about security.
-- 
Ron Clark
System Administrator/Web Coordinator
Armstrong Atlantic State University
11935 Abercorn Street 
Savannah, Ga 31419
Phone: 912 961 3234
Fax: 912 927 5353

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



[PHP] Persistent values between executions

2003-03-10 Thread Mike Mannakee
I have some sets of values that I have stored in several tables in a mySQL
database.  These don't often change, but are referenced on every single page
view.  While each call is quick, as a gross the load on the server is too
high.  I would like to know if there is a way to have these sets of values
remain persistent in the server's memory between calls from browsers, like
environment variables, to reduce the back and forth calls to mySQL.  As the
data from the calls are almost always the same, it would seem easier this
way.

Any thoughts?  Comments?  RTFM suggestions?

Mike



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



[PHP] active x like

2003-03-10 Thread Diana Castillo
I am using php to send an xml request, but the people on the side that
receives the xml says they can only receive from activex generated xml (with
code similar to below)

Does anyone know how to generate the xml from php so it comes out exactly
like it does from this active x object?

var s;

var url = http://www.tourico-demo.com/xmlserver.asp;;

var xmlHttp = new ActiveXObject (Microsoft.XMLHTTP);

s = bodyopCodeOP_GET_CUSTOMERS/opCode;

s += lastName + lastName + /lastName;

s += firstName + firstName + /firstName;

xmlHttp.open(POST, url, false);

xmlHttp.send(s);

var xmlDoc = xmlHttp.responseXML;

var root = xmlDoc.documentElement

if (root)

node = root.selectSingleNode(./opCode);

if (node) {

...

}




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



Re: [PHP] MySQL and PHP arrays

2003-03-10 Thread Mike Mannakee
You get at the data through $array = mysql_result($result,0,0);

Mike


{R}Ichard Ashton [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 On Mon, 10 Mar 2003 22:34:44 +0800, Jason Wong wrote:

 On Monday 10 March 2003 22:30, {R}ichard Ashton wrote:
  Is there a generally recommended way of storing an array created by PHP
  in a MySQL database field ?
 
 serialize() and unserialize().
 
  What type of field should it be, and how do you get the whole array
  back in one go without reconstructing it row by row, if that is
  possible?
 
 Any text field will do, just make sure it's large enough for your data.

 Thanks that now makes much more sense. So when I look at the data in
 the database I see
 a:142:{i:1;s:52:[52characters];i:2;s:37:[37characters] and so on for
 the 142 elements of the array.

 But getting it out is not so easy.

 $result = mysql_query(  select post from posts where id = '$id' )

 Gives $result as a Resource id #6 which is OK but I cant find the PHP
 MySQL command to get the whole field back to unserialize it :(

 {R}



 --
 Jason Wong - Gremlins Associates - www.gremlins.biz
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *
 --
 Search the list archives before you post
 http://marc.theaimsgroup.com/?l=php-general
 --
 /*
 QOTD:
  I'm not bald -- I'm hair challenged.
 
  [I thought that was differently haired. Ed.]
 */
 
 
 --
 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] Persistent values between executions

2003-03-10 Thread Rich Gray

 I have some sets of values that I have stored in several tables in a mySQL
 database.  These don't often change, but are referenced on every
 single page
 view.  While each call is quick, as a gross the load on the server is too
 high.  I would like to know if there is a way to have these sets of values
 remain persistent in the server's memory between calls from browsers, like
 environment variables, to reduce the back and forth calls to
 mySQL.  As the
 data from the calls are almost always the same, it would seem easier this
 way.

 Any thoughts?  Comments?  RTFM suggestions?

 Mike

Use a 404 handler to build static html pages from the database. To refresh
the content just delete the static content - this could be done
automatically at predetermined intervals using cron or similar.

FFT
Rich


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



[PHP] quick question

2003-03-10 Thread Doug Parker
I'm sending credit card info to a 3rd party credit card processing site. 
 I would like to keep the inputted values and, after the approval, have 
them appear in the value part of the form so that they don't have to 
re-input the same values they had just put in for the credit card.  how 
can i do this?

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


RE: [PHP] MySQL and PHP arrays

2003-03-10 Thread Van Andel, Robbert
mysql_fetch_array($result) works too.  It fetches the data from the current row and is 
used in conjunction with a while loop:

while($array=mysql_fetch_array($result))
{
//stuff to do with the current array
}



Robbert van Andel 



-Original Message-
From: Mike Mannakee [mailto:[EMAIL PROTECTED]
Sent: Monday, March 10, 2003 8:45 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] MySQL and PHP arrays


You get at the data through $array = mysql_result($result,0,0);

Mike


{R}Ichard Ashton [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 On Mon, 10 Mar 2003 22:34:44 +0800, Jason Wong wrote:

 On Monday 10 March 2003 22:30, {R}ichard Ashton wrote:
  Is there a generally recommended way of storing an array created by PHP
  in a MySQL database field ?
 
 serialize() and unserialize().
 
  What type of field should it be, and how do you get the whole array
  back in one go without reconstructing it row by row, if that is
  possible?
 
 Any text field will do, just make sure it's large enough for your data.

 Thanks that now makes much more sense. So when I look at the data in
 the database I see
 a:142:{i:1;s:52:[52characters];i:2;s:37:[37characters] and so on for
 the 142 elements of the array.

 But getting it out is not so easy.

 $result = mysql_query(  select post from posts where id = '$id' )

 Gives $result as a Resource id #6 which is OK but I cant find the PHP
 MySQL command to get the whole field back to unserialize it :(

 {R}



 --
 Jason Wong - Gremlins Associates - www.gremlins.biz
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *
 --
 Search the list archives before you post
 http://marc.theaimsgroup.com/?l=php-general
 --
 /*
 QOTD:
  I'm not bald -- I'm hair challenged.
 
  [I thought that was differently haired. Ed.]
 */
 
 
 --
 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] HTTP_REFERER security implications?

2003-03-10 Thread Tom Woody
I am working on a simple authentication script, where the user submits a
login and password, the credentials are checked and the user is
redirected to another script.  The new script checks the HTTP_REFERER
and if its the original script it continues, otherwise it stops with a
message about being unauthorized.

What kind of security implications may I be backing myself into?  I want
to try and stay away from cookies, and as small as this is I think
Session management is a little overkill.  The average user isn't going
to spend much more than 1 or 2 minutes on the site (not much for them to
see or do).  I have seen this method used on other sites, but I prefer
to check with the experts first.

thanks,

-- 
Tom

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



Re: [PHP] timestamp to english

2003-03-10 Thread Joel Colombo
jim

there is no need for the second parameter in Date() for PHP, unless u want
something other then current time.
Date ('m-d-y') is the same as Date ('m-d-y', Time())

Joel


James Holden [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 In mysql use

 DATE_FORMAT(FROM_UNIXTIME(time),%H ... etc)

 In PHP use

 echo date(, time());

 Read the manuals at mysql.com and php.net.

 jim

 Lord Loh. wrote:

 How do I convert the unix time stamp (the one I get by the time()) to a
 readable English language time
 
 I am getting data from mySQL by the now() function
 
 Please Help
 Thank You.
 
 Lord Loh.
 
 
 
 
 






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



Re: [PHP] quick question

2003-03-10 Thread Marco Tabini
You should look at E-xact (http://www.e-xact.com). They have a solution
they call tagged transactions that actually replaces the credit card
numbers with tags that are only meaningful in the context of your
merchant account. That way, you can let your customers make repeat
purchases without actually having to store CC numbers on your site.

Cheers,


Marco

--
php|architect - The Magazine for PHP Professionals
Get your free copy today at http://www.phparch.com

On Mon, 2003-03-10 at 11:46, Doug Parker wrote:
 I'm sending credit card info to a 3rd party credit card processing site. 
   I would like to keep the inputted values and, after the approval, have 
 them appear in the value part of the form so that they don't have to 
 re-input the same values they had just put in for the credit card.  how 
 can i do this?
 


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



[PHP] Re: standard html, hidden table's row and controls

2003-03-10 Thread Joel Colombo
This is a PHP group please post JS questions to a JS group unless u have PHP
code in inside requiring help !!!

IE considers it non-active when style.display = 'none'

you can not reference it via the 'javascipt' controls.
it must be made visible to work in IE... i think u should look at another
solution.
perhaps an array of the items stored in javascript with a simple input
type=hidden to store the active one.
i have ALOT of experience with the div style hidden areas.

Joel





Enediel [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 good day to all readers.
 It's specifically a javascript question.

 I've a form containing a hidden table, and inside of this last, controls
 that contain useful information invisible to the user, for example, hidden
 select tags that contains set of items, only subsets of it are visible to
 the user.

 form name=form_HiddenSets
 table
  tr style=display:none
td
  select name=R_InstitutionsSet_Institutions
   ... option tags
 /select
/td
   /tr
 /table
 /form

 if the row is invisible I receive this message
   frm.R_InstitutionsSet_Institutions has no properties.

 changing tr style=display:none to tr the program works correctly.

 Any suggestion?
 ?why this error, when no matter if the row is visible or not, the object
 R_InstitutionsSet_Institutions should be part of the form?

 I use only the most standard html specifications, using NetScape navigator
 to test my program; over IE, this solution works perfectly.

 Thanks in advance

 Enediel
 Linux user 300141

 Happy who can penetrate the secret causes of the things
 ¡Use Linux!




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



[PHP] Opening a file in a new window

2003-03-10 Thread Todd Cary
 Thanks to your help, this now is working:

?
 $session_id  = $HTTP_POST_VARS[session_id];
 $filename= $HTTP_POST_VARS[filename];
 /* Validate session_id here */

 header(Content-type: text/html);
 header(Content-Disposition: filename= . $filename);
 $fp = fopen($filename, r);
 if($fp) {
   fpassthru($fp);
   fclose($fp);
 }
?
Now I would like to open the file in a new window and I am not sure how 
to do that.

Todd

--
Ariste Software, Petaluma, CA 94952 \n [EMAIL PROTECTED]


RE: [PHP] Opening a file in a new window

2003-03-10 Thread George Pitcher
Todd,

if that script is the result of a link being follwed, add target=blank to
the end.

George

 -Original Message-
 From: Todd Cary [mailto:[EMAIL PROTECTED]
 Sent: 10 March 2003 5:28 pm
 To: [EMAIL PROTECTED]
 Subject: [PHP] Opening a file in a new window


   Thanks to your help, this now is working:

 ?
   $session_id  = $HTTP_POST_VARS[session_id];
   $filename= $HTTP_POST_VARS[filename];

   /* Validate session_id here */

   header(Content-type: text/html);
   header(Content-Disposition: filename= . $filename);
   $fp = fopen($filename, r);
   if($fp) {
 fpassthru($fp);
 fclose($fp);
   }
 ?

 Now I would like to open the file in a new window and I am not sure how
 to do that.

 Todd

 --
 Ariste Software, Petaluma, CA 94952 \n [EMAIL PROTECTED]



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



[PHP] arrray

2003-03-10 Thread Diana Castillo
Is the only way to keep an array alive between one class and another to
store it as a session array?



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



[PHP] Re: [PHP-DEV] Language Auto Detection / www.php.net

2003-03-10 Thread Mincu Alexandru
I don't like the Language Auto Detection system either but mabe others
do... so I don't think it should be removed .. 
On Mon, 2003-03-10 at 19:41, Wez Furlong wrote:
 Perhaps because he prefers to read most sites in his native language?
 
 --Wez.
 
 On Mon, 10 Mar 2003, Mincu Alexandru wrote:
 
  why not set your browser accept language to english?
-- 
Mincu Alexandru intelinet.ro
Tel:+4 0745 369719  +4 021 3140021
www.intelinet.ro[EMAIL PROTECTED]



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



Re: [PHP] Persistent values between executions

2003-03-10 Thread Mike Mannakee
Thanks, but what I need are static values accessible in the script, without
having to fetch them from the database every single page view.  They do
occassionally change, but in the main they're fairly static.

Mike


Rich Gray [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 
  I have some sets of values that I have stored in several tables in a
mySQL
  database.  These don't often change, but are referenced on every
  single page
  view.  While each call is quick, as a gross the load on the server is
too
  high.  I would like to know if there is a way to have these sets of
values
  remain persistent in the server's memory between calls from browsers,
like
  environment variables, to reduce the back and forth calls to
  mySQL.  As the
  data from the calls are almost always the same, it would seem easier
this
  way.
 
  Any thoughts?  Comments?  RTFM suggestions?
 
  Mike
 
 Use a 404 handler to build static html pages from the database. To refresh
 the content just delete the static content - this could be done
 automatically at predetermined intervals using cron or similar.

 FFT
 Rich




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



[PHP] form submission and storing variables

2003-03-10 Thread Doug Parker
I'm sending information to be processed by a third party site.  I need 
to store the inputted information in my site, via session or whatever, 
at some point.  However, the 3rd part site only accepts the information 
via a POST form submission, so I can't record the variables, then 
redirect them to the 3rd party site via a header function.  What should 
I do?

any help would be greatly appreciated.

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


[PHP] image question

2003-03-10 Thread Anthony Ritter
I'm looking for a php tutorial or script which can open and read an existing
.jpg or .png from another URL.

Next, the script then modifies that image by - say - cropping off the bottom
by 20px or resizing it by 50%.

Lastly, could this modified file then be renamed on ones server?

Many thanks,
Tony Ritter






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



Re: [PHP] HTTP_REFERER security implications?

2003-03-10 Thread Kevin Stone
- Original Message -
From: Tom Woody [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, March 10, 2003 9:53 AM
Subject: [PHP] HTTP_REFERER security implications?


 I am working on a simple authentication script, where the user submits a
 login and password, the credentials are checked and the user is
 redirected to another script.  The new script checks the HTTP_REFERER
 and if its the original script it continues, otherwise it stops with a
 message about being unauthorized.

 What kind of security implications may I be backing myself into?  I want
 to try and stay away from cookies, and as small as this is I think
 Session management is a little overkill.  The average user isn't going
 to spend much more than 1 or 2 minutes on the site (not much for them to
 see or do).  I have seen this method used on other sites, but I prefer
 to check with the experts first.

 thanks,

 --
 Tom

Yes I have read that the HTTP_REFERER can easily be faked by controlling the
name on a proxyserver (although I have never done so myself).  Once set up
all you have to do is post through an idential form and voila, you're in.  A
good analogy of the level of security we're talking about is a common door
lock... enough to keep out the casual individual but a thiefe can enter with
little or no trouble.  And isn't it the thieves you're worried about?
-Kevin



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



[PHP] delete from array

2003-03-10 Thread Steve Buehler
Not sure if there is a function that I missed when I did a search on this 
at php.net, but here is the situation:

I have an array that looks something like this:
12:00:00
12:05:00
12:10:00
12:15:00
Bascially, it just has all times in it for a day in 5 minute 
increments.  This is more of a template array for other things that I am 
doing.  How do I delete a specific time out of the array or how do I delete 
a range of times out of the array?  I would like to be able to delete 
12:05:00 but if I want, delete a range like 12:05:00 to 12:10:00.  I have 
other arrays that do NOT have numbers (times) in them and would like to be 
able to delete a specific item out of them too.

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


[PHP] Multi-select inputs and naming

2003-03-10 Thread Dan Phiffer
Hello,

Am I correct in my understanding that for a multi-select input, PHP requires
that the name attribute end with square brackets (i.e. select
name=my_select[] multiple) in order for the submission be handled
properly?

I know this is somewhat nit-picky, but this seems to unnecessarily expose
the underlying technology such that scanning the HTML source reveals that a
PHP script will ultimately parse the submission.

I'm hoping there's some alternative technique I've missed...

-Dan



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



RE: [PHP] delete from array

2003-03-10 Thread Johnson, Kirk
How do I delete a specific time out of the array or 
 how do I delete 
 a range of times out of the array?  I would like to be able to delete 
 12:05:00 but if I want, delete a range like 12:05:00 to 
 12:10:00.

Here's some code.

Kirk

function remove_array_values($valuesToRemove, $array)
{
  if (is_array($array))
  {
// convert the input to an array, so only one logic block is needed
below
if (!is_array($valuesToRemove))
{
  $valuesToRemove = (array) $valuesToRemove;
}

foreach ($valuesToRemove as $value)
{
  $match = true;
  // use the do...while to get multiple occurrences of the value to
delete
  do
  {
// array_search returns 'null' or 'false' if the value is not found,
// and the index if the value is found, so any number indicates a
match
$index = array_search($value, $array);
if (is_numeric($index))
{
  unset($array[$index]);
}
else
{
  $match = false;
}
  }
  while ($match);
}
// re-index the array
return array_values($array);
  }
  else
  {
// return false on bad input
return false;
  }
}

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



[PHP] Is the problem a server setting?

2003-03-10 Thread Chad Henderson
I have a number of websites that are on a hosting company, that I have been
using for a year or so. Suddenly, this morning, all of the websites began to
have PHP script errors on scripts that have run without fail for a long
period of time. I think the server setup must have been altered this weekend
but do not know how to look for or prove this. Any ideas would be greatly
appreciated.

Here is the error you get when you try to load http://www.afgaonline.com

--paste--

Warning: file(http://www.afgaonline.com/templates/tem4.tem) [function.file]:
failed to create stream: HTTP request failed! ¿¯wT in
/home/afgaonli/public_html/includes/Template.php on line 15

 --end paste --

The text that follows failed! above always changes.

Here is the code that is failing:

12function Template ($template)
13 {
14   $this-template = $template;
15   $this-html = implode (,(file($this-template)));
16 }

What should I look for?
thanks!

Chad




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



Re: [PHP] Is the problem a server setting?

2003-03-10 Thread Ray Hunter
You should contact the web hosting system administrator and verify that
they upgraded php.  From what i can tell it seems that they did upgrade
php.

--
Ray

On Mon, 2003-03-10 at 10:58, Chad Henderson wrote:
 I have a number of websites that are on a hosting company, that I have been
 using for a year or so. Suddenly, this morning, all of the websites began to
 have PHP script errors on scripts that have run without fail for a long
 period of time. I think the server setup must have been altered this weekend
 but do not know how to look for or prove this. Any ideas would be greatly
 appreciated.
 
 Here is the error you get when you try to load http://www.afgaonline.com
 
 --paste--
 
 Warning: file(http://www.afgaonline.com/templates/tem4.tem) [function.file]:
 failed to create stream: HTTP request failed! ¿¯wT in
 /home/afgaonli/public_html/includes/Template.php on line 15
 
  --end paste --
 
 The text that follows failed! above always changes.
 
 Here is the code that is failing:
 
 12function Template ($template)
 13 {
 14   $this-template = $template;
 15   $this-html = implode (,(file($this-template)));
 16 }
 
 What should I look for?
 thanks!
 
 Chad
 
 
 
 
 -- 
 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] form submission and storing variables

2003-03-10 Thread Mark Heintz PHP Mailing Lists
You can initiate a POST from within your script using cURL, assuming your
php installation has cURL support enabled.  Check http://www.php.net/curl
for details.

mh.

On Mon, 10 Mar 2003, Doug Parker wrote:

 I'm sending information to be processed by a third party site.  I need
 to store the inputted information in my site, via session or whatever,
 at some point.  However, the 3rd part site only accepts the information
 via a POST form submission, so I can't record the variables, then
 redirect them to the 3rd party site via a header function.  What should
 I do?

 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



Fw: [PHP] Multi-select inputs and naming

2003-03-10 Thread Kevin Stone

- Original Message -
From: Dan Phiffer [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, March 10, 2003 11:24 AM
Subject: [PHP] Multi-select inputs and naming


 Hello,

 Am I correct in my understanding that for a multi-select input, PHP
requires
 that the name attribute end with square brackets (i.e. select
 name=my_select[] multiple) in order for the submission be handled
 properly?

 I know this is somewhat nit-picky, but this seems to unnecessarily expose
 the underlying technology such that scanning the HTML source reveals that
a
 PHP script will ultimately parse the submission.

 I'm hoping there's some alternative technique I've missed...

 -Dan


Yes.  The values must be passed as an array.  In order to do that the select
tag requires the [] braces.  The proper syntax is:
select name=my_select[] multiple
optionOne/option
optionTwo/option
optionThree/option
/select

?
// To read the selected items...
for($i=0; $icount($_POST['my_select']); $i++)
{
echo $_POST['my_select'][$i].br;
}
?

Hope that helps.

- Kevin




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



Re: [PHP] quick question

2003-03-10 Thread CPT John W. Holmes
 I'm sending credit card info to a 3rd party credit card processing site.
   I would like to keep the inputted values and, after the approval, have
 them appear in the value part of the form so that they don't have to
 re-input the same values they had just put in for the credit card.  how
 can i do this?

So put the value in the value attribute of your text box.

input type=text name=cc_number value=?=$_POST['cc_number']?

substitute $_POST['cc_number'] with whatever you send to the processing
site.

---John Holmes...


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



[PHP] PHP static module on Apache 2.0 HPUX 11

2003-03-10 Thread Harring Figueiredo


 Folks, I am trying to build Apache 2.0 /PHP (latest) on an HPUX 11. 
 I configured both of them to handle DSO. PHP generates the .so, which later I
rename to .sl and move to the modules directory and run make install
successfully. After adding the LoadModule and the Addtype directive, apache
gives an error saying the it cannot find the libphp4.sl file. On the error
message, it outputs the path - ( When I copy and past the path on a ls command,
I can see that the file exists, and the permissions are set correctly)
  When I manually run apxs on the file, ( apxs -i libphp4.sl ) it tells me that
the file is not a DSO. If I run  the 'file' command on it, it tells me that it
is indeed a DSO.

 -- So, I gave up on the DSO route and switched to STATIC.

   1) PHP build does build the static lib libphp4.a; however, make  install
DOES NOT copy it to the apache source directory (as described on the docs) --
Fine, I copied it manually.

   2) As described on the INSTALL file, I pass the --activate-module for
apache. However, Apache2.0 does not take the  
--activate-module=modules/libphp.a; it says that activate-module is an invalid
flag. I ran ./configure --help and there was nothing similar to this falg.


   Any help would be very apreciated.

  (All the help on php.net about HP has does not address this issue. Also,
there is not docs on how to install PHP/APACHE2.0 as static.)

 Thanks for the help.


HArring.







__
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/

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



Re: [PHP] Multi-select inputs and naming

2003-03-10 Thread Mark Heintz PHP Mailing Lists
On Mon, 10 Mar 2003, Dan Phiffer wrote:

 Am I correct in my understanding that for a multi-select input, PHP requires
 that the name attribute end with square brackets (i.e. select
 name=my_select[] multiple) in order for the submission be handled
 properly?

As far as I know, that is correct.  I'd love to hear otherwise.

 I know this is somewhat nit-picky, but this seems to unnecessarily expose
 the underlying technology such that scanning the HTML source reveals that a
 PHP script will ultimately parse the submission.

Unless you're ashamed to be running php, or don't intend to be spending as
much time on security as you should, why would this be an issue?  If your
app is well-written, the knowledge that it's implemented with php
shouldn't benefit a potential attacker.  You know what they say about
security through obscurity...

 I'm hoping there's some alternative technique I've missed...

I guess you could use javascript to create/set individual hidden form
fields for the items selected, but if the user has javascript disabled
your form ceases to function.

mh.


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



Re: [PHP] Is the problem a server setting?

2003-03-10 Thread Chad Henderson
Thanks for the reply. If they did upgrade PHP, which I am fairly sure they
did, are there changes to the new PHP that would prevent the script from
working?  Or is it a matter of them not setting up the upgrade the same as
the previous installation?



Ray Hunter [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
You should contact the web hosting system administrator and verify that
they upgraded php.  From what i can tell it seems that they did upgrade
php.

--
Ray

On Mon, 2003-03-10 at 10:58, Chad Henderson wrote:
 I have a number of websites that are on a hosting company, that I have
been
 using for a year or so. Suddenly, this morning, all of the websites began
to
 have PHP script errors on scripts that have run without fail for a long
 period of time. I think the server setup must have been altered this
weekend
 but do not know how to look for or prove this. Any ideas would be greatly
 appreciated.

 Here is the error you get when you try to load http://www.afgaonline.com

 --paste--

 Warning: file(http://www.afgaonline.com/templates/tem4.tem)
[function.file]:
 failed to create stream: HTTP request failed! ¿¯wT in
 /home/afgaonli/public_html/includes/Template.php on line 15

  --end paste --

 The text that follows failed! above always changes.

 Here is the code that is failing:

 12function Template ($template)
 13 {
 14   $this-template = $template;
 15   $this-html = implode (,(file($this-template)));
 16 }

 What should I look for?
 thanks!

 Chad




 --
 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] delete from array

2003-03-10 Thread CPT John W. Holmes
 Not sure if there is a function that I missed when I did a search on this
 at php.net, but here is the situation:

 I have an array that looks something like this:
 12:00:00
 12:05:00
 12:10:00
 12:15:00

 Bascially, it just has all times in it for a day in 5 minute
 increments.  This is more of a template array for other things that I am
 doing.  How do I delete a specific time out of the array or how do I
delete
 a range of times out of the array?  I would like to be able to delete
 12:05:00 but if I want, delete a range like 12:05:00 to 12:10:00.  I have
 other arrays that do NOT have numbers (times) in them and would like to be
 able to delete a specific item out of them too.

You can only delete elements from an array if you know the key of that
element. To delete it, you just use the unset() function.

unset($array['key']);

For your problem, though, I assume those are the values of the array,
right? You can either run a loop and go through every value of the array and
deleting it if it matches what you want, or use array_search() to find the
key of the value you're looking for and deleting it.

---John Holmes...


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



Re: [PHP] Is the problem a server setting?

2003-03-10 Thread Mark Heintz PHP Mailing Lists
It sounds like either allow_url_fopen is set to false or php was compiled
with --disable-url-fopen-wrapper.  Either way, checking the output of
phpinfo() should give you your answer.

mh.

On Mon, 10 Mar 2003, Chad Henderson wrote:

 Thanks for the reply. If they did upgrade PHP, which I am fairly sure they
 did, are there changes to the new PHP that would prevent the script from
 working?  Or is it a matter of them not setting up the upgrade the same as
 the previous installation?



 Ray Hunter [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
 You should contact the web hosting system administrator and verify that
 they upgraded php.  From what i can tell it seems that they did upgrade
 php.

 --
 Ray

 On Mon, 2003-03-10 at 10:58, Chad Henderson wrote:
  I have a number of websites that are on a hosting company, that I have
 been
  using for a year or so. Suddenly, this morning, all of the websites began
 to
  have PHP script errors on scripts that have run without fail for a long
  period of time. I think the server setup must have been altered this
 weekend
  but do not know how to look for or prove this. Any ideas would be greatly
  appreciated.
 
  Here is the error you get when you try to load http://www.afgaonline.com
 
  --paste--
 
  Warning: file(http://www.afgaonline.com/templates/tem4.tem)
 [function.file]:
  failed to create stream: HTTP request failed! ¿¯wT in
  /home/afgaonli/public_html/includes/Template.php on line 15
 
   --end paste --
 
  The text that follows failed! above always changes.
 
  Here is the code that is failing:
 
  12function Template ($template)
  13 {
  14   $this-template = $template;
  15   $this-html = implode (,(file($this-template)));
  16 }
 
  What should I look for?
  thanks!
 
  Chad


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



Re: [PHP] Is the problem a server setting?

2003-03-10 Thread Chad Henderson
I did not see the

Mark Heintz Php Mailing Lists [EMAIL PROTECTED] wrote in
message news:[EMAIL PROTECTED]
It sounds like either allow_url_fopen is set to false or php was compiled
with --disable-url-fopen-wrapper.  Either way, checking the output of
phpinfo() should give you your answer.

mh.

On Mon, 10 Mar 2003, Chad Henderson wrote:

 Thanks for the reply. If they did upgrade PHP, which I am fairly sure they
 did, are there changes to the new PHP that would prevent the script from
 working?  Or is it a matter of them not setting up the upgrade the same as
 the previous installation?



 Ray Hunter [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
 You should contact the web hosting system administrator and verify that
 they upgraded php.  From what i can tell it seems that they did upgrade
 php.

 --
 Ray

 On Mon, 2003-03-10 at 10:58, Chad Henderson wrote:
  I have a number of websites that are on a hosting company, that I have
 been
  using for a year or so. Suddenly, this morning, all of the websites
began
 to
  have PHP script errors on scripts that have run without fail for a long
  period of time. I think the server setup must have been altered this
 weekend
  but do not know how to look for or prove this. Any ideas would be
greatly
  appreciated.
 
  Here is the error you get when you try to load http://www.afgaonline.com
 
  --paste--
 
  Warning: file(http://www.afgaonline.com/templates/tem4.tem)
 [function.file]:
  failed to create stream: HTTP request failed! ¿¯wT in
  /home/afgaonli/public_html/includes/Template.php on line 15
 
   --end paste --
 
  The text that follows failed! above always changes.
 
  Here is the code that is failing:
 
  12function Template ($template)
  13 {
  14   $this-template = $template;
  15   $this-html = implode (,(file($this-template)));
  16 }
 
  What should I look for?
  thanks!
 
  Chad



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



Re: [PHP] PHP static module on Apache 2.0 HPUX 11

2003-03-10 Thread Rasmus Lerdorf
   (All the help on php.net about HP has does not address this issue. Also,
 there is not docs on how to install PHP/APACHE2.0 as static.)

That's because we do not support a static build for Apache2.

-Rasmus


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



Re: [PHP] Is the problem a server setting?

2003-03-10 Thread Chad Henderson
Thanks for the reply Mark,

allow_url_fopen is set to on
i did not see anything about --disable-url-fopen-wrapper

Here is the info file:
http://www.afgaonline.com/phpinfo.php




Mark Heintz Php Mailing Lists [EMAIL PROTECTED] wrote in
message news:[EMAIL PROTECTED]
It sounds like either allow_url_fopen is set to false or php was compiled
with --disable-url-fopen-wrapper.  Either way, checking the output of
phpinfo() should give you your answer.

mh.

On Mon, 10 Mar 2003, Chad Henderson wrote:

 Thanks for the reply. If they did upgrade PHP, which I am fairly sure they
 did, are there changes to the new PHP that would prevent the script from
 working?  Or is it a matter of them not setting up the upgrade the same as
 the previous installation?



 Ray Hunter [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
 You should contact the web hosting system administrator and verify that
 they upgraded php.  From what i can tell it seems that they did upgrade
 php.

 --
 Ray

 On Mon, 2003-03-10 at 10:58, Chad Henderson wrote:
  I have a number of websites that are on a hosting company, that I have
 been
  using for a year or so. Suddenly, this morning, all of the websites
began
 to
  have PHP script errors on scripts that have run without fail for a long
  period of time. I think the server setup must have been altered this
 weekend
  but do not know how to look for or prove this. Any ideas would be
greatly
  appreciated.
 
  Here is the error you get when you try to load http://www.afgaonline.com
 
  --paste--
 
  Warning: file(http://www.afgaonline.com/templates/tem4.tem)
 [function.file]:
  failed to create stream: HTTP request failed! ¿¯wT in
  /home/afgaonli/public_html/includes/Template.php on line 15
 
   --end paste --
 
  The text that follows failed! above always changes.
 
  Here is the code that is failing:
 
  12function Template ($template)
  13 {
  14   $this-template = $template;
  15   $this-html = implode (,(file($this-template)));
  16 }
 
  What should I look for?
  thanks!
 
  Chad



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



Re: [PHP] image question

2003-03-10 Thread Hugh Danaher
Tony,
You might want to try the online php manual, I hear it's very good.
You should be able to do all of the tasks you desire.  Look for image in
your search.
Hope this helps.
Hugh
- Original Message -
From: Anthony Ritter [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, March 10, 2003 10:23 AM
Subject: [PHP] image question


 I'm looking for a php tutorial or script which can open and read an
existing
 .jpg or .png from another URL.

 Next, the script then modifies that image by - say - cropping off the
bottom
 by 20px or resizing it by 50%.

 Lastly, could this modified file then be renamed on ones server?

 Many thanks,
 Tony Ritter






 --
 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] A question of time...

2003-03-10 Thread Robert Cummings
Hi all,

I recently had a freelancing experience that has left me somewhat sour and
questioning myself. Unfortunately I don't feel I can fairly evaluate myself
and so I owuld like to put the question to my peers who populate the PHP
forum as to whether I have performed competently.

Last week I took upon myself the task of fixing a clients shopping cart
system by way of adding session support and proper user registration
validation. To give you some idea of the parameters of the job...

- VNC development connection
- live server with no error output
- no session support whatsoever
- cart had no input validation, except basic javascript
- user registration permitted clobbering of other users
  and had no validation either
- PHP code was ad-hoc sprinkled through the pages
- comments were almost non-existent

The first day I decided it would be best to mirror the server so that
development time would be minimized (VNC is terrible for devlopment). This was
done without charge to the client despite it's time saving effect.

The second day I spent 13 hours familiarizing myself with their code and
pages, and on this day I also implemented a session management library for
easily accessing and setting session data (this included hooks for permanent
cookie data storage). I also fixed the user registration process and add
security validation to ensure user information could not accidentally (or
deliberately via form hacking) be accessed by someone other than the
registrant. Previously re-registration of an existing email address regardless
of password would clobber existing customer. At this time I also fixed the
cart and ensured prepopulation of forms for updating registration information.

The third day I first wasted an hour making my changes work on their
server because they decided to rename all the files I had changed thus
breaking all of the include() paths. After that I spent another 3 hours adding
support for returning to previous page before entering any of the cart
checkout or customer registration pages. At this time a response page was also
added to thank the customer for their purchase. Of course all of this was
tested to be functional and where necessary broken pre-existing code was
replaced or fixed to provide the correct functionality.

On the fourth day I spent 3 hours adding support for input validation
feedback to the registration validation so that customer's would know exactly
why they could not continue. I also added support for a password reminder to
inform the user of their password when forgotten. This included adding the
page, adding the form, validating that the user id existed and outputting
appropriate feedback if the user did not exist - and of course testing.

All in all I spent 20 hours total for the client at a rate of $40 USD/hr
which I believe is on the low end of freelance. I myself have 3 years
experience devloping PHP web applications. So the question I ask is whther
this time frame is reasonable, or am I just a slow crappy programmer that is
ripping these people off? They seem to think I should have had this done in
just a few hours, but my experience thus far indicates to me that they got
just service. Additionally it seems before I took the job, they had went
through several other PHP developers would said they couldn't do it (and I
don't really blame them considering the VNC connection and lack of comments or
error feedback).

If it turns out that I am incompetent, then I will happily send them a
bill for zero hours, otherwise I would like to take comfort that I am not
ripping them off.

Sincerely,
Robert Cummings
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

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



Re: [PHP] PHP static module on Apache 2.0 HPUX 11

2003-03-10 Thread Harring Figueiredo

 Rasmus,
 Thanks for the reply.

 Then, what am I doing wrong on the DSO installation ?

 Any docs I could get my hands on ?

 Thanks again.

Harring.


--- Rasmus Lerdorf [EMAIL PROTECTED] wrote:
(All the help on php.net about HP has does not address this issue. Also,
  there is not docs on how to install PHP/APACHE2.0 as static.)
 
 That's because we do not support a static build for Apache2.
 
 -Rasmus
 


=
We should do smart things with stupid technology before we do stupid 
things with smart technology.
  --Bill Buxton, Alias Research


Harring Figueiredo

__
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/

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



Re: [PHP] quick question

2003-03-10 Thread Doug Parker
Right - but the problem is, the form is submitting to another site, so i 
don't have a way to store the variables.   I could put them in session 
variables, but I would have to create another script and then forward 
the form submission to the outside side.  This isn't working because the 
 outside site requires the variables to be submitted via a form, or 
POST i guess.  I don't even know if I'm going about this the right way - 
I just need to somehow store variables on my site that are submitted for 
processing to another site, so that when the user is sent back from that 
other site, i can put the values in the form fields of a new page.

Cpt John W. Holmes wrote:

I'm sending credit card info to a 3rd party credit card processing site.
 I would like to keep the inputted values and, after the approval, have
them appear in the value part of the form so that they don't have to
re-input the same values they had just put in for the credit card.  how
can i do this?
So put the value in the value attribute of your text box.

input type=text name=cc_number value=?=$_POST['cc_number']?

substitute $_POST['cc_number'] with whatever you send to the processing
site.
---John Holmes...




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


Re: [PHP] A question of time...

2003-03-10 Thread CPT John W. Holmes
[snip]
 If it turns out that I am incompetent, then I will happily send them a
 bill for zero hours, otherwise I would like to take comfort that I am not
 ripping them off.

Just my humble opinion, of course, but I think you did the job quickly
considering what you were given to start with. $40/hour is pretty cheap,
too.

No one likes paying and it always seems like a little change to those on
the outside.

It would of been hard to nail down a contract given the circumstances, but
that's what you should have done. Always get it in writing. If you agreed on
$40/hour before hand without a maximum number of hours where you had to
get back to them, then they have to pay.

---John Holmes...


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



[PHP] Re: HTTP_REFERER security implications?

2003-03-10 Thread Joseph Szobody
Tom,

This will completely break in AOL. An AOL user's referer changes all the time. 

Joseph

Tom Woody [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]
 I am working on a simple authentication script, where the user submits a
 login and password, the credentials are checked and the user is
 redirected to another script.  The new script checks the HTTP_REFERER
 and if its the original script it continues, otherwise it stops with a
 message about being unauthorized.
 
 What kind of security implications may I be backing myself into?  I want
 to try and stay away from cookies, and as small as this is I think
 Session management is a little overkill.  The average user isn't going
 to spend much more than 1 or 2 minutes on the site (not much for them to
 see or do).  I have seen this method used on other sites, but I prefer
 to check with the experts first.
 
 thanks,
 
 -- 
 Tom


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



Re: [PHP] A question of time...

2003-03-10 Thread Robert Cummings
CPT John W. Holmes wrote:
 
 [snip]
  If it turns out that I am incompetent, then I will happily send them a
  bill for zero hours, otherwise I would like to take comfort that I am not
  ripping them off.
 
 Just my humble opinion, of course, but I think you did the job quickly
 considering what you were given to start with. $40/hour is pretty cheap,
 too.
 
 No one likes paying and it always seems like a little change to those on
 the outside.
 
 It would of been hard to nail down a contract given the circumstances, but
 that's what you should have done. Always get it in writing. If you agreed on
 $40/hour before hand without a maximum number of hours where you had to
 get back to them, then they have to pay.

Thanks, I did estimate 20 to 30 hours for them after I had set up the mirror
server and before the actual work began. At the same time I asked if they wanted
me to stop to which they replied that I should continue.

Cheers,
Rob.
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

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



Re: [PHP] Multi-select inputs and naming

2003-03-10 Thread Dan Phiffer
 Unless you're ashamed to be running php, or don't intend to be spending as
 much time on security as you should, why would this be an issue?  If your
 app is well-written, the knowledge that it's implemented with php
 shouldn't benefit a potential attacker.  You know what they say about
 security through obscurity...

Hehe, yeah I am being somewhat anal here. I was hoping that with
search-friendly URLS (i.e. /issues/2003/mar/ rather than
/issues.php?year=2003month=mar), I could have the added security benefit of
obscuring the back-end technology. This is more from the theoretical than
practical line of thinking, so I'm not too worried.

While I agree that if the app is well-written it shouldn't matter, but I
figure it couldn't hurt as an added security net. I have another question
reguarding the security implications of source readable PHP projects, but
I'll save that for another thread.

  I'm hoping there's some alternative technique I've missed...

 I guess you could use javascript to create/set individual hidden form
 fields for the items selected, but if the user has javascript disabled
 your form ceases to function.

I guess this question was coming from a couldn't they have designed in a
cleaner way? perspective. Don't get me wrong, I think the way PHP does an
outstanding job of handling these particular kinds of form submissions, I
just figured there might be an alternative syntax.

Thanks for the responses,
-Dan



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



Re: [PHP] A question of time...

2003-03-10 Thread CPT John W. Holmes
[snip]
 Thanks, I did estimate 20 to 30 hours for them after I had set up the
mirror
 server and before the actual work began. At the same time I asked if they
wanted
 me to stop to which they replied that I should continue.

Offer them some cheese with their whine and tell them to pay up!

---John Holmes...


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



Re: [PHP] A question of time...

2003-03-10 Thread Mark Heintz PHP Mailing Lists
On Mon, 10 Mar 2003, Robert Cummings wrote:

 All in all I spent 20 hours total for the client at a rate of $40 USD/hr
 which I believe is on the low end of freelance. I myself have 3 years
 experience devloping PHP web applications. So the question I ask is whther
 this time frame is reasonable, or am I just a slow crappy programmer that is
 ripping these people off? They seem to think I should have had this done in
 just a few hours, but my experience thus far indicates to me that they got
 just service. Additionally it seems before I took the job, they had went
 through several other PHP developers would said they couldn't do it (and I
 don't really blame them considering the VNC connection and lack of comments or
 error feedback).

 If it turns out that I am incompetent, then I will happily send them a
 bill for zero hours, otherwise I would like to take comfort that I am not
 ripping them off.

It sounds very fair to me.  My time would have been similar if not more
(esp. not knowing the state of the existing code), and my hourly rate
2-3 times yours.

mh.



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



[PHP] Question

2003-03-10 Thread Clint Tredway
I have a display of images that every fourth image I want to start a new
column. In ColdFusion I would use the MOD operator like this:

if query.recordcount MOD 4 eq 0
/td
td
/if

I am just having a brain lapse today, can someone help me do this same
functionality in PHP?

Thanks!

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



[PHP] Sessions problem

2003-03-10 Thread David Chamberlin
Hey all,

Some of my users have reported a problem with my site and it's taken a 
while to debug it, but I think I've finally tracked it down.

If they go to the site as:

http://www.mysite.org/

Then it works

But if they go as:

http://mysite.org/

It doesn't.

I believe it has to do with my use of session variables.  Apparently (I 
didn't know this, but it's obvious from the debugging) that there are 
different session ID's and thus different session variables for the two. 
  And the problem is (due to sloppy programming on my part ... sigh 
...) that sometimes I set up the links as a href=/page and 
sometimes I do the explicit a href=http://www.mysite.org/page.  So 
when it goes to the link as www.mysite.org, it registers the variables, 
but then later when it tries to access and it's just mysite.org, the 
variables aren't set.  Lots of confusion ensues.

Is there any way to unify this, or do I have to go through and fix all 
of the absolute links to be relative?

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


Re: [PHP] Multi-select inputs and naming

2003-03-10 Thread Mark Heintz PHP Mailing Lists
On Mon, 10 Mar 2003, Dan Phiffer wrote:

 I guess this question was coming from a couldn't they have designed in a
 cleaner way? perspective. Don't get me wrong, I think the way PHP does an
 outstanding job of handling these particular kinds of form submissions, I
 just figured there might be an alternative syntax.

That is a good question...  I've had the (privelege?) of working with php
almost exclusively for the past 3-4 years, to the point where I've rarely
had to deal with other web-targeted languages (something I'm in the
process of changing).  To others on the list:  how do perl, jsp, asp, etc.
handle the passing of multiple selects?  What is their equivalent of php's
var[] syntax for handling form values?

mh.


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



Re: [PHP] Question

2003-03-10 Thread Mark Heintz PHP Mailing Lists

if($recordcount % 4 == 0)
{
  echo '/tdtd';
}

mh.

On Mon, 10 Mar 2003, Clint Tredway wrote:

 I have a display of images that every fourth image I want to start a new
 column. In ColdFusion I would use the MOD operator like this:

 if query.recordcount MOD 4 eq 0
   /td
   td
 /if

 I am just having a brain lapse today, can someone help me do this same
 functionality in PHP?

 Thanks!


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



[PHP] Re: Question

2003-03-10 Thread Dan Phiffer
Perhaps something like:

?php

if ($record_count % 4 == 0) {
echo /td\ntd;
}

?

HTH,
-Dan

Clint Tredway [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 I have a display of images that every fourth image I want to start a new
 column. In ColdFusion I would use the MOD operator like this:

 if query.recordcount MOD 4 eq 0
 /td
 td
 /if

 I am just having a brain lapse today, can someone help me do this same
 functionality in PHP?

 Thanks!



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



RE: [PHP] Re: Question

2003-03-10 Thread Clint Tredway
thanks, I knew it was simple.. just can't think today!

-Original Message-
From: Dan Phiffer [mailto:[EMAIL PROTECTED]
Sent: Monday, March 10, 2003 2:11 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: Question


Perhaps something like:

?php

if ($record_count % 4 == 0) {
echo /td\ntd;
}

?

HTH,
-Dan

Clint Tredway [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 I have a display of images that every fourth image I want to start a new
 column. In ColdFusion I would use the MOD operator like this:

 if query.recordcount MOD 4 eq 0
 /td
 td
 /if

 I am just having a brain lapse today, can someone help me do this same
 functionality in PHP?

 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] Multi-select inputs and naming

2003-03-10 Thread CPT John W. Holmes
 To others on the list:  how do perl, jsp, asp, etc.
 handle the passing of multiple selects?  What is their equivalent of php's
 var[] syntax for handling form values?

From what I've picked up, if there are multiple variables in the query
string / post data with the same name, the scripting language will
automatically make it into an array.

---John Holmes...


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



[PHP] sessions terminating randomly please help

2003-03-10 Thread freaky deaky
hi 

i am experiencing a major problem with sessions expiring randomly in some of my 
apps. i will log in and start clicking around and then i will eventually 
arrive at a page that tells me that i'm not logged in anymore. this happens 
apparently randomly. i have seen it on ie6, ie for mac, netscape 4.7 for pc, 
and mozilla 

the apps are hosted on 

freebsd 4.7-release p2 
apache 1.3.27 
php version 4.2.3 
compiled with --enable-trans-sid 

i can't go into production if there's the possibility that users will be 
randomly logged off. i went through all of my code over the weekend, and i 
don't think i can attribute this to a miscoding: 

when a user logs in, i create a session with 

session_start(); 
$valid_user=$_POST['username']; 
session_register(valid_user); 

i have the following code at the top of each page to check to see if the session 
is valid: 

session_start(); 
$valid_user=$_SESSION['valid_user']; 
global $valid_user; 
if (session_is_registered(valid_user) 
{...function to spit out an error message if the session is not valid...;} 

i have a logout page that destroys the session 

session_start(); 
session_destroy(); 

i also have a javascript timer in the header of every page that redirects to the 
logout page if the user has been inactive for 20 minutes. 

i have played around with session.gc_probability, setting it to 100, but that 
doesn't seem to have fixed the problem. 

this is a huge problem. 
if anyone can give some advice, i'd really appreciate it. 

thanks

-- 
__
http://www.linuxmail.org/
Now with e-mail forwarding for only US$5.95/yr

Powered by Outblaze

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



RE: [PHP] HTTP_REFERER security implications?

2003-03-10 Thread Don Read

On 10-Mar-2003 Tom Woody wrote:
 I am working on a simple authentication script, where the user submits a
 login and password, the credentials are checked and the user is
 redirected to another script.  The new script checks the HTTP_REFERER
 and if its the original script it continues, otherwise it stops with a
 message about being unauthorized.
 
 What kind of security implications may I be backing myself into?  I want
 to try and stay away from cookies, and as small as this is I think
 Session management is a little overkill.  The average user isn't going
 to spend much more than 1 or 2 minutes on the site (not much for them to
 see or do).  I have seen this method used on other sites, but I prefer
 to check with the experts first.
 

If they use a proxy that doesn't send HTTP_REFERER, It'll break things. 
My numbers say it happens about about 15% of the time:

mysql select count(*) from hit where urlid=0;
+--+
| count(*) |
+--+
|83082 |
+--+
1 row in set (0.53 sec)

mysql select count(*) from hit;
+--+
| count(*) |
+--+
|   541557 |
+--+
1 row in set (0.00 sec)


Since you don't want to use sessions, maybe 401 WWW-authenticate method
would work better for your application.

Regards,
-- 
Don Read   [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.

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



[PHP] Re: Sessions problem

2003-03-10 Thread Dan Phiffer
I believe there's a domain limitation inherent to the way cookies work
(assuming a cookies-based sessions setup), but there may be some way of
circumventing that (can't some ad banner companies track visitors from site
to site?). Seems like a multi-file search and replace should do the trick.
If you're using UltraEdit/BBEdit/Emacs you should be able to update your
links without too much effort.

HTH,
-Dan


David Chamberlin [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hey all,

 Some of my users have reported a problem with my site and it's taken a
 while to debug it, but I think I've finally tracked it down.

 If they go to the site as:

 http://www.mysite.org/

 Then it works

 But if they go as:

 http://mysite.org/

 It doesn't.

 I believe it has to do with my use of session variables.  Apparently (I
 didn't know this, but it's obvious from the debugging) that there are
 different session ID's and thus different session variables for the two.
And the problem is (due to sloppy programming on my part ... sigh
 ...) that sometimes I set up the links as a href=/page and
 sometimes I do the explicit a href=http://www.mysite.org/page.  So
 when it goes to the link as www.mysite.org, it registers the variables,
 but then later when it tries to access and it's just mysite.org, the
 variables aren't set.  Lots of confusion ensues.

 Is there any way to unify this, or do I have to go through and fix all
 of the absolute links to be relative?

 Thanks,
 Dave




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



Re: [PHP] Question

2003-03-10 Thread Hugh Danaher
something like:
print table;
while ( statement )
{
$i++;
if ($i==1) print tr;
print td;
your image code;
print /td;
if ($i==4) 
{
print /tr;
unset($i);
}
}
if ($i==1) print td/tdtd/tdtd/td/tr;
if ($i==2) print td/tdtd/td/tr;
if ($i==3) print td/td/tr;
print /table;

might work better.
hugh
- Original Message - 
From: Clint Tredway [EMAIL PROTECTED]
To: PHP [EMAIL PROTECTED]
Sent: Monday, March 10, 2003 11:53 AM
Subject: [PHP] Question


 I have a display of images that every fourth image I want to start a new
 column. In ColdFusion I would use the MOD operator like this:
 
 if query.recordcount MOD 4 eq 0
 /td
 td
 /if
 
 I am just having a brain lapse today, can someone help me do this same
 functionality in PHP?
 
 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] Re: sessions terminating randomly please help

2003-03-10 Thread David Chamberlin
It's possible you're being afflicted with the same problem I am.  See 
the message just one or two above this about Sessions problem.  What I 
found in my debugging is that it had to do with how I was 
mix-and-matching the way I specified links.

Short version of the problem is that http://mysite.org/ has one session 
and http://www.mysite.org/ has another.  In my code, I sometimes have 
the links as a href=/page and sometimes it's explicit, as a 
href=http://www.mysite.org/;.  So if a user went to the site as 
http://mysite.org - the pages that used the explicit www.mysite.org 
would fail.

So if there's anything in your pages/links that may change how the link 
is referred, you may be have different sessions occuring.

I would imagine it should be pretty easy for you to debug whether or not 
this is the problem.  Have each of your pages echo out the current 
session id (echo 'session is '.session_id().'br';) and see if it 
changes at any point, and especially on the pages that fail.

-Dave

Freaky Deaky wrote:
hi 

i am experiencing a major problem with sessions expiring randomly in some of my 
apps. i will log in and start clicking around and then i will eventually 
arrive at a page that tells me that i'm not logged in anymore. this happens 
apparently randomly. i have seen it on ie6, ie for mac, netscape 4.7 for pc, 
and mozilla 

the apps are hosted on 

freebsd 4.7-release p2 
apache 1.3.27 
php version 4.2.3 
compiled with --enable-trans-sid 

i can't go into production if there's the possibility that users will be 
randomly logged off. i went through all of my code over the weekend, and i 
don't think i can attribute this to a miscoding: 

when a user logs in, i create a session with 

session_start(); 
$valid_user=$_POST['username']; 
session_register(valid_user); 

i have the following code at the top of each page to check to see if the session 
is valid: 

session_start(); 
$valid_user=$_SESSION['valid_user']; 
global $valid_user; 
if (session_is_registered(valid_user) 
{...function to spit out an error message if the session is not valid...;} 

i have a logout page that destroys the session 

session_start(); 
session_destroy(); 

i also have a javascript timer in the header of every page that redirects to the 
logout page if the user has been inactive for 20 minutes. 

i have played around with session.gc_probability, setting it to 100, but that 
doesn't seem to have fixed the problem. 

this is a huge problem. 
if anyone can give some advice, i'd really appreciate it. 

thanks



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


RE: [PHP] sessions terminating randomly please help

2003-03-10 Thread Dennis Cole
Make sure that the url is always the same. For example if a user is at a
page http://mysite.com/phpscript.php and you link to
http://www.mysite.com/phpscript.php (notice the www) the session might not
follow because the url is different.

-Original Message-
From: freaky deaky [mailto:[EMAIL PROTECTED]
Sent: Monday, March 10, 2003 3:26 PM
To: [EMAIL PROTECTED]
Subject: [PHP] sessions terminating randomly please help
Importance: Low


hi

i am experiencing a major problem with sessions expiring randomly in some of
my
apps. i will log in and start clicking around and then i will eventually
arrive at a page that tells me that i'm not logged in anymore. this happens
apparently randomly. i have seen it on ie6, ie for mac, netscape 4.7 for pc,
and mozilla

the apps are hosted on

freebsd 4.7-release p2
apache 1.3.27
php version 4.2.3
compiled with --enable-trans-sid

i can't go into production if there's the possibility that users will be
randomly logged off. i went through all of my code over the weekend, and i
don't think i can attribute this to a miscoding:

when a user logs in, i create a session with

session_start();
$valid_user=$_POST['username'];
session_register(valid_user);

i have the following code at the top of each page to check to see if the
session
is valid:

session_start();
$valid_user=$_SESSION['valid_user'];
global $valid_user;
if (session_is_registered(valid_user)
{...function to spit out an error message if the session is not valid...;}

i have a logout page that destroys the session

session_start();
session_destroy();

i also have a javascript timer in the header of every page that redirects to
the
logout page if the user has been inactive for 20 minutes.

i have played around with session.gc_probability, setting it to 100, but
that
doesn't seem to have fixed the problem.

this is a huge problem.
if anyone can give some advice, i'd really appreciate it.

thanks

--
__
http://www.linuxmail.org/
Now with e-mail forwarding for only US$5.95/yr

Powered by Outblaze

--
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: sessions terminating randomly please help

2003-03-10 Thread Dennis Cole
Assuming that php is configued to rewrite the url tags, try turning off
cokkies in the browser and let the Session if carry over. This might help
you debugg it.

-Original Message-
From: David Chamberlin [mailto:[EMAIL PROTECTED]
Sent: Monday, March 10, 2003 3:41 PM
To: [EMAIL PROTECTED]; Freaky Deaky
Cc: [EMAIL PROTECTED]
Subject: [PHP] Re: sessions terminating randomly please help
Importance: Low


It's possible you're being afflicted with the same problem I am.  See
the message just one or two above this about Sessions problem.  What I
found in my debugging is that it had to do with how I was
mix-and-matching the way I specified links.

Short version of the problem is that http://mysite.org/ has one session
and http://www.mysite.org/ has another.  In my code, I sometimes have
the links as a href=/page and sometimes it's explicit, as a
href=http://www.mysite.org/;.  So if a user went to the site as
http://mysite.org - the pages that used the explicit www.mysite.org
would fail.

So if there's anything in your pages/links that may change how the link
is referred, you may be have different sessions occuring.

I would imagine it should be pretty easy for you to debug whether or not
this is the problem.  Have each of your pages echo out the current
session id (echo 'session is '.session_id().'br';) and see if it
changes at any point, and especially on the pages that fail.

-Dave

Freaky Deaky wrote:
 hi

 i am experiencing a major problem with sessions expiring randomly in some
of my
 apps. i will log in and start clicking around and then i will eventually
 arrive at a page that tells me that i'm not logged in anymore. this
happens
 apparently randomly. i have seen it on ie6, ie for mac, netscape 4.7 for
pc,
 and mozilla

 the apps are hosted on

 freebsd 4.7-release p2
 apache 1.3.27
 php version 4.2.3
 compiled with --enable-trans-sid

 i can't go into production if there's the possibility that users will be
 randomly logged off. i went through all of my code over the weekend, and i
 don't think i can attribute this to a miscoding:

 when a user logs in, i create a session with

 session_start();
 $valid_user=$_POST['username'];
 session_register(valid_user);

 i have the following code at the top of each page to check to see if the
session
 is valid:

 session_start();
 $valid_user=$_SESSION['valid_user'];
 global $valid_user;
 if (session_is_registered(valid_user)
 {...function to spit out an error message if the session is not valid...;}

 i have a logout page that destroys the session

 session_start();
 session_destroy();

 i also have a javascript timer in the header of every page that redirects
to the
 logout page if the user has been inactive for 20 minutes.

 i have played around with session.gc_probability, setting it to 100, but
that
 doesn't seem to have fixed the problem.

 this is a huge problem.
 if anyone can give some advice, i'd really appreciate it.

 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



  1   2   >