Re: [PHP] Apache

2002-03-21 Thread scott furt

Errmm... i don't know any apache groups, but
if you want to do what you ask, just read the
documentation, it's easy :-)

jtjohnston wrote:
 Anyone know of a good apache group?
 I want to hide the structure of a directory when there is no idex.html
 present g
 
 J
 
 
 



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




Re: [PHP] Apache

2002-03-21 Thread jtjohnston

Scott ,
I am. :) I'm looking at IndexIgnore but not sure if it's what I want?
John

 Errmm... i don't know any apache groups, but
 if you want to do what you ask, just read the
 documentation, it's easy :-)

 jtjohnston wrote:
  Anyone know of a good apache group?
  I want to hide the structure of a directory when there is no idex.html
  present g
 
  J
 
 
 

--
John Taylor-Johnston
-

  ' ' '   Collège de Sherbrooke:
 ô¿ô   http://www.collegesherbrooke.qc.ca/languesmodernes/
   - Université de Sherbrooke:
  http://compcanlit.ca/
  819-569-2064



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




Re: [PHP] Apache

2002-03-21 Thread jtjohnston

I'm also looking at this in my .conf. I know putting something here is the
answer, but what :)

Directory /
Options FollowSymLinks
AllowOverride All
/Directory

J

Scott Furt wrote:

 Errmm... i don't know any apache groups, but
 if you want to do what you ask, just read the
 documentation, it's easy :-)

 jtjohnston wrote:
  Anyone know of a good apache group?
  I want to hide the structure of a directory when there is no idex.html
  present g
 
  J
 
 
 

--
John Taylor-Johnston
-

  ' ' '   Collège de Sherbrooke:
 ô¿ô   http://www.collegesherbrooke.qc.ca/languesmodernes/
   - Université de Sherbrooke:
  http://compcanlit.ca/
  819-569-2064



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




[PHP] Re: [PHP-DEV] - Looking for good php-editor

2002-03-21 Thread Andrey Hristov

Komodo by ASPN - commercial. Code completion, debugging, syntaxt highlighting, syntaxt 
checking.
AnyEdit - Editor. Crashes on my Win2k but may work on yours. On http://sourceforge.net
UltraEdit - Commercial. Syntaxt highlighting with a additional info in a text file. 
The additional info about syntax highlighting
can be found on Sourceforge. Look for : php syntaxt highlighting.
PHPMole - Written in PHP requires GTK. Instructions for installation on the PHPMole's 
site.
EditPlus - commercial. One of my colleagues prefers it.
Suggestion : Look on freshmeat.net and sourceforge.net for IDE or editor syntax 
highlighting

Best regards,
Andrey Hristov

- Original Message -
From: Krister Hansson [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, March 21, 2002 10:20 AM
Subject: [PHP-DEV] - Looking for good php-editor


Hi there!!

I'm fairly new as a php developer and I can't seem to find a good editor. I've 
installed and uninstalled about 20 of them and now
I'm tired of it. Is there anyone (and there should be ;) ) who know of an editor I can 
use. If you do please mail me a link or
something

I'm working in Win2k

regards

Krister


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




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




Re: [PHP] Apache

2002-03-21 Thread Jan Rademaker

On Thu, 21 Mar 2002, jtjohnston wrote:

 I'm also looking at this in my .conf. I know putting something here is the
 answer, but what :)
I believe it was something like the NoIndex option, but I'm not sure...
 
 Directory /
 Options FollowSymLinks
 AllowOverride All
 /Directory
 
 J
 
 Scott Furt wrote:
 
  Errmm... i don't know any apache groups, but
  if you want to do what you ask, just read the
  documentation, it's easy :-)
 
  jtjohnston wrote:
   Anyone know of a good apache group?
   I want to hide the structure of a directory when there is no idex.html
   present g
  
   J
  
  
  
 
 --
 John Taylor-Johnston
 -
 
   ' ' '   Collège de Sherbrooke:
  ô¿ô   http://www.collegesherbrooke.qc.ca/languesmodernes/
- Université de Sherbrooke:
   http://compcanlit.ca/
   819-569-2064
 
 
 
 

-- 
Jan Rademaker [EMAIL PROTECTED]
http://www.ottobak.com



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




RE: [PHP] Is there any Possible Way to get data from Excel File?

2002-03-21 Thread Feroze Md. Arif

How about using COM?

http://www.php.net/manual/en/ref.com.php

I haven't used this personally but perhaps it could be a useful solution.
However there may be issues like running a copy of EXCEL on the server.

Best Regards
Feroze

Jar Jar Binks will be Jedi!!

-Original Message-
From: Justin French [mailto:[EMAIL PROTECTED]]
Sent: 20 March, 2002 2:11 PM
To: php
Subject: Re: [PHP] Is there any Possible Way to get data from Excel
File?


Anything is possible :)

I'd recommend that the Excell file be exported as a CSV, which will be a
LOT easier to munch through, because it won't contain formatting, or
anything else.


Justin French
indent.com.au
soundpimps.com


Jack wrote:

 Dear all
 What i'm planning to do is to use php to grep the data from a Excel file
and
 then insert it to the MySQL Database, so is there any possible way that
the
 php can grep the data from an Excel File?

 Thx all
 Jack
 [EMAIL PROTECTED]

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


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




RE: [PHP] Making a simple borderless pop up window with a Close button

2002-03-21 Thread Stampe, Lars

Hi,

I have a script that might do what you want, I don't have time to explain
but have a look at:
http://www.epson.co.uk/product/printers/inkjet/styc80/flash/index.html and
launch the site!

** SCRIPT

/*
CHROMELESS WINDOWS v.31.0 [ 4.50K ]
(c) Gabriel Suchowolski,2000 | www.microbians.com
Licensed under GNU LGPL (www.gnu.org)
*/

function chromeless(u,n,W,H,X,Y,cD,cU,cO,cL,tH,tW,wB,wBs,wBG,wBGs,wNS,fSO){
var c=(document.allnavigator.userAgent.indexOf(Win)!=-1)?1:0
var w=window.screen.width; var h=window.screen.height
var W=W||w; W=(typeof(W)=='string'?Math.ceil(parseInt(W)*w/100):W);
W+=2*c
var H=H||h; H=(typeof(H)=='string'?Math.ceil(parseInt(H)*h/100):H);
H+=23*c
var X=X||Math.ceil((w-W)/2)
var Y=Y||Math.ceil((h-H)/2)
var s=,width=+W+,height=+H

if(c){
var cTIT='\n'+
'htmlheadMETA HTTP-EQUIV=imagetoolbar
CONTENT=no\n'+
'script\n'+
'var iclod=new Image();iclod.src='+cD+';var iclou=new
Image();iclou.src='+cU+';var icloo=new Image();icloo.src='+cO+';var
iload=new Image();iload.src='+cL+';\n'+
'document.onselectstart=new Function(return
false;);document.ondragstart=new Function(mWIN();return
false;);document.oncontextmenu=new Function(return
false;);document.onmousemove=mWIN\n'+
'b=-1;\n'+
'function
wLoa(){if(top.loaded){bloa.style.visibility=hidden;sRes()}else
setTimeout(wLoa(),500)}\n'+
'function
sRes(){bclo.style.pixelLeft=document.body.clientWidth-18;bloa.style.pixelLef
t=document.body.clientWidth-38}\n'+
'function mWIN(){\n'+

'if(b==0){document.body.bgColor='+wBG+';parent.bM.document.body.bgColor='
+wB+';parent.bT.document.body.bgColor='+wB+';parent.bB.document.body.bgCo
lor='+wB+';parent.bL.document.body.bgColor='+wB+';parent.bR.document.bod
y.bgColor='+wB+';b=-1}\n'+

'if(b==2){px=event.screenX-ofx-1;py=event.screenY-ofy-1;top.window.moveTo(px
,py);}\n'+

'if(b==1){document.body.bgColor='+wBGs+';parent.bM.document.body.bgColor=
'+wBs+';parent.bT.document.body.bgColor='+wBs+';parent.bB.document.body.b
gColor='+wBs+';parent.bL.document.body.bgColor='+wBs+';parent.bR.documen
t.body.bgColor='+wBs+';ofx=event.x;ofy=event.y;b=2}\n'+
'}/script/head\n'+
'body onresize=sRes() bgcolor='+wBG+'\n'+
'div
style=position:absolute;left:0px;top:4px'+tH+'/div\n'+
'img id=bmov style=position:absolute;left:-50px;top:-50px
onmousedown=b=1;mWIN() onmouseup=b=0;mWIN() border=0 src= width=150%
height=500\n'+
'img id=bclo
style=position:absolute;top:4px;left:'+(W-20)+'px; src='+cU+' border=0
width=11 height=11 onmouseover=this.src=icloo.src
onmouseout=this.src=iclou.src onmouseup=this.src=iclou.src
onmousedown=this.src=iclod.src onclick=top.window.close()\n'+
'img id=bloa
style=position:absolute;top:4px;left:'+(W-40)+'px; src='+cL+' border=0
width=11 height=11\n'+
'scriptwLoa()/script\n'+
'/body\n'+
'/html'


cTIT=cTIT.replace(/\//g,\\\/).replace(/\/g,\\\).replace(/\n/g,\\n)

var cFRM='TITLE'+tW+'/TITLE\n'+
'script\n'+
'top.loaded=false\n'+
'function mTIT(){\n'+
'   if(frames.length6){\n'+
'
fT.document.bgColor='+wBG+';fT.document.write('+cTIT+');fT.document.clos
e()\n'+
'
bM.document.bgColor='+wB+';bL.document.bgColor='+wB+';bR.document.bgColo
r='+wB+';bB.document.bgColor='+wB+';bT.document.bgColor='+wB+'\n'+
'   } else setTimeout(mTIT(),20)\n'+
'}\n'+
'mTIT()\n'+
'/script\n'+
'frameset onselectstart=return false
onload=top.loaded=true border=0 framespacing=0 frameborder=0
cols=1,100%,1\n'+
'   frame name=bL src=about:blank scrolling=no
noresize\n'+
'   frameset border=0 framespacing=0 frameborder=0
rows=1,20,1,100%,1\n'+
'   frame name=bT src=about:blank
scrolling=no noresize\n'+
'   frame name=fT src=about:blank
scrolling=no noresize\n'+
'   frame name=bM src=about:blank
scrolling=no noresize\n'+
'   frame name=main src='+u+' '+fSO+'\n'+
'   frame name=bB src=about:blank
scrolling=no noresize\n'+
'   /frameset\n'+
'frame name=bR src=about:blank scrolling=no noresize\n'+
'/frameset\n'+
'/HTML'

var CWIN=window.open(,n,fullscreen=1+s)
CWIN.moveTo(5000,0)
CWIN.resizeTo(W,H)
CWIN.document.write(cFRM)
CWIN.document.close()

Re: [PHP] Apache

2002-03-21 Thread heinisch

At 21.03.2002  03:18, you wrote:
Errmm... i don't know any apache groups, but
if you want to do what you ask, just read the
documentation, it's easy :-)

jtjohnston wrote:
Anyone know of a good apache group?
I want to hide the structure of a directory when there is no idex.html
present g
J

Directory /your/absolute/path/dir
IndexIgnore *.*  # ignores all files that match *.*
InexIgnore ..  # ignores the parent directory
#other directives
/Directory
HTH Oliver


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




Re: [PHP] Apache

2002-03-21 Thread Matt Williams

On Thursday 21 March 2002 08:28, jtjohnston wrote: 

 I'm also looking at this in my .conf. I know putting something here is the
 answer, but what :)

 Directory /
     Options FollowSymLinks
     AllowOverride All
 /Directory

 J

Options -Indexes

matt


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




Re: [PHP] Re: [PHP-DEV] - Looking for good php-editor

2002-03-21 Thread Jason Wong

On Thursday 21 March 2002 16:25, Andrey Hristov wrote:
 Komodo by ASPN - commercial. Code completion, debugging, syntaxt
 highlighting, syntaxt checking. AnyEdit - Editor. Crashes on my Win2k but
 may work on yours. On http://sourceforge.net UltraEdit - Commercial.
 Syntaxt highlighting with a additional info in a text file. The additional
 info about syntax highlighting can be found on Sourceforge. Look for : php
 syntaxt highlighting.
 PHPMole - Written in PHP requires GTK. Instructions for installation on the
 PHPMole's site. EditPlus - commercial. One of my colleagues prefers it.
 Suggestion : Look on freshmeat.net and sourceforge.net for IDE or editor
 syntax highlighting

There is a PHP IDE by Maguma called PHP4EE Studio Light:

  www.maguma.com



-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
First rule of public speaking.
First, tell 'em what you're goin' to tell 'em;
then tell 'em;
then tell 'em what you've tole 'em.
*/

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




Re: [PHP] Making a simple borderless pop up window with a Close button

2002-03-21 Thread Underbrush

Very attractive site.  Is that the script from WebFX, http://webfx.eae.net/ ?  Anyone 
looking for lots of javascript / dhtml stuff should check that site.  It is pretty 
incredible and it looks as though their scripts are easily modified, ie pluggable.

