[PHP] imagecolorallocate / imagesetpixel / palette size?

2001-02-11 Thread Dan Harrington

Here is something weird going on.  Why is it that imagecolorallocate dies
after 256 colors have been allocated?  Note, this doesn't matter if
you write a jpg or png, it all produces the same result (see attached
graphic).

Yes, the colors are randomly made, and they all go in a straight, diagonal
line (315 degrees to be precise), and on the 256'th pixel
(I HAVE COUNTED EVERY PIXEL TO MAKE SURE)
it gets stuck on the last color and then continues painting pixels at that
last color until the end of the line.

I've tried to use imagecolordeallocate right after the pixel is drawn,
but that only makes all the pixels come out in one color (white).

Its like the "palette" only holds 256 pixels or something, what's
the deal with that?

Anyone experienced this before?  I've looked through the GD library
documentation
at boutell.com, i've looked through php.net, and every search engine on the
internet, and I can't seem to find out what is going on.

Thanks
Dan

==
?
$im = imagecreate(400,400);

//sets background to black
imagecolorallocate($im,0,0,0);

$x=0;
$y=0;

while ($x =400 ){
$color=imagecolorallocate($im,rand(0,255),rand(0,255),rand(0,255));
imagesetpixel($im,$x,$y,$color);
++$x;
++$y;
}

header("Content-type: image/png");
Imagepng($im);
ImageDestroy($im);
?



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


Re: [PHP] mod_rewrite starts driving me crazy ...

2001-02-11 Thread Richard Lynch

 This works perfectly, however what I really need to do is to make it work
 not only with /index.html but with everything typed in your browser...
 (index.html was only a test to let me know I am in a right direction)

 I tried:

 RewriteRule   ^(.*)  /start.php?go=$1
 RewriteRule   ^(.*)$  /start.php?go=$1
 RewriteRule   ^(.+)  /start.php?go=$1
 RewriteRule   ^(.+)$  /start.php?go=$1

 RewriteRule   ^(/.*)  /start.php?go=$1
 RewriteRule   ^(/.*)$  /start.php?go=$1
 RewriteRule   ^(/.+)  /start.php?go=$1
 RewriteRule   ^(/.+)$  /start.php?go=$1

Having just spent about 16 hours fighting with mod_rewrite to try and
replace broken DefaultType on FreeBSD, I feel your pain :-)

My thinking in this case is:  It really doesn't make sense to have either ^
or $ here, since you really don't care what you start or end with.  So, you
probably just want:

RewriteRule (.*) /start.php?go=$1

Except, of course, that will be an infinite loop, since that matches
start.php?go=index.html as well.

So, what I think you *really* want is:

RewriteRule ^/start\.php.* - [L]
RewriteRule (.*) /start.php?go=$1

Translation:
#1  If we are surfing to "/start.php?blahblahblah", then use the URL as-is
"-" and stop playing these silly rewrite games "[L]"
#2 Any URL that reaches this rule, wasn't one of our start.php hacks, so
redirect to start.php

You may need or want a [R] on the end of that second rule...

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



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




Re: [PHP] newline processing problem?

2001-02-11 Thread Richard Lynch

 I have some code which generates a large string to be used by the mail()
 function.  At the same point in the string each time, PHP stops processing
 "\n" correctly and instead of a newline outputs nothing, so the text
starts to
 get run together.. but it doesn't seem to happen on every "\n".  Has
anyone
 else run into this problem?  It used to work correctly but I made a few
 changes to portions of the code that were totally uninvolved, and it
started
 behaving this way.  Unfortunately, I didn't notice the problem until I'd
made
 a number of small changes to unrelated things and didn't remember what
they
 were.

To really be RFC-compliant, you should use "\r\n" instead of just "\n" --
Un*x mail-handling mostly fixes it for you, but...

My guess would be that you lost a \n somewhere or that you have \\n
somewhere...

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



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




Re: [PHP] passthru environment variables

2001-02-11 Thread Richard Lynch

 I'm trying to use passthru in a PHP program to have an external program
 display some data.  The problem is that I was trying to have the external
 program's environment pick up the form field variables automatically
passed
 into the PHP program as shell environment variables.

 In other words, if a user typed "Smith" into the last_name field in a
form,
 the PHP program called by that form starts out with $last_name = "Smith",
 and I would like the external program called by passthru within the PHP
 program to have a shell environment variable last_name = "Smith".

 Does anyone know an easy way to do this?

http://php.net/setenv

?php
SetEnv("last_name='$last_name'");
?

Since you probably want to do this for all your POST vars, check out
http://php.net/FAQ.php#7.1
?php
reset($HTTP_POST_VARS);
while (list($var, $val) = each($HTTP_POST_VARS)){
SetEnv("$var='$val'");
}
?

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



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




Re: [PHP-CVS] cvs: php4 /ext/standard file.c file.h

2001-02-11 Thread Sterling Hughes


 elixer Sat Feb 10 18:38:40 2001 EDT
 
   Modified files:  
 /php4/ext/standard file.c file.h 
   Log:
   Fix for bug #4556
   # This is pretty much a total rewrite of get_meta_tags using a simple
   # handwritten tokenizer.  It might be overkill, but it works.

I'd say this is news worthy...

Can you add an entry into the NEWS file.

-Sterling


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




Re: [PHP-CVS] cvs: php3 / php3.ini-dist

2001-02-11 Thread Rasmus Lerdorf

Hrm..  When was this changed in PHP 3?  It used to be on by default.  And
it is on by default in PHP 4.

-Rasmus

On Sat, 10 Feb 2001, Jim Winstead wrote:

 jimw  Sat Feb 10 11:43:58 2001 EDT

   Modified files:
 /php3 php3.ini-dist
   Log:
   we claim php3.ini documents the defaults, but magic_quotes_gpc defaults to off 
unless --enable-magic-quotes is used in compiling

 Index: php3/php3.ini-dist
 diff -u php3/php3.ini-dist:1.57 php3/php3.ini-dist:1.58
 --- php3/php3.ini-dist:1.57   Wed Feb 23 14:57:21 2000
 +++ php3/php3.ini-distSat Feb 10 11:43:58 2001
 @@ -110,7 +110,7 @@
  ;
  ; Data Handling ;
  ;
 -magic_quotes_gpc =   On  ; magic quotes for incoming 
GET/POST/Cookie data
 +magic_quotes_gpc =   Off ; magic quotes for incoming 
GET/POST/Cookie data
  magic_quotes_runtime=Off ; magic quotes for runtime-generated 
data, e.g. data from SQL, from exec(), etc.
  magic_quotes_sybase  =   Off ; Use Sybase-style magic quotes 
