php-general Digest 24 Feb 2001 04:43:15 -0000 Issue 530

Topics (messages 41318 through 41430):

Re: PHP and PAM <CVS PAY ATTENTION>
        41318 by: Krznaric Michael

Re: Problem with $REMOTE_ADDR
        41319 by: Jeff Oien
        41320 by: Rosen

Re: trouble getting .php3 files to work in php4.0.4pl1 (static)
        41321 by: Hunter Kelly
        41323 by: Hoover, Josh
        41325 by: Hunter Kelly

Re: [PHP-INST] Re: [PHP] trouble getting .php3 files to work in php4.0.4pl1 (static)
        41322 by: Geordon VanTassle

Re: apache+php on MacOSX
        41324 by: Thierry Coopman
        41331 by: Michael Stearne
        41339 by: Andrew Hill

Problemas con php
        41326 by: Oscar Pinto

array question
        41327 by: Jeff
        41338 by: Christian Reiniger

Re: MySQL execution order?
        41328 by: Don Johnson
        41336 by: Christian Reiniger

Re: File content type
        41329 by: Matt

Re: PHP / Filemaker?
        41330 by: Michael Stearne
        41344 by: Hoover, Josh

Latest PHP CVS binaries
        41332 by: Peter
        41333 by: James Moore

Re: Parsing a string
        41334 by: Christian Reiniger
        41340 by: mjriding.wcoil.com
        41341 by: Todd Cary
        41380 by: Simon Garner

Array Help
        41335 by: Brian V Bonini
        41348 by: php3.developersdesk.com

encrypt and decrypt in standard PHP
        41337 by: Zhu George-CZZ010
        41413 by: Richard Lynch

Undefinded Index on Mysql Result under Win98/PWS
        41342 by: Greg Kopp
        41345 by: Jason Stechschulte
        41346 by: mjriding.wcoil.com
        41350 by: php3.developersdesk.com
        41362 by: Jason Stechschulte
        41364 by: Greg Kopp

Need socket help!!!
        41343 by: Todd Cary
        41414 by: Richard Lynch

<no subject>
        41347 by: Don Johnson
        41353 by: Christian Reiniger

regex help
        41349 by: John Vanderbeck
        41354 by: Christian Reiniger

Re: 
        41351 by: Christian Reiniger

session question
        41352 by: Jon Rosenberg
        41378 by: Chris Lee
        41415 by: Richard Lynch

posgres 7 functions not working with PHP4
        41355 by: Phil Glatz

Header Location Frame Question
        41356 by: Jeff Oien
        41416 by: Richard Lynch

Explode a variable into each character
        41357 by: Brandon Orther
        41359 by: Rasmus Lerdorf
        41361 by: Philip Olson

Re: Counter Help
        41358 by: Navid Yar

php (cgi version) with Apache and suexec - help
        41360 by: jhagan.binghamton.edu
        41417 by: Richard Lynch

string question
        41363 by: MinorThreatBmxxx.aol.com
        41365 by: Philip Olson

Re: Problems sending mail to aol with the mail() function
        41366 by: Steve Werby

Submitting Form Information
        41367 by: Matthew Aznoe
        41418 by: Richard Lynch

file test
        41368 by: Kevin Beckford
        41379 by: php3.developersdesk.com
        41419 by: Richard Lynch

using DTDs and XML
        41369 by: Mark Newnham
        41370 by: Egon Schmid (.work)

Download PHP from Linux machine?
        41371 by: Jorge Alvarez
        41372 by: Joe Stump

chunk_split() doesnt seem to be working
        41373 by: Chris Lee
        41382 by: Chris Lee
        41420 by: Richard Lynch

imagettfbbox and imagettftext
        41374 by: Monte Ohrt

How to check if a current session is going?
        41375 by: Michael Zornek
        41376 by: Chris Lee

php and apache protected directories
        41377 by: Marius David

specifying alternate host with imap-mail
        41381 by: Mark Newnham

PHP not proccessing input?
        41383 by: Chris

problems with mail()
        41384 by: Chris Lee

ANSI to HTML with socket handling
        41385 by: Kyndig

Order by Date (Newbie)
        41386 by: Brian S. Drexler
        41388 by: Joe Stump
        41390 by: Kyndig

Re: Ok, this might make more sense
        41387 by: YoBro

Help INSERTing to MySQL
        41389 by: Clayton Dukes
        41391 by: Joe Stump
        41392 by: Philip Olson
        41421 by: Clayton Dukes
        41422 by: Kyndig
        41423 by: Clayton Dukes
        41424 by: php3.developersdesk.com
        41425 by: Philip Olson

Re: URGENT: IE pops-up an Error and File Download Fails. Needs to be  fixed NOW. 
Please advise.
        41393 by: Richard Lynch

Re: smtp protocol
        41394 by: Richard Lynch

Re: cURL library and auto-loggin to a site
        41395 by: Richard Lynch

Re: Database Paging using MSSQL 2000
        41396 by: Richard Lynch

Re: Apache & php as a DSO module woes!
        41397 by: Richard Lynch

Re: fopen
        41398 by: Richard Lynch

Re: Encryption
        41399 by: Richard Lynch

Re: fread over ftp
        41400 by: Richard Lynch

Re: Saving changes to a file
        41401 by: Richard Lynch

Re: Trans sid and form posts
        41402 by: Richard Lynch

Re: file upload error w/internet exploder!
        41403 by: Richard Lynch

Re: Problems with posix_getpwnam
        41404 by: Richard Lynch

Re: Cookie stored but cannot trigger the function...
        41405 by: Richard Lynch

Re: Alternate 2 schedules...
        41406 by: Richard Lynch

Re: cached fasttemplates permissions prob
        41407 by: Richard Lynch

Re: I have a great problem with sessions, can anybody help me!!!
        41408 by: Richard Lynch

Re: security and php
        41409 by: Richard Lynch

Re: is there a way to set apache's auth_user from php?
        41410 by: Richard Lynch

Re: php_self
        41411 by: Richard Lynch

Re: mysql.sock
        41412 by: Richard Lynch

special characters with perl,mysql,php
        41426 by: Mitchell Hagerty
        41428 by: Joe Stump
        41429 by: Kyndig

compliling imap support into php
        41427 by: Mitchell Hagerty

Using while as for...
        41430 by: Felipe Lopes

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]


----------------------------------------------------------------------


Hi,

        I had the same problem.  It appears that the new version of PHP
4.0.4+ does not compile this module properly.  However if you go down to PHP
4.0.3 or less everything works great.  So something changed in the build
process and I have no idea what.  Maybe if we're lucky we'll get someone
from the CVS reading this.

        Does anyone know why this doesn't work?  If anyone is interested I
have make output to show what goes wrong.

Mike


-----Original Message-----
From: Robert Marzon [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 22, 2001 9:16 AM
To: [EMAIL PROTECTED]
Subject: [PHP] PHP and PAM


Hello

I tried to used PHP with autentification....
I wrote script, but I had got error :
Fatal error: Call to undefined function: pam_auth() in
/usr/home/httpd/html/farm/dev/test/user.php on line 2
I read some FAQ and I found the answer:
....
For some reason, newer version of php4 do not always seem to properly update
the autoconf stuff when your run the buildconf script. If you get this
error, configure php again and then look through the autoconf output and
look for a line that says "Checking for Pam Auth support: yes". If you don't
see it, it isn't getting built in. To fix this, run the command 'autoconf'
in the top level php source directory, this should update the configure
script to recognize the pam auth stuff.
....

I was trying to configure PHP with "Pam Auth support", but I can't find this
opitions.
I looked all option from ./configure and there is nothing...
Server use FreeBSD 4.1.1


--
R.



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




Same thing happens to me:
http://www.webdesigns1.f2s.com/remote_addr.php
Jeff Oien

code:

 <html>
 <head>
 <title></title>
 </head>
 <body>
 <?php echo "$REMOTE_ADDR"; ?>
 </body>
 </html>

> At 09:54 AM 2/23/2001, Rosen wrote:
> 
> is the machine that your browsing on the same machine that you have your 
> serving software on?
> 
> ~kurth
> 
> 
> >Hi,
> >I have problem with using of "$REMOTE_ADDR" variable.
> >The variable always return me "127.0.0.1" ( localhost ),
> >
> >How can I get the IP of the remote host ?
> >
> >Thanks,
> >Rosen Marinov
> >
> >
> >
> >
> >
> >--
> >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]
> 




No,
the server is remote.



"Kurth Bemis" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> At 09:54 AM 2/23/2001, Rosen wrote:
>
> is the machine that your browsing on the same machine that you have your
> serving software on?
>
> ~kurth
>
>
> >Hi,
> >I have problem with using of "$REMOTE_ADDR" variable.
> >The variable always return me "127.0.0.1" ( localhost ),
> >
> >How can I get the IP of the remote host ?
> >
> >Thanks,
> >Rosen Marinov
> >
> >
> >
> >
> >
> >--
> >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]
>






Hmm okay that works, for most .php3 files, but for some reason,
does not work with index.php3.  Very strange...

H

"Hoover, Josh" wrote:
> 
> Try doing this in your httpd.conf (replacing what you have now):
> 
> AddType application/x-httpd-php .php
> AddType application/x-httpd-php .php3
> AddType application/x-httpd-php-source .phps
> 
> Josh Hoover
> KnowledgeStorm, Inc.
> 
> Searching for a new IT solution for your company? Need to improve your
> product marketing?
> Visit KnowledgeStorm at www.knowledgestorm.com to learn how we can
> simplify the process for you.
> KnowledgeStorm - Your IT Search Starts Here
> 
> > Hello, I am having trouble getting .php3 files to work in php4.0.4pl1.
> >
> > .php files work fine, but my browser wants to download the .php3 file.
> >
> > Here are the relevant lines from httpd.conf:
> >
> > AddType application/x-httpd-php .php .php3
> > AddType application/x-httpd-php-source .phps
> >
> > I'm at a bit of a loss as to why a .php file would work, but
> > a .php3 file
> > does
> > not.




Do you mean that index.php3 does not work when you access that page as the
index for the directory (http://youripaddress/) or that when you
specifically call index.php3 (http://youripaddress/index.php3), it wants to
download the script in your browser?

Thanks,

Josh Hoover
KnowledgeStorm, Inc.

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


> Hmm okay that works, for most .php3 files, but for some reason,
> does not work with index.php3.  Very strange...
> 
> H
> 




It was the latter, which was very strange, but the problem seems to have
gone away now.  How odd.

Thanks for your prompt help!!  Much appreciated.

Hunter

"Hoover, Josh" wrote:
> 
> Do you mean that index.php3 does not work when you access that page as the index for 
>the directory (http://youripaddress/) or that when you specifically call index.php3 
>(http://youripaddress/index.php3), it wants to download the script in your browser?
> 
> Thanks,
> 
> Josh Hoover
> KnowledgeStorm, Inc.
> 
> Searching for a new IT solution for your company? Need to improve your product 
>marketing?
> Visit KnowledgeStorm at www.knowledgestorm.com to learn how we can simplify the 
>process for you.
> KnowledgeStorm - Your IT Search Starts Here
> 
> > Hmm okay that works, for most .php3 files, but for some reason,
> > does not work with index.php3.  Very strange...
> >
> > H
> >




Find the "DirectoryIndex" line and add "index.php3" to it in the httpd.conf

HTH,
Geordon

----- Original Message -----
From: "Hunter Kelly" <[EMAIL PROTECTED]>
To: "Hoover, Josh" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Friday, February 23, 2001 9:22 AM
Subject: [PHP-INST] Re: [PHP] trouble getting .php3 files to work in
php4.0.4pl1 (static)


> Hmm okay that works, for most .php3 files, but for some reason,
> does not work with index.php3.  Very strange...
>
> H
>
> "Hoover, Josh" wrote:
> >
> > Try doing this in your httpd.conf (replacing what you have now):
> >
> > AddType application/x-httpd-php .php
> > AddType application/x-httpd-php .php3
> > AddType application/x-httpd-php-source .phps
> >
> > Josh Hoover
> > KnowledgeStorm, Inc.
> >
> > Searching for a new IT solution for your company? Need to improve your
> > product marketing?
> > Visit KnowledgeStorm at www.knowledgestorm.com to learn how we can
> > simplify the process for you.
> > KnowledgeStorm - Your IT Search Starts Here
> >
> > > Hello, I am having trouble getting .php3 files to work in php4.0.4pl1.
> > >
> > > .php files work fine, but my browser wants to download the .php3 file.
> > >
> > > Here are the relevant lines from httpd.conf:
> > >
> > > AddType application/x-httpd-php .php .php3
> > > AddType application/x-httpd-php-source .phps
> > >
> > > I'm at a bit of a loss as to why a .php file would work, but
> > > a .php3 file
> > > does
> > > not.
>
> --
> PHP Install 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]
>
>
>





At 8:46 AM -0500 2/23/01, Andrew Hill wrote:
>Thierry,
>
>Not sure if you need that 'echo' in there.

with or without echo it doesn't work, the PHP works on Solaris.

>
>Also, if you have problems, compiling PHP / apache under MacOS X isn't THAT
>complicated :)
>

well, yes, if you can find a C compiler that works. In the last 
beta's (4K50) Apple doesn't seem to include the right platform 
specific files for that.
I would also prefer the fact that PHP is already available and just 
needs to be configured. Compiling is for most people just too much 
hassle.

-- 
Thierry Coopman - [EMAIL PROTECTED]
My opinions are personal, and have really nothing or nothing to do 
with Keytrade!

The first place to look for information is in the section of the manual
where you least expect to find it.






Thierry Coopman wrote:

> At 8:46 AM -0500 2/23/01, Andrew Hill wrote:
> >Thierry,
> >
> >Not sure if you need that 'echo' in there.
>
> with or without echo it doesn't work, the PHP works on Solaris.
>
> >
> >Also, if you have problems, compiling PHP / apache under MacOS X isn't THAT
> >complicated :)
> >
>
> well, yes, if you can find a C compiler that works. In the last
> beta's (4K50) Apple doesn't seem to include the right platform
> specific files for that.
> I would also prefer the fact that PHP is already available and just
> needs to be configured. Compiling is for most people just too much
> hassle.
> \

Since it's so close to realease I wouldn't trust any beta's newer than the
Public Beta.  When OS X is realease and stable people will release PHP
binaries.

Michael


>
> --
> Thierry Coopman - [EMAIL PROTECTED]
> My opinions are personal, and have really nothing or nothing to do
> with Keytrade!
>
> The first place to look for information is in the section of the manual
> where you least expect to find 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]





The MacOS X Developer Tools (free from Apple's site with a developer
registration) have all the necessary tools.

Best regards,
Andrew
--------------------------------------
Andrew Hill - OpenLink Software
Director Technology Evangelism
eBusiness Infrastructure Technology
http://www.openlinksw.com

> -----Original Message-----
> From: Michael Stearne [mailto:[EMAIL PROTECTED]]
> Sent: Friday, February 23, 2001 11:25 AM
> To: Thierry Coopman
> Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Re: [PHP] apache+php on MacOSX
>
>
>
>
> Thierry Coopman wrote:
>
> > At 8:46 AM -0500 2/23/01, Andrew Hill wrote:
> > >Thierry,
> > >
> > >Not sure if you need that 'echo' in there.
> >
> > with or without echo it doesn't work, the PHP works on Solaris.
> >
> > >
> > >Also, if you have problems, compiling PHP / apache under MacOS
> X isn't THAT
> > >complicated :)
> > >
> >
> > well, yes, if you can find a C compiler that works. In the last
> > beta's (4K50) Apple doesn't seem to include the right platform
> > specific files for that.
> > I would also prefer the fact that PHP is already available and just
> > needs to be configured. Compiling is for most people just too much
> > hassle.
> > \
>
> Since it's so close to realease I wouldn't trust any beta's newer than the
> Public Beta.  When OS X is realease and stable people will release PHP
> binaries.
>
> Michael
>
>
> >
> > --
> > Thierry Coopman - [EMAIL PROTECTED]
> > My opinions are personal, and have really nothing or nothing to do
> > with Keytrade!
> >
> > The first place to look for information is in the section of the manual
> > where you least expect to find 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]
>
>





