Re: [PHP] What's the proper way to open a file? File access permissions?

2003-02-17 Thread Dunkel


Jason Wong wrote:

On Friday 14 February 2003 16:36, Dunkel wrote:



How do I ensure that all file access permissions are allowed? What is
the proper way to do it?

- I tried to 'fopen' an existing text file but got Permission denied
error.
- I tried different parameters, same error
- I tried to use 'chmode', same thing


So, what should I do to get it work?



Try using the /fullpath/to/the/file. If you're in doubt about the permissions 
try writing to the system temp directory (/tmp for example).


Okay, thank you. I'll try that.
Is there any way to find out the full - whole - path?

Paul Dunkel
--
[EMAIL PROTECTED]


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




Re: [PHP] RSA implementation

2003-02-17 Thread José León Serna
El mié, 12-02-2003 a las 16:27, Chris Hewitt escribió:
 Or it could be an MD5 hash.
 Current password hash compared with what is in the database, if OK then 
 store new password hash.
 I'm just suggesting that its possible to use MD5 and not a two-way 
 encryption/decryption. I have no experience of using RSA, I'd have to 
 leave it to others to help.
 I'm not trying to *log the user* this is already done with MD5, what
I'm trying is to allow the user to change it's own password. I need
decryption.

Regards.


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




Re: [PHP] RSA implementation

2003-02-17 Thread José León Serna
El mié, 12-02-2003 a las 18:47, Matt Vos escribió:
 Why not try this:
I'm not trying to log in the user, this is already done with MD5, I'm
trying to allow the user to change its own password, so I need
encryption/decryption.

Regards.


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




[PHP] Default argument values

2003-02-17 Thread neko
Hey All,

I've been trying to write a function that accepts multiple optional 
parameters, some of which are ints. The function signature looks like this:

function blahBlah($fromDate, $toDate = 0, $limit = 20, $limitNodeType = 
null)

I've been reading up here:

http://www.php.net/manual/en/functions.arguments.php

But it doesn't describe what to do with multiple optional arguments. Can I 
call the function like this:

blahBlah($date, null, null, $limitNodeType);


?

Need some help getting this language feature sorted.

cheers,
neko

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




[PHP] Re: Default argument values

2003-02-17 Thread Stephen Willcock
Yes, you can call your function with these arguments, but in this case of
course the defaults will not be used because you have supplied arguments.
SW