(escape ' with '' instead of \')
  track_vars   =   On  ; enable $HTTP_GET_VARS[], 
$HTTP_POST_VARS[] and $HTTP_COOKIE_VARS[] arrays



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



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




[PHP-CVS] cvs: CVSROOT / avail cvsusers gen_acl_file.m4

2001-02-11 Thread Rasmus Lerdorf

rasmus  Sun Feb 11 01:43:28 2001 EDT

  Modified files:  
/CVSROOTavail cvsusers gen_acl_file.m4 
  Log:
  CVS account for Emiliano Heyns (Midgard Project)
  
  
Index: CVSROOT/avail
diff -u CVSROOT/avail:1.79 CVSROOT/avail:1.80
--- CVSROOT/avail:1.79  Fri Feb  9 03:42:16 2001
+++ CVSROOT/avail   Sun Feb 11 01:43:27 2001
@@ -9,6 +9,7 @@
 
avail|jalal,zak,andre,ultrapingo,lyric,jmoore,ronabop,sbergmann,joey,sniper,torben,hellekin,cnewbill|qaweb
 
avail|andi,andrei,jimw,rasmus,rubys,sas,ssb,thies,zeev,shane,fmk,hirokawa,jah,eschmid,dbeu,sbergmann,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,sniper,changelog,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,shuric,svanegmond,rjs,vlad,jimjag,php_ext,chad,torben,lynch,kk,ted,kwazy,aka,affinity,paul,skaag,pglat,mbritton,coar,lwest,joey,bibi,mrobinso,lwh,perugini,hamoralesr,tzwenny,hirokawa,drews,paulsen,hartmann,philross,leon,valdirh,dmarion,dubois,jonen,tschuer,tfromm,manuel,stas,danbeck,sli,jmcastagnetto,mohrt,cris,goba,samesch,jon,soneca,kaufm,ronabop,glace,latoserver,phpguru_dk,lojmann,rafael,jan,jcmeloni,chrullrich,mk,sbergmann,troels,mathieu,voize,phaethon,mgx,mj,corean,pandach,brown,cycle98,vizvil,openlife,regina,cynic,jpm,dams,alponce,menuconfig,obst,topgoods,karoora,pcraft,suvia,zak,zimt,mgx,sintoris,jmoore,ftfuture,uttam,ag315,ropik,jbi1979,bbonev,malo,afortaleza,neotron,cg,delrom,dickmeiss,jkj,hellekin,kgergely,andreroq,eduardh,cnewbill,fuzzy74,inki,bjoern|phpdoc
 avail|andrei|php-gtk
+avail|emile|php4/ext/midgard
 avail|rasmus|php4/ext/aspell
 avail|andi|php4/ext/bcmath
 avail|NOBODY|php4/ext/calendar
Index: CVSROOT/cvsusers
diff -u CVSROOT/cvsusers:1.209 CVSROOT/cvsusers:1.210
--- CVSROOT/cvsusers:1.209  Fri Feb  9 03:42:16 2001
+++ CVSROOT/cvsusersSun Feb 11 01:43:27 2001
@@ -256,3 +256,4 @@
 fuzzy74   Jin Tae-Young   [EMAIL PROTECTED]   Korean 
translation
 inki  Ingmar Heinrich [EMAIL PROTECTED]  German 
translation
 bjoernBjoern Schotte  [EMAIL PROTECTED] PEAR
+emile Emiliano Heyns  [EMAIL PROTECTED]   Midgard
Index: CVSROOT/gen_acl_file.m4
diff -u CVSROOT/gen_acl_file.m4:1.82 CVSROOT/gen_acl_file.m4:1.83
--- CVSROOT/gen_acl_file.m4:1.82Fri Feb  9 03:42:16 2001
+++ CVSROOT/gen_acl_file.m4 Sun Feb 11 01:43:27 2001
@@ -13,6 +13,8 @@
 dnl
 define(`php_pres', `rasmus,sterling,jimw')dnl
 dnl
+define(`php_midgard', `emile')dnl
+dnl
 unavail
 avail|php_group|CVSROOT
 avail|php_group,php_web|phpweb
@@ -23,6 +25,7 @@
 avail|php_qa|qaweb
 avail|php_dev,php_ext,php_doc|phpdoc
 avail|andrei|php-gtk
+avail|php_midgard|php4/ext/midgard
 dnl Access to individual dirs in the code tree
 avail|rasmus|php4/ext/aspell
 avail|andi|php4/ext/bcmath



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




[PHP] XML Parsing The Sequel II

2001-02-11 Thread Steve Haemelinck

Ok, yesterday I had problems parsing an XML from Nasdaq.
Thx to Matt these problems have been solved and I am know able to parse any
XML without problems (I hope).

But I have one question:
In order to parse an XML you have to tell your parser where to find the
document:

$xml_file = ''test.xml';

This works perfectly, but If you want to get the XML files from Nasdaq you
have to say

$xml_file =
http://quotes.nasdaq.com/quote.dll?page=xmlmode=stocksymbol=NETA;

This however doe not work !!!

Why?  How can I overcome this problem?


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




[PHP] Code repositery

2001-02-11 Thread Michel 'ZioBudda' Morelli

Hi, does someone know some class/script for setup a code repositery? 
I have tried to find it on hotscripts.com or php.resourceindex.com but I
have not find nothing.

Tnx in advance.


-- 
Il tuo programma pi importante prende pi memoria di quella che hai.
Se hai abbastanza memoria, non hai abbastanza spazio su disco
Se un programma sta in memoria ed ha abbastanza spazio su disco, si
bloccher.
Se il programma va a gonfie vele, sta aspettando il momento peggiore per
bloccarsi.
--
Michel ZioBudda Morelli   [EMAIL PROTECTED]

ICQ UIN: 58351764   PR of Linux in Italy
http://www.ziobudda.net http://www.linuxlab.it 


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




[PHP] [newbie] Can I use regular expressions?

2001-02-11 Thread zbynek

Hi there!

I want to check if given username consists only of letters of English
alphabet, numbers, or "_".
I can go through the string and check every character.
Wouldn't it be simpler to use regular expressions? How would I do it?

These usernames are OK: _john_, 0123bla, foo
These are wrong: x#y, tboo, 100%

Thanks for your advice.

zbynek



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




Re: [PHP] [newbie] Can I use regular expressions?

2001-02-11 Thread Christian Reiniger

On Sunday 11 February 2001 13:09, zbynek wrote:

 I want to check if given username consists only of letters of English
 alphabet, numbers, or "_".

 Wouldn't it be simpler to use regular expressions? How would I do it?

if (preg_match ('/^\w+$/', $Username))
echo "'$Username' is okbr";
else
echo "'$Username' contains invalid chars"

-- 
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

"use the source, luke." (obi-wan gnuobi)

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




RE: [PHP] Code repositery

2001-02-11 Thread Dave

here is some logic, I'm sure you can flesh out the code.

fopen -r the URL
read the results into a variable, fopen -w to write a local temp file
(if the parser you build actially requires a "file")
save it locally and pass the filename variable to your XML parser
function

if your parser can work from a variable, then just pass the read
variable to your parser.

Dave

-Original Message-
From: Michel 'ZioBudda' Morelli [mailto:[EMAIL PROTECTED]]
Sent: Sunday, February 11, 2001 7:35 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Code repositery


Hi, does someone know some class/script for setup a code repositery?
I have tried to find it on hotscripts.com or php.resourceindex.com but
I
have not find nothing.

Tnx in advance.


--
Il tuo programma pi importante prende pi memoria di quella che hai.
Se hai abbastanza memoria, non hai abbastanza spazio su disco
Se un programma sta in memoria ed ha abbastanza spazio su disco, si
bloccher.
Se il programma va a gonfie vele, sta aspettando il momento peggiore
per
bloccarsi.
--
Michel ZioBudda Morelli   [EMAIL PROTECTED]

ICQ UIN: 58351764   PR of Linux in Italy
http://www.ziobudda.net http://www.linuxlab.it


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



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




[PHP-CVS] cvs: CVSROOT / avail gen_acl_file.m4

2001-02-11 Thread Rasmus Lerdorf

rasmus  Sun Feb 11 05:31:21 2001 EDT

  Modified files:  
/CVSROOTavail gen_acl_file.m4 
  Log:
  More karma for Emile
  
  
Index: CVSROOT/avail
diff -u CVSROOT/avail:1.80 CVSROOT/avail:1.81
--- CVSROOT/avail:1.80  Sun Feb 11 01:43:27 2001
+++ CVSROOT/avail   Sun Feb 11 05:31:20 2001
@@ -2,12 +2,12 @@
 unavail
 avail|andi,andrei,jimw,rasmus,rubys,sas,ssb,thies,zeev,shane|CVSROOT
 
avail|andi,andrei,jimw,rasmus,rubys,sas,ssb,thies,zeev,shane,cmv,tcobb,gareth,jah,eschmid,ronabop,derick,sterling,stas,phildriscoll,jmoore,andre,sniper,david,lyric,zimt,mk,goba,zak|phpweb
-avail|andi,andrei,jimw,rasmus,rubys,sas,ssb,thies,zeev,shane,fmk,hirokawa,jah,eschmid,dbeu,sbergmann,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,sniper,changelog,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,shuric,svanegmond,rjs,vlad,jimjag,jon,rael,jlp,sbergmann,troels,urs,jpm,adaniel,tuupola,mj,ssb,metallic,heyesr,aj,andre,zimt,uw,jeichorn,bjoern|php4/pear,pearweb,pear
-avail|andi,andrei,jimw,rasmus,rubys,sas,ssb,thies,zeev,shane,fmk,hirokawa,jah,eschmid,dbeu,sbergmann,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,sniper,changelog,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,shuric,svanegmond,rjs,vlad,jimjag|php4,php3,php31,phpfi
-avail|andi,andrei,jimw,rasmus,rubys,sas,ssb,thies,zeev,shane,fmk,hirokawa,jah,eschmid,dbeu,sbergmann,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,sniper,changelog,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,shuric,svanegmond,rjs,vlad,jimjag,hholzgra|functable
+avail|andi,andrei,jimw,rasmus,rubys,sas,ssb,thies,zeev,shane,fmk,hirokawa,jah,eschmid,dbeu,sbergmann,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,sniper,changelog,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,shuric,svanegmond,rjs,vlad,jimjag,emile,jon,rael,jlp,sbergmann,troels,urs,jpm,adaniel,tuupola,mj,ssb,metallic,heyesr,aj,andre,zimt,uw,jeichorn,bjoern|php4/pear,pearweb,pear
+avail|andi,andrei,jimw,rasmus,rubys,sas,ssb,thies,zeev,shane,fmk,hirokawa,jah,eschmid,dbeu,sbergmann,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,sniper,changelog,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,shuric,svanegmond,rjs,vlad,jimjag,emile|php4,php3,php31,phpfi
+avail|andi,andrei,jimw,rasmus,rubys,sas,ssb,thies,zeev,shane,fmk,hirokawa,jah,eschmid,dbeu,sbergmann,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,sniper,changelog,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,shuric,svanegmond,rjs,vlad,jimjag,emile,hholzgra|functable
 avail|rasmus,sterling,jimw|pres
 
avail|jalal,zak,andre,ultrapingo,lyric,jmoore,ronabop,sbergmann,joey,sniper,torben,hellekin,cnewbill|qaweb
-avail|andi,andrei,jimw,rasmus,rubys,sas,ssb,thies,zeev,shane,fmk,hirokawa,jah,eschmid,dbeu,sbergmann,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,sniper,changelog,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,shuric,svanegmond,rjs,vlad,jimjag,php_ext,chad,torben,lynch,kk,ted,kwazy,aka,affinity,paul,skaag,pglat,mbritton,coar,lwest,joey,bibi,mrobinso,lwh,perugini,hamoralesr,tzwenny,hirokawa,drews,paulsen,hartmann,philross,leon,valdirh,dmarion,dubois,jonen,tschuer,tfromm,manuel,stas,danbeck,sli,jmcastagnetto,mohrt,cris,goba,samesch,jon,soneca,kaufm,ronabop,glace,latoserver,phpguru_dk,lojmann,rafael,jan,jcmeloni,chrullrich,mk,sbergmann,troels,mathieu,voize,phaethon,mgx,mj,corean,pandach,brown,cycle98,vizvil,openlife,regina,cynic,jpm,dams,alponce,menuconfig,obst,topgoods,karoora,pcraft,suvia,zak,zimt,mgx,sintoris,jmoore,ftfuture,uttam,ag315,ropik,jbi1979,bbonev,malo,afortaleza,neotron,cg,delrom,dickmeiss,jkj,hellekin,kgergely,andreroq,eduardh,cnewbill,fuzzy74,inki,bjoern|phpdoc

RE: [PHP] XML Parsing The Sequel II

2001-02-11 Thread Dave

here is some logic, I'm sure you can flesh out the code.

fopen -r the URL
read the results into a variable, fopen -w to write a local temp file
(if the parser you build actially requires a "file")
save it locally and pass the filename variable to your XML parser
function

if your parser can work from a variable, then just pass the read
variable to your parser.

Dave

-Original Message-
From: Steve Haemelinck [mailto:[EMAIL PROTECTED]]
Sent: Sunday, February 11, 2001 5:13 AM
To: PHP Mailing Listl (E-mail)
Subject: [PHP] XML Parsing The Sequel II


Ok, yesterday I had problems parsing an XML from Nasdaq.
Thx to Matt these problems have been solved and I am know able to
parse any
XML without problems (I hope).

But I have one question:
In order to parse an XML you have to tell your parser where to find
the
document:

$xml_file = ''test.xml';

This works perfectly, but If you want to get the XML files from Nasdaq
you
have to say

$xml_file =
http://quotes.nasdaq.com/quote.dll?page=xmlmode=stocksymbol=NETA;

This however doe not work !!!

Why?  How can I overcome this problem?


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



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




RE: [PHP] Code repositery

2001-02-11 Thread Dave

sorry, ignore that last
hit reply to the wrong friggin message (late night last night)

cheers,

Dave

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




RE: [PHP] my bugaboo.

2001-02-11 Thread PHPBeginner.com

What  I think you should do is to use php's build-in function addslashes()

It helps .


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com




-Original Message-
From: Anna [mailto:[EMAIL PROTECTED]]
Sent: Sunday, February 11, 2001 9:37 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] my bugaboo.


- Original Message -
From: "Floyd Baker" [EMAIL PROTECTED]



 Hello and thanks to all for the help on the magic quotes, etc.
 It gives me a better handle on what I'm dealing with.

 Except for one more thing.

 When I bring back text from a field which contains a ', and try to apply
it as
 the value of an input box, it still truncates in the box.

 When I simply print $text, it prints out correctly as *Don't do this* .
 When I make $text the default value of an input box, it shows as *Don*.

 If the slash is still in place, it reads *Don\'t* above the box and *Don\*
in
 the box.

 My bugaboo continues..  :-

 Thanks again for any further advice.

 Floyd


That's  a problem with HTML.
example:
input type='text' name='textName' value='Don't do this'
Sees the ' in Don't as the signal for the end of the value string.
I haven't come up with an automatic way to deal with this,
but what I have done is in these lines (where there might be an apostrophe)
make sure I use double quotes:
input type="text" name="textName" value="Don't do this"
or
print "input type=\"text\" name=\"textName\" value=\"Don't do this\"";

Of course, then you may have the same trouble with double quotes. To avoid
that you can do ereg_replace("\"", "''", $text) -- that is, replace a double
quote with two single quotes? I think, I've never bothered.

Hope this helps somehow.

Anna


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



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




RE: [PHP] XML Parsing The Sequel II

2001-02-11 Thread Steve Haemelinck

But how can I automate the saving locally of the file !!!

 -Original Message-
From:   Dave [mailto:[EMAIL PROTECTED]] 
Sent:   zondag 11 februari 2001 14:44
To: PHP Mailing Listl (E-mail)
Subject:RE: [PHP] XML Parsing The Sequel II

here is some logic, I'm sure you can flesh out the code.

fopen -r the URL
read the results into a variable, fopen -w to write a local temp file
(if the parser you build actially requires a "file")
save it locally and pass the filename variable to your XML parser
function

if your parser can work from a variable, then just pass the read
variable to your parser.

Dave

-Original Message-
From: Steve Haemelinck [mailto:[EMAIL PROTECTED]]
Sent: Sunday, February 11, 2001 5:13 AM
To: PHP Mailing Listl (E-mail)
Subject: [PHP] XML Parsing The Sequel II


Ok, yesterday I had problems parsing an XML from Nasdaq.
Thx to Matt these problems have been solved and I am know able to
parse any
XML without problems (I hope).

But I have one question:
In order to parse an XML you have to tell your parser where to find
the
document:

$xml_file = ''test.xml';

This works perfectly, but If you want to get the XML files from Nasdaq
you
have to say

$xml_file =
http://quotes.nasdaq.com/quote.dll?page=xmlmode=stocksymbol=NETA;

This however doe not work !!!

Why?  How can I overcome this problem?


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



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



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




[PHP-CVS] cvs: php4 / NEWS

2001-02-11 Thread Sean Bright

elixer  Sun Feb 11 06:38:25 2001 EDT

  Modified files:  
/php4   NEWS 
  Log:
  Added note about get_meta_tags bugfix
  
  
Index: php4/NEWS
diff -u php4/NEWS:1.586 php4/NEWS:1.587
--- php4/NEWS:1.586 Wed Feb  7 06:10:13 2001
+++ php4/NEWS   Sun Feb 11 06:38:25 2001
@@ -2,6 +2,7 @@
 |||
 
 ?? ??? 200?, Version 4.0.5
+- Fixed get_meta_tags() multiline bug #4556 (Sean)
 - Prefer random() over *rand48() (JimJag)
 - Sped up WDDX serialization 2x. (Andrei)
 - Added a new parameter to mail() which appends aditional command line



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




[PHP] cgi execution w/php failing

2001-02-11 Thread Clif Wieden

Hi,

I've read through the archives and still must be missing something. I
need to execute a cgi script from php. This seems fairly trivial, but I
can't get it to work.

the cgi script is clean -- executes from the command line without issue
and is 755
from php the follwing is used:


chdir("../../cgibin");
if(is_executable("some.cgi"))
virtual("some.cgi");
else
echo "Not executable";



some.cgi is found and is executable but the following occurs when
attemping to execute via virtual():

Warning: Unable to include 'some.cgi' - request execution failed in
[path to php page]

Any help would be greatly appreciated,
clif



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




Re: [PHP] my bugaboo.

2001-02-11 Thread Floyd Baker



The problem seems to be solved.

Some suggestions didn't work, in my application at least, but what I found from
a combination of them was that I can eliminate the problem using a character
entity for the apostrophe.  It prints a single quote but does not parse as a
single quote.

 $text = (stripslashes($text));
 $text = ereg_replace("'","#39;",$text);

 It doesn't work in one shot (ie \' to `).

Further; I originally placed the apostrophes into the database field as they
were, without escaping them with slashes.  I have since added slashes.  However
converting ' to #39 may eliminate the need for add/strip slashes?  I have to
try that.  

Many tnx to Anne and all.  

Floyd



On Sat, 10 Feb 2001 18:36:36 -0600, you wrote:

- Original Message -
From: "Floyd Baker" [EMAIL PROTECTED]



 Hello and thanks to all for the help on the magic quotes, etc.
 It gives me a better handle on what I'm dealing with.

 Except for one more thing.

 When I bring back text from a field which contains a ', and try to apply
it as
 the value of an input box, it still truncates in the box.

 When I simply print $text, it prints out correctly as *Don't do this* .
 When I make $text the default value of an input box, it shows as *Don*.

 If the slash is still in place, it reads *Don\'t* above the box and *Don\*
in
 the box.

 My bugaboo continues..  :-

 Thanks again for any further advice.

 Floyd


That's  a problem with HTML.
example:
input type='text' name='textName' value='Don't do this'
Sees the ' in Don't as the signal for the end of the value string.
I haven't come up with an automatic way to deal with this,
but what I have done is in these lines (where there might be an apostrophe)
make sure I use double quotes:
input type="text" name="textName" value="Don't do this"
or
print "input type=\"text\" name=\"textName\" value=\"Don't do this\"";

Of course, then you may have the same trouble with double quotes. To avoid
that you can do ereg_replace("\"", "''", $text) -- that is, replace a double
quote with two single quotes? I think, I've never bothered.

Hope this helps somehow.

Anna

--


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




Re: [PHP] passthru environment variables

2001-02-11 Thread Rich Puchalsky

"Richard Lynch" [EMAIL PROTECTED] wrote:
 http://php.net/setenv

Thanks!  But when I try this link, or the "Quick Ref" button on the PHP home
page, I can't find anything about setenv.  And the manual doesn't have
anything about it under Program Execution Functions.  Is it undocumented?




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




[PHP] regex : Extracting parts of a string :-???

2001-02-11 Thread akio

Hello everyone,

 I have a string like

$thestring = "\"Hello everyone\" bye";

What I want to extract is: Hello everyone. Instead  I get: bye.
I use this command

ereg("([^\"\"]*)$",$thestring,$regs)

and echo $regs[1].

How can I extract what's within double quotes?


TIA

Regards



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




Re: [PHP] passthru environment variables

2001-02-11 Thread Rich Puchalsky


"Rich Puchalsky" [EMAIL PROTECTED] wrote in message
966dad$pkm$[EMAIL PROTECTED]">news:966dad$pkm$[EMAIL PROTECTED]...
 "Richard Lynch" [EMAIL PROTECTED] wrote:
  http://php.net/setenv

 Thanks!  But when I try this link, or the "Quick Ref" button on the PHP
home
 page, I can't find anything about setenv.  And the manual doesn't have
 anything about it under Program Execution Functions.  Is it undocumented?

And once I actaully tried it, I got an undefined function message.




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




Re: [PHP] regex : Extracting parts of a string :-???

2001-02-11 Thread Christian Reiniger

On Sunday 11 February 2001 17:21, akio wrote:

 $thestring = "\"Hello everyone\" bye";

 What I want to extract is: Hello everyone. Instead  I get: bye.
 I use this command

 ereg("([^\"\"]*)$",$thestring,$regs)

 and echo $regs[1].

 How can I extract what's within double quotes?

Hmm, I only know the preg syntax. With that it's

preg_match ('/"([^"]*?)"/', $thestring, $matches);

$InQuotes = $matches [1];

-- 
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

"use the source, luke." (obi-wan gnuobi)

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




[PHP] building binary data structures

2001-02-11 Thread Phil Driscoll

Having written loads of stuff in PHP, I find myself having for the first
time to generate binary data in memory - I actually need to build a native
file for a drawing program in memory. The data consists mainly of lists of
32bit little endian integers - some signed and some unsigned. I've started
the work, and am building the data up in a string variable. I know however
that I am about to get bitten by numeric overflows.

For example if I have a function create_thingy($param1,$param2) where param1
is an unsigned 32 bit int, and the top bit is set, then I suspect that php
will probably represent the number as floating point, and I'll probably lose
some precision.

Has anybody been here before and found a good mode of working in the
unsigned 32bit arena?

Cheers
--
Phil Driscoll
Dial Solutions
+44 (0)113 294 5112
http://www.dialsolutions.com
http://www.dtonline.org




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




[PHP] comparisons

2001-02-11 Thread Curtis Maurand

Hello,
  I'm having a rather strange problem.  I'm trying to compare two values.  "01" and 
"1".  The variables names that they are submitted under are pick1 and pick2.   i use 
the following code

$mypick1 = strval($pick1);
$mypick2 = strval($pick2);

I then perform the following comparison:

if ($mypick1 == $mypick2)
 {
   $error = 1;
   $errorstring[1] = "Your first pick and second pick are the same.";
 }

However, I get the error that they are equal.

If I call the comparison as foloows:

if(strval($mypick1) == strval($mypick2)
 {
   $error = 1;
   $errorstring[1] = "Your first pick and second pick are the same.";
 }

I still get the error.  Anyone have any ideas?  These two valuse mustbe evaluated as 
different.

Thanks in advance
Curtis



[PHP] checkbocks, arrays and more

2001-02-11 Thread Christian Dechery

PLease... I need some help from u gurus on this.

I have a table of gas stations (and a whole lot other tables, for stuff 
connected to them), and I have a table with 'assets' of each of these gas 
stations (or other stuff)... so I have to make a form so when inserting the 
user can select with of these assets it has, but also, he may add a comment 
to each of the assets, example:

my table of assets contains:

coke machine
vending machine
atm
dinner
public phone

and someone is inserting a gas station there... and it has two dinners and 
3 public phones, so he would check the checkboxes referring to these and 
add a little comment to show the number... right?

but how can I pass this to the next page so I can insert in the tables?
if I only had the checkboxes, it'd be easy like:

input type=checkbox name="assets[]" == for each of them... but how can I 
add the input type text next to each of the checkboxes and make them 
referrable?

. Christian Dechery (lemming)
. http://www.tanamesa.com.br
. Gaita-L Owner / Web Developer


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




[PHP] afraid !

2001-02-11 Thread php php

Hi!
i've just joined ur mailing list!
i used to work on asp with oracle and access!
i'm working on windont NT but i want to publish my site at a provider that 
has linux? do i have to change my code for that ?
do u know any provider that accepts acces and mysql with php4?
i'm afraid of using mysql with php cause i'm in hurry and that i discovered 
that mysql interface is not as good and easy as of oracle and access! is it 
true that if i want to insert data to a table i have to do it from the 
commend line?
Thanks   a lot
_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


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




Re: [PHP] afraid !

2001-02-11 Thread Christian Dechery

At 19:17 11/2/2001 +, you wrote:
Hi!
i've just joined ur mailing list!
i used to work on asp with oracle and access!
i'm working on windont NT but i want to publish my site at a provider that 
has linux? do i have to change my code for that ?
do u know any provider that accepts acces and mysql with php4?
i'm afraid of using mysql with php cause i'm in hurry and that i 
discovered that mysql interface is not as good and easy as of oracle and 
access! is it true that if i want to insert data to a table i have to do 
it from the commend line?

not really... there are many very nice Mysql clients avaliable... Mascon 
for once is very nice
and u can also put together or own PHP form to populate the tables... :)


. Christian Dechery (lemming)
. http://www.tanamesa.com.br
. Gaita-L Owner / Web Developer


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




Re: [PHP] comparisons

2001-02-11 Thread Phil Driscoll

In spite of yor best efforts here, PHP converts the string values to numbers (because 
the strings look like numbers) before doing the comparison.

Force a string comparison by using strcmp and everything will work fine - remember 
that strcmp returns true if the strings are not equal and false if equal.

Cheers 

 Reply Header 
Subject:[PHP] comparisons
Author: "Curtis Maurand" [EMAIL PROTECTED]
Date:Sun, 11 Feb 2001 18:47:31 +

Hello,
  I'm having a rather strange problem.  I'm trying to compare two values.  "01" and 
"1".  The variables names that they are submitted under are pick1 and pick2.   i use 
the following code

$mypick1 = strval($pick1);
$mypick2 = strval($pick2);

I then perform the following comparison:

if ($mypick1 == $mypick2)
 {
   $error = 1;
   $errorstring[1] = "Your first pick and second pick are the same.";
 }

However, I get the error that they are equal.

If I call the comparison as foloows:

if(strval($mypick1) == strval($mypick2)
 {
   $error = 1;
   $errorstring[1] = "Your first pick and second pick are the same.";
 }

I still get the error.  Anyone have any ideas?  These two valuse mustbe evaluated as 
different.

Thanks in advance
Curtis




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




Re: [PHP] afraid !

2001-02-11 Thread Carsten Gehling

From: "php php" [EMAIL PROTECTED]
Sent: Sunday, February 11, 2001 8:17 PM


 i'm afraid of using mysql with php cause i'm in hurry and that i
discovered
 that mysql interface is not as good and easy as of oracle and access! is
it
 true that if i want to insert data to a table i have to do it from the
 commend line?

Try to use the PhpMyAdmin - download it from http://www.phpwizard.com/

It is a very good MySql web client toolkit, that is built with PHP.

- Carsten




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




php-general Digest 11 Feb 2001 19:36:44 -0000 Issue 506

2001-02-11 Thread php-general-digest-help


php-general Digest 11 Feb 2001 19:36:44 - Issue 506

Topics (messages 39109 through 39136):

imagecolorallocate / imagesetpixel / palette size?
39109 by: Dan Harrington

Re: mod_rewrite starts driving me crazy ...
39110 by: Richard Lynch

Re: Parsing XML
39111 by: Richard Lynch

Re: newline processing problem?
39112 by: Richard Lynch

Re: passthru environment variables
39113 by: Richard Lynch
39126 by: Rich Puchalsky
39128 by: Rich Puchalsky

XML Parsing The Sequel II
39114 by: Steve Haemelinck
39120 by: Dave
39123 by: Steve Haemelinck

Code repositery
39115 by: Michel 'ZioBudda' Morelli
39119 by: Dave
39121 by: Dave

[newbie] Can I use regular expressions?
39116 by: zbynek
39117 by: Christian Reiniger
39118 by: PHPBeginner.com

Re: my bugaboo.
39122 by: PHPBeginner.com
39125 by: Floyd Baker

cgi execution w/php failing
39124 by: Clif Wieden

regex : Extracting parts of a string :-???
39127 by: akio
39129 by: Christian Reiniger

building binary data structures
39130 by: Phil Driscoll

comparisons
39131 by: Curtis Maurand
39135 by: Phil Driscoll

checkbocks, arrays and more
39132 by: Christian Dechery

afraid !
39133 by: php php
39134 by: Christian Dechery
39136 by: Carsten Gehling

Administrivia:

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

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

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


--



Here is something weird going on.  Why is it that imagecolorallocate dies
after 256 colors have been allocated?  Note, this doesn't matter if
you write a jpg or png, it all produces the same result (see attached
graphic).

Yes, the colors are randomly made, and they all go in a straight, diagonal
line (315 degrees to be precise), and on the 256'th pixel
(I HAVE COUNTED EVERY PIXEL TO MAKE SURE)
it gets stuck on the last color and then continues painting pixels at that
last color until the end of the line.

I've tried to use imagecolordeallocate right after the pixel is drawn,
but that only makes all the pixels come out in one color (white).

Its like the "palette" only holds 256 pixels or something, what's
the deal with that?

Anyone experienced this before?  I've looked through the GD library
documentation
at boutell.com, i've looked through php.net, and every search engine on the
internet, and I can't seem to find out what is going on.

Thanks
Dan

==
?
$im = imagecreate(400,400);

//sets background to black
imagecolorallocate($im,0,0,0);

$x=0;
$y=0;

while ($x =400 ){
$color=imagecolorallocate($im,rand(0,255),rand(0,255),rand(0,255));
imagesetpixel($im,$x,$y,$color);
++$x;
++$y;
}

header("Content-type: image/png");
Imagepng($im);
ImageDestroy($im);
?




 This works perfectly, however what I really need to do is to make it work
 not only with /index.html but with everything typed in your browser...
 (index.html was only a test to let me know I am in a right direction)

 I tried:

 RewriteRule   ^(.*)  /start.php?go=$1
 RewriteRule   ^(.*)$  /start.php?go=$1
 RewriteRule   ^(.+)  /start.php?go=$1
 RewriteRule   ^(.+)$  /start.php?go=$1

 RewriteRule   ^(/.*)  /start.php?go=$1
 RewriteRule   ^(/.*)$  /start.php?go=$1
 RewriteRule   ^(/.+)  /start.php?go=$1
 RewriteRule   ^(/.+)$  /start.php?go=$1

Having just spent about 16 hours fighting with mod_rewrite to try and
replace broken DefaultType on FreeBSD, I feel your pain :-)

My thinking in this case is:  It really doesn't make sense to have either ^
or $ here, since you really don't care what you start or end with.  So, you
probably just want:

RewriteRule (.*) /start.php?go=$1

Except, of course, that will be an infinite loop, since that matches
start.php?go=index.html as well.

So, what I think you *really* want is:

RewriteRule ^/start\.php.* - [L]
RewriteRule (.*) /start.php?go=$1

Translation:
#1  If we are surfing to "/start.php?blahblahblah", then use the URL as-is
"-" and stop playing these silly rewrite games "[L]"
#2 Any URL that reaches this rule, wasn't one of our start.php hacks, so
redirect to start.php

You may need or want a [R] on the end of that second rule...

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm






 I want to parse an XML from nasdaq, but I allways get a blank page when
 doing so.

You're gonna have to provide more info than that...

 I also get the notice: undefined index when parsing.  What does this mean?

If error_reporting is set to include E_NOTICE, and if you attempt to access
an array element that has never been set (or has been 

Re: [PHP-CVS] cvs: php3 / php3.ini-dist

2001-02-11 Thread Jim Winstead

magic_quotes_gpc always default to off in in php3, at least as far
as i've looked. the switch was added to configure.in in october 1997.

http://cvs.php.net/viewcvs.cgi/php3/configure.in.diff?r1=1.77r2=1.78

php4 does have a different default, it was changed very early
in the php4 cycle.

http://cvs.php.net/viewcvs.cgi/php4/main/main.c.diff?r1=1.3r2=1.4

it looks to me like the --enable-magic-quotes option to configure
is ignored by php4, too. it should probably be removed or fixed.

but i could easily be misreading things. someone could actually
test if they were eager to figure it out. :)

jim

On Sun, Feb 11, 2001 at 01:32:58AM -0800, Rasmus Lerdorf wrote:
 Hrm..  When was this changed in PHP 3?  It used to be on by default.  And
 it is on by default in PHP 4.
 
 -Rasmus
 
 On Sat, 10 Feb 2001, Jim Winstead wrote:
 
  jimwSat Feb 10 11:43:58 2001 EDT
 
Modified files:
  /php3   php3.ini-dist
Log:
we claim php3.ini documents the defaults, but magic_quotes_gpc defaults to off 
unless --enable-magic-quotes is used in compiling
 
  Index: php3/php3.ini-dist
  diff -u php3/php3.ini-dist:1.57 php3/php3.ini-dist:1.58
  --- php3/php3.ini-dist:1.57 Wed Feb 23 14:57:21 2000
  +++ php3/php3.ini-dist  Sat Feb 10 11:43:58 2001
  @@ -110,7 +110,7 @@
   ;
   ; Data Handling ;
   ;
  -magic_quotes_gpc   =   On  ; magic quotes for incoming 
GET/POST/Cookie data
  +magic_quotes_gpc   =   Off ; magic quotes for incoming 
GET/POST/Cookie data
   magic_quotes_runtime=  Off ; magic quotes for runtime-generated 
data, e.g. data from SQL, from exec(), etc.
   magic_quotes_sybase=   Off ; Use Sybase-style magic 
quotes (escape ' with '' instead of \')
   track_vars =   On  ; enable $HTTP_GET_VARS[], 
$HTTP_POST_VARS[] and $HTTP_COOKIE_VARS[] arrays

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




Re: [PHP] afraid !

2001-02-11 Thread Joe Stump

Heaven forbid you use a command line. I wouldn't trade my *NIX prompt for 
anything. Once you learn it you're set. MySQL's prompt is much like Oracle's
prompt and we all know Access has NO business anywhere near "enterprise" 
software.

I'd recommend learning the command prompt (which an hour's read on linuxdoc.org
can fix). If you decide to move to PHPMyAdmin (ack!) I'd be willing to bet you
move right back to the power of the prompt.

My $0.02

--Joe aka "Lover of the Prompt"



On Sun, Feb 11, 2001 at 07:17:50PM -, php php wrote:
 Hi!
 i've just joined ur mailing list!
 i used to work on asp with oracle and access!
 i'm working on windont NT but i want to publish my site at a provider that 
 has linux? do i have to change my code for that ?
 do u know any provider that accepts acces and mysql with php4?
 i'm afraid of using mysql with php cause i'm in hurry and that i discovered 
 that mysql interface is not as good and easy as of oracle and access! is it 
 true that if i want to insert data to a table i have to do it from the 
 commend line?
 Thanks   a lot
 _
 Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 

---
Joe Stump, PHP Hacker, [EMAIL PROTECTED] -o)
http://www.miester.org http://www.care2.com /\\
"It's not enough to succeed. Everyone else must fail" -- Larry Ellison _\_V
---


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




[PHP] Search replace text

2001-02-11 Thread CDitty

Hello all.  I am trying to search through a text file on my server to 
replace the user email.  I can open the file and read it, but cannot get it 
to "find" the actual string and replace it.  Can someone look over my code 
and see what the problem is?  I am afraid that ereg is not my strongest 
point.

Also, at what point should I start writing the file out?  Wouldn't there be 
a permissions error if I was reading and writing at the same time?

Thanks
CDitty


$oldemail = "[EMAIL PROTECTED]";
$newemail = "[EMAIL PROTECTED]";
$user = "cditty";
$file = fopen("/path/to/the/user/file/$user.dat", "r");
if(!$file){
 echo "pUnable to open remote file.\n";
 exit;
}else{
 echo "Successbr";
}
while (!feof($file)) {
 $line = fgets($file, 255);
 if(eregi($oldemail, $line, $out)) {
 str_replace($oldemail, $newemail, $line);
 }

echo $line . "BR";
}
fclose($file)


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




Re: [PHP] comparisons

2001-02-11 Thread Curtis Maurand

That was the solution.  It worked like a charm.

$cmpresult = strcmp($pick1,$pick2);
 if $cmpresult == 0)
  {
my code;
  }

