Re: [PHP] file locks

2002-04-10 Thread rarmin

Liam Gibbs wrote:
> < trying to access is locked by other script (via
> flock()) or not. I need to make script wait untill
> other script running in a parallel thread releases the
> lock on  the file.>>
> 
> Without testing, would this work? Just a suggestion
> (read: shot in the dark) that may work.
> 
> while(!$filehandle) {
>$filehandle = @fopen("file_in_question",
> "r/w/whatever");
> }
> 
> 
> <>
> 
> You're welcome in advance. :)
> 
> 
> __
> Do You Yahoo!?
> Yahoo! Tax Center - online filing with TurboTax
> http://taxes.yahoo.com/

How is it possible that the file locked with exclusive lock can be 
opened by another call to fopen in the same script? Am i getting it all 
wrong, or the second call to fopen in the next code should fail?

$fp=fopen("somefile", "w");
flock($fp, LOCK_EX);
$fp1=fopen("somefile", "w");

I'm using php 4.1.2 windows version on apache 1.2.23.

Armin


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




[PHP] Re: how to send an email to everone listed in a file

2002-04-10 Thread David Robley

In article <[EMAIL PROTECTED]>, 
[EMAIL PROTECTED] says...
> Hi all. I really wish I could contribute here and help
> people out too but i don't know a fraction of the
> stuff that you gurus do. 
> I try not to bug you all with too many questions and
> try to figure it out/learn on my own as much as
> possible.
> 
> I am trying to figure out how i could send an email to
> everyone listed in a file. the file contains a name
> followed by a space followed by their email followed
> by a carriage return. the number of entries in the
> file changes. i would like to send the newletter to
> everyone in the file and have their name put in the
> email as well. (since i don't endorse spam I assure
> you this isn't for such purpose).
> 
> From what i'm able to figure out on my own, I think
> i'm going to need something that reads the file into
> some array which separates each entry based on the \n
> and the space and some sort of loop (for, while, etc).
> I have no idea how complex of a task this is but i
> would appreciate any help or ideas! thanks! (note: i'm
> on php4.0.4pl1)
> 

file() will read the file into an array; you could then use explode() on 
each element of the array to extract the email address, and mail() to 
send the message.

-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




[PHP] MySQL connection from non-localhost

2002-04-10 Thread David Johansen

I was just wondering if there was a way to connect to a MySQL server on a
server other than the one that your php script is on. I tried just putting
in the URL of the site in place of localhost but that didn't work. Is there
anything special that I have to do to get it to work? Thanks,
Dave



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




[PHP] Re: MySQL connection from non-localhost

2002-04-10 Thread David Robley

In article <[EMAIL PROTECTED]>, 
[EMAIL PROTECTED] says...
> I was just wondering if there was a way to connect to a MySQL server on a
> server other than the one that your php script is on. I tried just putting
> in the URL of the site in place of localhost but that didn't work. Is there
> anything special that I have to do to get it to work? Thanks,
> Dave

Are the grants of the remote host set to accept anything other than 
localhost?

-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




[PHP] Php + Mysql Hosting problem

2002-04-10 Thread Simonk

I have made a web site containing Php and Mysql script
And I have applied for a free web hosting account in www.spaceports.com
there are two folder i can use:

Public_html
Cgi-bin

which one i should put mysql files in?
and what user name and password should i use for connecting mysql server?
the current setting is
mysql_connect ("localhost", "Administrator");

thank you! and which free hosting is recommanded for php + mysql?
I can only found this spaceports free!
Thank you very much!

__ ¦èªù³½
SeeMon Simonk ICQ#: 25943733 Current ICQ status: + More ways to contact me i
See more about me:
__



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




Re: [PHP] XML HELP

2002-04-10 Thread Michael Virnstein

Why don't you use this class...it's really good!
http://sourceforge.net/projects/phpxpath/

"Analysis & Solutions" <[EMAIL PROTECTED]> schrieb im
Newsbeitrag [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hey Christopher:
>
> On Mon, Apr 08, 2002 at 09:14:08PM -0400, Christopher J. Crane wrote:
> > ok I tried this at your suggestion
>
> Not exactly.  As mentioned, you've got all sorts of unneded stuff going
> on.  To make sure you're on the right track, start with a new script
> with just the basics:
>
>
> 
> $Symbols[] = 'ek';
> $Symbols[] = 'et';
>
> $URI = 'http://quotes.nasdaq.com/quote.dll?page=xml&mode=stock&symbol=';
>
>
> function StartHandler($Parser, $ElementName, $Attr='') {
> }
>
> function CharacterHandler($Parser, $Line) {
> }
>
> function EndHandler($Parser, $ElementName, $Attr='') {
> }
>
>
> while ( list(,$Sym) = each($Symbols) ) {
>$Contents = implode( '', file("$URI$Sym") );
>
>$Parser = xml_parser_create('ISO-8859-1');
>xml_set_element_handler($Parser, 'StartHandler', 'EndHandler');
>xml_set_character_data_handler($Parser, 'CharacterHandler');
>
>if ( xml_parse($Parser, $Contents) ) {
>   echo 'YES!';
>} else {
>   echo 'NO!';
>}
>
>xml_parser_free($Parser);
>
> }
>
> ?>
>
>
> Now, if that works, start flushing out the element/character handlers.
> Do it little by little to make sure each of your steps are correct.
>
> Enjoy,
>
> --Dan
>
> --
>PHP classes that make web design easier
> SQL Solution  |   Layout Solution   |  Form Solution
> sqlsolution.info  | layoutsolution.info |  formsolution.info
>  T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
>  4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409



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




[PHP] session variables and unset

2002-04-10 Thread Valdas Andrulis

Hello,

I have 3 scripts:

## i2.php


## i.php


## i1.php


When I open http://host/i2.php on my browser I get 0, though I expect it
to be 4. If I uncomment session_unregister("counter"); I get 4 as
expected.

PHP version 4.1.2.

Anyone can explain this behavior? Also can anyone try this with say
4.0.5 or older version of PHP?

Good luck,

Valdas



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




Re: [PHP] How creat image pointer from JPG/GIF string?

2002-04-10 Thread M

Robert Cummings wrote:

> M wrote:
> >
> > I have stored lot of images into BLOB Mysql fields, and need recover it
> > to resize. How can I create some image pointer from string stored into
> > BLOB field?
> >
> > Thanks
> >
> > Miguel
>
> imagecreatefromstring() seems to be the candidate... however a comment
> attached to the help page indicates it is buggy. I suggest trying it out
> and if that fails then pull your image from the database, write to a
> temporary file, and then use imagecreatefromjpeg() as per usual.
>
> Cheers,
> Rob.

Hello Rob, just to inform that function ImageCreateFromString works ok

Thanks for your valuable info

Miguel



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




[PHP] using php for keywords

2002-04-10 Thread Marc

hi

how can i use php to list keywords in search engines ?!?
how to index a website keywords via php =)

plz mail

thx




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




RE: [PHP] Empty HTML problem

2002-04-10 Thread K.Tomono

Hello.

Would you try to confirm your server's native response as below?

telnet your.server 80
GET /your/authentication_code.php HTTP/1.0
Authorization: Basic base64encoded_ID/PW

--
(request header ends with \n * 2)

> --
> 
> 
>  HEAD>
> 
> --

Do you use I.E?
The above HTML may be the auto made by IE...

I think I saw the same above when the server's respons is nothing...
,unless this is your own writing. :)


and it seems that Apache's behavior rather differs between on Windows and
Unix(Linux)


HYH

K.Tomono

> -Original Message-
> From: ayukawa [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, April 10, 2002 12:17 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Empty HTML problem
>
>
> Hello,
> I have a big problem around login script.
>
> I made an authentication site with PHP using PHP session.
> I use my own session handler that store session data into MySQL DB.
>
> It worked well on Win2000+Apache.
> But the problem occured when I put the scripts on TurboLinuxServer7+
> Apache.
>
> login authentication script output nothing but
> --
> 
> 
>  HEAD>
> 
> --
>
> It is almost empty HTML I have never expected!!
>
> Does anyone know about this kind of matter?
> Please HELP ME!!!
>
> I made php.ini as same as one of Windows.
>
> Regards,
> Hiroshi Ayukawa
> http://hoover.ktplan.ne.jp/kaihatsu/php_en/index.php
>
>
>
>
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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




php-general Digest 10 Apr 2002 10:27:56 -0000 Issue 1278

2002-04-10 Thread php-general-digest-help


php-general Digest 10 Apr 2002 10:27:56 - Issue 1278

Topics (messages 92311 through 92358):

Re: Manipulate the address field  in the browser?
92311 by: Dan Harrington
92313 by: Maxim Maletsky

Re: AS/400 data access
92312 by: Dan Vande More
92316 by: Matt

auth,perm,content management
92314 by: Dennis Gearon

splitting array values into usable chunks..
92315 by: phplists.woodenpickle.com
92317 by: phplists.woodenpickle.com

shopping cart suggestions
92318 by: Eugene Lee
92319 by: phplists.woodenpickle.com

Re: includes
92320 by: Tom Rogers
92343 by: Tom Rogers

Re: Downloading files
92321 by: Jim Koutoumis
92340 by: Jason Wong

Re: Php/Pdf application
92322 by: Justin French

PHP 4.2.0 RC2 + Apache 2.0.35 .. DirectoryIndex problem
92323 by: Adam Plocher
92324 by: Rasmus Lerdorf
92328 by: Austin Gonyou

PCRE - catching a caracter set in a negative class
92325 by: Maxim Maletsky
92332 by: CC Zona

Dealing with Query String
92326 by: Vladislav Kulchitski
92330 by: Maxim Maletsky
92333 by: Vladislav Kulchitski
92335 by: Maxim Maletsky

LOBS with CURSOR_SHARING=FORCE gives core dump on Oracle 8.1.7.2
92327 by: Prince

Help, anyone else using GD2 & php 4.1.2 ?
92329 by: Mark W. Humphries
92336 by: Matt Parlane

LOBS with CURSOR_SHARING=FORCE gives core dumpf
92331 by: Prince

php 4.0.6 file upload security fix
92334 by: peter

Empty HTML problem
92337 by: ayukawa
92358 by: K.Tomono

Scoping functions in PHP
92338 by: Eric Starr

how to send an email to everone listed in a file
92339 by: Police Trainee
92350 by: David Robley

no mod_dbase on FreeBSD?
92341 by: Jeff D. Hamann

Weird Session headers
92342 by: S.Murali Krishna

Re: sablotron XMl XSLT
92344 by: Yasuo Ohgaki

unserialize_callback_func
92345 by: Ian

allowed tags reg exp
92346 by: Justin French

chmod error?
92347 by: John Weez
92348 by: Henrik Hudson

Re: file locks
92349 by: rarmin

MySQL connection from non-localhost
92351 by: David Johansen
92352 by: David Robley

Php + Mysql  Hosting problem
92353 by: Simonk

Re: XML HELP
92354 by: Michael Virnstein

session variables and unset
92355 by: Valdas Andrulis

Re: How creat image pointer from JPG/GIF string?
92356 by: M

using php for keywords
92357 by: Marc

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]


--

--- Begin Message ---


Sounds to me like an Apache Alias Directive is what you need.
can you get at your apache configuration? :-)

http://httpd.apache.org/docs/mod/mod_alias.html



> -Original Message-
> From: Erik Price [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, April 09, 2002 4:22 PM
> To: Kevin Stone
> Cc: PHP-general
> Subject: Re: [PHP] Manipulate the address field in the browser?
> 
> 
> 
> On Tuesday, April 9, 2002, at 05:44  PM, Kevin Stone wrote:
> 
> > Here's a crazy question.  Say I have a script (such as a bulliten board
> > script) that is run by many clients (other websites) off of one location
> > on my web account.  Think of it as a service of some kind.  Is there
> > anyway to trick the browser into displaying the client's domain rather
> > than my own?  I would want it to look as though you've never left their
> > website when in fact you are now on mine.  Possible?
> 
> My domain name registrar uses a neat trick called "stealth forwarding".  
> It's probably explained in some tutorial on the web, so I won't 
> speculate on how it's done, but the principle is this --
> 
> You have a web page hosted at a certain ISP... where the domain name is 
> something like http://isp.com/~eprice/index.html
> 
> But you just purchased a fancy domain name from an independent domain 
> name registrar (not thru your ISP) and you want to point the new domain 
> name to the old domain name.  Unfortunately, the ISP didn't give you a 
> dedicated IP address and they won't give you a virtual host, so you have 
> no way to map your shiny new domain name to your web site.
> 
> Stealth forwarding essentially makes the entire browser window into one 
> giant new frame.  The contents of the frame are 
> http://isp.com/~eprice/index.html, but because the frameset is hosted by 
> the indie domain name registrar, and they have your shiny new domain 
> name mapped to a virtual host on their servers or something, it looks 
> like (judging from the URL bar) a user is browsing 
> http://shinynewdomainname.com, not http://isp.com/~eprice/index.html.
> 
> The only problem is that (a) it relies on fra

[PHP] Re: Scoping functions in PHP

2002-04-10 Thread Michael Virnstein

No, there's nothing like private or public functions/methods. There's no way
preventing someone using your private functions/methods.

"Eric Starr" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
000e01c1e041$d931cc20$[EMAIL PROTECTED]">news:000e01c1e041$d931cc20$[EMAIL PROTECTED]...
I am a Java programmer learning PHP.

In Java you can have a class that contains public and private functions.
Only the public functions are accessible outside of the class.  Does PHP
have a way to hide functions within a class (i.e. make the private)?

My concern is that there are some functions that you don't want anyone being
able to call...only local functions within the same class should be able to
call it.

I'll give an example below:



f1(); // I want this to be a valid function call
  $p->f2(); // I want this to be an invalid function call
?>


Any help would be greatly appreciated.

Eric Starr








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




[PHP] Re: allowed tags reg exp

2002-04-10 Thread liljim

Hi

try this (untested)

 and friends with their html equivelants.
$input = htmlenitities($input);

$input = preg_replace("!<(b|i|u)>(.*?)!is", "<$1>$2",
$input);

echo $input;

?>


I use something like this on one of my sites, though I check as the user
inputs the info whether or not there are matching opening and closing tags
before inputting to the db, and later echoing them out and doing the
conversions...