Hola a todos 
  
     Mi consulta es la siguiente
          He bajado la versión php-4.0.4pl1-Win32 para Windows 2000 

      ¿ como utilizo esto, es decir como ejecuto un archivo php4?

        Estoy utilizando Internet informaton server 5

  Ojala alguien pueda ayudarme





Is there better performance/speed instantiating an array with a
specified size and then adding elements versus adding elements to an
array with no size?

Thanks,

Jeff





On Friday 23 February 2001 17:02, Jeff wrote:
> Is there better performance/speed instantiating an array with a
> specified size and then adding elements versus adding elements to an
> array with no size?

Uh, you can't specify the size when instatiating an array ...

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

...10001000110101011010101101011110111010113...????




Yup, the data's correct. The new records all have the DownloadedDateTime as
'0000-00-00 00:00:00'

As an attempted fix, I even entered a pause between the two MySQL queries,
and made the UPDATE low_priority to make sure it wasn't jumping the gun.

No luck yet.

Don



in article 003d01c09d20$a16db610$[EMAIL PROTECTED],
"..s.c.o.t.t.. [gts]" at [EMAIL PROTECTED] wrote on 2/22/01 7:11 PM:

> mysql executes the queries in the order it recieves
> them, (so if your program's logic executes a select
> before an update, you'll never see results from the
> update in your select... at least not normally :)
> 
> Are you able to access the MySQL monitor program?
> 
> if so, verify that the data really does exist
> before running your script (maybe the SELECT
> is failing beucase the actual data is incorrect,
> not the code...)
> 
> go into the monitor and execute your SELECT
> statement, then run your PHP script... if
> the results still disagree, post some more
> information...
> 
> ----- Original Message -----
> From: "Don Johnson" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, February 21, 2001 5:19 PM
> Subject: [PHP] MySQL execution order?
> 
> 
>> Since I've always found my answers in the archive, this is my first post, so
>> please excuse any blunders...
>> 
>> I'm trying to download info from a table as a tab-delimted text file. This
>> part works fine. (By disabling the UPDATE statement in the code sample
>> below, I can get the same data file sent time after time.)
>> 
>> I need to keep the data in the table for future reference, and only want to
>> download each new record once, so I added a DateTime field that gets updated
>> after downloading. Then searching on that field gives me just the records
>> that haven't been downloaded yet.
>> 
>> The weird part is that it seems like the LAST MySQL command (UPDATE) gets
>> executed before the FIRST one (SELECT), because the SELECT statement comes
>> up with 0 rows.
>> 
>> 
>> Here's some selected (modified) parts of the PHP code:
>> 
>> ------------------------
>> First, I perform the SQL:
>> SELECT * from db_table WHERE (DownloadedDateTime = '0000-00-00 00:00:00')
>> 
>> Then, it parses and sends the info:
>> while ($row = mysql_fetch_row($result)) {
>> while (list($key, $val) = each($row)) {
>> $val = ereg_replace("[\n\r\t]"," ",$val);
>> $val = ereg_replace(" {2,}"," ",$val);
>> echo $val . "\t";
>> }
>> //end of line
>> echo "\r";
>> }   
>> 
>> Then I perform the SQL:
>> UPDATE LOW_PRIORITY db_table SET DownloadedDateTime=CURRENT_TIMESTAMP WHERE
>> (DownloadedDateTime = '0000-00-00 00:00:00')
>> --------------------------
>> 
>> Any ideas why the rows are getting the DownloadedDateTime field updated
>> before they get SELECTed?
>> 
>> 
>> Thanks,
>> 
>> Don Johnson
>> [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]
>> 






On Friday 23 February 2001 16:57, Don Johnson wrote:
> Yup, the data's correct. The new records all have the
> DownloadedDateTime as '0000-00-00 00:00:00'

It works if you execute only the SELECT (without the UPDATE) ?

> >> SELECT * from db_table WHERE (DownloadedDateTime = '0000-00-00
> >> 00:00:00')

> >> UPDATE LOW_PRIORITY db_table SET
> >> DownloadedDateTime=CURRENT_TIMESTAMP WHERE (DownloadedDateTime =
> >> '0000-00-00 00:00:00')

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

...10001000110101011010101101011110111010113...????




I'll would try it by netscrape isn't working @ the moment...

I doubt your script will let you upload file with out the .gif or .jpg
extension, but I think you can upload file with a different content type by
changing your local content type settings then using netscrape to upload..

.matt
----- Original Message -----
From: "Jason Stechschulte" <[EMAIL PROTECTED]>
To: "Matt" <[EMAIL PROTECTED]>
Sent: Friday, February 23, 2001 3:58 PM
Subject: Re: [PHP] File content type


> The reason I asked you to try that page is that I am also concerned
> about security and thought it was secure already.  If you know of
> something that can upload a file that I don't want uploaded, I would
> love to find out how to do it, so I can try to create a fix.  I'm not
> trying to be a jackass, so I hope my last message didn't sound that way.
>
> --
> Jason Stechschulte
> University of Northwestern Ohio
> [EMAIL PROTECTED]
> (419)998-3108
> --
> To have died once is enough.
> -- Publius Vergilius Maro (Virgil)





The only way you can do it now is through ODBC.  In OS X ODBC will probably be
better along with a Carbon FMP version, it will be a good combo.

Michael


knaSen wrote:

> Hey
>
> This is my first question and mail to this list...hope u treat me decent =)
> My earlier work have been lasso/filemaker (mac)
> I´ve been heard that PHP is coming strongly and I have no reason not to
> join. How is the relation between PHP/Filemaker?
>
> ----------------------*
> [knaSen]
> icq #23830427
>
> --
> 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]





Someone said it already, ODBC would be the best way to go.  BUT, keep in
mind that ODBC support in FileMaker is not by any means complete.  Also
remember that FileMaker is always going to be your bottleneck - not PHP.  I
would suggest looking at MySQL (http://www.mysql.com/) and/or PostgreSQL
(http://www.postgresql.org/) as alternatives to FileMaker Pro. 

I think you may also be interested in joining the AMP list at
http://www.developersplace.com/  This list has a lot of Mac people on it
doing Apache, MySQL, PHP, etc. stuff.  There are people there with good
Lasso/FileMaker Pro backgrounds, so they can help you out with any
problems/questions you may run into.

Josh Hoover
KnowledgeStorm, Inc.

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

> > Hey
> >
> > This is my first question and mail to this list...hope u 
> treat me decent =)
> > My earlier work have been lasso/filemaker (mac)
> > I´ve been heard that PHP is coming strongly and I have no 
> reason not to
> > join. How is the relation between PHP/Filemaker?
> >
> > ----------------------*
> > [knaSen]
> > icq #23830427




Does anyone know where I can download some compiled binaries of the latest
PHP snapshot (Win32)?

TIA
Peter







> Does anyone know where I can download some compiled binaries of the latest
> PHP snapshot (Win32)?

Have you got somewhere you can let me put them and Ill build you some
otherwise Ill set you up an FTP account later and let you have them.

James
--
James Moore
PHP QA Team
[EMAIL PROTECTED]





On Friday 23 February 2001 15:46, Hardy Merrill wrote:
> Look up the "split" and "explode" functions - they both do basically
> the same thing.
>
> $token_list = split(",", $string_to_parse);

.. and if that doesn't suffice I can send you a nice'n'powerful CSV 
parser class :)


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

...10001000110101011010101101011110111010113...????




Yes... you can use the explode function.

Example:

<?
        $parts = explode(",",$item);
?>

if $item where "Hello,There", $parts[0] would = "Hello" and $parts[1]
would = "There".

Thanks,

Mike Ridinger

On Fri, 23 Feb 2001, Todd Cary wrote:

> I have a comma delimited string that I need to parse into an array.  Is
> there a PHP function that will do that ?
> 
> Many thanks..........
> 
> Todd
> 
> --
> Todd Cary
> Ariste Software
> [EMAIL PROTECTED]
> 
> 
> 
> 





Thanks all!!

split() works like a champ!!

Todd

--
Todd Cary
Ariste Software
[EMAIL PROTECTED]






From: "Todd Cary" <[EMAIL PROTECTED]>

> Thanks all!!
>
> split() works like a champ!!
>
> Todd
>
> --
> Todd Cary
> Ariste Software
> [EMAIL PROTECTED]
>


If you're just tokenising by a comma, don't use split(), use explode().

split() accepts a regular expression for the separator, whereas explode()
accepts just a normal string. The difference is, split() is slower.



Cheers

Simon Garner





I've tried and tried and tried.... ;-)

I have this array;

$bikes = array(
     "Road"  => array(
          "Trek"  => array(
                    "Trek 5200" => "road.php?brand=t5200"
                    ),
          "Schwinn" => array(
                    "Schwinn Fastback Pro"  => "road.php?brand=schfp"
                    ),
          "Moots" => array(
                    "VaMoots"  => "road.php?brand=vamoots"
                    ),
          "Lemond" => array(
                    "Zurich" => "road.php?brand=zurich",
                    "Chambery" => "road.php?brand=chambery",
                    "BuenosAries" => "road.php?brand=bueno",
                    "Tourmalet" => "road.php?brand=tourmalet"
                    )
     )
);

I'm trying to list the four brands followed
by each brands model and URL. I.E.
Trek
Schwinn
Moots
Lemond

Trek 5200
Schwinn Fastback Pro

etc....

What am I doing wrong here,

        if ($cat == 'bikes') {
          while ( list($type,) = each($bikes["Road"])) {
           echo "<TD><A HREF=\"$type\" CLASS=\"menu\">$type</A></TD>\n";
          }
          while ( list($typ,) = each($bikes["Road"])) {
            while (list($val, $key)=each($bikes["Road"][$typ])) {
                echo "<TD><IMG SRC=\"images/spacer.gif\" WIDTH=\"25\"
HEIGHT=\"1\" ALT=\"\" BORDER=\"0\"></TD>\n";
                echo "<TD><A HREF=\"$key\" CLASS=\"menu\">$val</A></TD>\n";
            }
         }
        }

The first while loop works but not the second pair.
I thought $typ would contain the brand on each pass
but this returns nothing.......

Help... :(

-Brian






Addressed to: <[EMAIL PROTECTED]>
              [EMAIL PROTECTED]

** Reply to note from <[EMAIL PROTECTED]> Fri, 23 Feb 2001 12:20:12 -0500
>
> I've tried and tried and tried.... ;-)
>
> I have this array;
>
> $bikes = array(
>   "Road"  => array(
>      "Trek"  => array(
>         "Trek 5200" => "road.php?brand=t5200"
>         ),
>      "Schwinn" => array(
>         "Schwinn Fastback Pro" => "road.php?brand=schfp"
>         ),
>      "Moots" => array(
>         "VaMoots"  => "road.php?brand=vamoots"
<         ),
>      "Lemond" => array(
>         "Zurich" => "road.php?brand=zurich",
>         "Chambery" => "road.php?brand=chambery",
>         "BuenosAries" => "road.php?brand=bueno",
>         "Tourmalet" => "road.php?brand=tourmalet"
>          )
>      ),
>   "Dirt"  => array(
>    )
> );


I would probably do something like:

# reset( $Bikes )
while( list( $BikeType, $Manufacturers ) = each( $bikes )) {
   echo "$BikeType<BR>\n";


#   reset( $Manufacturers );
   while( list( $Mfr, $Models ) = each( $Manufacturers )) {
      echo "&nbsp;&nbsp;$Mfr<BR>\n";

#      reset( $Models );
      while( list( $Model, $URL ) = each( $Models )) {
         echo "&nbsp;&nbsp;&nbsp;&nbsp;" .
               "<A href=\"$URL\">$Model</A><BR>\n";          }
      }
   }


This would give

Road
  Trek
    Trek  <-- is a link
  Schwinn
    Schwinn Fastback Pro  <-- is a link
  Moots
    VaMoots  <--  is a link
  Lemond
    Zurich  <--  is a link
    Chambery  <--  is a link
    BuenosAries  <-- is a link
    Tourmalet  <-- is a link
Dirt


If you realy want

  Trek
  Schwinn
  Moots
  Lemond
    Trek  <-- is a link
    Schwinn Fastback Pro  <-- is a link
    VaMoots  <--  is a link
    Zurich  <--  is a link
    Chambery  <--  is a link
    BuenosAries  <-- is a link
    Tourmalet  <-- is a link

You need to do the outer look twice, doing a reset() in it between them,
and doing the reset()s I have commented out in the example.  Be aware if
you go thru the array more than once in the program it will be needed.




Rick Widmer
Internet Marketing Specialists
http://www.developersdesk.com




  As the PHP manual indicates, we can use Mcrypt to do the encrypt and decrypt work in 
PHP, but that needs to download the encrypt module and recompile PHP.   Is there any 
other way to encrypt and decrypt the string in standard PHP4.0.4 without any extension 
module?

  Thank you very much!




You could use popen() to execute http://gnupg.org or PGP...

It would be easier to recompile PHP, though, and performance on popen() is
going to suck.

You *might* be able to compile just the encryption module, and use
dl("mcrypt.so") in your PHP script to load it up rather than recompile all
of PHP, but again, it's going to be harder, and performance will suffer.

Compiling PHP the *second* time is *way* easier than the first time,
especially if you've saved your previous PHP source tree and all the other
source trees -- There's a file in the PHP source tree called config.status,
and some other config.* files, that "remember" what you did last time.  So,
copy those somewhere safe, and then look at them.

You'll probably be able to copy config.status to config.zhu, and then edit
that to add --with-mcrypt (or whatever it is), and do:
chmod 755 config.zhu
./config.zhu

--
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
----- Original Message -----
From: Zhu George-CZZ010 <[EMAIL PROTECTED]>
Newsgroups: php.general
Sent: Friday, February 23, 2001 11:07 AM
Subject: [PHP] encrypt and decrypt in standard PHP


>   As the PHP manual indicates, we can use Mcrypt to do the encrypt and
decrypt work in PHP, but that needs to download the encrypt module and
recompile PHP.   Is there any other way to encrypt and decrypt the string in
standard PHP4.0.4 without any extension module?
>
>   Thank you very much!
>
> --
> 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]
>





I am using PHP4 + MySQL + PWS + Windows 98.

We are trying to port over a web site to a laptop for remote use.

However, when we execute a SQL query on a DB in which a filed of the record
contains a NULL value, we get an error.

The code is as follows:

        $GetQuery = mysql_query ("SELECT * FROM ApplicantsTbl WHERE App_ID = $qq");
        $AppResult = mysql_fetch_array ($GetQuery);
        $AppDOB = $AppResult[AppDOB];

The query executes just fine, and PARTS of the $AppResult array get
returned. However...

We are experiencing TWO problems:

First, unless we put quote marks around the index so it reads
$AppResult['AppDOB'], we get an undefined constant. This doesn't happen on
our Linux/Apache web server.