Their borderless windows are even resizable
  - Original Message - 
  From: Stampe, Lars 
  To: 'Joe Webster' ; [EMAIL PROTECTED] 
  Sent: Thursday, March 21, 2002 4:52 PM
  Subject: RE: [PHP] Making a simple borderless pop up window with a Close button


  Hi,

  I have a script that might do what you want, I don't have time to explain
  but have a look at:
  http://www.epson.co.uk/product/printers/inkjet/styc80/flash/index.html and
  launch the site!

  ** SCRIPT

  /*
  CHROMELESS WINDOWS v.31.0 [ 4.50K ]
  (c) Gabriel Suchowolski,2000 | www.microbians.com
  Licensed under GNU LGPL (www.gnu.org)
  */

  function chromeless(u,n,W,H,X,Y,cD,cU,cO,cL,tH,tW,wB,wBs,wBG,wBGs,wNS,fSO){
  var c=(document.allnavigator.userAgent.indexOf(Win)!=-1)?1:0
  var w=window.screen.width; var h=window.screen.height
  var W=W||w; W=(typeof(W)=='string'?Math.ceil(parseInt(W)*w/100):W);
  W+=2*c
  var H=H||h; H=(typeof(H)=='string'?Math.ceil(parseInt(H)*h/100):H);
  H+=23*c
  var X=X||Math.ceil((w-W)/2)
  var Y=Y||Math.ceil((h-H)/2)
  var s=,width=+W+,height=+H

  if(c){
  var cTIT='\n'+
  'htmlheadMETA HTTP-EQUIV=imagetoolbar
  CONTENT=no\n'+
  'script\n'+
  'var iclod=new Image();iclod.src='+cD+';var iclou=new
  Image();iclou.src='+cU+';var icloo=new Image();icloo.src='+cO+';var
  iload=new Image();iload.src='+cL+';\n'+
  'document.onselectstart=new Function(return
  false;);document.ondragstart=new Function(mWIN();return
  false;);document.oncontextmenu=new Function(return
  false;);document.onmousemove=mWIN\n'+
  'b=-1;\n'+
  'function
  wLoa(){if(top.loaded){bloa.style.visibility=hidden;sRes()}else
  setTimeout(wLoa(),500)}\n'+
  'function
  sRes(){bclo.style.pixelLeft=document.body.clientWidth-18;bloa.style.pixelLef
  t=document.body.clientWidth-38}\n'+
  'function mWIN(){\n'+

  'if(b==0){document.body.bgColor='+wBG+';parent.bM.document.body.bgColor='
  +wB+';parent.bT.document.body.bgColor='+wB+';parent.bB.document.body.bgCo
  lor='+wB+';parent.bL.document.body.bgColor='+wB+';parent.bR.document.bod
  y.bgColor='+wB+';b=-1}\n'+

  'if(b==2){px=event.screenX-ofx-1;py=event.screenY-ofy-1;top.window.moveTo(px
  ,py);}\n'+

  'if(b==1){document.body.bgColor='+wBGs+';parent.bM.document.body.bgColor=
  '+wBs+';parent.bT.document.body.bgColor='+wBs+';parent.bB.document.body.b
  gColor='+wBs+';parent.bL.document.body.bgColor='+wBs+';parent.bR.documen
  t.body.bgColor='+wBs+';ofx=event.x;ofy=event.y;b=2}\n'+
  '}/script/head\n'+
  'body onresize=sRes() bgcolor='+wBG+'\n'+
  'div
  style=position:absolute;left:0px;top:4px'+tH+'/div\n'+
  'img id=bmov style=position:absolute;left:-50px;top:-50px
  onmousedown=b=1;mWIN() onmouseup=b=0;mWIN() border=0 src= width=150%
  height=500\n'+
  'img id=bclo
  style=position:absolute;top:4px;left:'+(W-20)+'px; src='+cU+' border=0
  width=11 height=11 onmouseover=this.src=icloo.src
  onmouseout=this.src=iclou.src onmouseup=this.src=iclou.src
  onmousedown=this.src=iclod.src onclick=top.window.close()\n'+
  'img id=bloa
  style=position:absolute;top:4px;left:'+(W-40)+'px; src='+cL+' border=0
  width=11 height=11\n'+
  'scriptwLoa()/script\n'+
  '/body\n'+
  '/html'


  cTIT=cTIT.replace(/\//g,\\\/).replace(/\/g,\\\).replace(/\n/g,\\n)

  var cFRM='TITLE'+tW+'/TITLE\n'+
  'script\n'+
  'top.loaded=false\n'+
  'function mTIT(){\n'+
  ' if(frames.length6){\n'+
  '
  fT.document.bgColor='+wBG+';fT.document.write('+cTIT+');fT.document.clos
  e()\n'+
  '
  bM.document.bgColor='+wB+';bL.document.bgColor='+wB+';bR.document.bgColo
  r='+wB+';bB.document.bgColor='+wB+';bT.document.bgColor='+wB+'\n'+
  ' } else setTimeout(mTIT(),20)\n'+
  '}\n'+
  'mTIT()\n'+
  '/script\n'+
  'frameset onselectstart=return false
  onload=top.loaded=true border=0 framespacing=0 frameborder=0
  cols=1,100%,1\n'+
  ' frame name=bL src=about:blank scrolling=no
  noresize\n'+
  ' frameset border=0 framespacing=0 frameborder=0
  rows=1,20,1,100%,1\n'+
  ' frame name=bT src=about:blank
  scrolling=no noresize\n'+
  ' frame name=fT src=about:blank
  scrolling=no noresize\n'+
  ' frame name=bM src=about:blank
  scrolling=no noresize\n'+
  ' frame name=main src='+u+' '+fSO+'\n'+
  ' frame name=bB src=about:blank
  scrolling=no noresize\n'+
  ' /frameset\n'+
  'frame name=bR src=about:blank scrolling=no noresize\n'+
  '/frameset\n'+
  '/HTML'

  var CWIN=window.open(,n,fullscreen=1+s)
  CWIN.moveTo(5000,0)
  CWIN.resizeTo(W,H)
  CWIN.document.write(cFRM)
  CWIN.document.close()
  CWIN.moveTo(X,Y)
  } else {
  var CWIN=window.open(u,n,wNS+s,true)
  CWIN.moveTo(X,Y)
  }
  CWIN.focus()
  CWIN.setURL=function(u) { if (this  !this.closed) { if
  (this.frames.main) this.frames.main.location.href=u; else
  this.location.href=u } }
  CWIN.closeIT=function() { if 

[PHP] Object reference

2002-03-21 Thread Lucijan

I can't understand why this works like it does.

class MyObj {
  var $Name;
  function MyObj($Name) {
$this-Name = $Name;
  }
}
$a = new MyObj('MyObjName');
$b = $a;
$b-Name = 'NoName';
echo $a-Name;

Last line will output 'MyObjName' instead of 'NoName' (like I was expecting)
I'd expect $a and $b to behave like reference pointers (change in $b is
reflected in $a and vice versa) instead of copiing $a to $b (beiing a Delphi
programmer this is as natural to me as the Sun raising in east and setting
in west :-)

So, is there a way to do this; pointers or something maybe?

Lucijan



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




RE: [PHP] Object reference

2002-03-21 Thread Stampe, Lars

Hi,

Use  to reference one variable to another!

$b = $a;

Lars

-Original Message-
From: Lucijan [mailto:[EMAIL PROTECTED]]
Sent: 21 March 2002 10:20
To: [EMAIL PROTECTED]
Subject: [PHP] Object reference


I can't understand why this works like it does.

class MyObj {
  var $Name;
  function MyObj($Name) {
$this-Name = $Name;
  }
}
$a = new MyObj('MyObjName');
$b = $a;
$b-Name = 'NoName';
echo $a-Name;

Last line will output 'MyObjName' instead of 'NoName' (like I was expecting)
I'd expect $a and $b to behave like reference pointers (change in $b is
reflected in $a and vice versa) instead of copiing $a to $b (beiing a Delphi
programmer this is as natural to me as the Sun raising in east and setting
in west :-)

So, is there a way to do this; pointers or something maybe?

Lucijan



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

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




[PHP] Fails to log in on some computers...?

2002-03-21 Thread David Orn Johannsson

Could any one tell me why this script fails, only on some computers. It
works fine on all computers at work, but some clients seem to have a
promblem with loging 
in, and it is not the passcheck that is failing I’m quite sure of that,
so it must be the check for session that is failing so could any one
tell me what could be wrong?
 
Thanks
 
?php
session_start();
session_register(uid);
session_register(sid);
?
html
head
titleUntitled Document/title
meta http-equiv=Content-Type content=text/html; charset=iso-8859-1
link rel=stylesheet href=css/style.css type=text/css
/head
 
body bgcolor=#99 text=#00
pDominews/p
table width=550 border=0 cellspacing=0 cellpadding=1
bgcolor=#00 align=center
  tr 
td 
  table width=100% border=0 cellspacing=0 cellpadding=20
bgcolor=#CC
tr 
  td class=maintext
  ?php
if(!IsSet($stage)){
print(form name=\login\
action=\$PHP_SELF\);
print(input type=\hidden\
name=\stage\ value=\1\);
print(table);
print(trtd
class=\maintext\bNotendanafn:/b/tdtdinput
name=\check_username\ type=\text\/td/tr);
print(trtd
class=\maintext\bLykilorð:/b/tdtdinput name=\check_passwd\
type=\password\/td/tr);
print(tdnbsp;/tdtdinput
type=\submit\ value=\Skrá inn\/td/tr);
print(/table);
}
else{
 
include(db_connect.php);
$query = select id,
passwd, system from users where username = '$check_username';
$mysql_result =
mysql_query($query, $db);
$row =
mysql_fetch_row($mysql_result);

if((crypt($check_passwd,
'dominos') == $row[1])  (($system == 0 || $system == 1 ))){
$sid =
session_id();
$uid =
$row[0];
print(a
href=\add_item.php\[Ný grein]/abr);
print(a
href=\view_edit.php\[Breyta greinum]/a);
}
else if($session ==
session_id()){
print(a
href=\add_item.php\[Ný grein]/abr);
print(a
href=\view_edit.php\[Breyta greinum]/a);
}
else{
print(Þú
verður að skrá þig inn. a href=\index.php\[Skrá inn]/a);
}
}
  ?
  /td
/tr
  /table
/td
  /tr
/table
pnbsp;/p
pnbsp;/p
/body
/html
 
 http://www.atom.is/ 
Davíð Örn Jóhannssson
Vefforritari

Atómstöðin hf.
Garðastræti 37
101 Reykjavík

sími: 595-3643
fax: 595-3649
 mailto:[EMAIL PROTECTED] [EMAIL PROTECTED]
 http://www.atom.is/ http://www.atom.is

 



[PHP] session problem?

2002-03-21 Thread bob

 1.php?2.php
session_start(); session_start();
.. ..
$_SESSION['a'] =$a;echo $_SESSION['a']; 
$_SESSION['b'] =$b; echo $_SESSION['b']; 
header(location: 2.php);

there is an warning: undefined index a ,b.


after  change 

1.php   2.php
session_start(); session_start();
.. ..
$_SESSION['a'] =$a;echo $_SESSION['a']; 
$_SESSION['b'] =$b; echo $_SESSION['b']; 
a href='2.php' go on /a

it works well?
why?


thanks!

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




Re: [PHP] Returning mutliple matches of a regex with preg_match()

2002-03-21 Thread liljim

Also, make sure that you make the match ungreedy with the U modifier, or
use:
(.*?)


James