Hope it helps, anyway.

~James

"Justin French" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi all,
>
> Further to a discussion we had yesterday about the danger of onLoad,
> onMouseOver, etc etc of allowed tags when using strip_tags(), I've decided
> to look at the issue from another angle.
>
> For the limited set of tags I usually allow on user input, , I'm
> going take the approach of deleting anything I don't specifically TRUST,
> rather than deleting things I don't trust.
>
> For such simple tags, It seems to me to be a smarter move to delete
anything
> in the tag apart from the actual tag.
>
>  becomes 
>
> This eliminates the danger of people putting anything evil like
> onmouseover="javascript:self.close();" into my small set of allowed tags.
>
>
> So, I'd like a regexp which looks for multiple occurences of a tag (let's
> take  for an example), and throw out anything not needed.
>
> In English, I guess it looks like:
>
> look for a "<" followed by a "b" (case insensitive), then throw away
> anything up to the first ">" we find.
>
> Better still would be a regexp or function that checks for b|i|u, or a
> passed set of tags.
>
>
> I'm aware that this type of hard-line approach will prevent ,
> and I will also have problems on things like  and
 HREF="foo.php">, but I plan to devise some psuedo tags for links, and
don't
> require font tags, image tags, etc etc.
>
>
> Many thanks in advance,
>
> Justin French
>



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




[PHP] mailing list using mail()

2002-04-10 Thread Petre Agenbag

Hi,
the combination of PHP and mysql and the ease of use of the mail() 
function obviously leads me to believe that it *should* be a singe to 
use php to send customised messages to all my users , of whom I have 
details in a mysql table by simply running a "select * from table" and 
then using a while loop to run through every row and sending an e_mail 
to $user_in_table.

The obvious problem here is that ( in my case 17 000 users) this can 
easily kill the mail server and could also cause the script to timeout 
or ( if increasing the timeout) kill the server outright.
So, what are my options?
Should I be attempting this ( if not, how can I keep others that are 
hosting on my machines from trying this with their own tables)
Should I just use one message and append the BCC: line of the one message?

Thanks 


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




[PHP] mysql

2002-04-10 Thread Mason Batley

Hi guys,

I've been looking on the net and the php docs for a simple
mysql query solution, can someone please let me know
the best way to get the values of a query that only returns 1 record?

All the select query examples on the net are examples of
multiple records being returned, and therefor, there is repition
methods shown.

For this I don't need any repitition, I just need to know the best
way to get the DB values from the query into variables.

Cheers.

-Mason



RE: [PHP] mysql

2002-04-10 Thread Brian Drexler

select * from table_name where criteria=whatever limit 1;