Can I also write that like the following?

if (strcmp($pick1,$pick2) == 0)
 {
   perform some action;
 }

Will that work?

Curtis


- Original Message -
From: "Phil Driscoll" [EMAIL PROTECTED]
To: "Curtis Maurand" [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Sunday, February 11, 2001 2:34 PM
Subject: Re: [PHP] comparisons


 In spite of yor best efforts here, PHP converts the string values to
numbers (because the strings look like numbers) before doing the comparison.

 Force a string comparison by using strcmp and everything will work fine -
remember that strcmp returns true if the strings are not equal and false if
equal.

 Cheers

  Reply Header 
 Subject: [PHP] comparisons
 Author: "Curtis Maurand" [EMAIL PROTECTED]
 Date: Sun, 11 Feb 2001 18:47:31 +

 Hello,
   I'm having a rather strange problem.  I'm trying to compare two values.
"01" and "1".  The variables names that they are submitted under are pick1
and pick2.   i use the following code

 $mypick1 = strval($pick1);
 $mypick2 = strval($pick2);

 I then perform the following comparison:

 if ($mypick1 == $mypick2)
  {
$error = 1;
$errorstring[1] = "Your first pick and second pick are the same.";
  }

 However, I get the error that they are equal.

 If I call the comparison as foloows:

 if(strval($mypick1) == strval($mypick2)
  {
$error = 1;
$errorstring[1] = "Your first pick and second pick are the same.";
  }

 I still get the error.  Anyone have any ideas?  These two valuse mustbe
evaluated as different.

 Thanks in advance
 Curtis





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




[PHP] gambling goes MLM

2001-02-11 Thread w334nnlsfd3d


Fortunes are being made online everyday! Now is your chance to become involved with 
one of the most explosive Internet industries...Internet Gaming!
But wait there is much more...LIVE Webcast Lotto and Bingo, International Sports 
Betting, and Virtual Stock Trading.
We are PLAYING GAMES, HAVING FUN AND MAKING MONEY!
How are we making money? We do it with the most RED HOT compensation plan ever seen in 
the industry...our NO-FLUSH Binary with incredible matching bonuses.Anyone can do 
this! You could be earning everytime someone you introduce plays a game.

This is a Worldwide opportunity and it is EXPLOSIVE!

Check it out at: http://frdrt.pokeadot.com



To be removed send an email to: [EMAIL PROTECTED]


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




[PHP] jpeg parsing

2001-02-11 Thread Chinatown

Hello. I'll keep short. Does any of you guys out there know why 
"imagecreatefromjpeg" cannot open remote files ? I have php-4.0.4pl1-Win32 with 
default gd lib. All other gd-things work fine, and I DO have the access rights to the 
file.

"thank you for your cooperation" :)
CT



[PHP] oops - wrong! (was: how to alter assoc_array?)

2001-02-11 Thread Jaxon

Okay, I don't have it :)

This should be recreating a 3 row array of key:value pairs with a "~"
character prepended to each key, but is only echoing _one_ key:value pair -
anyone see why?

while($array = mysql_fetch_array($result, MYSQL_ASSOC))
{
  list($key, $value) = each($array);
  $key_prep="~$key";
  $new_array=array("$key_prep = $value");

  echo $key_prep;
  echo " assigned to ";
  echo $value; 
}

outputs:

~boy assigned to hello

where are my other two rows?  :)