Second, if the field AppDOB contains a NULL value, PHP barks that there is
an undefined index. It appears that it won't even create the index.

I would appreciate any help you could be.

Greg





On Fri, Feb 23, 2001 at 12:20:19PM -0500, Greg Kopp wrote:
> I am using PHP4 + MySQL + PWS + Windows 98.
> We are experiencing TWO problems:
> 
> First, unless we put quote marks around the index so it reads
> $AppResult['AppDOB'], we get an undefined constant. This doesn't happen on
> our Linux/Apache web server.
> 
> Second, if the field AppDOB contains a NULL value, PHP barks that there is
> an undefined index. It appears that it won't even create the index.

I think you want to check the php.ini file. I believe error_reporting
can be changed to something less restrictive.

-- 
Jason Stechschulte
[EMAIL PROTECTED]
--
I knew I'd hate COBOL the moment I saw they'd used "perform" instead of
"do".
             -- Larry Wall on a not-so-popular programming language





Check your php.ini file.  

The line for error report is set to E_ALL by default.  Change it to
E_PARSE so that minor errors (like the one you mentioned) aren't reported
to the screen. 

Thanks.

On Fri, 23 Feb 2001, Greg Kopp wrote:

> I am using PHP4 + MySQL + PWS + Windows 98.
> 
> We are trying to port over a web site to a laptop for remote use.
> 
> However, when we execute a SQL query on a DB in which a filed of the record
> contains a NULL value, we get an error.
> 
> The code is as follows:
> 
>       $GetQuery = mysql_query ("SELECT * FROM ApplicantsTbl WHERE App_ID = $qq");
>       $AppResult = mysql_fetch_array ($GetQuery);
>       $AppDOB = $AppResult[AppDOB];
> 
> The query executes just fine, and PARTS of the $AppResult array get
> returned. However...
> 
> We are experiencing TWO problems:
> 
> First, unless we put quote marks around the index so it reads
> $AppResult['AppDOB'], we get an undefined constant. This doesn't happen on
> our Linux/Apache web server.
> 
> Second, if the field AppDOB contains a NULL value, PHP barks that there is
> an undefined index. It appears that it won't even create the index.
> 
> I would appreciate any help you could be.
> 
> Greg
> 
> 
> 





Addressed to: Jason Stechschulte <[EMAIL PROTECTED]>
              Greg Kopp <[EMAIL PROTECTED]>
              [EMAIL PROTECTED]

** Reply to note from Jason Stechschulte <[EMAIL PROTECTED]> Fri, 23 Feb 2001 12:59:05 
-0500
>
> On Fri, Feb 23, 2001 at 12:20:19PM -0500, Greg Kopp wrote:
> > I am using PHP4 + MySQL + PWS + Windows 98.
> > We are experiencing TWO problems:
> >
> > First, unless we put quote marks around the index so it reads
> > $AppResult['AppDOB'], we get an undefined constant. This doesn't happen on
> > our Linux/Apache web server.
> >
> > Second, if the field AppDOB contains a NULL value, PHP barks that there is
> > an undefined index. It appears that it won't even create the index.
>
> I think you want to check the php.ini file. I believe error_reporting
> can be changed to something less restrictive.

That might be good for a temporary solution, but not having quotes there
ia a potential bug waiting to happen.  That is why it there is a warning
about it.




Rick Widmer
Internet Marketing Specialists
http://www.developersdesk.com




On Fri, Feb 23, 2001 at 11:47:12AM -0700, [EMAIL PROTECTED] wrote:
> That might be good for a temporary solution, but not having quotes there
> ia a potential bug waiting to happen.  That is why it there is a warning
> about it.

I agree.  Since he didn't use the quotes on the live system though, I
took it to mean that he wasn't using many if any constants.  So it
should not be a problem to change the error reporting level.  

-- 
Jason Stechschulte
[EMAIL PROTECTED]
--
There's some entertainment value in watching people juggle nitroglycerin.
             -- Larry Wall in <[EMAIL PROTECTED]>




Thanks a ton to all. That did the trick.

Greg

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 23, 2001 1:47 PM
To: Jason Stechschulte; Greg Kopp; [EMAIL PROTECTED]
Subject: Re: [PHP] Undefinded Index on Mysql Result under Win98/PWS


Addressed to: Jason Stechschulte <[EMAIL PROTECTED]>
              Greg Kopp <[EMAIL PROTECTED]>
              [EMAIL PROTECTED]

** Reply to note from Jason Stechschulte <[EMAIL PROTECTED]> Fri, 23 Feb 2001
12:59:05 -0500
>
> On Fri, Feb 23, 2001 at 12:20:19PM -0500, Greg Kopp wrote:
> > I am using PHP4 + MySQL + PWS + Windows 98.
> > We are experiencing TWO problems:
> >
> > First, unless we put quote marks around the index so it reads
> > $AppResult['AppDOB'], we get an undefined constant. This doesn't happen
on
> > our Linux/Apache web server.
> >
> > Second, if the field AppDOB contains a NULL value, PHP barks that there
is
> > an undefined index. It appears that it won't even create the index.
>
> I think you want to check the php.ini file. I believe error_reporting
> can be changed to something less restrictive.

That might be good for a temporary solution, but not having quotes there
ia a potential bug waiting to happen.  That is why it there is a warning
about it.




Rick Widmer
Internet Marketing Specialists
http://www.developersdesk.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]







This is the first time I have used a new socket connection to send
header data *and* then retireve the echoed string.  This works fine.  I
get the result string and I am able to parse out the first element,
which is the status code.

Now here is where I am stuck!  I cannot go to another page!  I have
tried opening another socket and I have tried creating a Form with

     <Form Action="newpage.php" Method="Post">

All of them give me an error.

Help!!!!!!!!!

Todd

<?
    /* The $info variable contains the information to send to
       Authorize.net */
    $info = "SID=". $sid .
         "&x_ADC_Delim_Data=TRUE"  .
         "&x_Amount=" . urlencode($pu_amount) .
         "&x_Test_Request=" . $test .
         "&x_Card_Num=" . $pu_ccno .
         "&x_Exp_Date=" . $pu_exp .
         "&x_Login=" . $login .
         "&x_ADC_URL=FALSE" .
         "&jump=" . urlencode($jump);

    /* Now we will open a socket to Authorize.net and send
       the information using my class, $http */

    $http = new http;  // This is a class

    $fp = $http->http_fpost($server, $sendto, $info);

    /* Read the comma delimited string echoed back */
    if($fp) {
      print '<BASE HREF="' . $url . '"><p>';

      $result = fread($fp,10000);
      fclose($fp);

      $tokenarray = split(",",$result);
      $response = $tokenarray[0];
      // Response contains "1" which is success
    }
?>

Now I cannot go any further.
I need to go to a page, password.php!!
All efforts give an error message.

--
Todd Cary
Ariste Software
[EMAIL PROTECTED]






> Now I cannot go any further.
> I need to go to a page, password.php!!
> All efforts give an error message.

What error message?

Would it perchance, be the one about "headers already sent"?

You need to *NOT* have *ANY* output to the browser before you attempt to do:
header("Location: password.php");

Output includes "echo" or "print" statements, error messages, <HTML>, or
*EVEN* (and this is the killer) blank lines outside <?php ?> tags.

Specifically, if you include a file, and that file has a newline after the
?> at the end, you can't do a header after that.  Get rid of the trailing
newline.

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






Yup. Go figure.

Don Johnson


> It works if you execute only the SELECT (without the UPDATE) ?
> 
> Christian Reiniger
> LGDC Webmaster (http://sunsite.dk/lgdc/)
> 
> On Friday 23 February 2001 16:57, Don Johnson wrote:
>> Yup, the data's correct. The new records all have the
>> DownloadedDateTime as '0000-00-00 00:00:00'
> 

> >> SELECT * from db_table WHERE (DownloadedDateTime = '0000-00-00
> >> 00:00:00')

> >> UPDATE LOW_PRIORITY db_table SET
> >> DownloadedDateTime=CURRENT_TIMESTAMP WHERE (DownloadedDateTime =
> >> '0000-00-00 00:00:00')






Sorry for the other (empty) mail...

On Friday 23 February 2001 19:27, Don Johnson wrote:
> Yup. Go figure.
>
> Don Johnson
>
> > It works if you execute only the SELECT (without the UPDATE) ?

Then are you 100% sure that you execute the SELECT first (echo something 
on each query and check the order)?
Perhaps you can also post the actual code..

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

...10001000110101011010101101011110111010113...????




Hello,

I need to take a string and remove everything from the first "<" character
to the end of the line.  I'm pretty sure I could do this with an
ereg_replace(), but I am horrible at regular expressions.  Could anyone help
me with this?

- John Vandebreck
- Admin, GameDesign





On Friday 23 February 2001 19:33, John Vanderbeck wrote:

> I need to take a string and remove everything from the first "<"
> character to the end of the line.  I'm pretty sure I could do this with
> an ereg_replace(), but I am horrible at regular expressions.  Could
> anyone help me with this?

Well, I prefer preg_* :)

$mystring = preg_replace ('/<.*/', '', $mystring);

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

...10001000110101011010101101011110111010113...????




On Friday 23 February 2001 19:27, Don Johnson wrote:
> Yup. Go figure.
>
> Don Johnson
>
> > It works if you execute only the SELECT (without the UPDATE) ?
> >
> > Christian Reiniger
> > LGDC Webmaster (http://sunsite.dk/lgdc/)
> >
> > On Friday 23 February 2001 16:57, Don Johnson wrote:
> >> Yup, the data's correct. The new records all have the
> >> DownloadedDateTime as '0000-00-00 00:00:00'
> >>
> > >> SELECT * from db_table WHERE (DownloadedDateTime = '0000-00-00
> > >> 00:00:00')
> > >>
> > >> UPDATE LOW_PRIORITY db_table SET
> > >> DownloadedDateTime=CURRENT_TIMESTAMP WHERE (DownloadedDateTime =
> > >> '0000-00-00 00:00:00')

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

...10001000110101011010101101011110111010113...????




I have a form that submits to abc.php which then calls db.php and db.php
then redirects to a new URL.  I have session_start(); on all these files and
I'm registering the variables I need.  It seems that the session dies or
gets lost on it's way through all the included files.  I then tried to pass
the SID in the URL that the db.php file creates, but the SID is empty once
it gets here...though, there is a SID befoer then.  Can sessions not be used
with multple include files?  What could I be doing wrong?  This is my first
forray into sessions...be gentle!

thanks!

Some code below, it's prettry straight forward.  I still have cookies
enabled, as well.  Do I need to disable cookies for the SID in URL method to
work?

index.php where they log in from
<?
session_start();  //first line of file
?>
<form method="POST" action="main.php">
<input type="hidden" value="lrlogin" name="form_action">
Username&nbsp;&nbsp;<input type="text" name="username" class="color"><br />
Password&nbsp;&nbsp;<input class="color" type="password" name="password"><br
/>
<input type="reset">&nbsp;&nbsp;&nbsp;<input type="submit" value="Login">

code from main.php
<?
session_register();
require ("db.php");
if $form_action == "lrlogin"
{
get_user($username,$password);
}
?>

code from db.php
<?
session_start();
SQL to select user info from db
$access = $row[access_level]; //etc getting vars from db
session_register("username");
session_register("password");
session_register("access");
session_register("active");
header("Location:http://www.blah.com/index2.php?=".SID);
exit;
?>

index2.php code
<?
session_start();

print "Welcome $username";
?>

it only prints Welcome ...no username :(





some comments on sessions

- $PHPSESSID will only be set after the first page refresh.
- SID will only be set if your not using cookies.
- sessions with not transfer across multiple domain names.
- sessions without cookies will not transfer accross full urls.

<?php

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

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

?>

use this code and

- sessions will transfer across full urls when using $SID
- sessions will transer across multiple domain names on the same server
using $SID
- both $PHPSESSID and $SID are set allways set.

remember that header redirects *require* full urls so you will have to use
$SID.

    header("Location: http://$SERVER_NAME/index.php?$SID");


--

 Chris Lee
 Mediawaveonline.com

 ph. 250.377.1095
 ph. 250.376.2690
 fx. 250.554.1120

 [EMAIL PROTECTED]



""Jon Rosenberg"" <[EMAIL PROTECTED]> wrote in message
001301c09dc9$fc471c80$[EMAIL PROTECTED]">news:001301c09dc9$fc471c80$[EMAIL PROTECTED]...
> I have a form that submits to abc.php which then calls db.php and db.php
> then redirects to a new URL.  I have session_start(); on all these files
and
> I'm registering the variables I need.  It seems that the session dies or
> gets lost on it's way through all the included files.  I then tried to
pass
> the SID in the URL that the db.php file creates, but the SID is empty once
> it gets here...though, there is a SID befoer then.  Can sessions not be
used
> with multple include files?  What could I be doing wrong?  This is my
first
> forray into sessions...be gentle!
>
> thanks!
>
> Some code below, it's prettry straight forward.  I still have cookies
> enabled, as well.  Do I need to disable cookies for the SID in URL method
to
> work?
>
> index.php where they log in from
> <?
> session_start();  //first line of file
> ?>
> <form method="POST" action="main.php">
> <input type="hidden" value="lrlogin" name="form_action">
> Username&nbsp;&nbsp;<input type="text" name="username" class="color"><br
/>
> Password&nbsp;&nbsp;<input class="color" type="password"
name="password"><br
> />
> <input type="reset">&nbsp;&nbsp;&nbsp;<input type="submit" value="Login">
>
> code from main.php
> <?
> session_register();
> require ("db.php");
> if $form_action == "lrlogin"
> {
> get_user($username,$password);
> }
> ?>
>
> code from db.php
> <?
> session_start();
> SQL to select user info from db
> $access = $row[access_level]; //etc getting vars from db
> session_register("username");
> session_register("password");
> session_register("access");
> session_register("active");
> header("Location:http://www.blah.com/index2.php?=".SID);
> exit;
> ?>
>
> index2.php code
> <?
> session_start();
>
> print "Welcome $username";
> ?>
>
> it only prints Welcome ...no username :(
>
>
> --
> 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]
>






> index.php where they log in from
> <?
> session_start();  file://first line of file

Okay.

> ?>
> <form method="POST" action="main.php">
> <input type="hidden" value="lrlogin" name="form_action">
> Username&nbsp;&nbsp;<input type="text" name="username" class="color"><br
/>

<br/> ?  You been typing too much XML?... :-)

Shouldn't hurt.

> Password&nbsp;&nbsp;<input class="color" type="password"
name="password"><br
> />
> <input type="reset">&nbsp;&nbsp;&nbsp;<input type="submit" value="Login">
>
> code from main.php
> <?
> session_register();

Register what?  You're supposed to register a variable name...

> require ("db.php");
> if $form_action == "lrlogin"
> {
> get_user($username,$password);
> }
> ?>
>
> code from db.php
> <?
> session_start();

Doing this after you registered a variable is bogus -- The
session_register() automatically calls this if you haven't yet.

> SQL to select user info from db
> $access = $row[access_level]; file://etc getting vars from db
> session_register("username");
> session_register("password");
> session_register("access");
> session_register("active");
> header("Location:http://www.blah.com/index2.php?=".SID);

Doing session_start() (and, by extension, session_register()) in the same
file as a header("Location:") won't work on some browsers.  You'll either
get the cookie but no redirection or vice versa, depending on which browser
you are using.

And there should be a space after 'Location:'
And you probably need SID= for the SID to get passed on.
header("Location: http://www.blah.com/index2.php?SID=".SID);

> exit;
> ?>
>
> index2.php code
> <?
> session_start();
>
> print "Welcome $username";
> ?>
>
> it only prints Welcome ...no username :(

--
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've just built Apache 1.3.17 on Free BSD, using php-4.0.1pl2 and linking 
with the postgres 7.0.3 as a shared object.

I also linked in mySQL support, which works correctly.  When I try 
accessing the posgres database by calling pg_Connect(), my web server 
doesn't even display a page, other than "this page cannot be displayed" (in 
IE) or "page contains no data" (Netscape).

The error log displays:
(null): Undefined symbol "_PQsetdbLogin" called from 
httpd:/com/apache/libexec/libphp4.so at 0x8256498

1) Why isn't the function call resolving?  It appears to be in the postgres 
library.
2) What's with the format of the error message?  There isn't a date or 
error level field.  I'm guessing the error occurred somewhere very early in 
the Apache parsing process.

Does Postgres 7.0.3 work with PHP 4?

thanks





Is it possible to target a frame in the Location: of
a header? Sorry if this has been brought up a 
million times before.
Jeff Oien




> Is it possible to target a frame in the Location: of
> a header? Sorry if this has been brought up a
> million times before.

No.

You *can* pass enough information to the FRAMESET page that it will load the
right content for each sub-FRAME.

http://yoursite.com/main.php?nav=a.php&top=b.php&content=c.php

---- main.php ---------------------------
<FRAMESET ...>
    <FRAME SRC=<?php echo $nav;?> ...>
    <FRAME SRC=<?php echo $top;?> ...>
    <FRAME SRC=<?php echo $content;?> ...>
</FRAMESET>

In essence, you are "losing" the feature of frames that lets only one change
on a given HTTP interchange, but you still have frames (God knows why you
want them) and each FRAME gets the right content in it...

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






Hello,

I have a string of 1034 and I want to have an array that has each number in
an element.(ex: num[0] = 1, num[1] = 0, num[2] = 3 num[3] = 4) Is there a
way to explode a string by each character?

Thank you,

--------------------------------------------
Brandon Orther
WebIntellects Design/Development Manager
[EMAIL PROTECTED]
800-994-6364
www.webintellects.com
--------------------------------------------





> I have a string of 1034 and I want to have an array that has each number in
> an element.(ex: num[0] = 1, num[1] = 0, num[2] = 3 num[3] = 4) Is there a
> way to explode a string by each character?


Just convert it to a string:  ie. $foo = (string)$num; echo $foo[1];

-Rasmus






If $string is a string, like :

   $string = '312'; 

Then one can do :

   $string[0]; // 3
   $string[1]; // 1
   $string[2]; // 2

Note, '312' is a string and will work using above but if we define 312 as 
an integer like :

   $string = 312;

Then $string[0] will not "work" and it'll need to be juggled as a string
first, see :

   http://www.php.net/manual/en/language.types.type-juggling.php

Also, if you want to create an array and not do the above then check
out the following, an example exists to do this :

   http://www.php.net/manual/en/function.preg-split.php



Regards

Philip Olson
http://www.cornado.com/

On Fri, 23 Feb 2001, Brandon Orther wrote:

> Hello,
> 
> I have a string of 1034 and I want to have an array that has each number in
> an element.(ex: num[0] = 1, num[1] = 0, num[2] = 3 num[3] = 4) Is there a
> way to explode a string by each character?
> 
> Thank you,
> 
> --------------------------------------------
> Brandon Orther
> WebIntellects Design/Development Manager
> [EMAIL PROTECTED]
> 800-994-6364
> www.webintellects.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]
> 