-Original Message-
From: Mason Batley [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 11, 2002 12:02 AM
To: [EMAIL PROTECTED]
Subject: [PHP] mysql


Hi guys,

I've been looking on the net and the php docs for a simple
mysql query solution, can someone please let me know
the best way to get the values of a query that only returns 1 record?

All the select query examples on the net are examples of
multiple records being returned, and therefor, there is repition
methods shown.

For this I don't need any repitition, I just need to know the best
way to get the DB values from the query into variables.

Cheers.

-Mason


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




[PHP] Re: mailing list using mail()

2002-04-10 Thread Michael Virnstein

> Should I just use one message and append the BCC: line of the one message?

this could probably be the best way.

"Petre Agenbag" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
> the combination of PHP and mysql and the ease of use of the mail()
> function obviously leads me to believe that it *should* be a singe to
> use php to send customised messages to all my users , of whom I have
> details in a mysql table by simply running a "select * from table" and
> then using a while loop to run through every row and sending an e_mail
> to $user_in_table.
>
> The obvious problem here is that ( in my case 17 000 users) this can
> easily kill the mail server and could also cause the script to timeout
> or ( if increasing the timeout) kill the server outright.
> So, what are my options?
> Should I be attempting this ( if not, how can I keep others that are
> hosting on my machines from trying this with their own tables)
> Should I just use one message and append the BCC: line of the one message?
>
> Thanks
>



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




[PHP] using .htaccess to repoint

2002-04-10 Thread Adrian Murphy

Hi,
my isp uses wildcard dns to point to the root.
I want to put a .htaccess file in the root to
repoint the wildcard requests to a sub-folder but
leave the normal request alone.
plese help or tell me an article i can read(i've looked but haven't found
one specifically dealing with this.)
adrian.



RE: [PHP] using .htaccess to repoint

2002-04-10 Thread Stampe, Lars

Hi,

This might be helpful http://rob-mike.php4hosting.com/mike/htaccess/

Lars

-Original Message-
From: Adrian Murphy [mailto:[EMAIL PROTECTED]]
Sent: 10 April 2002 12:29
To: [EMAIL PROTECTED]
Subject: [PHP] using .htaccess to repoint


Hi,
my isp uses wildcard dns to point to the root.
I want to put a .htaccess file in the root to
repoint the wildcard requests to a sub-folder but
leave the normal request alone.
plese help or tell me an article i can read(i've looked but haven't found
one specifically dealing with this.)
adrian.

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




[PHP] printf

2002-04-10 Thread Ron Allen

I am looking at how to format output

Here is what I have.  There is a simple currency conversion that I do and
the output is just a string of numbers
I would like it so that it puts a comma for every 3 spaces...Any
clues..oh knowing newsgroup



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




[PHP] Re: mailing list using mail()

2002-04-10 Thread David Robley

In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says...
> Hi,
> the combination of PHP and mysql and the ease of use of the mail() 
> function obviously leads me to believe that it *should* be a singe to 
> use php to send customised messages to all my users , of whom I have 
> details in a mysql table by simply running a "select * from table" and 
> then using a while loop to run through every row and sending an e_mail 
> to $user_in_table.
> 
> The obvious problem here is that ( in my case 17 000 users) this can 
> easily kill the mail server and could also cause the script to timeout 
> or ( if increasing the timeout) kill the server outright.
> So, what are my options?
> Should I be attempting this ( if not, how can I keep others that are 
> hosting on my machines from trying this with their own tables)
> Should I just use one message and append the BCC: line of the one message?
> 
> Thanks 
> 
> 
Alternatively you could use the output from your table to feed a userlist 
to a dedicated mail list package

-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




[PHP] Re: mysql

2002-04-10 Thread David Robley

In article <002401c1e10d$96850910$e700a8c0@horizon>, 
[EMAIL PROTECTED] says...
> Hi guys,
> 
> I've been looking on the net and the php docs for a simple
> mysql query solution, can someone please let me know
> the best way to get the values of a query that only returns 1 record?
> 
> All the select query examples on the net are examples of
> multiple records being returned, and therefor, there is repition
> methods shown.
> 
> For this I don't need any repitition, I just need to know the best
> way to get the DB values from the query into variables.
> 
> Cheers.
> 
> -Mason
> 
A while or similar should still work with only one record; but of course 
you could just drop the while and use the 'enclosed' code just once. If 
you have a particular sample you want to reduce, post it if you need more 
help.

-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




[PHP] Re: printf

2002-04-10 Thread David Robley

In article <[EMAIL PROTECTED]>, 
[EMAIL PROTECTED] says...
> I am looking at how to format output
> 
> Here is what I have.  There is a simple currency conversion that I do and
> the output is just a string of numbers
> I would like it so that it puts a comma for every 3 spaces...Any
> clues..oh knowing newsgroup

number_format()

-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




[PHP] Re: mailing list using mail()

2002-04-10 Thread Yasuo Ohgaki

Michael Virnstein wrote:
>>Should I just use one message and append the BCC: line of the one message?
> 
> 
> this could probably be the best way.

Right, but some MTA cannot handle too large header(s).

Why don't you use list server in first place?
For example, ezmlm support database backends if you
are using qmail. PHP has ezmlm_hash function for it.

--
Yasuo Ohgaki



> 
> "Petre Agenbag" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> 
>>Hi,
>>the combination of PHP and mysql and the ease of use of the mail()
>>function obviously leads me to believe that it *should* be a singe to
>>use php to send customised messages to all my users , of whom I have
>>details in a mysql table by simply running a "select * from table" and
>>then using a while loop to run through every row and sending an e_mail
>>to $user_in_table.
>>
>>The obvious problem here is that ( in my case 17 000 users) this can
>>easily kill the mail server and could also cause the script to timeout
>>or ( if increasing the timeout) kill the server outright.
>>So, what are my options?
>>Should I be attempting this ( if not, how can I keep others that are
>>hosting on my machines from trying this with their own tables)
>>Should I just use one message and append the BCC: line of the one message?
>>
>>Thanks
>>
> 
> 
> 



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




[PHP] Is While needed in MySQL Result with a Limit of 1

2002-04-10 Thread Brian Drexler

Here is my code:

mysql_connect("localhost","username","password");
$result=mysql_db_query("Database","select * from table_name where
criteria=whatever limit 1");
while($r=mysql_fetch_array($result) {
$Value1=$r["TableFieldName1"];
$Value2=$r["TableFieldName2"];
echo "$Value1, $Value2";
}

My question is thisis the while statement needed when I'm only returning
one record?

Brian


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




Re: [PHP] Is While needed in MySQL Result with a Limit of 1

2002-04-10 Thread Luke van Blerk

No its not.

mysql_fetch_array will return an array if a record is found or false if not.

Regards
Luke

- Original Message -
From: "Brian Drexler" <[EMAIL PROTECTED]>
To: "Php-General@Lists. Php. Net" <[EMAIL PROTECTED]>
Sent: Wednesday, April 10, 2002 1:58 PM
Subject: [PHP] Is While needed in MySQL Result with a Limit of 1


> Here is my code:
>
> mysql_connect("localhost","username","password");
> $result=mysql_db_query("Database","select * from table_name where
> criteria=whatever limit 1");
> while($r=mysql_fetch_array($result) {
> $Value1=$r["TableFieldName1"];
> $Value2=$r["TableFieldName2"];
> echo "$Value1, $Value2";
> }
>
> My question is thisis the while statement needed when I'm only
returning
> one record?
>
> Brian
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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




[PHP] Re: printf

2002-04-10 Thread Steve Fitzgerald

Use number_format() to put a comma between the thousands
$foo = 123456789;
print number_format($foo); //will print 123,456,789

Ron Allen wrote:

> I am looking at how to format output
>
> Here is what I have.  There is a simple currency conversion that I do and
> the output is just a string of numbers
> I would like it so that it puts a comma for every 3 spaces...Any
> clues..oh knowing newsgroup


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




[PHP] Re: printf

2002-04-10 Thread Ron Allen

This is what I have and it is not working


$converted1 =round($usdamount * $convamount, 2);
$converted = number_format($converted1);
//echo "$amount * $convamount = $converted";
echo "You should receive$nbsp $converted $currency";
"Ron Allen" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I am looking at how to format output
>
> Here is what I have.  There is a simple currency conversion that I do and
> the output is just a string of numbers
> I would like it so that it puts a comma for every 3 spaces...Any
> clues..oh knowing newsgroup
>
>



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




[PHP] Sessions and Opera

2002-04-10 Thread Steve Fitzgerald

While testing a login page with different browsers I noticed that Opera
(vers5.02)
didn't allow me access to the site despite using the correct input, so I
wrote the
following pages to test Opera's performance. It seems that Opera doesn't

pass registered variables to the new page. IE & NS both print the output

as expected, but in Opera all variables are empty.
Has anyone got any thoughts/solutions/experiences?

regards
Steve

--
## login page



 method="POST">
Enter password: 



";
  print "The value of \$input is \"$input\"";
  print "The value of \$password is \"$password\"";
  print "The value of \$auth is \"$auth\"";
?>

--
## 2.php

"; // empty
  print "The value of \$input is \"$input\""; // should print
'letmein'
  print "The value of \$password is \"$password\""; // should print
'letmein'
  print "The value of \$auth is \"$auth\""; // should print '1'
?>




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




[PHP] Re: printf

2002-04-10 Thread Ron Allen

Figured out why it wasn't working, but I need to be able to display the 2
decimals afterwards
"Ron Allen" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I am looking at how to format output
>
> Here is what I have.  There is a simple currency conversion that I do and
> the output is just a string of numbers
> I would like it so that it puts a comma for every 3 spaces...Any
> clues..oh knowing newsgroup
>
>



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




[PHP] Re: printf

2002-04-10 Thread Ron Allen

figured that out as well
You need to put the number_format($number,2) afterwards
Thanks to both you!
"Ron Allen" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I am looking at how to format output
>
> Here is what I have.  There is a simple currency conversion that I do and
> the output is just a string of numbers
> I would like it so that it puts a comma for every 3 spaces...Any
> clues..oh knowing newsgroup
>
>



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




[PHP] Re: Is While needed in MySQL Result with a Limit of 1

2002-04-10 Thread Michael Virnstein

It seems that you don't understand why mysql_fetch_array
is most often used inside a loop. The loop is not required!
if you don't put mysql_fetch_array inside a loop, you can only get the first
row
and that's it, because calling mysql_fetch_array will return the next row in
your result.
if you expect more than one row, you have to call mysql_fetch_array for as
many times as you expect
rows. This could be done by calling mysql_fetch_array manually for as many
times you need or via
some sort of loop. The easiest way to get all rows, although you don't know
how many rows
you'll get, is using a while loop.

"Brian Drexler" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Here is my code:
>
> mysql_connect("localhost","username","password");
> $result=mysql_db_query("Database","select * from table_name where
> criteria=whatever limit 1");
> while($r=mysql_fetch_array($result) {
> $Value1=$r["TableFieldName1"];
> $Value2=$r["TableFieldName2"];
> echo "$Value1, $Value2";
> }
>
> My question is thisis the while statement needed when I'm only
returning
> one record?
>
> Brian
>



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




[PHP] Re: Sessions and Opera

2002-04-10 Thread Julio Nobrega Trabalhando

  Cookies disabled? Or cache? Have you tried a 'fresh' Opera install or a
newer version?

--

Julio Nobrega.

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

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


"Steve Fitzgerald" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> While testing a login page with different browsers I noticed that Opera
> (vers5.02)
> didn't allow me access to the site despite using the correct input, so I
> wrote the
> following pages to test Opera's performance. It seems that Opera doesn't
>
> pass registered variables to the new page. IE & NS both print the output
>
> as expected, but in Opera all variables are empty.
> Has anyone got any thoughts/solutions/experiences?
>
> regards
> Steve
>
> --
> ## login page
>
>$password = "letmein";
>   if (isset($input)){
>   if ($input == $password){
>   $auth = 1;
>   session_start();
>   session_register(enter,input,password,auth);
>   header("Location: 2.php");
>   exit;
>   }
>   }
> ?>
> 
>  method="POST">
> Enter password: 
> 
> 
>
>print "The value of \$enter is \"$enter\"";
>   print "The value of \$input is \"$input\"";
>   print "The value of \$password is \"$password\"";
>   print "The value of \$auth is \"$auth\"";
> ?>
>
> --
> ## 2.php
>
>session_start();
>
>   print "The value of \$enter is \"$enter\""; // empty
>   print "The value of \$input is \"$input\""; // should print
> 'letmein'
>   print "The value of \$password is \"$password\""; // should print
> 'letmein'
>   print "The value of \$auth is \"$auth\""; // should print '1'
> ?>
>
>
>



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




RE: [PHP] XML HELP

2002-04-10 Thread Crane, Christopher

ok I tried this code and the array is still empty.
By the way, my code looked the way it did because the browser or my mail
client cut it off. I had each of the functions on one line for easy reading
but because of the wrap I changed it to how you had it, which is how I would
normally do it if each function had more than one line to it.
 
http://quotes.nasdaq.com/quote.dll?page=xml&mode=stock&symbol=';
 
 
function StartHandler($Parser, $ElementName, $Attr='') {
 print "$ElementName: ";
 }
 
function CharacterHandler($Parser, $Line, $StockStuff) {
 array_push($StockStuff, $Line);
 print "$Line\n";
 }
 
function EndHandler($Parser, $ElementName, $Attr='') {
 }
 
 
while ( list(,$Sym) = each($Symbols) ) {
 global $StockStuff;
 $StockStuff = array();

 $Contents = implode( '', file("$URI$Sym") );
 
 $Parser = xml_parser_create('ISO-8859-1');
 xml_set_element_handler($Parser, 'StartHandler', 'EndHandler');
 xml_set_character_data_handler($Parser, 'CharacterHandler');
 
 if ( xml_parse($Parser, $Contents) ) { echo 'YES!'; }
 else { echo 'NO!'; }
 
 xml_parser_free($Parser);
 print "1st Position in the array = $StockStuff[1]\n";
  }
 
?>

Christopher J. Crane
Network Operations Manager

IKON Office Solutions
860.659.6464

 



[PHP] MSIE 6.0 Cookie/Privacy Question

2002-04-10 Thread Richard Spangenberg

Hi,

I have noticed that my cookies work just fine in MSIE 6.0 if the browser's
privacy setting is set to low.  However, in all other settings it is not
responding.

I am using a remote file JS call to set the cookie.  The browser will only
read cookie from the host that the page is loaded from and I believe that as
the remote JS script appears to be part of the html page from the host when
loaded.  Why would it not work?

Also, settings other than privacy set to low, make mention of  if host has a
Compact Privacy Policy, and Permission without Concent.  I don't know how to
qualify for these if there is anything we can do we will meet it.

Does everyone have problems with this or am I doing something wrong/

Rick



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




[PHP] Re: Sessions and Opera

2002-04-10 Thread Steve Fitzgerald

Cookies it was. Thanks

Julio Nobrega Trabalhando wrote:

>   Cookies disabled? Or cache? Have you tried a 'fresh' Opera install or a
> newer version?
>
> --
>
> Julio Nobrega.
>
> Um dia eu chego lá:
> http://sourceforge.net/projects/toca
>
> Ajudei? Salvei? Que tal um presentinho?
> http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884
>
> "Steve Fitzgerald" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > While testing a login page with different browsers I noticed that Opera
> > (vers5.02)
> > didn't allow me access to the site despite using the correct input, so I
> > wrote the
> > following pages to test Opera's performance. It seems that Opera doesn't
> >
> > pass registered variables to the new page. IE & NS both print the output
> >
> > as expected, but in Opera all variables are empty.
> > Has anyone got any thoughts/solutions/experiences?
> >
> > regards
> > Steve
> >
> > --
> > ## login page
> >
> >  >   $password = "letmein";
> >   if (isset($input)){
> >   if ($input == $password){
> >   $auth = 1;
> >   session_start();
> >   session_register(enter,input,password,auth);
> >   header("Location: 2.php");
> >   exit;
> >   }
> >   }
> > ?>
> > 
> >  method="POST">
> > Enter password: 
> > 
> > 
> >
> >  >   print "The value of \$enter is \"$enter\"";
> >   print "The value of \$input is \"$input\"";
> >   print "The value of \$password is \"$password\"";
> >   print "The value of \$auth is \"$auth\"";
> > ?>
> >
> > --
> > ## 2.php
> >
> >  >   session_start();
> >
> >   print "The value of \$enter is \"$enter\""; // empty
> >   print "The value of \$input is \"$input\""; // should print
> > 'letmein'
> >   print "The value of \$password is \"$password\""; // should print
> > 'letmein'
> >   print "The value of \$auth is \"$auth\""; // should print '1'
> > ?>
> >
> >
> >


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




Re: [PHP] Re: mailing list using mail()

2002-04-10 Thread Anzak Wolf

Is there anyway you could break this up into managable chunks maybe.  I'm 
currently doing something similar in that I'm writing a PHP based list 
server app that uses a heirarchical grouping system, but mine is broken done 
into smaller chunks based on group and user permissions.  What if you did a 
1 second sleep between each user send?  While it would take a very long time 
to parse through the list of users the mail server would still be able to 
respond quickly and not have PHP timeout.








>From: Yasuo Ohgaki <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: [PHP] Re: mailing list using mail()
>Date: Wed, 10 Apr 2002 20:46:57 +0900
>MIME-Version: 1.0
>Received: from [216.92.131.4] by hotmail.com (3.2) with ESMTP id 
>MHotMailBE7D714200A640043720D85C830472400; Wed, 10 Apr 2002 04:47:15 -0700
>Received: (qmail 99799 invoked by uid 1010); 10 Apr 2002 11:47:04 -
>Received: (qmail 99780 invoked by uid 1007); 10 Apr 2002 11:47:00 -
>From php-general-return-92371-anzak Wed, 10 Apr 2002 04:47:23 -0700
>Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
>Precedence: bulk
>list-help: 
>list-unsubscribe: 
>list-post: 
>Delivered-To: mailing list [EMAIL PROTECTED]
>Message-ID: <[EMAIL PROTECTED]>
>User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9+) 
>Gecko/20020328
>X-Accept-Language: ja, en-us, en
>References: <[EMAIL PROTECTED]> 
><[EMAIL PROTECTED]>
>X-Posted-By: 210.154.73.126
>
>Michael Virnstein wrote:
>>>Should I just use one message and append the BCC: line of the one 
>>>message?
>>
>>
>>this could probably be the best way.
>
>Right, but some MTA cannot handle too large header(s).
>
>Why don't you use list server in first place?
>For example, ezmlm support database backends if you
>are using qmail. PHP has ezmlm_hash function for it.
>
>--
>Yasuo Ohgaki
>
>
>
>>
>>"Petre Agenbag" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
>>[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>>
>>>Hi,
>>>the combination of PHP and mysql and the ease of use of the mail()
>>>function obviously leads me to believe that it *should* be a singe to
>>>use php to send customised messages to all my users , of whom I have
>>>details in a mysql table by simply running a "select * from table" and
>>>then using a while loop to run through every row and sending an e_mail
>>>to $user_in_table.
>>>
>>>The obvious problem here is that ( in my case 17 000 users) this can
>>>easily kill the mail server and could also cause the script to timeout
>>>or ( if increasing the timeout) kill the server outright.
>>>So, what are my options?
>>>Should I be attempting this ( if not, how can I keep others that are
>>>hosting on my machines from trying this with their own tables)
>>>Should I just use one message and append the BCC: line of the one 
>>>message?
>>>
>>>Thanks
>>>
>>
>>
>>
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>


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


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




Re: [PHP] Re: MySQL connection from non-localhost

2002-04-10 Thread Barry C. Hawkins

Dave,
 Did you use the URL:

http://www.domain.com

 Or did you use the fully-qualified domain name (FQDN):

www.domain.com

 For connecting to the MySQL server, the connection functions expect an FQDN, not 
a URL.  But, you may already know that.  Just checking.

Regards,

Barry C. Hawkins
Systems Consultant
All Things Computed
[EMAIL PROTECTED]



On Wed, 10 Apr 2002 19:54:10 +1200 David Robley <[EMAIL PROTECTED]> wrote:

In article <[EMAIL PROTECTED]>, 
[EMAIL PROTECTED] says...
> I was just wondering if there was a way to connect to a MySQL server on a
> server other than the one that your php script is on. I tried just putting
> in the URL of the site in place of localhost but that didn't work. Is there
> anything special that I have to do to get it to work? Thanks,
> Dave

Are the grants of the remote host set to accept anything other than 
localhost?

-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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


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




Re: [PHP] Re: Sessions and Opera

2002-04-10 Thread Tomy Wagner

and btw the browsers dont save the registered vars they are stored on the
server side... :) the browser only stores a cookie containing the session id
...

Tomy Wagner
- Original Message -
From: "Steve Fitzgerald" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, April 10, 2002 2:38 PM
Subject: [PHP] Re: Sessions and Opera


> Cookies it was. Thanks
>
> Julio Nobrega Trabalhando wrote:
>
> >   Cookies disabled? Or cache? Have you tried a 'fresh' Opera install or
a
> > newer version?
> >
> > --
> >
> > Julio Nobrega.
> >
> > Um dia eu chego lá:
> > http://sourceforge.net/projects/toca
> >
> > Ajudei? Salvei? Que tal um presentinho?
> > http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884
> >
> > "Steve Fitzgerald" <[EMAIL PROTECTED]> wrote in message
> > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > While testing a login page with different browsers I noticed that
Opera
> > > (vers5.02)
> > > didn't allow me access to the site despite using the correct input, so
I
> > > wrote the
> > > following pages to test Opera's performance. It seems that Opera
doesn't
> > >
> > > pass registered variables to the new page. IE & NS both print the
output
> > >
> > > as expected, but in Opera all variables are empty.
> > > Has anyone got any thoughts/solutions/experiences?
> > >
> > > regards
> > > Steve
> > >
> > > --
> > > ## login page
> > >
> > >  > >   $password = "letmein";
> > >   if (isset($input)){
> > >   if ($input == $password){
> > >   $auth = 1;
> > >   session_start();
> > >   session_register(enter,input,password,auth);
> > >   header("Location: 2.php");
> > >   exit;
> > >   }
> > >   }
> > > ?>
> > > 
> > >  method="POST">
> > > Enter password: 
> > > 
> > > 
> > >
> > >  > >   print "The value of \$enter is \"$enter\"";
> > >   print "The value of \$input is \"$input\"";
> > >   print "The value of \$password is \"$password\"";
> > >   print "The value of \$auth is \"$auth\"";
> > > ?>
> > >
> > > --
> > > ## 2.php
> > >
> > >  > >   session_start();
> > >
> > >   print "The value of \$enter is \"$enter\""; // empty
> > >   print "The value of \$input is \"$input\""; // should print
> > > 'letmein'
> > >   print "The value of \$password is \"$password\""; // should
print
> > > 'letmein'
> > >   print "The value of \$auth is \"$auth\""; // should print '1'
> > > ?>
> > >
> > >
> > >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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




RE: [PHP] AS/400 data access

2002-04-10 Thread Collins, Robert

Credit for the instructions goes to Matt Schroebel not myself.

Robert W. Collins II 
Webmaster 
New Orleans Regional Transit Authority 
Phone : (504) 248-3826 
Email : [EMAIL PROTECTED] 



-Original Message-
From: Dan Vande More [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 09, 2002 5:51 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] AS/400 data access


Thanks Mr. Collins, I wish that would have been about 7 months ago when I
did everything:)
I used those three articles and a couple more to get it done, but the
directions look great.


-Original Message-
From: Collins, Robert [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 09, 2002 3:24 PM
To: 'Matt Schroebel'; Collins, Robert; 'Rance Hall';
[EMAIL PROTECTED]
Subject: RE: [PHP] AS/400 data access


Thanks. Unfortunately this project is on a windows based platform, but this
may head me in the right direction.


Robert W. Collins II 
Webmaster 
New Orleans Regional Transit Authority 
Phone : (504) 248-3826 
Email : [EMAIL PROTECTED] 



-Original Message-
From: Matt Schroebel [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 09, 2002 2:46 PM
To: 'Collins, Robert'; 'Rance Hall'; [EMAIL PROTECTED]
Subject: RE: [PHP] AS/400 data access


I just did this on a Linux box running Red Hat 7.2 last Friday.  I used
several sources on the web and wrote up my exact steps and posted them at
http://www.php-faq.com/as400.html The other sources are quoted in that
document.  

Keep in mind, it's not the final version of the document, and I'd appreciate
any feedback.  After I get my app running, I'm going to move it to a FreeBSD
box and document that setup.  I was close to getting it to work on FreeBSD
last week, but decided to get it working with Redhat since that's what the
original docs describe.

I have written a couple of simple scripts that query the db on the AS/400
and display the results.  The performance seems fine. I did find that I had
to explictly state the library name the table is in as part of the sql.  For
instance:
$sql = "select field1, field2 from library.table where key=$id";

If you create a collection with the same name as the user php is connecting
with then you don't need to specify the library.  I need to read up a lot
because there is a way to set the path to multiple
libraries such that I saw in one of the IBM SQL books which is
$query = "SET path library1, library2";
But it wouldn't work for me. If either of you find the solution in the maze
of IBM docs, let me know and I'll add it to the instructions.

Also, you can't single quote numerics like you can in MySQL.

As I said, I just got it working, and will update the document as I learn
more about the pecularities of the AS/400.

Oh, make sure to grab the replacement odbc_fetch_array code in the user
notes at http://www.php.net/manual/en/function.odbc-fetch-array.php

> -Original Message-
> From: Collins, Robert [mailto:[EMAIL PROTECTED]] 
> Sent: Tuesday, April 09, 2002 2:13 PM
> To: 'Rance Hall'; [EMAIL PROTECTED]
> Subject: RE: [PHP] AS/400 data access
> 
> 
> I am also trying to access data on an AS/400 have you gotten 
> it to work, if
> so can you send an example? Thanks in advance.

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


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

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




Re: [PHP] Re: mysql

2002-04-10 Thread Erik Price


On Wednesday, April 10, 2002, at 07:45  AM, David Robley wrote:

>> I've been looking on the net and the php docs for a simple
>> mysql query solution, can someone please let me know
>> the best way to get the values of a query that only returns 1 record?
>>
>> All the select query examples on the net are examples of
>> multiple records being returned, and therefor, there is repition
>> methods shown.
>>
>> For this I don't need any repitition, I just need to know the best
>> way to get the DB values from the query into variables.
>>
>> Cheers.
>>
>> -Mason
>>
> A while or similar should still work with only one record; but of course
> you could just drop the while and use the 'enclosed' code just once. If
> you have a particular sample you want to reduce, post it if you need 
> more
> help.

Yes, just last night I discovered that the while or other loop is really 
only necessary if you're retrieving possible multiple results.  You can 
do it very simply just like

$sql = "SELECT...";
$result = mysql_query($sql, $db);
$row = mysql_fetch_row($result);
echo $row[0];

And of course the above can be modified for multiple columns/array 
elements.

Someone did suggest that you use an if statement, however, in the event 
that no records are retrieved --

if (!$result = mysql_query($sql, $db)) {
   echo "No records found.";
} else {
   $row = mysql_fetch_row($result);
}


Erik






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


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




[PHP] PHP Sessions/P3P Questions

2002-04-10 Thread Richard Spangenberg

Hi,

I am using PHP Sessions in my coding.  I have noticed that my cookies work
just fine in MSIE 6.0 if the browser's privacy setting is set to low.
However, in all other settings it is not responding.  I bleive this is
because of the P3P privacy setting.  Is this a major issue, or are the
higher P3P settings not really being used.

What are others doing about this? Implimenting P3P at clients sites or
standing by and waiting?

Rick





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




[PHP] formatting a numeric string

2002-04-10 Thread Erik Price

I have the following code --

$phone_number = "8005551212";
$phone_array = explode("", $phone_number);
$phone_number = sprintf("(%s%s%s) %s%s%s-%s%s%s%s", $phone_array[0], 
$phone_array[1], $phone_array[2], $phone_array[3], $phone_array[4], 
$phone_array[5], $phone_array[6], $phone_array[7], $phone_array[8]);

Is this really the best way to achieve $phone_number = "(800) 
555-1212" ?  Or am I taking the long way around, and there's a function 
that can do this better?

Thanks,


Erik







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


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




Re: [PHP] formatting a numeric string

2002-04-10 Thread Edward van Bilderbeek - Bean IT

try:
print ereg_replace("^([0-9]{3})([0-9]{3})([0-9]*)$", "(\\1) \\2 - \\3",
$phone_number);


Greets,

Edward


- Original Message -
From: "Erik Price" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, April 10, 2002 4:13 PM
Subject: [PHP] formatting a numeric string


> I have the following code --
>
> $phone_number = "8005551212";
> $phone_array = explode("", $phone_number);
> $phone_number = sprintf("(%s%s%s) %s%s%s-%s%s%s%s", $phone_array[0],
> $phone_array[1], $phone_array[2], $phone_array[3], $phone_array[4],
> $phone_array[5], $phone_array[6], $phone_array[7], $phone_array[8]);
>
> Is this really the best way to achieve $phone_number = "(800)
> 555-1212" ?  Or am I taking the long way around, and there's a function
> that can do this better?
>
> Thanks,
>
>
> Erik
>
>
>
>
>
> 
>
> Erik Price
> Web Developer Temp
> Media Lab, H.H. Brown
> [EMAIL PROTECTED]
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>



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




[PHP] Re: formatting a numeric string

2002-04-10 Thread liljim

Hi Erik.

Try this:



~James

"Erik Price" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I have the following code --
>
> $phone_number = "8005551212";
> $phone_array = explode("", $phone_number);
> $phone_number = sprintf("(%s%s%s) %s%s%s-%s%s%s%s", $phone_array[0],
> $phone_array[1], $phone_array[2], $phone_array[3], $phone_array[4],
> $phone_array[5], $phone_array[6], $phone_array[7], $phone_array[8]);
>
> Is this really the best way to achieve $phone_number = "(800)
> 555-1212" ?  Or am I taking the long way around, and there's a function
> that can do this better?
>
> Thanks,
>
>
> Erik
>
>
>
>
>
> 
>
> Erik Price
> Web Developer Temp
> Media Lab, H.H. Brown
> [EMAIL PROTECTED]
>



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




[PHP] Re: PHP Sessions/P3P Questions

2002-04-10 Thread Michael Kimsal

Richard Spangenberg wrote:
> Hi,
> 
> I am using PHP Sessions in my coding.  I have noticed that my cookies work
> just fine in MSIE 6.0 if the browser's privacy setting is set to low.
> However, in all other settings it is not responding.  I bleive this is
> because of the P3P privacy setting.  Is this a major issue, or are the
> higher P3P settings not really being used.
> 
> What are others doing about this? Implimenting P3P at clients sites or
> standing by and waiting?
> 


Well, if you want to get a project done and get paid, you've got no 
choice but to jump into the P3P stuff.  It's a major pain, let me tell 
you.  Getting clients who take 3 weeks to determine what shade of blue 
they like to suddenly have to positively articulate a privacy policy 
just isn't my idea of fun.

And don't think you can throw just anything in there.  If your customer 
will use the client's info to call them about something, and you 
indicate in the P3P that no phone calls will be made to the user, you 
may be in trouble (or at least the site owner would be).  The legal 
ramifications are unknown at this point, but given the big business at 
stake, and the litigious nature of our society (US anyway) nothing would 
surprise me at this point.

The whole P3P gives too much control to users without requiring any 
education on their part.  Sliding a bar to 'medium' without knowing 
precisely what it's doing causes nothing but support headaches for the 
sites.

We went through this about 6 months ago.  IE6 came out and about 6 
percent of our client's users were using it after about a month. 
Support calls skyrocketed because suddenly a huge number of people 
couldn't use the site.  Cookies weren't being accepted.  In every case, 
it was an IE6 user who'd set their privacy settings up higher than 
'low'.  We had to hastily put up a P3P policy and modify it later. 
People were just paranoid about 'privacy', as if moving a slider made 
them safer.  The sad thing is that the slime who *will* sell your name 
and email and whatever other info they gather will have no compunction 
about creating a false P3P policy file.

Michael Kimsal
http://www.phphelpdesk.com
734-480-9961
Guaranteed PHP support when you need it


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




Re: [PHP] formatting a numeric string

2002-04-10 Thread pong-TC

[EMAIL PROTECTED] writes:
>I have the following code --
>
>$phone_number = "8005551212";
>$phone_array = explode("", $phone_number);
>$phone_number = sprintf("(%s%s%s) %s%s%s-%s%s%s%s", $phone_array[0], 
>$phone_array[1], $phone_array[2], $phone_array[3], $phone_array[4], 
>$phone_array[5], $phone_array[6], $phone_array[7], $phone_array[8]);
>
>Is this really the best way to achieve $phone_number = "(800) 
>555-1212" ?  Or am I taking the long way around, and there's a function 
>that can do this better?
>
>Thanks,
>
>
>Erik

I would do this
echo "(" . substr(0,3) . ") " . substr(3,3) . "-" . substr(6,4);

Pong


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




[PHP] simple function question.

2002-04-10 Thread Jeff Bearer

this is a very simple question.  I'm trying to figure out if there is a
one line way to do this:

I want to pass a variable to the function only if it matches a certin
value, I know I can do this:

if($a=='H') my_function($bob,'Y');
else my_function($bob);

but If it's possible I'd like to do it with one line something that I'd
think it would be like this.

my_function($bob,if($a=='H') return 'Y'; );

I know that return doesn't work, and echo wouldn't work either,  can you
even put a if statement inside a function call?

-- 
Jeff Bearer, RHCE
Webmaster
PittsburghLIVE.com
2002 EPpy Award, Best Online U.S. Newspaper


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




Re: [PHP] simple function question.

2002-04-10 Thread pong-TC

[EMAIL PROTECTED] writes:
>this is a very simple question.  I'm trying to figure out if there is a
>one line way to do this:
>
>I want to pass a variable to the function only if it matches a certin
>value, I know I can do this:
>
>if($a=='H') my_function($bob,'Y');
>else my_function($bob);
You can do this
($a=='H') ? my_function($bob,'Y'):  my_function($bob);
>
>
>but If it's possible I'd like to do it with one line something that I'd
>think it would be like this.
>
>my_function($bob,if($a=='H') return 'Y'; );
>
Also, if you change this 
>if($a=='H') return 'Y'
  to a function ie foo(a){
>if($a=='H') return 'Y'
;}.  Then, put foo(a) in my_function, I think it would work.

Pong


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




[PHP] fwrite

2002-04-10 Thread Ron Allen

Using fwrite how would I insert a line return



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




[PHP] Sorry Folks, wanted to make sure that this address was not included in myRelay Block Settings

2002-04-10 Thread Daniel Negron/KBE

Sorry Folks, wanted to make sure that this address was not included in my
Relay Block Settings


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




Re: [PHP] fwrite

2002-04-10 Thread Jason Wong

On Wednesday 10 April 2002 22:44, Ron Allen wrote:
> Using fwrite how would I insert a line return


\r ==> return
\n ==> linefeed

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
One big pile is better than two little piles.
-- Arlo Guthrie
*/

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




Re: [PHP] fwrite

2002-04-10 Thread Ninety-Nine Ways To Die

$fp = fwrite($myfile,chr(13));
--



On Wed, 10 Apr 2002 16:44:44  
 Ron Allen wrote:
>Using fwrite how would I insert a line return
>
>
>
>-- 
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
>


See Dave Matthews Band live or win a signed guitar
http://r.lycos.com/r/bmgfly_mail_dmb/http://win.ipromotions.com/lycos_020201/splash.asp
 

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




[PHP] One last thing for the day

2002-04-10 Thread Ron Allen

Any idea on how to obtain a computer name...Windows environment using
PHP?



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




[PHP] Compiling php-4.1.2 on Mac OS 10.1.3 w/udpated tools

2002-04-10 Thread Barry C. Hawkins

Colleagues,
 Has anyone out there had success in compiling PHP 4.1.2 on Mac OS 10.1.3 (not 
server)?  I tried the workarounds posted on 

http://www.entropy.ch/software/macosx/php/

but I keep getting the following error during the make operation:

/usr/bin/libtool: internal link edit command failed
make[1]: *** [libphp4.la] Error 1
make: *** [all-recursive] Error 1

 Thanks in advance for any suggestions, and please correct me if this is improper 
for the general list.

Regards,

Barry C. Hawkins
Systems Consultant
All Things Computed
[EMAIL PROTECTED]


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




Re: [PHP] One last thing for the day

2002-04-10 Thread Scott St. John


 $network = new COM("WScript.Network");
 $computername = $network->ComputerName;



On Wed, 10 Apr 2002, Ron Allen wrote:

> Any idea on how to obtain a computer name...Windows environment using
> PHP?
> 
> 
> 
> 

-- 



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




Re: [PHP] Sessions and Opera

2002-04-10 Thread Tom Rogers

Hi
Some versions of opera will cache the first login page so if you submit to 
the same page it will still show the login dialog. The way I got around it 
was to add "?" to the post url .. ie action="index.php?"  that fooled it to 
reload the page correctly.
Tom

At 10:22 PM 10/04/2002, Steve Fitzgerald wrote:
>While testing a login page with different browsers I noticed that Opera
>(vers5.02)
>didn't allow me access to the site despite using the correct input, so I
>wrote the
>following pages to test Opera's performance. It seems that Opera doesn't
>
>pass registered variables to the new page. IE & NS both print the output
>
>as expected, but in Opera all variables are empty.
>Has anyone got any thoughts/solutions/experiences?
>
>regards
>Steve
>
>--
>## login page
>
>   $password = "letmein";
>   if (isset($input)){
>   if ($input == $password){
>   $auth = 1;
>   session_start();
>   session_register(enter,input,password,auth);
>   header("Location: 2.php");
>   exit;
>   }
>   }
>?>
>
> method="POST">
>Enter password: 
>
>
>
>   print "The value of \$enter is \"$enter\"";
>   print "The value of \$input is \"$input\"";
>   print "The value of \$password is \"$password\"";
>   print "The value of \$auth is \"$auth\"";
>?>
>
>--
>## 2.php
>
>   session_start();
>
>   print "The value of \$enter is \"$enter\""; // empty
>   print "The value of \$input is \"$input\""; // should print
>'letmein'
>   print "The value of \$password is \"$password\""; // should print
>'letmein'
>   print "The value of \$auth is \"$auth\""; // should print '1'
>?>
>
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php


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




[PHP] Re: [PHP-INST] php and POST

2002-04-10 Thread Matt

If you changed the php.ini to set the register_globals to on, did you also
restart apache?  I'm sure you are aware that register globals is now turned
off by default in php 4.1+. Look at phpinfo() and make sure register_globals
is *really* on.  You really ought to be writing code with $_POST[], read
http://www.php.net/manual/en/security.php to see why.

- Original Message -
From: "Not Telling You!" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
>  But I cannot use passed variables.  I can however print what
> was passed using...
>
> printf("%s", $HTTP_POST_VARS["name"]);
>
> That works fine, I'm just unable to just call $name.  The php code does
> work as it is currently running on a RH 7.1 box with Apache 1.3.20 and
> php 4.0.6.



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




[PHP] Visitors Log Help

2002-04-10 Thread Martin Clifford

Hi all!

I am trying to build a Visitor_Log.txt file for my page, which will write specific 
information about users that visit the page (time of day they visited, browser they 
are using, operating system, etc) to a txt file on my server.

My question is... how do I write these values to the file as soon as they access the 
page?  I'm very comfortable with using JavaScript to get user information, but I know 
that PHP also has built-in functions to get user information as well... would I do 
something along the lines of...



If someone loaded a page with that in it, would it write to the file as soon as it's 
accessed and interpreted, or would some action have to take place to make it run?  I 
won't ask which PHP Variables can be used to get user information, I can find that 
information in the Manual... any information as to my questions would be wonderful!

Also, please CC me on responses since I'm on the digest!  Thank you in advance!

Martin


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




[PHP] Secure storage of credit card information

2002-04-10 Thread Someone Somewhere

I'm working on a e commerce  site and I need to store the credit card info
of people who purchase stuff, on the site. How can I encrypt the credit card
# put it in a dbase and decrypt it when I need to

Using Php4.* and Mysql.





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




Re: [PHP] printf

2002-04-10 Thread Alexander Skwar

»Ron Allen« sagte am 2002-04-10 um 13:49:15 +0200 :
> I would like it so that it puts a comma for every 3 spaces...Any

Uhm, I'd rather use number_format than printf.

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

Alexander Skwar
-- 
How to quote:   http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:   http://www.iso-top.de  | Jabber: [EMAIL PROTECTED]
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
   Uptime: 21 hours 44 minutes

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




Re: [PHP] Is While needed in MySQL Result with a Limit of 1

2002-04-10 Thread Alexander Skwar

»Brian Drexler« sagte am 2002-04-10 um 07:58:59 -0400 :
> My question is thisis the while statement needed when I'm only returning
> one record?

No, it's not.  Since you know that you'll either get 0 or 1 row, you
don't need the while loop.  Instead I'd call mysql_num_rows to see if
there was 1 row.

Alexander Skwar
-- 
How to quote:   http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:   http://www.iso-top.de  | Jabber: [EMAIL PROTECTED]
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
   Uptime: 21 hours 45 minutes

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




RE: [PHP] session variables and unset

2002-04-10 Thread Johnson, Kirk

I get '4', as expected, on v.4.0.6.

Kirk

> -Original Message-
> From: Valdas Andrulis [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, April 10, 2002 3:43 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] session variables and unset
> 
> 
> Hello,
> 
> I have 3 scripts:
> 
> ## i2.php
>  session_start();
> $counter = 1;
> session_register("counter");
> header("Location: /i.php");
> ?>
> 
> ## i.php
>  session_start();
> $counter = 0;
> ### uncomment this to see the difference
> # session_unregister("counter");
> session_register("counter");
> unset($counter);
> $counter = 4;
> session_register("counter");
> header("Location: /i1.php");
> ?>
> 
> ## i1.php
>  session_start();
> print $counter;
> 
> ?>
> 
> When I open http://host/i2.php on my browser I get 0, though 
> I expect it
> to be 4. If I uncomment session_unregister("counter"); I get 4 as
> expected.
> 
> PHP version 4.1.2.
> 
> Anyone can explain this behavior? Also can anyone try this with say
> 4.0.5 or older version of PHP?
> 
> Good luck,
> 
> Valdas

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




Re: [PHP] chown error?

2002-04-10 Thread John Weez



Ah yes my brain was tired..I meant chown. I want to change the ownership 
of the newly created file to an existing user. The form has a field 
where they input their login name and the nam,e of the newly created 
directory. The PhP script is passed teh varibles but fails to change 
ownership to the valid login name which is supplied on the formThe 
script gives an error saying the command is not permitted and gives the 
line number where the chown command is given.

Si first the directory is made with ownership nobidy.nobody and then the 
script tries to change the ownsership tot he supplied login name via 
chown ($file,$login).

John


Henrik Hudson wrote:

>Hello.
>
>First off, to  change ownership you want "chown", not "chmod". Also, chown 
>isn't always permitted depending on the cicrumstances of who owns the 
>directory or the specific file to begin with. 
>
>If you're web server is running as nobody it will only be able to create files 
>in a directory owned by nobody (or world writable...but that's stupid) or 
>modify a file that already exists and owned by nobody. 
>
>If I may ask, what are you trying to change the ownership for / to?
>
>Henrik
>
>On Wednesday 10 April 2002 02:06, John Weez wrote:
>
>>Hi all...I want to change the ownership of a file that is created via
>>php..so i uses  chmod command in my php script.. Upon execution of the
>>script i get an error saying command not permitted with a line number
>>pointing to my chmod command.
>>
>>I'm running apache as user nobody for security reasons.
>>
>>any hints as to how i can get chmod to work would be great...
>>
>>John
>>
>




Re: [PHP] Visitors Log Help

2002-04-10 Thread Andrew Brampton

Well that should write as soon as that php is requested...

BUT U might want to put some file locking in there to make sure 2 people
don't visit at the exact same time and corrupt your Vistor_Log.txt

BTW If are using apache a better option might be to look into the custom log
files it can make, I think it can do what you are trying to do in PHP

Andrew
- Original Message -
From: "Martin Clifford" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, April 10, 2002 4:36 PM
Subject: [PHP] Visitors Log Help


Hi all!

I am trying to build a Visitor_Log.txt file for my page, which will write
specific information about users that visit the page (time of day they
visited, browser they are using, operating system, etc) to a txt file on my
server.

My question is... how do I write these values to the file as soon as they
access the page?  I'm very comfortable with using JavaScript to get user
information, but I know that PHP also has built-in functions to get user
information as well... would I do something along the lines of...



If someone loaded a page with that in it, would it write to the file as soon
as it's accessed and interpreted, or would some action have to take place to
make it run?  I won't ask which PHP Variables can be used to get user
information, I can find that information in the Manual... any information as
to my questions would be wonderful!

Also, please CC me on responses since I'm on the digest!  Thank you in
advance!

Martin


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




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




Re: [PHP] Secure storage of credit card information

2002-04-10 Thread Thalis A. Kalfigopoulos

Lookup in the manual about the mcrypt functions



On Wed, 10 Apr 2002, Someone Somewhere wrote:

> I'm working on a e commerce  site and I need to store the credit card info
> of people who purchase stuff, on the site. How can I encrypt the credit card
> # put it in a dbase and decrypt it when I need to
> 
> Using Php4.* and Mysql.
> 
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


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




[PHP] unsetting an instance from within its class

2002-04-10 Thread Erik Price

Is there a way to unset or destroy an object instance from a method 
within its class?  I'm trying to write a method that destroys its 
instance but I'm not sure how to refer to the object itself from within 
the class.


Erik







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


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




Re: [PHP] Visitors Log Help

2002-04-10 Thread Martin Clifford

As I'm sort of new to this, can you expand on "file locking"?  As of now, I'm running 
Apache on my home PC, but my host most likely will not allow me access to it's apache 
log files.  That is the main reason I want to do this, and also because I'm studying 
PHP and this looks like a good way to get a handle on file permissions, file writing, 
reading, etc.  Thanks for answering my question though! :)

Martin

>>> "Andrew Brampton" <[EMAIL PROTECTED]> 04/10/02 11:56AM >>>
Well that should write as soon as that php is requested...

BUT U might want to put some file locking in there to make sure 2 people
don't visit at the exact same time and corrupt your Vistor_Log.txt

BTW If are using apache a better option might be to look into the custom log
files it can make, I think it can do what you are trying to do in PHP

Andrew
- Original Message -
From: "Martin Clifford" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, April 10, 2002 4:36 PM
Subject: [PHP] Visitors Log Help


Hi all!

I am trying to build a Visitor_Log.txt file for my page, which will write
specific information about users that visit the page (time of day they
visited, browser they are using, operating system, etc) to a txt file on my
server.

My question is... how do I write these values to the file as soon as they
access the page?  I'm very comfortable with using JavaScript to get user
information, but I know that PHP also has built-in functions to get user
information as well... would I do something along the lines of...



If someone loaded a page with that in it, would it write to the file as soon
as it's accessed and interpreted, or would some action have to take place to
make it run?  I won't ask which PHP Variables can be used to get user
information, I can find that information in the Manual... any information as
to my questions would be wonderful!

Also, please CC me on responses since I'm on the digest!  Thank you in
advance!

Martin


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





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




Re: [PHP] mailing list using mail()

2002-04-10 Thread Peter H. Lemieux

> the combination of PHP and mysql and the ease of use of the mail()
> function obviously leads me to believe that it *should* be a cinch to
> use php to send customised messages to all my users , of whom I have
> details in a mysql table by simply running a "select * from table" and
> then using a while loop to run through every row and sending an e_mail
> to $user_in_table.

You don't want to use the mail() function.  It will take forever to send
17,000 messages since PHP will wait for each message to be delivered
before sending the next one.  With DNS lookups, slow remote servers, etc.,
it can take a long time to send each message.

A better solution on *nix machines with sendmail is to write the messages
into the mail queue and use "sendmail -q" to send them out.  (If sendmail
is running as a daemon, it's probably already configured with "-bd -q15m"
or a similar set of command line switches.  Otherwise you'll need a line
in /etc/crontab that runs "sendmail -q" as root throughout the day.)

Here's a sample that writes each message into the queue assuming the
appropriate values for each addressee are stored in $from, $to, $subject,
and $message.  You'd obviously embed this is an iteration loop.

# you probably want a sender to handle bounces
$sender="[EMAIL PROTECTED]";

### LOOP OVER THESE

# complete sendmail command; note that this must be in the iteration
# loop to fill in $sender and $name for each recipient
$sendmail="/usr/sbin/sendmail -odq -t -i -f$sender '$name'";

# construct the header
$headers=
"Sender: $sender
From: $from
To: $to
Subject: $subject
";

# mail the message (write to sendmail socket; queue for delivery)

$sm=popen($sendmail,"w");
fputs($sm,$headers);
fputs($sm,$message);
pclose($sm);

### END OF LOOP ###


Good luck!

Peter


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




RE: [PHP] Secure storage of credit card information

2002-04-10 Thread Nathan Cassano


If I where in your shoes I would encrypt the accounts with Mcrypt, setup
a separate database, on a separate computer, communicating on a low
speed serial line (4800 baud) using ppp, fully fire walling the
connection and doing mass logging. 

Mcrypt Encryption Functions
http://www.php.net/manual/en/ref.mcrypt.php

-Original Message-
From: Someone Somewhere [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, April 10, 2002 9:48 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Secure storage of credit card information


I'm working on a e commerce  site and I need to store the credit card
info of people who purchase stuff, on the site. How can I encrypt the
credit card # put it in a dbase and decrypt it when I need to

Using Php4.* and Mysql.





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


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




[PHP] password for PDF files

2002-04-10 Thread Bogdan Popescu

Hello everybody,

  can anybody tell me whether is it possible
  to generate PDF files with a password
  (both for opening and for modifying).

-- 
TIA,
Bogdan  mailto:[EMAIL PROTECTED]


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




[PHP] arguments against php / mysql?

2002-04-10 Thread Mallen Baker

Hi - the company we're talking to about doing some work on a simple site / database is 
trying hard to persuade us that Windows-based PHP / mysql is not the route to go. The 
arguments are as follows:

1. XXX's experience that MySQL is less than 100% stable when running on a windows 
platform (main problem being unexpected database shutdowns while applications are 
being used).
2. The fact that the recommended mode for running PHP on a windows platform (the CGI 
binary) uses technology that is now reasonably old and will consequently result  in a 
hit to the server performance and memory management and the associated  possible lack 
of scalability.
3. Loss of verity - the powerful search engine bundled with Cold Fusion. Searches may  
be significantly slower on the new site.

I have had some experience using php/mysql on linux/apache - but don't have enough 
information to know whether this advice is sound or not. Can anyone please advise - is 
there anything in these arguments?

If so, are there ways around the problems. We very much want to use these technologies 
due to the open source aspects.

Thanks - Mallen




This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk


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




Re: [PHP] XML HELP

2002-04-10 Thread Analysis & Solutions

Hey Christopher:

> function CharacterHandler($Parser, $Line, $StockStuff) {
>  array_push($StockStuff, $Line);
>  print "$Line\n";
>  }
... snip ...
> while ( list(,$Sym) = each($Symbols) ) {
>  global $StockStuff;

Global is used INSIDE functions to allow variables to be brought in and
out of the function.  So, in this case, you'd have to put it as the
first line inside the CharacterHandler function.


>  print "1st Position in the array = $StockStuff[1]\n";
... snip ...
> Christopher J. Crane
> Network Operations Manager
> IKON Office Solutions

"1" is not the first position in an array.  "0" is. Considering that
last step there and the signature below, I bet once you get the test
working, you're just going to grab the array index number that has the
latest stock quote in it put it on your company's website.

If that's the case, you've got a problem.  What if NASDAQ changes the
order that the fields are in?  That's right, you'll be putting the wrong
data on the website.  You need to use an associative array, which means 
the array's index are words, and in this case, the words are the names 
of the data tags.

I just whipped up a complete, basic, example of how to parse XML files
using PHP.  Lucky for you, it uses your stock quote project as the
model!  Go check it out:

   http://www.analysisandsolutions.com/code/phpxml.htm

Enjoy,

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

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




Re: [PHP] MSIE 6.0 Cookie/Privacy Question

2002-04-10 Thread Analysis & Solutions

Yo Rich:

On Wed, Apr 10, 2002 at 08:41:04AM -0400, Richard Spangenberg wrote:
>
> I have noticed that my cookies work just fine in MSIE 6.0 if the browser's
> privacy setting is set to low.  However, in all other settings it is not
> responding.
> 
> I am using a remote file JS call to set the cookie.

Why, I bet that's your problem right there.  I bet the problem is
arising because higher security settings turn Java'sCrap off.  Dude,
don't use JS for anything except mouse overs.  Cookies are bad
enough.

Use PHP's cookie functions.

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

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




[PHP] How to send an email to everone listed in a file

2002-04-10 Thread Anthony Rodriguez

Dear David,

You're going to have 2 problems:

(1) You're going to overload the outgoing mail server. I've done it. Now i 
use a newsletter-type mailing list.

(2) Invalid e-mail addresses will be returned to your hosting provider, not 
to the  "From: ..."address.  I'm looking for an answer to this now.

Here's the code I use for 1 e-mail.

\n");
@mysql_close($connection);
header ("location:add_5.htm");
flush();
exit;
?>


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




RE: [PHP] arguments against php / mysql?

2002-04-10 Thread Cal Evans

1 is outdated information.  I've had a production server up for a year now
without a hitch. (Linux, Apache/MySQL/PHP) I'm sure others have a much
longer track-record than mine.

#2: True.  Don't use IIS, use Apache. Then you can run PHP as a module of
Apache, not as a CGI. Better but still has issues. (Then again, just
straight IIS has more issues than any option)

#3 Write your own or use ht-dig. (is that available on Windows?)

I switched a smallish site form NT 4.x/IIS/ASP/M$SQL (2 servers) to
Linux/APache/PHP/MySQL.  My uptime has dramatically improved and I saved
$15,000 in licensing fees that M$ was going to charge me to move to
Win2k/SQL2k. (And I missed out on the whole CodeRed thingy!)

Why anyone would put up a Windows server on the Internet these days is
beyond me. It costs more, it's less reliable and if the argument is
'accountability', go back and read your EULAs. (The word blameless is in
there for a reason!)

Bottom line, I can't help you argue using PHP/MySQL on a Windows platform.
The problem is not the technology, it's the platform. L.A.M.P, however, is
the most stable platform I've ever used for web site/web based application
development.

=C=
Get on the M$ treadmill.  There's a toll-booth every 10 steps.

*
* Cal Evans
* Journeyman Programmer
* Techno-Mage
* http://www.calevans.com
*


-Original Message-
From: Mallen Baker [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 10, 2002 11:30 AM
To: >
Subject: [PHP] arguments against php / mysql?


Hi - the company we're talking to about doing some work on a simple site /
database is trying hard to persuade us that Windows-based PHP / mysql is not
the route to go. The arguments are as follows:

1. XXX's experience that MySQL is less than 100% stable when running on a
windows platform (main problem being unexpected database shutdowns while
applications are being used).
2. The fact that the recommended mode for running PHP on a windows platform
(the CGI binary) uses technology that is now reasonably old and will
consequently result  in a hit to the server performance and memory
management and the associated  possible lack of scalability.
3. Loss of verity - the powerful search engine bundled with Cold Fusion.
Searches may  be significantly slower on the new site.

I have had some experience using php/mysql on linux/apache - but don't have
enough information to know whether this advice is sound or not. Can anyone
please advise - is there anything in these arguments?

If so, are there ways around the problems. We very much want to use these
technologies due to the open source aspects.

Thanks - Mallen




This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk


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



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




RE: [PHP] unsetting an instance from within its class

2002-04-10 Thread Cal Evans

Never actually tried to do this (Never actually thought it was a good idea)
but:
this = null;

may do the trick.

Then again it may cause your php page to blow chow all over your screen.

=C=

*
* Cal Evans
* Journeyman Programmer
* Techno-Mage
* http://www.calevans.com
*


-Original Message-
From: Erik Price [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 10, 2002 11:04 AM
To: [EMAIL PROTECTED]
Subject: [PHP] unsetting an instance from within its class


Is there a way to unset or destroy an object instance from a method
within its class?  I'm trying to write a method that destroys its
instance but I'm not sure how to refer to the object itself from within
the class.


Erik







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


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



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




Re: [PHP] arguments against php / mysql?

2002-04-10 Thread Rasmus Lerdorf

It's pretty hard to argue in favour of Windows.  But stick Linux or
FreeBSD in there as your OS and you will have a rock-solid, inexpensive
and well-supported platform that will put just about anything you can
build on a Windows server to shame.

-Rasmus

On Wed, 10 Apr 2002, Mallen Baker wrote:

> Hi - the company we're talking to about doing some work on a simple site / database 
>is trying hard to persuade us that Windows-based PHP / mysql is not the route to go. 
>The arguments are as follows:
>
> 1. XXX's experience that MySQL is less than 100% stable when running on a windows 
>platform (main problem being unexpected database shutdowns while applications are 
>being used).
> 2. The fact that the recommended mode for running PHP on a windows platform (the CGI 
>binary) uses technology that is now reasonably old and will consequently result  in a 
>hit to the server performance and memory management and the associated  possible lack 
>of scalability.
> 3. Loss of verity - the powerful search engine bundled with Cold Fusion. Searches 
>may  be significantly slower on the new site.
>
> I have had some experience using php/mysql on linux/apache - but don't have enough 
>information to know whether this advice is sound or not. Can anyone please advise - 
>is there anything in these arguments?
>
> If so, are there ways around the problems. We very much want to use these 
>technologies due to the open source aspects.
>
> Thanks - Mallen
>
>
>
> 
> This e-mail has been scanned for all viruses by Star Internet. The
> service is powered by MessageLabs. For more information on a proactive
> anti-virus service working around the clock, around the globe, visit:
> http://www.star.net.uk
> 
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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




RE: [PHP] Secure storage of credit card information

2002-04-10 Thread Cal Evans

DISCLAIMER:
Use this advice at your own risk.  If you take my advice and your cc numbers
still get stolen, your fault, not mine. By continuing to read this, you
agree to these terms.

Put them in a separate database, on a different server, behind a firewall,
that is ONLY running MySQL and sh. Shut EVERYTHING else off, lock it down
hard, remove all logins other than the ones necessary for the box's
operation. Set your hosts.allow to only allow access to the box from the
webserver.

Then, in your PHP, retrieve them with a separate Select using a memberID or
userID as the FK from the main database.

Change the mysql password daily. Make sure it's different form the password
to get into your main server.

Is this secure? No.  Does it make it harder to get the CC info? Yes.  Harder
is all you can hope for. Impossible is...well, impossible.  :)

HTH,
=C=
*
* Cal Evans
* Journeyman Programmer
* Techno-Mage
* http://www.calevans.com
*


-Original Message-
From: Someone Somewhere [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 10, 2002 11:48 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Secure storage of credit card information


I'm working on a e commerce  site and I need to store the credit card info
of people who purchase stuff, on the site. How can I encrypt the credit card
# put it in a dbase and decrypt it when I need to

Using Php4.* and Mysql.





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



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




RE: [PHP] Secure storage of credit card information

2002-04-10 Thread SHEETS,JASON (Non-HP-Boise,ex1)

Storing credit card numbers is dangerous, look at the mcrypt functions like
previously mentioned. 

I would encrypt the user's credit card number with a key based on their
account password this gives you the ability to not store the encryption key
on the webserver.  You should mangle it, encrypt it with a temp key, etc.  I
would mangle their password someway to make it a more secure password, don't
trust a user to pick a safe or secure password.  Make sure you store the
users password as an md5 hash so that if your machine is compromised the bad
guys can't easily get your users passwords.

Just running the database server on an isolated machine does not solve the
problem of keeping the data secure, neither does running a firewall between
the two, obviously your web server needs access to the database, that in
itself will enable a "bad guy" to access your database once he has access to
your web server because the firewall allows access from your webserver to
the database server, speed of connection to the database server doesn't
really matter, how long does it take to transfer 16 characters?, if you are
not using encryption or store the key on your web server he has full access
to all of your credit card numbers.

Secure both your webserver and your database server and the host os they run
on (I would NOT use Windows), run tripwire or another similar program to
monitor your PHP scripts, if someone were to hack your machine they could
modify your PHP code to email them your users passwords, also conduct all
transactions accross at least 128 bit SSL.  Do NOT store the credit card
number or login password unencrypted in a session, sessions are plain text
by default and someone with access to your machine can read the session
files or access your database and read the information.

Make sure you really need to store credit cards, one bug and some script
kiddie has your credit card information.

Jason


-Original Message-
From: Someone Somewhere [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 10, 2002 10:48 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Secure storage of credit card information


I'm working on a e commerce  site and I need to store the credit card info
of people who purchase stuff, on the site. How can I encrypt the credit card
# put it in a dbase and decrypt it when I need to

Using Php4.* and Mysql.





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

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




Re: [PHP] arguments against php / mysql?

2002-04-10 Thread Jackson Miller

I have been using Win2K with Apache/MySQL/PHP for about 8 months for an
intranet site.  It is a mission critical intranet database for keeping
track of attendance/grades for a high school.

I have had no problems (read: not a single one!)

HTH

-Jackson

On Wed, 2002-04-10 at 12:30, Mallen Baker wrote:
> Hi - the company we're talking to about doing some work on a simple site / database 
>is trying hard to persuade us that Windows-based PHP / mysql is not the route to go. 
>The arguments are as follows:
> 
> 1. XXX's experience that MySQL is less than 100% stable when running on a windows 
>platform (main problem being unexpected database shutdowns while applications are 
>being used).
> 2. The fact that the recommended mode for running PHP on a windows platform (the CGI 
>binary) uses technology that is now reasonably old and will consequently result  in a 
>hit to the server performance and memory management and the associated  possible lack 
>of scalability.
> 3. Loss of verity - the powerful search engine bundled with Cold Fusion. Searches 
>may  be significantly slower on the new site.
> 
> I have had some experience using php/mysql on linux/apache - but don't have enough 
>information to know whether this advice is sound or not. Can anyone please advise - 
>is there anything in these arguments?
> 
> If so, are there ways around the problems. We very much want to use these 
>technologies due to the open source aspects.
> 
> Thanks - Mallen
> 
> 
> 
> 
> This e-mail has been scanned for all viruses by Star Internet. The
> service is powered by MessageLabs. For more information on a proactive
> anti-virus service working around the clock, around the globe, visit:
> http://www.star.net.uk
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 



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




[PHP] Re: Formatting timestamp date in MySQL

2002-04-10 Thread Mike Robinson

You should consider using mysql's built-in DATE_FORMAT function.
Why pull data, parse it, and format it, when you can retrieve it formatted
the way you want in one call. Double/triple handling of data is a bad thing.


"Nyon" <[EMAIL PROTECTED]> wrote in message
001c01c1dfbd$a7403320$[EMAIL PROTECTED]">news:001c01c1dfbd$a7403320$[EMAIL PROTECTED]...
Hi,

I need to recall a date data in a MySQL database.
The column is set as "date timestamp(8)".
A sample of date is "20020409"

I use the PHP Date function to format it back to say "9th April 2002".
$date_formated = date($date, 'S M Y' );
However, it's still doesn't appear as formatted.

Anyone mind sharing their code to do this?

Nyon



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




RE: [PHP] Secure storage of credit card information

2002-04-10 Thread Cal Evans

Jason,

You are of course correct in your statement that running the database on a
separate server does not solve the problem.  I contend that it is a problem
that cannot be solved.  The best we can hope for is to make it so difficult
that all but the most persistent give up.  Move the CC info onto it's own,
isolated server, is one step in that direction.

I did not mention it but you are again correct, some type of encryption is
called for as well. Pick you flavor but by all means, encrypt the info. I
would caution against using the users password as the key though because if
the user changes his/her password, it may leave the cc numbers mangled for
life. Something a bit more permanent like their login (which is usually not
changeable), their memberID or possibly a random number generated and stored
in the database with the users record but never returned to the browser.

My advise was not meant to assist in preventing someone from using malicious
web code to access the information. I was trying to help with physical
security of the data by adding an additional layer of security on top of
anything done in code.

Securing the data separately from everything else does have the advantage of
not compromising very sensitive data if the rest of the data is compromised.

My $0.2 worth, again, not arguing with you...:)

=C=
*
* Cal Evans
* Journeyman Programmer
* Techno-Mage
* http://www.calevans.com
*


-Original Message-
From: SHEETS,JASON (Non-HP-Boise,ex1) [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 10, 2002 12:07 PM
To: 'Someone Somewhere'; [EMAIL PROTECTED]
Subject: RE: [PHP] Secure storage of credit card information


Storing credit card numbers is dangerous, look at the mcrypt functions like
previously mentioned.

I would encrypt the user's credit card number with a key based on their
account password this gives you the ability to not store the encryption key
on the webserver.  You should mangle it, encrypt it with a temp key, etc.  I
would mangle their password someway to make it a more secure password, don't
trust a user to pick a safe or secure password.  Make sure you store the
users password as an md5 hash so that if your machine is compromised the bad
guys can't easily get your users passwords.

Just running the database server on an isolated machine does not solve the
problem of keeping the data secure, neither does running a firewall between
the two, obviously your web server needs access to the database, that in
itself will enable a "bad guy" to access your database once he has access to
your web server because the firewall allows access from your webserver to
the database server, speed of connection to the database server doesn't
really matter, how long does it take to transfer 16 characters?, if you are
not using encryption or store the key on your web server he has full access
to all of your credit card numbers.

Secure both your webserver and your database server and the host os they run
on (I would NOT use Windows), run tripwire or another similar program to
monitor your PHP scripts, if someone were to hack your machine they could
modify your PHP code to email them your users passwords, also conduct all
transactions accross at least 128 bit SSL.  Do NOT store the credit card
number or login password unencrypted in a session, sessions are plain text
by default and someone with access to your machine can read the session
files or access your database and read the information.

Make sure you really need to store credit cards, one bug and some script
kiddie has your credit card information.

Jason


-Original Message-
From: Someone Somewhere [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 10, 2002 10:48 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Secure storage of credit card information


I'm working on a e commerce  site and I need to store the credit card info
of people who purchase stuff, on the site. How can I encrypt the credit card
# put it in a dbase and decrypt it when I need to

Using Php4.* and Mysql.





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

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



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




[PHP] PHP/ASP/Siteminder

2002-04-10 Thread peter ferrigan


Hi there.

I am rather new to PHP and I am trying to implement the following on a
Solaris 8, Apache 1.3.24 Server.

We use siteminder here as our authentication method for the website.
Siteminder passes back certain user information that I can then display
on the website to customize it for the user.  I've gotten this working
with ASP on Windows nt server with IIS, but I cannot seem to make it
work on Apache.  The command that I use in ASP to retrieve the data is
this:

<%=Request.ServerVariables("HTTP_NAME")%>

This command returns the user's full name.

I've tried some echo commands without any luck.

Any ideas?

Thanks!

- pete


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




Re: [PHP] arguments against php / mysql?

2002-04-10 Thread Steve Edberg

Other people have made similar arguments, but just thought I'd throw in my 2c:

I had a couple of years experience running MySql (3.22.something) on 
WinNT4sp5, 3-4 years with PHP as a CGI (going all the way back to 
PHP2 aka PHP/FI) and ~9 months using Apache/PHP on Windows. As of 
last fall, I have no Windows machines anymore, so my recollection at 
the moment of details/versions is a bit fuzzy.


At 5:30 PM +0100 4/10/02, Mallen Baker wrote:
>Hi - the company we're talking to about doing some work on a simple 
>site / database is trying hard to persuade us that Windows-based PHP 
>/ mysql is not the route to go. The arguments are as follows:
>
>1. XXX's experience that MySQL is less than 100% stable when running 
>on a windows platform (main problem being unexpected database 
>shutdowns while applications are being used).


While I had fairly modest database usage, I NEVER had a single 
problem with MySQL/Windows. It was fast, took up very little memory, 
was about as close to set-and-forget as I've seen.


>2. The fact that the recommended mode for running PHP on a windows 
>platform (the CGI binary) uses technology that is now reasonably old 
>and will consequently result  in a hit to the server performance and 
>memory management and the associated  possible lack of scalability.


As others mentioned, this is obsolete info; I migrated sites running 
on Netscape Enterprise 3.5 & IIS to Apache with the PHP module (I 
believe the versions were 1.3.20 & a fairly early PHP4) with few 
problems (the biggest of which were a few functions that didn't work 
as expected in a PHP release candidate, but there were simple 
workarounds and - well, it was a release candidate not a final 
release). I used the PHP modules from PHP4WIN:

http://www.php4win.de/

By the way, the Apache/PHP-based solution worked much better than the 
ColdFusion stuff I was running on the same server. Cold Fusion sucked 
up tons of RAM, and on occasion database queries on an Access 
database caused CPU usage to spike at 100% until I restarted the CF 
server.

If you want to use PHP with IIS, then it is my (likely obsolete & 
incorrect) understanding that the PHP ISAPI version is still somewhat 
experimental, and that CGI is the recommended approach there. But 
then, I would avoid IIS as a web server to begin with.


>3. Loss of verity - the powerful search engine bundled with Cold 
>Fusion. Searches may  be significantly slower on the new site.


I'm sure you could still use Verity, but yes - you'd have to purchase 
it separately. I had just started using htDig -

http://www.htdig.org/

- as a search engine on the Windows box, but I didn't get much of a 
chance to get production experience with it. There's also MnoGoSearch 
-

http://www.mnogosearch.ru/

- which looks promising (and is pretty popular on the Unix side), but 
I don't have any experience with it. And, I think there's some 
nominal license fee to use it on Windows.


Thus endeth my spiel -

- steve edberg

-- 
++
| Steve Edberg  [EMAIL PROTECTED] |
| University of California, Davis  (530)754-9127 |
| Programming/Database/SysAdmin   http://pgfsun.ucdavis.edu/ |
++
| "If only life would imitate toys." |
|  - Ted Raimi, March 2002   |
|  - http://www.whoosh.org/issue67/friends67a.html#raimi |
++

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




[PHP] Re: arguments against php / mysql?

2002-04-10 Thread Michael Kimsal

Mallen Baker wrote:
 > Hi - the company we're talking to about doing some work on a simple
 > site / database is trying hard to persuade us that Windows-based PHP
 > / mysql is not the route to go. The arguments are as follows:
 >

Windows-based PHP might not be the way to go.  We've deployed
PHP as CGI under IIS, and, while it did work, there were things
Linux/Apache gave us that you can't get under Windows (IIS or Apache)
(good URL parsing, for a start).  It was workable enough, but
was not very fast.


 > 1. XXX's experience that MySQL is less than 100% stable when running
 > on a windows platform (main problem being unexpected database
 > shutdowns while applications are being used).

If we're going on experiences, then our experiences is that
*anything* on Windows doesn't stay up 100% of the time (not saying
other OSs are necessarily better, but you'll find pros and cons
on both sides).  Just because something isn't 100% doesn't
mean you shouldn't go with it.  We've run various SQL Servers on Windows
and normally had to reboot every 1-2 months as a preemptive
strike against a crash.  We had unexpected database crashes
with MS products on MS servers.  By XXX's logic, we shouldn't
use MS SQL Server either.  But people do use it.


2. The fact that the
 > recommended mode for running PHP on a windows platform (the CGI
 > binary) uses technology that is now reasonably old and will
 > consequently result  in a hit to the server performance and memory
 > management and the associated  possible lack of scalability.

As others have said, the Apache module under Windows seems to work better.


3. Loss
 > of verity - the powerful search engine bundled with Cold Fusion.
 > Searches may  be significantly slower on the new site.

Depending on what you use.  MySQL has full-text searching which, while 
not perfect, does a pretty good job with most of the stuff we've thrown
at it so far (speed and size).


 >
 > I have had some experience using php/mysql on linux/apache - but
 > don't have enough information to know whether this advice is sound or
 > not. Can anyone please advise - is there anything in these arguments?
 >
 >
 > If so, are there ways around the problems. We very much want to use
 > these technologies due to the open source aspects.
 >


There's always an answer - depends on how much work you want to do. 
Yeah, CF/Verity might be nice to start with, but who's doing the coding?
If XXX is doing it up front, will they be around to make changes 
quickly/as needed?  Or will the maintenance drop to you?

They may have a reseller program which means they'll make a couple 
hundred bucks off the sale of CF and want to push that.  (just a guess - 
you haven't given any more info).

For the money you'd spend on CF, you could do worse than to buy a
machine to run LAMP on and go with that.  If they only want to push
CF at you, and you want PHP, give us a call.  :)


Michael Kimsal
http://www.phphelpdesk.com
734-480-9961
Guaranteed PHP support when you need it


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




[PHP] help with detective work?

2002-04-10 Thread Nick Wilson

Hi all, 
I've just moved host and am having a shocking time of it. there is a php
script here: http://www.explodingnet.com/articles/latest/7/

There is nothing wrong with the code as you can see below but what on
earth could be causing this. I'm very unhappy with this ISP but before I
ball them out about it I thought I'd ask your opinions :-)

Code..




Many thanks
-- 
---
 www.explodingnet.com   |Projects, Forums and
+Articles for website owners 
-- Nick Wilson -- |and designers.


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




Re: [PHP] Visitors Log Help

2002-04-10 Thread Andrew Brampton

To be honest I've never done file locking in PHP, but the concept goes:
If User A opens log.txt and starts writing a string to it, but half way
through user B opens its and reads the file, User B will only get a half
written log.txt file. Then if B tries to do some writing it may end up
writing a corrupt file. (this is a general idea)

Anyway do a quick search for File Locking in the php manual (I've downloaded
the chm version and have it open alot!).
Also only last week was there a file locking discussion on this list, try
the archives (if they are any)

Andrew
- Original Message -
From: "Martin Clifford" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, April 10, 2002 5:04 PM
Subject: Re: [PHP] Visitors Log Help


As I'm sort of new to this, can you expand on "file locking"?  As of now,
I'm running Apache on my home PC, but my host most likely will not allow me
access to it's apache log files.  That is the main reason I want to do this,
and also because I'm studying PHP and this looks like a good way to get a
handle on file permissions, file writing, reading, etc.  Thanks for
answering my question though! :)

Martin

>>> "Andrew Brampton" <[EMAIL PROTECTED]> 04/10/02 11:56AM >>>
Well that should write as soon as that php is requested...

BUT U might want to put some file locking in there to make sure 2 people
don't visit at the exact same time and corrupt your Vistor_Log.txt

BTW If are using apache a better option might be to look into the custom log
files it can make, I think it can do what you are trying to do in PHP

Andrew
- Original Message -
From: "Martin Clifford" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, April 10, 2002 4:36 PM
Subject: [PHP] Visitors Log Help


Hi all!

I am trying to build a Visitor_Log.txt file for my page, which will write
specific information about users that visit the page (time of day they
visited, browser they are using, operating system, etc) to a txt file on my
server.

My question is... how do I write these values to the file as soon as they
access the page?  I'm very comfortable with using JavaScript to get user
information, but I know that PHP also has built-in functions to get user
information as well... would I do something along the lines of...



If someone loaded a page with that in it, would it write to the file as soon
as it's accessed and interpreted, or would some action have to take place to
make it run?  I won't ask which PHP Variables can be used to get user
information, I can find that information in the Manual... any information as
to my questions would be wonderful!

Also, please CC me on responses since I'm on the digest!  Thank you in
advance!

Martin


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





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




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




Re: [PHP] Visitors Log Help

2002-04-10 Thread Martin Clifford

I don't think I need to concern myself with that as of yet, since my site barely gets 
any hits per day, I don't think there is the possibility of two people accessing it at 
the same exact time.  Thanks though :o)

Martin

>>> "Andrew Brampton" <[EMAIL PROTECTED]> 04/10/02 03:06PM >>>
To be honest I've never done file locking in PHP, but the concept goes:
If User A opens log.txt and starts writing a string to it, but half way
through user B opens its and reads the file, User B will only get a half
written log.txt file. Then if B tries to do some writing it may end up
writing a corrupt file. (this is a general idea)

Anyway do a quick search for File Locking in the php manual (I've downloaded
the chm version and have it open alot!).
Also only last week was there a file locking discussion on this list, try
the archives (if they are any)

Andrew
- Original Message -
From: "Martin Clifford" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, April 10, 2002 5:04 PM
Subject: Re: [PHP] Visitors Log Help


As I'm sort of new to this, can you expand on "file locking"?  As of now,
I'm running Apache on my home PC, but my host most likely will not allow me
access to it's apache log files.  That is the main reason I want to do this,
and also because I'm studying PHP and this looks like a good way to get a
handle on file permissions, file writing, reading, etc.  Thanks for
answering my question though! :)

Martin

>>> "Andrew Brampton" <[EMAIL PROTECTED]> 04/10/02 11:56AM >>>
Well that should write as soon as that php is requested...

BUT U might want to put some file locking in there to make sure 2 people
don't visit at the exact same time and corrupt your Vistor_Log.txt

BTW If are using apache a better option might be to look into the custom log
files it can make, I think it can do what you are trying to do in PHP

Andrew
- Original Message -
From: "Martin Clifford" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, April 10, 2002 4:36 PM
Subject: [PHP] Visitors Log Help


Hi all!

I am trying to build a Visitor_Log.txt file for my page, which will write
specific information about users that visit the page (time of day they
visited, browser they are using, operating system, etc) to a txt file on my
server.

My question is... how do I write these values to the file as soon as they
access the page?  I'm very comfortable with using JavaScript to get user
information, but I know that PHP also has built-in functions to get user
information as well... would I do something along the lines of...



If someone loaded a page with that in it, would it write to the file as soon
as it's accessed and interpreted, or would some action have to take place to
make it run?  I won't ask which PHP Variables can be used to get user
information, I can find that information in the Manual... any information as
to my questions would be wonderful!

Also, please CC me on responses since I'm on the digest!  Thank you in
advance!

Martin


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





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





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




Re: [PHP] help with detective work?

2002-04-10 Thread Barry C. Hawkins

Nick,
 My guess is either permissions on the directory/files of your DocumentRoot for 
Apache and/or the Shared Object and MIME configurations of the Apache server where 
your script is located.

Yuck,
--
Barry C. Hawkins
Systems Consultant
[EMAIL PROTECTED]

On Wed, 10 Apr 2002 20:53:59 +0200 Nick Wilson <[EMAIL PROTECTED]> wrote:

Hi all, 
I've just moved host and am having a shocking time of it. there is a php
script here: http://www.explodingnet.com/articles/latest/7/

There is nothing wrong with the code as you can see below but what on
earth could be causing this. I'm very unhappy with this ISP but before I
ball them out about it I thought I'd ask your opinions :-)

Code..




Many thanks
-- 
---
 www.explodingnet.com   |Projects, Forums and
+Articles for website owners 
-- Nick Wilson -- |and designers.


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


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




Re: [PHP] mailing list using mail()

2002-04-10 Thread Anzak Wolf

>
> > the combination of PHP and mysql and the ease of use of the mail()
> > function obviously leads me to believe that it *should* be a cinch to
> > use php to send customised messages to all my users , of whom I have
> > details in a mysql table by simply running a "select * from table" and
> > then using a while loop to run through every row and sending an e_mail
> > to $user_in_table.
>
>You don't want to use the mail() function.  It will take forever to send
>17,000 messages since PHP will wait for each message to be delivered
>before sending the next one.  With DNS lookups, slow remote servers, etc.,
>it can take a long time to send each message.
>
>A better solution on *nix machines with sendmail is to write the messages
>into the mail queue and use "sendmail -q" to send them out.  (If sendmail
>is running as a daemon, it's probably already configured with "-bd -q15m"
>or a similar set of command line switches.  Otherwise you'll need a line
>in /etc/crontab that runs "sendmail -q" as root throughout the day.)
>
>Here's a sample that writes each message into the queue assuming the
>appropriate values for each addressee are stored in $from, $to, $subject,
>and $message.  You'd obviously embed this is an iteration loop.
>
># you probably want a sender to handle bounces
>$sender="[EMAIL PROTECTED]";
>
>### LOOP OVER THESE
>
># complete sendmail command; note that this must be in the iteration
># loop to fill in $sender and $name for each recipient
>$sendmail="/usr/sbin/sendmail -odq -t -i -f$sender '$name'";
>
># construct the header
>$headers=
>"Sender: $sender
>From: $from
>To: $to
>Subject: $subject
>";
>
># mail the message (write to sendmail socket; queue for delivery)
>
>$sm=popen($sendmail,"w");
>fputs($sm,$headers);
>fputs($sm,$message);
>pclose($sm);
>
>### END OF LOOP ###
>
>
I have a question with regards to this.  From reading the docs on mail() it 
seems that the mail function just opens a socket to sendmail on your local 
system anyway.  So how does forcing the same sort of action help in this 
case.  I'm trying to get a firm grasp around this whole 
email/sendmail/sockets thing.

-Jim

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


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




Re: [PHP] Visitors Log Help

2002-04-10 Thread Andrew Brampton

To be honest I've never done file locking in PHP, but the concept goes:
If User A opens log.txt and starts writing a string to it, but half way
through user B opens its and reads the file, User B will only get a half
written log.txt file. Then if B tries to do some writing it may end up
writing a corrupt file. (this is a general idea)

Anyway do a quick search for File Locking in the php manual (I've downloaded
the chm version and have it open alot!).
Also only last week was there a file locking discussion on this list, try
the archives (if they are any)

Andrew
- Original Message -
From: "Martin Clifford" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, April 10, 2002 5:04 PM
Subject: Re: [PHP] Visitors Log Help


As I'm sort of new to this, can you expand on "file locking"?  As of now,
I'm running Apache on my home PC, but my host most likely will not allow me
access to it's apache log files.  That is the main reason I want to do this,
and also because I'm studying PHP and this looks like a good way to get a
handle on file permissions, file writing, reading, etc.  Thanks for
answering my question though! :)

Martin

>>> "Andrew Brampton" <[EMAIL PROTECTED]> 04/10/02 11:56AM >>>
Well that should write as soon as that php is requested...

BUT U might want to put some file locking in there to make sure 2 people
don't visit at the exact same time and corrupt your Vistor_Log.txt

BTW If are using apache a better option might be to look into the custom log
files it can make, I think it can do what you are trying to do in PHP

Andrew
- Original Message -
From: "Martin Clifford" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, April 10, 2002 4:36 PM
Subject: [PHP] Visitors Log Help


Hi all!

I am trying to build a Visitor_Log.txt file for my page, which will write
specific information about users that visit the page (time of day they
visited, browser they are using, operating system, etc) to a txt file on my
server.

My question is... how do I write these values to the file as soon as they
access the page?  I'm very comfortable with using JavaScript to get user
information, but I know that PHP also has built-in functions to get user
information as well... would I do something along the lines of...



If someone loaded a page with that in it, would it write to the file as soon
as it's accessed and interpreted, or would some action have to take place to
make it run?  I won't ask which PHP Variables can be used to get user
information, I can find that information in the Manual... any information as
to my questions would be wonderful!

Also, please CC me on responses since I'm on the digest!  Thank you in
advance!

Martin


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





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




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




Re: [PHP] Secure storage of credit card information

2002-04-10 Thread heinisch

At 10.04.2002  11:48, you wrote:
>I'm working on a e commerce  site and I need to store the credit card info
>of people who purchase stuff, on the site. How can I encrypt the credit card
># put it in a dbase and decrypt it when I need to
>
>Using Php4.* and Mysql.



The first thing I would suggest, look for a good insurance.
The second is, if you can pay the rate, do it like the others say.
Resume:
Don´t even think about storing this data in elsewhere.
Oliver


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




Re: [PHP] Re: arguments against php / mysql?

2002-04-10 Thread Barry C. Hawkins

Mallen,
 It sounds like you might have some non-technical or open-source execs to talk to, 
and that a non-MS platform is not an option (yet :^) ).  If so, here are some more 
"managerial"-type arrows for your quiver:

1.) MySQL was one of the top 2 databases in a Ziff-Davis major vendor "shootout" 
recently, ranking alongside Oracle 9i.  See 

http://www.mysql.com/news/index.html 

under the heading "MySQL a winner in server database clash".  They like products more 
if they're mentioned in the same sentence as Oracle.  Oracle was on the SuperBowl, you 
know. :^)

2.) Actually, PHP doesn't officially say that CGI is the recommended install for IIS.  
They simply issue a few caveats regarding SAPI.  Check it out at:

http://www.php.net/manual/en/install.windows.php

3.) I have nothing to offer on the search engine issue.

 Now, I know that some of what I just said will incense some folks, because yes, 
ideally this poor fellow would be able to use *nix with Apache, MySQL, and PHP.  But, 
since he may not have that luxury, these items might put enough "spin" on things for 
him to get the Open Source items in the door.  Once that initial "yes" has been given, 
the subsequent steps might come more easily.

Best of luck,
-- 
Barry C. Hawkins
Systems Consultant
All Things Computed
[EMAIL PROTECTED]

Mallen Baker wrote:
 > Hi - the company we're talking to about doing some work on a simple
 > site / database is trying hard to persuade us that Windows-based PHP
 > / mysql is not the route to go. The arguments are as follows:
 >
 > 1. XXX's experience that MySQL is less than 100% stable when running
 > on a windows platform (main problem being unexpected database
 > shutdowns while applications are being used).

2. The fact that the
 > recommended mode for running PHP on a windows platform (the CGI
 > binary) uses technology that is now reasonably old and will
 > consequently result  in a hit to the server performance and memory
 > management and the associated  possible lack of scalability.

3. Loss
 > of verity - the powerful search engine bundled with Cold Fusion.
 > Searches may  be significantly slower on the new site.

 >
 > I have had some experience using php/mysql on linux/apache - but
 > don't have enough information to know whether this advice is sound or
 > not. Can anyone please advise - is there anything in these arguments?
 >
 >
 > If so, are there ways around the problems. We very much want to use
 > these technologies due to the open source aspects.
 >


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


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




Re[2]: [PHP] Re: arguments against php / mysql? - CORRECTION

2002-04-10 Thread Barry C. Hawkins

Substitute "open-source averse execs" for "open-source execs"; sorry about that.

-- 
Barry C. Hawkins
Systems Consultant
All Things Computed
[EMAIL PROTECTED]



On Wed, 10 Apr 2002 15:43:51 -0400 "Barry C. Hawkins" <[EMAIL PROTECTED]> 
wrote:

Mallen,
 It sounds like you might have some non-technical or open-source execs to talk to, 
and that a non-MS platform is not an option (yet :^) ).  If so, here are some more 
"managerial"-type arrows for your quiver:

1.) MySQL was one of the top 2 databases in a Ziff-Davis major vendor "shootout" 
recently, ranking alongside Oracle 9i.  See 

http://www.mysql.com/news/index.html 

under the heading "MySQL a winner in server database clash".  They like products more 
if they're mentioned in the same sentence as Oracle.  Oracle was on the SuperBowl, you 
know. :^)