Neko [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hey All,

 I've been trying to write a function that accepts multiple optional
 parameters, some of which are ints. The function signature looks like
this:

 function blahBlah($fromDate, $toDate = 0, $limit = 20, $limitNodeType =
 null)

 I've been reading up here:

 http://www.php.net/manual/en/functions.arguments.php

 But it doesn't describe what to do with multiple optional arguments. Can I
 call the function like this:

 blahBlah($date, null, null, $limitNodeType);


 ?

 Need some help getting this language feature sorted.

 cheers,
 neko



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




[PHP] Re: forking sendmail

2003-02-17 Thread Brendon
On Sun, 16 Feb 2003 01:05:58 -0300, Manuel Lemos [EMAIL PROTECTED] wrote:


Hello,

On 02/16/2003 12:15 AM, Brendon wrote:

I've been trying to fork sendmail because DNS checks cause it to be slow 
delivering messages...
Here's what i've tried, and many other variations...

$str = to: [EMAIL PROTECTED]\nfrom: [EMAIL PROTECTED]\nsubject: test;
exec('sendmail -i -t $str  /dev/null');

Has anyone successfully acomplished something like this? ideas?

You are duplicating a function that sendmail already provides given the 
right switches. Anyway, if you want to raise the message delivery 
throughput, the best you can do is to use the deferred mode so it does 
not take a long time to queue the messages and then sendmail will take 
care of the delivery next time it runs the queue.

In that case you may want to look at this class for composing and sending 
messages that comes with sub-class to deliver with sendmail program 
directly. It comes with options to let you choose the appropriate 
sendmail delivery mode:

http://www.phpclasses.org/mimemessage



Thanks for that. I'll look at it and see if I can modify it for my needs.

The problem isn't sendmail priority.  The system isn't doing anything and 
sendmail isn't doing anything.  The problem is that it takes sendmail 
awhile for it to respond.  No. sendmail isn't broke, it just has to do a 
lot of thinking before it talks to a client. I want to remove that problem 
from the equation by puting sendmail in the background once its called.

Brendon

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



[PHP] Re: forking sendmail

2003-02-17 Thread Manuel Lemos
Hello,

On 02/17/2003 07:04 AM, Brendon wrote:

I've been trying to fork sendmail because DNS checks cause it to be 
slow delivering messages...
Here's what i've tried, and many other variations...

$str = to: [EMAIL PROTECTED]\nfrom: [EMAIL PROTECTED]\nsubject: test;
exec('sendmail -i -t $str  /dev/null');

Has anyone successfully acomplished something like this? ideas?


You are duplicating a function that sendmail already provides given 
the right switches. Anyway, if you want to raise the message delivery 
throughput, the best you can do is to use the deferred mode so it does 
not take a long time to queue the messages and then sendmail will take 
care of the delivery next time it runs the queue.

In that case you may want to look at this class for composing and 
sending messages that comes with sub-class to deliver with sendmail 
program directly. It comes with options to let you choose the 
appropriate sendmail delivery mode:

http://www.phpclasses.org/mimemessage



Thanks for that. I'll look at it and see if I can modify it for my needs.

The problem isn't sendmail priority.  The system isn't doing anything 
and sendmail isn't doing anything.  The problem is that it takes 
sendmail awhile for it to respond.  No. sendmail isn't broke, it just 
has to do a lot of thinking before it talks to a client. I want to 
remove that problem from the equation by puting sendmail in the 
background once its called.

What I am telling you is that sendmail itself can act that way given 
that you pass the right command line switches when you invoke it.

The class above lets you tell sendmail to act that way but usually it is 
better to tell it to queue the message instead of trying to deliver it 
right away because if you attempt to deliver many messages at once you 
can exhaust your server resources easily and your script will break.

--

Regards,
Manuel Lemos


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



[PHP] Search engine PHP

2003-02-17 Thread Andrian Ivanov
Hello,

Can somebody direct me to a documentation source, about creating small
database search engines with PHP?

Thank you in advance, Andrian Ivanov



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




php-general Digest 17 Feb 2003 11:01:29 -0000 Issue 1888

2003-02-17 Thread php-general-digest-help

php-general Digest 17 Feb 2003 11:01:29 - Issue 1888

Topics (messages 135786 through 135814):

Re: List problem
135786 by: David T-G

Re: recursion?
135787 by: David T-G

Re: Inserting records in a particular way in MySQL
135788 by: Miles Thompson

Converting a large number of passwords to MD5 at once.
135789 by: Vernon
135799 by: Lord Loh.
135800 by: Jason Wong

Convert my old cookies to session variable(s)
135790 by: Øystein Håland

anyone know what ical and outlook are programmed in?
135791 by: Kevin Myrick
135793 by: Luke Woollard
135794 by: Kevin Myrick

Re: What happened to phpEdit???
135792 by: Bryan Lipscy

Re: URL of calling page
135795 by: Brendon
135798 by: Luke Woollard

Re: long running PHP application
135796 by: Robert Cummings

Future compatibility
135797 by: Lord Loh.

Re: PHP error messages
135801 by: Lord Loh.

Re: loading same page
135802 by: Lord Loh.

Re: call a website from a php script
135803 by: Uttam

Free PHP?
135804 by: Bjarke Walling Petersen
135805 by: Alan Murrell

Re: What's the proper way to open a file? File access permissions?
135806 by: Dunkel
135807 by: Dunkel

Re: RSA implementation
135808 by: José León Serna
135809 by: José León Serna

Default argument values
135810 by: neko
135811 by: Stephen Willcock

Re: forking sendmail
135812 by: Brendon
135813 by: Manuel Lemos

Search engine PHP
135814 by: Andrian Ivanov

Administrivia:

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

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

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


--

---BeginMessage---
Beauford --

...and then Beauford.2002 said...
% 
% Does anyone else get bounced messages saying they can't send email to
% [EMAIL PROTECTED] when sending email to the list? Every email I send to

Yep.  Looks like that person was subscribed to this list and died but the
list hasn't yet kicked out the address.

Just flush 'em when you get 'em.


HTH  HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, Science and Health
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg97171/pgp0.pgp
Description: PGP signature
---End Message---
---BeginMessage---
Fred, et al --

...and then Fred Merritt said...
% 
...
% The benefit of checking in javascript(which I suspect is enabled in most 

Not me!  Not me!  Not me!

It is by no means ubiquitous.  Anyone who even moderately considers
security will have it turned off.


HTH  HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, Science and Health
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg97171/pgp1.pgp
Description: PGP signature
---End Message---
---BeginMessage---

If you are not using them as foreign keys, how does it matter? They are 
simply identifiers for a particular record. If you need to know the number 
of records a select count(*) does that quickly enough, gaps are irrelevant.

Miles


At 03:38 PM 2/16/2003 -0500, Willie G wrote:
Miles,

I never use auto increment.  Not because of gaps, but in case I need to
reload the table.  They do have meaning if they are foreign keys to another
table.

- Larry


-Original Message-
From: Miles Thompson [mailto:[EMAIL PROTECTED]]
Sent: Sunday, February 16, 2003 1:14 PM
To: Phillip S. Baker; PHP Email List
Subject: Re: [PHP] Inserting records in a particular way in MySQL



Phillip,

It doesn't matter, obviously you're not using the autoincrement ID for a
foreign key. All this does is identify a record.

If you did a SELECT and found a missing sequence number, what's to say that
value would not be inserted by another user before your INSERT? If you have
not set up the table with a MyISAM, MySQL will eventually use the missing
numbers.

These are only identifying tags, with no intrinsic meaning.

Miles


At 09:37 AM 2/16/2003 -0800, Phillip S. Baker wrote:
Greetings all,

I have some PHP code that is inserting records into a DB.
Most of this is auto increment.

However I know there is allot of breaks in the sequencing.

I am wondering if there is some way to write the SQL code to search
through the existing records in the DB and to find where the next
available ID is instead of just inserting the next sequence.

So for example if the ID's are.

20453
20454
20458
20459

It would let me know that 20455 is available for use and use the ID number
instead of using 20460
Thanks all.


Phillip

Re: [PHP] Future compatibility

2003-02-17 Thread Zeev Suraski
At 07:03 17/02/2003, Lord Loh. wrote:

Future compatibility
===

Php and zend have constantly been discarding old syntax...making it
deprecated and all...

How can I be sure that a code I write will run for ever (or at least 10
years) irrespective of future PHP versions...

Is there a list of syntax that php plans to discard...

for example(only example): The DBX library I have is giving warnings with
mysql...


PHP is a live, evolving language.  Like all evolving languages, there are 
cases where existing features have to be altered in a way that is downwards 
incompatible, despite our efforts to avoid compatibility breaking changes.

There is no sure-fire way to ensure that your code will be upwards 
compatible with future PHP versions for time periods as long as 10 
years.  That is the case with virtually all other live language, including 
Java, C++ and Perl.  If you want to take advantage of the new features in 
new versions, then the price tag attached is that there'll be sometimes 
compatibility breaking changes that you would have to live with.  Typically 
it's a small price to pay for the extra features, but if you're not willing 
to pay it, you do have the option of not upgrading.

Zeev


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



FW: [PHP] List problem

2003-02-17 Thread Uttam
please remove [EMAIL PROTECTED] from the list.

-Original Message-
From: David T-G [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 17, 2003 06:06
To: PHP General list
Cc: Beauford.2002
Subject: Re: [PHP] List problem


Beauford --

...and then Beauford.2002 said...
% 
% Does anyone else get bounced messages saying they can't send email to
% [EMAIL PROTECTED] when sending email to the list? Every email I
send to

Yep.  Looks like that person was subscribed to this list and died but
the
list hasn't yet kicked out the address.

Just flush 'em when you get 'em.


HTH  HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral
courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, Science and
Health
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl
Npg!



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




[PHP] Re: Converting a large number of passwords to MD5 at once.

2003-02-17 Thread Nenad Djordjevic
Hello Vernon,

If database is MySQL you can use MySQL function MD5:

UPDATE TableName SET password = MD5(password)


If database is not MySQL: write PHP script and use PHP function md5;




Best regards,
 Nenad Djordjevic   mailto:[EMAIL PROTECTED]
   
   Diyomi Soft
   http://www.diyomisoft.com/


Monday, February 17, 2003, 2:17:09 AM, you wrote:

V I made the mistake of opening a web site with encrypting the passwords
V stored in the database and want to encrypt them all in one fell swoop. Any
V ideas on how to do that?

V Thanks


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




RE: [PHP] Re: URL of calling page

2003-02-17 Thread Uttam
or $_SERVER[HTTP_REFERER]

availability depends or server though...

regds,

-Original Message-
From: Luke Woollard [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 17, 2003 10:48
To: PHP-general
Subject: RE: [PHP] Re: URL of calling page


dude - try this:

echo $HTTP_REFERER;

It'l give you the refering page from when you came.

Luke Woollard






-Original Message-
From: Brendon [mailto:[EMAIL PROTECTED]]
Sent: Monday, 17 February 2003 3:17 PM
To:  Acleave
Subject: [PHP] Re: URL of calling page


On Sun, 16 Feb 2003 15:58:30 -0600, Acleave [EMAIL PROTECTED] wrote:

 I believe there's a way in PHP to get the URL of the page that called
the
 current page but can't find it.  Is there such a function?  Or would I
 have to use another script (like Javascript)?

 What I mean is if I click on a link on index.html to jeremiah.php I
can
 call the function and find out I just came from index.html (and not
 henry.php or fred.php).

If you're trying to get back to a page, I would suggest passing the
current
page as a variable to the next page.

e.g.
a href=somepage.php?return_to=? echo
urlencode($_SERVER['REQUEST_URI'])
?Subscribe/a

--
 _BB

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





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




[PHP] RE: Search engine PHP

2003-02-17 Thread Uttam
may be browsing through available classes will help you:

http://uttam27.users.phpclasses.org/browse.html/class/22.html

-Original Message-
From: Andrian Ivanov [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 17, 2003 16:30
To: [EMAIL PROTECTED]
Subject: Search engine PHP


Hello,

Can somebody direct me to a documentation source, about creating small
database search engines with PHP?

Thank you in advance, Andrian Ivanov




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




[PHP] safe mode

2003-02-17 Thread Wilbert Enserink
Hi all


I'm having troubles with the safe mode. My ISP has safe mode ON.

Now i'm busy accessing files, deleting uploaded files, moving them and so
on. Different actions are performed by different scripts.
I want to make use of functions like stat() and so on, but each time I get
the warning:

Warning: file_exists() [function.file-exists]: SAFE MODE Restriction in
effect. The script whose uid is 884 is not allowed to access
/opt/guide/www.company.com.nl/HTML/myDir owned by uid 99

Since safe mode is ON and I can't change it in php.ini of my ISP I am
wondering what to do now?
There is this whole lot of file functions which I wanna use, but each time
I'm getting the warning or warnings that look like the one above.

I already tried ini_set(safe_mode,0) but since the script is already
accessed this action comes too late and even more important, according to
the manual this entry can be set only in php.ini or httpd.conf
(PHP_INI_SYSTEM) .

Does anybody know a safe workaround for this phenomenon? Any tips are most
welcome!

Regards Wilbert Enserink




- 
Pas de Deux 
Van Mierisstraat 25 
2526 NM Den Haag 
tel 070 4450855 
fax 070 4450852 
http://www.pdd.nl 
[EMAIL PROTECTED] 
-

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




[PHP] Re: Search engine PHP

2003-02-17 Thread Lord Loh.
See mine...
MySQL, PHP

http://findmaan.sourceforge.net/ opensource, So you can modify as long as
you give me the cridits and comply with the licence...

Lord Loh



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




[PHP] Re: Default argument values

2003-02-17 Thread Lord Loh.
So you want to do overloading ?

Try depricating the function call by
@blhablah($a,$b,[$c]);
No warnings generated!

Hope this helps

Lord Loh



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




Re: [PHP] long running PHP application

2003-02-17 Thread Lord Loh.
There is a execution time out(30 sec. by default)

How do you avert it!



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




[PHP] preg_match_all

2003-02-17 Thread Cenk Uysal
hi,

i try to parse html data with php's preg_match_all() function.
here is a sample data that i try to parse:

a href=http://www.xxx.com; class=Mxxx/a

the regular expression that i use is:

preg_match_all(/a[ ]href=\([^\]+)\[ ]class=M([^]+)\/a/,$buffer,$ma
tch);

by this expression i get the same values more then one time. but i
absolutely know that there's no repetation of same value. probably my
problam is about the regular expression that i use.

any help will be great help






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




Re: [PHP] long running PHP application

2003-02-17 Thread Ernest E Vogelsinger
At 13:06 17.02.2003, Lord Loh. spoke out and said:
[snip]
There is a execution time out(30 sec. by default)

How do you avert it!
[snip] 

ini_set('max_execution_time', 1800);   // set to 30 minutes...


-- 
   O Ernest E. Vogelsinger 
   (\) ICQ #13394035 
^ http://www.vogelsinger.at/


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




[PHP] register_globals On

2003-02-17 Thread Sam

I'm thinking of running a shopping cart package (osCommerce) that requires
register_globals to be enabled. With all the warnings about security with
register_globals enabled I'm worried.

How dangerous is it?


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




[PHP] Re: database selection

2003-02-17 Thread Hans Prins
One more question about this:

If I wanted to select the last row, would I use this code?

$query = SELECT * FROM polls ORDER BY pollID DESC LIMIT 0,1;





Hans Prins [EMAIL PROTECTED] schreef in bericht
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 thank you,

 that did the trick :)

 Thomas Seifert [EMAIL PROTECTED] schreef in bericht
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  On Sun, 16 Feb 2003 12:51:58 +0100 [EMAIL PROTECTED] (Hans Prins) wrote:
 
   Hello,
  
   Im trying to select only one row in a mysql database (in this case a
 poll
   with the smallest pollID)...
   Each row has a field called pollID which is the primary key and is
 auto
   incremented when a new row is inserted.
  
   I could possible do the following but I think its a bit extensive:
  
   $query = SELECT * FROM polls ORDER BY pollID ASC;
   $result = mysql_query($query);
   for ($count = 0; $count  1 $count++) {
   $data = mysql_fetch_array($result);
   $pollID = $data['pollID'];
   }
   $query = SELECT * FROM polls WHERE pollID = $pollID;
  
   Does anyone now a solution for this that requires less code?
  
   Thx
  
  
 
  $query = SELECT * FROM polls ORDER BY pollID ASC LIMIT 1;
 
 
  Thats the only row.
 
 
 
  Regards,
  --
  Thomas Seifert
 
  mailto:[EMAIL PROTECTED]
  http://www.MyPhorum.de





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




[PHP] Re: .htpasswd and PayPal generated passwords

2003-02-17 Thread Rob Packer
Hi David,
When using the IPN feature that PayPal offers, you can optionally have
them generate a username:password pair for you. That way it will be stored
at paypal and the user can check their history to retrieve it anytime.

Robert


David Duong [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 btw - What do you mean by paypal generated passwords?  I am interested in
 using PayPal as an alternative to my current credit card handler.

 Just a link is appreciated.

 - David


 Rob Packer [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  I use PayPal to generate a username and password and then write them
 to
  the .htpasswd file. If I were to switch to using a database (because
  .htaccess seems to always prompt twice!) how would I perform the
 comparison
  for the passwords? It would seem that everytime you generate an
encrypted
  password it's different. So how would you compare them? Also, does
anyone
  know what the encryption method used by PayPal is?
 
  Thanks for any help...
 
  Robert Packer
 
 





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




[PHP] removing html attributes by preg_replace

2003-02-17 Thread Tomas Lehuta
hello!
could somebody please help me to build a regexp to strip some attributes
from html code?
i'd like to remove all class= attributes from html, but the example below
seems not match
i don't know what i'm doing wrong, this simply doesn't work!

?php
$html = 'A href=http://www.anywhere.com; class=link/A';
echo input:br.htmlspecialchars($html).hr;
$html = preg_replace(|(\w+[^]*) +class=\?.*\?([^]*)|iU, \\1\\2,
$html);
echo output:br.htmlspecialchars($html).hr;
?

input:
A href=http://www.anywhere.com; class=link/A
output:
A href=http://www.anywhere.comlink;/A

why this always removes 'class=' only???
thanx for any help

-lharp-
_
aurius media studio
http://www.aurius.sk




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




Re: [PHP] RSA implementation

2003-02-17 Thread Jason Sheets
If all you are doing is trying to allow a user to change their password
you do not need decryption, all you need to do is md5 the new password
and update the database.

If you really want to use public key encryption take a look at the PHP
GPG Exetension or GPG.

Again unless you have information that you want to encrypt on the
machine but not decrypt you don't need public key encryption and hashing
with either md5 or sha1 will work fine.

Jason
On Mon, 2003-02-17 at 01:54, José León Serna wrote:
 El mié, 12-02-2003 a las 16:27, Chris Hewitt escribió:
  Or it could be an MD5 hash.
  Current password hash compared with what is in the database, if OK then 
  store new password hash.
  I'm just suggesting that its possible to use MD5 and not a two-way 
  encryption/decryption. I have no experience of using RSA, I'd have to 
  leave it to others to help.
  I'm not trying to *log the user* this is already done with MD5, what
 I'm trying is to allow the user to change it's own password. I need
 decryption.
 
 Regards.
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


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




[PHP] PHP + XML

2003-02-17 Thread Sandy Pleyte
Hi,

I have a problem with PHP and XML, I can't get the right data out of the 
 XML file. I made a small example of what I want:

--- Code ---

 function startElement($xml_parser, $name, $attrs) { echo [$name]br;}
  function externalEntityRefHandler($xml_parser, $openEntityNames, 
$base, $systemId,$publicId)
  {
echo External ?;
  }
  function endElement($xml_parser, $name) { echo [/$name]br;}
  function characterData($xml_parser, $text)
  {
echo Handling characterdata: '.$text.'br;
  }

  $xml_parser = xml_parser_create();
  xml_parser_set_option( $xml_parser, XML_OPTION_CASE_FOLDING, false );
  xml_set_element_handler($xml_parser, startElement, endElement);
  xml_set_character_data_handler($xml_parser,  characterData);
  xml_set_external_entity_ref_handler($xml_parser, 
externalEntityRefHandler);

  // Parse the XML data.
  // open XML file
   if (!($fp = fopen(test.xml, r)))
   {
 die(Cannot locate XML data file);
   }

  // read and parse data
  while ($data = fread($fp, 4096))
  {
echo br.$data.hr;
if (!xml_parse($xml_parser, $data, feof($fp))) {
 echo XML error in given {$data} on line .
  xml_get_current_line_number($xml_parser) .
 '  column ' . xml_get_current_column_number($xml_parser) .
 '. Reason: ' .
 xml_error_string(xml_get_error_code($xml_parser));
}
  }

--- End Code ---

--- text.xml ---
?xml version=1.0 standalone=no?
!DOCTYPE DOCUMENT [
  !ENTITY % ISOlat1 PUBLIC -//W3C//ENTITIES Latin 1 for XHTML//EN

http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent;
   %ISOlat1;
]
DOCUMENT
  TITLEDas Hildebrandslied, circa 775 C.E. /TITLE
  LINEIk gihocirc;rta dhat seggen,/LINE
  LINEdhat sih urhecirc;ttun aelig;non muoticirc;n,/LINE
  LINEHiltibrant enti Hadhubrant untar heriun tuecirc;m.
  /LINE

  LINEsunufatarungo: iro saro rihtun,/LINE
  COMMENTI'll spare you the next 61 lines/COMMENT
/DOCUMENT
--- End test.xml ---

The output I get is :

 %ISOlat1; ]  Ik gihôrta dhat seggen,  dhat sih urhêttun ænon muotîn, 
 Hiltibrant enti Hadhubrant untar heriun tuêm.  sunufatarungo: iro saro 
rihtun,  I'll spare you the next 61 lines [DOCUMENT]
Handling characterdata: ' '
Handling characterdata: ' '
[TITLE]
Handling characterdata: 'Das Hildebrandslied, circa 775 C.E. '
[/TITLE]
Handling characterdata: ' '
Handling characterdata: ' '
[LINE]
Handling characterdata: 'Ik gih'
Handling characterdata: 'rta dhat seggen,'
[/LINE]
Handling characterdata: ' '
Handling characterdata: ' '
[LINE]
Handling characterdata: 'dhat sih urh'
Handling characterdata: 'ttun '
Handling characterdata: 'non muot'
Handling characterdata: 'n,'
[/LINE]
Handling characterdata: ' '
Handling characterdata: ' '
[LINE]
Handling characterdata: 'Hiltibrant enti Hadhubrant untar heriun tu'
Handling characterdata: 'm. '
Handling characterdata: ' '
Handling characterdata: ' '
[/LINE]
Handling characterdata: ' '
Handling characterdata: ' '
Handling characterdata: ' '
[LINE]
Handling characterdata: 'sunufatarungo: iro saro rihtun,'
[/LINE]
Handling characterdata: ' '
Handling characterdata: ' '
[COMMENT]
Handling characterdata: 'I'll spare you the next 61 lines'
[/COMMENT]
Handling characterdata: ' '
[/DOCUMENT]

As you can see, all the HTML entities are dissapeard ???

What am I doing wrong ?

Regards,

Sandy



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



[PHP] session cookie that never expires

2003-02-17 Thread Altug Sahin
Hi there,

I have setup a site with session management but even the browser is closed
or after the default time expiration of the session, the user should be able
to see his/her personalized settings. I am nor using any cookies.

How can I make this happen without changing my session related code? Should
I combine cookies with sessions or can I make my sessions never expire even
the browser is closed?

Thanks
-Al



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




[PHP] Does ZEND studio has secure FTP?

2003-02-17 Thread Hardik Doshi
Hi Everyone,

Does zend studio has Secure FTP feature? I am not able
to find information from Zend website.

thanks 

Hardik

__
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day
http://shopping.yahoo.com

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




Re: [PHP] register_globals On

2003-02-17 Thread Jonathan Pitcher
Sam,

The register_globals can be dangerous to turn on but it really depends 
on the quality of code that the shopping cart was written.  See 
Examples below for explanation.


Say you had a script that looked like this.


?PHP

	$Q = Select * from Stored CreditCards where User='$User';
	. Retrive info from DB
	. Charge Credit Card
	. Do Other Stuff.

?

With register_globals = on the I could do the following to the URL and 
force the systsem to bill someone else.

chargecredit.php?User=Joe

Basically if register_globals = off protects you from that type of URL 
hacking.

It just depends on how it is written and how thought out the shopping 
cart script is.

Hope this helped.

Jonathan Pitcher

On Monday, February 17, 2003, at 07:09  AM, Sam wrote:


I'm thinking of running a shopping cart package (osCommerce) that 
requires
register_globals to be enabled. With all the warnings about security 
with
register_globals enabled I'm worried.

How dangerous is it?


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




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




[PHP] Problem creating array from MySql query

2003-02-17 Thread Janyne Kizer
What we are trying to do is build an array from a query.  I don't
understand why but this is failing on the line $affiliations[] =
$affiliation_row[affiliation];  Basically there are two tables in the
database, since clubs can have multiple affiliations and the
affiliations are not set in stone, there is one table only for
affiliations.  We are trying to pull the data out of the table for
editing.  Any tips would be appreciated.  Thanks!

$affiliation_result = mysql_query(SELECT affiliation FROM
club_affiliations WHERE club_id=$id);

$affiliations = array();

 print Populating array...;
 //place affiliation data into an array that we can search later
 while($affiliation_row = mysql_fetch_array($affiliation_result)) {
  print $affiliation_row[affiliation];
  $affiliations[] = $affiliation_row[affiliation];
 }  //while


-- 
Janyne Kizer

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




RE: [PHP] anyone know what ical and outlook are programmed in?

2003-02-17 Thread acleave
If you really want to know I can ask a friend of mine that worked with the 
person who wrote Outlook (MS didn't come up with Outlook, an engineer of 
thiers had already written it on his own and when they saw it they decided to 
add it to their line).

Let me know in private if it really matters.  I imagine C or C++ (it predates 
VC, I think) but the current Outlook might have been converted to another 
language in any number of ways.  Such as upgrading C/C++ code to VC.

-Original Message-
From: Kevin Myrick [mailto:[EMAIL PROTECTED]]
Sent: Monday, 17 February 2003 2:27 PM
To:
Subject: [PHP] anyone know what ical and outlook are programmed in?


Hey all,

I was wondering if anyone could tell me what iCal and
Outlook are programmed in offhand. I have an ambitious
but probably not so thought out plan on builing some
mods for phpwebsite based off of phprojekt,
squirrelmail, myphpcalendar, and was thinking I would
write my own address book, but will probably use the
one built into projekt.

This info will help me greatly, because I'll write
files that will pass the address book and schedule
info from Outlook, and just the schedule infor from
iCal, onto my system (if it is even possible...)

Thanks,
Kevin Myrick

PS- Where would I look to find the PEAR libs
documentation on what each function, in each file,
does. I plan on printing this out so I can take a clos
e look into designing my system... PEAR is used in the
new version of phpwebsite (currently 0.9.0RC4) and
wanted to use this common function system to do the
rest of the design for me.

=
Kevin Myrick
/etc/KevX45
http://www.ultimatealchemy.com
[EMAIL PROTECTED]
Screw you guys, I'm going home.-Eric Cartman, South Park
Ultimatealchemy Dotcom!

__
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day
http://shopping.yahoo.com

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

Allan Cleaveland
Webmaster and Computer Technician
Math Department
Univeristy of Arkansas


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




Re: [PHP] Problem creating array from MySql query

2003-02-17 Thread Rick Emery
It helps if you show us all your code, not just what you think we might need.

For isntance, what does your mysql_query() statement look like?  Does it have an or
die(mysql_error())) clause?

- Original Message -
From: Janyne Kizer [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, February 17, 2003 9:04 AM
Subject: [PHP] Problem creating array from MySql query


What we are trying to do is build an array from a query.  I don't
understand why but this is failing on the line $affiliations[] =
$affiliation_row[affiliation];  Basically there are two tables in the
database, since clubs can have multiple affiliations and the
affiliations are not set in stone, there is one table only for
affiliations.  We are trying to pull the data out of the table for
editing.  Any tips would be appreciated.  Thanks!

$affiliation_result = mysql_query(SELECT affiliation FROM
club_affiliations WHERE club_id=$id);

$affiliations = array();

 print Populating array...;
 //place affiliation data into an array that we can search later
 while($affiliation_row = mysql_fetch_array($affiliation_result)) {
  print $affiliation_row[affiliation];
  $affiliations[] = $affiliation_row[affiliation];
 }  //while


--
Janyne Kizer

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




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




[PHP] Multisorting an array

2003-02-17 Thread Joachim Krebs
I have an array with the following structure:

Array
(
[0] = Array
(
[name] = images
[type] = dir
)

[1] = Array
(
[name] = includes
[type] = dir
)

[2] = Array
(
[name] = index.php
[type] = file
)

[3] = Array
(
[name] = index.tpl.php
[type] = file
)

[4] = Array
(
[name] = lib
[type] = dir
)
}

I want to array_multisort this array so it becomes sorted by type
first, and then by name. What are the arguments for the function in
this case?

Joachim



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




Re: [PHP] Problem creating array from MySql query

2003-02-17 Thread Janyne Kizer
Thanks for taking a look at this.  

?php

 mysql_connect (, , );
 mysql_select_db ();
 $result = mysql_query(SELECT * FROM clubs WHERE id=$id);
 $row = mysql_fetch_array($result);

 print Reading affiliations...;
 $affiliation_result = mysql_query(SELECT affiliation FROM
club_affiliations WHERE club_id=$id);

 print Building array...;
 $affiliations = array();

 print Populating array...;
 //place affiliation data into an array that we can search later
 while($affiliation_row = mysql_fetch_array($affiliation_result)) {
  print $affiliation_row[affiliation];
  $affiliations[] = $affiliation_row[affiliation];
 }  //while

 print Dumping array...;
 $count = count($affiliations);
 print Affiliations:;
 for ($i=0;i$count;$i++) {
  print $affiliations[$i];
 }
?

It does print the affiliations in print
$affiliation_row[affiliation]; and it works properly (except for
getting the affiliations field) if the line $affiliations[] =
$affiliation_row[affiliation]; is commented out.


Rick Emery wrote:
 
 It helps if you show us all your code, not just what you think we might need.
 
 For isntance, what does your mysql_query() statement look like?  Does it have an or
 die(mysql_error())) clause?
 
 - Original Message -
 From: Janyne Kizer [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Monday, February 17, 2003 9:04 AM
 Subject: [PHP] Problem creating array from MySql query
 
 What we are trying to do is build an array from a query.  I don't
 understand why but this is failing on the line $affiliations[] =
 $affiliation_row[affiliation];  Basically there are two tables in the
 database, since clubs can have multiple affiliations and the
 affiliations are not set in stone, there is one table only for
 affiliations.  We are trying to pull the data out of the table for
 editing.  Any tips would be appreciated.  Thanks!
 
 $affiliation_result = mysql_query(SELECT affiliation FROM
 club_affiliations WHERE club_id=$id);
 
 $affiliations = array();
 
  print Populating array...;
  //place affiliation data into an array that we can search later
  while($affiliation_row = mysql_fetch_array($affiliation_result)) {
   print $affiliation_row[affiliation];
   $affiliations[] = $affiliation_row[affiliation];
  }  //while
 
 --
 Janyne Kizer


-- 
Janyne Kizer
CNE-3, CNE-4, CNE-5
Systems Programmer Administrator I
NC State University, College of Agriculture  Life Sciences
Extension and Administrative Technology Services

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




Re: [PHP] Problem creating array from MySql query

2003-02-17 Thread Rick Emery
where is $id set in (SELECT affiliation FROM club_affiliations WHERE club_id=$id)

Also, change to:
$query = (SELECT affiliation FROM club_affiliations WHERE club_id=$id;
$affiliation_result = mysql_query($query) or die(mysql_error());

The above will help identify bad queries.

rick
People will forget what you said. People will forget what you did.
But people will never forget how you made them feel.
- Original Message - 
From: Janyne Kizer [EMAIL PROTECTED]
To: Rick Emery [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Monday, February 17, 2003 9:31 AM
Subject: Re: [PHP] Problem creating array from MySql query


Thanks for taking a look at this.  

?php

 mysql_connect (, , );
 mysql_select_db ();
 $result = mysql_query(SELECT * FROM clubs WHERE id=$id);
 $row = mysql_fetch_array($result);

 print Reading affiliations...;
 $affiliation_result = mysql_query(SELECT affiliation FROM
club_affiliations WHERE club_id=$id);

 print Building array...;
 $affiliations = array();

 print Populating array...;
 //place affiliation data into an array that we can search later
 while($affiliation_row = mysql_fetch_array($affiliation_result)) {
  print $affiliation_row[affiliation];
  $affiliations[] = $affiliation_row[affiliation];
 }  //while

 print Dumping array...;
 $count = count($affiliations);
 print Affiliations:;
 for ($i=0;i$count;$i++) {
  print $affiliations[$i];
 }
?

It does print the affiliations in print
$affiliation_row[affiliation]; and it works properly (except for
getting the affiliations field) if the line $affiliations[] =
$affiliation_row[affiliation]; is commented out.


Rick Emery wrote:
 
 It helps if you show us all your code, not just what you think we might need.
 
 For isntance, what does your mysql_query() statement look like?  Does it have an or
 die(mysql_error())) clause?
 
 - Original Message -
 From: Janyne Kizer [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Monday, February 17, 2003 9:04 AM
 Subject: [PHP] Problem creating array from MySql query
 
 What we are trying to do is build an array from a query.  I don't
 understand why but this is failing on the line $affiliations[] =
 $affiliation_row[affiliation];  Basically there are two tables in the
 database, since clubs can have multiple affiliations and the
 affiliations are not set in stone, there is one table only for
 affiliations.  We are trying to pull the data out of the table for
 editing.  Any tips would be appreciated.  Thanks!
 
 $affiliation_result = mysql_query(SELECT affiliation FROM
 club_affiliations WHERE club_id=$id);
 
 $affiliations = array();
 
  print Populating array...;
  //place affiliation data into an array that we can search later
  while($affiliation_row = mysql_fetch_array($affiliation_result)) {
   print $affiliation_row[affiliation];
   $affiliations[] = $affiliation_row[affiliation];
  }  //while
 
 --
 Janyne Kizer


-- 
Janyne Kizer
CNE-3, CNE-4, CNE-5
Systems Programmer Administrator I
NC State University, College of Agriculture  Life Sciences
Extension and Administrative Technology Services

-- 
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] Problem creating array from MySql query

2003-02-17 Thread Janyne Kizer


Rick Emery wrote:
 
 where is $id set in (SELECT affiliation FROM club_affiliations WHERE club_id=$id)

The $id comes in from a link and it is the row ID.

 Also, change to:
 $query = (SELECT affiliation FROM club_affiliations WHERE club_id=$id;
 $affiliation_result = mysql_query($query) or die(mysql_error());

Thank you for the suggestion.  Since the line
print $affiliation_row[affiliation];

Does work, I do not think that it is a bad query in this case but you
are correct, I should clean up that section.  Thanks!

 
 The above will help identify bad queries.
 
 rick
 People will forget what you said. People will forget what you did.
 But people will never forget how you made them feel.
 - Original Message -
 From: Janyne Kizer [EMAIL PROTECTED]
 To: Rick Emery [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Monday, February 17, 2003 9:31 AM
 Subject: Re: [PHP] Problem creating array from MySql query
 
 Thanks for taking a look at this.
 
 ?php
 
  mysql_connect (, , );
  mysql_select_db ();
  $result = mysql_query(SELECT * FROM clubs WHERE id=$id);
  $row = mysql_fetch_array($result);
 
  print Reading affiliations...;
  $affiliation_result = mysql_query(SELECT affiliation FROM
 club_affiliations WHERE club_id=$id);
 
  print Building array...;
  $affiliations = array();
 
  print Populating array...;
  //place affiliation data into an array that we can search later
  while($affiliation_row = mysql_fetch_array($affiliation_result)) {
   print $affiliation_row[affiliation];
   $affiliations[] = $affiliation_row[affiliation];
  }  //while
 
  print Dumping array...;
  $count = count($affiliations);
  print Affiliations:;
  for ($i=0;i$count;$i++) {
   print $affiliations[$i];
  }
 ?
 
 It does print the affiliations in print
 $affiliation_row[affiliation]; and it works properly (except for
 getting the affiliations field) if the line $affiliations[] =
 $affiliation_row[affiliation]; is commented out.
 
 Rick Emery wrote:
 
  It helps if you show us all your code, not just what you think we might need.
 
  For isntance, what does your mysql_query() statement look like?  Does it have an 
or
  die(mysql_error())) clause?
 
  - Original Message -
  From: Janyne Kizer [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Monday, February 17, 2003 9:04 AM
  Subject: [PHP] Problem creating array from MySql query
 
  What we are trying to do is build an array from a query.  I don't
  understand why but this is failing on the line $affiliations[] =
  $affiliation_row[affiliation];  Basically there are two tables in the
  database, since clubs can have multiple affiliations and the
  affiliations are not set in stone, there is one table only for
  affiliations.  We are trying to pull the data out of the table for
  editing.  Any tips would be appreciated.  Thanks!
 
  $affiliation_result = mysql_query(SELECT affiliation FROM
  club_affiliations WHERE club_id=$id);
 
  $affiliations = array();
 
   print Populating array...;
   //place affiliation data into an array that we can search later
   while($affiliation_row = mysql_fetch_array($affiliation_result)) {
print $affiliation_row[affiliation];
$affiliations[] = $affiliation_row[affiliation];
   }  //while
 
  --
  Janyne Kizer
 
 --
 Janyne Kizer
 CNE-3, CNE-4, CNE-5
 Systems Programmer Administrator I
 NC State University, College of Agriculture  Life Sciences
 Extension and Administrative Technology Services
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php

-- 
Janyne Kizer
CNE-3, CNE-4, CNE-5
Systems Programmer Administrator I
NC State University, College of Agriculture  Life Sciences
Extension and Administrative Technology Services

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




Re: [PHP] Problem creating array from MySql query

2003-02-17 Thread Rick Emery
If you have to comment out $affiliations[] = $affiliation_row[affiliation];, tghen 
it's not
working, because this is the crux of your algorithm.

What error are you getting?

rick
People will forget what you said. People will forget what you did.
But people will never forget how you made them feel.
- Original Message -
From: Janyne Kizer [EMAIL PROTECTED]
To: Rick Emery [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Monday, February 17, 2003 9:31 AM
Subject: Re: [PHP] Problem creating array from MySql query


Thanks for taking a look at this.

?php

 mysql_connect (, , );
 mysql_select_db ();
 $result = mysql_query(SELECT * FROM clubs WHERE id=$id);
 $row = mysql_fetch_array($result);

 print Reading affiliations...;
 $affiliation_result = mysql_query(SELECT affiliation FROM
club_affiliations WHERE club_id=$id);

 print Building array...;
 $affiliations = array();

 print Populating array...;
 //place affiliation data into an array that we can search later
 while($affiliation_row = mysql_fetch_array($affiliation_result)) {
  print $affiliation_row[affiliation];
  $affiliations[] = $affiliation_row[affiliation];
 }  //while

 print Dumping array...;
 $count = count($affiliations);
 print Affiliations:;
 for ($i=0;i$count;$i++) {
  print $affiliations[$i];
 }
?

It does print the affiliations in print
$affiliation_row[affiliation]; and it works properly (except for
getting the affiliations field) if the line $affiliations[] =
$affiliation_row[affiliation]; is commented out.


Rick Emery wrote:

 It helps if you show us all your code, not just what you think we might need.

 For isntance, what does your mysql_query() statement look like?  Does it have an or
 die(mysql_error())) clause?

 - Original Message -
 From: Janyne Kizer [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Monday, February 17, 2003 9:04 AM
 Subject: [PHP] Problem creating array from MySql query

 What we are trying to do is build an array from a query.  I don't
 understand why but this is failing on the line $affiliations[] =
 $affiliation_row[affiliation];  Basically there are two tables in the
 database, since clubs can have multiple affiliations and the
 affiliations are not set in stone, there is one table only for
 affiliations.  We are trying to pull the data out of the table for
 editing.  Any tips would be appreciated.  Thanks!

 $affiliation_result = mysql_query(SELECT affiliation FROM
 club_affiliations WHERE club_id=$id);

 $affiliations = array();

  print Populating array...;
  //place affiliation data into an array that we can search later
  while($affiliation_row = mysql_fetch_array($affiliation_result)) {
   print $affiliation_row[affiliation];
   $affiliations[] = $affiliation_row[affiliation];
  }  //while

 --
 Janyne Kizer


--
Janyne Kizer
CNE-3, CNE-4, CNE-5
Systems Programmer Administrator I
NC State University, College of Agriculture  Life Sciences
Extension and Administrative Technology Services

--
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] Problem creating array from MySql query

2003-02-17 Thread Janyne Kizer
No error.  It just times out.

Rick Emery wrote:
 
 If you have to comment out $affiliations[] = $affiliation_row[affiliation];, 
tghen it's not
 working, because this is the crux of your algorithm.
 
 What error are you getting?
 
 rick
 People will forget what you said. People will forget what you did.
 But people will never forget how you made them feel.
 - Original Message -
 From: Janyne Kizer [EMAIL PROTECTED]
 To: Rick Emery [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Monday, February 17, 2003 9:31 AM
 Subject: Re: [PHP] Problem creating array from MySql query
 
 Thanks for taking a look at this.
 
 ?php
 
  mysql_connect (, , );
  mysql_select_db ();
  $result = mysql_query(SELECT * FROM clubs WHERE id=$id);
  $row = mysql_fetch_array($result);
 
  print Reading affiliations...;
  $affiliation_result = mysql_query(SELECT affiliation FROM
 club_affiliations WHERE club_id=$id);
 
  print Building array...;
  $affiliations = array();
 
  print Populating array...;
  //place affiliation data into an array that we can search later
  while($affiliation_row = mysql_fetch_array($affiliation_result)) {
   print $affiliation_row[affiliation];
   $affiliations[] = $affiliation_row[affiliation];
  }  //while
 
  print Dumping array...;
  $count = count($affiliations);
  print Affiliations:;
  for ($i=0;i$count;$i++) {
   print $affiliations[$i];
  }
 ?
 
 It does print the affiliations in print
 $affiliation_row[affiliation]; and it works properly (except for
 getting the affiliations field) if the line $affiliations[] =
 $affiliation_row[affiliation]; is commented out.
 
 Rick Emery wrote:
 
  It helps if you show us all your code, not just what you think we might need.
 
  For isntance, what does your mysql_query() statement look like?  Does it have an 
or
  die(mysql_error())) clause?
 
  - Original Message -
  From: Janyne Kizer [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Monday, February 17, 2003 9:04 AM
  Subject: [PHP] Problem creating array from MySql query
 
  What we are trying to do is build an array from a query.  I don't
  understand why but this is failing on the line $affiliations[] =
  $affiliation_row[affiliation];  Basically there are two tables in the
  database, since clubs can have multiple affiliations and the
  affiliations are not set in stone, there is one table only for
  affiliations.  We are trying to pull the data out of the table for
  editing.  Any tips would be appreciated.  Thanks!
 
  $affiliation_result = mysql_query(SELECT affiliation FROM
  club_affiliations WHERE club_id=$id);
 
  $affiliations = array();
 
   print Populating array...;
   //place affiliation data into an array that we can search later
   while($affiliation_row = mysql_fetch_array($affiliation_result)) {
print $affiliation_row[affiliation];
$affiliations[] = $affiliation_row[affiliation];
   }  //while
 
  --
  Janyne Kizer
 
 --
 Janyne Kizer
 CNE-3, CNE-4, CNE-5
 Systems Programmer Administrator I
 NC State University, College of Agriculture  Life Sciences
 Extension and Administrative Technology Services
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php

-- 
Janyne Kizer
CNE-3, CNE-4, CNE-5
Systems Programmer Administrator I
NC State University, College of Agriculture  Life Sciences
Extension and Administrative Technology Services

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




[PHP] Re: Removing a comma from a form field

2003-02-17 Thread Eric Golpe
Just a thought.. If it is only a comma, and it is a form field, why do this
on the server side,

Perhaps a javascript onsubmit function that traps the comma (indexOf/charAt)
and then shift the

values over with substring. Since you know it's USD then you could do
value.length-3 or something similar.

You can also use the sprintf() function of php to keep the decimal places.

Have fun!

Ben C . [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I'm trying to update a field which contains a $USD figure.  But when I
update it as 200,000 it become 200.  I need to take out the comma.  Is using
ereg_replace function the best way of doing so?  What do you think.

 Thanks,

 Ben




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




Re: [PHP] Problem creating array from MySql query

2003-02-17 Thread Rick Emery
what times out?  The query? 

rick
People will forget what you said. People will forget what you did.
But people will never forget how you made them feel.
- Original Message - 
From: Janyne Kizer [EMAIL PROTECTED]
To: Rick Emery [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Monday, February 17, 2003 9:51 AM
Subject: Re: [PHP] Problem creating array from MySql query


No error.  It just times out.




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




Re: [PHP] Problem creating array from MySql query

2003-02-17 Thread Janyne Kizer
I'm not sure.  It sits and spins.  If I go to view - source that
doesn't yield any additional information.  We are trying to build the
array and then use in_array to handle the data appropriately.

Rick Emery wrote:
 
 what times out?  The query?
 
 rick
 People will forget what you said. People will forget what you did.
 But people will never forget how you made them feel.
 - Original Message -
 From: Janyne Kizer [EMAIL PROTECTED]
 To: Rick Emery [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Monday, February 17, 2003 9:51 AM
 Subject: Re: [PHP] Problem creating array from MySql query
 
 No error.  It just times out.

-- 
Janyne Kizer
CNE-3, CNE-4, CNE-5
Systems Programmer Administrator I
NC State University, College of Agriculture  Life Sciences
Extension and Administrative Technology Services

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




Re: [PHP] Problem creating array from MySql query

2003-02-17 Thread Leif K-Brooks
I believe I've spotted your problem:

for ($i=0;   i $count;$i++) {

You left the $ out.  It's looking for a constant named i, which doesn't 
exist.

Janyne Kizer wrote:

I'm not sure.  It sits and spins.  If I go to view - source that
doesn't yield any additional information.  We are trying to build the
array and then use in_array to handle the data appropriately.

Rick Emery wrote:
 

what times out?  The query?

rick
People will forget what you said. People will forget what you did.
But people will never forget how you made them feel.
- Original Message -
From: Janyne Kizer [EMAIL PROTECTED]
To: Rick Emery [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Monday, February 17, 2003 9:51 AM
Subject: Re: [PHP] Problem creating array from MySql query

No error.  It just times out.
   


 


--
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.





[PHP] **need info ASAP - displaying existing pdf files and other 'tricks'

2003-02-17 Thread Erin Fry
Hey there.
 
I want to display an existing pdf file.  However, I have a variable that is passed 
that will determine where I want the pdf file to ‘begin’.  For example, if the value 
of the variable passed is ‘B’ then I want the entire pdf file to be displayed with pg. 
75 in the immediate viewing screen.
 
I’ve found a lot of information on creating pdf files which obviously doesn’t help 
with what I want to do.  If you have any ideas, information (links, references) I 
would greatly appreciate it.
 
Thanks.
 
Erin

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.449 / Virus Database: 251 - Release Date: 1/27/2003
 



[PHP] MD5 login troubles

2003-02-17 Thread Vernon
Hey all,

I'm using the following code to save an MD5 password into a database along
with an unencrypted username and email address:

$insertSQL = sprintf(INSERT INTO penpals (email, password, username) VALUES
(%s, MD5(%s), %s),

All seems to have worked well, the password is encrypted and so forth. I
have also attempted to use the following MySQL command to encrypt the
password and came up with the same result:

UPDATE penpals SET password = MD5(password) WHERE ID = 1

So the trouble seems to be with the login where I am using the following
code:

SELECT email, password, access FROM penpals WHERE email= '%s' AND password =
MD5('%s')

Am I missing something here? Am I some how double encrypting the password?
Is there a de-encrypt function or something I'm missing?

Thanks



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




[PHP] check if a file has already be included

2003-02-17 Thread Greg
Is there any way to check if a file has been included / required already,
and if not include / require it?
Thanks!
-Greg



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




Fw: [PHP] MD5 login troubles

2003-02-17 Thread Rick Emery
Make it easy on yourself:

$pw = md5($password);
$query = INSERT INTO penpals (email, password, username) VALUES 
\$email\,\$pw\,\$username\);
mysql_query($query);

$pw = md5($password);
$query = SELECT email,password,username FROM penpals WHERE email=\$email\  
password=\$pw\;
$result = mysql_query($query) or die(mysql_error());

rick
People will forget what you said. People will forget what you did.
But people will never forget how you made them feel.
- Original Message -
From: Vernon [EMAIL PROTECTED]
To: 
Sent: Monday, February 17, 2003 10:16 AM
Subject: [PHP] MD5 login troubles


Hey all,

I'm using the following code to save an MD5 password into a database along
with an unencrypted username and email address:

$insertSQL = sprintf(INSERT INTO penpals (email, password, username) VALUES
(%s, MD5(%s), %s),

All seems to have worked well, the password is encrypted and so forth. I
have also attempted to use the following MySQL command to encrypt the
password and came up with the same result:

UPDATE penpals SET password = MD5(password) WHERE ID = 1

So the trouble seems to be with the login where I am using the following
code:

SELECT email, password, access FROM penpals WHERE email= '%s' AND password =
MD5('%s')

Am I missing something here? Am I some how double encrypting the password?
Is there a de-encrypt function or something I'm missing?

Thanks



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




Fw: [PHP] check if a file has already be included

2003-02-17 Thread Rick Emery
can you use:   include_once(filename);

This way, if it wasn't included, it will be.  If it was included, this statement is 
ignored.
- Original Message - 
From: Greg [EMAIL PROTECTED]
To: 
Sent: Monday, February 17, 2003 10:18 AM
Subject: [PHP] check if a file has already be included


Is there any way to check if a file has been included / required already,
and if not include / require it?
Thanks!
-Greg



-- 
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] check if a file has already be included

2003-02-17 Thread Greg
Thanks, forgot about that :)  I'm a converted ASP programmer...ASP has no
such ability.
-Greg

Rick Emery [EMAIL PROTECTED] wrote in message
013b01c2d6a1$2a599d70$0500a8c0@honeybee">news:013b01c2d6a1$2a599d70$0500a8c0@honeybee...
 can you use:   include_once(filename);

 This way, if it wasn't included, it will be.  If it was included, this
statement is ignored.
 - Original Message -
 From: Greg [EMAIL PROTECTED]
 To: 
 Sent: Monday, February 17, 2003 10:18 AM
 Subject: [PHP] check if a file has already be included


 Is there any way to check if a file has been included / required already,
 and if not include / require it?
 Thanks!
 -Greg



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






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




[PHP] MD5 Passwords (How it works?)

2003-02-17 Thread Vernon
I'm thinking that the MD5 function more than likely encrypts a password to
store into a database, and when you log in using the MD5 function it will
simply encrypt the value being passed along again the same way. Now I'm
wondering what happens when I user has lost there password and needs to
retrieve it, there is no way to reverse the process is there?

Thanks



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




Re: [PHP] MD5 Passwords (How it works?)

2003-02-17 Thread Greg Donald
On Mon, 17 Feb 2003, Vernon wrote:

I'm thinking that the MD5 function more than likely encrypts a password to
store into a database, and when you log in using the MD5 function it will
simply encrypt the value being passed along again the same way. Now I'm
wondering what happens when I user has lost there password and needs to
retrieve it, there is no way to reverse the process is there?

md5 is one-way encryption.  I use a password 'hint' field in conjunction 
with md5.


-- 
Greg Donald
http://destiney.com


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




Re: [PHP] MD5 Passwords (How it works?)

2003-02-17 Thread Leif K-Brooks
No, it's not reversable.  When a user loses their password, you must 
generate a new one.  To stop malicious users from requesting a new 
password for a user they dislike with a program (and stopping the user 
from logging in, since their password keeps changing), a link with a 
random code is sent to their email.  The password is only changed when 
they visit the link, with the random code being correct.

Vernon wrote:

I'm thinking that the MD5 function more than likely encrypts a password to
store into a database, and when you log in using the MD5 function it will
simply encrypt the value being passed along again the same way. Now I'm
wondering what happens when I user has lost there password and needs to
retrieve it, there is no way to reverse the process is there?

Thanks



 


--
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.




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




[PHP] select query question

2003-02-17 Thread Sunfire
hi i have a select query i need to do on a field in my table.. the field is
called Flags and there is 1 char for every flag that is set for a certain
group..
the flags are F S L C G R now what i want to do is search for every instance
of Flags field that has any value except L and C in it and select those
fields..

so the result would be every record that doesnt have L and C in the Flags
field would be selected.. dont know how to do this query i thought it might
be something like this:

mysql_query(select * from members where Flags not like '%l%c%'); but not
really sure.. i know to use the not like statement but its just figuring out
what search pattern to use...

tnx




---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.443 / Virus Database: 248 - Release Date: 1/10/2003


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




[PHP] PHP Compile question ....

2003-02-17 Thread James Hatridge

Hi all...

I just compiled PHP from source for the first time. It works, but not like I 
want it to. I need it to work with Mysql, do graphs, and let me run programs 
(ie safe-mode is off). Also the odd thing is that before I compiled my own 
PHP I could access all my mysql databases. Now I can only access in a read 
only mode. When I try to do any type of update I get either a blank screen or 
PHP says that the DB is not there. I am able to access all my DBs at the 
mysql command line without problem. 

I think that my problems are with the options when I compile PHP. Can someone 
give me an example of the options I need to make this work? 

Thanks

JIM
-- 
Jim Hatridge
Linux User #88484
--
 BayerWulf
   Linux System # 129656
 The Recycled Beowulf Project
  Looking for throw-away or obsolete computers and parts
   to recycle into a Linux super computer


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




Re: [PHP] RSA implementation

2003-02-17 Thread José León Serna
El lun, 17-02-2003 a las 15:33, Jason Sheets escribió:
 If all you are doing is trying to allow a user to change their password
 you do not need decryption, all you need to do is md5 the new password
 and update the database.
And what happens if this MD5 is sniffed? Any one can make a POST again
the login script and authenticate. I don't use SSL, due hardware
restrictions, it's a lightweight server and I need log this way:

-I generate the login script with a random key
-When the user submits the form, the password is encrypted using
javascript this way: sent_pass=md5(entered_pass+random_key).
-This random key is stored on the server, so I can md5 again with the
plain text user password and the random key to authenticate. In any
case (ok or not) I regenerate the random key, so this data is sniffed,
it's not useful

Now I want to enable the user change the password, so I need decription
on the sever, because I need to know the password in plain text.

Regards.



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




Re: [PHP] browser identification problem

2003-02-17 Thread chip . wiegand
Jason Wong [EMAIL PROTECTED] wrote on 02/14/2003 10:08:45 PM:

 On Saturday 15 February 2003 05:01, [EMAIL PROTECTED] wrote:
  I have an ecommerce app (MAS200 eBusiness Manager) that works. I am
  updating my
  web site to php frames. Now when I want to connect to the eBusiness
  Manager server
 
 Presumably you mean connect to that app with some php code?

On my web page is a link to another server, just a simple url link.
The existing pages are .php pages.

  I get this error:
 
  Unsupported Browser
  The browser you are using (PHP/4.2.3) is currently unsupported. Please
  update your browser to the most current level.
 
 
  This happens regardless of the browser I am using. How can I get this 
to
  send the actual browser info, not this php info in its place?
 
 The error comes from some php code accessing that app and has nothing to 
do 
 with whatever browser you're using.
 
I have had the existing .php pages accessing the other server for a couple
years now with no problems. Only differance is the new page that has the 
link
is frames. I don't know why that would make a differance though.

 Find out what browsers that app is satisfied with,

5.0 and higher browsers.

 then set 'user_agent' in 
 php.ini to match that of one of the compatible browsers.

I don't see any user_agent entry in my php.ini file. I did a search on the
php.net site and didn't find any info on this. What would be the proper 
way
to set this in php.ini, and in which section of php.ini?
Thanks,
--
Chip
 
 -- 
 Jason Wong - Gremlins Associates - www.gremlins.biz
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *
 --
 Search the list archives before you post
 http://marc.theaimsgroup.com/?l=php-general
 --
 /*
 The Usenet news is out of date
 */
 
 
 -- 
 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 Compile question ....

2003-02-17 Thread Mat Harris
i like to use to following with php 4.3.0. Note the $APACHE_PREFIX should be
changed:

./configure --prefix=/usr --with-apxs=$APACHE_PREFIX/bin/apxs --enable-debug=no 
--enable-safe-mode --with-mysql=/usr --with-regex=system --with-xml --with-imap 
--with-snmp --with-kerberos --with-imap-ssl --with-openssl --with-bz2 --with-db3 
--with-curl --with-png-dir=/usr --with-gd --with-gdbm --with-gettext --with-ncurses 
--with-jpeg-dir=/usr --with-mm --with-png --with-pspell --with-zlib --enable-ftp 
--enable-sockets --enable-track-vars --enable-trans-sid --enable-yp 
--enable-memory-limit --enable-calendar --enable-dbx

On Mon, Feb 17, 2003 at 05:02:00 +0100, James Hatridge wrote:
 
 Hi all...
 
 I just compiled PHP from source for the first time. It works, but not like I 
 want it to. I need it to work with Mysql, do graphs, and let me run programs 
 (ie safe-mode is off). Also the odd thing is that before I compiled my own 
 PHP I could access all my mysql databases. Now I can only access in a read 
 only mode. When I try to do any type of update I get either a blank screen or 
 PHP says that the DB is not there. I am able to access all my DBs at the 
 mysql command line without problem. 
 
 I think that my problems are with the options when I compile PHP. Can someone 
 give me an example of the options I need to make this work? 
 
 Thanks
 
 JIM
 -- 
 Jim Hatridge
 Linux User #88484
 --
  BayerWulf
Linux System # 129656
  The Recycled Beowulf Project
   Looking for throw-away or obsolete computers and parts
to recycle into a Linux super computer
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php

-- 
Mat Harris  OpenGPG Public Key ID: C37D57D9
[EMAIL PROTECTED]www.genestate.com   



msg97218/pgp0.pgp
Description: PGP signature


Re: [PHP] browser identification problem

2003-02-17 Thread chip . wiegand
Chris Shiflett [EMAIL PROTECTED] wrote on 02/14/2003 02:47:43 PM:

 --- [EMAIL PROTECTED] wrote:
  I have an ecommerce app (MAS200 eBusiness Manager) that works. I am 
  updating my web site to php frames.
 
 There is no such thing. Perhaps you mean HTML frames?

Take a look at this web site -
http://www.phpbeginner.com/columns/mark/frames
 
--
Chip

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




[PHP] emptying jammed mailbox by PHP?

2003-02-17 Thread Chris Hayes
hi,
maybe not the most professional way but my mailbox is jammed and i want to 
clear it. My ISP host is doing some office refurnishing and needs all his 
attention to pick the right color hues.
So i thought maybe i can send a simple POP command to delete all mails in 
the mailbox? It's 14000 mails since last thursday!
Maybe using mr Lemos' POP script class?

My email client eudora complains it cannot get a 'lock'- mailbox in use. 
This can be the mail subsystem thingy keeping sending itself a warning 
email. Ideas?

BTW PHP on the server is running in safe mode,
Chris
 


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



Re: [PHP] select query question

2003-02-17 Thread Rick Emery
SELECT * FROM mytable WHERE flags NOT IN('L','C')

rick
People will forget what you said. People will forget what you did.
But people will never forget how you made them feel.
- Original Message - 
From: Sunfire [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, February 17, 2003 11:19 AM
Subject: [PHP] select query question


hi i have a select query i need to do on a field in my table.. the field is
called Flags and there is 1 char for every flag that is set for a certain
group..
the flags are F S L C G R now what i want to do is search for every instance
of Flags field that has any value except L and C in it and select those
fields..

so the result would be every record that doesnt have L and C in the Flags
field would be selected.. dont know how to do this query i thought it might
be something like this:

mysql_query(select * from members where Flags not like '%l%c%'); but not
really sure.. i know to use the not like statement but its just figuring out
what search pattern to use...

tnx




---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.443 / Virus Database: 248 - Release Date: 1/10/2003


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




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




[PHP] mail function - using remote smtp in php.ini

2003-02-17 Thread Robin Mordasiewicz
IS there a way to tell php to use a remote smtp daemon for its mta under
UNIX. I see in the example it looks like windows can be configured to use
a remote smtp. If so what is the syntax.


[mail function]
; For Win32 only.
SMTP = localhost

; For Win32 only.
sendmail_from = [EMAIL PROTECTED]

; For Unix only.  You may supply arguments as well (default: sendmail -t
-i).
;sendmail_path =



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




[PHP] FTP not enabled in RedHat 7.x distro

2003-02-17 Thread role . php-general
Hi,

Installed RPM's from RedHat (latest patches) and using PHP with Apache
under RH7.1 Linux, lots of scripts, no problems.

The hitch is that a user just tried ftp_connect(), and got the
unknown function error.

Okay, so I expected this to be a missing php.so loadable module.
However, it appears more like an option --enable-ftp needs to be
specified at _compile time_ to get it working.

Is this really the case? Does RedHat _really_ not distribute with this
feature already on? Am I even barking up the right tree?!?

Many thanks in advance...


-- 
Best regards,
James.


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




Re: [PHP] FTP not enabled in RedHat 7.x distro

2003-02-17 Thread Rick Emery
I also use Redhat 7.1 and use FTP successfully.  Something in your setup?

rick
People will forget what you said. People will forget what you did.
But people will never forget how you made them feel.
- Original Message - 
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, February 17, 2003 11:44 AM
Subject: [PHP] FTP not enabled in RedHat 7.x distro


Hi,

Installed RPM's from RedHat (latest patches) and using PHP with Apache
under RH7.1 Linux, lots of scripts, no problems.

The hitch is that a user just tried ftp_connect(), and got the
unknown function error.

Okay, so I expected this to be a missing php.so loadable module.
However, it appears more like an option --enable-ftp needs to be
specified at _compile time_ to get it working.

Is this really the case? Does RedHat _really_ not distribute with this
feature already on? Am I even barking up the right tree?!?

Many thanks in advance...


-- 
Best regards,
James.


-- 
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] browser identification problem

2003-02-17 Thread chip . wiegand
Here's a bit more info - just for clarity and understanding of what's 
going on...
There are actually 3 server involved -
My current web site is hosted on my isp's server. 
I have another server here in my office which contains about a gigabyte of 
down-
loadable docs. 
And we have our ecommerce site, which is integrated into MAS200, our ERP
system.
On the original web site (on the isp's sever) are  links to the other two 
servers.
This is all fine. This system works, it's not the most efficient, but it 
works.
I am setting up a new server to host my web site, which will include the 
downloadable
docs (thus I will be removing that extra sever from all this), and will 
co-locate it at my
isp's office. (Rather than have them host my site on their server.)
Okay, so the web site on my new server is a mirror of the existing site on 
my isp's server.
That existing site has no problem linking to and logging into the remote 
ecommerce server.
But, my new server is the one with the problem. The isp's server is 
running php-4.2.2. Mine
is running 4.2.3.
So, the same web page can access the remote ecommerce server fine on the 
isp's system,
but not on mine. I have a call in to the isp's tech support, I'll try to 
get a copy of their php.ini
and find out what is differant between theirs and mine.
--
Chip

Jason Wong [EMAIL PROTECTED] wrote on 02/14/2003 10:08:45 PM:

 On Saturday 15 February 2003 05:01, [EMAIL PROTECTED] wrote:
  I have an ecommerce app (MAS200 eBusiness Manager) that works. I am
  updating my
  web site to php frames. Now when I want to connect to the eBusiness
  Manager server
 
 Presumably you mean connect to that app with some php code?
 
  I get this error:
 
  Unsupported Browser
  The browser you are using (PHP/4.2.3) is currently unsupported. Please
  update your browser to the most current level.
 
 
  This happens regardless of the browser I am using. How can I get this 
to
  send the actual browser info, not this php info in its place?
 
 The error comes from some php code accessing that app and has nothing to 
do 
 with whatever browser you're using.
 
 
 Find out what browsers that app is satisfied with, then set 'user_agent' 
in 
 php.ini to match that of one of the compatible browsers.
 
 -- 
 Jason Wong - Gremlins Associates - www.gremlins.biz
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *
 --
 Search the list archives before you post
 http://marc.theaimsgroup.com/?l=php-general
 --
 /*
 The Usenet news is out of date
 */
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 


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




Re[2]: [PHP] FTP not enabled in RedHat 7.x distro

2003-02-17 Thread role . php-general
Rick,

In response to your mail of Monday 17 February 2003 at 17:46:49:


Thanks for your swift response!


RE I also use Redhat 7.1 and use FTP successfully. Something in your
RE setup?

Well, I don't think so ... it's all fairly standard (only use RPM's)
and the function not found suggests the functionality just isn't
present. Do you have an FTP extension mentioned in your PHP.ini file?

The doc's aren't clear on this point ;)


-- 
Best regards,
James.


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




Re: [PHP] processing status page

2003-02-17 Thread Jeff Schwartz

Faking it with Javascript doesn't really work because the termination of the 
Javascript isn't tied to the completion of the processing. Here's how we're doing it 
for a new anti-spam product:

 

results.html

?php

if ($display):

// display results

else:

// save form info

header(Location: wait.php);

endif;

?

 

When the user is sent to results.html (the first time) it save the info and sends them 
to wait.php

 

wait.php

?php

if ($view):

echo centerP CLASS=titleChecking/P

BRembed width=125 height=25 src='images/progress_bar.swf'/center;

else:

echo html

FRAMESET rows='0,*' FRAMEBORDER=NO noresize

frame name=control src='processor.php' FRAMEBORDER=NO noresize

frame name=view src='$PHP_SELF?view=T'

/frameset

/html;

endif;

?

 

wait.php spawns 2 windows: One, which is invisible, runs your processing script and 
the other, a normal window, shows your animated “processing” gif.

 

processor.php

?php

// do all the processing

echo htmlbody 
onLoad=\top.location='results.html?any_info_to_pass_to_display_page';\/body/html;

?

 

processor.php does the actual work in its invisible window. When it’s finished, it 
loads the results page on top of the window which was displaying the “processing” 
info. 

 

If the results page needs only a little bit of info from the processing, and you don’t 
mind showing it, you can pass it via the URL. Or, you can store the info in a database 
table and have the results page access it from there.

 

Hope this helps,

 

Jeff



-
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day


[PHP] LDAP authentication to NDS

2003-02-17 Thread Brad Harriger
Is there any way to find out what privileges a user has to an NDS object 
throught LDAP?


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



Re: [PHP] RSA implementation

2003-02-17 Thread Matt Vos
I don't care what you say, all you need is Secure-Socket-Layer
contrary to what you may believe, you don't need a beefy server to implement
it. I had apache+ssl+php+mysql running quite well on a 486 DX4/100 with 64MB
ram.
Decrypting is worse than you think.
Anything you can decrypt, so can someone who is sniffing (with time). This
is why one-way hashes are used. MD5 is a one-way hash, i.e. it CANNOT be
read the other way (decrypted).
Aside from that, especially in regards to passwords, do not decrypt, EVER.
If security is that much of a concern that you need this functionality and
for some reason you can't run SSL, then upgrade the box (altho I don't think
you would really need to).

Matt
- Original Message -
From: José León Serna [EMAIL PROTECTED]
To: Jason Sheets [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Monday, February 17, 2003 12:13 PM
Subject: Re: [PHP] RSA implementation


El lun, 17-02-2003 a las 15:33, Jason Sheets escribió:
 If all you are doing is trying to allow a user to change their password
 you do not need decryption, all you need to do is md5 the new password
 and update the database.
And what happens if this MD5 is sniffed? Any one can make a POST again
the login script and authenticate. I don't use SSL, due hardware
restrictions, it's a lightweight server and I need log this way:

-I generate the login script with a random key
-When the user submits the form, the password is encrypted using
javascript this way: sent_pass=md5(entered_pass+random_key).
-This random key is stored on the server, so I can md5 again with the
plain text user password and the random key to authenticate. In any
case (ok or not) I regenerate the random key, so this data is sniffed,
it's not useful

Now I want to enable the user change the password, so I need decription
on the sever, because I need to know the password in plain text.

Regards.



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

2003-02-17 Thread David Eisenhart
yeh, I'd strongly agree with Jonathan's view that quality of the code can
mitigate against the dangers of register_globals.

FYI, an interesting article on php vulnerabilities is at:
http://www.securereality.com.au/studyinscarlet.txt

David Eisenhart


Jonathan Pitcher [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Sam,

 The register_globals can be dangerous to turn on but it really depends
 on the quality of code that the shopping cart was written.  See
 Examples below for explanation.


 Say you had a script that looked like this.


 ?PHP

 $Q = Select * from Stored CreditCards where User='$User';
 . Retrive info from DB
 . Charge Credit Card
 . Do Other Stuff.

 ?

 With register_globals = on the I could do the following to the URL and
 force the systsem to bill someone else.

 chargecredit.php?User=Joe

 Basically if register_globals = off protects you from that type of URL
 hacking.

 It just depends on how it is written and how thought out the shopping
 cart script is.

 Hope this helped.

 Jonathan Pitcher

 On Monday, February 17, 2003, at 07:09  AM, Sam wrote:

 
  I'm thinking of running a shopping cart package (osCommerce) that
  requires
  register_globals to be enabled. With all the warnings about security
  with
  register_globals enabled I'm worried.
 
  How dangerous is it?
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 




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




[PHP] RE: traversing and displaying directories in html [newbie]

2003-02-17 Thread Bobby Rahman



Hiya

I am trying to find a way to drill down on html file names, if there are 
directories to display the files in the new directory. Im assuming this 
needs the calling of the same page which displayed the intial file names 
again with the argument of new directory. Does anyone have any tips for me.

I can establish whether a file is an dir or not using is_dir...just not sure 
how to pass this new directory name and concatenate with the existing path 
to now show the file names in the new drill down directory.

(Also Im not sure if my a href statements are correct and wanted to know 
any good tutorials on string expressions?

So far I have knocked up this :

$start_dir = C:/Program Files/ApacheGroup/Apache2/cgi-bin/;
//default starting directory
if ($new_dir ==0)
//if new_dir is not set display files from start_dir
   {
		$current_dir = $start_dir;
   	}
   else
   {
	$current_dir = $start_dir.$new_dir;
	//if new_dir is set than the current directory becomes
   	//the starting directory and the new directory selected
	}

	$inside_dir = opendir($current_dir);
	//store contents of the file names in the current directory in $inside_dir

	echo Upload directory is $current_dirbr;
	echo Directory Listing:brhrbr;

   while  ($file = readdir($inside_dir))
	  if (is_dir($file))
	  	{
	echo a href=\displaydir.phpfile=
  .$file.\.$file./abr;

	  	}

	  	else
	{
 		echo a href=\openfile.php?
   file=.$file.\.$file./abr;
		}

	closedir($inside_dir);



_
It's fast, it's easy and it's free. Get MSN Messenger today! 
http://messenger.msn.co.uk


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



[PHP] Re: slideshow/flush

2003-02-17 Thread Joel Boonstra
Hi,

 I'm looking for a way to do something, not sure if someone can help me.

 I would like to be able to control, in a way, what a remote user is
 seeing, almost like running a slideshow.

 For example, user goes to website, it shows block of text or picture. I
 login to admin area.I click next or something, and it either advances to
 another page, or to another picture, and so on.

 I know you can kind of do a live output using flush, but what about
 forcing it to another page?

I don't think there's a way that you could force your server to push a
new page onto an end-user's browser.

However, you could replicate the behavior in a potentially annoying way:

* serve up a page that has a meta-refresh of like, 5 or 10 seconds
* that page includes an image, like foo.jpg
* in your admin area, when you click next, it does something to
  'foo.jpg' (symlinks it to a new file, replaces the file, makes foo.jpg
  pull different stuff from a database, whatever)
* next time the browser reloads due to the meta refresh, they see the
  new picture.

It's not perfect, and there may be some cache issues that come into
play.  So you could tie your admin area to session ids, and have the
reloading page have a dynamically determined image name.  This might
sidestep caching issues.

Of course, there won't be immediate feedback to the user.  They will
have to wait a maximum of 5 seconds (or whatever) before they see your
new image.

The point is that you can't talk directly to the browser.  You have to
talk to the server, and then have the client periodically poll the
server to see what new data it should get.

I think.

-- 
[ joel boonstra | [EMAIL PROTECTED] ]

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




[PHP] I have a problem with MsSQL

2003-02-17 Thread Jimmy Huaman
Hi.

My problem is the characters in spanish:

example:

Construcción (Data of MsSQL Server)
  
Result in web with PHP:
Construcci¢n  

Thanks you.




Prompyme a su servicio

-
Prompyme a su servicio.
El Estado su mejor cliente, visite la página de 
  información de Compras del Estado

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




[PHP] Locale install

2003-02-17 Thread David A Dickson
The system I am wroking on only has english locales. How do I install the 
french locales?


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




[PHP] MySQL DB Schema

2003-02-17 Thread Phillip S. Baker
Greetings all,

Is there an easy way to pull out the schema of a MySQL for viewing??

Thanks

Phillip


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




[PHP] Re: emptying jammed mailbox by PHP?

2003-02-17 Thread Manuel Lemos
Hello,

On 02/17/2003 11:27 PM, Chris Hayes wrote:

hi,
maybe not the most professional way but my mailbox is jammed and i want 
to clear it. My ISP host is doing some office refurnishing and needs all 
his attention to pick the right color hues.
So i thought maybe i can send a simple POP command to delete all mails 
in the mailbox? It's 14000 mails since last thursday!
Maybe using mr Lemos' POP script class?

Yes, the class maybe a better solution than most e-mail programs to 
delete so many messages in the server.

Make sure you get an updated version from here as there are some old 
versions elsewhere.

http://www.phpclasses.org/pop3class

Make sure you quit the POP3 connection properly with the class or else 
the server may not commit the delete requests when you disconnect.


My email client eudora complains it cannot get a 'lock'- mailbox in use. 
This can be the mail subsystem thingy keeping sending itself a warning 
email. Ideas?

This means that there is some program accessing your mailbox at the 
time. if you are not sure what program that may be, ask your system 
administration for help or else there will be no program that will be 
able to delete your messages.


--

Regards,
Manuel Lemos


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



RE: [PHP] **need info ASAP - displaying existing pdf files and other 'tricks'

2003-02-17 Thread Erin Fry
Wonderful.  Thanks so much for the info.


-Original Message-
From: Mathias Rockel [mailto:[EMAIL PROTECTED]] 
Sent: Monday, February 17, 2003 10:39 AM
To: Erin Fry
Subject: Re: [PHP] **need info ASAP - displaying existing pdf files and other 'tricks'

http://support.adobe.com/devsup/devsup.nsf/docs/52852.htm/$File/IRS-URLOpen_
2628.pdf

- Original Message -
From: Erin Fry [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, February 17, 2003 5:06 PM
Subject: [PHP] **need info ASAP - displaying existing pdf files and other
'tricks'


Hey there.

I want to display an existing pdf file.  However, I have a variable that is
passed that will determine where I want the pdf file to ‘begin’.  For
example, if the value of the variable passed is ‘B’ then I want the entire
pdf file to be displayed with pg. 75 in the immediate viewing screen.

I’ve found a lot of information on creating pdf files which obviously doesn’
t help with what I want to do.  If you have any ideas, information (links,
references) I would greatly appreciate it.

Thanks.

Erin

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.449 / Virus Database: 251 - Release Date: 1/27/2003



---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.449 / Virus Database: 251 - Release Date: 1/27/2003
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.449 / Virus Database: 251 - Release Date: 1/27/2003
 

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




Re: [PHP] emptying jammed mailbox by PHP?

2003-02-17 Thread Ernest E Vogelsinger
At 03:27 18.02.2003, Chris Hayes said:
[snip]
hi,
maybe not the most professional way but my mailbox is jammed and i want to 
clear it. My ISP host is doing some office refurnishing and needs all his 
attention to pick the right color hues.
So i thought maybe i can send a simple POP command to delete all mails in 
the mailbox? It's 14000 mails since last thursday!
Maybe using mr Lemos' POP script class?

My email client eudora complains it cannot get a 'lock'- mailbox in use. 
This can be the mail subsystem thingy keeping sending itself a warning 
email. Ideas?

BTW PHP on the server is running in safe mode,
[snip] 

You might try a socket connection to your POP3 server (port 110):

Pseudocode:
connect
USER login
PASS pass
LIST
# will return an array of message numbers
# walk these numbers and transmit a DELE command:
foreach ($msgs as $id)
DELE $id

QUIT


-- 
   O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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




[PHP] MD5 Password Login Driving me Crazy

2003-02-17 Thread Vernon
For what ever reason I cannot seem to get a user to login using MD5. The
user creates the password on log and it works fine, password encrypted and
all. I test to see if the process is working ok on creation by using the

UPDATE penpals SET password = MD5(password)

and the encrypted passwords match.

When the user goes to login into the page though I have the encrypted
password echo to the page and they match except a 52 on the end of it which
I am assuming is a space or something being picked up on submit or
something. I recall there is a way to trim the field so that it doesn't pick
up spaces but can't recall what it is. Anyone know what it is and if it
could be that?

Thanks



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




Re: [PHP] PHP Compile question ....

2003-02-17 Thread James Hatridge
Thanks! I'll give it a shot in the morning!

JIM

On Monday 17 February 2003 18:19, Mat Harris wrote:
 i like to use to following with php 4.3.0. Note the $APACHE_PREFIX should
 be changed:

 ./configure --prefix=/usr --with-apxs=$APACHE_PREFIX/bin/apxs
 --enable-debug=no --enable-safe-mode --with-mysql=/usr --with-regex=system
 --with-xml --with-imap --with-snmp --with-kerberos --with-imap-ssl
 --with-openssl --with-bz2 --with-db3 --with-curl --with-png-dir=/usr
 --with-gd --with-gdbm --with-gettext --with-ncurses --with-jpeg-dir=/usr
 --with-mm --with-png --with-pspell --with-zlib --enable-ftp
 --enable-sockets --enable-track-vars --enable-trans-sid --enable-yp
 --enable-memory-limit --enable-calendar --enable-dbx

 On Mon, Feb 17, 2003 at 05:02:00 +0100, James Hatridge wrote:
  Hi all...
 
  I just compiled PHP from source for the first time. It works, but not
  like I want it to. I need it to work with Mysql, do graphs, and let me
  run programs (ie safe-mode is off). Also the odd thing is that before I
  compiled my own PHP I could access all my mysql databases. Now I can only
  access in a read only mode. When I try to do any type of update I get
  either a blank screen or PHP says that the DB is not there. I am able to
  access all my DBs at the mysql command line without problem.
 
  I think that my problems are with the options when I compile PHP. Can
  someone give me an example of the options I need to make this work?
 
  Thanks
 
  JIM
  --
  Jim Hatridge
  Linux User #88484
  --
   BayerWulf
 Linux System # 129656
   The Recycled Beowulf Project
Looking for throw-away or obsolete computers and parts
 to recycle into a Linux super computer
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php

-- 
Jim Hatridge
Linux User #88484
--
 BayerWulf
   Linux System # 129656
 The Recycled Beowulf Project
  Looking for throw-away or obsolete computers and parts
   to recycle into a Linux super computer


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




[PHP] Re: MD5 Password Login Driving me Crazy

2003-02-17 Thread Philip Hallstrom
see the trim() function... not sure if that will solve your problem, but
that's the function you're looking for.

On Mon, 17 Feb 2003, Vernon wrote:

 For what ever reason I cannot seem to get a user to login using MD5. The
 user creates the password on log and it works fine, password encrypted and
 all. I test to see if the process is working ok on creation by using the

 UPDATE penpals SET password = MD5(password)

 and the encrypted passwords match.

 When the user goes to login into the page though I have the encrypted
 password echo to the page and they match except a 52 on the end of it which
 I am assuming is a space or something being picked up on submit or
 something. I recall there is a way to trim the field so that it doesn't pick
 up spaces but can't recall what it is. Anyone know what it is and if it
 could be that?

 Thanks



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



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




[PHP] Error Opening file

2003-02-17 Thread Pushpinder Singh Garcha
Hello All;


I am trying to open a File called cmi_list.txt  ( stored at the same 
level as the php file) and then load these into an array.
Now I check the $passport_codes with the value the User has entered and 
set the $flag accordingly

?  
.

 $PASSPORT_CODES =file(cmi_list.txt);
 $count = count($PASSPORT_CODES);

 for($i=0 ; $i  $count ; $i++) {

  if ($PASSPORT_COUNT[$i] != $p_code )   $flag = true;

  else $flag = false; 	

  }

  if ($flag == false)
{
	echo Passport Code did match record on file\n\n;
	exit;
}

.
.
?
This does not seem to work correctly.

[PHP] PHP 5

2003-02-17 Thread Adrian Portsmouth
Hi,

I have been checking out the books on Amazon.com and it seems there is a
PHP5 book in the works due to be released on March the 4th. Does anyone
know where I can find out information about this new release of PHP,
what changes there are etc?

TIA

Adrian

www.phpscriptsearch.com


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




Re: [PHP] PHP 5

2003-02-17 Thread Stephan Seidt
Hi,

Well, something very important in php5 is ZendEngine2:
http://cvs.php.net/co.php/ZendEngine2/ZEND_CHANGES

bye

Adrian Portsmouth wrote:

Hi,

I have been checking out the books on Amazon.com and it seems there is a
PHP5 book in the works due to be released on March the 4th. Does anyone
know where I can find out information about this new release of PHP,
what changes there are etc?

TIA

Adrian

www.phpscriptsearch.com




--
if (!$TCPA-connect()) {
throw new Exception('Sorry, no coffe today', EX_FATAL);
}


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




Re: [PHP] Multisorting an array

2003-02-17 Thread Kevin Stone
- Original Message -
From: Joachim Krebs [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, February 17, 2003 8:25 AM
Subject: [PHP] Multisorting an array


 I have an array with the following structure:

 Array
 (
 [0] = Array
 (
 [name] = images
 [type] = dir
 )

 [1] = Array
 (
 [name] = includes
 [type] = dir
 )

 [2] = Array
 (
 [name] = index.php
 [type] = file
 )

 [3] = Array
 (
 [name] = index.tpl.php
 [type] = file
 )

 [4] = Array
 (
 [name] = lib
 [type] = dir
 )
 }

 I want to array_multisort this array so it becomes sorted by type
 first, and then by name. What are the arguments for the function in
 this case?

 Joachim

I do not believe there are any arguments to the array_multisort() functon
that will help you in this case.  Sometimes you just need to backup and try
to see the problem in a new light.  Instead of building a large
multi-dimensional array you might consider building two one-dimensional
arrays (one for files and one for directories).  That solves half of your
problem right there.  Then all you need to do is sort each array using
asort() and you can combine them or print them out in whatever order you
like.
- Kevin



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




[PHP] pro-rated date

2003-02-17 Thread Paul Chvostek

Anybody have a quick way of determining the number of days remaining in
the current month?

I'm currently using:

$nextmonth = strftime(%Y-%m-01,strtotime(+1 month))
$monthdays = strftime(%d,strtotime($nextmonth)-86400);
$daysleft  = $monthdays - strftime(%d,time());

I can obviously compact things into a single line, but it's enormous and
offends my sense of esthetics.  I was hoping I might be able to feed
something funky like first day of next month to strtotime, but the gnu
date input format isn't quite that flexible.

Any advice?  Is there an *elegant* way of doing this?

-- 
  Paul Chvostek [EMAIL PROTECTED]
  Operations / Abuse / Whatever
  it.canada, hosting and development   http://www.it.ca/


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




[PHP] Text data truncated after first blank character in form fields

2003-02-17 Thread Michael Eacott
When I have the following in a form:
?php $testvar = a b c; ?
input type=text size=20 name=testvar value=?php echo $testvar; ?
the value shown in the form field is   a and not a b c
why?
and how can I get to see the untrucated text, please?

Mike


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




[PHP] Data from DB

2003-02-17 Thread Miguel Brás
Hello gents,

I have a table with users and passwords with over than 100 rows.
I have 7 specific users that I wanna display on a page, as well their data.

How can I display this specific users on the page?

Thx
Miguel



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




[PHP] Protecting files

2003-02-17 Thread PR
Hello,

How can I protect my php files among other files like templates
(.inc) and mysql config  (config.inc) files being copied/read/imported (front
page)/used by other applications other than my
site...

can this be done by htaccess? is so , could anyone point me into right
direction?

-- 
Thank you,
 Paul



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




Re: [PHP] PHP 5

2003-02-17 Thread Greg Donald
On Mon, 17 Feb 2003, Stephan Seidt wrote:

Well, something very important in php5 is ZendEngine2:
http://cvs.php.net/co.php/ZendEngine2/ZEND_CHANGES

Looks like PHP5 will be a lot like java/c++ when released.  Exception 
handling, true object support, and an inline debugger, oh my!

When is the expected release date?  Or is still too soon to tell still?

Thanks,


-- 
Greg Donald
http://destiney.com


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




Re: [PHP] Data from DB

2003-02-17 Thread David A Dickson
On Mon, 17 Feb 2003, Miguel Brás wrote:

 Hello gents,
 
 I have a table with users and passwords with over than 100 rows.
 I have 7 specific users that I wanna display on a page, as well their data.
 
 How can I display this specific users on the page?

A little more information is need:
1. What type of database are you using (postgresql, mysql)?
2. What is the database scheme (tables and columns)

Assuming you are using postgresql and have a table 'user' with columns 
user, password, firstname, lastname, email

$Result = pg_exec($DBConnection, SELECT firstname, lastname, email
FROM user
   WHERE user.user = '$User1'
 OR user.user = '$User2'
 OR user.user = '$User3'
 OR user.user = '$User4'
 OR user.user = '$User5'
 OR user.user = '$User6'
 OR user.user = '$User7';);
for ($i = 0; $i  pg_numrows($Result); $i++) {
print pg_fetch_result($Result, $i, 0) .   . pg_fetch_result($Result, 
$i, 1) .  
 ... (for rest of results)
}

$User1 ... $User7 are variables that contain the user id of the users you 
are interested in. Check the docs for pg_connect() (needed to connect to 
DB), pg_exec() (query db) and pg_result() (retrieve results from a 


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




Re: [PHP] Data from DB

2003-02-17 Thread Greg Donald
On Mon, 17 Feb 2003, Miguel Brás wrote:

I have a table with users and passwords with over than 100 rows.
I have 7 specific users that I wanna display on a page, as well their data.

How can I display this specific users on the page?

You probably want to execute some SQL queries.  Then the data that is 
returned you will want to place into an array.  Then finally you 
will want to iterate over the array creating some html from each row for 
display.


-- 
Greg Donald
http://destiney.com


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




Re: [PHP] PHP Compile question ....

2003-02-17 Thread Mat Harris
no problem. the only thing i forgot to say is that this is on a redhat 7.3
machine and the libraries that are used by some of those options are from
redhat rpms. If you aren't using a similar version of redhat then you may
get messages about certain options missing headers etc.

up to you whether you fix them or forget them :)

On Mon, Feb 17, 2003 at 08:43:20 +0100, James Hatridge wrote:
 Thanks! I'll give it a shot in the morning!
 
 JIM
 
 On Monday 17 February 2003 18:19, Mat Harris wrote:
  i like to use to following with php 4.3.0. Note the $APACHE_PREFIX should
  be changed:
 
  ./configure --prefix=/usr --with-apxs=$APACHE_PREFIX/bin/apxs
  --enable-debug=no --enable-safe-mode --with-mysql=/usr --with-regex=system
  --with-xml --with-imap --with-snmp --with-kerberos --with-imap-ssl
  --with-openssl --with-bz2 --with-db3 --with-curl --with-png-dir=/usr
  --with-gd --with-gdbm --with-gettext --with-ncurses --with-jpeg-dir=/usr
  --with-mm --with-png --with-pspell --with-zlib --enable-ftp
  --enable-sockets --enable-track-vars --enable-trans-sid --enable-yp
  --enable-memory-limit --enable-calendar --enable-dbx
 
  On Mon, Feb 17, 2003 at 05:02:00 +0100, James Hatridge wrote:
   Hi all...
  
   I just compiled PHP from source for the first time. It works, but not
   like I want it to. I need it to work with Mysql, do graphs, and let me
   run programs (ie safe-mode is off). Also the odd thing is that before I
   compiled my own PHP I could access all my mysql databases. Now I can only
   access in a read only mode. When I try to do any type of update I get
   either a blank screen or PHP says that the DB is not there. I am able to
   access all my DBs at the mysql command line without problem.
  
   I think that my problems are with the options when I compile PHP. Can
   someone give me an example of the options I need to make this work?
  
   Thanks
  
   JIM
   --
   Jim Hatridge
   Linux User #88484
   --
BayerWulf
  Linux System # 129656
The Recycled Beowulf Project
 Looking for throw-away or obsolete computers and parts
  to recycle into a Linux super computer
  
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
 
 -- 
 Jim Hatridge
 Linux User #88484
 --
  BayerWulf
Linux System # 129656
  The Recycled Beowulf Project
   Looking for throw-away or obsolete computers and parts
to recycle into a Linux super computer

-- 
Mat Harris  OpenGPG Public Key ID: C37D57D9
[EMAIL PROTECTED]www.genestate.com   



msg97253/pgp0.pgp
Description: PGP signature


Re: [PHP] Protecting files

2003-02-17 Thread Greg Donald
On Mon, 17 Feb 2003, PR wrote:

How can I protect my php files among other files like templates
(.inc) and mysql config  (config.inc) files being copied/read/imported (front
page)/used by other applications other than my
site...

can this be done by htaccess? is so , could anyone point me into right
direction?

The best way is to not allow anyone else access to your files to begin 
with.  I assume you mean you are in a shared hosting environment?  Your 
system administrators can and should have permissions setup so no one can 
mess with your stuff by default.  If that is not the case, I'd move.

What kind of system is it?  If it's unix you can make use of chown and 
chmod to protect your stuff.  If it's windows, I don't know.


-- 
Greg Donald
http://destiney.com


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




[PHP] IRR Function in PHP

2003-02-17 Thread Jonathan Pitcher
We are getting ready to automate a process that was currently done in 
Excel to a Web page.

This process involves an IRR Calculation. Or Internal Rate of Return.

I have looked at PHP.net and spent the last couple hours searching for 
a pre-built function to handle this but have come up blank.

Has anyone heard of something written in PHP that can handle this type 
of calculation??

Thanks in advance,

Jonathan Pitcher


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



Re: [PHP] Text data truncated after first blank character in form fields

2003-02-17 Thread Kevin Stone
It's your HTML  Failing to enclose the value in quotes may lead to
truncation.  Your output looks like this...
input type=text size=20 name=testvar value=a b c

You should always quote every parmeter in the tag just to avoid such
problems.  This should work..
input type=text size=20 name=testvar value=?php echo $testvar;?

- Kevin


- Original Message -
From: Michael Eacott [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, February 17, 2003 2:04 PM
Subject: [PHP] Text data truncated after first blank character in form
fields


 When I have the following in a form:
 ?php $testvar = a b c; ?
 input type=text size=20 name=testvar value=?php echo $testvar; ?
 the value shown in the form field is   a and not a b c
 why?
 and how can I get to see the untrucated text, please?

 Mike


 --
 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] IRR Function in PHP

2003-02-17 Thread Marco Tabini
On Mon, 2003-02-17 at 16:44, Jonathan Pitcher wrote:
 We are getting ready to automate a process that was currently done in 
 Excel to a Web page.
 
 This process involves an IRR Calculation. Or Internal Rate of Return.
 
 I have looked at PHP.net and spent the last couple hours searching for 
 a pre-built function to handle this but have come up blank.
 
 Has anyone heard of something written in PHP that can handle this type 
 of calculation??

Never heard of it being done in PHP... what is your scenario?

Cheers,


Marco

-- 

php|architect - The Monthly Magazine for PHP Professionals
Come check us out on the web at http://www.phparch.com!


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




Re: [PHP] IRR Function in PHP

2003-02-17 Thread Greg Donald
On Mon, 17 Feb 2003, Jonathan Pitcher wrote:

This process involves an IRR Calculation. Or Internal Rate of Return.

Sorry, I don't think there are any accountants lurking on the list, so 
please explain what the actual calculation for an IRR should be.


-- 
Greg Donald
http://destiney.com


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




Re[2]: [PHP] Protecting files

2003-02-17 Thread PR
Hello Greg,

Yes, I am in a shared environment..but I do have access to chmod..

GD What kind of system is it?  If it's unix you can make use of chown and
GD chmod to protect your stuff.  If it's windows, I don't know.



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




Re: [PHP] IRR Function in PHP

2003-02-17 Thread Marco Tabini
If I may barge in...

The IRR represents the actual return of an investment over an arbitrary
period of time (usually annualized).

Say, for example, that you invest $100 and, after two years, you have
$120. Your overall return is 20%. If your interest rate was constant
over the two-year period and you never took any money out or put any
money in, your annualized IRR, that is the percentage that best
approximates how much you've made on a yearly basis, is approximately
9.544% and is calculated through the simple formula

IRR = (EndAmount / StartAmount) ^ (1 / NumberofPeriods) - 1.

IRR = (120 / 100) ^ (1 / 2) - 1 =~ 0.95445

If it sounds like a straightforward calculation... it isn't, because you
rarely have a clean-cut situation like that. Most of the time, you have
to deal with variations in the cash flows (interest payments,
reinvestments, disbursements, taxes, and so forth) and partial periods.

In some cases, the problem can only be solved by interpolation and the
calculation can become quite complex.

Cheers,


Marco

On Mon, 2003-02-17 at 16:52, Greg Donald wrote:
 On Mon, 17 Feb 2003, Jonathan Pitcher wrote:
 
 This process involves an IRR Calculation. Or Internal Rate of Return.
 
 Sorry, I don't think there are any accountants lurking on the list, so 
 please explain what the actual calculation for an IRR should be.
 
 
 -- 
 Greg Donald
 http://destiney.com
-- 

Marco Tabini
President

Marco Tabini  Associates, Inc.
28 Bombay Ave.
Toronto, ON M3H 1B7
Canada

Phone: (416) 630-6202
Fax: (416) 630-5057
Weblog: http://blogs.phparch.com


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




Re: [PHP] IRR Function in PHP -- MORE Info

2003-02-17 Thread Jonathan Pitcher
I received an Excel Spread sheet with built in calculations for 
creating our rate sheets that we pass out to our branches and so on.

In this rate sheet to calculate our APR the spread sheet calls built in 
Finance Functions

IRR Internal Rate of Return
PMT Calculates a Payment
PV Calculates Present Value

My goal is to turn the excel sheet into a DB Driven Rate management 
system for our Internal and External websites. With all input and 
export going through a web based system.

I have all the information I need but I can't seem to find the right 
formulas to make the calculations.

Thanks again,

Jonathan


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



Re: [PHP] Text data truncated after first blank character in form fields

2003-02-17 Thread rentAweek support
Thanks

I tried our your suggestion sic:
input type=text size=20 name=testvar value=?php echo $testvar; ?
Still truncation

Mike
---
Kevin Stone wrote:


It's your HTML  Failing to enclose the value in quotes may lead to
truncation.  Your output looks like this...
input type=text size=20 name=testvar value=a b c

You should always quote every parmeter in the tag just to avoid such
problems.  This should work..
input type=text size=20 name=testvar value=?php echo $testvar;?

- Kevin















  1   2   >