Niklas lampén  wrote in message
000501c1d0aa$4a5d97f0$ba93c5c3@Niklas">news:000501c1d0aa$4a5d97f0$ba93c5c3@Niklas...
 preg_match_all();


 Niklas

 -Original Message-
 From: Stefen Lars [mailto:[EMAIL PROTECTED]]
 Sent: 21. maaliskuuta 2002 7:28
 To: [EMAIL PROTECTED]
 Subject: [PHP] Returning mutliple matches of a regex with preg_match()


 Hello all

 I have been scratching my head for the last two days about this regular
 expression problem. I would be really VERY happy if someone could help
 me!

 I have the following text in the file 'text.htm', for example:

 --

 BLOCKQUOTEP
 Cow, Cow, Cow, Cow, Cow
 Cow, Cow, Cow, Cow, Cow
 Cow, Cow, Cow, Cow, Cow
 a lot of lines
 /P/BLOCKQUOTE

 pboring stuff - we are not interested in this/p

 BLOCKQUOTEP
 Chicken, Chicken, Chicken
 Chicken, Chicken, Chicken
 Chicken, Chicken, Chicken
 more lines
 /P/BLOCKQUOTE

 pmore boring stuff - we are not interested in this/p

 BLOCKQUOTEP
 Rabbit, Rabbit, Rabbit, Rabbit

 /P/BLOCKQUOTE

 peven more boring stuff - we are not interested in this/p

 BLOCKQUOTEP
 Pig, Pig, Pig, Pig, Pig
 /P/BLOCKQUOTE

 --

 I want to return all the stuff between BLOCKQUOTEP ...
 /P/BLOCKQUOTE
 in an array. One element per match. For example, for the above text, I
 would
 like to get back an array back like this:

 array(
 Cow, Cow, Cow, Cow, Cow Cow, Cow, Cow, Cow, Cow Cow, Cow, Cow,
 Cow, Cow a
 lot of lines,
 Chicken, Chicken, Chicken Chicken, Chicken, Chicken Chicken,
 Chicken,
 Chicken more lines,
 Rabbit, Rabbit, Rabbit, Rabbit,
 Pig, Pig, Pig, Pig, Pig
 )

 I have been trying to do this with (many variations of) the following
 code:

 --

 ?PHP

 // open file
 $fd = fopen (./text.htm, r);

 // load contents into a variable
 while (!feof ($fd))
 {
 $content .= fgets($fd, 4096);
 }

 // close file
 fclose ($fd);

 // remove char returns and co.
 $content = preg_replace(/(\r\n)|(\n\r)|(\n|\r)/,  ,$content);

 // match agains regex -- this does not work correctly
 if
 (preg_match(/BLOCKQUOTEP(.*)\/P\/BLOCKQUOTE/i,$content,$matche
 s))
 {
 echo pre;
 var_dump($matches);
 echo /pre;
 }

 ?

 --

 For the above, var_dump() returns this:

 --

 array(2) {
   [0]=
   string(556) BLOCKQUOTEP Cow, Cow, Cow, Cow, Cow Cow, Cow, Cow,
 Cow,
 Cow Cow, Cow, Cow, Cow, Cow a lot of lines /P/BLOCKQUOTE  pboring
 stuff - we are not interested in this/p  BLOCKQUOTEP Chicken,
 Chicken, Chicken Chicken, Chicken, Chicken Chicken, Chicken, Chicken
 more
 lines /P/BLOCKQUOTE  pmore boring stuff - we are not interested in

 this/p  BLOCKQUOTEP Rabbit, Rabbit, Rabbit, Rabbit
 /P/BLOCKQUOTE  peven more boring stuff - we are not interested in
 this/p  BLOCKQUOTEP Pig, Pig, Pig, Pig, Pig /P/BLOCKQUOTE
   [1]=
   string(524)  Cow, Cow, Cow, Cow, Cow Cow, Cow, Cow, Cow, Cow Cow,
 Cow,
 Cow, Cow, Cow a lot of lines /P/BLOCKQUOTE  pboring stuff - we are
 not
 interested in this/p  BLOCKQUOTEP Chicken, Chicken, Chicken
 Chicken, Chicken, Chicken Chicken, Chicken, Chicken more lines
 /P/BLOCKQUOTE  pmore boring stuff - we are not interested in
 this/p  BLOCKQUOTEP Rabbit, Rabbit, Rabbit, Rabbit
 /P/BLOCKQUOTE  peven more boring stuff - we are not interested in
 this/p  BLOCKQUOTEP Pig, Pig, Pig, Pig, Pig 
 }

 --

 Clearly not what I want.

 Is my approach here incorrect? Or is it indeed possible to construct a
 regex
 to do what I want (with just one pass of the text)?

 Thank you in advance.

 :-))

 S.






 _
 Send and receive Hotmail on your mobile device: http://mobile.msn.com


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




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




Re: [PHP] Perl NewsGroup?

2002-03-21 Thread Scott St. John

Not really a bad question as both are great tools.  If you are new to Perl 
check out the Perl Beginners group.  Wonderful group of people and very 
patient with newbies.  Make sure you read up on things you are trying to 
do before you ask the how do I do this question.  

-Scott



On Wed, 20 Mar 2002, David Duong wrote:

 This may be the worst place to put this but here goes:
 
 Does anyone know of a Perl NewsGroup?
 
 
 
 

-- 



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




[PHP] Modulo

2002-03-21 Thread Jérome Moisy



Hy,

I would like to know if I do a mistak 
:
$i % 3 == ?

If $i is a multiple of 3 the result is 0, yes or 
no ?

If yes so what is wrong in this 
script

For ($i = $val; $i  ($val+9); $i++) 
{
For ($j = 1; $j  10; $j++) 
{
 If ($serie == Blue) 
{
 If($i = 18) 
{
 If ($j 
= 9) {
 print "td 
width='20%' align='center'";
print 
"img border=\"0\" 
src="\"../../images/galeries/series/".$serie."/".$serie."".$i.".jpg\"/td/tr";
 } Else 
{

 If (($i%3) == 0) 
{

 print 
"td width='20%' align='center'";
 print 
"img border=\"0\" 
src="\"../../images/galeries/series/".$serie."/".$serie."".$i.".jpg\"/td";
 
 print 
"/trtr";
  } Else 
{ 
print "td width='20%' align='center'";
 
print "img border=\"0\" 
src="\"../../images/galeries/series/".$serie."/".$serie."".$i.".jpg\"/td";
 }
  
}
}
}
 }
}

Thank You

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


[PHP] MODULO + OK

2002-03-21 Thread Jérome Moisy



Oups,
I find my mistak.

Thank you

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


Re: [PHP] Object reference

2002-03-21 Thread Lucijan

 Use  to reference one variable to another!
 $b = $a;

Thanks.

Lucijan



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




Re: [PHP] php code generator

2002-03-21 Thread Cameron Bales .:.

We are trying to find a php code generator like Macromedia Ultradelv to
develope a web base app.  Can someone recommend a few.

the new GoLive does it, and has the Zend debugger integrated in it. 
I don't know how good it is.


http://www.adobe.com/products/golive/movie_qt9.html

the scary part is the way he repeats ASP, JSP, or PHP about 300 
times in 3 minutes.

Cameron .:.

--
Tantramar Interactive
http://www.TantramarInteractive.com/
16 Lorne St., Unit 3, Sackville, NB  E4L 3Z7
Phone (506) 364-1097  Fax (506) 536-2409
All that glitters has a high refractive index.

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




Re: [PHP] Seek server hardware recommendation

2002-03-21 Thread Miles Thompson


Is that:
Local usage ...
 1000/8 = 125 hits/hr or roughly 2 hits/min
   Continental usage ...
 1000/12 = 83 hits/hr or 1.4  hits/min
   World usage ...
 1000/24 = or 1 hit every minute and half.