regards,
jaxon


 If $array contains the following:
 
 boy = hello
 girl = hi
 dog = bark
 
 How can I alter all the elements the same way?
 
 e.g. so that it now conatins:
 
 Xboy = Xhello
 Xgirl = Xhi
 Xdog = Xbark
 
 thanks!
 jaxon
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]
 To contact the list administrators, e-mail:
 [EMAIL PROTECTED]
 
 
 __
 Do You Yahoo!?
 Get personalized email addresses from Yahoo! Mail - only $35
 a year!  http://personal.mail.yahoo.com/
 


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




[PHP] mysql auto-increment

2001-02-11 Thread Christian Dechery

does mysql auto_increment always has to be 1 by 1, can't I set it to go 10 
by 10, or something like that?

and is there a way I can tell him to START (the first record) with a number 
or do I have to put a bogus record or even alter it's value so the next 
insertion is incremented from that...

. Christian Dechery (lemming)
. http://www.tanamesa.com.br
. Gaita-L Owner / Web Developer


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




[PHP-CVS] cvs: CVSROOT / avail cvsusers gen_acl_file.m4

2001-02-11 Thread Rasmus Lerdorf

rasmus  Sun Feb 11 12:50:36 2001 EDT

  Modified files:  
/CVSROOTavail cvsusers gen_acl_file.m4 
  Log:
  CVS account for David Guerizec
  
  