Thank you very much  :)

-----Original Message-----
From: Boaz Yahav [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 23, 2001 4:55 AM
To: '[EMAIL PROTECTED]'; [EMAIL PROTECTED]
Subject: RE: [PHP] Counter Help


Fixed.

Sincerely

      berber

Visit http://www.weberdev.com Today!!!
To see where PHP might take you tomorrow.


-----Original Message-----
From: Navid Yar [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 23, 2001 10:39 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Counter Help


Actually, I couldn't find the article number for that tutorial. I did,
however, place a comment directly into that specific web page with the fix.
Here is a direct link to the tutorial (I left the frames out):
http://www.weberdev.com/ViewArticle.php3?ArticleID=30. Thanks.

Navid

-----Original Message-----
From: Boaz Yahav [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 23, 2001 12:50 AM
To: '[EMAIL PROTECTED]'; [EMAIL PROTECTED]
Subject: RE: [PHP] Counter Help


WeberDev will fix it ASAP if you tell it the number of the example :)

Sincerely

      berber

Visit http://www.weberdev.com Today!!!
To see where PHP might take you tomorrow.


-----Original Message-----
From: Navid Yar [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 23, 2001 6:25 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Counter Help


Chris,

It worked! Thanks so much! Weberdev needs to fix it too.

Navid

-----Original Message-----
From: Chris Lee [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 22, 2001 4:46 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Counter Help


change

$row[count]

to

$row['count']

it thinks the work [count] is some kind of conastant, it doesnt know you
mean (string) 'count'


--

 Chris Lee
 Mediawaveonline.com

 ph. 250.377.1095
 ph. 250.376.2690
 fx. 250.554.1120

 [EMAIL PROTECTED]



""Navid Yar"" <[EMAIL PROTECTED]> wrote in message
000101c09d2d$135683e0$[EMAIL PROTECTED]">news:000101c09d2d$135683e0$[EMAIL PROTECTED]...
> Can someone help me with this script? It is an example from weberdev.com.
I
> ran it and it gave me the following error...
>
> -- Warning: Use of undefined constant count - assumed 'count' in
> c:\windows\desktop\localhost\examples\counter\counter1.php on line 27
> 25
>
> The number 25 is the correct number for the counter, but how do I get rid
of
> that error message that keeps coming up before the counter number (25)? I
am
> testing and learning PHP on Windows ME and am using PHP 4.0.4 with MySQL
> 3.23.33. Here is the script:
>
> <HTML>
> <HEAD>
> <TITLE></TITLE>
> </HEAD>
>
> <BODY>
>
> <!-- This example from
>
http://www.weberdev.com/index.php3?GoTo=ShowShoppingItems.php3%3FMasterCateg
>  -->
>
> <?php
> $hostname = 'localhost';
> $username = 'username';
> $password = 'password';
> $dbName = 'database';
> MYSQL_CONNECT($hostname,$username,$password) OR DIE("Unable to connect to
> database");
> @mysql_select_db("$dbName") or die("Unable to select database");
>
> $name = "$SCRIPT_NAME";
>
> $result = MYSQL_QUERY("SELECT * FROM counter WHERE (name = '$name')") or
die
> ("Bad query: ".mysql_error());
> $row = mysql_fetch_array($result);
>
> if($row){
> MYSQL_QUERY("UPDATE counter SET count = count+1 WHERE (name = '$name')")
or
> die ("Bad query: ".mysql_error());
> $count = $row[count];
> }else{
> MYSQL_QUERY("INSERT INTO counter VALUES ('', '$name', '2')") or die ("Bad
> query: ".mysql_error());
> $count = '1';
> }
> echo $count;
> ?>
>
> </BODY>
> </HTML>
>
> -- Navid
>
>
> --
> 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 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]






I've been trying to get the cgi version of php working with Apache and
suexec but so far I have not had much success.  I've installed the Apache
module version of php and it seems to work fine. I then installed the 
cgi version of php and it too seems to work fine as long as it
doesn't run through suexec.  Suexec works fine for other (perl, c,
etc...) cgi's.

Here's what I have in Apache's httpd.conf:
AddType application/x-httpd-php .php
Action application/x-httpd-php /cgi-bin/php.cgi
  
When I try to access a .php file I get an error about the command not
being in the document root.  This is one of the tests suexec performs and
it is true, the cgi-bin directory (and hence the php binary) is not under
the document root (although the .php file is).

If I change httpd.conf to this:
ScriptAlias /php-bin/ "/local/www/php/"
AddType application/x-httpd-php .php
Action application/x-httpd-php /php-bin/php.cgi
 
Now the php binary is under the document root but when I try to access a
.php file I get an error that the target uid/gid does not match that of
the directory or program.  This is also true since the php binary is owned
by the web server and the .php file is owned by another user.

So my question is "What am I missing?".  How can I ever get the cgi
version of php to work with suexec?  The php binary is owned by the web
server but the .php files will be owned by other users.  

Here is some more information about the environment in which I am working
in case it is relevant:

Solaris 7
Apache 1.3.17
php 4.04pl1

I'm just about ready to give up on this one.  Thanks in advance for any
and all help.
 
-john






Don't use safe-mode in your suExec PHP CGI configure.

suExec pretty much does everything safe mode does anyway, and more.

--
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
----- Original Message -----
From: <[EMAIL PROTECTED]>
Newsgroups: php.general
Sent: Friday, February 23, 2001 1:18 PM
Subject: [PHP] php (cgi version) with Apache and suexec - help


>
> I've been trying to get the cgi version of php working with Apache and
> suexec but so far I have not had much success.  I've installed the Apache
> module version of php and it seems to work fine. I then installed the
> cgi version of php and it too seems to work fine as long as it
> doesn't run through suexec.  Suexec works fine for other (perl, c,
> etc...) cgi's.
>
> Here's what I have in Apache's httpd.conf:
> AddType application/x-httpd-php .php
> Action application/x-httpd-php /cgi-bin/php.cgi
>
> When I try to access a .php file I get an error about the command not
> being in the document root.  This is one of the tests suexec performs and
> it is true, the cgi-bin directory (and hence the php binary) is not under
> the document root (although the .php file is).
>
> If I change httpd.conf to this:
> ScriptAlias /php-bin/ "/local/www/php/"
> AddType application/x-httpd-php .php
> Action application/x-httpd-php /php-bin/php.cgi
>
> Now the php binary is under the document root but when I try to access a
> .php file I get an error that the target uid/gid does not match that of
> the directory or program.  This is also true since the php binary is owned
> by the web server and the .php file is owned by another user.
>
> So my question is "What am I missing?".  How can I ever get the cgi
> version of php to work with suexec?  The php binary is owned by the web
> server but the .php files will be owned by other users.
>
> Here is some more information about the environment in which I am working
> in case it is relevant:
>
> Solaris 7
> Apache 1.3.17
> php 4.04pl1
>
> I'm just about ready to give up on this one.  Thanks in advance for any
> and all help.
>
> -john
>
>
>
> --
> 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]
>





I have a string that contains a number such as: $string = '12345'

I want that to read 12,345 though.  Is there any way in which I can insert a 
comma in there in the correct places?

-Matt





Use number_format() :

    http://www.php.net/manual/en/function.number-format.php

    echo number_format($number);

Other options exist with this function, it's pretty useful.  


Regards

Philip Olson
http://www.cornado.com/

On Fri, 23 Feb 2001 [EMAIL PROTECTED] wrote:

> I have a string that contains a number such as: $string = '12345'
> 
> I want that to read 12,345 though.  Is there any way in which I can insert a 
> comma in there in the correct places?
> 
> -Matt
> 





"Steve Kenshalo" <[EMAIL PROTECTED]> wrote:
> I am working on a PHP script for an e-commerce site that mails out calling
> card pin numbers after somebody purchases them online. Turing testing I
not
> noticed that aol users were not receiving the messages. AOL seems to be
> filtering them out without sending a bounce or anything. We tried it with

My guess is AOL might be filtering out emails that have a Return-Path header
of "nobody" or something similar.  If PHP is running as an Apache module I
don't think there's a way to change this header as I believe it's
automatically set to the owner of Apache.  Perhaps if you run the script
using a CGI install of PHP using a different user AOL will accept it.  Have
you contacted AOL about the problem?

--
Steve Werby
COO
24-7 Computer Services, LLC
Tel: 804.817.2470
http://www.247computing.com/





Is there a way to simulate a form submission to a cgi-script using PHP?  I
am trying to write a script that will replace the frontend of another CGI
script with a customized one of my own, but I need to be able to pass form
data into the next page in the cgi (including a password).


Matthew Aznoe
Fuzz Technologies
[EMAIL PROTECTED]




Search the net for Rasmus Lerdorf's "posttohost" function from long, long
ago.

--
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
----- Original Message -----
From: "Matthew Aznoe" <[EMAIL PROTECTED]>
Newsgroups: php.general
Sent: Friday, February 23, 2001 2:37 PM
Subject: [PHP] Submitting Form Information


> Is there a way to simulate a form submission to a cgi-script using PHP?  I
> am trying to write a script that will replace the frontend of another CGI
> script with a customized one of my own, but I need to be able to pass form
> data into the next page in the cgi (including a password).
>
>
> Matthew Aznoe
> Fuzz Technologies
> [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]





I am opening the top level of a a directory structure with dir. I want make
a list of the subdirectories, but not the files. Is there a file test
operator like perl's -d in php? I will then have to go into the sub
directories to perform actions on non directory files







Addressed to: "Kevin Beckford" <[EMAIL PROTECTED]>
              [EMAIL PROTECTED]

** Reply to note from "Kevin Beckford" <[EMAIL PROTECTED]> Fri, 23 Feb 2001 
15:42:26 -0500
>
> I am opening the top level of a a directory structure with dir. I want make
> a list of the subdirectories, but not the files. Is there a file test
> operator like perl's -d in php? I will then have to go into the sub
> directories to perform actions on non directory files

I bet there is...

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

Would be a good place to find out.


Hint:  look for  is_file()  or  is_dir().




Rick Widmer
Internet Marketing Specialists
http://www.developersdesk.com




> I am opening the top level of a a directory structure with dir. I want
make
> a list of the subdirectories, but not the files. Is there a file test
> operator like perl's -d in php? I will then have to go into the sub
> directories to perform actions on non directory files

http://php.net/is_dir

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






Does anyone have examples of using DTD's with the xml_parse functions?

Regards

Mark




Mark Newnham wrote:
> 
> Does anyone have examples of using DTD's with the xml_parse functions?

http://php.net/xml Example 4 uses an external DTD. Internal DTD's are
also possible.

-Egon

-- 
SIX Offene Systeme GmbH       ·        Stuttgart  -  Berlin 
Sielminger Straße 63   ·    D-70771 Leinfelden-Echterdingen
Fon +49 711 9909164 · Fax +49 711 9909199 http://www.six.de
Besuchen Sie uns auf der CeBIT 2001,  Halle 6,  Stand F62/4




Hi there,

I want to download PHP from my Linux server, but I can't just type "lynx
http://www.php.net/do_download.php?download_file=php-4.0.4pl1.tar.gz&source_
site=www.php.net"

This is the link in the PHP downloads page, but the shell gets confused by
the & character.

What should I do?

Best Regards,

Jorge.






lynx -source 
http://www.php.net/do_download.php?download_file=php-4.0.4pl1.tar.gz&source_site=www.php.net
 > php-4.0.4pl1.tar.gz will work - also try wget

--Joe

On Fri, Feb 23, 2001 at 03:28:14PM -0600, Jorge Alvarez wrote:
> Hi there,
> 
> I want to download PHP from my Linux server, but I can't just type "lynx
> http://www.php.net/do_download.php?download_file=php-4.0.4pl1.tar.gz&source_
> site=www.php.net"
> 
> This is the link in the PHP downloads page, but the shell gets confused by
> the & character.
> 
> What should I do?
> 
> Best Regards,
> 
> Jorge.
> 
> 
> 
> -- 
> 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
-------------------------------------------------------------------------------





Im running php 4.0.4pl1

Fatal error:  Call to undefined function:   chunk_split() in
/home/httpd/vhosts/myhearingstore/mail.egn on line 33

is there a configure option  im supposed to compile in ?


--

 Chris Lee
 Mediawaveonline.com

 ph. 250.377.1095
 ph. 250.376.2690
 fx. 250.554.1120

 [EMAIL PROTECTED]







ok, works now, strange stuff, cut and paste from opera and you'll get
problems like this, strange strange....


--

 Chris Lee
 Mediawaveonline.com

 ph. 250.377.1095
 ph. 250.376.2690
 fx. 250.554.1120

 [EMAIL PROTECTED]



""Chris Lee"" <[EMAIL PROTECTED]> wrote in message
976kjm$8cl$[EMAIL PROTECTED]">news:976kjm$8cl$[EMAIL PROTECTED]...
> Im running php 4.0.4pl1
>
> Fatal error:  Call to undefined function:   chunk_split() in
> /home/httpd/vhosts/myhearingstore/mail.egn on line 33
>
> is there a configure option  im supposed to compile in ?
>
>
> --
>
>  Chris Lee
>  Mediawaveonline.com
>
>  ph. 250.377.1095
>  ph. 250.376.2690
>  fx. 250.554.1120
>
>  [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]
>








> Im running php 4.0.4pl1
> 
> Fatal error:  Call to undefined function:   chunk_split() in
> /home/httpd/vhosts/myhearingstore/mail.egn on line 33
> 
> is there a configure option  im supposed to compile in ?

What version of PHP does <?php phpinfo();?> claim you are running?...

-- 
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've gone through the manual and user notes on these functions, and they
tend to be highly illogical ;-) The numbers don't coincide, the x/y
values are negative when it seems they ought to be positive, etc. If
someone has already figured this out, would you post a code snippet that
will create an image the size of the ttf bounding box and draw the
string of text exactly centered on the image... this should work no
matter what string of text is used, what font is used, what font size is
used and if letters hang below the baseline or not.

Thanks
Monte




I have a auth system in the works and if a session is going then they 
are "logged in".

What's the best way to check to see if a session is currently in progress?

Mike




check if your session variable is set.

ie, lets say your session variable is called SessionID

<?php

    if (isset($HTTP_SESSION_VARS['SessionID']))
    {
        echo "SET <br>\n";
    }

?>

--

 Chris Lee
 Mediawaveonline.com

 ph. 250.377.1095
 ph. 250.376.2690
 fx. 250.554.1120

 [EMAIL PROTECTED]


"Michael Zornek" <[EMAIL PROTECTED]> wrote in message
news:a05001900b6bc8c348c90@[38.241.81.150]...
> I have a auth system in the works and if a session is going then they
> are "logged in".
>
> What's the best way to check to see if a session is currently in progress?
>
> Mike
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>






I want to open a html file from a php script. The problem is that the html
file is located in a password protected directory on an apache web server. I
know the user/password for that directory and I want the php script to
handle the authentification automaticly. Is there a way to acomplish this ?

Thank you,
Marius







Is it possible to specify an alternate SMTP host for use with imap_mail? Is
this what the rpath parameter is for? If so, what would the syntax be.

Thanks

Mark




Help!
I am trying to post some info to my php script using the microsoft internet control:

    strurl = http://www.myserver.com/test.asp
    strdata = "lah=sd&dta=test
    Inet1.Execute strurl, "POST", strdata

PHP returns HTTP_POST_VARS as being empty.
Yet, if I use PERL, I can read the posted info just fine.

PHP does work fine with normal php forms.

Why can PERL recognize my data, but PHP not, how are they handling the posted info 
differently?

Is there a way I can get PHP to display the raw data that the script receives so I can 
see what is happening?

Thanks for any help, 
Chris





mail seems to be just throwing the 'extra headers' in with the body...



  $email_text_body = "Hello {$people->people_name[$pos]} how are you
today?";

  $email_html_body  = "<html>";
  $email_html_body .= "<body>";
  $email_html_body .= "<table>";
  $email_html_body .= "<tr bgcolor=eeeeee>";
  $email_html_body .= "<td>";
  $email_html_body .= "<font size=+2 face=ffffff>Hello
{$people->people_name[$pos]} How are you today?</font>";
  $email_html_body .= "</td>";
  $email_html_body .= "</tr>";
  $email_html_body .= "</table>";
  $email_html_body .= "</body>";
  $email_html_body .= "</html>";

  $email_boundary = uniqid('HTML');

  $email_headers  = "From: MyHearingStore.com
<[EMAIL PROTECTED]>\r\n";
  $email_headers .= "Return-Path: <[EMAIL PROTECTED]>\r\n";
  $email_headers .= "MIME-Version: 1.0\r\n";
  $email_headers .= "Content-Type: multipart/alternative;\r\n
boundary='$email_boundary'\r\n";
  $email_headers .= "This is a multi-part message in MIME format.\r\n\r\n";

  $email_body  = "--$email_boundary\r\n";
  $email_body .= "Content-Type: text/plain;\r\n  charset='ISO-8859-1'\r\n";
  $email_body .= "Content-Transfer-Encoding: ISO-8859-1\r\n\r\n";
  $email_body .= $email_text_body;

  $email_body .= "--$email_boundary\r\n";
  $email_body .= "Content-Type: text/html;\r\n  charset=ISO-8859-1\r\n";
  $email_body .= "Content-Transfer-Encoding: ISO-8859-1\r\n\r\n";
  $email_body .= $email_html_body;

  mail($people->people_email[$pos], 'An HTML Message', $email_body,
$email_headers);




outputs this.





Return-Path: <nobody>
Received: (from nobody@localhost)
 by server.mediawaveonline.com (8.9.3/8.9.3) id PAA30279;
 Fri, 23 Feb 2001 15:55:53 -0800
Date: Fri, 23 Feb 2001 15:55:53 -0800
From: Nobody <[EMAIL PROTECTED]>
Message-Id: <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Status:

Subject: An HTML Message
From: MyHearingStore.com <[EMAIL PROTECTED]>
Return-Path: <[EMAIL PROTECTED]>
MIME-Version: 1.0
Content-Type: multipart/alternative;
  boundary='HTML3a96f889828b4'
This is a multi-part message in MIME format.



--HTML3a96f889828b4
Content-Type: text/plain;
  charset='ISO-8859-1'
Content-Transfer-Encoding: ISO-8859-1

Hello test how are you today?--HTML3a96f889828b4
Content-Type: text/html;
  charset=ISO-8859-1
Content-Transfer-Encoding: ISO-8859-1

<html><body><table><tr bgcolor=eeeeee><td><font size=+2 face=ffffff>Hello
test How are you today?</font></td></tr></table></body></html>



its supposed to be this.


Return-Path: <nobody>
Received: (from nobody@localhost)
 by server.mediawaveonline.com (8.9.3/8.9.3) id PAA30279;
 Fri, 23 Feb 2001 15:55:53 -0800
Date: Fri, 23 Feb 2001 15:55:53 -0800
From: Nobody <[EMAIL PROTECTED]>
Message-Id: <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: An HTML Message
From: MyHearingStore.com <[EMAIL PROTECTED]>
Return-Path: <[EMAIL PROTECTED]>
MIME-Version: 1.0
Content-Type: multipart/alternative;
  boundary='HTML3a96f889828b4'
This is a multi-part message in MIME format.
Status:


--HTML3a96f889828b4
Content-Type: text/plain;
  charset='ISO-8859-1'
Content-Transfer-Encoding: ISO-8859-1

Hello test how are you today?--HTML3a96f889828b4
Content-Type: text/html;
  charset=ISO-8859-1
Content-Transfer-Encoding: ISO-8859-1

<html><body><table><tr bgcolor=eeeeee><td><font size=+2 face=ffffff>Hello
test How are you today?</font></td></tr></table></body></html>



any idea's ???


--

 Chris Lee
 Mediawaveonline.com

 ph. 250.377.1095
 ph. 250.376.2690
 fx. 250.554.1120

 [EMAIL PROTECTED]







venin all,

   Appologies in advance for the lengthy email. I have been
working on an ANSI to HTML converter for over 3 months now.
I am trying to get a socket to open up, read in the buffer,
and if any ANSI color codes are found, convert them to their
proper FONT tags. The socket callin is working fine. ( Though
I can't seem to get it to close properly after the login
screen of a game is completed ) This script is made to call
MUD's ( multi user dungeon ) games. Some of these muds have
color capable logins, and I'd like to convert those login
screens to HTML FONT.

   The purpose of this email is to request any help at
all in the completion of this small script. My string
function handling in any language is rusty at best. If
any on this list can give me some pointers, helpfull hints,
or debugging statements, it would be most appreciated.



The below script calls a host and a specific port ( I
hard coded in my game as an example ). If you save
this script, and run it, you will see what I am referring
to. It calls the game, and retrieves the login screen.


-------------------script begins below------------------

  
<HTML>
<BODY BGCOLOR="BLACK" TEXT="WHITE">
<big><TT>
<?
/* Function to convert each ANSI color to its appropriate
 * HTML FONT color. When an entry is sent, it is sent as
 * a single number
 */
function convert( $entry )
{
        switch ($entry)
        {
                 case '0':  return "</FONT>"; break;
                 case '1':  return "<strong>"; break;
                 case '2':  return "Dim"; break;
                 case '4':  return "<u>"; break;  
                 case '5':  return ""; break;
                 case '7':  return "Reverse"; break;
                 case '8':  return "Hidden"; break;
                 case '30':  return "<FONT COLOR=\"BLACK\">"; break;
                 case '31':  return "<FONT COLOR=#ff0019>"; break;
                 case '32':  return "<FONT COLOR=\"GREEN\">"; break;
                 case '33':  return "<FONT COLOR=\"YELLOW\">"; break;
                 case '34':  return "<FONT COLOR=#2626c1>"; break;
                 case '35':  return "<FONT COLOR=\"PURPLE\">"; break;
                 case '36':  return "<FONT COLOR=\"99FFFF\">"; break;
                 case '37':  return "<FONT COLOR=\"WHITE\">"; break;
                 case '40':  return "Black"; break;
                 case '41':  return "Red"; break;
                 case '42':  return "Green"; break;
                 case '43':  return "Yellow"; break;
                 case '44':  return "Blue"; break;
                 case '45':  return "Magenta"; break;
                 case '46':  return "Cyan"; break;
                 case '47':  return "White"; break;
                 default: return "UKNOWN"; break;
        }
}        

$query_str= "Memory";

 
$fp = fsockopen("kyndig.com", 9000, &$errno, &$errstr);
if (!$fp) 
{
        echo "ERROR: $errno - $errstr<br>\n";
        exit;
} 
else 
{
        fputs($fp, "\n");
        while(!feof($fp)) 
        {
                $buf = fgets($fp,4096);

                /* Lets store what it really looks like in another
variable */
                $actual .= $buf;

                /* We are looking for the most standard ANSI color
                 * codes here: example: [1;33;4m
                 */
                if (preg_match("/\[\d+(;\d+)+m/",$buf))
                {
                        /* we don't want to reset the 'buf' we are
reading in */

                        $buffer = $buf;
                        /* first we pull out the matches and stick them
in an array   
                         * we also get rid of the [ at this point
                         */
                        preg_match_all("/\d+(;\d+)+m/",$buffer,
$matches);

                        for ($i=0; $i< count($matches[0]); $i++)
                        {
                                /* TEST is just a reference */
                                /* $TEST .= "matched:
".$matches[0][$i]."\n<br>";*/

                                /* We have isolated all color in a
single line in its own array now
                                 * It looks like:  [1;33;4m   or
[1;33m    For those that are [#m ANSI
                                 * code, the next ifcheck takes care of
them. Now lets go through each
                                 * code we have, split it up, and
convert it to HTML
                                 */
                                $code = $matches[0][$i];
                                list( $color1 , $color2, $color3 ) =
split( ";", $code);
                                $two = intval($color2);
                                $three = intval($color3);

                                $setting = convert($color1);
                                $foreground = convert($two);
                                if( $three != 0 )
                                {
                                        $background = convert($three);
                                }
                                if( $three == 0 )
                                {
                                        $background = "";
                                }

                                /* We now have the colors converter to
proper HTML format
                                 * Now we have to bring our buffer back,
and place all
                                 * the text around the ANSI code,
example: [1;33mt would
                                 * be <FONT COLOR="RED">t
                                 */             
                                if (preg_match("/\[\d+(;\d+)+m/",$buf) )
                                {
                                           $test =
preg_replace("/\[\d+(;\d+)+m/","", $buf);
                                }

                         
                                $final .=
"$setting$foreground$background$test<br>";
                                /*$final .= "<br>Color1: $color1 ====
Color2: $two ==== Color3: $three<br>"; */
                        }
                }     /* End ifcheck for common ANSI */
        }             /* End WHILE loop */


        /* Next We check against other not so common combinations
         * of ANSI colors, example: [1;33m and [0m;
         */
        if (preg_match("/\[\d+m/",$buffer))
        {
                       
                preg_match_all("/\[\d+m/",$buf, $matches);
                for ($i=0; $i< count($matches[0]); $i++)
                {
                     /*            $final .= "matched:
".$matches[0][$i]."\n<br>"; */
                }        
        }

        echo "$final";
        echo "<hr>";
        $proper = ereg_replace( "\n", "<br>", $actual);
        echo "\n</FONT><FONT COLOR=\"WHITE\">The actual image looks
like: $proper";
        fclose($fp);
}
?>
</BODY>
</HTML>

-----------------------------script
stops--------------------------------------------

Thankyou for any assistance in getting this script to work.
 
Kind Regards,
---
Kyndig
Online Text Game Resource Site:  http://www.kyndig.com
ICQ#    10451240




Ok, I must be missing something, but does anyone have a script that will
order by the closest date in the future that hasn't been here yet.  Did that
make sense?

Brian





To order by dates use SQL

select * from news order by PostDate DESC;

and then make sure that PostDate is a date or datetime - hell even an int with
a unix timestamp (aka time()) will work.

--Joe

On Fri, Feb 23, 2001 at 07:52:54PM -0500, Brian S. Drexler wrote:
> Ok, I must be missing something, but does anyone have a script that will
> order by the closest date in the future that hasn't been here yet.  Did that
> make sense?
> 
> Brian
> 
> 
> -- 
> 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
-------------------------------------------------------------------------------





On Fri, 23 Feb 2001, Brian S. Drexler wrote:
> Ok, I must be missing something, but does anyone have a script that will
> order by the closest date in the future that hasn't been here yet.  Did that
> make sense?
> 
> Brian
> 
$plusten = mktime(0,0,0,date("m"),date("d")+10,date("Y") );

Will take todays day, and add 10 days to it.
-- 
Kind Regards,
---
Kyndig
Online Text Game Resource Site:  http://www.kyndig.com
ICQ#    10451240





Thanks for your help.

I do work with MySql and that was going to be my final option. But because I
am still in the learning stages of PHP I was hoping for a simple save
command.

Not to worry. MySql it is.


Thanks,

Yobro


""Chris Lee"" <[EMAIL PROTECTED]> wrote in message
9748a0$5o2$[EMAIL PROTECTED]">news:9748a0$5o2$[EMAIL PROTECTED]...
: Your asking a huge question and expecting a small answer ie.
:
: php_save();
:
: the anser your looking or is not small, im sorry. your asking a big
: question, and with all big questions comes a big answer.
:
: Do you know how to use db's ? mysql? postgres? I'll assume you do. save
you
: changes in a db, pull those variables rom the db and arange the client
pages
: around this data.
:
: http://phpbuilder.com/columns/jesus19990308.php3
:
: has an article on learning to use mysql.
:
: if you dont have a db you can use, you could use xml, I would recommend
: installing a db before you tackeled this, you said you have till monday,
: this doesnt leave alot of time to learn xml and all that is assisiated
with
: it. your going to be pushing it to learn a db language by then.
:
: when php is run all the variables are rememberd, untill... php stops
: running, then all is lost, this is why you need a db, to remember all the
: data. you could use sessions, but this is not what your looking for.
: sessions are for remebering *one* persons info, not many people's, and not
: for long term, short term.
:
: --
:
:  Chris Lee
:  Mediawaveonline.com
:
:  ph. 250.377.1095
:  ph. 250.376.2690
:  fx. 250.554.1120
:
:  [EMAIL PROTECTED]
:
:
: ""YoBro"" <[EMAIL PROTECTED]> wrote in message
: 9746nm$gh3$[EMAIL PROTECTED]">news:9746nm$gh3$[EMAIL PROTECTED]...
: > Hi,
: >
: > My last message on this topic was a bit hard to translate. So here is
the
: > thought out version.
: >
: > 1.    I have a page on a server called admin.php (protected by htaccess
: for
: > admin use only)
: > 2.    This page holds variables that are changed by form elements.
: > (Checkboxes etc)
: >        And this in turn effects different parts of the site it is being
: used
: > in.
: > 3.    I want to know how to keep the changes to the form.
: >
: > Example: If i bring up the admin.php page in my browser and click a
: > checkbox, it permantly keeps it changed until i decide to change it
again.
: >
: > 4.    Is there some sort of PHP save command, that saves the state of a
: > page.
: > 5.    Any ideas?
: >
: > Please help, I gotta have this worked out by Monday or I'm dead.
: >
: > --
: > Regards,
: >
: >
: > YoBro
: > -------------------------------------------------------------
: > DO NOT REPLY TO THIS VIA EMAIL
: > PLEASE USE THE NEWSGROUP
: > All emails sent to this address are automatically deleted.
: > This is to avoid SPAM!
: > -------------------------------------------------------------
: >
: >
: >
: > --
: > 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]
:






Hello,
This is my first attempt, so I'm prolly doing something stupid, but can someone tell me why this doesn't work?
All it returns is "Unable to INSERT to database"
 
 
 
---BEGIN---
<?
   $time = time();
   $rand = Random_Password(5);
   $docid = $time . $rand;
 
    if (isset($email) && isset($docid)) {
        mysql_connect("$HOSTNAME", "$DB_USER", "$DB_PASS");
 
   $query = "INSERT INTO documents VALUES ('$docid', '$category', '$subcategory', '$date', '$subject', '$title', '$author', '$email', '$language', '$gr
ade', '$level', '$city', '$state', '$county', '$zip', '$authors_comments', '$teachers_comments', 'N', '$docdata')";
 
   $result = mysql_db_query("$DATABASE", $query) or die("Unable to INSERT to database");
 
    if ($result) {
        echo "<p>$docid was added to the database</p>";
    }
}
?>
 
     <h1>Submit a new document to the database</h1>
         <form>
         Email Address: <input type=text name=email><br>
         Category: <select name=category><? print "$CATEGORIES" ?></select><br>
         Sub Category: <select name=subcategory><? print "$SUBCATEGORIES" ?></select><br>
         Date Document was written: <input type=text name=date> (xx-xx-xxxx)<br>
         Document Subject: <input type=text name=subject><br>
         Document Title: <input type=text name=title><br>
         Document Author: <input type=text name=author><br>
         Document Language: <input type=text name=language value=English><br>
         Grade Received (Percentage): <input type=text name=grade size=3> (xx/100)<br>
         Grade Level of Paper: <select name=level><option>High School</option><option>College</option><option>Other</option></select><br>
         City in which paper was submitted: <input type=text name=city value=Jacksonville><br>
         State in which paper was submitted: <input type=text name=state value=FL><br>
         County in which paper was submitted: <input type=text name=county value=Duval> <b>(County, not Country!)</b><br>
         School at which paper was submitted: <input type=text name=school value="Mandarin High School"><br>
         ZIP code: <input type=text name=zip size=5 value=32257> <b>(Put your ZIP code in if you don't know your school's)</b><br>
         Author's Comments: <input type=text name=authors_comments><br>
         Teacher's Comments: <input type=text name=teachers_comments><br>
         Document (ASCII TEXT ONLY):<br>
         <textarea name=docdata cols=80 rows=30>Paste document text here</textarea>
         <p><input type=submit value="Submit for verification">
         </form>
 