Unless you have really heavy duty hits on the database (complex queries) 
just about anything from a P-200 with 32 mbytes of RAM will do, but if all 
you have is a P-133, start with it. (And that may be over-spec'ed.) Guess 
what I'm really saying, is do a bit of math, time some queries, etc. then 
you'll know how to decide.

If your extracting a lot data from multiple tables, constructing graphics 
on the fly and converting everything to PDF before sending it, then what 
I've suggested won't do.

Regards - Miles Thompson

PS Don't cross-post. It doesn't help but may annoy. This is replied to 
php-general only as it's not an installation problem.

At 03:00 PM 3/21/2002 +0200, Aras Kucinskas wrote:
Hi,

I seek a recommendation for server hardware.

Server software:

LINUX
Apache
PHP
mySQL

Server purpose:
One site (PHP+mySQL ) hosting, max 1000 visitors per day.

What is recommendet hardware requiremnts (CPU, RAM,...)?

Thanks



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


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




[PHP] Urgent: Apache sometimes displays PHP source code

2002-03-21 Thread Sam Jordan

Hello all

I'm working for an ISP and some weeks ago we noticed a problem
with PHP we never had before. Since then quite often the PHP
code is not interpreted, but displayed as plain text in the
browser window. The behavior is not reproduceable and not
predictable.

We are running out of ideas and the problem is becoming a
pretty urgent one, because our customer's PHP hostings
are affected, too.

Again, everything was working fine until some weeks ago, so
there shouldn't be any simple configuration error. It sounds
pretty much like a faulty behaviour of either apache or PHP
under certain circumstances, which we don't know.

We are running apache 1.3.19 and PHP 4.0.4, rpm-installed
from the SUSE 7.1 Linux distribution.

We would be very glad if anyone in this list could either
help us directly or point us to more resources, which might
be helpful.

Please cc the answer to [EMAIL PROTECTED] Thank you very much
for reading!

Have a nice day

Sam Jordan, Switzerland


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




RE: [PHP] [newman] This don't work, if else if

2002-03-21 Thread Rick Emery

if (mysql_num_rows($sql_result)  0) {

FYI:  thank you for providing full code and what the algorithm is supposed
to accomplish.  Most posters do not.

-Original Message-
From: Philip J. Newman [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 20, 2002 6:37 PM
To: [EMAIL PROTECTED]
Subject: [PHP] [newman] This don't work, if else if


Can anyone tell me why this isn't working?  What its ment to do is add an IP
number to the database. if the IP is all ready in the database then it would
update a counter.


?php

$proxy_ip=getenv('REMOTE_ADDR'); 
$proxy_dns=gethostbyaddr($proxy_ip);
$add_date=date (d/F/Y  @ h:i:s A);

$sql = SELECT accessIP FROM `access` ORDER BY `accessID` DESC;
$sql_result = mysql_query($sql, $connection) or die (Could not get Query);


$row = mysql_fetch_array($sql_result);
$accessIP = $row[accessIP]; 

if (mysql_num_rows($sql_result)  0) {

 // Update view where ip = visitor_ip
 mysql_query(UPDATE access SET accessVIEW = accessVIEW+1 WHERE accessIP =
$accessIP);
 
 } else {

 // Normal insert
  $sql = INSERT INTO `access` (`accessID`, `accessIP`, `accessDNS`,
`accessTIME`, `accessUPDATE`, `accessVIEW`) VALUES ('', '$proxy_ip',
'$proxy_dns', '$add_date', NOW(NULL), '0');
 $result = mysql_query($sql);
 }

?

Philip J. Newman
PhilipNZ :: Design Solutions
http://www.philipnz.com/
[EMAIL PROTECTED]
ICQ# 20482482
+64 25 6144012

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




Re: [PHP] Form Value Validation

2002-03-21 Thread C. Cormier - Ormetal Inc.

On 21 Mar 2002, at 0:54, David Johansen wrote:

 I was wondering if there was a way to do validation of the values in
 forms.

Sure, in your Form tag, you can have an statement like:

onsubmit=return validate()

Where validate() will be a javascript function.

Claude Cormier
Ormetal Inc.

http://www.goldcurrencies.ca
http://www.ormetal.com
=
Claude Cormier Public Key
http://www.ormetal.com/keys/ClaudeCormier.asc
=

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




[PHP] variable test

2002-03-21 Thread atu

Hi,

I'm asking me, what is the difference of the two ifs.

if($x)
   echo $x;

if(!empty($x))
   echo $x;

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




Re: [PHP] variable test

2002-03-21 Thread Andrey Hristov

 
 if($x)
echo $x;

if $x is not defined you will get a warning but that depends on error settings in 
php.ini.
This construction checks whether $x is defined or $x is true.

 
 if(!empty($x))
echo $x;

$x must be defined.
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 


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




[PHP] testing for blank var

2002-03-21 Thread ROBERT MCPEAK

if $img_url has a value, then I'd like to show the image, if it doesn't,
then I'd like to show a message.  What's wrong with my code?  Am I
incorrectly testing for the value?  The else works fine, but not the if.
 Thanks!

if (!$img_url)
{
echo bNo Image URL Entered/bbr;
}
else
{
echo img src=\$img_url\;
}


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




RE: [PHP] testing for blank var

2002-03-21 Thread Rick Emery

if ( ! ISSET($img_url) )


-Original Message-
From: ROBERT MCPEAK [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 21, 2002 8:18 AM
To: [EMAIL PROTECTED]
Subject: [PHP] testing for blank var


if $img_url has a value, then I'd like to show the image, if it doesn't,
then I'd like to show a message.  What's wrong with my code?  Am I
incorrectly testing for the value?  The else works fine, but not the if.
 Thanks!

if (!$img_url)
{
echo bNo Image URL Entered/bbr;
}
else
{
echo img src=\$img_url\;
}


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

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




RE: [PHP] testing for blank var

2002-03-21 Thread ROBERT MCPEAK

Beautiful!

 Rick Emery [EMAIL PROTECTED] 03/21/02 09:19AM 
if ( ! ISSET($img_url) )


-Original Message-
From: ROBERT MCPEAK [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, March 21, 2002 8:18 AM
To: [EMAIL PROTECTED] 
Subject: [PHP] testing for blank var


if $img_url has a value, then I'd like to show the image, if it
doesn't,
then I'd like to show a message.  What's wrong with my code?  Am I
incorrectly testing for the value?  The else works fine, but not the
if.
 Thanks!

if (!$img_url)
{
echo bNo Image URL Entered/bbr;
}
else
{
echo img src=\$img_url\;
}


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

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




[PHP] Re: testing for blank var

2002-03-21 Thread Julio Nobrega Trabalhando

if (ereg(^[[:blank:]]*$,$img_url)) {
// $img_url is blank
}

--

Julio Nobrega.

Um dia eu chego lá:
http://sourceforge.net/projects/toca

Ajudei? Salvei? Que tal um presentinho?
http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884


Robert McPeak [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 if $img_url has a value, then I'd like to show the image, if it doesn't,
 then I'd like to show a message.  What's wrong with my code?  Am I
 incorrectly testing for the value?  The else works fine, but not the if.
  Thanks!

 if (!$img_url)
 {
 echo bNo Image URL Entered/bbr;
 }
 else
 {
 echo img src=\$img_url\;
 }




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




[PHP] How to clear variables?

2002-03-21 Thread C. Cormier - Ormetal Inc.

Hi everybody,

I am having a problem with variables. Basically I have not 
found a way to clear them so they are reset to   if the user reload 
the page or move to another page

Here is the speudo code:

?php

session_start();

If ($Faction==Add to Data)
  { Add_to_data(); }

html...

form...method=POST  action='this_script?with session_id()'
..
input...
input type='submit' name=Faction value='Add to Data'
/form

?PHP

function Add_to_data()
{

Add data to mysql DB

session_unregister('Faction');
session_destroy;
}
?
The above speudo script work fine and when the user click 'Add to 
Data', the data is added to my database.  Howver, the 
session_unregister and session_destroy do not clear the variable 
Faction and its value. Therefore if the user click Reload on the 
browser, the data gets added again.

What is my problem,

Thanks in advance

Claude 

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




[PHP] Parse from a Text file

2002-03-21 Thread Gerard

Hi all,

I'm newbiee into php and I need some help.

I would like to parse some data from a Text file after some character.

For example I have this text file:

1st line Broomfield / Jeffco, CO, United States (KBJC) 39-55N 105-07W
2nd line Jun 04, 2000 - 02:45 PM EST / 2002.03.04 1945 UTC
3rd line Wind: from the NE (050 degrees) at 9 MPH (8 KT):0
4th line Visibility: 30 mile(s):0

And I would like to take only some data from  the 4th line 30mile(s):0 and
nothing else...

Can somebody explain me who to do it ?¿
Many thanks
Gerard



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




[PHP] compile PHP without threads

2002-03-21 Thread LF

hi ALL,
could please anybody tell me what argument i should use for compiling, that
PHP4 runs without threads (pthreads)??
i need to recompile php because i receive the error from httpd.
dl-close.c:123 ...assertion failed..
thanks for any help
lothar




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




Re: [PHP] Perl NewsGroup?

2002-03-21 Thread bvr



Why not try www.perl.com ???

I found: http://www.perl.com/cs/user/query/q/6?id_topic=50

bvr.

David Duong wrote:

This may be the worst place to put this but here goes:

Does anyone know of a Perl NewsGroup?






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




[PHP] Re: testing for blank var

2002-03-21 Thread Marcel Besancon

Hi Robert,

maybe your variable doesn't exist. Try using

if(!isset($variable))  {
missing-message  }
else  {
show $variable  }

I hope this helps.

Bye, Marcel

--
registered Fli4l-User #0388



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




RE: [PHP] Parse from a Text file

2002-03-21 Thread Rick Emery

As you read each line into a variable, $chrText, apply this test:
ereg(Visibility: ([0-9]*.*), $chrText,$regs);

EXAMPLE:

?php
$chrText = Visibility: 30 mile(s):0;
ereg(Visibility: ([0-9]*.*), $chrText,$regs);
print #.$regs[0].#.$regs[1].#\n;

$regs= NULL;
$chrText = Wind: from the NE (050 degrees) at 9 MPH (8 KT):0;
ereg(Visibility: ([0-9]*.*), $chrText,$regs);
print #.$regs[0].#.$regs[1].#\n;
?

You will find what you need in $regs[1]

-Original Message-
From: Gerard [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 21, 2002 8:44 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Parse from a Text file


Hi all,

I'm newbiee into php and I need some help.

I would like to parse some data from a Text file after some character.

For example I have this text file:

1st line Broomfield / Jeffco, CO, United States (KBJC) 39-55N 105-07W
2nd line Jun 04, 2000 - 02:45 PM EST / 2002.03.04 1945 UTC
3rd line Wind: from the NE (050 degrees) at 9 MPH (8 KT):0
4th line Visibility: 30 mile(s):0

And I would like to take only some data from  the 4th line 30mile(s):0 and
nothing else...

Can somebody explain me who to do it ?¿
Many thanks
Gerard



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

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




Re: [PHP] Returning mutliple matches of a regex with preg_match()

2002-03-21 Thread Stefen Lars

Thank you James and Niklas.

Here is the code that I need:

?PHP

// open file
$fd = fopen (./text.htm, r);

// load contents into a variable
while (!feof ($fd))
{
$content .= fgets($fd, 4096);
}

// close file
fclose ($fd);

// remove char returns and co
$content = preg_replace(/(\r\n)|(\n\r)|(\n|\r)/,  ,$content);

if 
(preg_match_all(/BLOCKQUOTEP(.*)\/P\/BLOCKQUOTE/U,$content,$matches))
{
echo pre;
var_dump($matches);
echo /pre;
}

?

This returns exactly what I want (see my original post to learn what that 
is.)

Thank again.

:-))

S.

From: liljim [EMAIL PROTECTED]
Reply-To: liljim [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Returning mutliple matches of a regex with preg_match()
Date: Thu, 21 Mar 2002 11:42:35 -

Also, make sure that you make the match ungreedy with the U modifier, or
use:
(.*?)


James

Niklas lampén  wrote in message
000501c1d0aa$4a5d97f0$ba93c5c3@Niklas">news:000501c1d0aa$4a5d97f0$ba93c5c3@Niklas...
  preg_match_all();
 
 
  Niklas
 
  -Original Message-
  From: Stefen Lars [mailto:[EMAIL PROTECTED]]
  Sent: 21. maaliskuuta 2002 7:28
  To: [EMAIL PROTECTED]
  Subject: [PHP] Returning mutliple matches of a regex with preg_match()
 
 
  Hello all
 
  I have been scratching my head for the last two days about this regular
  expression problem. I would be really VERY happy if someone could help
  me!
 
  I have the following text in the file 'text.htm', for example:
 
  --
 
  BLOCKQUOTEP
  Cow, Cow, Cow, Cow, Cow
  Cow, Cow, Cow, Cow, Cow
  Cow, Cow, Cow, Cow, Cow
  a lot of lines
  /P/BLOCKQUOTE
 
  pboring stuff - we are not interested in this/p
 
  BLOCKQUOTEP
  Chicken, Chicken, Chicken
  Chicken, Chicken, Chicken
  Chicken, Chicken, Chicken
  more lines
  /P/BLOCKQUOTE
 
  pmore boring stuff - we are not interested in this/p
 
  BLOCKQUOTEP
  Rabbit, Rabbit, Rabbit, Rabbit
 
  /P/BLOCKQUOTE
 
  peven more boring stuff - we are not interested in this/p
 
  BLOCKQUOTEP
  Pig, Pig, Pig, Pig, Pig
  /P/BLOCKQUOTE
 
  --
 
  I want to return all the stuff between BLOCKQUOTEP ...
  /P/BLOCKQUOTE
  in an array. One element per match. For example, for the above text, I
  would
  like to get back an array back like this:
 
  array(
  Cow, Cow, Cow, Cow, Cow Cow, Cow, Cow, Cow, Cow Cow, Cow, Cow,
  Cow, Cow a
  lot of lines,
  Chicken, Chicken, Chicken Chicken, Chicken, Chicken Chicken,
  Chicken,
  Chicken more lines,
  Rabbit, Rabbit, Rabbit, Rabbit,
  Pig, Pig, Pig, Pig, Pig
  )
 
  I have been trying to do this with (many variations of) the following
  code:
 
  --
 
  ?PHP
 
  // open file
  $fd = fopen (./text.htm, r);
 
  // load contents into a variable
  while (!feof ($fd))
  {
  $content .= fgets($fd, 4096);
  }
 
  // close file
  fclose ($fd);
 
  // remove char returns and co.
  $content = preg_replace(/(\r\n)|(\n\r)|(\n|\r)/,  ,$content);
 
  // match agains regex -- this does not work correctly
  if
  (preg_match(/BLOCKQUOTEP(.*)\/P\/BLOCKQUOTE/i,$content,$matche
  s))
  {
  echo pre;
  var_dump($matches);
  echo /pre;
  }
 
  ?
 
  --
 
  For the above, var_dump() returns this:
 
  --
 
  array(2) {
[0]=
string(556) BLOCKQUOTEP Cow, Cow, Cow, Cow, Cow Cow, Cow, Cow,
  Cow,
  Cow Cow, Cow, Cow, Cow, Cow a lot of lines /P/BLOCKQUOTE  pboring
  stuff - we are not interested in this/p  BLOCKQUOTEP Chicken,
  Chicken, Chicken Chicken, Chicken, Chicken Chicken, Chicken, Chicken
  more
  lines /P/BLOCKQUOTE  pmore boring stuff - we are not interested in
 
  this/p  BLOCKQUOTEP Rabbit, Rabbit, Rabbit, Rabbit
  /P/BLOCKQUOTE  peven more boring stuff - we are not interested in
  this/p  BLOCKQUOTEP Pig, Pig, Pig, Pig, Pig /P/BLOCKQUOTE
[1]=
string(524)  Cow, Cow, Cow, Cow, Cow Cow, Cow, Cow, Cow, Cow Cow,
  Cow,
  Cow, Cow, Cow a lot of lines /P/BLOCKQUOTE  pboring stuff - we are
  not
  interested in this/p  BLOCKQUOTEP Chicken, Chicken, Chicken
  Chicken, Chicken, Chicken Chicken, Chicken, Chicken more lines
  /P/BLOCKQUOTE  pmore boring stuff - we are not interested in
  this/p  BLOCKQUOTEP Rabbit, Rabbit, Rabbit, Rabbit
  /P/BLOCKQUOTE  peven more boring stuff - we are not interested in
  this/p  BLOCKQUOTEP Pig, Pig, Pig, Pig, Pig 
  }
 
  --
 
  Clearly not what I want.
 
  Is my approach here incorrect? Or is it indeed possible to construct a
  regex
  to do what I want (with just one pass of the text)?
 
  Thank you in advance.
 
  :-))
 
  S.
 
 
 
 
 
 
  _
  Send and receive Hotmail on your mobile device: http://mobile.msn.com
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 





_
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


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




[PHP] ecommerce solutions..

2002-03-21 Thread Kelly Meeks

Howdy folks,

Anyone have recommendations for ecommerce packages for linux (pref. linux/mysql/php 
opensource..)?

Thanks

Kelly

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




[PHP] search engine friendly urls

2002-03-21 Thread Kelly Meeks

Does anyone have any ideas/info (or can you point me to) regarding how to make dynamic 
php content more search engine friendly (losing the '?' when dealing with url 
variables)?

As a Cold Fusion convert, you could do something like this:

http://www.blabla.com/dynamicpage.cfm/205  were 205 would be a record number and would 
be conventionally represented as

http://www.blabla.com/dynamicpage.cfm?id=205  

Thanks in advance,

Kelly

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




RE: [PHP] Parse from a Text file

2002-03-21 Thread Rick Emery

You're welcome.  we aims to please...

-Original Message-
From: Gerard [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 21, 2002 9:22 AM
To: Rick Emery
Subject: Re: [PHP] Parse from a Text file


Many thanks Rick !

Much apreciated  very fast :-)

Gerard
- Original Message -
From: Rick Emery [EMAIL PROTECTED]
To: 'Gerard' [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Thursday, March 21, 2002 4:18 PM
Subject: RE: [PHP] Parse from a Text file


As you read each line into a variable, $chrText, apply this test:
ereg(Visibility: ([0-9]*.*), $chrText,$regs);

EXAMPLE:

?php
$chrText = Visibility: 30 mile(s):0;
ereg(Visibility: ([0-9]*.*), $chrText,$regs);
print #.$regs[0].#.$regs[1].#\n;

$regs= NULL;
$chrText = Wind: from the NE (050 degrees) at 9 MPH (8 KT):0;
ereg(Visibility: ([0-9]*.*), $chrText,$regs);
print #.$regs[0].#.$regs[1].#\n;
?

You will find what you need in $regs[1]

-Original Message-
From: Gerard [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 21, 2002 8:44 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Parse from a Text file


Hi all,

I'm newbiee into php and I need some help.

I would like to parse some data from a Text file after some character.

For example I have this text file:

1st line Broomfield / Jeffco, CO, United States (KBJC) 39-55N 105-07W
2nd line Jun 04, 2000 - 02:45 PM EST / 2002.03.04 1945 UTC
3rd line Wind: from the NE (050 degrees) at 9 MPH (8 KT):0
4th line Visibility: 30 mile(s):0

And I would like to take only some data from  the 4th line 30mile(s):0 and
nothing else...

Can somebody explain me who to do it ?¿
Many thanks
Gerard



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

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


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




[PHP] Re: search engine friendly urls

2002-03-21 Thread Henrik Hansen

[EMAIL PROTECTED] (Kelly Meeks) wrote:

  Does anyone have any ideas/info (or can you point me to) regarding how
  to make dynamic php content more search engine friendly (losing the
  '?' when dealing with url variables)?

  As a Cold Fusion convert, you could do something like this:

  http://www.blabla.com/dynamicpage.cfm/205 were 205 would be a record
  number and would be conventionally represented as

  http://www.blabla.com/dynamicpage.cfm?id=205

http://www.promotionbase.com/article/485

-- 
Henrik Hansen

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




[PHP] checking if a link is still alive

2002-03-21 Thread Christoph Starkmann

Hi there!

I would like to implement a feature to a website
I'm working at right now but don't know where to
start (searching), so maybe one of you can give me
a hint.

The Links page is dynamically created out of a
database. Now what I want is to have a function 
that checks (each time) if all links are still
alive and to display only valid links.

Is there any posibility to check if there is
actually a website behind a link or just, let's
say a 404?

Would be a nice feature, together with an email
notification to the webmaster, I think...

Any hints are appreciated.

Cheers,

Kiko

-
It's not a bug, it's a feature.
christoph starkmann
mailto:[EMAIL PROTECTED]
http://www.fh-augsburg.de/~kiko
ICQ: 100601600
-

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




[PHP] RE: checking if a link is still alive

2002-03-21 Thread Christoph Starkmann

Outsch, sorry, I just found what I wanted...

 Is there any posibility to check if there is
 actually a website behind a link or just, let's
 say a 404?

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

Have a nice day ;)

Kiko
-
It's not a bug, it's a feature.
christoph starkmann
mailto:[EMAIL PROTECTED]
http://www.fh-augsburg.de/~kiko
ICQ: 100601600
-

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




[PHP] Re: checking if a link is still alive

2002-03-21 Thread Julio Nobrega Trabalhando

  Open a connection? Maybe fopen, dns search, ip search, anything. I just
don't know which way is faster (I think it's fopen).

--

Julio Nobrega.

Um dia eu chego lá:
http://sourceforge.net/projects/toca



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




[PHP] session_start() and headers

2002-03-21 Thread Chris Boget

Are there any headers sent to the browser in session_start()?
I ask because I have a script that sends data as a PDF document
to the browser.  Before I'm outputting the data, I'm sending the
header:

header( Content-Type: application/pdf );

to tell the browser that it's a PDF and to load as such.  If I don't
use session_start(), everything works as expected.  The PDF 
comes up and all is right with the world.  However, as soon as I
uncomment session_start(), the PDF doesn't load correctly and
in fact, I get a save dialogue that doesn't work right (ie, I get an
error when I click any of the buttons).
So, is there a header getting sent by session_start()?  Is there any
way I can turn that off?  Has anyone found a workaround for this?

Any help would be greatly appreciated!

Chris



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




[PHP] eating mySQL result rows 1 by 1.. a better way?

2002-03-21 Thread Steve Clay

Hello,

On my site I paginate query results by limiting rows output to a
value, say LIMIT, and then the 2nd, 3rd pages run the same query with
$skip=LIMIT, $skip=(LIMIT*2) value posted back.  I use the following
code to skip these result rows, which is just fetching the next row
to an unused array.

//if there are rows to skip
if ($result_rows  $rows_to_skip) {
   while ( $rows_to_skip ) {
  // eat a row
  mysql_fetch_array($result);
  $rows_to_skip--;
  $total_results_shown++;
   }
}

Can I make this more efficient?  Is there a way to eliminate this data
before it leaves the mySQL server (and would it be faster)?

If it makes any difference the average result row is probably around 40-50
bytes but some of these queries can return up to 850 rows..

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


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




Re: [PHP] search engine friendly urls

2002-03-21 Thread Rasmus Lerdorf

You can do exactly the same thing with PHP.  The 205 would show up in the
$PATH_INFO variable.

-Rasmus

On Thu, 21 Mar 2002, Kelly Meeks wrote:

 Does anyone have any ideas/info (or can you point me to) regarding how to make 
dynamic php content more search engine friendly (losing the '?' when dealing with url 
variables)?

 As a Cold Fusion convert, you could do something like this:

 http://www.blabla.com/dynamicpage.cfm/205  were 205 would be a record number and 
would be conventionally represented as

 http://www.blabla.com/dynamicpage.cfm?id=205

 Thanks in advance,

 Kelly

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



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




Re: [PHP] How to clear variables?

2002-03-21 Thread Rasmus Lerdorf

 The above speudo script work fine and when the user click 'Add to
 Data', the data is added to my database.  Howver, the
 session_unregister and session_destroy do not clear the variable
 Faction and its value. Therefore if the user click Reload on the
 browser, the data gets added again.

 What is my problem,

Uh...  Do you actually do a session_register('Faction')?  If so, why?  I
bet you don't though, which means your question has nothing to do with
sessions.  You can't prevent a user from hitting reload and re-posting the
same data.  This Faction variable comes from the browser.  You simply have
to check to see if the data has already been added to your database and
not allow the re-post.  Or redirect away from this page as soon as you get
the post so a reload wouldn't reload the posted page.

-Rasmus


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




Re: [PHP] eating mySQL result rows 1 by 1.. a better way?

2002-03-21 Thread Joffrey van Wageningen

- Original Message -
From: Steve Clay [EMAIL PROTECTED]
To: PHP-GENERAL [EMAIL PROTECTED]
Sent: Thursday, March 21, 2002 4:54 PM
Subject: [PHP] eating mySQL result rows 1 by 1.. a better way?


 On my site I paginate query results by limiting rows output to a
 value, say LIMIT, and then the 2nd, 3rd pages run the same query with
 $skip=LIMIT, $skip=(LIMIT*2) value posted back.  I use the following
 code to skip these result rows, which is just fetching the next row
 to an unused array.

 //if there are rows to skip
 if ($result_rows  $rows_to_skip) {
while ( $rows_to_skip ) {
   // eat a row
   mysql_fetch_array($result);
   $rows_to_skip--;
   $total_results_shown++;
}
 }

 Can I make this more efficient?  Is there a way to eliminate this data
 before it leaves the mySQL server (and would it be faster)?

try 'LIMIT' :)

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

The LIMIT clause can be used to constrain the number of rows returned by the
SELECT statement. LIMIT takes one or two numeric arguments. If two arguments
are given, the first specifies the offset of the first row to return, the
second specifies the maximum number of rows to return. The offset of the
initial row is 0 (not 1):
mysql select * from table LIMIT 5,10;  # Retrieve rows 6-15
if one argument is given, it indicates the maximum number of rows to return:
mysql select * from table LIMIT 5; # Retrieve first 5 rows
In other words, LIMIT n is equivalent to LIMIT 0,n.

Rod Kreisler wrote a nice article on Building Next/Prev Buttons for Query
Results:
http://www.phpbuilder.com/columns/rod20001214.php3

hope it helps :)

mvgr,
Joffrey van Wageningen

--
.-[ Joffrey van Wageningen | WoLFjuh | [EMAIL PROTECTED] ]--
| Networking Event 2000 - www.ne2000.nl - IRCnet:#ne2000, Undernet:#clue
| PGP:1024D/C6BA5863 - 3B93 52D3 CB91 9CB7 C50D FA79 865F 628A C6BA 5863
| * We demand guaranteed rigidly defined areas of doubt and uncertainty.
|   -- Douglas Adams


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




Re: [PHP] Assignment operator proposal

2002-03-21 Thread Bogdan Stancescu

Egon Schmid wrote:

From: Enrico Weigelt [EMAIL PROTECTED]


Please note, there are many German PHP developers. Most of them are
not so stupid ...

I must say I fail to understand both the meaning and the reason for the 
harsness in your reply.

Bogdan




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




Re: [PHP] Assignment operator proposal

2002-03-21 Thread Bogdan Stancescu

[EMAIL PROTECTED] wrote:

 I think this is a nice idea for php8 (or some release, I´ll never have 
 to use)
 The main thing in using php is that it is close to c.
 As there are so many new functions, some of them are not really 
 necessary,
 I would not prefer shortcuts like these. Who should help these guys, 
 which
 use these kind of abbrevations. We will get code like these real 
 C-freaks make
 when they get mad in optimizing.
 Its always a walk on a sharp edge, optimizimg and readability.
 For compatibility reasons, I would not like this kind of stuff. 

I don't agree with this. I find this kind of operator a specific 
necessity of PHP. In C you generally know when you have a variable 
assigned and when you don't. In PHP you have lots of situations where 
you have to test whether something has been set or not due to the nature 
of the environment (you don't know what happened in the previous page - 
in C you do know what a window does). That's because, as we all know too 
well, we operate PHP in a stateless environments - therefore you always 
have to check for stuff.


 and also, where can you write your comments
 old style
 if($whatever) // this option must be true
 {
 do something; // this operation does something
 } // end of whatever

 new style
 $whatever^=something // this option must be true an then it does 
 something

 (guaranteed to be more then 80 chars, have fun when reading this command
 under production pressure at 0:30 at the box using ed)
 oops I just wanted to add a comment, I find myself writing a book ;-) 