Index: CVSROOT/avail
diff -u CVSROOT/avail:1.81 CVSROOT/avail:1.82
--- CVSROOT/avail:1.81  Sun Feb 11 05:31:20 2001
+++ CVSROOT/avail   Sun Feb 11 12:50:35 2001
@@ -9,7 +9,7 @@
 
avail|jalal,zak,andre,ultrapingo,lyric,jmoore,ronabop,sbergmann,joey,sniper,torben,hellekin,cnewbill|qaweb
 
avail|andi,andrei,jimw,rasmus,rubys,sas,ssb,thies,zeev,shane,fmk,hirokawa,jah,eschmid,dbeu,sbergmann,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,sniper,changelog,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,shuric,svanegmond,rjs,vlad,jimjag,emile,php_ext,chad,torben,lynch,kk,ted,kwazy,aka,affinity,paul,skaag,pglat,mbritton,coar,lwest,joey,bibi,mrobinso,lwh,perugini,hamoralesr,tzwenny,hirokawa,drews,paulsen,hartmann,philross,leon,valdirh,dmarion,dubois,jonen,tschuer,tfromm,manuel,stas,danbeck,sli,jmcastagnetto,mohrt,cris,goba,samesch,jon,soneca,kaufm,ronabop,glace,latoserver,phpguru_dk,lojmann,rafael,jan,jcmeloni,chrullrich,mk,sbergmann,troels,mathieu,voize,phaethon,mgx,mj,corean,pandach,brown,cycle98,vizvil,openlife,regina,cynic,jpm,dams,alponce,menuconfig,obst,topgoods,karoora,pcraft,suvia,zak,zimt,mgx,sintoris,jmoore,ftfuture,uttam,ag315,ropik,jbi1979,bbonev,malo,afortaleza,neotron,cg,delrom,dickmeiss,jkj,hellekin,kgergely,andreroq,eduardh,cnewbill,fuzzy74,inki,bjoern|phpdoc
 avail|andrei|php-gtk
-avail|emile|php4/ext/midgard
+avail|emile,mgddavid|php4/ext/midgard
 avail|rasmus|php4/ext/aspell
 avail|andi|php4/ext/bcmath
 avail|NOBODY|php4/ext/calendar
Index: CVSROOT/cvsusers
diff -u CVSROOT/cvsusers:1.210 CVSROOT/cvsusers:1.211
--- CVSROOT/cvsusers:1.210  Sun Feb 11 01:43:27 2001
+++ CVSROOT/cvsusersSun Feb 11 12:50:35 2001
@@ -257,3 +257,4 @@
 inki  Ingmar Heinrich [EMAIL PROTECTED]  German 
translation
 bjoernBjoern Schotte  [EMAIL PROTECTED] PEAR
 emile Emiliano Heyns  [EMAIL PROTECTED]   Midgard