2.) Actually, PHP doesn't officially say that CGI is the recommended install for IIS.  
They simply issue a few caveats regarding SAPI.  Check it out at:

http://www.php.net/manual/en/install.windows.php

3.) I have nothing to offer on the search engine issue.

 Now, I know that some of what I just said will incense some folks, because yes, 
ideally this poor fellow would be able to use *nix with Apache, MySQL, and PHP.  But, 
since he may not have that luxury, these items might put enough "spin" on things for 
him to get the Open Source items in the door.  Once that initial "yes" has been given, 
the subsequent steps might come more easily.

Best of luck,
-- 
Barry C. Hawkins
Systems Consultant
All Things Computed
[EMAIL PROTECTED]

Mallen Baker wrote:
 > Hi - the company we're talking to about doing some work on a simple
 > site / database is trying hard to persuade us that Windows-based PHP
 > / mysql is not the route to go. The arguments are as follows:
 >
 > 1. XXX's experience that MySQL is less than 100% stable when running
 > on a windows platform (main problem being unexpected database
 > shutdowns while applications are being used).

2. The fact that the
 > recommended mode for running PHP on a windows platform (the CGI
 > binary) uses technology that is now reasonably old and will
 > consequently result  in a hit to the server performance and memory
 > management and the associated  possible lack of scalability.