I merely proposed an assignment operator, not a new type of block. The 
funny thing is that you'd gain horizontal space instead of losing it:
if (!$whatever)
{
  $whatever=something; // defaulting to something
}

You just wasted a TAB for indentation - whatever the tab size is. Just 
to remind you, if you want to be formatting correct, the recommended TAB 
size is 8 chars. Whereas

$whatever^=something; // defaulting to something

wastes only one character (the caret).

What I have to agree with is that it's not standard. That is correct - 
but I would find this operator useful and I'd be willing to sacrifice a 
bit of standardness in favor of writing less.

Bogdan




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




Re: [PHP] Urgent: Apache sometimes displays PHP source code

2002-03-21 Thread Rasmus Lerdorf

Step 1 - upgrade to a recent version.  Then report back.

-Rasmus

On Thu, 21 Mar 2002, Sam Jordan wrote:

 Hello all

 I'm working for an ISP and some weeks ago we noticed a problem
 with PHP we never had before. Since then quite often the PHP
 code is not interpreted, but displayed as plain text in the
 browser window. The behavior is not reproduceable and not
 predictable.

 We are running out of ideas and the problem is becoming a
 pretty urgent one, because our customer's PHP hostings
 are affected, too.

 Again, everything was working fine until some weeks ago, so
 there shouldn't be any simple configuration error. It sounds
 pretty much like a faulty behaviour of either apache or PHP
 under certain circumstances, which we don't know.

 We are running apache 1.3.19 and PHP 4.0.4, rpm-installed
 from the SUSE 7.1 Linux distribution.

 We would be very glad if anyone in this list could either
 help us directly or point us to more resources, which might
 be helpful.

 Please cc the answer to [EMAIL PROTECTED] Thank you very much
 for reading!

 Have a nice day

 Sam Jordan, Switzerland


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



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




Re: [PHP] Assignment operator proposal

2002-03-21 Thread Rasmus Lerdorf

 Please note, there are many German PHP developers. Most of them are
 not so stupid ...

Oh, I don't know about that.  I have met a bunch of them...  ;)

-Rasmus


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




Re: [PHP] eating mySQL result rows 1 by 1.. a better way?

2002-03-21 Thread Maris Kalnins

Hmm.. but if it's not MySql .. but Sybase for instance?
What then?.. there is no such thing like LIMIT in SQL




Joffrey Van Wageningen [EMAIL PROTECTED] wrote in message
014801c1d0f2$fd59ac20$[EMAIL PROTECTED]">news:014801c1d0f2$fd59ac20$[EMAIL PROTECTED]...
 - Original Message -
 From: Steve Clay [EMAIL PROTECTED]
 To: PHP-GENERAL [EMAIL PROTECTED]
 Sent: Thursday, March 21, 2002 4:54 PM
 Subject: [PHP] eating mySQL result rows 1 by 1.. a better way?


  On my site I paginate query results by limiting rows output to a
  value, say LIMIT, and then the 2nd, 3rd pages run the same query with
  $skip=LIMIT, $skip=(LIMIT*2) value posted back.  I use the following
  code to skip these result rows, which is just fetching the next row
  to an unused array.
 
  //if there are rows to skip
  if ($result_rows  $rows_to_skip) {
 while ( $rows_to_skip ) {
// eat a row
mysql_fetch_array($result);
$rows_to_skip--;
$total_results_shown++;
 }
  }
 
  Can I make this more efficient?  Is there a way to eliminate this data
  before it leaves the mySQL server (and would it be faster)?

 try 'LIMIT' :)

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

 The LIMIT clause can be used to constrain the number of rows returned by
the
 SELECT statement. LIMIT takes one or two numeric arguments. If two
