Re: [PHP] Apache per directory setting

2004-01-07 Thread Chris Lee
Dear Umesh,

I already restart Apache, but it didn't work.

OT question: 

Do Apache's Directory Directive, use relative path or absolute path
for matching?

Beside, I am using PHP Version 4.2.3

Regards,
Chris Lee

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



[PHP] Apache per directory setting

2004-01-06 Thread Chris Lee
Hi,

Is it possible to set PHP flag at Apache ver 1.3.x per directory?

e.g.
VirtualHost 127.0.0.1
DocumentRoot /home/www/apps/htdocs
ServerName localhost
Directory /home/www/cch/htdocs/test
php_flag register_globals on
/Directory
/VirtualHost

I tried but fail to turn on Register Globals settings (Default is
off). Any Hints?


Regards,
Chris Lee

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



Re: [PHP] Apache per directory setting

2004-01-06 Thread Chris Lee
You need to use:

  php_value register_globals 1

I tried, but still fail, phpinfo still show 
register_globals OffOff

Regards,
Chris Lee

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



Re: [PHP] Cannot output before input

2003-08-18 Thread Chris Lee
ob_flush()

Thanks curt, it's working ^_^


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



[PHP] Cannot output before input

2003-08-17 Thread Chris Lee
Hi All,

I run the following program at Windows command prompt

c:\php\cli\php.exe input.php