3. Loss
 > of verity - the powerful search engine bundled with Cold Fusion.
 > Searches may  be significantly slower on the new site.

 >
 > I have had some experience using php/mysql on linux/apache - but
 > don't have enough information to know whether this advice is sound or
 > not. Can anyone please advise - is there anything in these arguments?
 >
 >
 > If so, are there ways around the problems. We very much want to use
 > these technologies due to the open source aspects.
 >


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


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


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




RE: [PHP] mailing list using mail()

2002-04-10 Thread Sebastian A.

That's a good question and one that I have too. As far as I know mail() is
supposed to utilize sendmail...

-Original Message-
From: Anzak Wolf [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 10, 2002 7:27 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] mailing list using mail()

>
> > the combination of PHP and mysql and the ease of use of the mail()
> > function obviously leads me to believe that it *should* be a cinch to
> > use php to send customised messages to all my users , of whom I have
> > details in a mysql table by simply running a "select * from table" and
> > then using a while loop to run through every row and sending an e_mail
> > to $user_in_table.
>
>You don't want to use the mail() function.  It will take forever to send
>17,000 messages since PHP will wait for each message to be delivered
>before sending the next one.  With DNS lookups, slow remote servers, etc.,
>it can take a long time to send each message.
>
>A better solution on *nix machines with sendmail is to write the messages
>into the mail queue and use "sendmail -q" to send them out.  (If sendmail
>is running as a daemon, it's probably already configured with "-bd -q15m"
>or a similar set of command line switches.  Otherwise you'll need a line
>in /etc/crontab that runs "sendmail -q" as root throughout the day.)
>
>Here's a sample that writes each message into the queue assuming the
>appropriate values for each addressee are stored in $from, $to, $subject,
>and $message.  You'd obviously embed this is an iteration loop.
>
># you probably want a sender to handle bounces
>$sender="[EMAIL PROTECTED]";
>
>### LOOP OVER THESE
>
># complete sendmail command; note that this must be in the iteration
># loop to fill in $sender and $name for each recipient
>$sendmail="/usr/sbin/sendmail -odq -t -i -f$sender '$name'";
>
># construct the header
>$headers=
>"Sender: $sender
>From: $from
>To: $to
>Subject: $subject
>";
>
># mail the message (write to sendmail socket; queue for delivery)
>
>$sm=popen($sendmail,"w");
>fputs($sm,$headers);
>fputs($sm,$message);
>pclose($sm);
>
>### END OF LOOP ###
>
>
I have a question with regards to this.  From reading the docs on mail() it
seems that the mail function just opens a socket to sendmail on your local
system anyway.  So how does forcing the same sort of action help in this
case.  I'm trying to get a firm grasp around this whole
email/sendmail/sockets thing.