arguments
 are given, the first specifies the offset of the first row to return, the
 second specifies the maximum number of rows to return. The offset of the
 initial row is 0 (not 1):
 mysql select * from table LIMIT 5,10;  # Retrieve rows 6-15
 if one argument is given, it indicates the maximum number of rows to
return:
 mysql select * from table LIMIT 5; # Retrieve first 5 rows
 In other words, LIMIT n is equivalent to LIMIT 0,n.

 Rod Kreisler wrote a nice article on Building Next/Prev Buttons for Query
 Results:
 http://www.phpbuilder.com/columns/rod20001214.php3

 hope it helps :)

 mvgr,
 Joffrey van Wageningen

 --
 .-[ Joffrey van Wageningen | WoLFjuh | [EMAIL PROTECTED] ]--
 | Networking Event 2000 - www.ne2000.nl - IRCnet:#ne2000, Undernet:#clue
 | PGP:1024D/C6BA5863 - 3B93 52D3 CB91 9CB7 C50D FA79 865F 628A C6BA 5863
 | * We demand guaranteed rigidly defined areas of doubt and uncertainty.
 |   -- Douglas Adams




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




[PHP] Error compiling PHP with native MySql

2002-03-21 Thread Richard Fox

When I try to configure PHP 4.1.1 I get the following error:

checking whether to include ming support... no
checking for mnoGoSearch support... yes
checking for mnoGoSearch version... 3.1.19
checking for mSQL support... no
checking for Muscat support... no
checking for MySQL support... yes
configure: error: Cannot find header files under /usr/include/mysql

The command line I'm using to configure:

./configure --with-mysql=/usr/include/mysql --with-java=/usr/java/j2sdk1.4.0
 --w
ith-xml --enable-shared-pdflib --enable-track-vars --with-db --with-gdbm --w
ith-
gd --enable-ftp --disable-debug --enable-memory-limit=yes --enable-trans-sid
 --w
ith-apxs=/usr/local/apache/bin/apxs --with-mnogosearch=/usr/local/mnogosearc
h

I am on RedHat 7.1 with the following MySql RPMs installed:

MySQL-devel-3.23.49-1
MySQL-client-3.23.49-1
MySQL-3.23.49-1

To check where the RPM installed the MySQL header files, I looked and found
that they are in /usr/include/mysql

[root@centauri local]# find / -name mysql -print
/home/rfox/download/mnogosearch-3.1.19/create/mysql
/usr/share/mysql
/usr/bin/mysql
/usr/lib/mysql
/usr/include/mysql
/usr/download/php-4.1.1/ext/mysql
/usr/download/php-4.1.1/pear/DB/tests/mysql
/var/lib/mysql
/var/lib/mysql/mysql
/var/lib/mysql-/mysql
/var/lock/subsys/mysql
/etc/rc.d/init.d/mysql
/etc/logrotate.d/mysql

So, I do not understand this error at all! Can anyone help?

Thanks
Rich



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




Re: [PHP] How to clear variables?

2002-03-21 Thread C. Cormier - Ormetal Inc.

On 21 Mar 2002, at 8:03, Rasmus Lerdorf wrote:

 This Faction variable comes from the browser.

Thanks for answering Rasmus.

But is it possible to clear this variable. Is this what is called a 
global variable? If not, does this means that the scope of POST 
variables is as long as the life of the browser session ?

Or redirect away from this page as soon as you get
the post so a reload wouldn't reload the posted page.

Sure. But the user can always click Back on the browser and 
reload all data?


Claude
Ormetal Inc.

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




[PHP] Append to the beginning of a file...

2002-03-21 Thread Mauricio Sthandier

I guess thist must be really silly... but how can I append text to the
beginning of a file ???
I've been trying since a while... but all I get is overwriting !.



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




Re: [PHP] How to clear variables?

2002-03-21 Thread C. Cormier - Ormetal Inc.

Thanks for your help.

 Well, you could prevent the user from cacheing the page by sending the
 appropriate cache control headers.  Then when they click back it would
 say that the page is expired.


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




[PHP] How to adress pictures stored outside of the http server root?

2002-03-21 Thread andy

Hi there,

I am trying to put my images outside the http server root. Anywhere else on
my system to make it inpossible to steal those files and images with wget.

My problem is how to access the files myself :-) I tryed img
src=/home/user/test/images/22.jpg But the server understands :
server.com/home/user/test/images/22.jpg

So how could I do this? I guess this is possible, isn't it?

Thanx for any help,

Andy



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




Re: [PHP] How to clear variables?

2002-03-21 Thread Rasmus Lerdorf

 On 21 Mar 2002, at 8:03, Rasmus Lerdorf wrote:

  This Faction variable comes from the browser.

 Thanks for answering Rasmus.

 But is it possible to clear this variable. Is this what is called a
 global variable? If not, does this means that the scope of POST
 variables is as long as the life of the browser session ?

No, you are misunderstanding the issue.  It's like asking if you can clear
the URL in someone's browser so that when they hit reload they will not
reload your site.  You can't control their browser like that from PHP.
That is purely a client-side issue.  You might be able to do some funky
Javascript to do it, but from a PHP perspective it is out of your hands.
You simply have to compensate in your server code to avoid committing the
same query twice.

 Or redirect away from this page as soon as you get
 the post so a reload wouldn't reload the posted page.

 Sure. But the user can always click Back on the browser and
 reload all data?

Well, you could prevent the user from cacheing the page by sending the
appropriate cache control headers.  Then when they click back it would say
that the page is expired.

-Rasmus


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




[PHP] Function Not Accepting Variable Values From a Form

2002-03-21 Thread Dr. Shim

Alas, more problems with forms =)

Well now, here is my problem. I have a form, method is set to post, and
action is set to the same page. I also have a hidden field named
form_post and it's value is 1.

Underneath this form is my PHP script.

?php

if (isset($form_post))
   {
echo Function \isset\ called. Values are...br\n
 Title: $titlebr\n
 Author: $authorbr\n
 Lead Actors: $actorsbr\n
 Poster: $posterbr\n
 Summ.: $summerybrbr\n\n
 Rev.: $reviewbrbr\n\n;
verify();// Function call to verify
   } else {
exit;
   }// Since form_post is set, it proceeds to verify. Strangley enough,
all the values appear in this if block.


function verify()
   {

echo Verify called. Values are...br\n
 Title: $titlebr\n
 Author: $authorbr\n
 Lead Actors: $actorsbr\n
 Poster: $posterbr\n
 Summ.: $summerybrbr\n\n
 Rev.: $reviewbrbr\n\n;
   }

In the function verify no values appear, just:

Title:
Author:
Lead Actors:
Poster:
Summ.:

Rev.:

Although -- as the comment said -- the if block shows all the values just
fine.


What could possibly be wrong? The solution to my last problem was to get rid
of any functions. However, that results in highly messy code! There has got
to be a way of having values passed to a function.

Thanks for any help/suggestions.



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




Re: [PHP] Apache

2002-03-21 Thread Erik Price

Isn't it just a matter of setting the permissions?  apache can't have 
read access to this directory, that's all.


Erik



On Thursday, March 21, 2002, at 03:28  AM, jtjohnston wrote:

 I'm also looking at this in my .conf. I know putting something here is 
 the
 answer, but what :)

 Directory /
 Options FollowSymLinks
 AllowOverride All
 /Directory

 J

 Scott Furt wrote:

 Errmm... i don't know any apache groups, but
 if you want to do what you ask, just read the
 documentation, it's easy :-)

 jtjohnston wrote:
 Anyone know of a good apache group?
 I want to hide the structure of a directory when there is no idex.html
 present g

 J




 --
 John Taylor-Johnston
 -

   ' ' '   Collège de Sherbrooke:
  ô¿ô   http://www.collegesherbrooke.qc.ca/languesmodernes/
- Université de Sherbrooke:
   http://compcanlit.ca/
   819-569-2064



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









Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




Re: [PHP] Append to the beginning of a file...

2002-03-21 Thread Mauricio Sthandier

I already seen it... I used r+ and aw.
I saw and example in www.php.net, in the fopen function description, but it
is incomplete...
this is taking me hours !!!.
Well, if I can preappend... how can I read, for example, the first 8 chars
of the last line I inserted ?. They have no fixed length.
I'm starting to feel silly :(.

Chris Boget [EMAIL PROTECTED] escribió en el mensaje
news:01bd01c1d0f6$3fc51f60$[EMAIL PROTECTED]...
  I guess thist must be really silly... but how can I append text to the
  beginning of a file ???
  I've been trying since a while... but all I get is overwriting !.

 Check out fopen().  There is an argument that you can use in that function
 call to determine how the data is sent to the file.

 Chris




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




[PHP] Re: Function Not Accepting Variable Values From a Form

2002-03-21 Thread Julio Nobrega Trabalhando

  Scope. Try to pass the values as the function reference (inside the ()),
'global' them, or use $_POST[''], from 4.1 and beyond.

  If you don't know what's a 'scope', there's an entry on the manual that
can explain better.

--

Julio Nobrega.

Um dia eu chego lá:
http://sourceforge.net/projects/toca

Ajudei? Salvei? Que tal um presentinho?
http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884


Dr. Shim [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Alas, more problems with forms =)

 Well now, here is my problem. I have a form, method is set to post,
and
 action is set to the same page. I also have a hidden field named
 form_post and it's value is 1.

 Underneath this form is my PHP script.

 ?php

 if (isset($form_post))
{
 echo Function \isset\ called. Values are...br\n
  Title: $titlebr\n
  Author: $authorbr\n
  Lead Actors: $actorsbr\n
  Poster: $posterbr\n
  Summ.: $summerybrbr\n\n
  Rev.: $reviewbrbr\n\n;
 verify();// Function call to verify
} else {
 exit;
}// Since form_post is set, it proceeds to verify. Strangley
enough,
 all the values appear in this if block.


 function verify()
{

 echo Verify called. Values are...br\n
  Title: $titlebr\n
  Author: $authorbr\n
  Lead Actors: $actorsbr\n
  Poster: $posterbr\n
  Summ.: $summerybrbr\n\n
  Rev.: $reviewbrbr\n\n;
}

 In the function verify no values appear, just:

 Title:
 Author:
 Lead Actors:
 Poster:
 Summ.:

 Rev.:

 Although -- as the comment said -- the if block shows all the values just
 fine.


 What could possibly be wrong? The solution to my last problem was to get
rid
 of any functions. However, that results in highly messy code! There has
got
 to be a way of having values passed to a function.

 Thanks for any help/suggestions.





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




Re: [PHP] How to adress pictures stored outside of the http serverroot?

2002-03-21 Thread Rasmus Lerdorf

Think about what you are doing a bit here.  You want to store the pictures
outside of your document_root, yet you want to reference them directly
from a web page.  That makes absolutely no sense.  By definition,
something that can be accessed directly through your web server must be
accessible from your document_root.

The way to do this is to write a little PHP wrapper script that you stick
in your document_root that does a readfile() on the file stored outside of
the document_root.

-Rasmus

On Thu, 21 Mar 2002, andy wrote:

 Hi there,

 I am trying to put my images outside the http server root. Anywhere else on
 my system to make it inpossible to steal those files and images with wget.

 My problem is how to access the files myself :-) I tryed img
 src=/home/user/test/images/22.jpg But the server understands :
 server.com/home/user/test/images/22.jpg

 So how could I do this? I guess this is possible, isn't it?

 Thanx for any help,

 Andy



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



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




[PHP] T_STRING, T_VARIABLE, and T_NUM_STRING

2002-03-21 Thread Joshua E Minnie

I keep getting the following error message and I am just wondering what
T_STRING, T_VARIABLE, and T_NUM_STRING mean.

Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or
`T_NUM_STRING' in /home/www/process.php on line 20

--
Joshua E Minnie
CIO
[EMAIL PROTECTED]

Don't work for recognition, but always do work worthy of recognition.



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




Re: [PHP] Oracle ORA_ functions and blobs / clobs

2002-03-21 Thread Thies C. Arntzen

On Thu, Mar 21, 2002 at 12:33:13PM +1100, Bradley Goldsmith wrote:
 Hi All,
 
   Is it possible to store/fetch blobs/clobs with the oracle (ORA not
 OCI8) functions?

no
tc

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




RE: [PHP] T_STRING, T_VARIABLE, and T_NUM_STRING

2002-03-21 Thread Rick Emery

you just have to double check your code, as you did

-Original Message-
From: Joshua E Minnie [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 21, 2002 11:07 AM
To: Rick Emery
Subject: Re: [PHP] T_STRING, T_VARIABLE, and T_NUM_STRING


I had already fixed the error, I just wondered what those particular errors
meant.  This time it was just a missing quote, but other times it has been a
missing \ or ;.  So I just wondered if there was a particular meaning for
those errors or do you basically have to just double check your code for
typos.

Joshua E Minnie
CIO
[EMAIL PROTECTED]

Don't work for recognition, but always do work worthy of recognition.

 -Original Message-
 From: Joshua E Minnie [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, March 21, 2002 10:44 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] T_STRING, T_VARIABLE, and T_NUM_STRING


 I keep getting the following error message and I am just wondering what
 T_STRING, T_VARIABLE, and T_NUM_STRING mean.

 Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or
 `T_NUM_STRING' in /home/www/process.php on line 20

 --
 Joshua E Minnie
 CIO
 [EMAIL PROTECTED]

 Don't work for recognition, but always do work worthy of recognition.



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

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