-----END-----
 
 
 
TIA!
Clayton




Before your VALUES you need to have a list of the fields ie:

insert into table (id,fname,lname) values ('$id','$fname','$lname')

--joe

On Fri, Feb 23, 2001 at 08:00:30PM -0500, Clayton Dukes wrote:
> Hello,
> This is my first attempt, so I'm prolly doing something stupid, but can someone tell 
>me why this doesn't work?
> All it returns is "Unable to INSERT to database"
> 
> 
> 
> ---BEGIN---
> <?
>    $time = time();
>    $rand = Random_Password(5);
>    $docid = $time . $rand;
> 
>     if (isset($email) && isset($docid)) {
>         mysql_connect("$HOSTNAME", "$DB_USER", "$DB_PASS");
> 
>    $query = "INSERT INTO documents VALUES ('$docid', '$category', '$subcategory', 
>'$date', '$subject', '$title', '$author', '$email', '$language', '$gr
> ade', '$level', '$city', '$state', '$county', '$zip', '$authors_comments', 
>'$teachers_comments', 'N', '$docdata')";
> 
>    $result = mysql_db_query("$DATABASE", $query) or die("Unable to INSERT to 
>database");
> 
>     if ($result) {
>         echo "<p>$docid was added to the database</p>";
>     }
> }
> ?>
> 
>      <h1>Submit a new document to the database</h1>
>          <form>
>          Email Address: <input type=text name=email><br>
>          Category: <select name=category><? print "$CATEGORIES" ?></select><br>
>          Sub Category: <select name=subcategory><? print "$SUBCATEGORIES" 
>?></select><br>
>          Date Document was written: <input type=text name=date> (xx-xx-xxxx)<br>
>          Document Subject: <input type=text name=subject><br>
>          Document Title: <input type=text name=title><br>
>          Document Author: <input type=text name=author><br>
>          Document Language: <input type=text name=language value=English><br>
>          Grade Received (Percentage): <input type=text name=grade size=3> 
>(xx/100)<br>
>          Grade Level of Paper: <select name=level><option>High 
>School</option><option>College</option><option>Other</option></select><br>
>          City in which paper was submitted: <input type=text name=city 
>value=Jacksonville><br>
>          State in which paper was submitted: <input type=text name=state 
>value=FL><br>
>          County in which paper was submitted: <input type=text name=county 
>value=Duval> <b>(County, not Country!)</b><br>
>          School at which paper was submitted: <input type=text name=school 
>value="Mandarin High School"><br>
>          ZIP code: <input type=text name=zip size=5 value=32257> <b>(Put your ZIP 
>code in if you don't know your school's)</b><br>
>          Author's Comments: <input type=text name=authors_comments><br>
>          Teacher's Comments: <input type=text name=teachers_comments><br>
>          Document (ASCII TEXT ONLY):<br>
>          <textarea name=docdata cols=80 rows=30>Paste document text here</textarea>
>          <p><input type=submit value="Submit for verification">
>          </form>
> 
> -----END-----
> 
> 
> 
> TIA!
> Clayton
> 

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






> Hello, This is my first attempt, so I'm prolly doing something stupid,
> but can someone tell me why this doesn't work? All it returns is
> "Unable to INSERT to database"

Change : or die("Unable to INSERT to database");
To     : or die(mysql_error());

And see what it tells you.  Odds are there's a field not being accounted
for.  When not designating columns (just values) it's important to make
sure all columns are accounted for.  See :

    http://www.sqlcourse.com/

It'll provide some basic SQL help.  It's recommended to write out columns
and values (easier to make sense of).


Regards,

Philip Olson
http://www.cornado.com/
 
> 
> 
> ---BEGIN---
> <?
>    $time = time();
>    $rand = Random_Password(5);
>    $docid = $time . $rand;
> 
>     if (isset($email) && isset($docid)) {
>         mysql_connect("$HOSTNAME", "$DB_USER", "$DB_PASS");
> 
>    $query = "INSERT INTO documents VALUES ('$docid', '$category',
> '$subcategory', '$date', '$subject', '$title', '$author', '$email',
> '$language', '$gr ade', '$level', '$city', '$state', '$county',
> '$zip', '$authors_comments', '$teachers_comments', 'N', '$docdata')";
> 
>    $result = mysql_db_query("$DATABASE", $query) or die("Unable to
> INSERT to database");
> 
>     if ($result) {
>         echo "<p>$docid was added to the database</p>";
>     }
> }
> ?>





Well sheesh,
If I knew I could get answers that easy here, I woudn't have worked on this
for 20 hours :-)

THANKS!!!!

btw, field one is an ID field set to auto increment, how can I insert that
if I don't know what it is?