-Jim

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


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


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




Re: [PHP] Re: arguments against php / mysql?

2002-04-10 Thread Michael Kimsal

Barry C. Hawkins wrote:
 > Mallen, It sounds like you might have some non-technical or
 > open-source execs to talk to, and that a non-MS platform is not an
 > option (yet :^) ).  If so, here are some more "managerial"-type
 > arrows for your quiver:
 >
 > 1.) MySQL was one of the top 2 databases in a Ziff-Davis major vendor
 > "shootout" recently, ranking alongside Oracle 9i.  See
 >
 > http://www.mysql.com/news/index.html
 >
 > under the heading "MySQL a winner in server database clash".  They
 > like products more if they're mentioned in the same sentence as
 > Oracle.  Oracle was on the SuperBowl, you know. :^)
 >
 > 2.) Actually, PHP doesn't officially say that CGI is the recommended
 > install for IIS.  They simply issue a few caveats regarding SAPI.
 > Check it out at:
 >
 > http://www.php.net/manual/en/install.windows.php

"Officially" perhaps but I think the overwhelming consensus has been
that ISAPI under Windows just didn't work.  It *does* work now, as
long as you don't use any third party DLLs (like MySQL, GD, etc) 
rendering it pretty useless.

Sorry, it's just anecdotal evidence, but you'll notice that no one in 
the PHP camp will unequivocally say that PHP under ISAPI is solid.  The 
silence on ISAPI speaks volumes right now.




 > 3.) I have nothing to offer on the search engine issue.
 >
 > Now, I know that some of what I just said will incense some folks,
 > because yes, ideally this poor fellow would be able to use *nix with
 > Apache, MySQL, and PHP.  But, since he may not have that luxury,
 > these items might put enough "spin" on things for him to get the Open
 > Source items in the door.  Once that initial "yes" has been given,
 > the subsequent steps might come more easily.