+mgddavid  David Guerizec  [EMAIL PROTECTED]  Midgard
Index: CVSROOT/gen_acl_file.m4
diff -u CVSROOT/gen_acl_file.m4:1.84 CVSROOT/gen_acl_file.m4:1.85
--- CVSROOT/gen_acl_file.m4:1.84Sun Feb 11 05:31:20 2001
+++ CVSROOT/gen_acl_file.m4 Sun Feb 11 12:50:35 2001
@@ -13,7 +13,7 @@
 dnl
 define(`php_pres', `rasmus,sterling,jimw')dnl
 dnl
-define(`php_midgard', `emile')dnl
+define(`php_midgard', `emile,mgddavid')dnl
 dnl
 unavail
 avail|php_group|CVSROOT



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




[PHP] A way to duplicate data across databases

2001-02-11 Thread Carsten Gehling

I'm making a script that generates test sites usng dummy data stored in one
MySql database ("uwebsitebase")

Now, using php-scripting, I'm copying these data to a demo-database
("uwebdemo"). The structure is the same - the same tables with the same
fields. Only difference will be that the copied data should get new primary
keys which are auto-incremented. No problem there.

However, the process is tedious. I have tables that contains some 30 fields
and it's just a bore selecting all fields from one table, and then writing a
complete insert statement with all the fields except the PK.

Is there an easier way? Remember 1) It's PHP 2) It's across databases.

I have to script it, since I need the new keys on other places.

- Carsten



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




Re: [PHP] oops - wrong! (was: how to alter assoc_array?)

2001-02-11 Thread Jaxon

ack. 
ignore me. 
not enough coffee.


the 'while' was in the wrong place.
also dropped the array() in favor of array_name[] to ensure I keep it
associative.

$array = mysql_fetch_array($result, MYSQL_ASSOC);

while (list ($key,$value) = each($array))
   {
  $key ="~" . $key;
  $tagged_array[$key] = $value;
   }


thanks!
jaxon


On 2/11/01 4:10 PM, "Jaxon" [EMAIL PROTECTED] wrote:

Okay, I don't have it :)

This should be recreating a 3 row array of key:value pairs with a "~"
character prepended to each key, but is only echoing _one_ key:value pair -
anyone see why?

while($array = mysql_fetch_array($result, MYSQL_ASSOC))
{
  list($key, $value) = each($array);
  $key_prep="~$key";
  $new_array=array("$key_prep = $value");

  echo $key_prep;
  echo " assigned to ";
  echo $value;
}


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




[PHP] First connection?

2001-02-11 Thread Info

Hi,

Fifteen years ago I did lots of Informix SQL on Unix -- including transaction 
processing -- BUT I find there isn't a lot of immediate help from that experience -- I 
tried using some webmonkey examples as "basic training" for php with MySQL and got 
nowhere.

I'm on Red Hat with Apache 1.3.9, PHP 4.02 and MySQL 3.22.32

Is there a good place to find typical PHP and MySQL code examples for that 
configuration?

My pages are "virtual" hosted and I have access to phpMyAdmin 2.0.5 which is a menu 
access by my ISP.

My php.ini is at /usr/local/lib

I've built a very small database of five fields in database "eprofitsys" in table 
"employees" and would like to connect to it within a .php file.  So, obviously, I am 
at ground zero.  Anyone want to lift me up.

Lonnie


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




[PHP-CVS] cvs: php4 /pear CMD.php

2001-02-11 Thread Anders Johannsen

aj  Sun Feb 11 13:39:13 2001 EDT

  Added files: 
/php4/pear  CMD.php 
  Log:
  The Cmd:: class implements an abstraction for various ways 
  of executing commands (directly using the backtick operator,
  as a background task after the script has terminated using
  register_shutdown_function() or as a detached process using nohup).
  
  

Index: php4/pear/CMD.php
+++ php4/pear/CMD.php
?php
//
// +--+
// | PHP version 4.0  |
// +--+
// | Copyright (c) 1997-2001 The PHP Group|
// +--+
// | This source file is subject to version 2.02 of the PHP license,  |
// | that is bundled with this package in the file LICENSE, and is|
// | available at through the world-wide-web at   |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to   |
// | obtain it through the world-wide-web, please send a note to  |
// | [EMAIL PROTECTED] so we can mail you a copy immediately.   |
// +--+
// | Authors: Anders Johannsen [EMAIL PROTECTED]  
   |
// |  |
// +--+
//
define('CMD_RCSID', '$Id: CMD.php,v 1.1 2001/02/11 21:39:13 aj Exp $');

/**
 * The Cmd:: class implements an abstraction for various ways 
 * of executing commands (directly using the backtick operator,
 * as a background task after the script has terminated using
 * register_shutdown_function() or as a detached process using nohup).
 *
 * @author  Anders Johannsen [EMAIL PROTECTED]
 * @version $Revision: 1.1 $
 **/

require_once 'PEAR.php';


class Cmd extends PEAR
{
var $arrSetting = array();
var $arrConstant= array();
var $arrCommand = array();

/**
 * Class constructor
 * 
 * Defines all necessary constants and sets defaults
 * 
 * @author Anders Johannsen [EMAIL PROTECTED]
 *
 * @access public
 * 
 **/

function Cmd ()
{
// Defining constants
$this-arrConstant  = array ("CMD_SEQUENCE",
 
"CMD_SHUTDOWN",
 "CMD_SHELL",
 "CMD_OUTPUT",
 "CMD_NOHUP",
 "CMD_VERBOSE"
 );

foreach ($this-arrConstant as $key = $value) {
if (!defined($value)) {
define($value, $key);
}
}

// Setting default values
$this-arrSetting[CMD_SEQUENCE] = true; 
$this-arrSetting[CMD_SHUTDOWN] = false; 
$this-arrSetting[CMD_OUTPUT]   = false; 
$this-arrSetting[CMD_NOHUP]= false; 
$this-arrSetting[CMD_VERBOSE]  = false; 

$arrShell = array ("sh", "bash", "zsh", "tcsh", "csh", "ash", "sash", 
"esh", "ksh");
   
foreach ($arrShell as $shell) {
if ($this-arrSetting[CMD_SHELL] = $this-which($shell)) {
break;
} 
}

if (empty($this-arrSetting[CMD_SHELL])) {
$this-raiseError("No shell found");
}
}

/**
 * Sets any option
 * 
 * The options are currently:
 * CMD_SHUTDOWN : Execute commands via a shutdown function 
 * CMD_SHELL: Path to shell
 * CMD_OUTPUT   : Output stdout from process
 * CMD_NOHUP: Use nohup to detach process
 * CMD_VERBOSE  : Print errors to stdout
 *
 * @param $option is a constant, which corresponds to the
 * option that should be changed
 *
 * @param $setting is the value of the option currently
 * being toggled.
 *
 * @return bool true if succes, else false
 *
 * @access public
 * 
 * @author Anders 

Re: [PHP] First connection?

2001-02-11 Thread Jaxon

Lonnie,

Try something like this:

create a file called db_connection_params.inc - I do this maintainability :)

(change to match your specifics)

?
$host="localhost";
$usr="username";
$pass="password";
$database="database_name";
?

Here is a sample page with connection/query:

?

$sql = "SELECT * from table WHERE field = something";

include("db_connect_params.inc");
$link_id = mysql_connect($host, $usr, $pass); //setup a connection handle

mysql_select_db($database, $link_id); //select database catalog (schema,
namespace, etc)

$result = mysql_query($sql, $link_id); //return result set to php

echo $result;

?


There are lot's of different ways to do this, check out the mysql functions:
http://www.php.net/manual/en/ref.mysql.php

HTH!

regards,
jaxon

On 2/11/01 4:40 PM, "Info" [EMAIL PROTECTED] wrote:

 Hi,
 
 Fifteen years ago I did lots of Informix SQL on Unix -- including transaction
 processing -- BUT I find there isn't a lot of immediate help from that
 experience -- I tried using some webmonkey examples as "basic training" for
 php with MySQL and got nowhere.
 
 I'm on Red Hat with Apache 1.3.9, PHP 4.02 and MySQL 3.22.32
 
 Is there a good place to find typical PHP and MySQL code examples for that
 configuration?
 
 My pages are "virtual" hosted and I have access to phpMyAdmin 2.0.5 which is a
 menu access by my ISP.
 
 My php.ini is at /usr/local/lib
 
 I've built a very small database of five fields in database "eprofitsys" in
 table "employees" and would like to connect to it within a .php file.  So,
 obviously, I am at ground zero.  Anyone want to lift me up.
 
 Lonnie
 


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




Re: Re: [PHP] comparisons

2001-02-11 Thread Phil Driscoll

Can I also write that like the following?

if (strcmp($pick1,$pick2) == 0)
 {
   perform some action;
 }

that will work, but I prefer
Can I also write that like the following?

if (!strcmp($pick1,$pick2))
 {
   perform some action;
 }
Cheers

Phil


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




[PHP] Building php4.0.4pl1 with mysql 3.23.32

2001-02-11 Thread Scott Brown

I've got a real weird problem happening after building 4.0.4pl1 and mysql
3.23.32 on my test machine.   I previously had 4.0.1 up and running with an
earlier version of mysql - I think it was 3.22.xx - and this combination
worked fine.

I *seem* to successfully connect to my mysql database... it's not returning
any error but it's not returning any data either.

PHP was configed with:

./configure' '--with-apache=/root/Apachetoolbox/apache_1.3.17'
'--enable-exif' '--enable-memory-limit=yes' '--enable-track-vars'
'--with-calendar=shared' '--enable-safe-mode' '--enable-magic-quotes'
'--enable-trans-sid' '--enable-sysvsem' '--enable-sysvshm' '--enable-wddx'
'--enable-yp' '--enable-sockets' '--with-gd=/usr/local'
'--enable-gd-imgstrttf' '--with-mysql' '--with-mysql' '--with-pgsql'
'--with-ldap'

And compiled and installed fine into 1.3.17 (as far as I could see)but
I'm not getting any results out of it.

I can force an error on the connect to the database by supplying a bad
userid - so it must be talking to mysqld fine...  but I get no data out of
it, and no errors.

Here's an example of the code which is accessing the database - the database
open is handled by a separate function:

function ThePrice($prodid,$typ)
{
$inqSQL="select * from pricing where ProdCode ='" . $prodid . "' and
Price_effDate='".date("Y m d")."' order by price_effdate desc";
echo "!-- " . $inqSQL . " --\n";
$result = mysql_db_query("thedbname",$inqSQL);
if (!$result) {
echo mysql_error();
exit;
}
$rtnvalue = "!?";

if ($row = mysql_fetch_array($result)) {
if ($typ=="S")
$rtnvalue = $row["ProdSetup"];
else
$rtnvalue = $row["ProdMonthly"];
}

mysql_free_result($result);
echo "!-- product: $prodid Type: $typ Price: $rtnvalue .  --\n";
return($rtnvalue);
}

$rtnvalue shows up as the default value !?.  Sometimes.  Sometimes they show
up blank.  It's almost like the script is dying, but not telling me it's
dying.

The database fields are setup like this:

mysql describe pricing;
+---+--+--+-+++
| Field | Type | Null | Key | Default| Extra  |
+---+--+--+-+++
| ID| int(11)  |  | PRI | NULL   | auto_increment |
| ProdCode  | varchar(50)  |  | |||
| Price_effdate | date |  | | -00-00 ||
| ProdSetup | double(16,4) |  | | 0. ||
| ProdMonthly   | double(16,4) |  | | 0. ||
+---+--+--+-+++
5 rows in set (0.00 sec)

So the field names do match... and mysql will return values when I select
the rows from it directly.

Does anyone have any suggestions???  As near as I can tell mysql_fetch_array
is failing - but there is a return result otherwise I'd be getting an error
message out of this routine...

I'm really confused here.

Is my build bad?  Or is this 4.0.4pl1 version a little different?



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




[PHP] open_basedir error message.

2001-02-11 Thread Floyd Baker


Hello.  

I need an explanation of this error message please.

This is the entire result of my upload of a jpg to a blob and I get the
open_basedir error on straight uploads also.  Although they do get uploaded.

On this one I started from scratch with some 5 star directions and still flunk
out.  :- 

==
Warning: open_basedir restriction in effect. File is in wrong directory. in
/usr/local/plesk/apache/vhosts/webpay.com/httpdocs/php/pic2blob/do_insert.php3
on line 10

Warning: fopen("/tmp/phpfbQ1wb","r") - Invalid argument in
/usr/local/plesk/apache/vhosts/webpay.com/httpdocs/php/pic2blob/do_insert.php3
on line 10

Warning: Unable to find file identifier 0 in
/usr/local/plesk/apache/vhosts/webpay.com/httpdocs/php/pic2blob/do_insert.php3
on line 10

Success!
You have inserted the following into your database:
tn_999.jpg, a 2937 byte file with a mime type of image/pjpeg.
==

Here is the offending line 10.

$binary_junk = addslashes(fread(fopen($img1, "r"), filesize($img1)));

Can someone tell me what's going on here.  I don't seem to have a problem in
fact, but there are enough messages that say I do.  

Thanks.

Floyd



--


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




RE: [PHP] To The Hacker: CodeBoy

2001-02-11 Thread Jason Murray

 Furthermore, below you stated I posted a URL. That URL was 
 to a geocities.com site.  That site has nothing to do with 
 PHP and has nothing to do with my local computer.  In fact, 
 that geocities.com site only showed screenshots of what I 
 had been working on.  Obviously, it must have sparked your 
 interest because you went to work on finding out my IP 
 Address so that you could break into my system.

One would probably guess the URL of the site you were
working on was in the screenshots. You don't need to
"find" an IP address at that point.

Furthermore, Jonathan stated that he didn't "break into" your
system - you left phpMyAdmin *wide* open, which is frankly
asking for trouble. Imagine how much fun you'd have had if
someone with *malicious* intent had found it.

And lastly ... if he was *really* going to do anything, would 
he really be so stupid as to leave his commonly-known pseudonym, 
which can be (as you proved) easily traced back to himself?

I think this whole issue has been blown out of proportion enough 
on the list now, and as it's no longer a PHP-related discussion
I suggest you move it to private mail.

And, try some valium for loss of sleep. :)

Jason

-- 
Jason Murray
[EMAIL PROTECTED]
Web Design Team, Melbourne IT
Fetch the comfy chair!

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




Re: [PHP] Search replace text

2001-02-11 Thread David Robley

On Mon, 12 Feb 2001 06:41, CDitty wrote:
 Hello all.  I am trying to search through a text file on my server to
 replace the user email.  I can open the file and read it, but cannot
 get it to "find" the actual string and replace it.  Can someone look
 over my code and see what the problem is?  I am afraid that ereg is not
 my strongest point.

 Also, at what point should I start writing the file out?  Wouldn't
 there be a permissions error if I was reading and writing at the same
 time?

 Thanks
 CDitty


 $oldemail = "[EMAIL PROTECTED]";
 $newemail = "[EMAIL PROTECTED]";
 $user = "cditty";
 $file = fopen("/path/to/the/user/file/$user.dat", "r");
 if(!$file){
  echo "pUnable to open remote file.\n";
  exit;
 }else{
  echo "Successbr";
 }
 while (!feof($file)) {
  $line = fgets($file, 255);
  if(eregi($oldemail, $line, $out)) {
  str_replace($oldemail, $newemail, $line);

You need to assign the output of this function to a string:
   $new_line = str_replace($oldemail, $newemail, $line);

  }

 echo $line . "BR";

and then

echo $new_line . 'BR;

 }
 fclose($file)

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

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




[PHP-CVS] cvs: php4 /pear CMD.php

2001-02-11 Thread Anders Johannsen

aj  Sun Feb 11 16:38:28 2001 EDT

  Modified files:  
/php4/pear  CMD.php 
  Log:
  Fixed indentation problems related to use of TAB instead of spaces
  
  

Index: php4/pear/CMD.php
diff -u php4/pear/CMD.php:1.1 php4/pear/CMD.php:1.2
--- php4/pear/CMD.php:1.1   Sun Feb 11 13:39:13 2001
+++ php4/pear/CMD.php   Sun Feb 11 16:38:28 2001
@@ -13,11 +13,11 @@
 // | obtain it through the world-wide-web, please send a note to  |
 // | [EMAIL PROTECTED] so we can mail you a copy immediately.   |
 // +--+
-// | Authors: Anders Johannsen [EMAIL PROTECTED] 
   |
+// | Authors: Anders Johannsen [EMAIL PROTECTED] |
 // |  |
 // +--+
 //
-define('CMD_RCSID', '$Id: CMD.php,v 1.1 2001/02/11 21:39:13 aj Exp $');
+define('CMD_RCSID', '$Id: CMD.php,v 1.2 2001/02/12 00:38:28 aj Exp $');
 
 /**
  * The Cmd:: class implements an abstraction for various ways 
@@ -26,7 +26,7 @@
  * register_shutdown_function() or as a detached process using nohup).
  *
  * @author  Anders Johannsen [EMAIL PROTECTED]
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
  **/
 
 require_once 'PEAR.php';
@@ -34,67 +34,67 @@
 
 class Cmd extends PEAR
 {
-var $arrSetting= array();
-var $arrConstant   = array();
-var $arrCommand= array();
-   
+var $arrSetting = array();
+var $arrConstant= array();
+var $arrCommand = array();
+
 /**
  * Class constructor
  * 
  * Defines all necessary constants and sets defaults
  * 
  * @author Anders Johannsen [EMAIL PROTECTED]
-*
+ *
  * @access public
  * 
  **/
-   
+
 function Cmd ()
 {
-   // Defining constants
-   $this-arrConstant  = array ("CMD_SEQUENCE",
-
"CMD_SHUTDOWN",
-"CMD_SHELL",
-"CMD_OUTPUT",
-"CMD_NOHUP",
-"CMD_VERBOSE"
-);
-   
-   foreach ($this-arrConstant as $key = $value) {
-   if (!defined($value)) {
-   define($value, $key);
-   }
-   }
-   
-   // Setting default values
-   $this-arrSetting[CMD_SEQUENCE] = true; 
-   $this-arrSetting[CMD_SHUTDOWN] = false; 
-   $this-arrSetting[CMD_OUTPUT]   = false; 
-   $this-arrSetting[CMD_NOHUP]= false; 
-   $this-arrSetting[CMD_VERBOSE]  = false; 
-   
-   $arrShell = array ("sh", "bash", "zsh", "tcsh", "csh", "ash", "sash", 
"esh", "ksh");
-  
-   foreach ($arrShell as $shell) {
-   if ($this-arrSetting[CMD_SHELL] = $this-which($shell)) {
-   break;
-   } 
-   }
-   
-   if (empty($this-arrSetting[CMD_SHELL])) {
-   $this-raiseError("No shell found");
-   }
+// Defining constants
+$this-arrConstant  = array ("CMD_SEQUENCE",
+ "CMD_SHUTDOWN",
+ "CMD_SHELL",
+ "CMD_OUTPUT",
+ "CMD_NOHUP",
+ "CMD_VERBOSE"
+ );
+
+foreach ($this-arrConstant as $key = $value) {
+if (!defined($value)) {
+define($value, $key);
+}
+}
+
+// Setting default values
+$this-arrSetting[CMD_SEQUENCE] = true; 
+$this-arrSetting[CMD_SHUTDOWN] = false; 
+$this-arrSetting[CMD_OUTPUT]   = false; 
+$this-arrSetting[CMD_NOHUP]= false; 
+$this-arrSetting[CMD_VERBOSE]  = false; 
+
+$arrShell = array ("sh", "bash", "zsh", "tcsh", "csh", "ash", "sash", "esh", 
+"ksh");
+   
+foreach ($arrShell as $shell) {
+if ($this-arrSetting[CMD_SHELL] = $this-which($shell)) {
+break;
+} 
+}
+
+   

Re: Re: [PHP] comparisons

2001-02-11 Thread Curtis Maurand



 that will work, but I prefer
 Can I also write that like the following?
 
 if (!strcmp($pick1,$pick2))
  {
perform some action;
  }

Thanks.  That works for me.  

Curtis


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




Re: [PHP] transactions

2001-02-11 Thread Curtis Maurand

look at the syntax for locking the tables.

Curtis
- Original Message -
From: "Christian Dechery" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, February 11, 2001 7:14 PM
Subject: [PHP] transactions


 Hi,

 I was reading mysql's manual, about transactions and all... and I didn't
 find what they said about 'atomic operations' being as safe as
transactions.
 I couldn't figure out HOW to update 5 tables at a time ENSURING that ALL
 will be update or NONE. How can this be done without transactions? With
 code? I don't think so...

 can anyone clear my mind here...
 I have this problem... I need to update 4 tables at once, and if something
 goes wrong I have to UNDO everything
 
 . Christian Dechery (lemming)
 . http://www.tanamesa.com.br
 . Gaita-L Owner / Web Developer


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



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




[PHP] change password in NIS using PHP

2001-02-11 Thread karu

Hi ,

Does anyone know how to change user password in NIS using PHP?
Any help is appreciated.

Pls mail to my e-mail address.
Many thanks in advance.

Thanks and regards,
Karu



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




[PHP] wide open

2001-02-11 Thread Dan Harrington


 Furthermore, Jonathan stated that he didn't "break into" your
 system - you left phpMyAdmin *wide* open, which is frankly
 asking for trouble. Imagine how much fun you'd have had if
 someone with *malicious* intent had found it.

--in the physical world, if a door is left unlocked, even ajar a couple
inches, the physical act of pushing the door open so that one can enter
the door is defined as "breaking and entering".

"Harmlessly" pushing an unlocked door open, and walking in and writing on
a whiteboard "Gangstaboy was here" is just as much of a crime as
unauthorizedly logging into a machine, no matter how "wide open" it is,
even if "harm" is not done.

I don't do this to point fingers, I speak this on the part of someone
whose good friend got nabbed by police for "harmless" activity on the
internet -- and as a result spent time in the slammer.

take note

Dan



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




[PHP] unsubscribe php-general

2001-02-11 Thread John McKown

unsubscribe php-general


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




RE: [PHP] wide open

2001-02-11 Thread Jason Murray

  Furthermore, Jonathan stated that he didn't "break into" your
  system - you left phpMyAdmin *wide* open, which is frankly
  asking for trouble. Imagine how much fun you'd have had if
  someone with *malicious* intent had found it.
 
 --in the physical world, if a door is left unlocked, even ajar a couple
 inches, the physical act of pushing the door open so that one can enter
 the door is defined as "breaking and entering".

--in the physical world, in the US, perhaps.

Note to everyone else: I have no idea or interest in regional differences 
of this definition now, either :)

My *point* was that he should be glad that all he did was add an entry
to the database instead of deleting every damn table in there, hence
the bit about "someone with *malicious* intent".

Still, can we please leave this alone for now on the list? It's already
gone on for far too long.

Jason

-- 
Jason Murray
[EMAIL PROTECTED]
Web Design Team, Melbourne IT
Fetch the comfy chair!

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




Re: [PHP] wide open

2001-02-11 Thread Josh G

Actually IIRC pushing open a door that's ajar is not breaking and
entering, but trespass :)

Gfunk -  http://www.gfunk007.com/

I sense much beer in you. Beer leads to intoxication, intoxication to
hangovers, and hangovers to... suffering.


- Original Message -
From: "Jason Murray" [EMAIL PROTECTED]
To: "'Dan Harrington'" [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Monday, February 12, 2001 1:44 PM
Subject: RE: [PHP] "wide open"


   Furthermore, Jonathan stated that he didn't "break into" your
   system - you left phpMyAdmin *wide* open, which is frankly
   asking for trouble. Imagine how much fun you'd have had if
   someone with *malicious* intent had found it.
 
  --in the physical world, if a door is left unlocked, even ajar a couple
  inches, the physical act of pushing the door open so that one can enter
  the door is defined as "breaking and entering".

 --in the physical world, in the US, perhaps.

 Note to everyone else: I have no idea or interest in regional differences
 of this definition now, either :)

 My *point* was that he should be glad that all he did was add an entry
 to the database instead of deleting every damn table in there, hence
 the bit about "someone with *malicious* intent".

 Still, can we please leave this alone for now on the list? It's already
 gone on for far too long.

 Jason

 --
 Jason Murray
 [EMAIL PROTECTED]
 Web Design Team, Melbourne IT
 Fetch the comfy chair!

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



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




Re: [PHP] afraid !

2001-02-11 Thread Kath

Hell yes to phpmyadmin, IMHO.

I use it on all my servers.

- Kath

- Original Message -
From: "php php" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, February 11, 2001 2:17 PM
Subject: [PHP] afraid !


 Hi!
 i've just joined ur mailing list!
 i used to work on asp with oracle and access!
 i'm working on windont NT but i want to publish my site at a provider that
 has linux? do i have to change my code for that ?
 do u know any provider that accepts acces and mysql with php4?
 i'm afraid of using mysql with php cause i'm in hurry and that i
discovered
 that mysql interface is not as good and easy as of oracle and access! is
it
 true that if i want to insert data to a table i have to do it from the
 commend line?
 Thanks   a lot
 _
 Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


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



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




Re: [PHP] afraid !

2001-02-11 Thread Jaxon

anyone try myphpPagetool?
it seems to be of the same camp.

regards,
jaxon


On 2/11/01 10:28 PM, "Kath" [EMAIL PROTECTED] wrote:

 Hell yes to phpmyadmin, IMHO.
 
 I use it on all my servers.
 
 - Kath
 
 - Original Message -
 From: "php php" [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Sunday, February 11, 2001 2:17 PM
 Subject: [PHP] afraid !
 
 
 Hi!
 i've just joined ur mailing list!
 i used to work on asp with oracle and access!
 i'm working on windont NT but i want to publish my site at a provider that
 has linux? do i have to change my code for that ?
 do u know any provider that accepts acces and mysql with php4?
 i'm afraid of using mysql with php cause i'm in hurry and that i
 discovered
 that mysql interface is not as good and easy as of oracle and access! is
 it
 true that if i want to insert data to a table i have to do it from the
 commend line?
 Thanks   a lot
 _
 Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 


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




[PHP] way to save data

2001-02-11 Thread McShen

hi

I realized that there are 2 ways to save data. Using mySQL or a textfile.
Which do you think is better? i like using myysql instead a textfile cuz
it's faster and it's securier.



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




Re: [PHP-CVS] cvs: php4 /ext/standard file.c file.h

2001-02-11 Thread Colin Viebrock

[Sun, 11 Feb 2001] Sterling Hughes said:

 
  elixer Sat Feb 10 18:38:40 2001 EDT
  
Modified files:  
  /php4/ext/standard file.c file.h 
Log:
Fix for bug #4556
# This is pretty much a total rewrite of get_meta_tags using a simple
# handwritten tokenizer.  It might be overkill, but it works.
 
 I'd say this is news worthy...
 
 Can you add an entry into the NEWS file.


I agree.  However, on first glance, it only seems to grab the meta-tags
that have the NAME/CONTENT attributes, not the HTTP-EQUIV/CONTENT
attributes.  This was a major drawback of the original code (IMHO).

I wrote my own get_metatags function in PHP.  Find the code below.  If
someone likes this and wants to convert it into C ...

?php
function get_metatags($url) {

if (substr($url,0,7)=='http://') {
$url = substr($url,7);
}

if( !($fp = fopen('http://'.$url, 'r')) ) {
return false;
} else {

$file = '';
while (!feof($fp)  !stristr($file,'/head') ) {
$file.= fgets($fp, 80);
}
fclose($fp);

$file = str_replace("\r", '', $file);
$file = str_replace("\n", '', $file);

$result = array();
preg_match_all('/meta(.+?)/i', $file, $temp);

if (is_array($temp[1])) {

foreach($temp[1] as $key=$match) {

$t = $n = $c = '';
if (preg_match('/name=("|\')(.*?)\\1/i', $match, $b)) {
$t = 'NAME';
$n = $b[2];
} else if (preg_match('/http-equiv=("|\')(.*?)\\1/i', $match, $b)) {
$t = 'HTTP-EQUIV';
$n = $b[2];
}

if (preg_match('/content=("|\')(.*?)\\1/i', $match, $b)) {
$c = $b[2];
}

if ($t  $n  $c) {
$result[] = array(
'type'  = $t,
'meta_name' = $n,
'meta_content'  = $c
);
}
}
}
return $result;
}
}
?


- Colin


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




RE: [PHP-CVS] cvs: php4 /ext/standard file.c file.h

2001-02-11 Thread Sean R. Bright

Well, I was trying to fix one bug, not introduce others.  If you read the
documentation for get_meta_tags you will see that it returns an associative
array that is keyed by the value of the NAME attribute while the value is
the data within the CONTENT attribute.

If other members of the developers list would like to suggest a solution for
this problem, I would be more than happy to implement it.  Right now I don't
know how to add what you are asking for without breaking existing PHP code.

Sean

 -Original Message-
 From: Colin Viebrock [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, February 11, 2001 10:52 PM
 To: Sterling Hughes
 Cc: Sean Bright; [EMAIL PROTECTED]
 Subject: Re: [PHP-CVS] cvs: php4 /ext/standard file.c file.h


 [Sun, 11 Feb 2001] Sterling Hughes said:

 
   elixer Sat Feb 10 18:38:40 2001 EDT
  
 Modified files:
   /php4/ext/standard file.c file.h
 Log:
 Fix for bug #4556
 # This is pretty much a total rewrite of get_meta_tags
 using a simple
 # handwritten tokenizer.  It might be overkill, but it works.
 
  I'd say this is news worthy...
 
  Can you add an entry into the NEWS file.


 I agree.  However, on first glance, it only seems to grab the
 meta-tags
 that have the NAME/CONTENT attributes, not the HTTP-EQUIV/CONTENT
 attributes.  This was a major drawback of the original code (IMHO).

 I wrote my own get_metatags function in PHP.  Find the code below.  If
 someone likes this and wants to convert it into C ...

 ?php
 function get_metatags($url) {

 if (substr($url,0,7)=='http://') {
 $url = substr($url,7);
 }

 if( !($fp = fopen('http://'.$url, 'r')) ) {
 return false;
 } else {

 $file = '';
 while (!feof($fp)  !stristr($file,'/head') ) {
 $file.= fgets($fp, 80);
 }
 fclose($fp);

 $file = str_replace("\r", '', $file);
 $file = str_replace("\n", '', $file);

 $result = array();
 preg_match_all('/meta(.+?)/i', $file, $temp);

 if (is_array($temp[1])) {

 foreach($temp[1] as $key=$match) {

 $t = $n = $c = '';
 if (preg_match('/name=("|\')(.*?)\\1/i',
 $match, $b)) {
 $t = 'NAME';
 $n = $b[2];
 } else if
 (preg_match('/http-equiv=("|\')(.*?)\\1/i', $match, $b)) {
 $t = 'HTTP-EQUIV';
 $n = $b[2];
 }

 if (preg_match('/content=("|\')(.*?)\\1/i',
 $match, $b)) {
 $c = $b[2];
 }

 if ($t  $n  $c) {
 $result[] = array(
 'type'  = $t,
 'meta_name' = $n,
 'meta_content'  = $c
 );
 }
 }
 }
 return $result;
 }
 }
 ?


 - Colin


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




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




Re: [PHP] FDF Toolkit uncompression error

2001-02-11 Thread Kurt R. Hoehn

Thank You Frank it worked but the FDF Toolkit seems to have a problem with
4.0.4p11 so I had to roll back to 4.0.3p11 and eveything seems to be running
ok.

Kurt

Tim Frank [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Kurt,

I fought with this same problem for about an hour today.  For me there
was something changed when the file was downloaded that made it
corrupt... I think it was a LF to a CR + LF or something.  I tried Dling
the file with Lynx on a linux machine and it was still corrupt.  My fix
was to DL the file on a windows machine and then FTP the file to my unix
box in ASCII mode (NOT BINARY).  I don't know why or what was causing the
problem, but that is how I fixed it.

Now I'm trying to install it ;)

Hope that helps

Tim Frank

 Original Message 

On 05/02/01, 8:10:18 AM, [EMAIL PROTECTED] ("Kurt R. Hoehn") wrote
regarding [PHP] FDF Toolkit uncompression error:


 Hello,

 I've downloaded the FDF toolkit from adobe (fdftk4_05_C.tar.Z) and it
 doesn't uncompress.  I've noticed that other people are using it.  Has
 anyone else experianced this same problem and if so what was your work
 around.

 Thank You
 Kurt







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

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




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




[PHP] checking for presnet file name

2001-02-11 Thread John LYC

is there a pre-defined variable that return present php file name...

for example...

url : www.domain.com/mypage.php

$var == "mypage";



thanks




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




[PHP] Preserve variables between page loads?

2001-02-11 Thread Chuck Mayo

This may have crossed the list a bazillion times, but I couldn't really find
anything appropriate in the archives... maybe I just didn't look hard enough.

In a MySQL app, I have the usual row of paging links at the bottom of the page
and need to pass to the next iteration more variables than I can comfortably
url-encode in the hyperlink. If all these paging links were submit buttons I
could pass anything I wanted in hidden form fields, but since they're
hyperlinks I don't seem to have that option.

Is there a way to selectively preserve variables between iterations? Something
like variables that are global to PHP, as opposed to being global within the
script?


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




[PHP] help: column into array?

2001-02-11 Thread andrew

Hi PHPers!

how can I reference a result set by array index numbers???

this $sql="select field from table where id_field = 1";
would return a result like this:

field
---
first
second 
third

from this table

id_field  field
|
1   first
1   second 
1   third
2   fourth
2   fifth

how can I do something like this:

$array=mysql_db_query($database, $sql, $link_id);

echo array[0];  //I want this to print "first"
echo array[1];  //I want this to print "second"

I know mysql_fetch_array pulls a ROW into an array, but in this case the row
is only one item wide, so I essentially want column results in an indexed
array.

TIA!
andrew



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




Re: [PHP] newline processing problem?

2001-02-11 Thread Ankur Verma

try using "\r\n" instead of a simple "\n".

hope that helps

Ankur Verma
HCL Technologies
A1CD, Sec -16
Noida, UP
India

- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, February 11, 2001 6:51 AM
Subject: [PHP] newline processing problem?



 I have some code which generates a large string to be used by the mail()
 function.  At the same point in the string each time, PHP stops processing
 "\n" correctly and instead of a newline outputs nothing, so the text
starts to
 get run together.. but it doesn't seem to happen on every "\n".  Has
anyone
 else run into this problem?  It used to work correctly but I made a few
 changes to portions of the code that were totally uninvolved, and it
started
 behaving this way.  Unfortunately, I didn't notice the problem until I'd
made
 a number of small changes to unrelated things and didn't remember what
they
 were.



 Gordon Morehouse
 [EMAIL PROTECTED]
 www.evernex.com

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


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




Re: [PHP] checking for presnet file name

2001-02-11 Thread Ankur Verma

try using 

$PHP_SELF

and 

$REQUEST_URI

regards

Ankur Verma
HCL Technologies
A1CD, Sec -16
Noida, UP
India

- Original Message - 
From: "John LYC" [EMAIL PROTECTED]
To: "PHP List" [EMAIL PROTECTED]
Sent: Monday, February 12, 2001 10:52 AM
Subject: [PHP] checking for presnet file name


 is there a pre-defined variable that return present php file name...
 
 for example...
 
 url : www.domain.com/mypage.php
 
 $var == "mypage";
 
 
 
 thanks
 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


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




[PHP] Arrgghh, Regular Expressions?!?!

2001-02-11 Thread Scott Mebberson

Hi guys,

I need to write a regular expression search that can search through a block
of HTML code and find anything similar to these:

IMG alt="" border=0 hspace=10 src="" vspace=20

IMG align=baseline alt="" border=0 hspace=0 src=""

IMG align=right alt="" border=1 hspace=2 src="" vspace=

IMG align=textTop alt="" border=0 hspace=0 src=""

IMG align=baseline alt="" border=0 hspace=0 src=""

IMG alt="" border=0 hspace=0 src=""

IMG alt="" border=2 hspace=0 src=""

IMG alt="" border=2 hspace=0 src="" style="" vspace=2

IMG align=left alt="" border=2 hspace=0 src="" style="" vspace=2

 And return what I want in an array.

I need the search or piece of code to be able to differ as to which one it
is using, ie/ with align or without align. I need all of the values returned
in an array.

Does anybody think that they could help me out with this one. I know that it
is pretty tricky but I am not that good with reg exp and I need some help.

Anything is very much appreciated. Thanks Guys!!

Scott Mebberson



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




Re: [PHP] rewriting this SQL query to remove subselect

2001-02-11 Thread Ifrim Sorin

You could try a two step query:
  $querywords="CREATE TABLE  temptable SELECT  ... ";
  $sel_querywords=mysql_query($querywords);

 $search = "SELECT count(search_table.word) as score,
 search_table.qid,page_data.contents
  FROM search_table,page_data,temptable
  WHERE page_data.pID = search_table.qid AND search_table.word =
temptable.word
  GROUP BY search_table.qid
  ORDER BY score DESC";

  then drop temptable .

HTH
Sorin Ifrim

Scott Mebberson [EMAIL PROTECTED] wrote in message
967ab7$t1$[EMAIL PROTECTED]">news:967ab7$t1$[EMAIL PROTECTED]...
 Hi Guys,

 I understand that as of version 3.24, MySQL will support subselects. But
 untill then (because 3.23 is the latest stable release) I need to convert
 this SQL satement into something that can be used with v3.2? - the
version
 just before the latest release.

 $search = "SELECT count(search_table.word) as score,
 search_table.qid,page_data.contents
  FROM search_table,page_data
  WHERE page_data.pID = search_table.qid AND search_table.word
  IN($querywords)
  GROUP BY search_table.qid
  ORDER BY score DESC";

 Does anybody have any ideas, thanks for this guys. Any help is much
 appreciated.




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



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




Re: [PHP] To The Hacker: CodeBoy

2001-02-11 Thread Matt McClanahan

On Sun, Feb 11, 2001 at 03:51:33PM -0800, rswfire wrote:

 I am not a hacker.  I do not try to hack and
 don't know how people go about doing it.  I'm a
 programmer.  To me, those two are very different.
  A programmer is constructive.  A programmer
 likes to take a problem and turn it into a
 solution.  A programmer is creative.  A
 programmer has respect for other people's domains
 and boundaries.  A hacker is destructuve.  A
 hacker takes a solution and turns it into a
 problem.  A hacker has no respect for other
 people's domain or boundaries.  As you have
 clearly done.  You have overstepped a boundary
 with me.

I feel compelled to repost this, because you seem to have the right
principles in mind, but the wrong term.  I realize it's usually viewed
as useless nitpicking to point this out, but it seems appropriate in
this context to stress the misconception of what a hacker is.  So if
you have a free moment, please do read over some of the well-written
explanations about where the word comes from, and what it stands for.

http://www.tuxedo.org/~esr/jargon/html/entry/hacker.html
http://www.tuxedo.org/~esr/jargon/html/entry/hacker-ethic.html
http://www.tuxedo.org/~esr/jargon/html/entry/cracker.html

Your description of a programmer does fit well with who a hacker really
is, so I'm sure you would appreciate what they have to say.  There is,
of course, a great wealth of writing on the topic, the links above are
simply succinct definitions.  For more in depth discussion, I'd suggest
browsing the bibliography included in the jargon file, which includes
excellent works, both fiction and non-fiction, relating to the subject.

http://www.tuxedo.org/~esr/jargon/html/Bibliography.html

Matt

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




[PHP] Fatal Error!

2001-02-11 Thread chuck


Fatal error: input in flex scanner failed in /var/www/html/gcdb/lang on
line 1

Using gcdb version 1.1.4 (see: http://sourceforge.net/projects/gcdb/)

I get the error listed above... I believe the error is arising from this
code (from gcdb.php):

if(!(isset($sess_lang))) {
$db = getDBConnection();
$result = mysql_query("select * from Configuration");
$config_row = mysql_fetch_array($result);
require("lang/".$config_row["Language"]);
} else {
require("lang/".$sess_lang);
}

I searched the buglist for php and found a few references to this error
but nothing I'd call definitive... I also found a reference in the PHP
documentation which says this error occurs when a require points at a
directory instead of a file...

I'm just learning php but the code sample above appears to me to be
pointing at a directory but I'm not sure... I'm also too tired to
continue tonight... if anybody has seen this and knows what it is I'd
appreciate a hand...

Thanx!

--
Chuck Mead, chuck -AT- moongroup.com, Owner, MoonGroup.com 
(Note: html formatted email sent to me is filtered  deleted unread)
GnuPG Public Key Available: http://wwwkeys.us.pgp.net


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




php-general Digest 12 Feb 2001 07:44:46 -0000 Issue 507

2001-02-11 Thread php-general-digest-help


php-general Digest 12 Feb 2001 07:44:46 - Issue 507

Topics (messages 39137 through 39181):

Re: afraid !
39137 by: Joe Stump
39168 by: Kath
39169 by: Jaxon

Search  replace text
39138 by: CDitty
39155 by: David Robley

Re: comparisons
39139 by: Curtis Maurand
39148 by: Phil Driscoll
39159 by: Curtis Maurand

gambling goes MLM
39140 by: w334nnlsfd3d.hotmail.com

jpeg parsing
39141 by: Chinatown

oops - wrong! (was: how to alter assoc_array?)
39142 by: Jaxon
39145 by: Jaxon

mysql auto-increment
39143 by: Christian Dechery

A way to duplicate data across databases
39144 by: Carsten Gehling

First connection?
39146 by: Info
39147 by: Jaxon

Re: good free/cheap IDE for PHP
39149 by: Brian White

transactions
39150 by: Christian Dechery
39160 by: Curtis Maurand

Building php4.0.4pl1 with mysql 3.23.32
39151 by: Scott Brown

Re: To The Hacker: CodeBoy
39152 by: rswfire
39154 by: Jason Murray
39180 by: Matt McClanahan

open_basedir error message.
39153 by: Floyd Baker

rewriting this SQL query to remove subselect
39156 by: Scott Mebberson
39179 by: Ifrim Sorin

rewriting this SQL statement to remove subselect
39157 by: Scott Mebberson

Problems installing PHP 4.0.4pl1 on RedHat 6.2
39158 by: Pablo Pasqualino

change password in NIS using PHP
39161 by: karu

"wide open"
39162 by: Dan Harrington
39164 by: Jason Murray
39165 by: Josh G

unsubscribe php-general
39163 by: John McKown

fscanf problem
39166 by: John Vanderbeck

Re: Previous Next problems !!
39167 by: Manuel Lemos

way to save data
39170 by: McShen

Re: FDF Toolkit uncompression error
39171 by: Kurt R. Hoehn

checking for presnet file name
39172 by: John LYC
39176 by: Ankur Verma

Preserve variables between page loads?
39173 by: Chuck Mayo
39177 by: Ankur Verma

Re: column into array?
39174 by: andrew

Re: newline processing problem?
39175 by: Ankur Verma

Arrgghh, Regular Expressions?!?!
39178 by: Scott Mebberson

Fatal Error!
39181 by: chuck.moongroup.com

Administrivia:

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

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

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


--



Heaven forbid you use a command line. I wouldn't trade my *NIX prompt for 
anything. Once you learn it you're set. MySQL's prompt is much like Oracle's
prompt and we all know Access has NO business anywhere near "enterprise" 
software.

I'd recommend learning the command prompt (which an hour's read on linuxdoc.org
can fix). If you decide to move to PHPMyAdmin (ack!) I'd be willing to bet you
move right back to the power of the prompt.

My $0.02

--Joe aka "Lover of the Prompt"



On Sun, Feb 11, 2001 at 07:17:50PM -, php php wrote:
 Hi!
 i've just joined ur mailing list!
 i used to work on asp with oracle and access!
 i'm working on windont NT but i want to publish my site at a provider that 
 has linux? do i have to change my code for that ?
 do u know any provider that accepts acces and mysql with php4?
 i'm afraid of using mysql with php cause i'm in hurry and that i discovered 
 that mysql interface is not as good and easy as of oracle and access! is it 
 true that if i want to insert data to a table i have to do it from the 
 commend line?
 Thanks   a lot
 _
 Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 

---
Joe Stump, PHP Hacker, [EMAIL PROTECTED] -o)
http://www.miester.org http://www.care2.com /\\
"It's not enough to succeed. Everyone else must fail" -- Larry Ellison _\_V
---





Hell yes to phpmyadmin, IMHO.

I use it on all my servers.

- Kath

- Original Message -
From: "php php" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, February 11, 2001 2:17 PM
Subject: [PHP] afraid !


 Hi!
 i've just joined ur mailing list!
 i used to work on asp with oracle and access!
 i'm working on windont NT but i want to publish my site at a provider that
 has linux? do i have to change my code for that ?
 do u know any provider that accepts acces and mysql with php4?
 i'm afraid of using mysql with php cause i'm in hurry and