[PHP] Re: Function Not Accepting Variable Values From a Form

2002-03-21 Thread Dr. Shim

I will try $_POST[] first. I do that under the value parameter for each
form element?
input type=text name=author value=?php $_POST['author'] ?
Right?


--
Julio Nobrega Trabalhando [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Scope. Try to pass the values as the function reference (inside the ()),
'global' them, or use $_POST[''], from 4.1 and beyond.

  If you don't know what's a 'scope', there's an entry on the manual that
can explain better.

--

Julio Nobrega.

Um dia eu chego lá:
http://sourceforge.net/projects/toca

Ajudei? Salvei? Que tal um presentinho?
http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884


Dr. Shim [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Alas, more problems with forms =)

 Well now, here is my problem. I have a form, method is set to post,
and
 action is set to the same page. I also have a hidden field named
 form_post and it's value is 1.

 Underneath this form is my PHP script.

 ?php

 if (isset($form_post))
{
 echo Function \isset\ called. Values are...br\n
  Title: $titlebr\n
  Author: $authorbr\n
  Lead Actors: $actorsbr\n
  Poster: $posterbr\n
  Summ.: $summerybrbr\n\n
  Rev.: $reviewbrbr\n\n;
 verify();// Function call to verify
} else {
 exit;
}// Since form_post is set, it proceeds to verify. Strangley
enough,
 all the values appear in this if block.


 function verify()
{

 echo Verify called. Values are...br\n
  Title: $titlebr\n
  Author: $authorbr\n
  Lead Actors: $actorsbr\n
  Poster: $posterbr\n
  Summ.: $summerybrbr\n\n
  Rev.: $reviewbrbr\n\n;
}

 In the function verify no values appear, just:

 Title:
 Author:
 Lead Actors:
 Poster:
 Summ.:

 Rev.:

 Although -- as the comment said -- the if block shows all the values just
 fine.


 What could possibly be wrong? The solution to my last problem was to get
rid
 of any functions. However, that results in highly messy code! There has
got
 to be a way of having values passed to a function.

 Thanks for any help/suggestions.







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




[PHP] bigendian vs littleendian

2002-03-21 Thread Mika Tuupola


How can I make 

$double = pack(d,   $val);

to produce same value when run on bigendian host as what
it would result when running in a littleendian host?

-- 
Mika Tuupola  http://www.appelsiini.net/~tuupola/


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




Re: [PHP] Seek server hardware recommendation

2002-03-21 Thread Miguel Cruz

On Thu, 21 Mar 2002, Aras Kucinskas wrote:
 LINUX
 Apache
 PHP
 mySQL
 
 Server purpose:
 One site (PHP+mySQL ) hosting, max 1000 visitors per day.
 
 What is recommendet hardware requiremnts (CPU, RAM,...)?

Unless you expect most of those hits to be concentrated in a short period,
for that sort of traffic (one hit every 86 seconds), you could easily get
away with a 486-based PC with 24M of RAM and a 500M hard drive. The only
thing that will bug you will be the long compile times when you're getting
the software installed.

miguel


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




RE: [PHP] Re: Function Not Accepting Variable Values From a Form

2002-03-21 Thread Rick Emery

you still need to declare the values as GLOBAL

-Original Message-
From: Dr. Shim [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 21, 2002 11:12 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: Function Not Accepting Variable Values From a Form


I will try $_POST[] first. I do that under the value parameter for each
form element?
input type=text name=author value=?php $_POST['author'] ?
Right?


--
Julio Nobrega Trabalhando [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Scope. Try to pass the values as the function reference (inside the ()),
'global' them, or use $_POST[''], from 4.1 and beyond.

  If you don't know what's a 'scope', there's an entry on the manual that
can explain better.

--

Julio Nobrega.

Um dia eu chego lá:
http://sourceforge.net/projects/toca

Ajudei? Salvei? Que tal um presentinho?
http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884


Dr. Shim [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Alas, more problems with forms =)

 Well now, here is my problem. I have a form, method is set to post,
and
 action is set to the same page. I also have a hidden field named
 form_post and it's value is 1.

 Underneath this form is my PHP script.

 ?php

 if (isset($form_post))
{
 echo Function \isset\ called. Values are...br\n
  Title: $titlebr\n
  Author: $authorbr\n
  Lead Actors: $actorsbr\n
  Poster: $posterbr\n
  Summ.: $summerybrbr\n\n
  Rev.: $reviewbrbr\n\n;
 verify();// Function call to verify
} else {
 exit;
}// Since form_post is set, it proceeds to verify. Strangley
enough,
 all the values appear in this if block.


 function verify()
{

 echo Verify called. Values are...br\n
  Title: $titlebr\n
  Author: $authorbr\n
  Lead Actors: $actorsbr\n
  Poster: $posterbr\n
  Summ.: $summerybrbr\n\n
  Rev.: $reviewbrbr\n\n;
}

 In the function verify no values appear, just:

 Title:
 Author:
 Lead Actors:
 Poster:
 Summ.:

 Rev.:

 Although -- as the comment said -- the if block shows all the values just
 fine.


 What could possibly be wrong? The solution to my last problem was to get
rid
 of any functions. However, that results in highly messy code! There has
got
 to be a way of having values passed to a function.

 Thanks for any help/suggestions.







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

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




Re: [PHP] Append to the beginning of a file...

2002-03-21 Thread Miguel Cruz

On Thu, 21 Mar 2002, Mauricio Sthandier wrote:
 I guess thist must be really silly... but how can I append text to the
 beginning of a file ???
 I've been trying since a while... but all I get is overwriting !.

Open a temporary file, write your new data to it, copy the old file on to 
the end of it, remove the old file, rename the temporary file with the old 
file's name.

Obviously this is not very efficient. Explore whether you really need to
prepend. Perhaps you can append and then read the file backwards a la tac?  
Or perhaps a database is more useful. Or multiple files.

miguel


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




Re: [PHP] How to adress pictures stored outside of the http server root?

2002-03-21 Thread andy

hmm sounds logical. The idea was to protect the image directory from people
who would like to download all the image files. Somebody told me to place
the dir outside the document root. So this seems to be wrong.

What would you suggest to prevent people from downloading all the  image
files?

Thanx, Andy


Rasmus Lerdorf [EMAIL PROTECTED] schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Think about what you are doing a bit here.  You want to store the pictures
 outside of your document_root, yet you want to reference them directly
 from a web page.  That makes absolutely no sense.  By definition,
 something that can be accessed directly through your web server must be
 accessible from your document_root.

 The way to do this is to write a little PHP wrapper script that you stick
 in your document_root that does a readfile() on the file stored outside of
 the document_root.

 -Rasmus

 On Thu, 21 Mar 2002, andy wrote:

  Hi there,
 
  I am trying to put my images outside the http server root. Anywhere else
on
  my system to make it inpossible to steal those files and images with
wget.
 
  My problem is how to access the files myself :-) I tryed img
  src=/home/user/test/images/22.jpg But the server understands :
  server.com/home/user/test/images/22.jpg
 
  So how could I do this? I guess this is possible, isn't it?
 
  Thanx for any help,
 
  Andy
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 




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




[PHP] Session Varaible Problem

2002-03-21 Thread Randy Phillips

Hi,

I have tried every example of creating a session variable I could find on
php.net and have had the same results with all of them. The session
variables get set on the initial page but that's the only place I can access
them.

I am new to php so I'm sure I have just overlooked something.

Here is my latest attempt. It's a simple login page that starts a session
when a user successfully logs in:

$connect...

$sql ...

list($id,$first_name) = mysql_fetch_row($sql);
session_start();
if (!session_is_registered('user_id')) {
session_register('user_id');
$user_id = $id;
session_register('user_name');
$user_name = $first_name;
} else {
echo pSession is set and should now be availalbe on all pages via a
cookie. At least that what I expected.;
}

Sadly, these vars are available only on this page.

echo pID: $user_id;

echo pName: $user_name;

Mac OSX
Apache
PHP 4+

Thanks,

-- 
Rp



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




Re: [PHP] Apache

2002-03-21 Thread Jason Wong

On Friday 22 March 2002 00:54, Erik Price wrote:
 Isn't it just a matter of setting the permissions?  apache can't have
 read access to this directory, that's all.


No, he doesn't want apache to *list* files in that directory but still to be 
able to serve files *from* that directory.



-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
We have a equal opportunity Calculus class -- it's fully integrated.
*/

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




Re: [PHP] Apache

2002-03-21 Thread Mika Tuupola

On Fri, 22 Mar 2002, Jason Wong wrote:

 No, he doesn't want apache to *list* files in that directory but still to be 
 able to serve files *from* that directory.

Just add an empty index file?

-- 
Mika Tuupola  http://www.appelsiini.net/~tuupola/


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




Re: [PHP] How to adress pictures stored outside of the http serverroot?

2002-03-21 Thread Miguel Cruz

On Thu, 21 Mar 2002, andy wrote:
 Rasmus Lerdorf [EMAIL PROTECTED] schrieb:
 The way to do this is to write a little PHP wrapper script that you
 stick in your document_root that does a readfile() on the file stored
 outside of the document_root.

 What would you suggest to prevent people from downloading all the  image
 files?

Here's one idea: write a little PHP wrapper script that you stick in your
document_root that does a readfile() on the file stored outside of the
document_root.

miguel


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




Re: [PHP] Error compiling PHP with native MySql

2002-03-21 Thread Jason Wong

On Friday 22 March 2002 00:29, Richard Fox wrote:

 When I try to configure PHP 4.1.1 I get the following error:

 configure: error: Cannot find header files under /usr/include/mysql

 The command line I'm using to configure:

 ./configure --with-mysql=/usr/include/mysql


  ./configure --with-mysql=/usr

or just

  ./configure --with-mysql

if you want the PHP's builtin support for mysql.


-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
Operator, please trace this call and tell me where I am.
*/

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




Re: [PHP] Session Varaible Problem

2002-03-21 Thread Rasmus Lerdorf

Are you calling session_start() on the subsequent pages you want to be
part of the session?

On Thu, 21 Mar 2002, Randy Phillips wrote:

 Hi,

 I have tried every example of creating a session variable I could find on
 php.net and have had the same results with all of them. The session
 variables get set on the initial page but that's the only place I can access
 them.

 I am new to php so I'm sure I have just overlooked something.

 Here is my latest attempt. It's a simple login page that starts a session
 when a user successfully logs in:

 $connect...

 $sql ...

 list($id,$first_name) = mysql_fetch_row($sql);
 session_start();
 if (!session_is_registered('user_id')) {
 session_register('user_id');
 $user_id = $id;
 session_register('user_name');
 $user_name = $first_name;
 } else {
 echo pSession is set and should now be availalbe on all pages via a
 cookie. At least that what I expected.;
 }

 Sadly, these vars are available only on this page.

 echo pID: $user_id;

 echo pName: $user_name;

 Mac OSX
 Apache
 PHP 4+

 Thanks,

 --
 Rp



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



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




Re: [PHP] Apache

2002-03-21 Thread Rasmus Lerdorf

So either turn off the DirectoryIndex or put an index.html in the dir.

On Fri, 22 Mar 2002, Jason Wong wrote:

 On Friday 22 March 2002 00:54, Erik Price wrote:
  Isn't it just a matter of setting the permissions?  apache can't have
  read access to this directory, that's all.


 No, he doesn't want apache to *list* files in that directory but still to be
 able to serve files *from* that directory.



 --
 Jason Wong - Gremlins Associates - www.gremlins.com.hk

 /*
 We have a equal opportunity Calculus class -- it's fully integrated.
 */

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



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




Re: [PHP] Apache

2002-03-21 Thread Jason Wong

On Friday 22 March 2002 01:38, Mika Tuupola wrote:
 On Fri, 22 Mar 2002, Jason Wong wrote:
  No, he doesn't want apache to *list* files in that directory but still to
  be able to serve files *from* that directory.

   Just add an empty index file?

But that's a kludge. Anyway someone has already given the correct answer.


-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
I hate quotations.
-- Ralph Waldo Emerson
*/

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




[PHP] Re: Function Not Accepting Variable Values From a Form

2002-03-21 Thread Dr. Shim

function verify()
   {

echo Verify called. Values are...br\n
 Title: . $_POST['title'] . br\n# This works!
 Author: $authorbr\n
 Lead Actors: $actorsbr\n
 Poster: $posterbr\n
 Summ.: $summerybrbr\n\n
 Rev.: $reviewbrbr\n\n;
}




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




Re: [PHP] Session Varaible Problem

2002-03-21 Thread Erik Price


Have you made sure that the correct values are even being loaded into 
the session variable containers?  IOW, try

echo $id;
echo $first_name;

to make sure that there is actually any value in those variables.



Erik


On Thursday, March 21, 2002, at 12:22  PM, Randy Phillips wrote:

 Hi,

 I have tried every example of creating a session variable I could find 
 on
 php.net and have had the same results with all of them. The session
 variables get set on the initial page but that's the only place I can 
 access
 them.

 I am new to php so I'm sure I have just overlooked something.

 Here is my latest attempt. It's a simple login page that starts a 
 session
 when a user successfully logs in:

 $connect...

 $sql ...

 list($id,$first_name) = mysql_fetch_row($sql);
 session_start();
 if (!session_is_registered('user_id')) {
 session_register('user_id');
 $user_id = $id;
 session_register('user_name');
 $user_name = $first_name;
 } else {
 echo pSession is set and should now be availalbe on all pages 
 via a
 cookie. At least that what I expected.;
 }

 Sadly, these vars are available only on this page.

 echo pID: $user_id;

 echo pName: $user_name;

 Mac OSX
 Apache
 PHP 4+

 Thanks,

 --
 Rp



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









Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




Re: [PHP] Apache

2002-03-21 Thread Erik Price


On Thursday, March 21, 2002, at 12:22  PM, Jason Wong wrote:

 On Friday 22 March 2002 00:54, Erik Price wrote:
 Isn't it just a matter of setting the permissions?  apache can't have
 read access to this directory, that's all.


 No, he doesn't want apache to *list* files in that directory but still 
 to be
 able to serve files *from* that directory.

I'm not trying to argue, I just want to make sure that *I* understand 
how Apache works -- I thought that if you deny read access to a 
directory to Apache, then it won't list the files, but as long as Apache 
still has execute access to the directory then it should still serve 
files from it.  Just like using ls in the shell, you can read files in 
a directory you cannot read, as long as you can execute the directory 
and know the exact filename.

Am I wrong?


Erik




Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




Re: [PHP] Append to the beginning of a file...

2002-03-21 Thread Jason Wong

On Friday 22 March 2002 00:40, Mauricio Sthandier wrote:
 I already seen it... I used r+ and aw.
 I saw and example in www.php.net, in the fopen function description, but it
 is incomplete...
 this is taking me hours !!!.
 Well, if I can preappend... how can I read, for example, the first 8 chars
 of the last line I inserted ?. They have no fixed length.
 I'm starting to feel silly :(.

 Chris Boget [EMAIL PROTECTED] escribió en el mensaje
 news:01bd01c1d0f6$3fc51f60$[EMAIL PROTECTED]...

   I guess thist must be really silly... but how can I append text to the
   beginning of a file ???
   I've been trying since a while... but all I get is overwriting !.
 
  Check out fopen().  There is an argument that you can use in that
  function call to determine how the data is sent to the file.

Write your stuff to a new file, 
read old file, 
add stuff from old file onto new file,
rename new file to old file


OR

read old file into a very long string
add new stuff to beginning of very long string
write very long string to old file

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
Technological progress has merely provided us with more efficient means
for going backwards.
-- Aldous Huxley
*/

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




Re: [PHP] Apache

2002-03-21 Thread Jason Wong

On Friday 22 March 2002 01:39, Erik Price wrote:
 On Thursday, March 21, 2002, at 12:22  PM, Jason Wong wrote:
  On Friday 22 March 2002 00:54, Erik Price wrote:
  Isn't it just a matter of setting the permissions?  apache can't have
  read access to this directory, that's all.
 
  No, he doesn't want apache to *list* files in that directory but still
  to be
  able to serve files *from* that directory.

 I'm not trying to argue, I just want to make sure that *I* understand
 how Apache works -- I thought that if you deny read access to a
 directory to Apache, then it won't list the files, but as long as Apache
 still has execute access to the directory then it should still serve
 files from it.  Just like using ls in the shell, you can read files in
 a directory you cannot read, as long as you can execute the directory
 and know the exact filename.

I don't know what ramifications it will have by denying apache read access to 
a directory. But what the poster asked for is a standard apache directive so 
the prudent approach would be to set this from within apache and not through 
the OS.

 Am I wrong?

I really don't know. Try it and tell us ;-)



-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
The future isn't what it used to be.  (It never was.)
*/

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




[PHP] $HTTP_POST_VARS

2002-03-21 Thread Joshua E Minnie

I need to access a variable on a form that allows multiples.  I have to use
$HTTP_POST_VARS so I need to know how to display the information obtained
from the form.  This is what I am using right now:

?
  reset($HTTP_POST_VARS[interest]);
  while(current($HTTP_POST_VARS[interest])) {
echo strip_tags(trim($HTTP_POST_VARS[interest])).nbsp;nbsp;nbsp;;
next($HTTP_POST_VARS[interest]));
  }
?

Both $HTTP_POST_VARS[interest] and $HTTP_POST_VARS[interest[]] throw
errors.  Any suggestions would be greatly appreciated.


--
Joshua E Minnie
CIO
[EMAIL PROTECTED]

Don't work for recognition, but always do work worthy of recognition.



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




RE: [PHP] $HTTP_POST_VARS

2002-03-21 Thread Rick Emery

$interest = $HTTP_POST_VARS['interest'];

or (if using PHP 4.1)
$interest = $_POST['interest'];

then reference $interest[0], $interest[1], $interest[2],...


-Original Message-
From: Joshua E Minnie [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 21, 2002 11:54 AM
To: [EMAIL PROTECTED]
Subject: [PHP] $HTTP_POST_VARS


I need to access a variable on a form that allows multiples.  I have to use
$HTTP_POST_VARS so I need to know how to display the information obtained
from the form.  This is what I am using right now:

?
  reset($HTTP_POST_VARS[interest]);
  while(current($HTTP_POST_VARS[interest])) {
echo strip_tags(trim($HTTP_POST_VARS[interest])).nbsp;nbsp;nbsp;;
next($HTTP_POST_VARS[interest]));
  }
?

Both $HTTP_POST_VARS[interest] and $HTTP_POST_VARS[interest[]] throw
errors.  Any suggestions would be greatly appreciated.


--
Joshua E Minnie
CIO
[EMAIL PROTECTED]

Don't work for recognition, but always do work worthy of recognition.



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

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




Re: [PHP] Seek server hardware recommendation

2002-03-21 Thread Miles Thompson

You're right Michael, but those are getting hard to find. g
M.

At 11:13 AM 3/21/2002 -0600, Miguel Cruz wrote:
On Thu, 21 Mar 2002, Aras Kucinskas wrote:
  LINUX
  Apache
  PHP
  mySQL
 
  Server purpose:
  One site (PHP+mySQL ) hosting, max 1000 visitors per day.
 
  What is recommendet hardware requiremnts (CPU, RAM,...)?

Unless you expect most of those hits to be concentrated in a short period,
for that sort of traffic (one hit every 86 seconds), you could easily get
away with a 486-based PC with 24M of RAM and a 500M hard drive. The only
thing that will bug you will be the long compile times when you're getting
the software installed.

miguel


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


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




AW: [PHP] Apache

2002-03-21 Thread Andres Petralli

Here's the solution, quick and dirty:

You must have Options Indexes somewhere in your Apache conf files.
Remove the Expression Indexes from there and no more lists should be
generated. Maybe it's also Options ALL, then just limit the options to
what you need.

Greets,

Andres

 -Ursprüngliche Nachricht-
 Von: jtjohnston [mailto:[EMAIL PROTECTED]]
 Gesendet: Donnerstag, 21. März 2002 09:14
 An: [EMAIL PROTECTED]
 Betreff: [PHP] Apache
 
 
 Anyone know of a good apache group?
 I want to hide the structure of a directory when there is no idex.html
 present g
 
 J
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 

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




Re: [PHP] $HTTP_POST_VARS

2002-03-21 Thread Miguel Cruz

On Thu, 21 Mar 2002, Joshua E Minnie wrote:
 I need to access a variable on a form that allows multiples.  I have to use
 $HTTP_POST_VARS so I need to know how to display the information obtained
 from the form.  This is what I am using right now:
 
 ?
   reset($HTTP_POST_VARS[interest]);
   while(current($HTTP_POST_VARS[interest])) {
 echo strip_tags(trim($HTTP_POST_VARS[interest])).nbsp;nbsp;nbsp;;
 next($HTTP_POST_VARS[interest]));
   }
 ?
 
 Both $HTTP_POST_VARS[interest] and $HTTP_POST_VARS[interest[]] throw
 errors.  Any suggestions would be greatly appreciated.