If the only way to get "open source" products in the door is
to have them running half-crippled (running on OSes they weren't
designed for) you're giving "open source" products a bad image.  No one 
expects ASP to run on anything but IIS (chilisoft notwithstanding).  If 
the server HAS to be Windows, use ActiveState's Perl or something else 
with a company behind it and just go down that road.

Having PHP run poorly under Windows will just make PHP look bad, even if 
it's Windows' fault.

Michael Kimsal
http://www.phphelpdesk.com
734-480-9961





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




[PHP] Re: Sub groups ? - Programming structure...

2002-04-10 Thread Hugh Bothwell


"Gordon Stewart" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello, - I'm used (in years gone by) to the Qbasic programme, where i can
> create 'sub' routines, & view each routine on its own - Without reference
/
> Viewing the other code.. (I think its good like that..)..

Yes, I remember the QBasic editor too.  Personally,
I found it horribly annoying, but (shrug) to each his own.
I don't know of any such for PHP, but you could probably
manage with a 'folding' text editor.

Note that in PHP (like Pascal) it is possible to define
functions-inside-functions; I haven't seen code that
actually uses this, but it's something to keep in mind.


> 1) Does PHP allow sub-routines,  eg - I can send
> values to the routine, & it processes it & does
> whatever it requires & returns to the spot where I
> called it from.