Here are the fields:
CREATE TABLE documents (
  id bigint(20) DEFAULT '0' NOT NULL auto_increment,
  docid varchar(20),
  category enum('Language Arts','Sciences','Humanities','Arts','Special
Subjects','Other'),
  subcategory enum('Physics','Biology','Chemistry','Math','Computers and
Internet','History','Economics','Geography','Law','Religion','Philosophy','B
lack Awareness','Countries','Drugs','Education','Environmental
Awareness','Politics','Health','Sex and Sexuality','Female
Awareness','Art','Movies or TV','Music','Sports','Charles
Dickens','Shakespeare','Biography','Fictional
Stories','Astronomy','Mythology'),
  date varchar(10),
  subject varchar(200),
  title varchar(200),
  author varchar(200),
  email varchar(50),
  language enum('English','Danish','Dutch','Finnish','German','Spanish'),
  grade int(3),
  level enum('High School','College','Other'),
  city varchar(15),
  state varchar(15),
  county varchar(15),
  school varchar(45),
  zip smallint(5),
  authorcomments varchar(200),
  teachercomments varchar(200),
  approve enum('Y','N'),
  docdata text,
  PRIMARY KEY (id),
  UNIQUE id (id)


----- Original Message -----
From: "Philip Olson" <[EMAIL PROTECTED]>
To: "Clayton Dukes" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, February 23, 2001 8:31 PM
Subject: Re: [PHP] Help INSERTing to MySQL


>
> > Hello, This is my first attempt, so I'm prolly doing something stupid,
> > but can someone tell me why this doesn't work? All it returns is
> > "Unable to INSERT to database"
>
> Change : or die("Unable to INSERT to database");
> To     : or die(mysql_error());
>
> And see what it tells you.  Odds are there's a field not being accounted
> for.  When not designating columns (just values) it's important to make
> sure all columns are accounted for.  See :
>
>     http://www.sqlcourse.com/
>
> It'll provide some basic SQL help.  It's recommended to write out columns
> and values (easier to make sense of).
>
>
> Regards,
>
> Philip Olson
> http://www.cornado.com/
>
> >
> >
> > ---BEGIN---
> > <?
> >    $time = time();
> >    $rand = Random_Password(5);
> >    $docid = $time . $rand;
> >
> >     if (isset($email) && isset($docid)) {
> >         mysql_connect("$HOSTNAME", "$DB_USER", "$DB_PASS");
> >
> >    $query = "INSERT INTO documents VALUES ('$docid', '$category',
> > '$subcategory', '$date', '$subject', '$title', '$author', '$email',
> > '$language', '$gr ade', '$level', '$city', '$state', '$county',
> > '$zip', '$authors_comments', '$teachers_comments', 'N', '$docdata')";
> >
> >    $result = mysql_db_query("$DATABASE", $query) or die("Unable to
> > INSERT to database");
> >
> >     if ($result) {
> >         echo "<p>$docid was added to the database</p>";
> >     }
> > }
> > ?>
>
>
> --
> 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]





On Fri, 23 Feb 2001, Clayton Dukes wrote:
> Well sheesh,
> If I knew I could get answers that easy here, I woudn't have worked on this
> for 20 hours :-)
> 
> THANKS!!!!
> 
> btw, field one is an ID field set to auto increment, how can I insert that
> if I don't know what it is?
>
You don't need to insert it. auto_increment will automatically
increment every time you insert a record. In fact, you _really_
don't want to ever set this field, as you would be modifying your
primary key ( unless your modifying them all )

 Note: You don't have to INSERT all fields mentioned below. If
you have a 'default' value set..then it will default to that value,
or in auto_increment case...it will automatically increment from
the last record it reads.

> 
> Here are the fields:
> CREATE TABLE documents (
>   id bigint(20) DEFAULT '0' NOT NULL auto_increment,
>   docid varchar(20),
>   category enum('Language Arts','Sciences','Humanities','Arts','Special
> Subjects','Other'),
>   subcategory enum('Physics','Biology','Chemistry','Math','Computers and
> Internet','History','Economics','Geography','Law','Religion','Philosophy','B
> lack Awareness','Countries','Drugs','Education','Environmental
> Awareness','Politics','Health','Sex and Sexuality','Female
> Awareness','Art','Movies or TV','Music','Sports','Charles
> Dickens','Shakespeare','Biography','Fictional
> Stories','Astronomy','Mythology'),
>   date varchar(10),
>   subject varchar(200),
>   title varchar(200),
>   author varchar(200),
>   email varchar(50),
>   language enum('English','Danish','Dutch','Finnish','German','Spanish'),
>   grade int(3),
>   level enum('High School','College','Other'),
>   city varchar(15),
>   state varchar(15),
>   county varchar(15),
>   school varchar(45),
>   zip smallint(5),
>   authorcomments varchar(200),
>   teachercomments varchar(200),
>   approve enum('Y','N'),
>   docdata text,
>   PRIMARY KEY (id),
>   UNIQUE id (id)
> 
> 
> ----- Original Message -----
> From: "Philip Olson" <[EMAIL PROTECTED]>
> To: "Clayton Dukes" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Friday, February 23, 2001 8:31 PM
> Subject: Re: [PHP] Help INSERTing to MySQL
> 
> 
> >
> > > Hello, This is my first attempt, so I'm prolly doing something stupid,
> > > but can someone tell me why this doesn't work? All it returns is
> > > "Unable to INSERT to database"
> >
> > Change : or die("Unable to INSERT to database");
> > To     : or die(mysql_error());
> >
> > And see what it tells you.  Odds are there's a field not being accounted
> > for.  When not designating columns (just values) it's important to make
> > sure all columns are accounted for.  See :
> >
> >     http://www.sqlcourse.com/
> >
> > It'll provide some basic SQL help.  It's recommended to write out columns
> > and values (easier to make sense of).
> >
> >
> > Regards,
> >
> > Philip Olson
> > http://www.cornado.com/
> >
> > >
> > >
> > > ---BEGIN---
> > > <?
> > >    $time = time();
> > >    $rand = Random_Password(5);
> > >    $docid = $time . $rand;
> > >
> > >     if (isset($email) && isset($docid)) {
> > >         mysql_connect("$HOSTNAME", "$DB_USER", "$DB_PASS");
> > >
> > >    $query = "INSERT INTO documents VALUES ('$docid', '$category',
> > > '$subcategory', '$date', '$subject', '$title', '$author', '$email',
> > > '$language', '$gr ade', '$level', '$city', '$state', '$county',
> > > '$zip', '$authors_comments', '$teachers_comments', 'N', '$docdata')";
> > >
> > >    $result = mysql_db_query("$DATABASE", $query) or die("Unable to
> > > INSERT to database");
> > >
> > >     if ($result) {
> > >         echo "<p>$docid was added to the database</p>";
> > >     }
> > > }
> > > ?>
> >
> >
> > --
> > 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]
-- 
Kind Regards,
---
Kyndig
Online Text Game Resource Site:  http://www.kyndig.com
ICQ#    10451240





Thanks! :-)

Man, what a great list! You guys kick a$$



----- Original Message -----
From: "Kyndig" <[EMAIL PROTECTED]>
To: "Clayton Dukes" <[EMAIL PROTECTED]>; "Philip Olson" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, February 23, 2001 8:50 PM
Subject: Re: [PHP] Help INSERTing to MySQL


> On Fri, 23 Feb 2001, Clayton Dukes wrote:
> > Well sheesh,
> > If I knew I could get answers that easy here, I woudn't have worked on
this
> > for 20 hours :-)
> >
> > THANKS!!!!
> >
> > btw, field one is an ID field set to auto increment, how can I insert
that
> > if I don't know what it is?
> >
> You don't need to insert it. auto_increment will automatically
> increment every time you insert a record. In fact, you _really_
> don't want to ever set this field, as you would be modifying your
> primary key ( unless your modifying them all )
>
>  Note: You don't have to INSERT all fields mentioned below. If
> you have a 'default' value set..then it will default to that value,
> or in auto_increment case...it will automatically increment from
> the last record it reads.
>
> >
> > Here are the fields:
> > CREATE TABLE documents (
> >   id bigint(20) DEFAULT '0' NOT NULL auto_increment,
> >   docid varchar(20),
> >   category enum('Language Arts','Sciences','Humanities','Arts','Special
> > Subjects','Other'),
> >   subcategory enum('Physics','Biology','Chemistry','Math','Computers and
> >
Internet','History','Economics','Geography','Law','Religion','Philosophy','B
> > lack Awareness','Countries','Drugs','Education','Environmental
> > Awareness','Politics','Health','Sex and Sexuality','Female
> > Awareness','Art','Movies or TV','Music','Sports','Charles
> > Dickens','Shakespeare','Biography','Fictional
> > Stories','Astronomy','Mythology'),
> >   date varchar(10),
> >   subject varchar(200),
> >   title varchar(200),
> >   author varchar(200),
> >   email varchar(50),
> >   language
enum('English','Danish','Dutch','Finnish','German','Spanish'),
> >   grade int(3),
> >   level enum('High School','College','Other'),
> >   city varchar(15),
> >   state varchar(15),
> >   county varchar(15),
> >   school varchar(45),
> >   zip smallint(5),
> >   authorcomments varchar(200),
> >   teachercomments varchar(200),
> >   approve enum('Y','N'),
> >   docdata text,
> >   PRIMARY KEY (id),
> >   UNIQUE id (id)
> >
> >
> > ----- Original Message -----
> > From: "Philip Olson" <[EMAIL PROTECTED]>
> > To: "Clayton Dukes" <[EMAIL PROTECTED]>
> > Cc: <[EMAIL PROTECTED]>
> > Sent: Friday, February 23, 2001 8:31 PM
> > Subject: Re: [PHP] Help INSERTing to MySQL
> >
> >
> > >
> > > > Hello, This is my first attempt, so I'm prolly doing something
stupid,
> > > > but can someone tell me why this doesn't work? All it returns is
> > > > "Unable to INSERT to database"
> > >
> > > Change : or die("Unable to INSERT to database");
> > > To     : or die(mysql_error());
> > >
> > > And see what it tells you.  Odds are there's a field not being
accounted
> > > for.  When not designating columns (just values) it's important to
make
> > > sure all columns are accounted for.  See :
> > >
> > >     http://www.sqlcourse.com/
> > >
> > > It'll provide some basic SQL help.  It's recommended to write out
columns
> > > and values (easier to make sense of).
> > >
> > >
> > > Regards,
> > >
> > > Philip Olson
> > > http://www.cornado.com/
> > >
> > > >
> > > >
> > > > ---BEGIN---
> > > > <?
> > > >    $time = time();
> > > >    $rand = Random_Password(5);
> > > >    $docid = $time . $rand;
> > > >
> > > >     if (isset($email) && isset($docid)) {
> > > >         mysql_connect("$HOSTNAME", "$DB_USER", "$DB_PASS");
> > > >
> > > >    $query = "INSERT INTO documents VALUES ('$docid', '$category',
> > > > '$subcategory', '$date', '$subject', '$title', '$author', '$email',
> > > > '$language', '$gr ade', '$level', '$city', '$state', '$county',
> > > > '$zip', '$authors_comments', '$teachers_comments', 'N',
'$docdata')";
> > > >
> > > >    $result = mysql_db_query("$DATABASE", $query) or die("Unable to
> > > > INSERT to database");
> > > >
> > > >     if ($result) {
> > > >         echo "<p>$docid was added to the database</p>";
> > > >     }
> > > > }
> > > > ?>
> > >
> > >
> > > --
> > > 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]
> --
> Kind Regards,
> ---
> Kyndig
> Online Text Game Resource Site:  http://www.kyndig.com
> ICQ# 10451240





Addressed to: Clayton Dukes <[EMAIL PROTECTED]>
              [EMAIL PROTECTED]

** Reply to note from Philip Olson <[EMAIL PROTECTED]> Sat, 24 Feb 2001 01:31:30 
+0000 (GMT)
>
>
> > Hello, This is my first attempt, so I'm prolly doing something stupid,
> > but can someone tell me why this doesn't work? All it returns is
> > "Unable to INSERT to database"
>
> Change : or die("Unable to INSERT to database");
> To     : or die(mysql_error());
>
> And see what it tells you.  Odds are there's a field not being accounted
> for.  When not designating columns (just values) it's important to make
> sure all columns are accounted for.  See :
>
>     http://www.sqlcourse.com/
>
> It'll provide some basic SQL help.  It's recommended to write out columns
> and values (easier to make sense of).

I find SET even easier:


   INSERT INTO Table SET

or

   UPDATE Table SET


then

      field1 = '$Field1',
      field2 = '$Field2',
      fieldN = '$FieldN'


That makes it very easy to keep track of what goes where.  It is
somewhat new to MySQL, but anything less than a year old should have it
available.




Rick Widmer
Internet Marketing Specialists
http://www.developersdesk.com





> If I knew I could get answers that easy here, I woudn't have worked on this
> for 20 hours :-)
> 
> THANKS!!!!
> 
> btw, field one is an ID field set to auto increment, how can I insert that
> if I don't know what it is?

In this case use NULL as the value for id and it'll auto increment nicely.
Using a blank  ''  will work too.  Regarding use of NULL, it's NULL and
not 'NULL'.

Regards,

Philip





Read the http://php.net/FAQ about the NULL character problem.

I'm betting you have some funky character that confuses that browser in the
output that the other browsers just ignore.

--
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
----- Original Message -----
From: Boaz Yahav <[EMAIL PROTECTED]>
Newsgroups: php.general
Sent: Wednesday, February 21, 2001 12:59 AM
Subject: RE: [PHP] URGENT: IE pops-up an Error and File Download Fails.
Needs to be fixed NOW. Please advise.


> What do you see in your web server logs?
> what webserver do you use?
>
> Sincerely
>
>       berber
>
> Visit http://www.weberdev.com Today!!!
> To see where PHP might take you tomorrow.
>
>
>
> -----Original Message-----
> From: Maxim Maletsky [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, February 21, 2001 8:59 AM
> To: 'PHP General List. (E-mail)'
> Subject: [PHP] URGENT: IE pops-up an Error and File Download Fails. Needs
to
> be fixed NOW. Please advise.
>
>
> Hello guys,
> This is that time when I am in trouble ...
>
> One of our internal databases receives inputs from all kind of different
> places and stores them for later reviews.
> Since it's creation it was all going perfectly well, but now it has a
little
> problem:
>
> The Internet Explorer gives me this error while listing one of databases'
> tables:
>
> (it is a pop up message of internet explorer)
> ----
>     Internet Explorer Cannot Open the internet site
> http://that.damn.db/database.php <http://that.damn.db/database.php>
> ?db=opp_post
>
>     The download of the specified resource has filed.
> ----
>
> What is it, PHP or IE? I suppose something is wrong with IE (5.01 for
> instance), but so far couldn't come with any solution. The output is
simply
> not there, source shows cuted off at the very beginning of file - after
few
> hundreds of bytes.
>
> This suggests me that one of the entries in Database is somehow corrupting
> IE. But I have not found anything strange. What to look for, guys?
>
> I tested it on Opera and Netscape - no probs whatsoever.
> I also tested it on Linux, and Mac (Opera, Netscape) - no probs
whatsoever.
> ...and (listen to this one)...
> I tested it on Mac, MSIE 5.(01)? (just the version I have on my Win2k) --
> and It gave me no errors at all.
>
> Why MSIE 5.01 of Win2k gives that message and breaks download?
>
> I've seen this messages already while browsing the web, and that's the
> reason I'm asking you: anyone had to fix that before? What are your
guesses
> on my problem?
>
> It is quite urgent since the database is not usable and I don't have much
> time for researches on this issue.
> The sad thing is that our office uses the exactly same configured machines
> (MSIE5 - Win2k) and no one can view the database from their PCs. All the
> sales and coordinators are staying here in line near my MAC while I am
> writing you this.
>
> Any help is greatly appreciated!
>
> Cheers,
> Maxim Maletsky
>
> P.S: if any friends of Bill are around the list, please forward him my
happy
> moments and eventual sweet words.
>
> Maxim Maletsky - [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> Webmaster, J-Door.com / J@pan Inc.
> LINC Media, Inc.
> TEL: 03-3499-2175 x 1271
> FAX: 03-3499-3109
>
> http://www.j-door.com <http://www.j-door.com/>
> http://www.japaninc.net <http://www.japaninc.net/>
> http://www.lincmedia.co.jp <http://www.lincmedia.co.jp/>
>
>
>
>
>
> --
> 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]
>





> Hi...anybody can help me about sending email directly using local smtp
port
> (25). I've read some articles, still, i don't have a clear explanation.
i.e
> : some using \n to separate between each header, but others use \r\n.

The ones using \n haven't read the spec very carefully, and are using Un*x
mail servers that are forgiving.

The ones that use \r\n either read the spec, or are using very rigid
unforgiving Microsoft products.

Use the \r\n ones if you care about portability.

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






> Does anyone know if it is possible to use PHP and cURL to auto-login into
a
> site (which sets a cookie) and then fill in a form to send an sms message?
> I need to do this to test a site automatically and check response times
for
> sending the SMS.

I have no idea what SMS is.

You *can* probably use PHP and cURL to send and receive the appropriate data
to initiate and continue a cookie session to fake out the server and fill
out the form.  You just might have to work at it a bit.

Tip:  Set up a page that works the way you think their page works, and then
use <?php phpinfo();?> in it to figure out what a "normal" browser sends to
a server that's doing what you think they are doing.  Send exactly the same
stuff to their server that worked on your server, and see what happens.

If you work hard enough at it, there is *no* *way* they can detect that your
program is not a human.

--
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 wanted to know if there is some syntax in the MSSQL Select statement
which can allow me to >limit the no. of records being returned. I am lookin
at functionality which is similar to >LIMIT in Mysql.

Look up "cursor" in your MS SQL documentation.

It's not as mind-numbingly simple as LIMIT, but it works.

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







> apxs:Break: Command failed with rc=65536

Search the mailing list archives for "rc=65536"

-- 
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'm trying to fopen a URL that I have no problems getting to
> if I just past it into the address field of my browser.  However,
> when I use it in my fopen() function call, I'm getting an "Error
> 0" (zero) message.
> I've looked all over the documentation and I could not find what
> 'Error 0' means.

Your browser is probably configured to use "anonymous/youremailhere" as
usename/password to FTP.

Are you using those values in your PHP code?

--
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 am trying to do a simple encryption on a credit card number to store in a
mysql text field.
>I also have to de-crypt the number after exporting to an access db.
>I tried to use xor encryption, but it seems to only work half the time, the
other half, I >can't seem to de-crypt the # properly, some of the numbers
end up screwed.
>Is this because of the way mysql is storing the field? Mabye it can't
recognize some of the >characters that are generated from the xor
encryption?
>
>Ex: 123456789123 may end up 1 YdR  and then de-crypts to
1234(*$8912#
>
>Is it the  that are the problem?  Or is the the access database that isn't
properly storing >the   ?

Yes, those are the problems.  You are XOR-ing and getting invalid
characters.  You could URLEncode/URLDecode it, or
Base64_Encode/Base64_Decode or some other way of guaranteeing that your
databases don't have to deal with funky characters.

>Is there a better way to do this?

This is a *really* bad idea, all around.  Either the place you are storing
the credit card numbers is "secure enough" that encrypting them is
pointless, or it's not secure enough at all, and your encryption won't stop
anybody who wants those numbers.

You shouldn't be storing nor transporting credit card numbers insecurely.
XOR-encryption is not secure, by definition.

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







> if( !($fd = @fopen($ftp_url, "r")) ){
>   $error = true;
>   $error_msg = "Unable to connect to server.";
> }
> else {
>   $file_contents = fread($fd, 100000);
>   fclose($fd);
> }
>
> if( empty($file_contents) ){
>   $error = true;
>   $error_msg = "Did not read file.";
> }
>
>
> The problem is that the fread doesn't always succeed; about about half
> the time the $file_contents string tests as empty.  There is never a
> problem with the fopen, and there doesn't seem to be any consistancy in
> the failure...  The same file may be loaded into the string on run one,
> and missing the next.  The remote server is NT-based.
>
> Does anybody know what is going wrong here?  I don't have to add any logic
> to "wait" for the fread to complete, do I?

You do not need to "wait" for fread().  It blocks by default.  Unless you've
messed around with set_socket_blocking() somewhere else in your code?...

What *exactly* is the value of $file_contents when it fails?

echo "'$file_contents' ", gettype($file_contents), "<BR>\n";

If it is 0 or 'false' you can at least detect the problem and try again a
time or two...

--
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 am trying to make am admin page for a few other pages in PHP but I dont
> know how to save the changes made.
>
> ie. The page has a few checkboxes & select boxes that when changed, change
> some variables that are then used in other pages.
>
> However I want the changes in the admin page to be permanent, until they
are
> changed again. Not just for that session or user, but if the change is
made
> it stays changed until the administrator decideds to go back in and change
> it again.
>
> How do you save the changes in that file on the server, by just using a
> browser?

The *easiest* way to do this is to store those changable values and their
possible settings in a database.  Really.  Even if you've never used a
database before, it's the easiest.  Honest.

Then just have the pages access the database to get their settings.

*HOWEVER*, if you are not already using a database, opening a database
connection can be expensive time and resource-wise.

So, if you don't already use a database, and *IF* (*huge* *IF* there) you
can guarantee that no two administrators will attempt to alter settings at
the same time, and *IF* you really, really need to worry about performance,
you could fopen() the file to write the current settings to it.

This comes with a security penalty -- You have a file somewhere on your file
system that PHP's user (usually 'nobody') can write to and that gets read by
all your pages to set your variables.

In an ideal world, you should *at* *least* make sure that:
o This file is *not* in your web-tree, but is somewhere else
o This file does *not* have .php extension
o All settings are explicitly checked for by the reader code, not this file.

To further explain this third point:
You *could* (bad idea) just have your file look like this:
--------- settings.inc -----------------
<?php
    $forecolor = 'FF0000';
?>

And you *could* (bad idea) just include() it in your scripts.

But, this file is essentially world-writable.  (Well, okay, it's only
'nobody' writable, but any other person on your server can write to that, so
it's pretty darn close to world-writable.)

So, they could put all sorts of malicious code in there.

Far better to have your nobody-writable settings file look like this:
---------- settings.ini ---------------
forecolor = 'FF0000'
backcolor = '00FF00'

And have another file you include() that looks like this:
<?php
    $settings = file('/full/path/to/settings.ini');
    while (list(,$line) = each($settings)){
        list($var, $val) = explode('=', $line);
        switch ($var){
            case 'forecolor':
                $forecolor = $val;
            break;
            case 'backcolor':
                $backcolor = $val;
            break;
            default:
                mail('[EMAIL PROTECTED]', 'HACKER ALERT', 'Somebody has
altered settings.ini!');
            break;
        }
    }
?>

You can even be more cautious by validating the individual inputs for the
settings.
IE, forecolor should be exactly 8 characters, starting with ' and ending
with ' and only [0-9a-fA-F] in between.  (Regex is your buddy here.)

The point is to make it harder for a hacker to exploit this file they can
all too easily write into.  *YOU* make sure that the data you have there is
what you expect, and you are only setting variables you expect, not just
executing what is essentially arbitrary code that anybody else on your
server could alter.

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






> Can anyone tell me if trans sid is supposed to work through form posts,

It is supposed to work.

> and
> if so how to make it work right?  It is working fine through normal links,
> but we have quite a few posts, and they lose the session. :(

Use "View Source" in your browser on one of your FORM pages.

I forget if trans sid puts the ID into the URL (ie, mixes GET/POST) or adds
it as a INPUT TYPE=HIDDEN form element...

If, as I suspect, it is being put into the URL, you may be accidentally not
getting the mixed GET/POST data...  Perhaps just adding
enctype=multipart/form-data would help...  Or maybe something in your
web-server is tromping on the mixed data types.

--
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've created a simple form that uploads file to my server. I noticed that
> I'm having problems when I use Internet Explorer 4.5 and 5.0 on the Mac (I
> haven't checked it yet on the pc). It may have something to do with the
path
> to the file. When I use Netscape, the entire path is displayed in the form
> field prior to upload. IE only displays the file name, no path. Is there a
> way that I could force the path along, echo maybe?

You aren't necessarily supposed to see the full path or not, nor does your
script need it.

You should only get the filename by the time it reaches PHP.

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






> What does it mean when I get the line 'posix_getpwnam(username) failed
with
> "Error number not set" in /xx.php3 on line ##' printed? It doesn't return
> anything anymore.

Whomever contributed the posix_getpwnam() function probably encountered an
error of some kind, but has not specified what error it is...

Can the PHP user (default 'nobody') actually execute this funtion?
Use <?php phpinfo();?> to find out what user PHP runs as.
If you have 'root' access, su to that username, and try to find some shell
commands to get info about that user.
If 'nobody' can't get the info, neither can PHP.

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






> Before redirecting it will also store a cookie in the
> browser named camefrom.
>
> SO then On the login.php page a user enters username
> and pasword and Submits.. if user is found then It has
> to get the Cookie value like this:
>
> $goto = $HTTP_COOKIE_VARS['camefrom'];
>
> header ("Location: $goto");

Only some browsers will accept a Cookies *and* a redirect in the headers in
a single page.

Don't use a cookie to do the "camefrom".

Use $HTTP_REFERER or use:
header("Location: login.php?camefrom=thispage.php");

--
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' m searching a way to programmatically alternate  2 schedules each sunday
at 00:00. >Schedule1 start on first sunday and seven days later, schedule2
replace schedule1,and seven >days later, schedule1 replace schedule2 etc...

The *easiest* thing to do would be to run a cron job every Sunday at
midnight to flip something...

But, assuming you want to avoid that:

<?php
    $now = time()
    $weeknumber = $now % 52;
    #So now I know which week of the year it is...
    #How do I know if it's "before" or "after" Sunday?
    #Easy:
    $dayofweek = date("w", $now);
    #So, now $dayofweek is either 0, for Sunday, or 1 for Monday, or...
    #Problem, how to mix and match $weeknumber and $dayofweek to "change" on
Sundays
    #Well, did this year start on a Wednesday, or what?
    $newyeardayofweek = date("w", mktime(0, 0, 0, 1, 1, date("Y", $now)));
    #This formula makes a lot more sense if you look at sample data:
/*
Format is:
The Day of week (Sun-Sat)
The day of the year 1-365
$weeknumber/$dayofweek
The right-hand column is 1/2
based on which schedule we want.
                            |
                            |
                            v
                Thu Fri Sat
                1   2   3   1
                0/4 0/5 0/6
Sun Mon Tue Wed Thu Fri Sat
4   5   6   7   8   9   10  2
0/0 0/1 0/2 0/3 1/4 1/5 1/6
Sun Mon Tue Wed Thu Fri Sat
11  12  13  14  15  16  17  1
1/0 1/1 1/2 1/3 2/4 2/5 2/6
Sun Mon Tue Wed Thu Fri Sat
18  19  20  21  22  23  24  2
2/0 2/1 2/2 2/3 3/4 3/5 3/6
*/
    #So, the "trick" is to switch on whether our day of the week is before
or after
    #the day that started the year off.
    if ((($weeknumber % 2) && ($dayofweek >= $newyeardayofweek)) ||
(!($weeknumber % 2) && ($dayofweek < $newyeardayofweek))){
        include 'schedule1';
    }
    else{
        include 'schedule2';
    }
?>

Somebody else probably has a one-line answer.  Oh well. :-)

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






You may need chmod 666 instead, for the cache directory...
./menu.cache needs to be *WRITABLE*, not *exectuable*.
Seems pretty scary to me to have world-writable files in your web-site
though...

--
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
----- Original Message -----
From: Peter Van Dijck <[EMAIL PROTECTED]>
Newsgroups: php.general
Sent: Thursday, February 22, 2001 11:05 AM
Subject: [PHP] cached fasttemplates permissions prob


> I'm trying to get cachedfasttemplates to work.
> I chmodded the entire directory and everything in it 775 (using -R), I
> still get
> Warning: fopen("./menu.cache","w") - Permission denied in
> ../includes/classes/fasttemplate/cachedfasttemplate.class.php on line 73
>
> Any ideas at all? I've been stuck on this for the entire afternoon...
> thanks
> Peter
>
> ~~~~~~~~~~~~~~~~~~~~~
> http://liga1.com  ,a weblog on:
> - Localisation
> - Internationalisation
> - Globalisation
> - Accessibility
>
>
> --
> 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
> session_start();
> 
> if( !isset( $c)) {
>     session_register("c");
>     $c = 1;
> }
> 
> echo $c . "<br>";
> 
> ?>
> <a href="index.php">reload</A>
> 
> In the new machine this code every show 1, don't save session data.
> I see in /tmp and all the sess_* files are empty.
> I check configuration, etc, and don't found anything.
> 
> I check the same code in other machine with the same configuration, and
> works fine.
> 
> Can anybody help me??

Move the session_register() outside (before) the if()

-- 
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 am a system administrator and currently we are playing to migrate all
> our CGI (written in C) to php! But playing a little with php i got
> worried about how services that need to keep username/password are
> handled by php, for instance:

For starters, you *could* have PHP running as a CGI wrapped by suExec
(http://apache.org)

Performance, however, would be not-so-hot, particularly after custom C code
as your previous experience.

Rumor had it at one point that Apache 2.0 would allow Modules to execute in
a similar fashion to suExec -- Whether this feature has survived
development/debug/QA phases is unknown to me.  But it *might* be worth
checking out.  WARNING:  You'd be way past the envelope of tested source
code at that point.  Not just with Apache as Beta software, but with
PHP/Apache/MySQL interaction.  OpenSource QA mostly consists of quantity of
users pounding on stuff, versus a planned organized QA team.

You *could* write a tiny C-module using PEAR, or even alter PHP's source
code, to have the passord encoded as part of your PHP Module binary.  Your
username/password would then be buried somewhere in the binary of that
module, so only a C disassembler would get it out.  I *think* libphp4.so
just needs to be executable for Apache, right?...

Many admins set up different username/passwords for MySQL, depending on what
"classes" of users need select/update/insert/delete access to which
tables -- And the one username/password combo that is for general everyday
access through your public site is stored in a file that the PHP user
(default 'nobody') can read, but is in a directory tree that is not in the
web tree and that other users cannot 'cd' to.  PHP can
http://php.net/include such a file, even though it is not visible in the
web-tree via a browser, if the include_path is set properly in php.ini.
Still, other users on the same server can read that file using PHP or Perl
or anything else than can run as user 'nobody', so it's not great
protection.

Another option would be to buy the Zend Encoder, and encode the file that
contains username/password info.  Rather expensive for what you need right
now, but it would save you writing/testing the C code to bury the
username/password in a large enough block of binary, and you can move on to
your "real" application.  Of course, if at some point you want to install
PHP code on somebody else's server, or just keep a lot of files on your own
server protected, the Zend Encoder price becomes more reasonable.  Again,
only somebody with a lot of time on their hands, a thorough knowledge of the
Zend engine, and a disassembler is going to be able to reverse-engineer
this.

Still, if they want it bad enough, they *can* -- There's pretty much *no*
*way* to have your web server capable of reading/executing a file, and yet
not have some other user on that machine capable of doing the same to
masquerade as that MySQL user, if they work at it enough.  It will be as as
good as your CGI programs were, but no better.  Well, maybe a little better,
since C crackers/disassembler-experts exist, but I don't think there are any
ZendEncoder cracker specialists yet...

> All our CGI programs execute sql queries to a mysql server, they
> contains the user name and password in order to login into the database.
> Since these programs need only to be executed its read flags are turned
> off. I need such a funcionality with php, but how can this be done?

It seems to me though, that the barrier difference between nobody-executable
and nobody-readable is not *that* different:  If I can write a Perl/PHP
script to execute your connect.cgi, it ain't all that more difficult from
being able to read the username/password in your connect.php.  Yeah, I have
to write a little shell script.  Not that big a deal, really, in most
real-world scenarios.

> PHP scripts not owned by the user that runs the web server are required
> to have the read flag for all tuned on, ok? this makes its contents
> readable by all my system users, right ? So how to put user
> name/password information into such script in order to get it accessing
> mysql, but without allowing any other user to get into its contents and
> reading login/password information ?

It doesn't have to be *world* readable -- You can chown -R your site to be
the user that PHP runs as, and chomd -R 400 it.  See <?php phpinfo();?> to
find out what that user is, and edit httpd.conf to change it with "User"
directive.  So now, only people who can su to 'nobody' or who have access to
write PHP/Perl/C code on your server are able to snarf those passwords.
Let's face it -- If they can write PHP/Perl/C code and execute it on your
server, your MySQL passwords for data that web-surfers can read is probably
not your biggest worry.

Also, check out "safe mode"  That makes it harder for one user on a shared
server to read another user's files with username/password info in them.
This is more for use in a VirtualHost ISP environment, which I get the
feeling you're not, but I could be wrong.

--
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 would like to have the authenticated user name
> appear in my apache access web logs but I am not using
> HTTP authentication.  I am using phplib to have better
> control over the authentication process.
> Is there a way to set this apache api variable
> from php code so that apache will log these user names?

I think not.

That variable is sent/set by the *browser* to Apache on each URL request.

What you *could* do is log stuff yourself from PHP using
http://php.net/error-log

You could log the time, their IP, and their user_agent using that, and then
later mix-and-match those entries with Apache entries to figure out who
asked for what.

For that matter, you could turn off Apache logging, and use PHP's to log
everything you need.

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






> Why does php self always show php4/php.exe? how do i take  it off?

This is a known bug under *some* Win32 installations.

Use <?php phpinfo();?> to figure out which variable has what you need in it,
and use that variable.

If you need to deploy on multiple platforms, you'll have to compare/contrast
the two server's <?php phpinfo();?> outputs and find a common variable with
the info you need, or using some sort of if/else with the other variables to
detect which platform is running.

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






>can someone please send me   mysql.sock
>( unix redhat 6.2 )
>
>i had a crash - reinstalled the rpm 3.22.32  but this file is missing

Unless I'm grossly mistaken, that file should only exist while MySQL is
actually running, and should contain the socket number that MySQL happens to
be using at the moment.

So, (A) their mysql.sock is not going to do you any good, and (B) it will
get created when you start MySQL, and (C) you really don't want to try to
change it by hand.

You may need to *delete* the old mysql.sock file, if MySQL didn't "know" the
computer crashed, and is complaining about that old one being there.  It's
basically just MySQL thinking that MySQL must already be running since you
have one of those files.

Or, you may just need to start MySQL to have a mysql.sock file show up where
you think there should be one.

Or, *maybe* the *path* where MySQL wants to store mysql.sock somehow got
trashed/changed during your RPM install, since it is configurable, and you
just need to create the directory where mysql.sock wants to live.  WARNING:
If you messed this up with your RPM, you may have also not told the new
MySQL install where your databases live.  Don't panic if you fire up MySQL
and all your databases are "gone".  You probably just need to configure
MySQL to look for the database files in the right place.

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







Hey All,

What would be a good method for inserting data into a blob field
that contained special characters using perl then retrieving that
data with php?

URI::Escape has worked well with perl but now that php has
gotten into the picture I need a new method.

any suggestions?

tks
mitch






What type of special characters?

--Joe

On Fri, Feb 23, 2001 at 08:54:09PM -0600, Mitchell Hagerty wrote:
> Hey All,
> 
> What would be a good method for inserting data into a blob field
> that contained special characters using perl then retrieving that
> data with php?
> 
> URI::Escape has worked well with perl but now that php has
> gotten into the picture I need a new method.
> 
> any suggestions?
> 
> tks
> mitch
> 
> 
> 
> -- 
> 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
-------------------------------------------------------------------------------






If your refering to:  '  or "  just use:

addslashes($value);   to escape special characters.


On Fri, 23 Feb 2001, Mitchell Hagerty wrote:
> Hey All,
> 
> What would be a good method for inserting data into a blob field
> that contained special characters using perl then retrieving that
> data with php?
> 
> URI::Escape has worked well with perl but now that php has
> gotten into the picture I need a new method.
> 
> any suggestions?
> 
> tks
> mitch
> 
> 
> 
> -- 
> 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]
-- 
Kind Regards,
---
Kyndig
Online Text Game Resource Site:  http://www.kyndig.com
ICQ#    10451240






Does the fun ever stop?

This one has thrown me, I have imap install and running on my system but evidently not 
c.client.a (which i do) . Has 
anyone else has problems with this? What is a good imap src to point --imap= to?

apache 1.2.14
php 4.0.4pl1
bsd 4.2

any tips would be great
tks
mitch






I was trying to code the following script using while instead of for, 
but I'm havig a lot of problems...Is it possible to do what I want?

for ($count = 0; $count <= 10; $count++){
echo "Number is $count <BR>\n";
}

Could anyone tell me how is it with while instead of for??
Thank you!!

Felipe Lopes
MailBR - O e-mail do Brasil -- http://www.mailbr.com.br
Faça já o seu. É gratuito!!!


Reply via email to