1. Make sure you defined the form element in your HTML as interest[] and
not interest.

2. Test to see that it's an array before trying to run loop through it,
because if the user doesn't select anything, you won't get an array, and
therefore referring to to the variable as one would be an error.

if (is_array($HTTP_POST_VARS['interest']))
  foreach ($HTTP_POST_VARS['interest'] as $item)
echo strip_tags(trim($item)) . 'nbsp;nbsp;nbsp;';

miguel


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




[PHP] Browser Detection without use of browsecap.ini file

2002-03-21 Thread R'twick Niceorgaw

Hi all,
is there any way, I can detect the browser without using browsecap.ini file
? I'm simply interested to know if the user using netscape 4.x or earlier.

I  tried get_browser() function but it returns blank! after checking my
server's configuration i found browsecap file setting in uninitialized. I'm
not sure if my hosting company will setit up properly for me, but already
contacted them and waiting to hear a response form them..

Any help will be much appreciated.

R'twick



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




[PHP] ereg_replace Help

2002-03-21 Thread lists

Hi all,

I have a large file that I am trying to parse.

I have a many lines that look like this


\\text1

I need an expression that will change \\text1 to text1=

so if I have something like this

\\text1 

asdfkjaslkfj
asdlfkjasljkf
asdlkfjasldfkj
asldkfjalskfj

\\text2 
erweiurwoeir
werqwer
qwer
qwerqw
er

\\text3

asdlfkw
xcvsdf
zxcvcgn
sdfgwr
xcdfvszdfg


it will become

text1 = 

asdfkjaslkfj
asdlfkjasljkf
asdlkfjasldfkj
asldkfjalskfj
 text2 = erweiurwoeir
werqwer
qwer
qwerqw
er
 text3 = asdlfkw
xcvsdf
zxcvcgn
sdfgwr
xcdfvszdfg



Any Ideas,
Michael



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




[PHP] Control Panel

2002-03-21 Thread karthikeyan

Hi Everybody,

  Is there any control panel like Webmin in PHP.

  Regards,

karthikeyan.



Re: [PHP] Append to the beginning of a file...

2002-03-21 Thread Mauricio Sthandier

I guess I should do that.
I need the plain file because is just a log of users registering in a Club,
in a csv format.
Using a database is just too much and not intended for this page... even
when I would prefer using mysql. At least, I can handle that rather than the
fopen and fwrite !.
I could append but then I need to read the first 8 chars of the last line I
appended... neither something I know how to do.
If they were fixed I could... maybe I can fill it with blank chars the line
until a given size ?

Thanxs everyone for your replies.

Miguel Cruz [EMAIL PROTECTED] escribió en el mensaje
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 On Thu, 21 Mar 2002, Mauricio Sthandier wrote:
  I guess thist must be really silly... but how can I append text to the
  beginning of a file ???
  I've been trying since a while... but all I get is overwriting !.

 Open a temporary file, write your new data to it, copy the old file on to
 the end of it, remove the old file, rename the temporary file with the old
 file's name.

 Obviously this is not very efficient. Explore whether you really need to
 prepend. Perhaps you can append and then read the file backwards a la tac?
 Or perhaps a database is more useful. Or multiple files.

 miguel




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




Re: [PHP] cannot see LDAP userPassword and createTimestamp attr

2002-03-21 Thread Stig Venaas

On Tue, Feb 26, 2002 at 07:42:15PM -0800, tim tom wrote:
 why can't i see the createTimestamp and userPassword bcos i did an *authenticated 
bind* !
 the script:

This depends on the LDAP server. createTimestamp is an operational
attribute and is not returned by default. You can specify explicitly
that you want this attribute, or use the magical name + to get all
operational attributes. The userPassword attribute is normally
protected but it seems like you fixed that. I think the problem you
see is that PHP always returns attributes in lower case. It might be
a good idea to do var_dump() of array returned by ldap_get_entries()
to see what's in it.

Stig

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




Re: [PHP] Append to the beginning of a file...

2002-03-21 Thread Miguel Cruz

On Thu, 21 Mar 2002, Mauricio Sthandier wrote:
 I could append but then I need to read the first 8 chars of the last line I
 appended... neither something I know how to do.

Seek to the end of the file minus typical record length, read, 
look for the penultimate end-of-record delimiter (\n, probably) in there, 
and you've found your final record. If you don't find a delimiter, read 
some more and tack it onto the beginning of your string, then check again. 
Repeat until batter contains no large lumps.

miguel


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




[PHP] Execute AppleScript

2002-03-21 Thread Henrik Johansson

Is this possible from php?
Regards,
Henrik

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




  1   2   >