[PHP] Fork and multi-thread in PHP?

2002-06-12 Thread Nathan Cassano


Hi PHP folks,
I have a program that sends out email by making socket
connection to our email server. The problem is that the program is very
slow because it has to finish talking to the email server until it can
proceed with the next email (as opposed to the mail() function that just
forks off a sendmail process). Is there a way for PHP to fork or
multi-thread to do I/O?


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




RE: [PHP] eregi(mail)

2002-05-10 Thread Nathan Cassano


This is what I have used.

?
if(eregi(^[_.+a-z0-9-]+@[a-z0-9-]+(\.[a-z0-9-]+)*(\.([a-z]){2,4})\$,
$email)){
echo Good Email!;
}
?


Here is an excellent article on Regular Expressions.

Learning to Use Regular Expressions by Example
http://www.phpbuilder.com/columns/dario19990616.php3


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




RE: [PHP] Browser cache

2002-04-23 Thread Nathan Cassano

?php
header(Cache-Control: no-cache);
?

-Original Message-
From: José León Serna [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, April 23, 2002 9:31 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Browser cache


Hello:
How could I disable the browser cache?, I have a script that
generates
an image and shows it via IMG SRC=myimage. The problem is if I
change
the image, the browser doesn't reflect the changes until I push refresh.
I
supose is sending a header, but which header?

Best Regards.



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




RE: [PHP] php and wml

2002-04-09 Thread Nathan Cassano


Introduction to WML, Apache, and PHP
http://www.phpbuilder.com/columns/mike20010118.php3

Building dynamic WML sites
http://www.phpbuilder.com/columns/baravalle20010221.php3

-Original Message-
From: Starman [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, April 09, 2002 1:00 PM
To: [EMAIL PROTECTED]
Subject: [PHP] php and wml


Can anyone tell me if it is possible to write php scripts withing wml
pages?

I need to design a wireless site (wap) and the form will be writing to a
mysql db using php.

Is there any difference in doing this than with html?


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




RE: [PHP] Cookies

2002-04-02 Thread Nathan Cassano



There is no such thing as an infinite cookie. About the closest thing
to infinity in PHP is year 2038.

setcookie(test, val, 2147483647);

-Original Message-
From: Steffan Harris [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, April 02, 2002 11:57 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Cookies


hi, is there a way of setting an infinite cookie using PHP? Is there a
special command for it? If not, I suggest adding that function in to
PHP. Thanks,

Steffan


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




[PHP] PHP OOP: Multiple Class Extends

2002-03-21 Thread Nathan Cassano


Attention PHP guru's,
I have a question about PHP and OOP. My problem is that I want
multiple inheritance functionality in PHP but it does not support this
(see http://www.zend.com/manual/keyword.extends.php). My question is can
PHP classes be extended multiple times to simulate multiple inheritance?
Is this supported? Is this safe? 

It do seems to work.
?

class A {
var $A = A;
}

class B extends A {
var $B = B;
}

class C extends B {
var $C = C;
}

$test = new C();
var_dump($test);

?


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




RE: [PHP] HTMLnetscape issue

2002-03-20 Thread Nathan Cassano


Yes here is a solution to this problem and I am surprised no one on this
list pointed it out.

Simply put a transparent dot within a cell table that you wish to have
the background image display.
Netscape 4 in retarded in the fact that it will not display a cell
background image unless it has cell content.


tr
td background=images/bottomcell_bg.gifimg
src=images/transparent_1x1_dot.gif/td
/tr

-Original Message-
From: Vlad Kulchitski [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, March 20, 2002 10:12 AM
To: [EMAIL PROTECTED]
Subject: [PHP] HTMLnetscape issue


Hi,

Sorry for repeating myself, but am lost and still can't find a solution
to the following problem, I need to specify a background image for td
like the code below:

tr
  td background=images/bottomcell_bg.gif/td
/tr

This code works EVERYWHERE (in all browsers) but Netscape Navigator 4.xx
versions.




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




RE: [PHP] URGENT: CERT Advisory CA-2002-05 Multiple Vulnerabilities in PHP fileupload

2002-02-28 Thread Nathan Cassano


I'm finished! Patched all my servers, recompiled and installed. We're
safe. 

-Original Message-
From: Bogdan Stancescu [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, February 28, 2002 9:58 AM
To: [EMAIL PROTECTED]
Subject: [PHP] URGENT: CERT Advisory CA-2002-05 Multiple Vulnerabilities
in PHP fileupload


Hello everybody!

For whever's interested...

CERT Advisory CA-2002-05 Multiple Vulnerabilities in PHP fileupload



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




[PHP] Quote in input tag value?

2002-02-07 Thread Nathan Cassano


If there is a quote mark in an input tags value what is the correct way
to print the quote?

input type=text value=quotMy Quotequot

or

input type=text value=\My Quote\


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




RE: [PHP] WAP

2002-01-17 Thread Nathan Cassano


There are some excellent article at phpbuilder.com about PHP and WAP.

Go to http://www.phpbuilder.com/columns/
and scroll down to the WAP columns.

-Original Message-
From: LaserJetter [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, January 17, 2002 9:27 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: [PHP] WAP


I was fiddling around with the Nokia WAP toolkit the other day and I've
created a pretty little WAP site - just listing dates and it has a WBMP
image as a welcome screen.

Whilst looking for someone to host the site, I noticed a review for  f2s
which said allows PHP to be combined with WML That would be a pretty
neat thing to do - I could have a PHP script automatically port every
page to WML and WBMP images.

The problem is, how do you include PHP in a WML file?  Do you have to
use SCRIPT LANGUAGE=php/SCRIPT in a .wml file or can you use .php
files? (I can't just fidddle about because I don't have a WAP phone
yet!)

Also, and I know this isn't really anything to do with PHP, what are the
dimensions in pixels of a typical WAP phone screen? I checked my site
using the emulator in the Nokia Toolkit and the one at TagTag.com and my
WBMP image fitted nicely in the middle of the screen. But when my
girlfriend showed it me on her phone, only about a third of the
image fitted on!!   Making the image smaller wouldn't be a problem but I
dont really know what size to make it.
Any directions to some useful info would be greatly appreciated.


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




RE: [PHP] 8 bit check sum???? Not 32 bit

2002-01-16 Thread Nathan Cassano


This is a strange request but here you go.

function CRC8bit($data){
return (crc32($data)  255);
}

-Original Message-
From: Brian C. Doyle [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, January 16, 2002 11:34 AM
To: [EMAIL PROTECTED]
Subject: [PHP] 8 bit check sum Not 32 bit


Hello all,

I currently have a perl subroutine that uses an 8 bit check sum.  From
what I have found, in books and the site, php will only do 32 bit.

Here is what I have currently

sub _hash_domain {
return uc(
unpack('H2',
pack('C',
unpack(%8C*, shift)
)   
)
);
}

This works fine in perl but I would like to get this to work in PHP What
am I missing.

Thanks for you help

Brian C. Doyle


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


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




RE: [PHP] sql question

2002-01-15 Thread Nathan Cassano


select * from tbl_lit where lit_source like 'c%';

Check out http://www.sqlcourse.com/

-Original Message-
From: Wolf-Dietrich von Loeffelholz [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, January 15, 2002 12:09 PM
To: [EMAIL PROTECTED]
Subject: [PHP] sql question


i want that a select query display me all words beginning with an a ..
like select * from tbl_lit where lit_source = 'c*' .. 
 
thnx bSue


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




[PHP] Persistent Database Resources?

2002-01-14 Thread Nathan Cassano


Lets say I have a page that makes queries with multiple sorts, returning
plenty of rows and displaying part of the result set. Each time the
client accesses the page the query must be re-executed, spinning the CPU
and thus tieing up resources. In PHP, or any other language could the
result set be stored persistently until the client accesses the page
again, or the result expires and must be re-executed?


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




RE: [PHP] Mommy, is it true that...?

2001-12-21 Thread Nathan Cassano


One thing that I do know is dangerous is deleting rows based on an
integer field with an unprocessed value;


Example: Delete row script
?

if($delete  $id){
delete from mytable where id = $id;
}

?

By simply appending an all inclusive sql clause.

$id = 21421 or 1 = 1;

Ca-Boom! The entire table has been deleted. Don't you feel dumb!

Instead process the input.
$id = abs($id);

-Original Message-
From: Bogdan Stancescu [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, December 20, 2001 5:40 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Mommy, is it true that...?


2. Please enter your age: 25; drop database mysql

Does this actually work?

I've read at least a dozen articles telling people to get it in their
blood not to trust users and addslashes to any king incoming data, as
well as pass it as strings to mysql (insert into person set age='$age'
instead of insert into person set age =$age).

So I decided I had to test this: I wrote the code exactly as in the
example; I provided the exact dangerous input (well, to be honest, I
tried a select instead of drop mysql). When I tried it, the presumably
dangerous situation degraded into a trivial MySQL error. It went
something like You have an error near '; select 1+1'.

Did you ever actually try this? Does it work on your system?

Thanks in advance for the input!

Bogdan


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




RE: [PHP] How can I have CVS ?

2001-12-20 Thread Nathan Cassano


And the answer is... WinCVS

Check it our at.
http://www.cvsgui.org/

-Original Message-
From: Alawi [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, December 20, 2001 7:51 AM
To: PHP genral
Subject: [PHP] How can I have CVS ?




and log to it from windows ?


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




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

2001-12-18 Thread Nathan Cassano


There aren't any modem modules that I am aware of but if you are using
UNIX you can just open the modem device and talk to it directly. What is
your application that would need to use a modem?

?
 /* Something like this */
 $fp = fopen(/dev/modem, rw);
 fwrite($fp, ATA);
 echo fgets($fp, 128)
 fclose($fp);
?

-Original Message-
From: Scott Fletcher [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, December 18, 2001 8:11 AM
To: [EMAIL PROTECTED]
Subject: [PHP] PHP module for modem???


Hi!

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

Thanks,
 Scott


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




RE: [PHP] Performance

2001-12-13 Thread Nathan Cassano


I have always assumed straight html was faster than function output. My
logic being that quoted output requires more parsing than straight
html. But they may be the same speed after a simple optimization pass. 

-Original Message-
From: René Fournier [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, November 13, 2001 9:05 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: [PHP] Performance


Is it true that mixing HTML and PHP--switching back and forth with 
?php ?  tags--slows down performance? (I'm using PHP4.) Is it better 
to echo output than to drop out of PHP mode?


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




RE: [PHP] phplib???

2001-12-13 Thread Nathan Cassano


Went to www.google.com. Searched phplib. The first result returned was
http://sourceforge.net/projects/phplib.


-Original Message-
From: Duane Douglas [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, December 13, 2001 1:59 PM
To: [EMAIL PROTECTED]
Subject: [PHP] phplib???


hello,

can someone please explain phplib to me?  what is it used for?  i
apologize 
if this question has been asked many times before.

thanks in advance.


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




RE: [PHP] Script like this for PHP

2001-12-12 Thread Nathan Cassano


While we are on the topic of Dynamic HTML, I'd like to recommend DynAPI
(http://dynapi.sourceforge.net/), a powerful cross-browser DHTML
library. You can do some awesome stuff with DynAPI.


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




RE: [PHP] How to UNSUBSCRIBE ???

2001-12-07 Thread Nathan Cassano


Whats wrong? Is it that you don't like us anymore? Why would you want to
unsubscribe?

Please inspect the bottom of any PHP list email to find you answer.

-Original Message-
From: fazer [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, December 06, 2001 8:25 AM
To: [EMAIL PROTECTED]
Subject: [PHP] How to UNSUBSCRIBE ???
Importance: High


UNSUBSCRIBE


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




[PHP] Simulating POST with GET and Location:

2001-11-02 Thread Nathan Cassano


Hi list,
Don't you just hate the way that the POST method makes browsers
act some times? Expiring pages and asking you if you really want to
reload this page. I have found a solution. Instead of relying on the
POST method to protect pages from being accessed twice, I use GET and at
the end of a processing script using ? header(Location:
next_page.html) ? redirecting the client to the desired url. So when
the client tries to go back and forth accessing pages with their
browser, the processing page is virtually replaced with the url
next_page.html, thus stopping an additional posts. Hope this is
useful.

?

/* Processing script */

if($submit){
/* Delete something with the database */
mysql(database, delete from table where id = $id);

header(Location: next_page.html);
exit;
}

?


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




RE: [PHP] defending PHP mail function

2001-10-31 Thread Nathan Cassano


My favorite email libraries are .. 

SMTP class
http://www.phpguru.org/download.php?script_id=10

And working in conjunction with SMTP class ..

HTML Email Class
http://www.phpguru.org/download.php?script_id=4

-Original Message-
From: Matthew Luchak [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, October 31, 2001 8:04 AM
To: Php-General (E-mail)
Subject: [PHP] defending PHP mail function


Recently I have had to defend the use of PHP in light of a number of
screw-ups with the mail function in 4.0+.  It seems that some email
addresses will simply not work with mail.  I have been shopping around
for a smtp direct class ( http://www.zend.com/codex.php?id=347single=1
) looks pretty good to me and was wondering if anyone has any
experiences, shortcuts etc. to this kind of problem with mail.


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




RE: [PHP] PHP and qmail

2001-10-31 Thread Nathan Cassano


If you have installed Qmail and removed Sendmail create symlinks to the
qmail sendmail wrapper and you should not have to edit you php.ini. Read
the qmail INSTALL file for more.

# ln -s /var/qmail/bin/sendmail /usr/lib/sendmail
# ln -s /var/qmail/bin/sendmail /usr/sbin/sendmail

-Original Message-
From: Suleyman Kuran [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, October 31, 2001 12:22 PM
To: '[EMAIL PROTECTED]'
Subject: [PHP] PHP and qmail


Hi list,
 
I have recently installed qmail-1.03 now what settings should I make in
php.ini file to send email with mail() function. Thanks.
 


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




[PHP] Daylight savings and timestamps

2001-10-26 Thread Nathan Cassano


Hello fellow PHPer's,
Daylight savings is soon upon most of us and I have some
questions in regard to timestamps. My problem: So we put our clocks an
hour back. I have database tables with plain integers that store
timestamps. I like to do comparison operations with these timestamps.
When daylight savings takes effect the pre-daylight savings timestamps
are an hour ahead of the daylight saving timestamps and cause time
operations to calculate incorrectly. What is the solution? Could I
offset the new timestamps to ignore daylight savings, make all my
timestamps none-daylight savings timestamps?



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




RE: [PHP] How to protect MySQL password

2001-10-23 Thread Nathan Cassano


One solution is to depend upon your defaults in /usr/local/lib/php.ini
. Then just call mysql_connect() with no arguments or just call
mysql_db_query with out the connection parameter and PHP will connect
for you. If you are connecting to different MySQL servers this solution
is not appropriate.

mysql.default_host = localhost
mysql.default_user = MySQLUsername
mysql.default_password = MySQLPassword


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




RE: [PHP] Password Generator?

2001-04-18 Thread Nathan Cassano

Random Pronounceable Password Generator
This function generates random pronounceable passwords. (ie jachudru,
cupheki)

http://www.zend.com/codex.php?id=215single=1

-Original Message-
From: Ashley M. Kirchner [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 18, 2001 1:20 PM
To: PHP-General List
Subject: [PHP] Password Generator?



Is there an easy way to generate generic passwords based on
(combined) dictionary words?  (ej: take two different words and put them
together)

AMK4


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




RE: [PHP] password

2001-03-27 Thread Nathan Cassano

Don't you mean..

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

or do you want to do this with php headers?

-Original Message-
From: Marisol Daz E. [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 27, 2001 9:03 AM
To: PHP General
Subject: [PHP] password


Hi

I need the code, for protecting the dir by password.


Thanks


Marisol Daz E.



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




RE: [PHP] Tutorial for RegExpressions

2001-03-14 Thread Nathan Cassano


Learning to Use Regular Expressions by Example
http://www.phpbuilder.com/columns/dario19990616.php3

-Original Message-
From: Martin Thoma [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 14, 2001 6:12 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Tutorial for RegExpressions


Hi !

Does someone know a good tutorial fr regula-expression, like they are
used in ereg and preg ?

Martin



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


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




[PHP] HTTP Bailout

2001-03-12 Thread Nathan Cassano

When a client bails out of a http connection and apache shuts down that
thread process, is there something or a way so that php can call some sort
of destructor? My problem is if a client bails out right in the middle of a
financial transaction I need some way of canceling a pending order.

Nathan

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




RE: [PHP] Is it odd or even??? Optimize!!!

2001-03-05 Thread Nathan Cassano

You all are a bunch of un-optimizing novices. Just do some bit banging.

i.e.

if(1  number){
echo "$number is odd";
}else{
echo "$number is even";
}


-Original Message-
From: Brandon Orther [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 05, 2001 12:18 PM
To: PHP User Group
Subject: [PHP] Is it odd or even???


Hello,

Is there an easy way to check and see if a number is odd or even?

Thank you,


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


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




RE: [PHP] strip ^M's ??

2001-03-02 Thread Nathan Cassano

Here is a solution I can up with to solve all the CR and LF funniness coming
from different web browsers.

$input = ereg_replace("\r\n|\n|\r", "\n", $input);

-Original Message-
From: Brandon Orther [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 02, 2001 9:43 AM
To: PHP User Group
Subject: [PHP] strip ^M's ??


Hello,

I am making a PHP script that upload formmail into people web directory with
all the settings easily configured on a web based setup screen.  Is there a
way to have php remove all ^M (Control M) from the file before it uploads it
to the server?

Thank you,


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



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


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




[PHP] Reindexing Arrays

2001-02-15 Thread Nathan Cassano

I have an array of search results which I am searching through and
unset()ing unwanted search results. My question is once I have unset a
result there is then a break in the numeric index and how do I stop this
from happening or reindex the results. Like this..

$results = array(0 = array(more elements...), 1 = array(bla bla...) , 2
=array());

/* unset results index 1 */
unset($results[1]);

/*

Now the $results index is like this..

array(0 = array(more elements...), 2 =array());

*/


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




Re: [PHP] php and xml

2001-02-13 Thread Nathan Cassano

Steve,
Did you take a look at the raw data returned by the fsockopen file pointer.
There may be some http headers that are tripping up the xml parser.

-Original Message-
From: Steve Haemelinck [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 13, 2001 12:07 PM
To: PHP Mailing Listl (E-mail)
Subject: [PHP] XML Parsing through Proxy


Hi Anybody got an idea?

I am sitting behind a proxy and I want to able to parse an XML.
So I have to use fsockopen() to get through my firewall and get the page.
So far, everything goes wel, but I am not able to parse the file, because I
think it is not in XML format if I use "GET http:// "
Does anyone has an idea how I can solve this?

My code so far (bits and pieces of anywhere :) )


Steve


?php

#
#   Parse XML through Proxy   #
#

// Define Variables

# Proxy Settings
$proxy_ip="proxy.server.be";
$proxy_port=8080;

# XML Mapping
$map_array = array(
"NASDAQAMEX-DOT-COM" = "HEADER_TAG",
"ISSUE-NAME" = "STOCK_NAME",
"LAST-SALE-PRICE" = "LAST_SALE",
"PREVIOUS-CLOSE-PRICE" = "PREVIOUS_SALE",
"NET-CHANGE-PRICE" = "CHANGE",
"NET-CHANGE-PCT" = "CHANGE_PCT",
"TODAYS-HIGH-PRICE" = "TODAYS_HIGH",
"TODAYS-LOW-PRICE" = "TODAYS_LOW",
);

# XML File to Parse
$xmlFile_Location="http://quotes.nasdaq.com/quote.dll?page=xmlmode=stocksy
mbol=NETA";


// Functions

# StartElement Of Parser
function startElement($parser, $name, $attrs=''){
global $map_array, $temp, $current_tag;

$current_tag = $name;
if ($format = $map_array[$name]){
switch($name){
case 'NASDAQAMEX-DOT-COM':
//echo $HTTP_GET_VARS['ticker'];
break;
default:
break;
}
}
}

# EndElement Of Parser
function endElement($parser, $name, $attrs=''){
global $map_array, $temp, $current_tag;

if ($format = $map_array[$name]){
switch($name){
case 'NASDAQAMEX-DOT-COM':
return_page($temp);
$temp = '';
break;
default:
break;
}
}
}

# Process the Data between XML-Tags
function characterData($parser, $data){
global $current_tag, $temp, $catID;

switch($current_tag){
case 'ISSUE-NAME':
$temp['STOCK_NAME'] = $data;
$current_tag = '';
break;
case 'LAST-SALE-PRICE':
$temp['LAST_SALE'] = $data;
$current_tag = '';
break;
default:
break;
}
}

# Create the XML Parser and set options
$type="UTF-8";
$xml_parser = xml_parser_create($type);
xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING, true);
xml_set_element_handler($xml_parser, 'startElement','endElement');
xml_set_character_data_handler($xml_parser, 'characterData');

/* Open a connection through Proxy with Nasdaq and start parsing */
$sockPointer = fsockopen($proxy_ip,$proxy_port, $errNo, $errStr,30);
//Connect to Proxy

if( !$sockPointer ){
echo "$errStr Proxy not Available \n\n";
exit();
}
else{
fputs($sockPointer,"GET $xmlFile_Location/ ?xml version=\"1.0\"
?\n\n");
while (!feof($sockPointer)){
$Data = fgets($sockPointer, 10);
$tag= "?xml version=\"1.0\" ?\n\n";
if( eregi("xml version",$Data) ){
$Parse=1;
}
if($Parse==1){
if (!($Data = utf8_encode($Data))){
echo 'ERROR'."\n";
}
if (!xml_parse($xml_parser, $Data, feof($sockPointer))){
die(sprintf( "XML error: %s at line %d\n\n",
xml_error_string(xml_get_error_code($xml_parser)),
xml_get_current_line_number($xml_parser)));
}
}
}
fclose($sockPointer);
}

xml_parser_free($xml_parser);

?


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




[PHP] Class method reference

2001-02-09 Thread Nathan Cassano

Does anyone know how to pull a function reference from a class method?
Here's why,

class myclass(){
var $myarray;

function mysort() {
/* User sort fails */
usort($this-myarray, $this-mycompfunction);
/* Or */
usort($this-myarray, "mycompfunction");
}

function mycompfunction() {

}
}

The sort fails because the member function mycompfunction() is not
referencable. Any ideas?


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




RE: [PHP] job search/posting software

2001-02-05 Thread Nathan Cassano

At CJHunter.com we use swish-e http://sunsite.berkeley.edu/SWISH-E/ in
conjunction with custom php scripts to make our job and resumes searches.

-Original Message-
From: Chuck Barnett [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 05, 2001 4:46 AM
To: PHP General List
Subject: [PHP] job search/posting software


Does anyone know of any good software for creating a job posting/search
service?


Thanks,
Chuck



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


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




RE: [PHP] Echo and Print

2001-01-26 Thread Nathan Cassano


As I understand it, echo is somewhat of an language construct and print is a
function.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 26, 2001 11:37 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Echo and Print


I know it is a kind of stupid question but I was trying to figure out
the difference between "Echo" and "Print" and I didn't find it...Could
anybody explain that to me??
Thank you

Felipe Lopes


MailBR - O e-mail do Brasil -- http://www.mailbr.com.br
Faa j o seu.  gratuito!!!

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


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