Re: [PHP] nl2br() Function for Paragraphs?

2003-06-11 Thread John S. Huggins
On Wed, 11 Jun 2003, Nick Wilson wrote:

-Hello everyone, 
-
-Has anyone written a function that does what nl2br() does but wraps text
-in a p/p's instead? I'm a bit of a clean html type and nl2br() just
-leaves me wishing there was a better way...

Several examples appear in the user comments section of:

http://us2.php.net/manual/en/function.nl2br.php


-
-I'm afraid my regex is dreadfull so I just hoped someone might have
-already done it and be willing to share. ;-)
-
-Many thanks...
-
--- 
-Nick WIlson
-
-
-
--- 
-PHP General Mailing List (http://www.php.net/)
-To unsubscribe, visit: http://www.php.net/unsub.php
-

**

John Huggins

[EMAIL PROTECTED]
http://www.phphosts.com/

**


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



Re: [PHP] piping email directly into PHP

2003-06-11 Thread John S. Huggins
On Wed, 11 Jun 2003, Adrian Teasdale wrote:

-Hi there
-
-We are wanting to create a little help/crm tool for internal use.  Rather
-than reading (and parsing) in an email from a pop account, is it now
-possible to pipe email in directly to a database via PHP?  If so, any
-pointers on how to do it and anything to watch out for?

You might get good clues by examining the phorummail.php file in the
Phorum.org forum script in their scripts directory of their tarball.

http://www.phorum.org/

As I recall, it is meant to be passed email messages via .forward or
something like that.  It then looks at the mail contents and deals with it
accordingly.  Phorum is a MySQL thing so I assume they write the data to
the database.

Note that this file is meant to run like a typical shell script with this
in the first line:

#!/usr/local/bin/php -q

Thus, you must have a compiled php executable in /usr/local/bin or
whereever you keep your favorite programs.

Just compile PHP with no parameters in ./configure and it should make a
php binary perfect for use as a shell program tool. 

The -q turns off header generation I think making php a very suitable
progamming language.

Good luck.


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

**

John Huggins

[EMAIL PROTECTED]
http://www.phphosts.com/

**


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



Re: [PHP] Mail Username

2003-06-10 Thread John S. Huggins

You can add extra info into the appropriate fields like so.

mail([EMAIL PROTECTED], the subject, $message,
 From: [EMAIL PROTECTED],[EMAIL PROTECTED]);


However, your local sendmail might restrict this behavoir of changing the
sender identity.  Mine simply complaines about it in the mail logs, but
does change the from information like I wish.

Look here for more details:
http://us2.php.net/manual/en/function.mail.php

On Tue, 10 Jun 2003, Josh Thomas wrote:

-I know that if you use sendmail to perform your mailings in php that the
-sender shows up as the user and group for Apache. Now is there a way to make
-the mail command display a different user in the from field? I know that I
-could change the user/group for Apache to fix it, but is there a setting in
-the PHP.conf file to change this. Will I be better off using pop and smtp
-and just point it to my local box?
-
-Thanks
-Josh Thomas
-www.kickbackpoints.com
-

**

John Huggins

[EMAIL PROTECTED]
http://www.phphosts.com/

**


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



Re: [PHP] oasis banners - ot -

2003-06-05 Thread John S. Huggins
On Tue, 3 Jun 2003, Ryan A wrote:

-Hi,
-I have decided to check out Oasis banner software but cant figure out how
-to install it in my shared hosting planbecause it says something about
-compiling it into apache or php etc which has gotten me totally confused.
-Anybody here worked with Oasis kindly tell me how you installed it.
-Thanks,

I have tried a few times without success.  It seems to require some kind
of cache feature which allows it to be fast, but not as straight forward
as something like phpAdsNew.

I did not have time to fiddle with such things and have plenty of
horsepower anyway, so I went with phpAdsNew and moved on.

Please let us know if you have success with Oasis.


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

**

John Huggins

[EMAIL PROTECTED]
http://www.phphosts.com/

**


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



Re: [PHP] Jpgraph troubles

2003-05-29 Thread John S. Huggins
On Wed, 28 May 2003, Jordan Elver wrote:

-Hi,
-I've been creating some graphs using jpgraph and they work really well when I 
-view them directly i.e. directly through the script. My problem comes as soon 
-as I try to display them using the DEFANGED_IMG tag within another page. When I do:
-
-DEFANGED_IMG src=graph.php /
-
-I can't get it to display. It just shows the broken image icon.
-
-Any ideas whaty may be causing that?

Some mail filters strip all IMG tags from HTML style emails to prevent
unwanted trickery of loading images so see if an email address works.

Some just change the IMG tag to DEFANGED_IMG effectively breaking the
link.

I only see this in email filters so I do not know why this is showing up
on your PHP generated web page.


-
-TIA,
-Jord
--- 
-Jordan Elver
-The office is like an army, and I'm the field general. You're my footsoldiers 
-and customer quality is the WAR!!! -- David Brent (The Office)
-
-
--- 
-PHP General Mailing List (http://www.php.net/)
-To unsubscribe, visit: http://www.php.net/unsub.php
-

**

John Huggins

[EMAIL PROTECTED]
http://www.phphosts.com/

**


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



Re: [PHP] php and databases

2002-10-25 Thread John S. Huggins
On Fri, 25 Oct 2002, Tyler Durdin wrote:

-Is there anyway to have php convert a database from mySQL to Access via a 
-webpage? I have a couple of people here who use Access to do mail merging 
-things with word and it would make my life a ton easier if I did not have to 
-convert the db's everytime they want the info. If anyone has any thoughts on 
-how to go about this it would be greatly appreciated. Thanks in advance.

What comes to mind first is letting them use their Access to access the
MySQL tables directly through the MyODBC capabilities.  It works pretty
well, but will take some setup.

This may prove to be the best way to copy an Access accessed MySQL toa
native Access database.

The only thing I can think of PHP helping you out here is by generating a
good delimited file available for download which Access or Excel should
be able to swallow whole.

-
-Bobby
-
-
-
-
-
-_
-Surf the Web without missing calls! Get MSN Broadband. 
-http://resourcecenter.msn.com/access/plans/freeactivation.asp
-
-
--- 
-PHP General Mailing List (http://www.php.net/)
-To unsubscribe, visit: http://www.php.net/unsub.php
-

**

John Huggins

[EMAIL PROTECTED]
http://www.phphosts.com/

**


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




Re: [PHP] mysql stored procedures

2002-10-11 Thread John S. Huggins

On Fri, 11 Oct 2002, electroteque wrote:

-when is this being implemented ?

Perhaps in version 4.1 of the MySQL server.

Have a look near the bottom of this page...

  MySQL 4.1, the following development release
  http://www.mysql.com/products/mysql-4.0/index.html



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

**

John Huggins
VANet

[EMAIL PROTECTED]
http://www.va.net/

**


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




Re: [PHP] PHP in crontab job

2002-10-11 Thread John S. Huggins

On Fri, 11 Oct 2002, Sharat Hegde wrote:

-Hello,
-
-I am having a problem at my ISP relating to execution of PHP commands from 
-the crontab command. My ISP told me to have a look at the following URL, but 
-despite following these instructions, the crontab job is not being executed.
-http://www.htmlcenter.com/tutorials/tutorials.cfm/155/PHP/
-
-The crontab command line works from the shell prompt and I am able to 
-execute the php command from the command line as well as the lynx command - 
-no problems with that.
-
-Any ideas on how to get the crontab to execute the PHP commands?

Ensure you have specified the php program in the first line, I am sure you
did this but here is how I do it.

#!/usr/local/bin/php -q


Make sure it is a fully specified pathname to the php executable.  Crontab
all too often does not have knowledge of your path environment so may get
lost if you just say php.

Make sure you really do have a php executable.  This is what will compile
if you do not specify any configuration directives during the ./configure
process.

Tell us how you do.


-
-Regards,
-Sharat
-
-
-_
-Join the world’s largest e-mail service with MSN Hotmail. 
-http://www.hotmail.com
-
-
--- 
-PHP General Mailing List (http://www.php.net/)
-To unsubscribe, visit: http://www.php.net/unsub.php
-

**

John Huggins
VANet

[EMAIL PROTECTED]
http://www.va.net/

**


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




Re: [PHP] Adding to a MySql Database

2002-09-24 Thread John S. Huggins

On Tue, 24 Sep 2002, The New Source wrote:

-I have a field on a MySql database that is started with a 0, and I want
-to add 1 to this field every time a button is pressed on a form. So it
-should add one every time, like if there is 5 and you press it one time
-it would have 6.
-

UPDATE table SET field = field + 1 WHERE whatever = whatever;

**

John Huggins
VANet

[EMAIL PROTECTED]
http://www.va.net/

**


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




Re: [PHP] MySQL vs. basic text file

2002-09-23 Thread John S. Huggins


I was doing this too with good old AWK CGI scripts and text data files.
Once I imported the data into MySQL I said, Well this is not much
benefit.  Then I started sorting.  Then I accessed the information from a
different application.  Then I wrote a maintenance application so my
customer could sort, review and edit the data.  Then I started using
multitable queries.  I am now so hooked on the database method, I have
never looked back.

Keep up with your text data.  You will always be able to import it into
MySQL when you are ready.  I would do ahead and migrate to a database; You
will have a slight learning curve, but will reap many benefits.

John

On Sat, 21 Sep 2002, Doug Parker wrote:

-often i use text files at my data sources, delimted by the | symbol. 
-i simply delimit the fields of each line, then when i need to open them, 
-i open the text file, populate an array with each line, then explode the 
-fields for each to get the corresponding values.   i use this method for 
-catalogs - and even backend interfaces, for which the client can 
-add/edit/delete products.  everything seems to be working fine, and 
-there doesn't seem to be a need for MySQL or anything.  i was wondering 
-if there is anything i'm not thinking of that perhaps would push me to 
-favor using php and mysql instead of the plain old text file.
-
-
-
--- 
-PHP General Mailing List (http://www.php.net/)
-To unsubscribe, visit: http://www.php.net/unsub.php
-

**

John Huggins
VANet

[EMAIL PROTECTED]
http://www.va.net/

**


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




[PHP] MD5 and Password Security?

2002-08-13 Thread John S. Huggins

On Wed, 14 Aug 2002, Robert Parker wrote:

-On Tuesday 13 August 2002 10:57 am, you wrote:
- MD5 encryption of passwords is secure since you do not need to decrypt the
- password ever (in fact you can't).  You just encrypt the password that the
- user entered and check if the MD5 of each password is the same, then the
- user most likely entered the correct password.
-
-I don't remember where I read this but it only takes the crackers about 1 - 2 
-seconds to crack your average MD5 encrypted password. This is quite logical
-because all they had to do is make a database of all of the MD5 sums of all 
-the passwords in the various dictionaries.
-The only Linux distro in my (limited) experience that gave the option of MD5 
-encryption of passwords was Debian 2. Even then you had the option of shadow 
-password files instead. Debian 2 is quite old. Later distros such as Mandrake 
-8.0 and up simply use shadow password files without other option.
-
-Regards
-Bob Parker

Bob, this is an excellent point.

Your statement seems to assume the crackers have made off with the list of
MD5 hashes for the passwords.  One way to foil their attempts at
guessing the original strings from the MD5 hashes is to incorporate code
that prepends or appends a system string known only to the webmaster when
creating the MD5 hash.  Of cource if they have made their way into your
system deep enough to get the MD5 info, then they might also have the
system string.  Oh well.

MD5 is pretty much impractical to decrypt, but if the passwords that
create the MD5 sums are easy to guess, then dictionary attacks are still
useful are are a bigger problem that MD5, SHA or any other hash generator.

I see the only way around this is to regularly require your users to
reverify several answers to several questions on each login or, perhaps,
every month or so.

So instead of requesting:
username:
password:

One could ask:
username:
password:
pet's name:
mother maidenname:
etc.:
etc.:

As always, the question remains - How much security is too much security? 

John

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

**

John Huggins
VANet

[EMAIL PROTECTED]
http://www.va.net/

**


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




Re: Re[2]: [PHP] Credit Card suggestions

2002-08-13 Thread John S. Huggins

On Wed, 14 Aug 2002, Robert Parker wrote:

-On Tuesday 13 August 2002 12:20 pm, you wrote:
- Makes sense, except if you use upper and lowercase characters,
- numbers, and symbols (as you should for secure passwords). I
- would think that with these kind of passwords, storing the sheer
- number of posibilites would get slightly large. And I mean even
- if it is easy to break, it's more secure then storing them clear
- text.
-
- Adam Voigt
- [EMAIL PROTECTED]
-
-Thing that really scares me about MD5 being used anywhere that's easily
-accessible is what happens if 'pussycat' maps on to the same hash as 
-'H3ph!3s09Zw'. The crackers don't need the original password just something 
-that generates the same hash.

Sure this is possible and I agree a concern.  With MD5 there is some
mathematically small chance this will happen.  With SHA even smaller.
However, where do we draw the line?

I suppose requiring users to use long passphrases instead of passwords and
MD5 that result would help with this issue.

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

**

John Huggins
VANet

[EMAIL PROTECTED]
http://www.va.net/

**


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




Re: Re[2]: [PHP] Credit Card suggestions

2002-08-13 Thread John S. Huggins

On Wed, 14 Aug 2002, Robert Parker wrote:

-On Tuesday 13 August 2002 12:20 pm, you wrote:
- Makes sense, except if you use upper and lowercase characters,
- numbers, and symbols (as you should for secure passwords). I
- would think that with these kind of passwords, storing the sheer
- number of posibilites would get slightly large. And I mean even
- if it is easy to break, it's more secure then storing them clear
- text.
-
- Adam Voigt
- [EMAIL PROTECTED]
-
-Thing that really scares me about MD5 being used anywhere that's easily
-accessible is what happens if 'pussycat' maps on to the same hash as 
-'H3ph!3s09Zw'. The crackers don't need the original password just something 
-that generates the same hash.
-
-Bob Parker

Whoa, I thought Bob was saying he found two strings that generate the same
hash.

md5(pussycat) = fd316a211a7178c6fbf09c4c2ac6fa05
md5(H3ph!3s09Zw) = 4172a5caff5b7878144c8aae11f3de17

Guess not.  WHEW!




**

John Huggins
VANet

[EMAIL PROTECTED]
http://www.va.net/

**


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




[PHP] Cookies

2002-07-24 Thread John S. Huggins


Say it is not so.

I hear the PHP 4.2.2 will only set the last cookie delivered by a browser
to a variable in the PHP environment.

Is this true?

**

John Huggins
VANet

[EMAIL PROTECTED]
http://www.va.net/

**


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




Re: [PHP] is php.net down ?

2002-07-22 Thread John S. Huggins


They seem to be working on it.  It comes up every few minutes so keep
trying.  I managed to sneak it just long enough to snag 4.2.2.

On Mon, 22 Jul 2002, R'twick Niceorgaw wrote:

-Hi guys,
-any one else able to get into www.php.net ?
-
-I'm getting this
-
-Warning: main(geoip.inc) - No such file or directory in
-/local/Web/sites/phpweb/include/prepend.inc on line 6
-
-Fatal error: Failed opening required 'geoip.inc'
-(include_path='.:/local/Web/sites/phpweb/include') in
-/local/Web/sites/phpweb/include/prepend.inc on line 6
-
-
-
-
-
--- 
-PHP General Mailing List (http://www.php.net/)
-To unsubscribe, visit: http://www.php.net/unsub.php
-

**

John Huggins
VANet

[EMAIL PROTECTED]
http://www.va.net/

**


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




Re: [PHP] rebooting linux using php

2002-07-18 Thread John S. Huggins

On Thu, 18 Jul 2002, Harpreet Kaur wrote:

-
-Can we reboot a linux server using a php page?

Yes.

-And is it recommended?

No.

-
-Regards,
-Harpreet Kaur
-
-
-_
-Join the world’s largest e-mail service with MSN Hotmail. 
-http://www.hotmail.com
-
-
--- 
-PHP General Mailing List (http://www.php.net/)
-To unsubscribe, visit: http://www.php.net/unsub.php
-

**

John Huggins
VANet

[EMAIL PROTECTED]
http://www.va.net/

**


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




Re: [PHP] Development Tools

2002-07-10 Thread John S. Huggins


Dreamweaver has come along nicely.  I have only dabbled at the MX version.

Ultraedit, http://www.ultraedit.com/, has proven to be very nice at
handling editing tasks of PHP, HTML, SQL, and hundreds of other languages. 
It can edit files via FTP which was useful to me years ago and continues
to be a requrement; Probably any editor does that now. 

I use both of the above to attack web design projects.

John

On Wed, 10 Jul 2002, Mark McCulligh wrote:

-I am looking for a good Development tool to write my PHP in and was
-wondering what people are using out there.
-
-I have been looking at Dreamweaver MX, Zend Studio 2.5 and phpEdit.
-I know UltraDev 4 well with ASP, but the new MX now supports PHP.  This
-MX/PHP any good?  Zend looks good with the integrated documentation and
-debugging tools.
-
-Thanks, Mark.
-_
-Mark McCulligh, Application Developer / Analyst
-Sykes Canada Corporation www.SykesCanada.com
-(888)225-6824 ex. 3262
[EMAIL PROTECTED]
-
-
-
--- 
-PHP General Mailing List (http://www.php.net/)
-To unsubscribe, visit: http://www.php.net/unsub.php
-

**

John Huggins
VANet

[EMAIL PROTECTED]
http://www.va.net/

**


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




Re: [PHP] Incrementing a table cell

2002-06-28 Thread John S. Huggins


Table fubar
ID, SomeNumber

1 456
2 123
3 3
4 4589

$query = UPDATE fubar SET SomeNumber = SomeNumber+1 WHERE ID = 2;

Result

Table fubar
ID, SomeNumber

1 456
2 124
3 3
4 4589

On Fri, 28 Jun 2002, JJ Harrison wrote:

-what is the best way to increment a mySQL table cell?
-
-is there a increment function or do I need to increment it in php?
-
-
-
-
-
--- 
-PHP General Mailing List (http://www.php.net/)
-To unsubscribe, visit: http://www.php.net/unsub.php
-

**

John Huggins
VANet

[EMAIL PROTECTED]
http://www.va.net/

**


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




Re: [PHP] md5 php vs. md5 perl

2002-06-16 Thread John S. Huggins

On Sun, 16 Jun 2002, Danny Kruitbosch wrote:

-Hi,
-
-I'm trying to rewrite a perl finction to php. The function uses Digest::MD5.
-
-PHP md5() returns a 32 char hex number. The perl Digest::MD5 function 
-returns a 16 char (ascii??) string. Can I also get this from PHP? If so 
-how do I do that?

32 hex characters describes the 128 bit result from the MD5 routine no
matter where it is run: PHP, Shell, whatever.  This assumes one hex
character stands for 4 bits = 32 x 4 = 128.  This is the usual way of
handling MD5 hashes as this is simple 7 bit ascii characters use to
describe the hex numerals 0-9, A, B, C, D, E, and F.

If you use a full byte then you get 8 bits * 16 = 128.  This result is an
extended ascii string which may or may not be difficult to handle with
built-in PHP functions.

You could write a routine that combines every two hex characters into one
byte by converting the right hex to its numerical value (0 to 15), the
left bit to its numerical value * 16, add them together to get the
resulting byte value (0 to 255) and use it to build your 16 byte result.

This should get you compatibility between the two different ways of
describing MD5 hashes.


-
-My ultimate goal is to have compatible PHP/Perl functions.
-
-
-Thanks!
-
-Danny
-
-
--- 
-PHP General Mailing List (http://www.php.net/)
-To unsubscribe, visit: http://www.php.net/unsub.php
-

**

John Huggins
VANet

[EMAIL PROTECTED]
http://www.va.net/

**


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




[PHP] Beginning / and end of word / in eregi_replace

2002-06-14 Thread John S. Huggins


Can it be true that PHP does not implement the beginning and end of word
syntax of regular expressions?

In builing a bad word filter, I find this...

  $outstring = eregi_replace(badword$,goodword,$stringtocheck);

will find an occurance of the 'badword' at the end of the string and
replace it.

Similarly,

  $outstring = eregi_replace(^badword,goodword,$stringtocheck);

will find an occurance of the 'badword' at the beginning of the string
and replace it.

Also,

  $outstring = eregi_replace(badword,goodword,$stringtocheck);

will find all occurances of 'badword' even if they are part of a longer
not so bad word like 'badwordage' and replace it.

Then,

  $outstring = eregi_replace( badword ,goodword,$stringtocheck);

will help me isolate just the actual bad word, but not those at the
beginning and end of a string or that end in a period or comma.

So I could make a rule for each possible placement of badword in a string
and then do this for each vulger term I try to filter.  Or I could just
do... 

  $outstring = eregi_replace(/badword/,goodword,$stringtocheck);

Which should find any occurance of 'badword' and nothing more anywhere in
the string.  It works in grep.  It works in bash.  It does not seem to
work in PHP.

Anybody know what I might be doing wrong?

**

John Huggins
VANet

[EMAIL PROTECTED]
http://www.va.net/

**


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




Re: [PHP] Beginning / and end of word / in eregi_replace

2002-06-14 Thread John S. Huggins

On Fri, 14 Jun 2002, 1LT John W. Holmes wrote:

-You have your answer, just use this:
-
-$outstring = eregi_replace(badword,goodword,$stringtocheck);
-
-It'll replace it whether it's at the beginning or end of a string, embedded
-in a word, or by itself. Isn't that what you want?
-

Not quite.  I want to replace words like ass and leave works like
assumption in place.

Actually, I did find the answer to the beginning and end of word regex
syntax.  It is.

  $outstring = \
  eregi_replace([[::]]badword[[::]],goodword,$stringtocheck);

This constrains the word and will only act if it is surrounded by
non-alpha characters.  It acts just like / and /.  I found this answer
in the MySQL web page of all things...

  http://www.mysql.com/doc/R/e/Regexp.html

Thanks for your input.

John

-Actually, it'd be better and faster to just use str_replace() instead of a
-regular expression...
-
John Holmes...
-
-- Original Message -
-From: John S. Huggins [EMAIL PROTECTED]
-To: [EMAIL PROTECTED]
-Sent: Friday, June 14, 2002 11:37 AM
-Subject: [PHP] Beginning / and end of word / in eregi_replace
-
-
-
- Can it be true that PHP does not implement the beginning and end of word
- syntax of regular expressions?
-
- In builing a bad word filter, I find this...
-
-   $outstring = eregi_replace(badword$,goodword,$stringtocheck);
-
- will find an occurance of the 'badword' at the end of the string and
- replace it.
-
- Similarly,
-
-   $outstring = eregi_replace(^badword,goodword,$stringtocheck);
-
- will find an occurance of the 'badword' at the beginning of the string
- and replace it.
-
- Also,
-
-   $outstring = eregi_replace(badword,goodword,$stringtocheck);
-
- will find all occurances of 'badword' even if they are part of a longer
- not so bad word like 'badwordage' and replace it.
-
- Then,
-
-   $outstring = eregi_replace( badword ,goodword,$stringtocheck);
-
- will help me isolate just the actual bad word, but not those at the
- beginning and end of a string or that end in a period or comma.
-
- So I could make a rule for each possible placement of badword in a string
- and then do this for each vulger term I try to filter.  Or I could just
- do...
-
-   $outstring = eregi_replace(/badword/,goodword,$stringtocheck);
-
- Which should find any occurance of 'badword' and nothing more anywhere in
- the string.  It works in grep.  It works in bash.  It does not seem to
- work in PHP.
-
- Anybody know what I might be doing wrong?
-
- **
-
- John Huggins
- VANet
-
- [EMAIL PROTECTED]
- http://www.va.net/
-
- **
-
-
- --
- 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
-

**

John Huggins
VANet

[EMAIL PROTECTED]
http://www.va.net/

**


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




Re: [PHP] .php3 extension?

2002-05-30 Thread John S. Huggins

Somewhere in the apache configuration file you will find something like
this...

IfModule mod_php4.c
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php4
AddType application/x-httpd-php-source .phps
/IfModule

To include the old .php3 extension make it look like this...

IfModule mod_php4.c
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php4
AddType application/x-httpd-php .php3
AddType application/x-httpd-php-source .phps
/IfModule


On Thu, 30 May 2002, The Gabster wrote:

-Hello all...
-
-I have Apache 2.0.35 and PHP 4.2.0 on a win2k machine... Everything works
-fine, etc. The question I have, how can I configure PHP (or Apache?) to
-support (and run) .php3 extension files?
-
-Thanks a lot,
-Gabi.
-
-
-
--- 
-PHP General Mailing List (http://www.php.net/)
-To unsubscribe, visit: http://www.php.net/unsub.php
-

**

John Huggins
VANet

[EMAIL PROTECTED]
http://www.va.net/

**


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




Re: [PHP] PhP, mysql and pictures

2002-05-27 Thread John S. Huggins

On Mon, 27 May 2002, Ragnar wrote:

-Is it possible to display images in a browser that are stored as a blob
-column in a mysql table? Or is it better to store images in a direcotory and
-display them from there?

IMHO it is better to let a file system store the image files and let MySQL
reference the file names and do overall organization.

However, it is possible to store the image in MySQL and have it displayed
in a browser. 


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

**

John Huggins
VANet

[EMAIL PROTECTED]
http://www.va.net/

**


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




Re: [PHP] How to stop site flipping?

2002-05-13 Thread John S. Huggins

If they reveal themselves in the AGENT info of each web request, you could
act on that accordingly in your PHP code by looking at the REQUEST_AGENT
variable.  I use this tactic to prevent web sucking programs from access
my site all at once.

On Mon, 13 May 2002, David McInnis wrote:

-I have been running a newswire service since 97 and recently noticed an
-increase in the number of people flipping our site to harvest email
-addresses contained in the news releases posted on our site. (prweb.com)
-
-I am running apache and php on a linux box.  Can anyone suggest
-something that I can implement that would block users who are harvesting
-data from our site?  I do not mind legit users from using this data, but
-the flippers are chewing up my bandwidth and db resources.  
-
-I also want to be careful to not block valid search engine spiders from
-indexing our site.
-
-David McInnis
-
-
--- 
-PHP General Mailing List (http://www.php.net/)
-To unsubscribe, visit: http://www.php.net/unsub.php
-

**

John Huggins
VANet

[EMAIL PROTECTED]
http://www.va.net/

**


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




Re: [PHP] adding 60 to a date

2002-05-07 Thread John S. Huggins

On Tue, 7 May 2002, Scott St. John wrote:

-Morning
-
-I am working on a password aging system that will force a user to change 
-their password every 60 days.  Can anyone recommend the best method for 
-taking the current date and adding 60 days to that number?  Should I do a 
-unix timestampe and add or strtotime and add 60 days?

Yes, using the unix timestamp is most frequently the wise thing to do - at
least for me :-|

Just add 5,184,000 seconds to the current timestamp.

**

John Huggins
VANet

[EMAIL PROTECTED]
http://www.va.net/

**


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




Re: [PHP] date wierdness

2002-05-03 Thread John S. Huggins

Long ago I saw this same thing and never did resolve it since the easier
solution is to let MySQL format the date for you using DATE_FORMAT.

Formatting the date using PHP tools from data derived from a query will
just drive you nuts.

There is some kind of thing that MySQL and PHP don't agree on and I just
have no idea what.

Weirdness indeed.  Avoid it and live long and prosper. 

John

On Fri, 3 May 2002, ROBERT MCPEAK wrote:

-On PHP3 where $row[art_date] == 2002-05-03, 
-$thedate resolves to Thurs, May 2, 2002  
-
-YESTERDAYS DATE!
-
-See for yourself, if you wish, here:
-http://www.endvaw.org/current.php3
-
-What gives.
-
-$row = mysql_fetch_array($result);
-$blah = eregi_replace(-, /, $row[art_date]); 
-$thedate = date(D, M d, Y, strtotime($blah));   
-
--- 
-PHP General Mailing List (http://www.php.net/)
-To unsubscribe, visit: http://www.php.net/unsub.php
-

**

John Huggins
VANet

[EMAIL PROTECTED]
http://www.va.net/

**


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




Re: [PHP] Create Picture Thumbnails On the gly with PHP

2002-05-03 Thread John S. Huggins


ImageMagic works pretty well.  You invoke their command line programs
using the shell capabilities of PHP.  convert is the particular command
you want.

On Fri, 3 May 2002, simos wrote:

-Hi
-
-My Hosting Provider  has'nt the GD lib in PHP enabled. Are threre any alternative to 
create jpg thumbnails in my site without the use of GD lib ??
-
-Thanks in advance for your reply
-
-Regards
-
-Simos
-
-
-
-

**

John Huggins
VANet

[EMAIL PROTECTED]
http://www.va.net/

**


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




Re: [PHP] bulletin board algorithm in php - how to write one?

2002-04-24 Thread John S. Huggins


Recursion is the way I manage this in my forum script.  The database
table for a particular forum topic does not have any concept of threads
in the field data.  Each message only knows who its parent is.  If the
parent ID = 0, then I know this is the first message of a virtual thread.

Have a look at an example...

  http://www.astronomy.net/forums/atm/

I use a recursive loop to find children of children.  In the main screen I
use it to build indented lists of the first 30 threads.  Within a
message, I use it to find the children of children of the current message
ID.

So long as you have proper indexes in your table for the main ID and the
ParentID, this will be blazing fast. 

I have thought long and hard about seperating the thread and post data
into two tables.  I see some advantages to this, but so far, I just cannot
justify the need for it when the thread relationship is implicit within
the defined parent child relationship of each message.

The result is a simple one-table-per-topic system with the content of the
table simply being:

- ID = autoincrement
- Title = The message Title
- Author = Who made this message - derived from a seperate login system
- Date = The data message was created - simply NOW() in the insert query
- ParentID = The ID of the message that is parent to this, 0 if thread top
- Body = The actual message
- ClientIPAddress = I log this, but probably don't really need to.
- Display = An on-off switch to hide inappropriate messages.
- hash = I calculate an MD5 hash of Title-Author-Body and UNIQUE it to
prevent duplicate postings.

Are their better ways?  Sure.  Do I care?  Not yet as this just works fine
for me.

Good luck.

John



On Wed, 24 Apr 2002, Phil Schwarzmann wrote:

-I want to write a simple bulletin board in PHP.  I want to use the
-typical parent-child (it's sorted by both date AND thread) type of
-bulletin board you see often on other websites.
- 
-But I just can't figure out how to write some simple code to do this
-and keep track of all the threads.
- 
-Any ideas?  I don't even need example code, just if someone could
-quickly explain in plain english how to do it.
- 
-Thanks!!
-

**

John Huggins
VANet

[EMAIL PROTECTED]
http://www.va.net/

**


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




[PHP] List, Key, Value oh my.

2002-04-23 Thread John S. Huggins


I have a problem.

I am fetching rows from a MySQL table called temp.  Each row has four
fields: Name, 1, 2 and 3

Then I do this function which will eventually generate records for a
lookup table for any skills in the 1, 2 or 3 fields that equal the string
YES associated with the Name (right now it just prints to the web
browser while I debug it).

function generateLookupTable() {
//
$query  = SELECT * FROM temp;
if ( !$result = mysql_query($query) ) {
//
print(pmysql_error() .  br$query/p); 
} else {
//
// For each name returned, march through
// each skill and insert a row into the
// lookup_skill
// where the skill value == YES
while ( $row = mysql_fetch_array($result) ) {
//
print(p); // For test
while ( list($key,$value) = each($row) ) {
print(---\{$key,$value}---); // For test
//
if ( $key == Name ) { -
print(Name is $value, Key = $key
| );
} else {
if ( $value == YES ) {
print($key | );
}
}
print(br);
}
print(/p); // For test
}
}
}



I have marked an IF statement with the - string.  As the
while statement marches through the array $row returned from
mysql_fetch_array the value of key is set first to 0 then Name then
1 then 2 then 3.  Fine.  However, the if statement highlighted above
winds up being true when the $key == 0 and when $key == Name and I
can't see why this would be so.

Any possibilities folks?  I am quickly working around this now so it is
not slowing me down, however, this is just too unusual to not figure out.

John


**

John Huggins
VANet

[EMAIL PROTECTED]
http://www.va.net/

**



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




Re: [PHP] List, Key, Value oh my.

2002-04-23 Thread John S. Huggins


I forgot to show you some output from this thing...

---{0,BLOW, JOE}---Name is BLOW, JOE, Key = 0 | 
---{Name,BLOW, JOE}---Name is BLOW, JOE, Key = Name | 
---{1,YES}---1 | 
---{2,}---
---{3,YES}---3 | 

The way I see it, that first line should have not printed because $key is
equal to 0 not Name.


On Tue, 23 Apr 2002, John S. Huggins wrote:

-
-I have a problem.
-
-I am fetching rows from a MySQL table called temp.  Each row has four
-fields: Name, 1, 2 and 3
-
-Then I do this function which will eventually generate records for a
-lookup table for any skills in the 1, 2 or 3 fields that equal the string
-YES associated with the Name (right now it just prints to the web
-browser while I debug it).
-
-function generateLookupTable() {
-  //
-  $query  = SELECT * FROM temp;
-  if ( !$result = mysql_query($query) ) {
-  //
-  print(pmysql_error() .  br$query/p); 
-  } else {
-  //
-  // For each name returned, march through
-  // each skill and insert a row into the
-  // lookup_skill
-  // where the skill value == YES
-  while ( $row = mysql_fetch_array($result) ) {
-  //
-  print(p); // For test
-  while ( list($key,$value) = each($row) ) {
-  print(---\{$key,$value}---); // For test
-  //
-  if ( $key == Name ) { -
-  print(Name is $value, Key = $key
-| );
-  } else {
-  if ( $value == YES ) {
-  print($key | );
-  }
-  }
-  print(br);
-  }
-  print(/p); // For test
-  }
-  }
-}
-
-
-
-I have marked an IF statement with the - string.  As the
-while statement marches through the array $row returned from
-mysql_fetch_array the value of key is set first to 0 then Name then
-1 then 2 then 3.  Fine.  However, the if statement highlighted above
-winds up being true when the $key == 0 and when $key == Name and I
-can't see why this would be so.
-
-Any possibilities folks?  I am quickly working around this now so it is
-not slowing me down, however, this is just too unusual to not figure out.
-
-John
-
-
-**
-
-John Huggins
-VANet
-
[EMAIL PROTECTED]
-http://www.va.net/
-
-**
-
-
-
--- 
-PHP General Mailing List (http://www.php.net/)
-To unsubscribe, visit: http://www.php.net/unsub.php
-

**

John Huggins
VANet

[EMAIL PROTECTED]
http://www.va.net/

**


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




Re: [PHP] List, Key, Value oh my.

2002-04-23 Thread John S. Huggins


The Earth shook, Angles sang, there was much rejoicing.

Behold Miguel is correct. === did the trick.

It sure is nice to know I am not going nuts.

Much thanks.

John


On Tue, 23 Apr 2002, Miguel Cruz wrote:

-Amazing things happen when you compare values of different types. The 
-numerical value of Name is zero. Try using === to compare type as well 
-as value.
-
-miguel
-
-On Tue, 23 Apr 2002, John S. Huggins wrote:
- I forgot to show you some output from this thing...
- 
- ---{0,BLOW, JOE}---Name is BLOW, JOE, Key = 0 | 
- ---{Name,BLOW, JOE}---Name is BLOW, JOE, Key = Name | 
- ---{1,YES}---1 | 
- ---{2,}---
- ---{3,YES}---3 | 
- 
- The way I see it, that first line should have not printed because $key is
- equal to 0 not Name.
- 
- 
- On Tue, 23 Apr 2002, John S. Huggins wrote:
- 
- -
- -I have a problem.
- -
- -I am fetching rows from a MySQL table called temp.  Each row has four
- -fields: Name, 1, 2 and 3
- -
- -Then I do this function which will eventually generate records for a
- -lookup table for any skills in the 1, 2 or 3 fields that equal the string
- -YES associated with the Name (right now it just prints to the web
- -browser while I debug it).
- -
- -function generateLookupTable() {
- -  //
- -  $query  = SELECT * FROM temp;
- -  if ( !$result = mysql_query($query) ) {
- -  //
- -  print(pmysql_error() .  br$query/p); 
- -  } else {
- -  //
- -  // For each name returned, march through
- -  // each skill and insert a row into the
- -  // lookup_skill
- -  // where the skill value == YES
- -  while ( $row = mysql_fetch_array($result) ) {
- -  //
- -  print(p); // For test
- -  while ( list($key,$value) = each($row) ) {
- -  print(---\{$key,$value}---); // For test
- -  //
- -  if ( $key == Name ) { -
- -  print(Name is $value, Key = $key
- -| );
- -  } else {
- -  if ( $value == YES ) {
- -  print($key | );
- -  }
- -  }
- -  print(br);
- -  }
- -  print(/p); // For test
- -  }
- -  }
- -}
- -
- -
- -
- -I have marked an IF statement with the - string.  As the
- -while statement marches through the array $row returned from
- -mysql_fetch_array the value of key is set first to 0 then Name then
- -1 then 2 then 3.  Fine.  However, the if statement highlighted above
- -winds up being true when the $key == 0 and when $key == Name and I
- -can't see why this would be so.
- -
- -Any possibilities folks?  I am quickly working around this now so it is
- -not slowing me down, however, this is just too unusual to not figure out.
- -
- -John
- -
- -
- -**
- -
- -John Huggins
- -VANet
- -
- [EMAIL PROTECTED]
- -http://www.va.net/
- -
- -**
- -
- -
- -
- --- 
- -PHP General Mailing List (http://www.php.net/)
- -To unsubscribe, visit: http://www.php.net/unsub.php
- -
- 
- **
- 
- John Huggins
- VANet
- 
- [EMAIL PROTECTED]
- http://www.va.net/
- 
- **
- 
- 
- 
-

**

John Huggins
VANet

[EMAIL PROTECTED]
http://www.va.net/

**


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




Re: [PHP] cvs tags (version?)

2002-04-04 Thread John S. Huggins

print(p$Revision: $/p);

The next time you commit a file with this in it, the $Revision:$ will be
replaced by $Revision: 1.38$ if you version is in fact 1.38.

On Thu, 4 Apr 2002, Jeff D. Hamann wrote:

-I'm trying to find a way to insert the cvs version into a footer of my php
-files so I can simple ask the client to tell me the version number at the
-bottom of the page. I can then send an update or even better have the
-browser request an update for the file.
-
---
-Jeff D. Hamann
-Hamann, Donald  Associates, Inc.
-PO Box 1421
-Corvallis, Oregon USA 97339-1421
-Bus. 541-753-7333
-Cell. 541-740-5988
[EMAIL PROTECTED]
-www.hamanndonald.com
-
-
-
-
--- 
-PHP General Mailing List (http://www.php.net/)
-To unsubscribe, visit: http://www.php.net/unsub.php
-

**

John Huggins
VANet

[EMAIL PROTECTED]
http://www.va.net/

**


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




Re: [PHP] Temporary MySQL Tables

2002-03-21 Thread John S. Huggins

On Thu, 21 Mar 2002, Georgie Casey wrote:

-Hi,
-
-membership with the username and timestamp in the URL. The users clicks it,
-and I run a SQL command that copies the row from tempmembers into the
-members table.

I assume you are building up all your fields as you move through the site.
I would just perform an INSERT into your tempmebers table right away
setting whatever fields you have at this point.  Then as I pass through
each data entry page, I would do UPDATES to that record updating only
those new fields, leaving the old ones alone and thus preserved.

This way you only have to pass a record ID and the new parameters on each
page thus eliminating moving data through the URL.  Yuk.

Anyway, that's what I would do.

-
-This process worked well for a while until I discovered if users enter a
-single or double quote into any of the fields, it fecks everything up. So I
-added an addslashes command but it's all getting a bit hairy so I was
-looking for some advice on MySQL temporary tables for either using after
-every form or at the end of all the forms.
-
-Or does anyone have any other method I could use??? Thanks for any help
-you might have.
-
-
-
--- 
-PHP General Mailing List (http://www.php.net/)
-To unsubscribe, visit: http://www.php.net/unsub.php
-

**

John Huggins
VANet

[EMAIL PROTECTED]
http://www.va.net/

**


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




Re: [PHP] cvs data PHP

2002-03-20 Thread John S. Huggins

Look for CHORA on the net.  It is a PHP thing that somehow accesses a CVS
respository.  I discovered it as part of phpGroupWare.  It works well and
should serve as a decent guide.


On Wed, 20 Mar 2002, Erik Price wrote:

-I was wondering if there is a way to access CVS from a PHP script.  
-Obviously there's some way to do it, SourceForge does it.  What I'm 
-wondering is how --
-
-Somebody commits an XML file to CVS.  Later, somebody else accesses the 
-PHP script.  The PHP script queries CVS for the latest version of the 
-file, and reads its contents.  (This is because I actually want the PHP 
-script to parse the XML and do later things with this info.)
-
-Does anyone know how this is done?  Rather, can anyone point me to a 
-tutorial or resource on this topic?
-
-Thank you,
-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
-

**

John Huggins
VANet

[EMAIL PROTECTED]
http://www.va.net/

**


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




Re: [PHP] MySQL and indexes

2002-03-18 Thread John S. Huggins

I have seen this problem before and, yes, an index field with
autoincrement is always a good thing to have.

Perhaps, this is not necessary, but usually works.

John

On Mon, 18 Mar 2002, Jennifer Downey wrote:

-Hi all,
-
-Just wondering, does a table have to have an index? If so what should I
-consider when making a colum an index?
-
-Here is the table I am using but I can't get php to update it.
-Is it because there is no index?
-
-
-CREATE TABLE wt_pet (
-  petid varchar(100) default NULL,
-  pet_user int(10) NOT NULL default '0',
-  petname varchar(50) NOT NULL default '',
-  pet_sex enum('Male','Female') NOT NULL default 'Male',
-  pet_equip varchar(50) NOT NULL default '',
-  pet_state varchar(20) NOT NULL default '',
-  pet_hunger varchar(20) NOT NULL default '',
-  pet_date date NOT NULL default '-00-00',
-  num_pets int(1) NOT NULL default '0',
-  ) TYPE=MyISAM;
-
-
-Thanks
-Jennifer Downey
-
-
-
--- 
-PHP General Mailing List (http://www.php.net/)
-To unsubscribe, visit: http://www.php.net/unsub.php
-

**

John Huggins
VANet

[EMAIL PROTECTED]
http://www.va.net/

**


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




Re: [PHP] phpMyAdmin

2002-03-11 Thread John S. Huggins

On Mon, 11 Mar 2002, Chuck PUP Payne wrote:

-I have a client that has install phpMyAdmin but can't get into he gets this
-error;
-
-Error
-MySQL said:
-
-
-Access denied for user: 'root@localhost' (Using password: NO)
-
-
-Is there a way to get into if he knows the password?

Well, yes.  The root mysql account is most likely password protected and
yes if you have it then you should be able to get in.

If you do not have the password forthe root account, but do have it for
your mysql account, then change the parameters in the config files to
reflect your account settings.

-
-Chuck PUP Payne
-Sr. System Administrator
-GDI Engineering, Inc.
-
-
-
-
--- 
-PHP General Mailing List (http://www.php.net/)
-To unsubscribe, visit: http://www.php.net/unsub.php
-

**

John Huggins
VANet

[EMAIL PROTECTED]
http://www.va.net/

**


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




Re: [PHP] How can i count the number of users logged in my system

2002-02-12 Thread John S. Huggins


Create a user activity table which stores the time when the user does
anything.  Then query it with a GROUP BY user syntax and constrain the
records to only those after, say, an hour ago if you think that users
doing something during the last hour means they are in there doing
something.

This is only a start, but is how I do it.

On Tue, 12 Feb 2002, V wrote:

-I'm developing a site where many users can log in.
-I want to know how many users are using the system simoultaneously, and display it 
in a document so the users can see it.
-¿How can i do that?
-Thanks
-
-Salu2,
-
- 
-___
-Powered by Sambar Webmail - http://www.sambar.com)
-
-
-
-
-
--- 
-PHP General Mailing List (http://www.php.net/)
-To unsubscribe, visit: http://www.php.net/unsub.php
-

**

John Huggins
VANet

[EMAIL PROTECTED]
http://www.va.net/

**


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




Re: [PHP] Firewall

2002-02-06 Thread John S. Huggins

On Wed, 6 Feb 2002, Thomas Franz wrote:

-Hi,
-
-i hope this is the right group for my question.
-
-i've written a php-program with a ftp-connection to a mysql database.
-
-now there is one problem. the local network has a firewall. Now, if i try to
-connect to the database via ftp there is an error.
-There are no problems if i try to connect from a place without firewall.
-
-What must i do to go through the firewall.

Hmmm, well, FTP through a firewall requires some kind of openness on
ports 20 and 21.  Just port 20 is fine if you use passive mode to transfer
data.

I have to ask, how can you connect to a mysql database (which I assume is
on port 3306) using an ftp connection?  I realize you can instruct ftp to
connect to 3306 (which would then require the firewall pass traffic on
3306), but why would this ever be preferable to using the usual connect
methods in PHP?

In any case, check that your firewall passes port 21 out, 3306 out and
port 20 in.

John


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

**

John Huggins
VANet

[EMAIL PROTECTED]
http://www.va.net/

**


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




Re: [PHP] QUESTION: how to validate credit card number before sent to Versi gn?

2001-12-19 Thread John S. Huggins


Look at the strings section of the PHP online manual.  The function of
choice is probably something like str_replace().  Not sure if this is the
correct thing, but I know you can do what you want with a PHP string
function.

Good luck and make sure to keep those damn CC numbers nowhere on your
machine.

J

On Wed, 19 Dec 2001 [EMAIL PROTECTED] wrote:

-We collect credit card info. on our site and send it to Verisign for
-processing.  We collect the credit card info. on the last page of our
-registration form.  We have about 50% of the credit card numbers declined
-because people use dashes in their cc number (even though our directions ask
-them not to).
-
-Is there anyway to incorporate the following function so that the dashes
-would be stripped out before going directly to Verisign for processing? or
-do I need to create a middle page that would validate the credit card info.
-before going to Verisign? If the latter is true, then is there a way I can
-run this validation invisibly - maybe using header(Location:)?
-
-
-? function clean_no($cc_no){// Remove non-numeric characters from $cc_no return 
ereg_replace ('[^0-9]+', '', $cc_no); }?
-
-
-Thanks for your help, Shawna
-
--- 
-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]
-

**

John Huggins
VANet
7101 Oriole Avenue
Springfield, VA 22150
703-912-6453
703-912-4831 fax

[EMAIL PROTECTED]
http://www.va.net/

**


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




Re: [PHP] intergration?

2001-12-13 Thread John S. Huggins


I have these issues too and the only thing I knew to do was develop my own
user management system with a simple interface to other programs.  My
other programs are custom too.   I used Tim Perdue's user system as a code
base so I am duty bound to distribute my changes to the open source crowd
soon.

The real solution is to have the open-source crowd agree on a few user
management systems and then offer hooks into each.  So many projects have
their own home-grown user systems that re-inventing the wheel occurs
constantly.

User Management is of sufficient importance that it really should have its
own legion of programmers concentrating on making it secure and useful to
other applications.

If any of you know more about this topic, please chime in with your
comments.

John

On Thu, 13 Dec 2001, Kunal Jhunjhunwala wrote:

-Hi,
-Ive been trying to figure out ways to intergrate two applications to use a
-common user information database... example: intergrating phpnuke to work
-with vbulletin.. so the use doesnt have to re-gister to use each service...
-any suggestions on how to go about doing this? I have the dbase structure of
-both the appz, and can alter the code for one of the apps.. not the both...
-so its a kinda one sided thing..
-what would be the best approach for something like this?
-Regards,
-Kunal Jhunjhunwala
-
-
--- 
-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]
-

**

John Huggins
VANet
7101 Oriole Avenue
Springfield, VA 22150
703-912-6453
703-912-4831 fax

[EMAIL PROTECTED]
http://www.va.net/

**


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




Re: [PHP] md5 decrypt

2001-12-05 Thread John S. Huggins

On Wed, 5 Dec 2001, Dan McCullough wrote:

-Is there away to take a md5 encrypted password and decrypt it and give that to the 
client, if they
-fogot their password.

No.

-
-=
-dan mccullough
-
-Theres no such thing as a problem unless the servers are on fire!
-
-
-__
-Do You Yahoo!?
-Buy the perfect holiday gifts at Yahoo! Shopping.
-http://shopping.yahoo.com
-
--- 
-PHP General Mailing List (http://www.php.net/)
-To unsubscribe, e-mail: [EMAIL PROTECTED]
-For additional commands, e-mail: [EMAIL PROTECTED]
-To contact the list administrators, e-mail: [EMAIL PROTECTED]
-

**

John Huggins
VANet
7101 Oriole Avenue
Springfield, VA 22150
703-912-6453
703-912-4831 fax

[EMAIL PROTECTED]
http://www.va.net/

**


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




Re: [PHP] generating text file from php

2001-11-30 Thread John S. Huggins

On Fri, 30 Nov 2001, David Tod Sigafoos wrote:

-I have a script which generates html and writes out for users to
-download.  The script works and the html file works.
-
-I build strings of html then writeout with fwrite.  
-
-My question is how can i add linefeeds to the strings?

\n

or maybe

\r

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

**

John Huggins
VANet
7101 Oriole Avenue
Springfield, VA 22150
703-912-6453
703-912-4831 fax

[EMAIL PROTECTED]
http://www.va.net/

**


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




Re: [PHP] getting a user's ip address

2001-11-29 Thread John S. Huggins

On Thu, 29 Nov 2001, Ken Savage wrote:

-Super new to PHP but I'm putting in the effort to learn quickly.
-How would I output the user's IP address in a php file.
-
-I want the webpage to say...
-
-Your IP address is xx.xx.xx.xx

Try finding it in these variables:

  $HTTP_SERVER_VARS[REMOTE_ADDR]

or

  $REMOTE_ADDR

John


**

John Huggins
VANet
7101 Oriole Avenue
Springfield, VA 22150
703-912-6453
703-912-4831 fax

[EMAIL PROTECTED]
http://www.va.net/

**


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




Re: [PHP] pipe email to php?

2001-11-24 Thread John S. Huggins

The forum PHP program package Phorum has something like this available.  I
believe it is a file called phorummail.php.

I remember using it as a basis for another program and it really does a
good job of indentifying and splitting headers and body of emails into
assorted variables.

On Sun, 25 Nov 2001, Kunal Jhunjhunwala wrote:

-Hey,
-Ive looked.. and tried... nothing seems to work.. any ideas on how to pipe
-email to a php script? Ive already setup the valias.. the big question is,
-how to process the info when the email comes in..
-kunal
-
-
--- 
-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]
-

**

John Huggins
VANet
7101 Oriole Avenue
Springfield, VA 22150
703-912-6453
703-912-4831 fax

[EMAIL PROTECTED]
http://www.va.net/

**


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




Re: [PHP] Version Contol for PHP site

2001-11-19 Thread John S. Huggins

On 19 Nov 2001, Jeff Bearer wrote:

-Is anybody doing something like this with their PHP development?  Any
-direction from a working implementation would be great. And what do you
-think about the VNC idea that I just came up with?
-
VNC in a fine tool, but I think not needed for this.  Here is what I do
using WinCVS and Windows work stations.

I have three servers: one live web server, one development web server and
one completely seperate CVS server. Both web servers carry the same
Apache/PHP/MySQL setup.

At a work station (Windows for me) I checkout whatever (PHP, INC, HTML)
from the CVS server to my local drive.  I then edit it in Ultraedit and
save it via FTP to the development server.  Then I work, work, work,
crashing, banging, fixing with my browser pointing at the development
server.  Edits complete, I then save as to the local file name, do a CVS
commit and call it done.

Every so often, I will CVS Update the latest changes from the CVS
repository directly into the live web server and evaluate the web site. 
If things bomb, I will obtain a previous tagged-as-stable version of the
whole site (HTML,PHP,graphics) into the web directory and continue working
towards the next stable release.  If the development release works just
fine, I will tag the whole CVS repository with a new release description. 

CVS is proving quite effective at managing this stuff.

**

John Huggins
VANet
7101 Oriole Avenue
Springfield, VA 22150
703-912-6453
703-912-4831 fax

[EMAIL PROTECTED]
http://www.va.net/

**


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




[PHP] PHP General Archive

2001-10-30 Thread John S. Huggins


Hello folks.

I am yet another person having difficulty with 4.0.6 and GD graphic
support.  It has been a while since I have been on this list so I want to
search the archives of this group.

Where are the archives?  I remember some archive last year with a black
background.

Thanks.

**

John Huggins
VANet
7101 Oriole Avenue
Springfield, VA 22150
703-912-6453
703-912-4831 fax

[EMAIL PROTECTED]
http://www.va.net/

**


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