?php
print Input:;
flush();
$fp = fopen(php://stdin, r);
$input = fgets($fp);
fclose($fp);
echo $input;
?

The program did not show out Input: and waiting for input after run!
Any hint to flush the output first?

I am using PHP 4.3.2 (cli) (built: May 28 2003 15:10:38)

Regards,
Chris Lee

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



Re: [PHP] Get Local IP Address

2003-07-28 Thread Chris Lee
Try this:
?php
exec('ipconfig',$catch);
foreach($catch as $line){
if(eregi('IP Address',$line)){
list($t,$ip) = split(':',$line);
echo 'IP is '.$ip.\n;
}
}
?

Thanks Tom, but I think it only work for Win NT, how about Win 9x?



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



[PHP] Get Local IP Address

2003-07-27 Thread Chris Lee
How can I get the local Computer IP Address when running PHP program in 
Windows command line (i.e. php getmyip.php)

** Since the PHP did not are run on Webserver, so _SERVER[SERVER_ADDR] 
won't work.

Many thanks in advance.

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


[PHP] Local IP Address

2003-07-27 Thread Chris Lee
How can I get the local Computer IP Address when running PHP program in 
Windows command line (i.e. php getmyip.php)

** Since the PHP did not are run on Webserver, so _SERVER[SERVER_ADDR] 
won't work.

Many thanks in advance.

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


Re: [PHP] file uploading = dumping into ram?

2002-01-03 Thread Chris Lee

set your max upload file size smaller then. default is 2mb max. I find that
too small, I re-set mine to 5mb. I have 2g of ram on our server, 5mb isnt a
worry to me. Id rather that then the slow speed of writing the file to the
hd.

--

  Chris Lee
  [EMAIL PROTECTED]



David [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 hi all,

 I wes doing some file upload stuff with php when i noticed that as the
file is being uploaded, the entire file is stored in ram until it\'s
finished.

 obviously, we know the problems associated with this(use up a lot of ram
for large files), i\'m just wondering, is this going to be fixed soon in the
next release of php?

 i think those people using php to upload large files will be very happy if
it\'s fixed :)



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Form Validation class

2002-01-03 Thread Chris Lee

Ive seen em on zend.com, I wrote my own. I would recommend you take a look
at the ones on zend.com and modify it to taste.

--

  Chris Lee
  [EMAIL PROTECTED]


Daniel Harik [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hello guys,

 at moment i'm reading Hack Proofing your web apps book, but it makes
 me scared, i have seen a class from newbienetwork.net(can't find it
 now), that validates
 user input, things like telephone number, state, country , email, and
 also can check if only letters or numbers are in text field, my
 question is this are there classes of this kind around? I would really
 need it.

 Thank You very much



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




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: page has expired

2001-12-21 Thread Chris Lee

this has been covered before on the newsgroup, never the less.

this is because php sends the no-cache header when using sessions. try it.
sniff the line and run the same page with sessions and then without
sessions, you can see the different headers. you can get around this by
sending a cache header.

header('Cache-Control: public');

done. only problem is the browser will go anal about caching. sometimes when
you hit F5 to refresh, it will only grab the cached copy. and on a side note
this is a nasty header to send with dynamically generated images, if this
header is sent on a dynamic image the browser will cache this file to death,
only downloading a new image when you clear your cache and restart your
browser, so dont use this on any dynamic stock charts haha.

--

  Chris Lee
  [EMAIL PROTECTED]



Peter [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi,

 I was wondering whenever I use sessions on a page and then I use the
 back button on the browser, I get Warning page has expired.  Is there
 anyway to avoid this?

 Thanks.

 Peter




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: sessions and authentication

2001-12-21 Thread Chris Lee

insted of

if ( $isloggedin )
user logged in

do

if ( $HTTP_SESSION_VARS['isloggedin'] )
user is logged in

--

  Chris Lee
  [EMAIL PROTECTED]



Steve Maroney [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...


 Hey guys,

 I know this has been brought up several times but can't find it in the
 archives of this list.

 I have some PHP 4 scripts that check the value of a logged in variable.
 if the user authenticates him/her self, then the logged in variable gets
 set and registered with the session.  How can I stop some evil person from
 passing that variable to my script using GET or POST methods ?

 I tried:
  $HTTP_POST_VARS[user_authenticated] = ;
  $HTTP_GET_VARS[user_authenticated] = ;

 and:
 unset($HTTP_POST_VARS[user_authenticated]);
 unset($HTTP_GET_VARS[user_authenticated]);

 but that didn't do me any good. Please advise.

 Thank you,
 Steve Maroney







-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Standard output (printf) question...

2001-12-21 Thread Chris Lee

look at the output bufering functions.

http://php.ca/manual/en/ref.outcontrol.php

--

  Chris Lee
  [EMAIL PROTECTED]


Paul H. Breslin [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I'm trying to create a function that will generate output that could go to
 either a file or to the current browser directly. To do this I have
something
 like:

 function GenerateOutput($out)
 {
 fwrite($out, Some stuff);
 fflush($out);
 }

 and to call it I tried:

 $stdout = fopen(php://stdout, w);
 GenerateOutput($stdout);

 But for some reason nothing shows in the browser when I do this.

 I can't seem to find information about what output stream printf is
actually
 writing to. Do we have access to this stream?


 Can anyone provide a hint as to why the above doesn't work?

 Thanks.
 _
 Paul H. Breslinhttp://Canadian-Artist.com
 mailto:[EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Cookie Can't Display Name on other page

2001-12-21 Thread Chris Lee

wow sessions and cookie on the same page? why dont you just use one or the
other? I pref sessions. never the less.

your not setting the exp, path, or domain in your setcookie() you must do
all those.

setcookie('name', 'chris lee', time()+84700, '/',
'www.mediawaveonline.com');

--

  Chris Lee
  [EMAIL PROTECTED]



Jack [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Dear all
 Here is the Code for my Login.php page

 ?php
 // *** Start the session
 session_start();
 // *** Validate request to log in to this site.
 $KT_LoginAction = $PHP_SELF;
 if ($QUERY_STRING!=) $KT_LoginAction .= ?.$QUERY_STRING;
 $KT_valUsername=$user;
 if (isset($KT_valUsername)) {
   $KT_fldUserAuthorization=Username;
   $KT_redirectLoginSuccess=index.php;
   $KT_redirectLoginFailed=LOGIN.php;
   $KT_rsUser_Source=SELECT Username, Password ;
   if ($KT_fldUserAuthorization != ) $KT_rsUser_Source .= , .
 $KT_fldUserAuthorization;
   $KT_rsUser_Source .=  FROM login WHERE Username=' . $KT_valUsername .
'
 AND Password=' . $password . ';
   $KT_rsUser=$Mysql_nedcorhk-Execute($KT_rsUser_Source) or
 DIE($Mysql_nedcorhk-ErrorMsg());
   if ($KT_rsUser-RecordCount()==1) {
 // username and password match - this is a valid user
 $KT_Username=$KT_valUsername;
 session_register(KT_Username);
 if ($KT_fldUserAuthorization != ) {
   $KT_UserAuthorization=$KT_rsUser-Fields($KT_fldUserAuthorization);
 } else {
   $KT_UserAuthorization=;
 }
 session_register(KT_UserAuthorization);
 if (isset($accessdenied)  false) {
   $KT_redirectLoginSuccess = $accessdenied;
 }
 $KT_rsUser-Close();
 session_register(KT_login_failed);
  $KT_login_failed = false;
 header (Location: $KT_redirectLoginSuccess);
 exit;
   }
   $KT_rsUser-Close();
   session_register(KT_login_failed);
   $KT_login_failed = true;
   header (Location: $KT_redirectLoginFailed);
   exit;
 setcookie(username,$user);
 }
 ?
 html
 head
 titleLogin Page/title
 meta http-equiv=Content-Type content=text/html; charset=iso-8859-1
 script language=JavaScript
 !--
 function MM_findObj(n, d) { file://v4.0
   var p,i,x;  if(!d) d=document;
 if((p=n.indexOf(?))0parent.frames.length) {
 d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
   if(!(x=d[n])d.all) x=d.all[n]; for (i=0;!xid.forms.length;i++)
 x=d.forms[i][n];
   for(i=0;!xd.layersid.layers.length;i++)
 x=MM_findObj(n,d.layers[i].document);
   if(!x  document.getElementById) x=document.getElementById(n); return
x;
 }

 function MM_validateForm() { file://v4.0
   var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
   for (i=0; i(args.length-2); i+=3) { test=args[i+2];
 val=MM_findObj(args[i]);
 if (val) { nm=val.name; if ((val=val.value)!=) {
   if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
 if (p1 || p==(val.length-1)) errors+='- '+nm+' must contain an
 e-mail address.\n';
   } else if (test!='R') {
 if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
 if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
   min=test.substring(8,p); max=test.substring(p+1);
   if (valmin || maxval) errors+='- '+nm+' must contain a number
 between '+min+' and '+max+'.\n';
 } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is
 required.\n'; }
   } if (errors) alert('The following error(s) occurred:\n'+errors);
   document.MM_returnValue = (errors == '');
 }
 file://--
 /script
 /head
 body bgcolor=#E8E9E0 text=#00 link=#FF vlink=#FF
 alink=#FF
 div align=center
   pbfont size=+3uNedcor Internal WebSite/u/font/b/p
   pbPlease Provide your Username and Password for the Internal
 Web./b/p
   ?
 print (Diagnostic Informationbr);
 print (Session Name :  . session_name() . br\n);
 print (Session ID :  . session_id() . br\n);
 ?
   form action=?php echo $KT_LoginAction? name=LOGIN method=post
 onSubmit=MM_validateForm('user','','R','password','','R');return
 document.MM_returnValue
 table width=75% border=0
   tr
 td width=49%
   div align=rightbUsername/b/div
 /td
 td width=51%
   input type=text name=user
 /td
   /tr
   tr
 td width=49%
   div align=rightbPassword/b/div
 /td
 td width=51%
   input type=password name=password
 /td
   /tr
 /table
 p
   input type=submit name=Submit value=Submit
   input type=reset name=Submit2 value=Reset
 /p
   /form
   pnbsp;/p

 /div
 /body
 /html

 I had use the setcookie function in the script which is
 ?setcookie(username,$user);?, then in the Main.php page, i set another
 script ?echo $HTTP_COOKIE_VARS[username];?.
 Then the strange things happen, the Main.php won't show the name from
 cookie! actually the $user you saw in setcookie is the input box where the
 user input their username to login!!
 Another way i had tried is , if i set the coo

[PHP] Re: PHP called recursively?

2001-12-21 Thread Chris Lee

if he wants to burn a cd why dont you just copy the php dir onto a cd? why
do you have to parse everything? as an admin I would rather the entire dir
then the content of the executed script. plus on your side parseing every
url recursivly and getting all the images etc, what a hasle, just copy the
dir ..

--

  Chris Lee
  [EMAIL PROTECTED]




Thomas Karcher [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi PHP users,

 I have a couple of PHP scripts that generate dynamic content for a
website.
 Now the admin of this website should be able to burn a CD of its pages, so
I
 wrote another PHP script which calls the CGI PHP executable to get the
 content and write it down, like this:

 $content = `/usr/lib/httpd/cgi-bin/php4
/home/httpd/html/project/foo.php4`;

 But with this line, the server seems to call many many instances of PHP
...
 and I don't get the content I want ...
 The server engine for PHP is CGI. I tried to call my PHP4 with another
 path, e. g. $content = `/tmp/php4 ...` , but it's useless.
 I changed the foo.php4 - and really easy scripts don't work at all, e.
g.
 scripts that only contain phpinfo() or die() or something like that.

 Does anybody know why so many PHP instances are called?

 Yes, another possibility for my problem is to do it with
 fopen(http://localserver/...), but this is not very good I think because I
 have loops in my script, so for every loop an HTTP request is called ...
 very heavy for the webserver ...

 Thanks a lot,
 Thomas





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: some body flood mypage how can I prevent them ?

2001-12-21 Thread Chris Lee

hehe, not exactly a php question but whatever.

you have a firewall correct? if you dont, lie and say you do because no one
should be caught dead without one, and add the person to your block list.

--

  Chris Lee
  [EMAIL PROTECTED]


Alawi [EMAIL PROTECTED] wrote in message
00cd01c18a1a$05063440$b084a2d4@mcsh2l7jqy8bgj">news:00cd01c18a1a$05063440$b084a2d4@mcsh2l7jqy8bgj...
some body flood mypage how can I prevent them ?





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: undefined function: ftp_connect()

2001-12-20 Thread Chris Lee

run phpinfo() is ftp support in there? if not run configure like you
normally do and scroll up to the ftp section, are there any errors in there?
if so what are they?

--

  Chris Lee
  [EMAIL PROTECTED]



Sam Schenkman-Moore [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I've compiled php 4.0.6 on Darwin as CGI. --with-ftp shows up in the php
 configuration display but I still get this message:

 undefined function: ftp_connect()

 I've read a couple past articles with people having this problem but I did
 not spot a solution.

 Any suggestions?

 Thanks, Sam




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: [PHP-DB] Re: while...if statements???

2001-12-19 Thread Chris Lee

personal pref. Once I knew php and mysql better I wrote my own wrappers, I found using 
them easier. But there is no reason why someone couldnt do fine without one. writing a 
set of wrappers allowed me to better optimize my queries and write code faster without 
having to worry about everything else.

have you tried the PEAR db wrappers? PEAR came out after I wrote mine, therfore I 
never used them, you?

  Chris Lee
  [EMAIL PROTECTED]



- Original Message - 
From: matt stewart [EMAIL PROTECTED]
To: 'Chris Lee' [EMAIL PROTECTED]; [EMAIL PROTECTED]; 
[EMAIL PROTECTED]
Sent: Wednesday, December 19, 2001 1:16 AM
Subject: RE: [PHP-DB] Re: while...if statements???


 and i always thought the best tactic was to go ugly early.
 
 seriously, this isn't really that ugly a solution, most textbooks tend to
 tell you to use this method to start with as its a bit simpler to understand
 for beginners - an if...else statement to see if an initial row is returned,
 then you can happily use a do...while on that first row, and it'll carry on
 outputting the following rows if there are any more.
 
 -Original Message-
 From: Chris Lee [mailto:[EMAIL PROTECTED]]
 Sent: 18 December 2001 20:49
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Subject: [PHP-DB] Re: while...if statements???
 
 
 because the while() statement works like this
 
 - do something while x is true. if x is not true dont do anything.
 - do something while conent is in the db. if there is no conent in the db
 dont do anything.
 
 your if() statement is never run if there is no content.
 
 $return = mysql_fetch_row($result);
 if ( isset($return['pet_name']) )
 do
 {
 echo $return['pet_name'] .br;
 } while( $return = mysql_fetch_row($result) );
 else
 echo  No Pets br;
 
 its ugly but it works. I dont like ugly, so I wrote my own db wrappers.
 
 http://www.mediawaveonline.com/examples/
 
 foreach( $db-select_array('', 'petinfo', '') as $pos = $val )
 echo $val['pet_name'] .br;
 if ( !isset($val['pet_name']) )
 echo  No Pets br;
 
 I like that more. but whatever.
 
 --
 
   Chris Lee
   [EMAIL PROTECTED]
 
 
 
 Jay Fitzgerald [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Does anyone know why this isn't working?? What I am trying to do is
 display
  photos from a database based on each month. This part works fine when I
 set
  it to the current month of December (today) as that is when I uploaded the
  photos.
 
  However, when I manually set the date to a month that has no photos in it,
  I want it to echo the No Animals string belowThis is only working
  half-way...meaning that it will display a blank page with nothing on it
  instead of actually echoing the No Animals string
 
  Can anyone please help?? Is there really a way to have a while...if
  statement
 
 
 
  CODE=
  ?
  $connection = mysql_connect($hostname, $user, $pass) or die (Unable to
  connect!);
  $query = SELECT petname, petDesc, petpicture FROM petinfo WHERE petmonth
 =
  'Apr';
  $result = mysql_db_query($database, $query, $connection) or die (Error in
  query: $query.  . mysql_error());
 
  while (list($pet_name, $pet_Desc, $pet_picture) =
 mysql_fetch_row($result))
  {
  if ($pet_picture == )
  {
  echo No Animals have been posted for $date at this moment. Please check
  back soon.;
  exit;
  }
 
  else
  {
  echo 
  FONT FACE=\Arial, Helvetica\BPet of the month/B/FONTBR
 
  BR
  IMG
 
 SRC=\http://moss.bayou.com:/oppj/admin/animalcontrol/photos/$pet_pictur
 e\
  HEIGHT=150BR
 
  BR
  FONT FACE=\Arial, Helvetica\ SIZE=\-1\$pet_DescBR
 
  BR
  To adopt $pet_name please visit the Ouachita Parish Animal Shelter.BR
  The adoption fee is \$50.00 which includes Spade, Neutering and 7-N-1
  Shot.BR
 
  BR
  Sorry, we can not hold $pet_name for you (First come first serve
  basis)./FONT
  BRBR;
  }
  }
  ?
  /CODE=
 
  Thanks,
 
 
  Confus3d
 
 
 
 
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 ---
 Incoming mail is certified Virus Free.
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.307 / Virus Database: 168 - Release Date: 11/12/01
  
 
 ---
 Outgoing mail is certified Virus Free.
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.307 / Virus Database: 168 - Release Date: 11/12/01
  
 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: session destroy ??

2001-12-19 Thread Chris Lee

?php
 session_start();
// destroy the session
 session_destroy();
 $p = session_get_cookie_params();
// destory the cookie
 setcookie(session_name(), '' , 0, $p['path'], $p['domain']);

// redirect without the SID for trans-sid users
 header(Location: http://$SERVER_NAME;);
?

works for me. yes its stupid, but a session has to be started beore it can
be destroyed.

--

  Chris Lee
  [EMAIL PROTECTED]




Olivier Masudi [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 In my online store i use session.

 I use a script to check that a user dont make 2 order during the same
 session using the back button for that i put his sessionid in the db and
 check it before processing the order.

 My probleme is how can i give a new session_id to the person when he goes
 back to the home page of my site so he can do a new order ?

 I try session_destroy , session_unset
 but the person have still the same session_id

 REMARK

 I always use the same string into session_name(abcdef) for all the user.
 Is it a problem?


 Thanks for your help




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] sessions var

2001-12-19 Thread Chris Lee

as long as your start the session on the new page everything will work. are
your clients not using cookies? and you have trans-sid enabled? you'll need
to pass the SID to the new page then obv.

--

  Chris Lee
  [EMAIL PROTECTED]



William Sanchez Sanchez [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...


 I need some help with sessions. I need to pass variables to a page that
will
 load
 in a new browser window (window.open(,myWindow,) and form ...
 target=myWindow).
 I used session_register and I tried using start_session
 and still no luck.  Once I get the session vars registered, how do I
 access them from the new window opened...


 thanks in advantage...



 William.




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: php telnet

2001-12-19 Thread Chris Lee

if I nc to my server on port 23 I get the same thing. ie there is nothing
wrong. your going to have to emulate the telnet protocal now, thats just the
connect string.

--

  Chris Lee
  [EMAIL PROTECTED]




Kancha [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]...
 The following code generated garbase output. what is wrong ??

 ?php
   $sp = fsockopen(localhost, 23);
   if(!$sp){
 echo error;
 exit;
   }
   socket_set_blocking($sp, FALSE);

   function getLine(){
 global $sp;

 $op = fgets($sp, 1024);
 while(empty($op)){
   $op = fgets($sp, 1024);
 }
 return $op;
   }

   echo getLine();
 ?

 The output was as follows:

 [root@ispms html]# php telnet.php
 X-Powered-By: PHP/4.1.0
 Content-type: text/html

 ÿý?ÿý ÿý#ÿý'[root@ispms html]#




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: inscription

2001-12-19 Thread Chris Lee

thanks for the inscription. here's mine.

--

  Chris Lee
  [EMAIL PROTECTED]


Sim/Haouhach [EMAIL PROTECTED] wrote in message
58C7D97FA088D31190FD0090277B017502EA06DC@EXCHANGE">news:58C7D97FA088D31190FD0090277B017502EA06DC@EXCHANGE...

Lynda Haouhach
Ingénieur système
SONATRACH
Email :[EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: JavaScript php question - mainly JS though so slightly OT but hep needed!!! :o)

2001-12-19 Thread Chris Lee

thats exactly how you do it.

foreach( $array as $pos = $val )
echo 
a href='javascript:windowpopup('page.php?id=$pos')'$val /abr
;

--

  Chris Lee
  [EMAIL PROTECTED]


Martin Hughes [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 How could I write the function windowPopup(XX) where XX is a variable that
 can change from link to link, for a popup info window to load a php file
 with the variable XX in the url?

 So the link would look like:
 a href=javascript:windowPopup(XX);Link Text/a

 and I want that link to open the page info.php?patch=XX in a new popup
 window

 Do I do it something like this, or is there a faster/better way??

 Cheers  Merry X-Mas!

 Martin





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Problem with fopen / url

2001-12-18 Thread Chris Lee

sounds like php is having a problem resolving the dns. could be 1 of a 100
things ...

try putting the IP of the machine in vs the domain name.

--

  Chris Lee
  [EMAIL PROTECTED]



Martin Leclair [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi,

 I have a problem doing a fopen(http:///index.php,r;) on a
particular
 server it's extreamly slow (about 2 minutes to get the content of a
webpage
 on a server that pings at 1ms) on another server it's getting the content
in
 less than 5 seconds (same script). Same URL, servers are side to side on
the
 same network, almost same hardware, uptime is fine. The server that causes
 problem is with 4.0.6.

 Would someone have some hints on what could cause it to work on one server
 and take more than 2 minutes on the other?

 Martin






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Remote image

2001-12-18 Thread Chris Lee

how those remote servers destinguish where the images are coming from is
from the Referr header.

play around with getting the data manually using fopen()/fwrite()/fread()
and your done. not so easy eh, well it works.

--

  Chris Lee
  [EMAIL PROTECTED]



Martin Kampherbeek [EMAIL PROTECTED] wrote in message
001201c18290$60da3820$328078d9@cc16349a">news:001201c18290$60da3820$328078d9@cc16349a...
Hi,

I have a problem with a remote image. I hope someone can help me.

People can post their link of their webpage at my site.
I check if the file excists, fopen().
After that I scan the page for links.
And the links for images.
Then I would like to see the sizes of all those images.

The problem is that there are servers that don't allow to brow straight to
the images, it can only from the page self.
So I look for something in php that surfs the the page en from that page to
the links.

I hope someone can help me.

Cheers,
Martin.






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: online editor

2001-12-18 Thread Chris Lee

online editor? you got 1mb free? no? buy a floppy. install ultraedit, it's
the best editor around imho.

--

  Chris Lee
  [EMAIL PROTECTED]


R. Lindeman [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 can someone help get a online editor

 thanx

 R. Lindeman







-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Passing through Array's to another script

2001-12-18 Thread Chris Lee

foreach( $array_name as $pos = $val )
echo 
input type=hidden name='array_name[$pos]' value='$val'
;

or use sessions.

--

  Chris Lee
  [EMAIL PROTECTED]


Gkin [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I want to pass through an array with content to another script. The array
is
 correctly filled with data. To do this I use the following code:
  FORM METHOD='post' ACTION='script.php?xtabel = ? print($xtabel); ?'

 The content of the array is not recognised in the script.php. What is the
 best way to do this?





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: sessions

2001-12-18 Thread Chris Lee

take a look at my session.egn file.

http://www.mediawaveonline.com/examples/

--

  Chris Lee
  [EMAIL PROTECTED]



Anthony [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I need some help with sessions.  I read the sections in the manual and
 searched for tutorials, but I still can't get a straight forward example
 of how sessions work.  I need to pass variables to a page that will load
 in a new browser window.  I used session_register, but when I look in
 the $HTTP_SESSION_VARS, it doesn't exist.  I tried using start_session
 and still no luck.  Once I get the session vars registered, how do I
 access them.  I am able to pass the session id as a var, I'm going it
 like page.php?sid=$sid_var.  Is there a better way, do I need to do
 this at all?  I'm confused as hell and can't find a working example
 anywhere. Help!

 - Anthony




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Cookie Retrieval

2001-12-18 Thread Chris Lee

I know this isnt answering your question, but skip cookies and goto
sessions, easier to work with.

now the answer to your question, you need to set the domain and path on your
setcookie()

setcookie('name', 'value', $exp, '/', $SERVER_NAME);

--

  Chris Lee
  [EMAIL PROTECTED]



Steve Osborne [EMAIL PROTECTED] wrote in message
001701c1829d$90a519a0$[EMAIL PROTECTED]">news:001701c1829d$90a519a0$[EMAIL PROTECTED]...
 Can someone tell me if there is a bit of code I need to put on pages so I
 can retrieve a cookie.
 The cookie was set with the following code:

 //(D) Set Cookie
$encoded_login = encode_string($login);
if ( $remember == yes ){
 // set login to expire in 1000 days
 $time = (time() + ( 24 * 3600 * 365 ));
 SetCookie ( poccd_session, $encoded_login, $time);
}else{
 SetCookie ( poccd_session, $encoded_login );
}

 I am trying to retrieve it with the following code (for testing purposes
 only, right now):

 if($poccd_session)
 {
  header(location: index.php);
 }else{
  print(The cookie plan didn't work.);
 }

 Any suggestions would be appreciated.

 Steve Osborne
 Database Programmer
 Chinook Multimedia Inc.
 [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: php sessions limit

2001-12-18 Thread Chris Lee

its irrelevant. now there is a file system dependancy. in linux is inodes,
not enough and you'll have some problems, win2k I dont know.

--

  Chris Lee
  [EMAIL PROTECTED]


Aaustin [EMAIL PROTECTED] wrote in message
002101c18293$671c5d00$0300a8c0@tomato">news:002101c18293$671c5d00$0300a8c0@tomato...
 Hi
 This may sound strange. but ...
 Is there a  limit to the number of sessions one can/should have using the
 same identity details at one time. ie if beta testing a website with the
 same password details etc. or is it irrelevant.

 Thanks


 Andrew





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Single character input on command line

2001-12-18 Thread Chris Lee

take them from the arguments list

$argv[]

I know its not what you asked, its just what I answered.

--

  Chris Lee
  [EMAIL PROTECTED]


August Zajonc [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Interested in getting a single character at a time on the command line
using
 php.

 ie, I'd like to type 2 and be able to trap that keystroke right away and
act
 on it.

 Before spending a lot of time tracking down possibilites (readline
 input_buffer, reading the stdin pipe) thought I'd ask if anyone's done
this
 already and has an elegant way I'm missing.

 Thanks,

 - August




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: http referer problems

2001-12-18 Thread Chris Lee

break it down.

if ( $ef != 'nm' )
echo a : $efbr;
else
echo b : $ef br;
if ( $HTTP_REFERER !=
'http://www.globalhealth.org/news/article.php3?id=1526' )
echo c : $HTTP_REFERERbr;
else
echo d : $HTTP_REFERERbr;

now you can see where the bug is.

--

  Chris Lee
  [EMAIL PROTECTED]


[EMAIL PROTECTED] wrote in message
BB6D932A42D6D211B4AC0090274EBB1DA0F1E8@GLOBAL1">news:BB6D932A42D6D211B4AC0090274EBB1DA0F1E8@GLOBAL1...
 For some reason, the following if  statement isn't working.  Maybe I
haven't
 had enough coffee to drink or maybe I've had too much - what am I missing?

 if ($efa != nm || $HTTP_REFERER !=
 http://www.globalhealth.org/news/article.php3?id=1526;){do this);}

 Thank you, Shawna



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Logout problem

2001-12-18 Thread Chris Lee

  Header(WWW-Authenticate: Basic realm='$SERVER_NAME' );
  Header(HTTP/1.0 401 Unauthorized);

is the proper http auth hearders, change the realm and you'll have to
re-authenticate.

--

  Chris Lee
  [EMAIL PROTECTED]



J.F.Kishor [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 hello all,

I have designed a web page using php, as a security measure I have
  kept it password protected. I have used Apache authentication, using
  htpasswd file. Now I want to keep a logout in this web page, I tried to
  send a header request http/1.0 401 Unauthorized to force it to
  reauthenticate when the logout link is clicked in the form, but this dose
  not work.

  I tried using session_destroy() even that does not work.

  To get the authenticated users name I have used GetEnv(REMOTE_USER) in
  all the form and with that username I'am handling mysql and other
requests.
  I don't know where exactly the REMOTE_USER gets stored.

  So please help me out in this problem. I want to remove the
  window's authentication cache.

  Please give me some ideas and suggestion to remove the user name and make
  the page fresh for the other user to log in.

  If possible please send me a sample script.




 kishor
 Nilgiri Networks








-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Header redirecting with POST

2001-12-18 Thread Chris Lee

2k is alot of data to be sending using GET or POST, just leave it on the
server in a session variable.

redirect server 2000 bytes - client
GET client 2000 bytes - server

or via sessions

redirect server 50 bytes - client
GET client 50 bytes - server

--

  Chris Lee
  [EMAIL PROTECTED]




Jim Lucas [EMAIL PROTECTED] wrote in message
001b01c18363$cd008990$[EMAIL PROTECTED]">news:001b01c18363$cd008990$[EMAIL PROTECTED]...
 is it possible to use header() to redirect and have it act as a post

 I know about this method
 header(Location: http://www.yahoo.com/?variable=value;);
 but this is the GET method
 I don't want to have to know every single (variable|value) combination
that
 will be sent to a page

 Sadly though, GET has a size limit on the amount of data you can send
 throught the URL, 2kb.  I want to be able to send larger amounts with a
 header() redirect.

 Any ideas on how to send the data in a POST with header(); woud be
 appreciated.

 Thanks Jim Lucas




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: need some help

2001-12-18 Thread Chris Lee

I'll try and answer your questions as will the rest off the forum Im sure,
just post away.

--

  Chris Lee
  [EMAIL PROTECTED]



Melva Garcia [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I am looking for a mentor to help me along with
 using php and mysql

 i am a designer for over 9 years now..and will
 in return help you with anything pertaining to
 layout and design

 i have alot of dumb questions pertianing to
 php and mysql dba can someone help me
 i would appreciate any help I can get

 thanks
 Mel

 __
 Do You Yahoo!?
 Check out Yahoo! Shopping and Yahoo! Auctions for all of
 your unique holiday gifts! Buy at http://shopping.yahoo.com
 or bid at http://auctions.yahoo.com



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: max # of characters for links to work in emails?

2001-12-18 Thread Chris Lee

a good guess would be every email client does it differnetly. unfort Id have
to say try it yourself. Id imagine its long enough that you shouldnt have to
worry about it, but I could be wrong.

--

  Chris Lee
  [EMAIL PROTECTED]


Tom Churm [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 hi,

 i'm working on an eCard project and somehow need to find out what the
 reasonable limit is on characters for urls in email bodies (normal text,
 not mime).

 i know that some mail clients will cut off urls that are too long or
 else throw a line break in the middle of them--thus rendering them
 'unclickable'.  and this is exactly what i wanna avoid.

 anyone have any advice to offer in this area?

 muchos gracias,

 tom



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Using @file

2001-12-18 Thread Chris Lee

haha, I bet it cant resolve, and I doubt it works on other machines :)

www.myserver,com
www.myserver.com

see the diff? ditch the comma and put a period in insted :) trust me it
happens to the best of us.

--

  Chris Lee
  [EMAIL PROTECTED]



Jeff Lewis [EMAIL PROTECTED] wrote in message
013901c181b8$a4acd400$76a1a8c0@LEWISJCIT">news:013901c181b8$a4acd400$76a1a8c0@LEWISJCIT...
I am using this line in part of my code but am getting an error that looks
like below:

Code:
$serverDetails =
@file(http://www.myserver,com/versions.php?l=$scripturlv=$version;);

Error:
2: php_network_getaddresses: gethostbyname failed
(c:\inetpub\wwwroot\yabbse\Sources\Admin.php ln 43)

What would be causing this error?  It works on some machines but not others?

Jeff




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Rational Rose plugin for generating php code ?

2001-12-18 Thread Chris Lee

configure --help

ie. nope, nothing there.

--

  Chris Lee
  [EMAIL PROTECTED]



Arne Brune Olsen [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Hi
Does anyone know if there is a module for rational rose for generating php
code from UML diagrams ?

Arne






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: What is the best way to reorder table columns...temp tables?

2001-12-18 Thread Chris Lee

man that is nasty, but imho because of the constant in and out of php

echo 
a
href='$PHP_SELF?reports.php?userid=$useriddate_start=$date_startdate_end=$
date_endorder_by=trans_per_req%20descgroupby=$groupbytype=otherdaterange
=$daterange'link /a
;

I came across this same problem, I hate the long urls, their ugly, so I
wrote a simple session class to carry my prefs across a page.

carry_class.egn

http://www.mediawaveonline.com/examples/

 $carry-add('position');
 $carry-add('order_by');
 $carry-add('order_by_dir');
 $carry-add('search');
 $carry-add('search_keyword');
 $carry-add('search_category');

 echo 
 a href='$PHP_SELF?order_by=people_namecarry_keep='order by name/a
 a href='$PHP_SELF?order_by=people_emailcarry_keep='order by email
address/a
 a href='$PHP_SELF?order_by_dir=1carry_keep='up/a
 a href='$PHP_SELF?order_by_dir=0carry_keep='down/a

 a href='$PHP_SELF?position=$prevcarry_keep='back/a
 a href='$PHP_SELF?position=0carry_keep='home/a
 a href='$PHP_SELF?position=$nextcarry_keep='next/a
 ;

--

  Chris Lee
  [EMAIL PROTECTED]




J. Roberts [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I'm trying to update a report generator I have, using php and mysql.
 The setup is essentially listing employees and production data.

 What I did when I created it was for the column headers, made them links
 to requery the database..sample link follows (inside an anchor tag):
 reports.php?userid=?php echo $userid; ?date_start=?php echo
 $date_start; ?date_end=?php echo $date_end;
 ?orderby=trans_per_req%20descgroupby=?php echo $groupby;
 ?type=otherdaterange=?php echo $daterange; ?

 As you can see that is very ugly, and inefficient.

 I was thinking that one way to get around passing so many parameters was
 after the initial query, have that inserted into a temporary table.  Then
 all that would need to be passed with the query string would be an ORDER
BY
 clause, at which time I would do a SELECT * FROM TEMP_TABLE ORDER BY
 $orderby.

 One thing im not sure about, is if temporary tables are unique to each
user.
 That is to say if two people were running reports at the same time with
 different
 parameters, would that work?  If so, how long before the connection dies?
 If
 it is at the end of script execution, that wouldn't be much help.

 Does anyone have any better ideas as well?  I thought about using a
 multi-dimensional
 array, but was told that that would be a bad idea to keep a large array
 alive
 in memory.

 Thanks,

 -Jamison

 (hope this makes some sense)








-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: PHP and plugin detection

2001-12-18 Thread Chris Lee

it has to be done via javascript.

javascript = clientside
php = serverside

if the plugins are on the clientside then javascript is needed. and no,
sorry, I dont know how.

--

  Chris Lee
  [EMAIL PROTECTED]



Daniel Reichenbach [EMAIL PROTECTED] wrote in message
01c1816b$ae010230$796010ac@danielmob">news:01c1816b$ae010230$796010ac@danielmob...
 Hy,

 is there any way to detect the plugins a user has installed in his
 browser with PHP? I want to write a page where users get a plugin
 depending on their installation. If none of the required plugins
 is available an error page should be viewed.

 If it's not possible using PHP, can it be done with JavaScript?

 Greetings,
 Daniel





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Still need help with miscount

2001-12-18 Thread Chris Lee

need more info buddy. does this query work at the mysql command prompt? show
us an example, show us 10 records and accual query being exec and what the
returned result is and what you think it should be.

--

  Chris Lee
  [EMAIL PROTECTED]



Fîk ì?çìsâî [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Hi,

i still need help with this query:

$t = 7;
$shot_counts = SELECT COUNT(*) FROM statistik WHERE
shooter='$shooter_login' AND (shot_one = '$t' OR shot_two = '$t' OR
shot_three = '$t' OR shot_four = '$t' OR shot_five = '$t');

It doesn´t return the correct count. I have tried to tweak the syntax
around, excluding one or more columns to count etc. But it still gives the
wrong count. What´s wrong?

- Daniel




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Text file busy

2001-12-18 Thread Chris Lee

try php.ca or any of the other mirrors when php.net is down.

I bet you got that file your running open in an editor eh? close the file in
the editor then run the file, no problems.

--

  Chris Lee
  [EMAIL PROTECTED]



Boaz Yahav [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
HI

I'm trying to run a php file in CGI mode and I get : Text file busy
I'm running many other files like that for years and this is the 1st
time I see such a message.

php.net seems to be down for me, any idea?

berber






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: including outside pages

2001-12-18 Thread Chris Lee

include() will not handel ssl. include() on a remote site obv. will not
transer access to the variables to the remote site.

your best bet is to encode your session, session_encode(), and either store
it in a common mysql table that both servers have access to (best method) or
to pass it in the url to the ssl site, if this is done then you have to
treat your session data as if it were cookie data, dont trust it.

--

  Chris Lee
  [EMAIL PROTECTED]




Jordan [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 hello all,

 Two questions

 1) Is it possible to pass a session to another server?  I'm creating a
 secure order form for a shopping cart but the ssl service of my provider
is
 on a different server.  Is there anyway to carry a users session over to
 this box?

 2) If it is not possible to carry a session...is there anyway I could
 include this page on the ssl server into my main server from my host?  If
I
 could do an include I could continue the session and use it's stored
 variables.

 Thank you for the help.

 -Jordan





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Header error while creating an Image

2001-12-18 Thread Chris Lee

you dont have output buffering on, check php.ini or add it manually to an
.htaccess.

--

  Chris Lee
  [EMAIL PROTECTED]



J.F.Kishor [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 hello,

 I'am trying to create an image using php image functions
 it gives a warning and outputs a image with GIF87a format, why does
 this happen, could some help me out in this problem.

 This is the script
 --
 ?
 Header(Content-type: image/gif);
 $string=implode($argv, );
 $im = imagecreatefromgif(images/Next.gif);
 $orange = ImageColorAllocate($im, 220, 210, 60);
 $px = (imagesx($im)-7.5*strlen($string))/2;
 ImageString($im,3,$px,9,$string,$orange);
 ImageGif($im);
 imagecolortransparent($im);
 ImageDestroy($im);
 ?

 Warning alerted is
 --

 Warning: Cannot add header information - headers already sent by
 (output started at /home/kuruvi1/kishor/public_html/GD/creatingIMG.php:2)
in
 /home/kuruvi1/kishor/public_html/GD/creatingIMG.php on line 4
 --


 Junk output is
 ---

 --
---
 GIF87a9CU_11EraalUYIAAf11__O99 @ ` @\*6Z@6#%,9I# AA CIACA E#YU ( @
 a#,EX(R X#Y*(B H#I3  EC A []
 --
---

 Thanks for sparing time for this mail

 with regards

  -JFK




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: MySQL Native Function in PHP Query Not Working?

2001-12-18 Thread Chris Lee

that command doesnt even work from the mysql command prompt for me, Ive
never used LAST_INSERT_ID(), but it dont work for me. try it on your mysql
command prompt.

--

  Chris Lee
  [EMAIL PROTECTED]


Ise [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hello,

 Can someone explain to me why the below SQL query when executed with the
PHP
 mysql functions does not work? (it returns nothing)

 SELECT * FROM table WHERE aid=LAST_INSERT_ID()

 If I replace the MySQL function LAST_INSERT_ID() with a integer, it
works
 fine so its not the query.  Further, I was returned results on the above
 query when I ran it directly from a MySQL client.  Does PHP not support
 certain MySQL native functions?


 Thanks,

 Michael Caplan
 Institute for Social Ecology
 http://www.social-ecology.org/

 1118 Maple Hill Road
 Plainfield, VT, 05667 USA

 Tel.: 1 (514) 421-3515
 General Tel. / Fax.: 1 (802) 454-8493




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: PHP module for modem???

2001-12-18 Thread Chris Lee

configure --help

in other words, no. but there is nothing from stopping you from writing a
module :) im sure there are others out there that would like such a feature,
ie for fax's

--

  Chris Lee
  [EMAIL PROTECTED]



Scott Fletcher [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi!

 Is there any module or software that I can use and compile it with PHP
 for working with hte modem???
 For example, I have cURL but it is a seperate software and can be
 compile with PHP for certain things like FTP, Internet socket, etc.  So,
is
 there ever one for the modem?

 Thanks,
  Scott





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] php htpasswd

2001-12-18 Thread Chris Lee

?
 include_once('cookie.egn');
 include_once('database.egn');

 function bad_passwd()
 {
  echo You have entered an invalid password.br\n;
  exit();
 }

 if ( isset($PHP_AUTH_USER) AND isset($PHP_AUTH_PW) AND $peop_r =
fetch_db_value('people_manager', WHERE username = '$PHP_AUTH_USER' AND
password = '$PHP_AUTH_PW' ) )
  $SessionID = $peop_r['peopleID'];
 else
 {
  Header(WWW-Authenticate: Basic realm='$SERVER_NAME' );
  Header(HTTP/1.0 401 Unauthorized);
  bad_passwd();
 }
?

http://www.mediawaveonline.com/examples/

--

  Chris Lee
  [EMAIL PROTECTED]


Jtjohnston [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Jack,

  not sure i follow...you open it with php do whatever you need and close
  it...its just a text file...

 It's not just a text file delimited by a colon. You can indeed just type:

 user:password

 but it should be:

 user:crypt(password)

 When I perled, I knew how to database a text file delimited by :
 Now that I'm saved :) I'm learning MySQL, but I don't want to MySQL my
 htpasswd.users file.
 I don't even know if I can?

 Can I anyone? How would I?




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: while...if statements???

2001-12-18 Thread Chris Lee

because the while() statement works like this

- do something while x is true. if x is not true dont do anything.
- do something while conent is in the db. if there is no conent in the db
dont do anything.

your if() statement is never run if there is no content.

$return = mysql_fetch_row($result);
if ( isset($return['pet_name']) )
do
{
echo $return['pet_name'] .br;
} while( $return = mysql_fetch_row($result) );
else
echo  No Pets br;

its ugly but it works. I dont like ugly, so I wrote my own db wrappers.

http://www.mediawaveonline.com/examples/

foreach( $db-select_array('', 'petinfo', '') as $pos = $val )
echo $val['pet_name'] .br;
if ( !isset($val['pet_name']) )
echo  No Pets br;

I like that more. but whatever.

--

  Chris Lee
  [EMAIL PROTECTED]



Jay Fitzgerald [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Does anyone know why this isn't working?? What I am trying to do is
display
 photos from a database based on each month. This part works fine when I
set
 it to the current month of December (today) as that is when I uploaded the
 photos.

 However, when I manually set the date to a month that has no photos in it,
 I want it to echo the No Animals string belowThis is only working
 half-way...meaning that it will display a blank page with nothing on it
 instead of actually echoing the No Animals string

 Can anyone please help?? Is there really a way to have a while...if
 statement



 CODE=
 ?
 $connection = mysql_connect($hostname, $user, $pass) or die (Unable to
 connect!);
 $query = SELECT petname, petDesc, petpicture FROM petinfo WHERE petmonth
=
 'Apr';
 $result = mysql_db_query($database, $query, $connection) or die (Error in
 query: $query.  . mysql_error());

 while (list($pet_name, $pet_Desc, $pet_picture) =
mysql_fetch_row($result))
 {
 if ($pet_picture == )
 {
 echo No Animals have been posted for $date at this moment. Please check
 back soon.;
 exit;
 }

 else
 {
 echo 
 FONT FACE=\Arial, Helvetica\BPet of the month/B/FONTBR

 BR
 IMG

SRC=\http://moss.bayou.com:/oppj/admin/animalcontrol/photos/$pet_pictur
e\
 HEIGHT=150BR

 BR
 FONT FACE=\Arial, Helvetica\ SIZE=\-1\$pet_DescBR

 BR
 To adopt $pet_name please visit the Ouachita Parish Animal Shelter.BR
 The adoption fee is \$50.00 which includes Spade, Neutering and 7-N-1
 Shot.BR

 BR
 Sorry, we can not hold $pet_name for you (First come first serve
 basis)./FONT
 BRBR;
 }
 }
 ?
 /CODE=

 Thanks,


 Confus3d





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Simple(?) Question

2001-12-05 Thread Chris Lee

do a header re-direct.

header(Location: http://domain.com/page.php;);

include any variables you want, inc session vars if needed.

--

  Chris Lee
  [EMAIL PROTECTED]


Andrew Forgue [EMAIL PROTECTED] wrote in message
001d01c17ddc$a898fc40$6701a8c0@ajf">news:001d01c17ddc$a898fc40$6701a8c0@ajf...
Hello,

Is there a way to post to a script without any user interventions... e.g
The user posts to a script, and the script posts back to the original one.

Thanks!




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: session question: session.auto_start vs. session_register.

2001-12-05 Thread Chris Lee

session.auto_start is only usefull when not using classes as session
variables. because a class must be defined before it can be created (or
brought back to life from a session) it must be defined, this cant be done
with session.auto_start. I dont use session.auto_start. I find the ability
to use class's as session variables much more handy.

--

  Chris Lee
  [EMAIL PROTECTED]



Kurt Lieber [EMAIL PROTECTED] wrote in message
E16Bitf-00049T-00@z8">news:E16Bitf-00049T-00@z8...
 I am working on an open source e-commerce package and have hit a wall with
 sessions.

 If I have session.auto_start turned on, I get the following error message:

 Fatal error: The script tried to execute a method or access a property of
an
 incomplete object. Please ensure that the class definition shoppingcart of
 the object you are trying to operate on was loaded _before_ the session
was
 started in  path to my file on line 12

 If I turn session.auto_start off, the error disappears.

 So, the error message tells me that I can't use the class unless I've
defined
 it before the session gets started.  However, session.auto_start (as far
as I
 know) starts a session immediately, before even waiting for a script to be
 fully parsed  executed.  So, the two seem mutually exclusive. (but then
the
 usefullness of session.auto_start would seem extremely limited)

 Is there a way

 I think there's some glaring errors in my understanding here.  Can someone
 help me fill in the holes?

 --kurt




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Recursive Threading with PHP and MySQL.

2001-12-05 Thread Chris Lee

recursion is something that can be fun and practical at times, other times
its a bad coder trying to do something they think is clever. use it wisly.


?php
function power($num, $power = 1)
{
if ($num != 2)
$power = power(($num/2), $power+1);
return $power;
}
echo power(16);
?

this example is purposely coded bad to show you how recursion can mess up
with bad error checking. this example will work. change to power(30) and
you'll get a segfault because $num will allways equal anything but 2. this
gives you a starting point on recursion.

--

  Chris Lee
  [EMAIL PROTECTED]



Alawi [EMAIL PROTECTED] wrote in message
002201c17dc2$75276cd0$753f47d4@mcsh2l7jqy8bgj">news:002201c17dc2$75276cd0$753f47d4@mcsh2l7jqy8bgj...
I want to know how can i do that Recursive loop to get categories as example
can any body help me by give my tutorial or any thing to understand this
techniqe




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: serialize object session_auto_start

2001-12-05 Thread Chris Lee

to be blunt. then dont use session.auto_start. classes must be defined
before variables can be created based on that class, obviously. the proper
order has to be.

- class definition
- session initialized

--

  Chris Lee
  [EMAIL PROTECTED]



Matthieu Brunet [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi,
 I'm trying to save an object in the session, with the serialize and
 uunserialize fonction.
 But i got an error message wich say me that i must define the class before
 the session start.
 But my session start automaticly. So I can't include my class before the
 session start.
 I'm looking for a workaround.

 Thanks

 --
 --
 Matthieu Brunet - [EMAIL PROTECTED]
 Réseau-Photo S.A. - http://www.reseau-photo.com
 15, rue du Général Campredon - 34000 Montpellier
 Tél. : 04 67 58 07 08 - Fax : 04 67 58 03 04
 Icq : 119683958






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: folver view options

2001-12-05 Thread Chris Lee

wrong newsgroup.

--

  Chris Lee
  [EMAIL PROTECTED]


Caspar Kennerdale [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I have just installed mandrake

 something that is annoying me with KDE is that the default view within the
 file manager is with icons.

 Is is possible to have the tree or detailed view as the default.

 I briefly looked at the prefences and could find it anywhere

 Thanks





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: automatic forward URL to other URL

2001-12-05 Thread Chris Lee

header(Location: www.domain2.com);

--

  Chris Lee
  [EMAIL PROTECTED]


Manu Verhaegen [EMAIL PROTECTED] wrote in message
001301c17c93$53be4620$[EMAIL PROTECTED]">news:001301c17c93$53be4620$[EMAIL PROTECTED]...
I want automatic forward URL (www.mydomain.com) to (www.mydomain2.com)

If i type in my brower www.mydomain.com the i will see www.mydomain2.com


Greetings,
Manu





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: diferent data on diferent columns...

2001-11-19 Thread Chris Lee

echo td.$row[id].td\n;//id for the firt record ex:1
echo td.$row[name].td\n;//id for the second record ex: 2

or

echo td.$row[0].td\n;//id for the firt record ex:1
echo td.$row[1].td\n;//id for the second record ex: 2

is that what you mean?

--

  Chris Lee
  [EMAIL PROTECTED]



Romeo Manzur [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi, I wonder how could I do a script for print direfent data on
 diferents columns from a table...
 I mean this
 $result = mysql_query(SELECT * FROM xxx);
 while(($row = mysql_fetch_array($result)){
 echo table
 echo tr
 echo td.$row[id].td\n;//id for the firt record ex:1
 echo td.$row[id].td\n;//id for the second record ex: 2
 echo /tr\n;
 echo /table\n;

 if I do this it prints the same record value...

 please I need help...




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Download File Problem - text not appearing on downloaded file

2001-11-19 Thread Chris Lee

I dont know if Im pointing out the obvious or if you orgot to post more
code.

?PHP
  header(Content-type: application/octet-stream);
  header(Content-Disposition: attachment; filename=file.txt);
  // get file data rom db or wherever
  echo $data;
?

--

  Chris Lee
  [EMAIL PROTECTED]



Joe Van Meer [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi there. I managed to get the prompt for a file download when a user
clicks
 on a text link. The file downloads properly to the client machine, howevr,
 when I open up the file there is no content. What do I have to add to the
 following code to get the content sent back to the user?

 Thx Joe :)

 ?PHP

 header(Content-type: application/octet-stream);
 header(Content-Disposition: attachment; filename=file.txt);

 ?






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: OOP support

2001-11-19 Thread Chris Lee

this is fine as any of a place to ask OOP questions :)

--

  Chris Lee
  [EMAIL PROTECTED]


Roko Roic [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I don't know if this is the right place to ask this (there is no
.news.admin
 group on news.php.net), but where is the right place to look for support
for
 OOP PHP programming.

 Any newsgroups, mailing lists?

 Maybe opening a group in this hierarchy named php.oop?? Where is the right
 place to ask for group opening?

 I believe there are a lot of us OOProgrammers using PHP in an OOP manner
who
 would like to share ideas, solutions and troublshooting.


 Roko





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] How to create and run background process at Win2K

2001-11-18 Thread Chris Lee

Dear John,

Actually I need to generate an report which need an half an hour to
complete. 
The MS Proxy Server time out for the long process, so I want to create the
report by following method:

apache/mod_php - call cgi/php - email notify end user when completed.

Regards,
Chris Lee


 -Original Message-
 From: John Monfort [mailto:[EMAIL PROTECTED]]
 Sent: Monday, November 19, 2001 11:38 AM
 To: Chris Lee
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] How to create and run background process at Win2K
 
 
 
 
 You can run the application as a SERVICE.
 Would that do the trick?
 
 
 __John Monfort_
 _+---+_
  P E P I E  D E S I G N S
www.pepiedesigns.com
 The world is waiting, are you ready?
 -+___+-
 
 On Mon, 19 Nov 2001, Chris Lee wrote:
 
  Hi,
 
  It is possible to create/run background process at Win2K / Apache
  environment? If yes, how?
 
  Regards,
  Chris Lee
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: 
 [EMAIL PROTECTED]
 
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] SQL question. how relevent are the search results ?

2001-11-16 Thread Chris Lee

if I give the user a search and he enters 'cat dog' I am going to want to
find all the results that have the word 'cat' or 'dog' in them, but I want
all the results that have 'cat' and 'dog' at the beginning of the results
because these would be more relevent. now how I see it is this, it aint
pretty.

$result = select * from product where product_feature like '%cat%' and
product_feature like '%dog%'
foreach( $result as $pos = $val )
$name[$val['product_id']] = $val['product_name']
$result = select * from product where product_feature like '%cat%' or
product_feature like '%dog%'
foreach( $result as $pos = $val )
$name[$val['product_id']] = $val['product_name']
foreach( $name as $pos = $val )
echo $val br;

this will put the 'AND' before the 'OR'. but its not nice, would be nice if
I could do this with one simple query. this is only with two keywords. with
three its gets exponentially nasty.

'cat dog mouse'

$result = select * from product where product_feature like '%cat%' and
product_feature like '%dog%' and product_feature like '%mouse%'
foreach( $result as $pos = $val )
$name[$val['product_id']] = $val['product_name']
$result = select * from product where product_feature like '%cat%' and
product_feature like '%dog%'
foreach( $result as $pos = $val )
$name[$val['product_id']] = $val['product_name']
$result = select * from product where product_feature like '%cat%' and
product_feature like '%mouse%'
foreach( $result as $pos = $val )
$name[$val['product_id']] = $val['product_name']
$result = select * from product where product_feature like '%dog%' and
product_feature like '%mouse%'
foreach( $result as $pos = $val )
$name[$val['product_id']] = $val['product_name']
$result = select * from product where product_feature like '%cat%' or
product_feature like '%dog%' or product_feature like '%mouse%'
foreach( $result as $pos = $val )
$name[$val['product_id']] = $val['product_name']
foreach( $name as $pos = $val )
echo $val br;

ouch, this is just nasty, not good. there must be a better way. accually
writing code to take a dynamic number of keywords is guna be ugly.

any SQL idea's ? yes I know this is a php forum, but its related.

--

  Chris Lee
  [EMAIL PROTECTED]





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: SQL question. how relevent are the search results ?

2001-11-16 Thread Chris Lee

ok. im answering my own question here. answer is this sucks. I wrote some
nasty ruff code just to get the job done. but it invoves alot of sql queries
and alot o recursion.

?php
 include_once('database_class.egn');

 function search_string($field, $keyword, $join = 'OR')
 {
  if (!is_array($keyword))
   $keyword = explode(' ', $keyword);

  if (!is_array($field) OR !is_array($keyword))
   return ;

  foreach($field as $f_pos = $f_val)
  {
   unset($query);
   foreach($keyword as $k_pos = $k_val)
if ($k_val)
 $query[] = $f_val LIKE '%$k_val%';
   $return[] = implode( $join , $query);
  }

  if (isset($return))
   return 'WHERE ( ('. implode(') OR (', $return) .') )';
 }

 function relevent_query($search, $keyword, $first = 1 )
 {
  $keyword = explode(' ', $keyword);
  $tmp_key = $keyword;

  static $query;
  if ( $first )
  {
   $tmp = implode(' ', $tmp_key);
   $query[strlen($tmp)][$tmp] = search_string($search, $tmp, 'AND');
  }

  if ( count($tmp_key) = 1 )
  {
   $tmp = array();
   foreach( $query as $pos = $val )
foreach( $val as $q_pos = $q_val )
 $tmp[] = $q_val;
   return $tmp;
  }

  for( $count = 0; $count = count($tmp_key); $count++ )
  {
   $tmp_key = $keyword;
   unset($tmp_key[$count]);
   $tmp = implode(' ', $tmp_key);
   $query[strlen($tmp)][$tmp] = search_string($search, $tmp, 'AND');
   relevent_query($search, implode(' ', $tmp_key), $first + 1);
  }
  $tmp = array();
  foreach( $query as $pos = $val )
   foreach( $val as $q_pos = $q_val )
$tmp[] = $q_val;
  return $tmp;
 }

 $search[] = 'search_query';
 $search[] = 'search_engine';

 $keyword = 'ab cc ba';

 foreach( relevent_query($search, $keyword) as $pos = $val )
  foreach( $db-select_array('', 'search', $val) as $db_pos = $db_val )
   $id[$db_val['search_id']] = $db_val['search_query'];

 foreach( $db-select_array('', 'search', '') as $pos = $val )
 {
  $search_query[$val['search_id']] = $val['search_query'];
  $search_engine[$val['search_id']] = $val['search_engine'];
 }

 foreach( $id as $pos = $val )
  echo {$search_engine[$pos]} : {$search_query[$pos]} br;
?

that does these queries

WHERE ( (search_query LIKE '%ab%' AND search_query LIKE '%cc%' AND
search_query LIKE '%ba%') OR (search_engine LIKE '%ab%' AND search_engine
LIKE '%cc%' AND search_engine LIKE '%ba%') )
WHERE ( (search_query LIKE '%cc%' AND search_query LIKE '%ba%') OR
(search_engine LIKE '%cc%' AND search_engine LIKE '%ba%') )
WHERE ( (search_query LIKE '%ab%' AND search_query LIKE '%ba%') OR
(search_engine LIKE '%ab%' AND search_engine LIKE '%ba%') )
WHERE ( (search_query LIKE '%ab%' AND search_query LIKE '%cc%') OR
(search_engine LIKE '%ab%' AND search_engine LIKE '%cc%') )
WHERE ( (search_query LIKE '%ba%') OR (search_engine LIKE '%ba%') )
WHERE ( (search_query LIKE '%cc%') OR (search_engine LIKE '%cc%') )
WHERE ( (search_query LIKE '%ab%') OR (search_engine LIKE '%ab%') )

nasty eh? any better idea's. I hope so ..

--

  Chris Lee
  [EMAIL PROTECTED]


Chris Lee [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 if I give the user a search and he enters 'cat dog' I am going to want to
 find all the results that have the word 'cat' or 'dog' in them, but I want
 all the results that have 'cat' and 'dog' at the beginning of the results
 because these would be more relevent. now how I see it is this, it aint
 pretty.

 $result = select * from product where product_feature like '%cat%' and
 product_feature like '%dog%'
 foreach( $result as $pos = $val )
 $name[$val['product_id']] = $val['product_name']
 $result = select * from product where product_feature like '%cat%' or
 product_feature like '%dog%'
 foreach( $result as $pos = $val )
 $name[$val['product_id']] = $val['product_name']
 foreach( $name as $pos = $val )
 echo $val br;

 this will put the 'AND' before the 'OR'. but its not nice, would be nice
if
 I could do this with one simple query. this is only with two keywords.
with
 three its gets exponentially nasty.

 'cat dog mouse'

 $result = select * from product where product_feature like '%cat%' and
 product_feature like '%dog%' and product_feature like '%mouse%'
 foreach( $result as $pos = $val )
 $name[$val['product_id']] = $val['product_name']
 $result = select * from product where product_feature like '%cat%' and
 product_feature like '%dog%'
 foreach( $result as $pos = $val )
 $name[$val['product_id']] = $val['product_name']
 $result = select * from product where product_feature like '%cat%' and
 product_feature like '%mouse%'
 foreach( $result as $pos = $val )
 $name[$val['product_id']] = $val['product_name']
 $result = select * from product where product_feature like '%dog%' and
 product_feature like '%mouse%'
 foreach( $result as $pos = $val )
 $name[$val['product_id']] = $val['product_name']
 $result = select * from product where product_feature like '%cat%' or
 product_feature like '%dog%' or product_feature like '%mouse%'
 foreach( $result as $po

[PHP] Re: Strange include

2001-11-01 Thread Chris Lee

this '/' method looks kinda neet, but some vars get messed, ie $PHP_SELF,
just be carefull using it.

?php
  $INC = explode('/', $REQUEST_URI);
  unset($INC[0]);
  unset($INC[1]);
  $INC = implode('/', $INC);
  include_once($INC);
?

  Chris Lee
  [EMAIL PROTECTED]


Oòkó‰öårzòËèkó [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Sveiki, php-general,

   I have a file index.php . I include file menu.php in index.php ( I
 write include('menu.php'); in index.php ) . I want to do like this:

   index.php/menu.php . That means, that index.php has to include menu.php

   index.php/second.php . That means, that index.php has to include
   second.php .

   I think that you already know what I'm talkking about. So how could
 I do it?

 Thank you



 
  2001.11.02, penktadienis
  Marius Pertravèius
  iCQ: #125733984
  [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Destroying Ssessions

2001-11-01 Thread Chris Lee

destroying session vars never worked for me either. it hasnt for quite some
time. now why its important you destoy them other then cleanup, I dont know
your reasons. Im going to guess.

- you store username/passwd in sessions and because httpd runs as nobody,
anyone on the server can read them. ans: chroot telnet, telnet, ftp, it
should be done anyhow. dont store passwd's in plain text, encypt them and
compare the encryped passwd to the storeed encrypted passwd on the server,
if correct, great. you should do it this way anyhow.
- your finatical about cleanlyness and code perfect. ans: so am I. I rip
hair out and call it a day. dont stress it.
- you think you *have* to do this just to get sessions working: ans: wrong
- you think these files will stay on the server forever and fill your HD.
ans: wrong, check php.ini for session_gc (garbage collection)

email me any questions.

--

  Chris Lee
  [EMAIL PROTECTED]



Richard Baskett [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Unusual that I didnt even get one response, so I shall try again! :)

 Ok why does this not work?

 session_name(adminid);
 session_start();
 unset($sess);
 session_unset();
 session_destroy();
 session_write_close();
 $sess = 0;

 etc etc etc etc etc etc..

 After all that is executed I take a look at the session file and what do I
 see?  All the session variables still there... and the file still there
 also!  How can I get rid of them?

 Rick




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Is there a way not to pop up the default login window?

2001-11-01 Thread Chris Lee

if your using mod_auth then mod_auth will be called not mod_php. if you want
mod_php to be called, dont use .htaccess (they are apart of mod_auth).
sorry...

--

  Chris Lee
  [EMAIL PROTECTED]



Zhu George-Czz010 [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

 If we are using the default Apache/PHP authentication, it will always
pop up the default login window for login user ID /password.   Is there a
method to redirect to a customized PHP login page instead of the default pop
up window?

 Thanks ahead.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: print on printer

2001-11-01 Thread Chris Lee

javascript

javascript = client side
php = server side

unless you want to print on a printer on the server, your goign to need to
use javascript. not only are you asking in the wrong forum, real answer is
'I dont know' sorry cant help ya bud.

--

  Chris Lee
  [EMAIL PROTECTED]



Luz Lopez [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi All

 I have a php that access to database and show the values in the browser,
But
 I need add hte option of print on printer, but that only print the table
 with values.

 Somebody can help me?

 Thanks in Advanced,

 Regards,



 _
 Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Crating program for access parallel

2001-11-01 Thread Chris Lee

why? if your thinking the db may give the wrong answer, postgres does a bery
good job of this. if your super worried, well use mysql, they lock the table
when a field is being inserted, updated, or deleted. if you want todo this
for some other strange reason, do it the easy way.

?php
- if file 'busy.tmp' doesnt exist
- - write a file 'busy
- - do something
- - delete the file
- else
- - bugger off
?

--

  Chris Lee
  [EMAIL PROTECTED]



Luz Lopez [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi all

 I am creating a program PHP that will be access int the web for many
 persons, this aplication will be permit to insert registry on a data base
 Postgresql, When a person this inserting a registry I need to block that
 table so that another user cannot to access the data base. Exists some
form
 in php to do this?

 I want to Know how can I save  information on a Data Bse that will
 be access
 for many persons at the same time.

 Thanks in advanced for yuor advices !!!

 Regards,

 _
 Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Secure transfer

2001-11-01 Thread Chris Lee

you dont need any unctions in php todo this. you need to install openssl and
compile it into apache.

port 80 = http (non-secure)
port 443 = https (secure)

http://www.somesite.com/index.php unsecure
https://www.somesite.com/index.php same page, now everything is secure

have fun.

--

  Chris Lee
  [EMAIL PROTECTED]



Orv î?÷inklÏ ²ørÏkîskî [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi php'ers

I'm about to build a site that allows payment with credit card.
Of cause the card number, expiration date etc. should be secured
when transfered. How do I do that?
I've been looking at the OpenSSL functions in php, but they seem to
be unsatisfying.

 Kind regards,
 Morten Winkler





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Distributed Data Base

2001-11-01 Thread Chris Lee

I dont worry about it. why are you?

--

  Chris Lee
  [EMAIL PROTECTED]



Luis Corea [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hello,
 I want to Know how can I save  information on a Data Bse that will be
access
 for many persons at the same time.

 I use Postgressql

 Thanks.

 _
 Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: date problem

2001-11-01 Thread Chris Lee

date() shoudl give you the time in your timezone, gmdate() should give you
the time in the GMT timezone. I would check your server and make sure the
timezone is correctly set.

--

  Chris Lee
  [EMAIL PROTECTED]



Steve Tsai [EMAIL PROTECTED] wrote in message news:none...
 For reference:
 OS: OpenBSD 2.9
 Web Server: Apache1.3.19
 PHP Version: 4.0.6

 My problem is that date() and all the other time functions return GMT
instead
 of localtime.  system(date) returns the correct localtime.  Those
functions
 used to return localtime since GMT.  The problem seems to have started
after
 daylight savings time changed.  I hope someone has an idea of what's wrong
 and how to fix it.  As for now, I'm adding time() - 3600 * 8 to all my
 scripts right now.

 Steve



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: mysql php prob...

2001-11-01 Thread Chris Lee

put the mysql_db_query in an if() statement, more likley then not your
select statement isnt returning any results.

--

  Chris Lee
  [EMAIL PROTECTED]



Sc [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi;

 i keep getting an error of: Warning: Supplied argument is not a valid
MySQL
 result resource in /datascripts/insertdata.php on line 17...

 Line 17 is: $row = mysql_fetch_assoc($test);

 and here is the rest of it (not all of it though):

 for ($p = 1; $p = 24; $p++) {
 $test = mysql_db_query(melbourne, SELECT * FROM 'Port$p' WHERE
 'Port$p'.date='$yesterday');
 $row = mysql_fetch_assoc ($test);
 $yindata = $row['switchin'];
 $youtdata = $row['switchout'];
 $dinPort = '$inPort$p' - $yindata;
 $doutPort = '$outPort$p'  - $youtdata;

 Can anyone help me overcome this prob? i've prob missed something without
 thinking but i cant seem to get it...

 Thx.

 sc






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: is there a commandline php.exe interpreter?

2001-11-01 Thread Chris Lee

sure there is, get it at php.net goto download section and choose the cgi
version. there you are. php.exe

--

  Chris Lee
  [EMAIL PROTECTED]



John A. Grant [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I've installed ActivePerl, which gives me a way to run .pl files,
 i.e. :
 c:\ perl someprogram.pl

 Does the Win32 php installation give me a command-line
 interpreter like that?

 Here's why I'm asking. I have a set of pages that I want to convert
 to php, but I will also need to drop those pages onto a CD too.
 I suppose I could view each page from the server and 'save as
 HTML' locally, but I was thinking that I might be able to run a php
 interpreter on the *.php pages and generate corresponding *.html
 pages in batch mode as follows:
 c:\ php index.php  index.html
 c:\ php about.php  about.html
 etc.

 Then I would have to run a batch search/replace program on the
 *.html files to change all links to *.php pages to link to the
 newly-generated *.html pages.

 Is there anything like that in the win32 install package or
 just configure a web server? I started to install it, but it looked
 like it was going to just install server stuff, so I cancelled it.

 --
 John A. Grant  * I speak only for myself *  (remove 'z' to reply)
 Radiation Geophysics, Geological Survey of Canada, Ottawa
 If you followup, please do NOT e-mail me a copy: I will read it here






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] How to protect MySQL password

2001-10-23 Thread Chris Lee

I use proftpd, I can setup a chroot for the user that logs in, chroot them
to their vhosts dir, move the mysql passwd file out of that dir. now anyone
that ftp's in can not read the passwd. as for telnet (shell) access, its
rare a user needs that anyhow, if you feel your customers do need that, well
its your choice to offer them the security risk or not. I just tell our
customers, sorry, nope, to big of a security risk., I have yet to have one
complain so badly they switch hosting services.

--

  Chris Lee
  [EMAIL PROTECTED]



Kurt Lieber [EMAIL PROTECTED] wrote in message
0110231140330C.23909@z8">news:0110231140330C.23909@z8...
 On Tuesday 23 October 2001 11:20, Matt Williams wrote:
  Move it outside the document root
 
  or put a .htaccess file inside the dir to deny access. This will still
  allow system access but will prevent other fopen.

 Either solution still allows anyone with shell access to the machine to
read
 your password.  Not an ideal solution for shared hosting environments, but
if
 you're running your own server, it's a great solution.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Searching for a word in a string

2001-10-19 Thread Chris Lee

php.net/strstr

if ( strstr($string, $search) )
echo TRUE;
else
echo FALSE;

--

  Chris Lee
  [EMAIL PROTECTED]



Brandon [EMAIL PROTECTED] wrote in message
001e01c158b3$91579170$5a52a040@wi">news:001e01c158b3$91579170$5a52a040@wi...
 Hello,

 How can I search for a certain word in a string?

 Thanks
 Brandon




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: session ID does not delete itself

2001-10-19 Thread Chris Lee

in php.ini

session.gc_probability= 1   ; percentual probability that the
; 'garbage collection' process is
started
; on every session initialization
session.gc_maxlifetime= 604800  ; after this number of seconds, stored
; data will be seen as 'garbage' and
; cleaned up by the gc process

I have my php.ini set to everytime php is run it looks for session files 7
days (604800 seconds) old, if there are any files at all, there is a 1%
chance php will delete them. this is called garbage collection.

so to simply answer your question: no. they are not deleted when the user
quits their browser. the cookie however can be set to a lifetime of 0, which
means when the browser quits the cookie is considered expired and the
browser on the next launch will delete the cookie.

--

  Chris Lee
  [EMAIL PROTECTED]




Peter [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

 Hi,

 I have been experimenting with PHP4 using sessions and one of my books
 says that session ID's are created in the /tmp directory so I take a look
 in there and I find are about 10 sessions that have not been deleted dated
 earliest to about being week old

 ie.  sess_5b30ccebb1d098c37a5e46efd7708fef

 I have been experimenting with user authentication with sessions and just
 plain starting a session when a user accesses the site.

 Well, the site is still experimental and each time I logged myself out.

 But I thought sessions were supposed to wipe themselves out from the /tmp
 directory immediately after leaving the website.

 Appreciate if someone could shed the light on this issue for me.

 Thanks.

 Peter




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: search result page, need some ideas on how to do [PREV] 1 2 3 4 [NEXT] stuff..

2001-10-05 Thread Chris Lee

there are tutorials posted all over the inet, and all over this news group.
take a look around.

Ive left out the details and stuck with the basics, modify as needed, you'll
need to :)

  if (!isset($HOW_MANY))
$HOW_MANY = 10;
  if (!isset($position))
$position = 0;

  $prev = $position - $HOW_MANY;
  $next = $position + $HOW_MANY;

  $query = SELECT * FROM table LIMIT $position, $HOW_MANY;

  $search_a = $position;
  $search_b = $next;
  $search_c = @$product-product_count;

  if ($search_b  $search_c)
$search_b = $search_c;

  echo 
  Displaying $search_a - $search_b of $search_c Orders
  ;

  if ($prev = 0)
echo 
a href='$PHP_SELF?position=$prev'$IMG src='image/back.gif'/a
;
  echo 
  a href='$PHP_SELF?position=0'$IMG src='image/home.gif'/a
  ;
  if ( $next  $search_c )
echo 
a href='$PHP_SELF?position=$next'$IMG src='image/next.gif'/a
;


--

  Chris Lee
  [EMAIL PROTECTED]


Nicklas Bondesson [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 all ideas are very welcomed !!

 /nicke





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: accessing localtime array directly

2001-10-05 Thread Chris Lee

there are functions like current() next() etc but they wont help you in this
case. I just wrote my own.

function index($array, $index)
{
  return @$array[$index];
}

$now = index(localtime(), 7);

--

  Chris Lee
  [EMAIL PROTECTED]


John A. Grant [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 In Perl I have done this:
 $julianday=(localtime)[7];

 Is there an equivalent syntax for PHP or do I just do:
 $now=localtime();
 $julianday=$now[7];

 I don't need it - I'm just curious about the syntax.

 --
 John A. Grant  * I speak only for myself *  (remove 'z' to reply)
 Radiation Geophysics, Geological Survey of Canada, Ottawa
 If you followup, please do NOT e-mail me a copy: I will read it here






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: help with exec()...

2001-10-05 Thread Chris Lee

with exec() I wouldnt assume that all the PATH info is there, just to be
sure, use hardcoded paths.

exec(/usr/bin/mysqldump  /tmp/somesql.txt, $return);
print_r($return);

--

  Chris Lee
  [EMAIL PROTECTED]


Christian Dechery [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I'm running with some trouble with exec(), system() and it's friends...

 I have a MySQL backup script that somewhere have something like

 $cmd=mysqldump ..  somefile.sql;

 if( !fopen(somefile.sql,r) ) { print error message };

 $cmd is correct... I've copy-pasted it tons of times in the command shell
 and it worked... created the 'somefile.sql' and all. But none of the
 functions (exec, system..) works. When I use system it outputs me some
 header for mysqldump and that's all...

 I've also checked the directory with getcwd()... it is in the right dir to
 execute the mysqldump...

 I'm running PHP 4.06 in Apache 1.3.12 in a Win98 machine...

 what might be?




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Fancy thing.

2001-10-05 Thread Chris Lee

why is this amazing ?

--

  Chris Lee
  [EMAIL PROTECTED]


Andrey Hristov [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 After getting the PHP source from the CVS and compiling I tested with
 phpinfo(). The result was amazing :
 ===cutted=
 a href=http://www.php.net/;img
 src=/master/test.php?=PHPE9568F34-D428-11d2-A769-00AA001ACF42 border=0
 align=right alt=PHP Logo/ah1PHP Version 4.0.8-dev/h1
 ===cutted=


 --
 Andrey Hristov
 IcyGEN Corporation
 BALANCED SOLUTIONS
 http://www.icygen.com



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: next and previous links

2001-10-05 Thread Chris Lee

this question is common, accually so common that someone asked this same
question earlier today, read the previous posts before asking. phpbuilder
also has a tutorial, look around the web before posting too.

  if (!isset($HOW_MANY))
$HOW_MANY = 10;
  if (!isset($position))
$position = 0;

  $prev = $position - $HOW_MANY;
  $next = $position + $HOW_MANY;

  $query = SELECT * FROM table LIMIT $position, $HOW_MANY;

  $search_a = $position;
  $search_b = $next;
  $search_c = @$product-product_count;

  if ($search_b  $search_c)
$search_b = $search_c;

  echo 
  Displaying $search_a - $search_b of $search_c Orders
  ;

  if ($prev = 0)
echo 
a href='$PHP_SELF?position=$prev'$IMG src='image/back.gif'/a
;
  echo 
  a href='$PHP_SELF?position=0'$IMG src='image/home.gif'/a
  ;
  if ( $next  $search_c )
echo 
a href='$PHP_SELF?position=$next'$IMG src='image/next.gif'/a
;


--

  Chris Lee
  [EMAIL PROTECTED]


Mick Fitzpatrick [EMAIL PROTECTED] wrote in message
005801c14db9$6bfe4900$0100a8c0@garage">news:005801c14db9$6bfe4900$0100a8c0@garage...
 Hello

 After several days of reading various articles on the web I've 'finally'
got
 a basic database working. The database is for a massive collection of my
 vinyl records. Therefore I would like to limit the results to about 20 per
 page and move forward/backward with 'next' and 'previous' links.

 I'd like to stress at this stage that I'm new to PHP and don't really know
 and 'tech speak' related to it ... however I like to think I'm a quick
 learner :-)

 Below I've pasted a copy of the script I fashioned ... I suppose it's full
 of mistakes but it does work!

 Any assistance will be appreciated

 TIA ... Mick

 ***

 html
 body

 table border=1 width=100% cellspacing=0TRTHfont
 face=Arialartists/THTHfont face=Arialaside/THTHfont
 face=Arialbside/THTHfont face=Ariallabel/THTHfont
 face=Arialnumber/THTHfont face=Arialprice/THTHfont
 face=Arialorigin/THTHfont face=Arialformat/THTHfont
 face=Arialinfo/TH/TR


 ?php

 file://THIS BLOCK IS THE MySQL DATABASE INFO AND LOCATION
 mysql_connect (xxx, xc, xx);
 mysql_select_db (xx);

 if ($artists == )
 {$artists = '%';}

 if ($aside == )
 {$aside = '%';}

 if ($bside == )
 {$bside = '%';}

 if ($label == )
 {$label = '%';}

 if ($number == )
 {$number = '%';}


 file://THIS ROW SETS THE SEARCH CRITERIA AND THE ORDER ITS DISPLAYED ASC
is
 ASCENDING
 $result = mysql_query (SELECT * FROM example WHERE artists LIKE
'$artists%'
 AND aside LIKE '$aside%' AND bside LIKE '$bside%' AND label LIKE '$label%'
 AND number LIKE '$number%' ORDER BY artists ASC);

 if ($row = mysql_fetch_array($result)) {

 do {


 file://THIS BLOCK DEFINES THE ALTERNATE ROW COLOURS
 $darkcolor=#EE;
 $lightcolor=#FF;
 $test=$colorcount%2;
 if ($test==0){
 $rowcolor=$darkcolor;}
 else{
 $rowcolor=$lightcolor;}
 $colorcount++;

 file://THIS BLOCK PUTS THE SEARCH RESULTS IN THE TABLE
 echo(tr valign=top bgcolor=$rowcolor/TDTDfont size=1 face=Arial
.
 $row[artists] . /TDTDfont size=1 face=Arial . $row[aside] .
 /TDTDfont size=1 face=Arial . $row[bside] . /TDTDfont
size=1
 face=Arial . $row[label] . /TDTDfont size=1 face=Arial .
 $row[number] . /TDTDfont size=1 face=Arial . $row[price] .
 /TDTDfont size=1 face=Arial . $row[origin] . /TDTDfont
 size=1 face=Arial . $row[format] . /TDTDfont size=1 face=Arial
.
 $row[info] . /TD/TR);

 } while($row = mysql_fetch_array($result));

 } else {print font face=ArialSorry, no records were found!;}

 ?

 /body
 /html





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: session var being lost between pages

2001-10-01 Thread Chris Lee

echo $PHPSESSID on every page, is it the same on every page ?

I usually recommend that you create the register variables too.

else {
  $userid = '';
  $userpassword = '';
  session_register('userid');
  session_register('userpassword');
}

if $PHPSESSID is set then session_start() will find it and use it, if your
trying to override HTTP_COOKIE_VARS['PHPSESSID'] with
HTTP_GET_VARS['PHPSESSID'] I would also check if it is not thedefault
allready, change the code to relect that then

if (isset($HTTP_GET_VARS['PHPSESSID']) AND $PHPSESSID !=
$HTTP_GET_VARS['PHPSESSID'])

all small things, nothing big looks wrong. try it and see.

--

  Chris Lee
  [EMAIL PROTECTED]


Jean-Christian Imbeault [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]...
 Ok, newbie I am but ... I seem to be losing my session vars when I load up
a
 different php page.

 My set-up:

 1- main page starts session and logs user in

 if (isset($PHPSESSID))
   session_start($PHPSESSID);
 else
   session_start();

 $PHPSESSID = session_id();
 $SID   = PHPSESSID=$PHPSESSID;

 if(!isset($userid)) {
login_form();
exit;
 }
 else {
session_register(userid, userpassword);
 }

 Once the user is logged in I have no problem accessin the vars $userid and
 $userpassword.

 On the page I even have an A HREF link to second php page and the vars
are
 accessible there also.

 However this other page has a form. When the user submits the form, a
third
 php page is loaded. On this third page the vars no longer have any values.

 Why is this? How can I access the vars from this third page?

 Thanks!

 Jc



 _
 Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: HTTP Authentication / Logging Out

2001-10-01 Thread Chris Lee

php is serverside, PHP_AUTH_USER is set by the client, therfore when you
unset() the serverside instance of PHP_AUTH_USER the client doesnt know
about this and keeps sending the username/pass. the only way I know of is to
re-send the http auth headers and change the domain. this works for me.

Header(WWW-Authenticate: Basic realm='someother-domain' );
Header(HTTP/1.0 401 Unauthorized);

--

  Chris Lee
  [EMAIL PROTECTED]


Eric J Schwinder [EMAIL PROTECTED] wrote in
message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I used a pretty basic system to check HTTP authentication values against
 database values, but I can't seem to find a way to allow the user to log
 out.  I tried:

 unset($PHP_AUTH_USER)

 but Internet Explorer hangs on to that value until all browser windows are
 closed.  Is there any way around that?

 Thanks,

 Eric J Schwinder
 eric.AT.bergencomputing.DOT.com





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: 2D array from file

2001-09-26 Thread Chris Lee

have you thought of just using

http://www.php.net/manual/en/function.serialize.php
http://www.php.net/manual/en/function.unserialize.php

its alot easier.

--

  Chris Lee
  [EMAIL PROTECTED]


John Frenzel [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I have created a 2D array, then written it into a tet file. The file is
 written such that all the secondary array elements (the rows) are seperate
 lines, with the columns tab-delimited. Now I'd like to read this file
back
 into a 2D array. I thought this should work:


 $array_file = file (array.dat);
 for ($k=0; $k = 63; $k++)
 {
 $array[$k] = explode( \t, $array_file[$k] );
 }

 I know that $array[$k] is a valid variable, and that explode returns an
 array, so I'm not clear why this isn't working. If I use $array = explode(
 \t, $array_file[$k] ); I get the line without any trouble. What am I
 missing?

 Thanks

 --- John Frenzel





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: writing files

2001-09-25 Thread Chris Lee

'/images/image1.png' is 'root/images/image1.png'
'images/image1.png' is 'webroot/images/image1.png'

you are using the first, unless your something wierd on your first box, like
chroot, or safe_mode, or something else Ive never used, I dont know why the
first server is acting the way it is.

--

  Chris Lee
  [EMAIL PROTECTED]




Jeb Scarbrough [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 When I run the code below it writes the image to the webroot/images
 directory on a Solaris machine running iPlanet and php4.04pl1.  When I run
 the exactly same code on a Solaris machine running iPlanet and php4.08 it
 tries to write the file to root/images/image1.png.  Why would one
write
 to the webroot and one write to the file system root?  Is there
 configuration directive I can put in the php.ini to resolve?  What am I
 missing here?

 Thanks!


 ?php
 $key = /images/image1.png;
 $value = http://xxx.xxx.xxx.xxx?type=PNG;;
 if(file_exists($key)) {
 $diff =  time() - filemtime($key);
 if($diff = 3600) {
 unlink($key);
 }
 $im = ImageCreateFromPNG($value);
 $isCreated = imagepng($im, $key, '80');
 }
 ?

 
 Jeb Scarbrough
 [EMAIL PROTECTED]

 Internet Security Systems, Inc.
 6303 Barfield Road
 Atlanta, Georgia 30328
 Phone: 404-236-3292
 Fax: 404-236-2626
 _



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: dates only in the future

2001-09-25 Thread Chris Lee

If the user submits the page and that date is wrong then dont save the data,
check the data serverside. if you want the date checked before the client
presses submit, your looking at doing somehting client side, javascript. php
is server side only, just check the data to see if it is valid at the
server, if it isnt, just send the user back with a nasty message and tell
them to smarten up :)

if ( time()  mktime(1, 1, 1, $month, $day, $year) )
echo Bad !!;
else
echo Good, now I'll save the data;

--

  Chris Lee
  [EMAIL PROTECTED]



Kristjan Kanarik [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Good afternoon,

I'm looking for a function which enables me to allow user only to enter
those dates which are still to come. In my head I have three select
things... one for day, one for month and one for year. In order to prevent
the user from submitting the form with the date which is in past, I need
probably Javascript. Am I correct?

I rather prefer to keep my site Javascript free and therefore it would be
great if somebody has already written such a function and would be ready to
share it with me/others. If not, any ideas how to start... 

TIA  happy coding,
Kristjan Kanarik

P.S. Please put [EMAIL PROTECTED] to CC: line since I'm only on the digest.






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Test.php does not show that it was configured with sybase on Linux 7.1

2001-09-25 Thread Chris Lee

you installed sybase after you installed php ? yup you need to re-install,
how would php know about something that was never on the system when you
compiled php ? if you installed sybase then php and php doesnt see it, well,
php does that, its anoying.

configure --with-sybase=/usr/local/sybase

change that to where ever your sybase dir is.

--

  Chris Lee
  [EMAIL PROTECTED]



Caleb Carvalho [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi all,

 I have installed sybase on my Linux 7.1 machine and after
 creating my first php-4.0.4pl1-9 page, sybase is not listed under
 ./configure section,,,

 do i need to recompile again???

 pls help



 Caleb Carvalho
 LoadRunner/APM
 --
---
 Enterprise Testing and Performance Management Solutions
 --
---
 Mercury Interactive
 410 Frimley Business Park
 Frimley, Surrey.  GU16 7ST
 United Kingdom
 Telephone :  +44 (0)1276 808300


 _
 Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Counter

2001-09-25 Thread Chris Lee

there are tutorials all over the inet.

?
  $file_name = '/tmp/counter.txt';
  $counter = fread(fopen($file_name, 'r'), 4096);

  echo $counter;

  unlink($file_name);
  fwrite(fopen($file_name, 'w+'), ++$counter);
?

--

  Chris Lee
  [EMAIL PROTECTED]



Mark Lo [EMAIL PROTECTED] wrote in message
000501c145d9$c5f56ca0$caccfea9@mark">news:000501c145d9$c5f56ca0$caccfea9@mark...
 Hi,

 I would like to know how to write a web page counter in PHP or
 Javascript.

 Thank You

 Mark Lo




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Socket help

2001-09-25 Thread Chris Lee

your server has to open a connection to a remote host to see if there are
messages ? like email ? if this is so then use cron once every so often to
check if there are new messages. if the remote host makes a connection to
your server the use tcp_wrappers to call your php script.

the second script can NOT use the first apps socket, sockets arent shared
like that.

yes, sending and recienveing should be ok, any data backed up will just be
stored in buffers.

--

  Chris Lee
  [EMAIL PROTECTED]



Stefano Baronio [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hello list,
 I need to receive/send sms through an IPSec connection
 using the socket (pfsocket) function of php.
 I hope there's someone out there that can help me solving
 some questions.

 Here is what I thought to do:
 REC_SCRIPT that open the socket connection and listen on
 arriving messages (msg will be stored in mysql)
 SEND_SCRIPT that is launched from a html form and use that
 socket to send the message and store it in myslq.

 Questions
 1. Can the REC_SCRIPT stay alive listening on the persistent
 socket connection ?
 2. There's a way to launch it automagically when I start
 apache ?
 3. Can the SEND_SCRIPT use the socket conn. opened by the
 first script ?
 4. In case of receive/send in the same time, will all be ok
 ?

 Thank you very much for any help

 Stefano Baronio

 [EMAIL PROTECTED]
 www.sateltrack.com




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: calling javascript function from a form image

2001-09-21 Thread Chris Lee

this isnt reallt a php question but I'll answer it anyhow because Ive been
stuck with netscapes incompatabilities before. do this.

input type=image border=0 name=sub src=genre.png
onsubmit=set_category()

if that doesnt work you'll have todo this.

script
function set_category()
{
  alert(category set);
  document.formMoviesSearch.submit();
}
/script
...
input type='hidden' name='sub' value=''
img src=genre.png onclick=set_category()

or if you want the hand to show up over the image. change the img tag to

a href='javascript: set_category()'img src=genre.png/a

--

  Chris Lee
  [EMAIL PROTECTED]



Neil Freeman [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi,

 I have a form which contains an:
 input type=image

 When the user clicks this image I want a javascript function to be
 called. I have added an onclick event to this input line (see code
 below) which works great in IE and all is well. Netscape doesn't
 recognise this onclick event though for the image so how do you call a
 javascript function here? Normally I'd wrap an img with a/a tags
 but I don't think a form will like this.

 Has anyone a solution?

 Here is my code

 #
 head
 titleimagesubmit.htm/title

 script
 function set_category() {
  alert(category set);
 }
 /script
 /head

 body bgcolor=#FF text=#00

 ?php

 if ($submit_form)  //if this equals true then the form has been
 submitted
 {
  echo scriptalert(\form submitted\);/script;
 }
 else
 {
  echo scriptalert(\not submitted\);/script;
 }

 ?

 form name=formMoviesSearch method=post action=imagesubmit.htm

 input type=image border=0 name=sub src=genre.png
 onclick=set_category()
 input type=hidden name=submit_form value=true

 /form

 /body
 /html
 #

 Neil

 
  Email:  [EMAIL PROTECTED]
  [EMAIL PROTECTED]
 





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Sockets

2001-09-19 Thread Chris Lee

is this even a php related question? post some code and an example site and
we'll see what we can do.

--

  Chris Lee
  [EMAIL PROTECTED]



Jonathan Hilgeman [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I run a web application that opens a socket using cURL and sends data to a
 payment gateway and then receives confirmations, etc... Sometimes, a
visitor
 clicks multiple times and I have the program check to see if a transaction
 is already in process, and if so, it redirects them to a page where they
can
 check to see whether the transaction has gone through. So now I have 1
 thread/request going, doing the processing, and returning the data, and a
 second thread where the visitor can check to see if thread 1 has come back
 from processing or not. Normally, this works okay.

 SOMETIMES, thread 1 does not come back with data from the gateway, as if
the
 connection had timed out. Sometimes the gateway has processed the
 transaction, and sometimes not. So I would like to know if there's a
program
 or something that will allow me to either log socket communication, or to
 monitor the sockets, etc... Can anyone help me out with this?

 - Jonathan







-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Modularity--Optimizing Includes and Libs

2001-09-19 Thread Chris Lee

ok, everytime a page is called php loads all the file that are requested,
php then compiles the whole thing, and only runs what you tell it to
(obviously). if you have a library with 100 huge functions yet you dont use
not one of those functions other then loading time to load that huge file,
the performance will not sufer because you dont call any of those huge
functions. try it.

?php
function sleep_some()
{
sleep(10);
}
?

run this, obviously because I dont ever call that unction, the function is
never called, therfore my app doesnt take 10 seconds to run. now if you had
10 include files 100k each and never called anything in there, well ya its
going to take a little while, thats alot of code to be loading. if you have
a simple C app that loads 10 huge shared libraries that it doesnt do
anything with, well ya, same deal, it'll take awhile longer then without.
the obvious question is why are you loading 10 100k libraries that your not
going to use ? only put relevant data in your libraries and only call
relevant libraries and you wont have a problem.

--

  Chris Lee
  [EMAIL PROTECTED]



Bora Paksoy [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi;

 I have a question regarding includes and writing
 library modules in PHP.

 In one of the replies to my previous e-mail,I was told
 that PHP parses/compiles pages everytime a new request
 comes in. So, does this mean we have to minimize the
 amount of code per page (which also means to minimize
 number of includes) to improve response time? I mean,
 usually in many programming languages, it is a common
 practice to gather shared functions in a library and
 include/import them from individual scripts. But, in
 case of PHP, given that this library will also be
 parsed/compiled per every request, is this a bad
 practice? What is the alternative to this? Replicate
 functions that are used in scripts in every page?

 Thanks,
 Baho

 __
 Terrorist Attacks on U.S. - How can you help?
 Donate cash, emergency relief information
 http://dailynews.yahoo.com/fc/US/Emergency_Information/



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: session screw up - any experience/hints for me?

2001-09-19 Thread Chris Lee

more likley then not what your seeing is the browser cache the results of
page 1. If I am understanding this correctly. post link and link.src and
I'll have a look. without code, there isnt anything more then guess.

  header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
  header('Last-Modified: '. gmdate('D, d M Y H:i:s') .' GMT');
  header('Cache-Control: no-cache, must-revalidate');
  header('Pragma: no-cache');

should tell most browsers not to cache.

--

  Chris Lee
  [EMAIL PROTECTED]



Wolfram Kriesing [EMAIL PROTECTED] wrote in message
01091919575201.01019@hubert">news:01091919575201.01019@hubert...
 i am saving data in the session
 lets say every page relates to specific session data, like:
 page 1 sets sess_x=1,
 page 2 sets sess_x=2
 but if i use the history.back or the browsers back-button i can go from
page
 2 back to page 1 WITHOUT updating the session
 so what i finally have is page 2 where sess_x=1 and that screws up the
 logic at some point, since the session could not be updated because the
page
 the user sees came from the browser cache, which didnt necessitate an
 interaction with the server, so the server thinks that the user sees
 another page

 how can i handle this stuff? or prevent it from happening?
 or is my way of session handling weird?

 thanks in advance

 Wolfram



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Problem: lost session id when htaccess'ing.

2001-09-18 Thread Chris Lee

- you have cookie support on or off ?
- you using any header redirects ? (you have to manually add the SID to
URI's)

send some src and a link. lets see whats going on.

--

  Chris Lee
  [EMAIL PROTECTED]




Lic. Rodolfo Gonzalez Gonzalez [EMAIL PROTECTED] wrote in
message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hello,

 I have a problem with sessions: I have php with sessions autostarting,
 compiled with transid support. I have a homepage with a link to another
 page protected via Apache's htaccess. Well, the href's in the homepage get
 the correct SID=md5 session id, then I click the link, I give login and
 password, Apache checks and accepts the data, but then in the next page I
 get a new session_id value!! (as if the SID passed in the URL were being
 lost!). I guess this is not normal. What can I do?.

 Many thanks in advanced.
 Rodolfo.

 P.S. apache-1.3.20, custom mod_mysql_auth, php-4.0.8-dev (latest snapshot,
 4.0.6 had a bug in the imap code, and I haven't returned to 4.0.5 yet).





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] What is PHP's equivalent?

2001-09-18 Thread Chris Lee

correct me if Im wrong, but I wanted to add a note saying that php supports
loading .COM and .NET only if the server is windows based.

--

  Chris Lee
  [EMAIL PROTECTED]


Sterling Hughes [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 On Mon, 17 Sep 2001, Eric Lebetsamer wrote:

  What is PHP's equivalent to ASP/COM or JSP/EJB?  Basically, I want to
get an
  idea of what methods there are of having multi tier development in PHP.
Any
  information or links are appreciated.
 

 Not that PHP needs an equivalent, but... PHP supports loading of
 COM, .NET and Java objects into its source code, you can also write
 PHP extensions in C (much faster than COM, .NET or EJB).

 -Sterling




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Getting data over https?

2001-09-18 Thread Chris Lee

php doesnt support https url-wrappers. grab the data with an external app
maybe, it'll be ugly.

exec('lynx -source https://www.pilotmedia.fi/  /tmp/somefile.txt');
fopen('/tmp/somefile.txt', 'r');
unlink('/tmp/somefile.txt');

--

  Chris Lee
  [EMAIL PROTECTED]



Ville Mattila [EMAIL PROTECTED] wrote in message
000b01c13fa0$fe139ce0$0100a8c0@ville">news:000b01c13fa0$fe139ce0$0100a8c0@ville...
Hi there,

Is there a way to get data over https-protocol as can be done with
file(http://www.pilotmedia.fi/;) -function with normal http-protocol? Or
some other way?

- Ville

.
Ville Mattila
Ikaalinen, Finland
[EMAIL PROTECTED]
www.pilotmedia.fi





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: how can i show my table 5 record by five record ?

2001-09-18 Thread Chris Lee

I dont understand, so Im going to make up a question and then answer it.

how do I make a table five elements wide dynamically ?

echo 
tr
;
foreach( $db-select_array('', 'product', '') as $pos = $val )
{
  if ( !(@$counter++ % 5) )
echo 
/trtr
;
  echo 
  td{$val['product_name']}/td
  ;
}
echo 
/tr
;

there you go every five products you get a new line.

--

  Chris Lee
  [EMAIL PROTECTED]


Alawi Albaity [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 how can i show my record to user to view it five
 record by fifve record by click link


 __
 Terrorist Attacks on U.S. - How can you help?
 Donate cash, emergency relief information
 http://dailynews.yahoo.com/fc/US/Emergency_Information/



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Handling sessions between servers?

2001-09-18 Thread Chris Lee

using mysql is an excelent choice, if your not using a db Ive seen people
pass the data raw

echo 
a href='http://www.mediawaveonline.com/index.php?session_data=;.
base64_encode(session_encode()) .'mediawaveonline.com/a
;

then

session_decode(base64_decode($session_data));

its ugly, but it works.
--

  Chris Lee
  [EMAIL PROTECTED]


Josh Hoover [EMAIL PROTECTED] wrote in message
E973048AB322D411AE99009027E32DF685CD83@FRAZ">news:E973048AB322D411AE99009027E32DF685CD83@FRAZ...
 You can use NFS shares, but I've read that it is too slow for most
 situations.  My suggestion would be to use a database and use a custom PHP
 session handler.  A really good tutorial (including working code) on how
to
 write custom PHP session handlers utilizing a database can be found at the
 following URL:

 http://www.phpbuilder.com/columns/ying2602.php3

 I've tested this code and it worked fine utilzing MySQL.  You can apply
the
 same concepts to just about any datasource you want.

 Josh Hoover
 KnowledgeStorm, Inc.
 [EMAIL PROTECTED]

 Searching for a new IT solution for your company? Need to improve your
 product marketing?
 Visit KnowledgeStorm at www.knowledgestorm.com to learn how we can
simplify
 the process for you.
 KnowledgeStorm - Your IT Search Starts Here

  From: Michael Champagne [mailto:[EMAIL PROTECTED]]
 
  Is it possible to handle sessions with PHP between separate
  web servers?  We
  have 2 Apache servers and would like to share session data
  between them.  If
  we keep the session data on an NFS mounted drive -- will this
  work?  Would it
  be better to write custom session handlers to store session
  data in a database
  accessible from both servers?  It seems like this should be
  possible, but I'm
  not quite sure how to go about doing it.  Also, this is on 2 separate
  platforms.  One is RedHat Linux 7.1 and the other server is
  on AIX 4.3.3.
 
  Thanks in advance for any replies,
  Mike




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Previous / Next Buttons

2001-09-06 Thread Chris Lee

I just use LIMIT its alot better, alot less CPU intensive.

if (!isset($pos))
$pos = 0

SELECT * FROM product LIMIT 0, $pos

$pos++
if ( !((SELECT count(*) FROM product)  $pos) )
a href='$PHP_SELF?pos=$pos'Next/a

you get the idea.

  Chris Lee
  [EMAIL PROTECTED]

Jeff Oien [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Hi, what's the simplest way to provide previous/next buttons that
navigate
  through individual records of a database?  This is for a photo gallery,
so I
  want to do one record at a time until I'm out of records, then I want
the
  next button to disappear.  I've been fiddling with it for a while now,
but
  haven't been very successful.  Anyone have any snippets, or ideas for
me?
 
  Thanks in advance.

 I'll show you what I did but realize I'm an advanced beginner/intermediate
 programmer. This may not be the most efficient way to do it but seems to
 be the simplest code compared to other ways of doing it that I've seen.
Not
 sure if I will explain this well enough either. And this is for a fairly
small
 database. With a larger one it may be too inefficient.

 First count how many records are in the database for the album and put
 it in $count.

 Then loop through all the records in the album, place the id for each
record
 in an array and find out where in the array the current record is.
$photo_id
 is fed to this script which tells it which picture to display:

 $x = 0;
 while ($row = mysql_fetch_array($result)) {
 $photo_id1 = $row['photoid'];
 $array[$x] =  $photo_id1;
 if ($photo_id1 == $photo_id) {
 $position = $x;
 }
 $x++;
 }

 In another sql query for retrieving the specific image (have to compensate
for
 array[] starting at zero but record count starting at 1):

 $row = mysql_fetch_array($result);
 $photo_id = $row['photoid'];
 if ($position == 0) {
 $photo_pos = $position + 1;
 echo pShowing $photo_pos of $count lt;lt; Previous; //no link
 }
 else {
 $photo_pos = $position + 1;
 $previous_pos = $photo_pos - 2;
 $previous = $array[$previous_pos];
 echo pShowing $photo_pos of $count a
 href=\display.php?photo_id=$previous\lt;lt; Previous/a;
 }
 if ($count == $photo_pos) {
 echo  | Next gt;gt;; //no link
 }
 elseif ($photo_pos  $count) {
 $next_pos = $photo_pos;
 $next = $array[$next_pos];
 echo  | a
 href=\display.php?photo_id=$next\Next gt;gt;/a;
 }

 Comments from more experienced programmers welcome. I don't want to lead
 astray.
 Jeff Oien



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: SESSIONS! - please help

2001-09-06 Thread Chris Lee

this allways buggers people up

session_register(count);
$count = array();

should be

$count = array();
session_register(count);

you have to set the var first before registering it. you should also check
if the var is allready registerd ($HTTP_SESSION_VARS[]) if so, dont
re-register it, this can cause session to segfault apache every so often.

www.mediawaveonline.com/exmaples/session.txt

this is my session file I use, take a look at what I mean.

also your using php4 so try foreach() its alot nicer, just looks better.

foreach($count as $key = $value)
vs
while (list($key, $value) = each ($count))

--

  Chris Lee
  [EMAIL PROTECTED]




Christian Haines [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 hi all,

 PHP-4.03pl
 LINUX 7.0

 i am still having problems with sessions. the following does nothing but
 should appear to do something! it is just a simple experiment to test that
 sessions work. session_test.php calls session_proc.php to perform one of
 three functions.

 i would really appreciate any help as this is driving me nuts. i have also
 tested this on other systems to no avail.

 many thanks in advance,
 christian


 - session_test.php --
 html

 body
 ?
 if(is_array($count))
 {
 reset ($count);
 while (list($key, $value) = each ($count)) {
 echo Key: $key; Value: $value
 Count:.count($value).br\n;

 if(is_array($value))
 {
 reset ($value);
 while (list($key2, $value2) = each ($value)) {
 echo --- Key: $key2; Value: $value2 br\n;
 }
 }
 }
 }

 print brnbsp;br.count($count).
 ---.session_is_registered(count);

 ?
 form name=test method=post action=session_proc.php
 input name=increment type=submit value=incrementinput name=reset
 type=submit value=resetinput name=decrement type=submit value=decrement
 /form

 /body
 /html

 - session_proc.php --
 ?
 session_start();

 session_register(count);
 $count = array();

 if(isset($increment))
 {
 $count[0] = 9;
 $count[1] = 11;
 $count[2] = 12;
 }

 if(isset($reset))
 {
 unset($count);
 }

 if(isset($decrement))
 {
 $count[0] = 4;
 $count[1] = 6;
 $count[2] = 1;
 }

 header(location: session_test.php);
 exit;
 ?




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Mailing, which is faster

2001-09-06 Thread Chris Lee

benchamrking is a common question with a common answer, try it yourself,
depending on your situation/hardware/software this will very greatly from
machine to machine.

--

  Chris Lee
  [EMAIL PROTECTED]


Niklas lampén [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Which is faster (and/or smarter), using function mail() or doing it by
 popen(/blah/sendmail)?


 Niklas




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: multi updates

2001-09-06 Thread Chris Lee

where's the form, maybe the problem is there. your update query has no where
statment, this isnt syntaxicaly incorrect, its just rare that you need to
update every single element in the database to the same value. everything
else looks ok, what exactly is the error/warning ? you dont accually need
the $conn in mysql_query() and die() is just nasty, I like a little bit more
friendly user errors. I also like to shorten things by putting the
mysql_query in the if() statement

if ( !mysql_query($sql) )

--

  Chris Lee
  [EMAIL PROTECTED]



Gary [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I have a form that has name (unique in the table), team, pick, and
 message. The below is updating all the rows with the same updates. where
 have I screwed up?



 $sql = UPDATE cappers SET team= \$team\, pick = \$pick\, message =
 \$message\;

 //Get Results
 $sql_result = mysql_query($sql, $conn) or die(Couldn't Query Database);

 if(!$sql_result) {

 TIA
 Gary




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: this newsgroup via newsgroup program?

2001-09-06 Thread Chris Lee

I use Outlook Express and Im posting this via news.php.net into php.general

--

  Chris Lee
  [EMAIL PROTECTED]


Chris Hayes [EMAIL PROTECTED] wrote in message
3B981E0F.25754.4210CA@localhost">news:3B981E0F.25754.4210CA@localhost...
 hi,
 from http://www.php.net/support.php i get the
 impression that i can subscribe to this group via
 news.php.net. Indeed i can collect a zillion
 newsgroups via that server but i cannot find
 php.general. Neither on news.xs4all.nl.
 I am using 'Agent'.
 Chris

 ---
 -
 --  C.Hayes  Droevendaal 35  6708 PB Wageningen
 the Netherlands  --
 ---
 -






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




  1   2   3   4   >