yes, it's called a 'function'.
http://www.php.net/manual/en/functions.php


> 2) For those of you that know Qbasic & know
> what i mean, is/are there any programmes out
> there that can allow you to view / see any
> sub-routines in Perl and/or PHP one at a time,
> & list them ..

As above, don't know any offhand; but it should
be easy enough to write code to return you a
list of functions.



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




[PHP] newbie html forms primer help

2002-04-10 Thread ROBERT MCPEAK

I need some help with html forms.  I primer on html forms and variables
is much needed.  Anybody have some code snipets to share?  

I'm getting acquainted with $HTTP_POST_VARS but need some help in
accomplishing a couple of things.

I'd like to collect all "checkbox" input variables and stick them
together in a comma delimited string.

I'd also like to display the names and values of the all posted
variables.

In another language I'm familiar with, this looks like:

[formvariables name=thevarname][name]=[value][/formvariables]

For passed checkbox input var doh, where values were blah and bleck,
the above code would display:

doh=blah
doh=bleck

How do I do this with php?

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




[PHP] SESSIONS in javascript

2002-04-10 Thread Morten Nielsen

Hi,
I got a PHP page where I define a SESSION. I then include a javascript page
where I would like to use the value which is stored in the SESSION. The
problem is that the php tags  doesn't work in javascript.
Can anyone tell me how to do that?

Regards,
Morten



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




  1   2   >