[PHP] Re: Credit Card script that really works...

2001-07-13 Thread elias

Go to http://www.webberdev.com and search for a credit card script!
I found one that is very good! and I'm using it.

Dhaval Desai [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi!


 Well I jsut downloaded the credit card script from
 this website:

 http://tobiac.supereva.it/checkcard.zip


 I just have one problem with the script. When the
 checkcard.php page loads for the first time I get this
 message always invalid length INVALID, is there any
 way I can stop this message when it loads for the
 first time...


 I really appreciate any help from anyone...


 Thank You
 Dhaval Desai

 __
 Do You Yahoo!?
 Get personalized email addresses from Yahoo! Mail
 http://personal.mail.yahoo.com/



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




Re: [PHP] Re: Mcrypt fails to run

2001-07-13 Thread Christopher Ostmo

Gigi pressed the little lettered thingies in this order...

 Hi,
 
 Try upgrading to 4.0.6. I think there are known pb with 4.0.4 and mcrypt.
 Regards,
 
 --Gildas.
 
 --
 /-*-\
 | Systèmes  Technologies | Tél: +33 2 96438787 |
 | Informatiques du Ponant | Fax: +33 2 96438788 |
 | 27, rue Auguste Brizeux | email:   [EMAIL PROTECTED] |
 | 22200 Guingamp - France | web: http://www.stip.fr |
 \-*-/
 Dixie Flatline [EMAIL PROTECTED] a écrit dans le message news:
 [EMAIL PROTECTED]  Greetings!   I'm running
 Debian Potato 2.2.19 with php 4.0.4-pl1. I'd recently compiled  an
 Mcrypt.so module, then added the extension line into my php.ini file. 
 After reloading Apache and trying to run any php script which includes ANY
  mcrypt related function, the code immediately halts and no output is
 given.  There aren't any errors in my log files, so I don't know what
 could be the  problem :(.   I'm using libmcrypt 2.4.15 and MCrypt 2.5.7.
   Best Regards,   Dixie Flatline  
 
 

If this is the same problem that I ran into, you can fix it with a re-
compile of php.  Before compiling, go into the file:
ext/standard/crypt.c
and change line 109 to:
srand48((long)time(0) * (long)getpid() * (long)(php_combined_lcg()*(double)1.0));

You should check your server log files.  If httpd is core dumping when 
you run mycrypt commands, then this is your problem.  The fix was 
documented at bugs.php.net and was incorporated into a later version.  
When I compiled 4.0.6, I didn't have to make this change.

If you're going to recompile anyway, you may as well upgrade.

Good luck...

Christopher Ostmo
a.k.a. [EMAIL PROTECTED]
AppIdeas.com
Innovative Application Ideas
Meeting cutting edge dynamic
web site needs since the 
dawn of Internet time (1995)

Business Applications:
http://www.AppIdeas.com/

Open Source Applications:
http://open.AppIdeas.com/

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




[PHP] Problem with mail subject

2001-07-13 Thread umesh DESHMUKH

Hi Gurus,

I am using PHP4, I am using mail function which has
Japanese subject, I am using 'iso-2022-jp' charser
for japanese mail body. 

The problem the Japanese subject is seen corrupted,
can anyone pls. tell me what should I do to change the
charset of Subject to 'iso-2022-jp' so that the
subject won't be seen corrupted.

Regards

Umesh.


=
Umesh A. Deshmukh.


Do You Yahoo!?
Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
or your free @yahoo.ie address at http://mail.yahoo.ie

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




Re: [PHP] Strong typing?

2001-07-13 Thread Adam

 why can't you just use plan simple HTML to do it??? rather than make a
larger hassle for your self ie

 strong howdy /strong ???

  yes that is valid HTML :)

 Peter

why do i get the idea that's not what they meant...

-Adam



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




[PHP] field values in multipart/form

2001-07-13 Thread Erick Calder

Hi, I'm running PHP 4.0.4pl1 on a RedHat 7.0 box.  I have the following
problem:

when using ENCTYPE=multipart/form for a FORM, PHP receives the values of
fields with a prepended \n e.g. with:

PRE
?
if ($f1) {
   echo test: /$f1/;
   exit;
   }
?
/PRE
FORM ENCTYPE=multipart/form
INPUT TYPE=TEXT NAME=f1
INPUT TYPE=SUBMIT
/FORM

if I enter Hello into the field and submit the form I get:

/
Hello/

what's the deal?? I've read through all the user comments on the file
uploads section but no one seems to have run into this.  is it a bug or did
I miss some docs somewhere?

1k thx - e r i c k



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




RE: [PHP] Alternative to phpMyAdmin

2001-07-13 Thread Steve Brett

if you install mysql on a windoze machine then you can administer ANY mysql
database going through the socket.

i do it all the time.


Steve

 -Original Message-
 From: Alexander Skwar [mailto:[EMAIL PROTECTED]]
 Sent: 12 July 2001 19:15
 To: Matthew Loff
 Cc: 'Steve Brett'; 'Steph'; [EMAIL PROTECTED]
 Subject: Re: [PHP] Alternative to phpMyAdmin
 
 
 So sprach »Matthew Loff« am 2001-07-12 um 14:07:16 -0400 :
  
  I second that recommendation-- MySQL-Front is downright excellent!
  
  http://www.mysqlfront.de/
 
 Well, but how is that going to work, if Steph wants to manage his
 databases on his providers server?
 
 Besides, mysqlfront is a Windows program...
 
 Alexander Skwar
 -- 
 How to quote: http://learn.to/quote (german) 
 http://quote.6x.to (english)
 Homepage: http://www.digitalprojects.com   |   
 http://www.iso-top.de
iso-top.de - Die günstige Art an Linux Distributionen zu kommen
   Uptime: 23 hours 13 minutes
 

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




[PHP] php/webmail question

2001-07-13 Thread Adrian D'Costa

Hi,

I am writing a webmail in php using pop3 as the ones I downloaded do not
do what I want.

Assuming I am able to connect and get the list of messages and sizes.  Now
I have a couple of attachments on some mails.  When I read the message it
just displays the base64 encoded message (trying to build on rymo webmail
rymo.sourceforge.net).

I did the following:  I check if the Content-Type is MULTIPART and got the
BOUNDARY but don't know how to proceed from there on.  How do I read the
body of the message seperating each attachment and giving an
option do download or view (something like squirrelmail).  Any example
would be great

TIA

Adrian


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




[PHP] postgres and php

2001-07-13 Thread Derek

anyone know how I force a case insensitive search through a postgres
database.

I've got a search looking for 'something like '%something%' but this won't
find 'SOMETHING'...if you know what I mean!?

Thanks in advance for any help

Derek



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




RE: [PHP] Alternative to phpMyAdmin

2001-07-13 Thread Alexander Skwar

 if you install mysql on a windoze machine then you can administer ANY  mysql 
database going through the socket.

Okay, for a development this may be fine, but I still fail to see how a tool that runs 
on your own computer (no matter if it's a Windows tool, or a Linux tool) can help you 
administer databases which are not on the same computer (unless the mysql database on 
the providers server can be contacted from any machine and not just from localhost).

-- 
Homepage:http://www.digitalprojects.com   |   http://www.iso-top.de
iso-top.de - Die günstige Art an Linux Distributionen zu kommen

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




RE: [PHP] Alternative to phpMyAdmin

2001-07-13 Thread Steve Brett

i'm sorry but i seem to be completely missing your point.

mysql accepts incoming requests on a specific socket (can't remember which
one, but postgresql is 5432) and therefore where you are is not an issue.

i administer databases via a modem connection that sit on servers somewhere
in the states.
i install mysql and php in windows and then develop at home, then i update
the live db throught mysql-front.

Steve

 -Original Message-
 From: Alexander Skwar [mailto:[EMAIL PROTECTED]]
 Sent: 13 July 2001 10:15
 To: Steve Brett; Alexander Skwar; Matthew Loff; Steve Brett; 'Steph';
 [EMAIL PROTECTED]
 Subject: RE: [PHP] Alternative to phpMyAdmin
 
 
  if you install mysql on a windoze machine then you can 
 administer ANY  mysql database going through the socket.
 
 Okay, for a development this may be fine, but I still fail to 
 see how a tool that runs on your own computer (no matter if 
 it's a Windows tool, or a Linux tool) can help you administer 
 databases which are not on the same computer (unless the 
 mysql database on the providers server can be contacted from 
 any machine and not just from localhost).
 
 -- 
 Homepage:http://www.digitalprojects.com   |   
 http://www.iso-top.de
 iso-top.de - Die günstige Art an Linux Distributionen zu kommen
 

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




[PHP] Read and write

2001-07-13 Thread Francois Boucher

I need to read in a binary file.
(the file is write in c++ and contain integer, interger,char(10),char(10) )

So I need to read this and write it in normal caracters.

So I try:
 $fp = fopen(data_bin.dat,rb);
 $data[] = fread($fp,4);
 $data[] = fread($fp,4);
 $data[] = fread($fp,10);
 $data[] = fread($fp,10);

but i think it wrong...

Thanks.


-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-=   François Boucher  =-
-=  [EMAIL PROTECTED] =-
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-



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




[PHP] mysql error

2001-07-13 Thread andreas \(@work\)

hi all,

my script was now working for month but now 
suddenly get this error:


The table 'SQL90cb_0' is full

SELECT DISTINCT t1.id,t1.textd FROM tblEntry AS t1,tblTopic AS t2 ORDER BY 
t2.named,t1.textd
anyone know whats the problem ?

thank you

andreas






RE: [PHP] Alternative to phpMyAdmin

2001-07-13 Thread Alexander Skwar

 i'm sorry but i seem to be completely missing your point.
 
 mysql accepts incoming requests on a specific socket (can't remember 

You mean port, don't you?

 one, but postgresql is 5432) and therefore where you are is not an
 issue.

Well, the issue is, that normally, connects to mysql are NOT allowed from any 
arbitrary host.  Normally, in safe setups, network connections to mysql are not 
possible.  And if they are, you need to specify a ip from which connects are allowed.

-- 
Homepage:http://www.digitalprojects.com   |   http://www.iso-top.de
iso-top.de - Die günstige Art an Linux Distributionen zu kommen

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




RE: [PHP] Alternative to phpMyAdmin

2001-07-13 Thread Alexander Skwar

 i'm sorry but i seem to be completely missing your point.

Yeah, seems like so :)

 
 mysql accepts incoming requests on a specific socket (can't remember 

You mean port, don't you?

 one, but postgresql is 5432) and therefore where you are is not an
 issue.

Well, the issue is, that normally, connects to mysql are NOT allowed from any 
arbitrary host.  Normally, in safe setups, network connections to mysql are not 
possible.  And if they are, you need to specify a ip from which connects are allowed.

-- 
Homepage:http://www.digitalprojects.com   |   http://www.iso-top.de
iso-top.de - Die günstige Art an Linux Distributionen zu kommen

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




[PHP] forms and IP numbers

2001-07-13 Thread Marc van Duivenvoorde

A friend of mine found a bug in my messageboard code, this way he can post 
with other (than in my database) nicknames from a local form. Now I want to 
have the formhandler do a check from where the form is sent. If it is not 
sent from my own webserver it has to display an error message.

Thanks,

Marc van Duivenvoorde


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




Re: [PHP] Read and write

2001-07-13 Thread Chris Lambert - WhiteCrown Networks

Put quotes around rb, but I don't think you need the b.

Also, are the integers always char(4)?

/* Chris Lambert, CTO - [EMAIL PROTECTED]
WhiteCrown Networks - More Than White Hats
Web Application Security - www.whitecrown.net
*/

- Original Message -
From: Francois Boucher [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, July 13, 2001 7:55 AM
Subject: [PHP] Read and write


| I need to read in a binary file.
| (the file is write in c++ and contain integer,
interger,char(10),char(10) )
|
| So I need to read this and write it in normal caracters.
|
| So I try:
|  $fp = fopen(data_bin.dat,rb);
|  $data[] = fread($fp,4);
|  $data[] = fread($fp,4);
|  $data[] = fread($fp,10);
|  $data[] = fread($fp,10);
|
| but i think it wrong...
|
| Thanks.
|
|
| -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
| -=   François Boucher  =-
| -=  [EMAIL PROTECTED] =-
| -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|
|
|
| --
| PHP General Mailing List (http://www.php.net/)
| To unsubscribe, e-mail: [EMAIL PROTECTED]
| For additional commands, e-mail: [EMAIL PROTECTED]
| To contact the list administrators, e-mail: [EMAIL PROTECTED]
|
|
|


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




Re: [PHP] forms and IP numbers

2001-07-13 Thread Chris Lambert - WhiteCrown Networks

This would be just as bad, as he could open up a socket faking a referer.
What you really need are data integrity checks inside the script which posts
to the message board on your server.

/* Chris Lambert, CTO - [EMAIL PROTECTED]
WhiteCrown Networks - More Than White Hats
Web Application Security - www.whitecrown.net
*/

- Original Message -
From: Marc van Duivenvoorde [EMAIL PROTECTED]
To: Php general lijst [EMAIL PROTECTED]
Sent: Friday, July 13, 2001 6:09 AM
Subject: [PHP] forms and IP numbers


| A friend of mine found a bug in my messageboard code, this way he can post
| with other (than in my database) nicknames from a local form. Now I want
to
| have the formhandler do a check from where the form is sent. If it is not
| sent from my own webserver it has to display an error message.
|
| Thanks,
|
| Marc van Duivenvoorde
|
|
| --
| PHP General Mailing List (http://www.php.net/)
| To unsubscribe, e-mail: [EMAIL PROTECTED]
| For additional commands, e-mail: [EMAIL PROTECTED]
| To contact the list administrators, e-mail: [EMAIL PROTECTED]
|
|
|


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




Re: [PHP] Alternative to phpMyAdmin

2001-07-13 Thread Steve Brett

 -Original Message-

 From: Alexander Skwar [mailto:[EMAIL PROTECTED]]

 Sent: 13 July 2001 10:57

 To: Steve Brett; Alexander Skwar; Steve Brett; Matthew Loff; Steve

 Brett; 'Steph'; [EMAIL PROTECTED]

 Subject: RE: [PHP] Alternative to phpMyAdmin





  i'm sorry but i seem to be completely missing your point.

 

  mysql accepts incoming requests on a specific socket (can't

 remember



 You mean port, don't you?



i do indeed. gess who's psending most of his time at the minute socket
programming :-)

  one, but postgresql is 5432) and therefore where you are is not an

  issue.



 Well, the issue is, that normally, connects to mysql are NOT

 allowed from any arbitrary host. Normally, in safe setups,

 network connections to mysql are not possible. And if they

 are, you need to specify a ip from which connects are allowed.



this should be set up by your isp though so as part of a mysql package you'd
get this type of access to your db's

Steve

 --

 Homepage: http://www.digitalprojects.com |

 http://www.iso-top.de

 iso-top.de - Die günstige Art an Linux Distributionen zu kommen



Alexander Skwar [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  i'm sorry but i seem to be completely missing your point.

 Yeah, seems like so :)

 
  mysql accepts incoming requests on a specific socket (can't remember

 You mean port, don't you?

  one, but postgresql is 5432) and therefore where you are is not an
  issue.

 Well, the issue is, that normally, connects to mysql are NOT allowed from
any arbitrary host.  Normally, in safe setups, network connections to mysql
are not possible.  And if they are, you need to specify a ip from which
connects are allowed.

 --
 Homepage:http://www.digitalprojects.com   |   http://www.iso-top.de
 iso-top.de - Die günstige Art an Linux Distributionen zu kommen



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




[PHP] O'Reilly Open Source Conference

2001-07-13 Thread Chris Lambert - WhiteCrown Networks

As the conference date draws nearer, I'd like to try and get familiar with
some of the other list members who'll be attending.

What sessions or tutorials are you looking forward to?
What's your background with PHP, MySQL, or other open source technologies?
What company, if any, will you be representing?
Where are you flying in from?
What're you hoping to bring back from the convention?

...and anything else you might be find relevant.

/* Chris Lambert, CTO - [EMAIL PROTECTED]
WhiteCrown Networks - More Than White Hats
Web Application Security - www.whitecrown.net
*/



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




AW: [PHP] Alternative to phpMyAdmin

2001-07-13 Thread Sebastian Stadtlich


  one, but postgresql is 5432) and therefore where you are is not an
  issue.
 
 Well, the issue is, that normally, connects to mysql are NOT 
 allowed from any arbitrary host.  Normally, in safe setups, 
 network connections to mysql are not possible.  And if they 
 are, you need to specify a ip from which connects are allowed.

Hi

as it happens i'm just installing my webserver...
i'd like to set it up just like that, but don't know how..
of cause i set it in mysql, but i don't trust mysql,
so it'd like linux ( redhat 7.1) take care of that .
all connections just from localip or my STATIC work ip

could you/or someone help?

 
 -- 
 Homepage:http://www.digitalprojects.com   |   
 http://www.iso-top.de
 iso-top.de - Die günstige Art an Linux Distributionen zu kommen
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: 
 [EMAIL PROTECTED]
 

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




[PHP] session problem using headers

2001-07-13 Thread David Allen

Hi,

I am having problems with sessions. With cookies turned on it works
fine. Turn off cookies it fails.

I have tried both

header(Location: input.php?=SID);
header(Location: input.php?PHPSESSID=.PHPSESSID);

to pass the session id to the programme input.php but neither works.

The first lines of input.php are

?
session_register(userid);
?

userid is the variable  I wish to pass. However, I have no other code
related to sessions in this script. Do I need in some way tell the
script to use this session id?

As a have said before, it works fine if cookies are turned on.

Thanks in advance for any help.

David


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




Re: [PHP] How to force a file download

2001-07-13 Thread Philip Murray

Try sticking in a

Header(Content-Disposition: attachment; filename=\$filename\);

It should work with IE5.5, but it's hard to tell with Internet Explorer as
it changes from version to version.

 -  -- -  -   -
Philip Murray - Senior Systems Engineer
[EMAIL PROTECTED] - Open2View.com
http://www.open2view.com
- -  -- -   -

- Original Message -
From: Santiago Romero [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, July 13, 2001 10:23 PM
Subject: [PHP] How to force a file download



  Hi!

  I have some code that outputs (from a php3 cgi) email attachments
  under horde/IMP webmail. I would like ALL attachment (including
  all understood by web browser mime types) to be SAVED to disk,
  and not opened.

  I tryed to send them as application/octet-stream but Explorer
  does open them (Netscape treats them correctly and asks me
  to save to disk or open them). Under Explorer, if the output of
  clicking on the Download attach link is pure text, it opens
  it directly on the web browser instead of saving it (that's
  what i want! :). On PDFs, it opens acrobat reader, BUT man!,
  I'm passing it application/octet-stream, this should force
  explorer to save it!

  Any idea?
 --
 Santiago Romero
 Departamento de Sistemas
 [EMAIL PROTECTED]

 Av. Primado Reig 189, entlo
 46020 Valencia - Spain
 Telf. (+34) 96 332 12 00
 Fax. (+34) 96 332 12 01
 http://www.servicom2000.com


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




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




[PHP] How to convert a string into a mathematical expression?

2001-07-13 Thread Christodoulou Demetris

 Hi list.
 I have string variables that contain mathematical expressions. These
strings are submitted through forms.
For example if a user inserts the following- 1+cos(0.3)*x into a text field
with name expression in an  HTML form then
what i get on the server is the string variable $expression whose values is
1+cos(0.3)*x

Is there a way to convert the string variable, $expression, into a
mathematical expression that can  be calculated?
 Thanks in advance.
 DX.




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




[PHP] How to convert a string into a mathematical expression?

2001-07-13 Thread Christodoulou Demetris

Hi list.
 I have string variables that contain mathematical expressions. These
strings are submitted through forms.
For example if a user inserts the following- 1+cos(0.3)*x into a text field
with name expression in an  HTML form then
what i get on the server is the string variable $expression whose values is
"1+cos(0.3)*x"

Is there a way to convert the string variable, $expression, into a
mathematical expression that can  be calculated?
 Thanks in advance.
 DX.




[PHP] $B$4M;;q$N$40FFb(B

2001-07-13 Thread $B%"%]%m4k2h(B
$B!&!&!&(B $B:#F|$N;q6b7+$j$G$*:$$j$NJ}$O(B $B!&!&!&(B
http://www.justinmail.net/ma02/pa01.htm
$B!&!&!&(B  $B!&!&!&(B  $B!&!&!&(B  $B!&!&!&(B  $B!&!&!&(B  $B!&!&!&(B  
$B!&!&!&(B  $B!&!&!&!&(B
$B#1#0#0K|1_$^$G$4M;;qCW$7$^$9!#(B
$B.@Ze5-#U#R#L$K%"%/%;%9!*(B

$B%&%'%V%U%!%$%J%s%9$N%Q%$%*%K%"(B
  ::: $B%"%]%m4k2h(B ::


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


Re: [PHP] Alternative to phpMyAdmin

2001-07-13 Thread Egan

On Fri, 13 Jul 2001 11:15:52 +0100, Steve Brett
[EMAIL PROTECTED] wrote:

one of the guys i work for has an account with a service provider that gives
mysql databases as part of his package. he has an account and password that
is supplied when using mysql-front to connect to his database.

Does mysql-front encrypt the password before it travels the net?




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




Re: [PHP] Multiple Host's with setcookie

2001-07-13 Thread jeremy brand

That is correct.  .domain.com is the correct way to do it.  (make sure you
have the leading dot.)  You are having some other problem.

Jeremy


On Fri, 13 Jul 2001, the following spilled from the mind of david jarvis:

 Date: Fri, 13 Jul 2001 09:36:14 -0400
 From: david jarvis [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: [PHP] Multiple Host's with setcookie

 Hi, I was wondering if there was a way to set a cookie so that it would be 
accessible over multiple hosts, for instance, mail.webpage.com, forums.webpage.com, 
ect.  I tried setting the domain to .webpage.com, but when I read the cookie it says 
the domain is w ww.webpage.com, thus not being accessible by mail.webpage.com. Any 
thoughts would be greatly appreciated.


-- 
Jeremy Brand :: Sr. Software Engineer :: +393485323988 :: [EMAIL PROTECTED]
http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for more
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
LINUX is obsolete  -- Andy Tanenbaum, January 29th, 1992
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  Get your own Free, Private email at http://www.smackdown.com/



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




Re: [PHP] Multiple Host's with setcookie

2001-07-13 Thread jeremy brand

for example this code:
setcookie('cookie_name', 'cookie_val', time()+3600, '/', '.domain.com');

results in this HTTP header:
Set-Cookie: cookie_name=cookie_val; expires=Fri, 13-Jul-01 15:14:25 GMT; path=/; 
domain=.domain.com

Jeremy Brand

Jeremy Brand :: Sr. Software Engineer :: +393485323988 :: [EMAIL PROTECTED]
http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for more
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
LINUX is obsolete  -- Andy Tanenbaum, January 29th, 1992
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  Get your own Free, Private email at http://www.smackdown.com/

On Fri, 13 Jul 2001, the following spilled from the mind of jeremy brand:

 Date: Fri, 13 Jul 2001 16:08:06 +0200 (WEDT)
 From: jeremy brand [EMAIL PROTECTED]
 To: david jarvis [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] Multiple Host's with setcookie

 That is correct.  .domain.com is the correct way to do it.  (make sure you
 have the leading dot.)  You are having some other problem.

 Jeremy


 On Fri, 13 Jul 2001, the following spilled from the mind of david jarvis:

  Date: Fri, 13 Jul 2001 09:36:14 -0400
  From: david jarvis [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Subject: [PHP] Multiple Host's with setcookie
 
  Hi, I was wondering if there was a way to set a cookie so that it would be 
accessible over multiple hosts, for instance, mail.webpage.com, forums.webpage.com, 
ect.  I tried setting the domain to .webpage.com, but when I read the cookie it says 
the domain is w ww.webpage.com, thus not being accessible by mail.webpage.com. Any 
thoughts would be greatly appreciated.
 





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




[PHP] count number of form fields?

2001-07-13 Thread Jaxon

Hi,

Can someone give me an example of how to count the number of form fields
entered?
E.g. let's say I have three dropdown lists, the first is mandatory, and the
second two are optional.
I want to be able to tell my target php script how many of the dropdowns are
populated.

thanks in advance!
jaxon


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




[PHP] Re: php/apache question(probably stupid)

2001-07-13 Thread Peter Clarke


Conor McTernan [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

 hey all,

 I've been using apache, php and mysql on win32 for a while now, and I have
 recently decided to move over to linux *yay*, so i got myself a copy of
 Suse 7.1 personal edition.

 i now have linux up and running, but for the life of me I cannot get php
 and apache to work.

 i downloaded the sources of both from their respective sites, and I have
 managed to compile apache and get it running, and I have also managed to
 compile php(i think) but i cannot get apache to parse any of my code.

 i followed the instructions on installing php as a static object, here is
 a brief outline of what i have done

 i initially install apache, and get it running, i cannot remember what i
 configured it with, but i dont think i configured it with anything
 actually. one apache was installed i managed to get the httpd up and
 running, *note* I have installed apache in /usr/local/apache, i assumed
 that this was the norm.

 i got apache running using the apachectl command, and managed to stop it
 as well.

 i now unpacked the php4.0.6 sources, these are the most recent available
 from php.net, i unpacked this into a temp dir in my root folder (i dont
 know if this is a good or a bad thing?)

 i then followed the instructions in the php install file i configure php
 with what i want, e.g. --with-mysql
 --with-apache-prefix=/usr/loocal/apache (is this correct, or should it
 point to where my apache source code is, in which case it should point to
 /root/temp/apache1.3.6/src)

 before i run the make and make install for php i then run the ./configure
 on apache again this time enabling the php4 module, i run the ./configure
 then i run the make, i now have a httpd binary in my apache1.3.6/src
 dir(once again, i'm not really sure if it was here before) so i copy this
 to the /usr/local/apache/bin dir, shutting down apache first of course.

 once this is done i compile and install php

 i now copy my php.ini-dist to my /usr/lib dir(i think) and edit my
 httpd.conf file

 i now restart apache and fire up a test php page i name my page test.php4,
 when i load it in my browser(either konqueror or netscape6) all i get is
 my source spat back out at me.


 i'm guessing that it is just a problem with my httpd.conf, but i have made
 the changes that are outlined in the install file. other than that i've no
 idea as to what the problem could be.

 any help would be much appreciated. sorry about the length of this mail.

 conor

Do you have the following in httpd.conf:

# And for PHP 4.x, use:
#
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

NB .php NOT .php4

Otherwise consider have php as a DSO then you can rebuild PHP without
rebuilding Apache.

Peter


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




[PHP] Re: postgres and php

2001-07-13 Thread Peter Clarke


Derek [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 anyone know how I force a case insensitive search through a postgres
 database.

 I've got a search looking for 'something like '%something%' but this won't
 find 'SOMETHING'...if you know what I mean!?

 Thanks in advance for any help

 Derek



What's the actual SQL query you trying to use? Because _ like '%something%'
_ is correct.

Peter


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




Re: [PHP] Re: php/apache question(probably stupid)

2001-07-13 Thread Conor McTernan


Peter

I think I have tohse lines i nmy httpd.conf. although they might read:

AddType application/x-httpd-php4 .php
AddType application/x-httpd-php-source .phps

or something like that, i'll make sure to check it when I get back from
work. I was going to install it as a DSO, but it said i need Apache
configured with mod_so.c (or something like that) unfortunately i dont
have that configured when i check my httpd. 




On Fri, Jul 13, 2001 at 03:40:34PM +0100, Peter Clarke wrote:
 
 Conor McTernan [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 
  hey all,
 
  I've been using apache, php and mysql on win32 for a while now, and I have
  recently decided to move over to linux *yay*, so i got myself a copy of
  Suse 7.1 personal edition.
 
snip
 
 Do you have the following in httpd.conf:
 
 # And for PHP 4.x, use:
 #
 AddType application/x-httpd-php .php
 AddType application/x-httpd-php-source .phps
 
 NB .php NOT .php4
 
 Otherwise consider have php as a DSO then you can rebuild PHP without
 rebuilding Apache.
 
 Peter
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

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




Re: [PHP] count number of form fields?

2001-07-13 Thread py

A multiple dropdown lists will produce an array is you put [] when naming
the list. You than need to count how many elements you have in the array.

py

p.s. it could be done in javascript as well, but it's so easy in php :)

- Original Message -
From: Jaxon [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, July 13, 2001 3:32 PM
Subject: [PHP] count number of form fields?


 Hi,

 Can someone give me an example of how to count the number of form fields
 entered?
 E.g. let's say I have three dropdown lists, the first is mandatory, and
the
 second two are optional.
 I want to be able to tell my target php script how many of the dropdowns
are
 populated.

 thanks in advance!
 jaxon


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




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




[PHP] Problem with is_file function on WinNT and apache HELP!

2001-07-13 Thread Antony Cleave

I am trying to dynamically generate an image gallery from a directory iof
images.
To do this I am using the following code

 while (false!==($file = readdir($handle)))
   {
 if ((is_file($file)))
 {
  echo .. Link info here
  }
   }
Only problem is that none of the files in the folder apper to be files
according to PHP
I tried using

if (!(is_dir($file))
This returns every entry in the folder bar . and ..
BUT it includes the all of the other directories in the directory.
As I need to check the file extension before I link to it this is a serious
problem as PHP crashes apache when trying to find the file extension of a
directory.

Any Ideas?

Thanks in advance
Antony Cleave



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




Re: [PHP] Problem with is_file function on WinNT and apache HELP!

2001-07-13 Thread ReDucTor

http://www.evilwalrus.com/download_agree.php?codeEx=304 is a good example of
using directory handles, works in windows...
- Original Message -
From: Antony Cleave [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, July 14, 2001 1:17 AM
Subject: [PHP] Problem with is_file function on WinNT and apache HELP!


 I am trying to dynamically generate an image gallery from a directory iof
 images.
 To do this I am using the following code

  while (false!==($file = readdir($handle)))
{
  if ((is_file($file)))
  {
   echo .. Link info here
   }
}
 Only problem is that none of the files in the folder apper to be files
 according to PHP
 I tried using

 if (!(is_dir($file))
 This returns every entry in the folder bar . and ..
 BUT it includes the all of the other directories in the directory.
 As I need to check the file extension before I link to it this is a
serious
 problem as PHP crashes apache when trying to find the file extension of a
 directory.

 Any Ideas?

 Thanks in advance
 Antony Cleave



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



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




RE: [PHP] Upcoming wrox php/flash book?

2001-07-13 Thread Andrew Chase

Also, PHP's .SWF generating capabilities aside, PHP could also be used to
generate included text on the fly - I forget the exact command, but I know
you can define the contents of a variable from an external file in Flash.
This would lend itself to updating a newsfeed or What's New blurb within a
Flash file without having to recompile it from its .FLA source.

-Andy

 -Original Message-
 From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]

 See http://php.net/swf and also http://www.opaque.net/ming



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




[PHP] Pb with MP3 streaming with Flash Object swfmovie()

2001-07-13 Thread octopussy

Hi all,
I'm trying to make some MP3 streaming with my Apache Web Server and PHP
since I discovered the instruction streammp3($filename) in the swfmovie
object.
But can't make it work!
Anybody else tryied to use this feature or did I miss something?

Octopussy!

?
// Streaming MP3 Test
$mp3_file = sounds/test.mp3;
$m = new SWFMovie();
//$m-setRate(12.0);
$m-streamMp3(fopen($mp3_file,r));
//$m-setFrames(141);
header('Content-type: application/x-shockwave-flash');
$m-output();
?




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




[PHP] Query in Enum Field in MYSQL

2001-07-13 Thread Diego Riaño

Hi everybody

I have a problem with an ENUM fiel in a MySQL DB:
I want to order alphabetically the options in the ENUM fiel in a query.
How can I do That?

Thanks in advances
Diego Ria;o


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




Re: [PHP] Upcoming wrox php/flash book?

2001-07-13 Thread infoz

Yep, the Flash 4/5 LoadVariables function will let you call a PHP script
that sends the data back as URL encoded variables.

Works great!

- Tim
  http://www.phptemplates.org

- Original Message -
From: Andrew Chase [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, July 13, 2001 11:43 AM
Subject: RE: [PHP] Upcoming wrox php/flash book?


 Also, PHP's .SWF generating capabilities aside, PHP could also be used to
 generate included text on the fly - I forget the exact command, but I know
 you can define the contents of a variable from an external file in Flash.
 This would lend itself to updating a newsfeed or What's New blurb within
a
 Flash file without having to recompile it from its .FLA source.



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




[PHP] Regex Help

2001-07-13 Thread Sheridan Saint-Michel

I am trying to write a script that needs a list of all the images in an HTML file.

I am trying this code

if (eregi ((img.+src=)(.+)[\s],$buffer, $regs )) 
{
  echo $regs[2]BRBR;
}

The problem, however is that when it looks at

IMG SRC=images/Logo.gif ALT=Only Child Club - The Place for Only Children

instead of getting images/Logo.gif like I want I am getting

images/Logo.gif ALT=Only Child Club - The Place for Only Children

I am not as familiar with Regexes as I would like and any help would be greatly 
appreciated

Thanks

Sheridan Saint-Michel
Website Administrator
FoxJet, an ITW Company
www.foxjet.com



RE: [PHP] Thumbnail Generation from DB Stored Images.

2001-07-13 Thread scott [gts]

Here is my code to turn a directory full of *files*
into thumbnail images.  im sure you can adapt it to
your own needs...  the code is a bit long-winded, but
it was my first attempt at writing thumbnail code,
so forgive me ;)



// example call to the function
make_thumbs('./pictures/cavern/', './pictures/cavern/thumbs', 200, 60 );

/*
Simple function to make thumbnail images for an
entire directory of .JPG images. (no GIF support
because the owners of the GIF patent are buttheads)

It will create square thumbnail images (height=width),
with the original image resized properly within the
thumbnail dimensions to preserve the height to width ratio

This code is free for use as long as you keep my
email and URL in here:
[EMAIL PROTECTED]
[EMAIL PROTECTED]
http://furt.com/code/make_thumbs/

Syntax of function call
  make_thumbs(
$dir= where the original image files are located
$tdir   = where you want the thumbnails to be saved
$max= $max=width=height of the new thumbnail images
all thumbnails are square.
$quality = quality of thumbnail JPG worst(1..100)best
$border  = how many pixels of border to put around the image
);

*/
function make_thumbs($dir, $tdir, $max, $quality=75, $border=3) {
  // this is so the script won't time out
  set_time_limit(0);

  $files = opendir($dir) or die(Cannot opendir $dir);
  while ($file = readdir($files)) {

if ( preg_match(/[a-zA-Z0-9]\.(jpg|jpeg|JPG|JPEG)$/, $file) ) {
//if (!file_exists($tdir .'/'. $file .'_t.jpg')) {

// Information about the original image
$img_name = $dir .'/'. $file;
$img  = imagecreatefromjpeg($img_name) or die(Cannot read 
$img_name);
$img_x= $img_y = 0;
$img_w= imagesx($img);
$img_h= imagesy($img);

// Create a new empty container for the thumbnail image
$out = imagecreate($max, $max);

// Set background colour of the thumbnail container
$bg = ImageColorAllocate($out, 200,200,200);

// If image is more wide than tall
if ($img_w  $img_h) {
$mod   = ($img_w - $max) / $img_w;

$out_w = $max;
$out_h = $img_h * (1 - $mod);

$out_x = 0;
$out_y = ($max - $out_h) / 2;

$out_x += $border;
$out_w -= $border*2;
}

// If image is more tall than wide
else {
$mod   = ($img_h - $max) / $img_h;

$out_h = $max;
$out_w = $img_w * (1 - $mod);

$out_y = 0;
$out_x = ($max - $out_w) / 2;

$out_y += $border;
$out_h -= $border*2;
}

// for debugging purposes... so i can see what's going on
//print out_x=$out_x, out_y=$out_y, img_x=$img_x, img_y=$img_y\n;
//print out_w=$out_w, out_h=$out_h, img_w=$img_w, img_h=$img_h\n;

//Put some text into the image
//$fg = ImageColorAllocate($out, 0,0,0);
//imagestring ($out, '2', 3, $max-15, Text, $fg);

// Copy and resize the original image into the new thumbnail container
imagecopyresized (
$out, $img,
$out_x, $out_y, $img_x, $img_y,
$out_w, $out_h, $img_w, $img_h);

// Save the image to disk (in the thumbnail directory)
imagejpeg($out, $tdir .'/'. $file .'_t.jpg', $quality);

//}
}#if
  }#while


}





 -Original Message-
 From: Jason Bell [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, July 12, 2001 7:27 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Thumbnail Generation from DB Stored Images.
 
 
 Hello! I have images stored in a MySQL Database. I can retrieve the images 
 and display them without a problem, but I'd really like to be able to 
 create thumbnails. The code that I've written just doesn't seem to work. 
 Preferably, I'd like to pull the image from the database, and create the 
 thumbnail for display, without ever writing an image to the disk. If this 
 is not possible, I'd like to know alternate methods. I'm using 
 imagemagick's convert utility to create the thumbs. Here is my code:
 
 getpic.php:
 
 ?php
 if($id) {
 @MYSQL_CONNECT(localhost,username,mypassword);
 @mysql_select_db(daelic);
 $query = select image,type from images where id=$id;
 $result = @MYSQL_QUERY($query);
 $data = @MYSQL_RESULT($result,0,image);
 $type = @MYSQL_RESULT($result,0,type);
 Header( Content-type: $type);
 echo $data;
 };
 ?
 
 tgen.php:
 
 ?php
 if 

[PHP] GD help

2001-07-13 Thread Angerer, Chad

I am having some problems generating images with GD.  I am using GD 1.6.2
and trying to create a .png image.  I know it works.  I have created just a
generic graphic without trying to put variables into it and am hoping
someone can help me on this one.  Here is some code snippet

// here is my gd.php file to create the image

?

Header ( Content-Type: image/png );   

$im  =  ImageCreate ( 10,  200 );   
$red  =  ImageColorAllocate ( $im,  255,  0,  0 );   
$white  =  ImageColorAllocate ( $im ,  255,  255,  255 );   
$blue  =  ImageColorAllocate ( $im ,  0 ,  0 ,  255 );   
$gray  =  ImageColorAllocate ( $im , 0xC0, 0xC0 , 0xC0 );   

ImageFill ( $im , 0 , 0 , $gray );   
ImageFilledRectangle ( $im , 0 ,$bluehg, 3, 200, $blue );   
ImageFilledRectangle ( $im , 6, $redhg, 10, 200, $red );   

// write the image
ImagePNG( $im ); 

// clean up the mess
ImageDestroy($im);
?

// here is the function that I use to determine the attributes of the image

// create a function to call gd.php
function graphic($blueval, $redval)
{
$pctrd = round($blueval*100, 1);
$pctbl = round($redval*100, 1);
$blueval = ($blueval * 200);
$redval = ($redval * 200);

echo table
tr
td
align=\center\$pctbl%/td
tdimg
src=\gd.php?bluehg=$bluevalredhg=$redval\ height=\100\ //td
td
align=\center\$pctrd/td
/tr
/table;
}

On the page I get a broken image.  If I view the source I see the image is
being called with params.

Any help would be appreciated.

Thanks.

Chad

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




RE: [PHP] Strong typing?

2001-07-13 Thread scott [gts]

and as far as i know, perl's 'strict mode' has absolutely
nothing to do with typing of variables...

use strict; will force you to define all variables
with my $var; or local $var; before you assign values
to them or try and use them... but it doesnt do anything
about enforcing typing... 

in perl 6, i think that plans are under way to add
extensions that will let people strongly-type
variables if they want (but it still wont be mandatory)

example: my integer $number = 5;

would stronlgy-type that variable as an integer, and
you wouldnt be able to assign any other type of value
to it without an error.  but i dont know how far the
developers will go towards realizing strongly-typed
extensions to perl... 

as rasmus said... it's incredibly hard to have it both
ways.  the freedom of perl and PHP largely comes from
*not* having to always worry about variable typing,
memory allocation/cleanup and all those other nitpicky
low-level things that BDSM ... errr C programmers
seem to love  :-)


 -Original Message-
 From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, July 12, 2001 8:15 PM
 To: Dr. Evil
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] Strong typing?
 
 
  PHP is a great language.  It makes it fast and easy to create web
  pages.  However, one feature which is critical for doing rock-solid
  stable websites is strong typing.  The reason for this is that you're
  dealing with untrusted user input.  Strong typing helps because if you
  are expecting an INT, and the user gave you something else, and you
  made a mistake in your input checking, the program will fail when you
  attempt to assign the value to the strongly-type INT variable.  This
  is a good thing when you are dealing with money, or other contexts
  where you need very solid code.
 
  First, is there a plan to introduce a strong typing option, like
  perl's strict mode?
 
  Second, is there a way to get something equivalent to strong typing
  using the class system?
 
 You can't really have it both ways.  And no, there is no plan to implement
 strong typing.
 
 -Rasmus
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 

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




RE: [PHP] Algorithm for repeating calendar events

2001-07-13 Thread Matthew Loff


That's a good question, Michael-- I don't really know if libmcal can be
used on Win32...  Is it made to be compiled under VC++?

If it can't, you should be able to achieve similar results by storing
events in a DB, and using the Date_Calc class:
http://www.phpinsider.com/php/code/Date_Calc/

Good luck!

-Original Message-
From: Michael Hall [mailto:[EMAIL PROTECTED]] 
Sent: Friday, July 13, 2001 9:13 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Algorithm for repeating calendar events


This libmcal sounds like something I've been needing for another
project.

Unfortunately, I'm on a Windows platform.  Is there any way to get this
functionality on Win32?

I downloaded the tar.gz file with teh libmcal library in it, but I have
no idea what I would do next.



 -Original Message-
 From: Matthew Loff [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, July 12, 2001 1:43 PM
 To: 'Rasmus Lerdorf'; 'Reuben D Budiardja'
 Cc: 'php php'
 Subject: RE: [PHP] Algorithm for repeating calendar events



 libmcal is a pain in the butt to set up, but once it's set up, it has 
 some great features...  I had to write a PHP page that handled 
 scheduling of appointments, and mcal saved me a lot of time, after I 
 spent the initial 2 hours pulling my hair to set it up. :)


 -Original Message-
 From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, July 12, 2001 2:28 PM
 To: Reuben D Budiardja
 Cc: php php
 Subject: Re: [PHP] Algorithm for repeating calendar events


 Not quite live yet.  You'll see it when it goes live.

 By the way, there is a very complete date class in PEAR that has 
 pretty much everything you would need to build a calendar app.  See 
 pear/Date/Calc.php

 -Rasmus

 On Thu, 12 Jul 2001, Reuben D Budiardja wrote:

  Great, I'd like to steal it too then :). I just check php.net, but 
  couldn't find it. In what section would you put it?
 
  Thanks.
  Reuben D. Budiardja
 
  On Tuesday 10 July 2001 05:34 pm, Rasmus Lerdorf wrote:
Have any of you seen those calendar applications that let you 
program events that repeat periodically? You can set it to 
repeat every thursday, every week, every third week, every six 
months, and so on?
   
I am developing such an application in PHP and I know that the 
client will ask for this feature. So in thinking ahead of time, 
I would like to know if any of you has had any experience 
developing

such an application so that you can point me in the right 
direction.
  
   I just wrote one on the plane back from LinuxTag.  I'll get it up 
   on

   php.net soon and you can steal it from there.
  
   -Rasmus
 


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




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


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




RE: [PHP] Alternative to phpMyAdmin

2001-07-13 Thread Matthew Loff


Unfortunately, it doesn't -- you bring up a good point. 

It does support the compressed client/server protocol, which would make
it harder to intercept-- but encryption is not an option yet on the
client.

I don't suppose there's any way on Win32 to use an SSH tunnel, is there?


-Original Message-
From: Egan [mailto:[EMAIL PROTECTED]] 
Sent: Friday, July 13, 2001 10:06 AM
To: Steve Brett
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Alternative to phpMyAdmin


On Fri, 13 Jul 2001 11:15:52 +0100, Steve Brett
[EMAIL PROTECTED] wrote:

one of the guys i work for has an account with a service provider that 
gives mysql databases as part of his package. he has an account and 
password that is supplied when using mysql-front to connect to his 
database.

Does mysql-front encrypt the password before it travels the net?




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


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




RE: [PHP] The need for strong typing...

2001-07-13 Thread scott [gts]

you could easily write yourself a typing function to take
care of all that (as someone suggested previously) using the
same familiar syntax as you want to use in the function
definition.

function pay($fromaccount, $toaccount, $amount, $memo) {

  $good = checkInput($fromaccount, int, $toaccount, int, $memo, varchar(1000) )
or die(Invalid input!);

  // code...

}

 -Original Message-
 From: Dr. Evil [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, July 12, 2001 10:31 PM
 To: [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] The need for strong typing...


  The one problem with all your musings is that there is no such thing as an
  integer when it comes to transferring data over http.  Everything comes as
  a string.  What is done with these strings when they get to the
  application is what matters.  It's not like there is an HTML form element
  like input type=integer or input type=float.  All you have is input
  type=text when it comes to users entering data and passing it to you.  I
  fail to see how strong typing helps you here at all.  You are going to
  have to apply some sort of user-space rule once you receive the data.  And
  that is quite easy to do with PHP.

 Right, obviously.  The only data type in http is the string.  However,
 there is obviously some value in being able to say:

 function pay(fromaccount int, toaccount int, amount int, memo
varchar(100)) { // 

 instead of:

 function pay(fromaccount, toaccount, amount, memo) { // 

 In the former case, even if there was a mistake in checking user
 input, at least the script will die instead of trying to do some
 operation on some impossible data type.  That's a good thing.

 Obviously, all user input must be taken from string type to other
 types, but internal functions should be constrained.  It's just
 another level of checking.  It's exactly the same reason why databases
 allow you to put constraints into table definitions.  Sure, you should
 check that the value is positive when you do the INSERT, but you
 should also put a constraint into the table.  Lots of things go
 wrong.

 Also obviously, this capability isn't needed for most of what PHP is
 used for, and so maybe it doesn't belong in PHP, and maybe those of us
 who are writing more sensitive aps should look into other things.  Any
 sugestions?

 I don't want people to think that I'm bashing PHP.  I'm not.  I love
 it.  I could never go back to perl or anything else.  It's just that
 I'm working on this one particular financial application, and I'm
 paranoid that something will slip through somewhere, and I would feel
 more comfortable if I could define variables that have built-in
 constraints.  Can I use classes to do this?

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



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




RE: [PHP] Enabling short tags in PHP 4.0.6

2001-07-13 Thread scott [gts]

what do the tags look like?

? ?
or 
% %

the first is a short tag
the second is an asp style tag

maybe you're looking at the wrong option in the 'ini' file.

 -Original Message-
 From: Ralph Guzman [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, July 12, 2001 11:17 PM
 To: Coulee Web; [EMAIL PROTECTED]
 Subject: RE: [PHP] Enabling short tags in PHP 4.0.6
 
 
 Are you sure you have the php.ini file in the right directory? When looking
 at phpinfo() make sure php.ini is located where the Configuration File
 (php.ini) Path is set to.
 
 -Original Message-
 From: Coulee Web [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, July 10, 2001 6:03 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Enabling short tags in PHP 4.0.6
 
 I have just installed PHP 4.0.6 on my server and although the php.ini
 file shows that short open tags should be on, a look at phpinfo() shows
 they are off and of course the don't work. I have a huge site already
 developed using short tags and must turn them on. Does anyone know what
 is wrong? I even configured PHP with the --enable-short-tags option but
 still no luck.
 
 --
 ---
 Shane Lambert, Owner
 Coulee Web
 http://www.couleeweb.net/
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 

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




RE: [PHP] Re: How to maintain a variable between PHP pages (sessions?).

2001-07-13 Thread scott [gts]

sessions or cookies is the way you probably want to go.

you could pass the variable around to each and every
form, but that is a pain in the ass, and extremely
prone to errors.

on the first page, where you check the user's ability to 
use attachments, you could simply set a cookie

setcookie('cookie_can_use_attachments', ... );

and on subsequent pages, check to see if the variable
$cookie_can_use_attachments is set

or, if you plan to carry arounc more information from
page to page than just the user's ability to use attachments,
sessions will make your life much easier 

best of luck.

 -Original Message-
 From: Santiago Romero [mailto:[EMAIL PROTECTED]]
 Sent: Friday, July 13, 2001 2:12 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Re: How to maintain a variable between PHP pages
 (sessions?).
 
 
  Hi!
 
  How is possible to maintain a PHP variable defined on a PHP3 file
  (IMP 2.2.5, mailbox.php3) so that is available for another PHP3
  file (compose.php3) and for future reloads of mailbox.php3?
 
  I have a variable called can_use_attachs (can_use_attachs) that
  is checked on an LDAP server on mailbox.php3 and used on compose.php3.
  The idea is just to check the LDAP server just once (the first
  time) and set that variable so that future reloads do not check the
  ldap server another time.
 
  I'm using the following code, but I suspect that produces a segmen-
  tation fault one time each about 4000 reloads (yes, I can reload
  the page thousands of times automatically, and when I reach about
  4000 it produces a segmentation fault on token_cache.c):
 
 // the beginning of my mailbox.php3 file
 if( !isset( $can_use_attachs ) )
 {
  $ds=ldap_connect(192.168.1.152);
 
  if ($ds)
  {
$r=ldap_bind($ds);
$busca=uid= . $imp-user;
$sr=ldap_search($ds,cn=Correo,o=sistemas.servicom2000,
$busca);
if( ldap_count_entries($ds,$sr)  1 )
  SetCookie( can_use_attachs, 'n', time()+3600 );
else
{ 
  $info = ldap_get_entries($ds, $sr);
  if( $info[0][roomnumber][0] == s )
SetCookie( can_use_attachs, 's', time()+3600 );
  else
SetCookie( can_use_attachs, 'n', time()+3600 );
}
ldap_close($ds);
  }
 }
 
  And in compose.php3:
 
 ? if( $can_use_attachs == 's' ) { ?
 
  input type=hidden name=attachmentAction value=
  (etc...)
  ?php endif; ?
 
 ?php } ?
  
 
  Does anyone know a better way of doing the above? I don't know how
  to use PHP sessions (as used on Horde/IMP) so that I don't need
  cookies to set up that variable.
  
 PS: and if someone can see in the above code what could be the 
 cause of the segmentation fault, please tell me.
 
  CU and thanks a lot.
 -- 
 Santiago Romero
 Departamento de Sistemas
 [EMAIL PROTECTED]
 
 Av. Primado Reig 189, entlo
 46020 Valencia - Spain
 Telf. (+34) 96 332 12 00
 Fax. (+34) 96 332 12 01
 http://www.servicom2000.com
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 

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




[PHP] Export to Excel

2001-07-13 Thread Jorge Alvarez

One of my clients is requesting me to export some data from PHP-generated
pages to MS Excel files. I have no clue on how to do such export with PHP.
I'm using PHP/Apache/Linux Mandrake.

What options do I have?

Your help is very appreciated.

Regards,

Jorge Alvarez
--
Let your screen saver contribute to cancer research.
http://members.ud.com/vypc/cancer/
A new way to help. Sponsored by Intel.



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




[PHP] Post processing Perl output through PHP

2001-07-13 Thread tau

Hi all,

I am having a knightmare trying to get some PHP into the output of
a Perl script. PHP. I've heard rumours of Apache 2.0 allowing multiple
filters, which would be perfect when it's out, but not yet obviously.

I've tried calling the CGI PHP from inside Perl in a few ways:

==
#!/usr/bin/perl
$result = `/usr/bin/php -q  EOF
?php echo Hello World; ?
EOF
`;
print Content-Type: text/html\n\n;
print PHP output was $result\n;
exit;
==

I've also tried running this command as a system() call in Perl, and
sending the output of /usr/bin/php to a temporary file, then using
Perl to open and read the contents of that file.

Both methods work if I call the script myself at a shell prompt. In
the case of the file creation, an 11 byte file is duly created.

However, when I call the perl script from a web browser, I lose the
PHP output. The code given above doesn't help narrow it down, but
in the case of the file creating version, I notice back at a shell
prompt that the call to /usr/bin/php has made a 0 byte file... which
obviously explains why I see nothing once Perl copies it to the output.

So, that means there is something about /usr/bin/php that is making it
generate absolutely no output when called via apache and the perl script.

I am guessing that this has to do with the environment variables, as I
can see no other way in which /usr/bin/php would be aware of a difference
in its environment.

So, my question is, does anybody know how to persuade PHP to give me the
output when called in this way... perhaps by forging an environment 
variable from Perl first, or some clever command line switch...

Alternatively, and much preferred, some way of parsing the whole of the
perl output through PHP before returning to the browser. Then I could
just print PHP tags in my Perl output and Apache/mod_php would handle
the rest on the way back...

For reasons that really aren't worth going into, I need to access some
messy PHP functions from Perl, and I can't rewrite the PHP functions in
Perl because I have .php pages that need them, and I can't rewrite the
Perl scripts in PHP either. If I can't find a way of doing this, I will
probably tear all my hair out and then sit down to rewrite a separate
copy of every routine in Perl, and have two copies of all the code in
two different languages... knightmare come true !

Please please help me !!!

James
[EMAIL PROTECTED]

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




Re: [PHP] Enabling short tags in PHP 4.0.6

2001-07-13 Thread Coulee Web

Thank you - that did the trick! The php.ini file WAS in the wrong
folder. Too bad the ./configure command doesn't know where to put it!

Ralph Guzman wrote:
 
 Are you sure you have the php.ini file in the right directory? When looking
 at phpinfo() make sure php.ini is located where the Configuration File
 (php.ini) Path is set to.
 
 -Original Message-
 From: Coulee Web [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, July 10, 2001 6:03 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Enabling short tags in PHP 4.0.6
 
 I have just installed PHP 4.0.6 on my server and although the php.ini
 file shows that short open tags should be on, a look at phpinfo() shows
 they are off and of course the don't work. I have a huge site already
 developed using short tags and must turn them on. Does anyone know what
 is wrong? I even configured PHP with the --enable-short-tags option but
 still no luck.
 
 --
 ---
 Shane Lambert, Owner
 Coulee Web
 http://www.couleeweb.net/
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
---
Shane Lambert, Owner
Coulee Web
http://www.couleeweb.net/

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




RE: [PHP] Export to Excel

2001-07-13 Thread Kurt Lieber

Easiest way is to export the data into comma-delimited format. (.csv
files)  Excel can import those no problem.

So, you would write a php function that created a simple text file that
looked like:

Fieldname1,fieldname2,fieldname3
Data1,data2,data3
Etc.

And excel can open that kind of file right up.

Hth
--kurt

-Original Message-
From: Jorge Alvarez [mailto:[EMAIL PROTECTED]] 
Sent: Friday, July 13, 2001 9:58 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Export to Excel


One of my clients is requesting me to export some data from
PHP-generated pages to MS Excel files. I have no clue on how to do such
export with PHP. I'm using PHP/Apache/Linux Mandrake.

What options do I have?

Your help is very appreciated.

Regards,

Jorge Alvarez
--
Let your screen saver contribute to cancer research.
http://members.ud.com/vypc/cancer/
A new way to help. Sponsored by Intel.



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



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




Re: [PHP] Export to Excel

2001-07-13 Thread BELL, JASON (PB)

You could try writing the data out to a comma seperated file, and then offer
the file for download. Excel understands these files, and they are
plaintext, therefore easy to create.

Jason Bell

Jorge Alvarez [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]...
 One of my clients is requesting me to export some data from PHP-generated
 pages to MS Excel files. I have no clue on how to do such export with PHP.
 I'm using PHP/Apache/Linux Mandrake.
 
 What options do I have?
 
 Your help is very appreciated.
 
 Regards,
 
 Jorge Alvarez 

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




RE: [PHP] Export to Excel

2001-07-13 Thread Neil Kimber

Dump to file as comma separated and then load into Excel. Excel reads comma
separated files. In the file open dialog you can select file type to be .txt
(csv).

If you want to be really sick then you can set up an ODBC connection to a
comma separated file and then use MSQuery inside Excel.

Another alternative is to dump out your data to a webpage in an HTML table.
Excel can link to the web page, just goto to Data-Get External Data-New
Web Query. Select the URL and you're away. This is quite a cool feature as
you don't have to send out updated files on a continual basis.

Enjoy.

-Original Message-
From: Jorge Alvarez [mailto:[EMAIL PROTECTED]]
Sent: 13 July 2001 17:58
To: [EMAIL PROTECTED]
Subject: [PHP] Export to Excel


One of my clients is requesting me to export some data from PHP-generated
pages to MS Excel files. I have no clue on how to do such export with PHP.
I'm using PHP/Apache/Linux Mandrake.

What options do I have?

Your help is very appreciated.

Regards,

Jorge Alvarez
--
Let your screen saver contribute to cancer research.
http://members.ud.com/vypc/cancer/
A new way to help. Sponsored by Intel.



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




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




RE: [PHP] Alternative to phpMyAdmin

2001-07-13 Thread scott [gts]

like you said... as long as the database provider accepts
connections from outside, you can administer it from anywhere.

if the provider doesn't accept incoming connections, no amount
of tools and software will work for you.

 -Original Message-
 From: Alexander Skwar [mailto:[EMAIL PROTECTED]]On Behalf Of
 Subject: RE: [PHP] Alternative to phpMyAdmin


  if you install mysql on a windoze machine then you can administer ANY 
 mysql database going through the socket.

 Okay, for a development this may be fine, but I still fail to see how a
 tool that runs on your own computer (no matter if it's a Windows tool, or
 a Linux tool) can help you administer databases which are not on the same
 computer (unless the mysql database on the providers server can be
 contacted from any machine and not just from localhost).

 --
 Homepage:http://www.digitalprojects.com   |   http://www.iso-top.de
 iso-top.de - Die günstige Art an Linux Distributionen zu kommen

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



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




RE: [PHP] forms and IP numbers

2001-07-13 Thread scott [gts]

no offense, but that's a bad kludge for the problem.

however, if you really want to do that, you could try
checking $SERVER_NAME and $HTTP_REFERER and other
enviornment variables like that... 

what would be easier (and better practise) to do is to 
verify that the incoming username is valid... 


 -Original Message-
 From: Marc van Duivenvoorde [mailto:[EMAIL PROTECTED]]
 Sent: Friday, July 13, 2001 6:10 AM
 To: Php general lijst
 Subject: [PHP] forms and IP numbers
 
 
 A friend of mine found a bug in my messageboard code, this way he can post 
 with other (than in my database) nicknames from a local form. Now I want to 
 have the formhandler do a check from where the form is sent. If it is not 
 sent from my own webserver it has to display an error message.
 
 Thanks,
 
 Marc van Duivenvoorde
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 

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




RE: [PHP] forms and IP numbers

2001-07-13 Thread Randy Johnson

I would like to pull the date and time of the creation of a file via a php
script and compare it to the current time.

How do I do this?

TIA

Randy


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




[PHP] Re: How to convert a string into a mathematical expression?

2001-07-13 Thread Philip Hallstrom

Take a look at the eval() function.

On Fri, 13 Jul 2001, Christodoulou Demetris wrote:

  Hi list.
  I have string variables that contain mathematical expressions. These
 strings are submitted through forms.
 For example if a user inserts the following- 1+cos(0.3)*x into a text field
 with name expression in an  HTML form then
 what i get on the server is the string variable $expression whose values is
 1+cos(0.3)*x

 Is there a way to convert the string variable, $expression, into a
 mathematical expression that can  be calculated?
  Thanks in advance.
  DX.




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



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




[PHP] Re: Export to Excel

2001-07-13 Thread Philip Hallstrom

Instead of the comma-separated suggestions mentioned in other posts, I'd
recommend using a tab-separated file so that you don't have any confusion
for entries such as addresses that might look like Seattle, WA.  The
other reason is that it's *really* hard to enter a TAB in an HTML form so
it's just nicer.

The other thing to look out for is TEXTAREA inputs where people have
entered newlines.  You'll need to convert those back to spaces before
exporting otherwise the file won't be one record per line.

On Fri, 13 Jul 2001, Jorge Alvarez wrote:

 One of my clients is requesting me to export some data from PHP-generated
 pages to MS Excel files. I have no clue on how to do such export with PHP.
 I'm using PHP/Apache/Linux Mandrake.

 What options do I have?

 Your help is very appreciated.

 Regards,

 Jorge Alvarez
 --
 Let your screen saver contribute to cancer research.
 http://members.ud.com/vypc/cancer/
 A new way to help. Sponsored by Intel.



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



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




Re: [PHP] Re: Export to Excel

2001-07-13 Thread Marius Andreiana

How do you deal with numeric fields which start with 0 ?
Excel takes the 0s out.

Thanks,
Marius Andreiana
--
You don't have to go to jail for helping your neighbour
http://www.gnu.org/philosophy/


 



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




RE: [PHP] forms and IP numbers

2001-07-13 Thread scott [gts]

stat()

 -Original Message-
 From: Randy Johnson [mailto:[EMAIL PROTECTED]]
 Sent: Friday, July 13, 2001 4:09 PM
 To: scott [gts]; php
 Subject: RE: [PHP] forms and IP numbers
 
 
 I would like to pull the date and time of the creation of a file via a php
 script and compare it to the current time.
 
 How do I do this?
 
 TIA
 
 Randy
 

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




RE: [PHP] Re: How to convert a string into a mathematical expression?

2001-07-13 Thread scott [gts]

be *extremely* careful.  eval() is like spawning another PHP
interpreter... it'll execute *any* code that you give it.

people could type in unlink(); and such commands and really
trash your webserver.

 -Original Message-
 From: Philip Hallstrom [mailto:[EMAIL PROTECTED]]
 Subject: [PHP] Re: How to convert a string into a mathematical
 expression?
 
 Take a look at the eval() function.
 


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




RE: [PHP] session problem using headers

2001-07-13 Thread scott [gts]

you're passing the PHPSESSID incorrectly, it seems

you must do something like this:
  A HREF=nextpage.php??=SID?
or
  header(Location: nextpage.php?$SID);

what you're doing now will go to page input.php?=SID
instead of input.php?938sa9fa98f7daf987a9s (or similar)


 -Original Message-
 From: David Allen [mailto:[EMAIL PROTECTED]]
 Sent: Friday, July 13, 2001 6:45 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] session problem using headers
 
 
 Hi,
 
 I am having problems with sessions. With cookies turned on it works
 fine. Turn off cookies it fails.
 
 I have tried both
 
 header(Location: input.php?=SID);
 header(Location: input.php?PHPSESSID=.PHPSESSID);
 
 to pass the session id to the programme input.php but neither works.
 
 The first lines of input.php are
 
 ?
 session_register(userid);
 ?
 
 userid is the variable  I wish to pass. However, I have no other code
 related to sessions in this script. Do I need in some way tell the
 script to use this session id?
 
 As a have said before, it works fine if cookies are turned on.
 
 Thanks in advance for any help.
 
 David
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 

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




[PHP] which php shopping cart is this?

2001-07-13 Thread pyz

Greetings!

Which php-based shopping cart is being used at this site?
http://shop.t-shirtoutlet.com/catalog/


Thanks!



Max Pyziur BRAMA - Gateway Ukraine
[EMAIL PROTECTED]  http://www.brama.com/

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




[PHP] ODBC to MS-Access View?

2001-07-13 Thread Hankley, Chip

I'm trying to connect up w/ an Access database one of our db administrators
set up.

The Access file has an adp extension...the data is housed in a view,
(essentially a read-only dump of some MS SQL Server tables).

I've set up the file as a System DSN in ODBC (WinNT)

When I issue the following command:

  $conn_id = odbc_connect($db, $username, $password) or die();

I get the following error:

Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver] The Microsoft
Jet database engine cannot open the file '(unknown)'. It is already opened
exclusively by another user, or you need permission to view its data., SQL
state S1000 in SQLConnect in C:\Inetpub\wwwroot/seating/sharondb.php on line
36

Any ideas? I am supplying the correct username and password...

Thanks

Chip Hankley

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




RE: [PHP] The need for strong typing...

2001-07-13 Thread Merio, Quinn

I was going to suggest this too.

I like doing any sort of transactions or complex business logic using
components whether they be servlets, com objects, etc.

I would take advantage of the ability to integrate different technologies.
Also, it helps using a compiled language for the bus logic, because a
designer (for example) couldnt accidentally open your page in a wysiwymg
editor and kill parts of your app.

my addt .02
q.





-Original Message-
From: Opec Kemp [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 12, 2001 9:17 PM
To: Dr. Evil
Cc: PHP List
Subject: RE: [PHP] The need for strong typing...


 I will look into JSP.

 Even on the same website, we could have two different languages: Maybe
 we'll use JSP for the transaction stuff, and PHP for customer support
 pages, where things are less critical.

Incidentally, PHP4 can also use some Java Serverlet or Bean. Check out this
bit from the manual:

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

This PHP/Java combo could be what you needed :)


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

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




[PHP] mysql ERROR: Update Query Failed problem with 4.0.6

2001-07-13 Thread David Wartell

Im using PHP 4.0.6 install on Solaris x86 with mysql 3.23.39.  The following code 
causes mysql_query to return false, but the
database update works!

$query .= WHERE User_Name = '$User_Name[$i]' ;
$sth = mysql_query($query) or die (pERROR: Update Query Failedp$queryBR) ;
if ($verbose) {
print ($queryBR);
}

Here is the error message generated by the code:
ERROR: Update Query Failed
UPDATE Padmin SET Full_Name = 'Corin Cody', Admin = 1 WHERE User_Name = 'ccody'

I was recieving the following warning from the code above until I changed 
error_reporting = E_ERROR
Warning: MySQL: Unable to save result set in
/usr/www/netsite-docs/parda.actionwebservices.com/public-html/includes/admin_user_write.php
 on line 26

Here are my PHP build options:
CC=gcc OPTIM=-O2 EXTRA_LIBS=/usr/local/lib LIBS=-lz
./configure  --with-apxs=/usr/local/httpd/bin/apxs --with-mysql=/usr/local/mysql/ 
--with-png-dir=/usr/local/lib/libpng.so.2 --with-i
map=/usr/local/lib --with-lz=/usr/local/lib

Any ideas?

Thanks,
David


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




RE: [PHP] which php shopping cart is this?

2001-07-13 Thread Jerry Lake

I think that is opencart, or openshop something
like that. I ran across it at www.hotscripts.com
a while back.

Jerry Lake
Interface Engineering Technician
Europa Communications - http://www.europa.com
Pacifier Online - http://www.pacifier.com


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 13, 2001 10:47 AM
To: [EMAIL PROTECTED]
Subject: [PHP] which php shopping cart is this?


Greetings!

Which php-based shopping cart is being used at this site?
http://shop.t-shirtoutlet.com/catalog/


Thanks!



Max Pyziur BRAMA - Gateway Ukraine
[EMAIL PROTECTED]  http://www.brama.com/

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



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




Re: [PHP] which php shopping cart is this?

2001-07-13 Thread James W Greene

Actually is is TEP at www.theexchangeproject.org
JG
- Original Message - 
From: Jerry Lake [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, July 13, 2001 2:02 PM
Subject: RE: [PHP] which php shopping cart is this?


 I think that is opencart, or openshop something
 like that. I ran across it at www.hotscripts.com
 a while back.
 
 Jerry Lake
 Interface Engineering Technician
 Europa Communications - http://www.europa.com
 Pacifier Online - http://www.pacifier.com
 
 
 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
 Sent: Friday, July 13, 2001 10:47 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] which php shopping cart is this?
 
 
 Greetings!
 
 Which php-based shopping cart is being used at this site?
 http://shop.t-shirtoutlet.com/catalog/
 
 
 Thanks!
 
 
 
 Max Pyziur BRAMA - Gateway Ukraine
 [EMAIL PROTECTED]  http://www.brama.com/
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 


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




RE: [PHP] which php shopping cart is this?

2001-07-13 Thread Jerry Lake

Never mind that last message,
It is The Exchange Project
http://theexchangeproject.org/catalog/default.php?

Jerry Lake 
Interface Engineering Technician
Europa Communications - http://www.europa.com
Pacifier Online - http://www.pacifier.com


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 13, 2001 10:47 AM
To: [EMAIL PROTECTED]
Subject: [PHP] which php shopping cart is this?


Greetings!

Which php-based shopping cart is being used at this site?
http://shop.t-shirtoutlet.com/catalog/


Thanks!



Max Pyziur BRAMA - Gateway Ukraine
[EMAIL PROTECTED]  http://www.brama.com/

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



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




[PHP] peculiar behaviour of large integers with and

2001-07-13 Thread scott [gts]

Has anyone come across this before?

// compare 5 to the max value of an integer
if (5  -2147483647) {
  print This is;
}

// knock a digit off the max and compare again
if (5  -214748364) {
  print weird;
}

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




RE: [PHP] Export to Excel

2001-07-13 Thread Brady Hegberg

Here's something I found on the PHP Code Exchange:

Generate Excel files from PHP by Christian Novak on 2000-11-25 11:47:24
(v for 4.0) is 1974 bytes.
Small function library to generate Excel files/stream directly from PHP.

http://px.sklar.com/code.html?code_id=488

I haven't tried it out...it doesn't look terribly sophisticated but it
might work.

Brady

 Dump to file as comma separated and then load into Excel. Excel reads comma
 separated files. In the file open dialog you can select file type to be .txt
 (csv).
 
 If you want to be really sick then you can set up an ODBC connection to a
 comma separated file and then use MSQuery inside Excel.
 
 Another alternative is to dump out your data to a webpage in an HTML table.
 Excel can link to the web page, just goto to Data-Get External Data-New
 Web Query. Select the URL and you're away. This is quite a cool feature as
 you don't have to send out updated files on a continual basis.
 
 Enjoy.
 
 -Original Message-
 From: Jorge Alvarez [mailto:[EMAIL PROTECTED]]
 Sent: 13 July 2001 17:58
 To: [EMAIL PROTECTED]
 Subject: [PHP] Export to Excel
 
 
 One of my clients is requesting me to export some data from PHP-generated
 pages to MS Excel files. I have no clue on how to do such export with PHP.
 I'm using PHP/Apache/Linux Mandrake.
 
 What options do I have?
 
 Your help is very appreciated.
 
 Regards,
 
 Jorge Alvarez
 --
 Let your screen saver contribute to cancer research.
 http://members.ud.com/vypc/cancer/
 A new way to help. Sponsored by Intel.
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 


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




RE: [PHP] peculiar behaviour of large integers with and

2001-07-13 Thread Johnson, Kirk

?
// compare 5 to the max value of an integer
if (5  -2147483647) {
  print This is;
} else {
  print Nothing ;
}

// knock a digit off the max and compare again
if (5  -214748364) {
  print weird;
} else {
  print unusual;
}
?

I get nothing unusual

Kirk

 -Original Message-
 From: scott [gts] [mailto:[EMAIL PROTECTED]]
 Sent: Friday, July 13, 2001 12:08 PM
 To: php
 Subject: [PHP] peculiar behaviour of large integers with  and 
 
 
 Has anyone come across this before?
 
 // compare 5 to the max value of an integer
 if (5  -2147483647) {
   print This is;
 }
 
 // knock a digit off the max and compare again
 if (5  -214748364) {
   print weird;
 }

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




RE: [PHP] Export to Excel

2001-07-13 Thread Boget, Chris

 Here's something I found on the PHP Code Exchange:
 Generate Excel files from PHP by Christian Novak on 
 2000-11-25 11:47:24 (v for 4.0) is 1974 bytes.
 Small function library to generate Excel files/stream 
 directly from PHP.
 http://px.sklar.com/code.html?code_id=488
 I haven't tried it out...it doesn't look terribly sophisticated but it
 might work.

I just tried it and it didn't work.  At least, not for Excel2k.  It
created an .xls file but it wasn't something that could be opened
and read by my version of XL.

Chris



RE: [PHP] peculiar behaviour of large integers with and

2001-07-13 Thread scott [gts]

after reading thru the PHP site some more, i found a little
note mentioning a problem with the way negative integers are
handled in v4.0.6...

what version are you using?
what do you see when you run this code?

if (5  -2147483647) {
print This is printed.;
}

if (5  -214748364) {
print This is not.;
}

 -Original Message-
 From: Johnson, Kirk [mailto:[EMAIL PROTECTED]]
 Sent: Friday, July 13, 2001 2:23 PM
 To: [EMAIL PROTECTED]
 Subject: RE: [PHP] peculiar behaviour of large integers with  and 
 
 
 ?
 // compare 5 to the max value of an integer
 if (5  -2147483647) {
   print This is;
 } else {
   print Nothing ;
 }
 
 // knock a digit off the max and compare again
 if (5  -214748364) {
   print weird;
 } else {
   print unusual;
 }
 ?
 
 I get nothing unusual
 
 Kirk
 
  -Original Message-
  From: scott [gts] [mailto:[EMAIL PROTECTED]]
  Sent: Friday, July 13, 2001 12:08 PM
  To: php
  Subject: [PHP] peculiar behaviour of large integers with  and 
  
  
  Has anyone come across this before?
  
  // compare 5 to the max value of an integer
  if (5  -2147483647) {
print This is;
  }
  
  // knock a digit off the max and compare again
  if (5  -214748364) {
print weird;
  }
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 

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




Re: [PHP] Export to Excel

2001-07-13 Thread Aaron Bennett

Interesting... I have excel2k, and it worked fine for me... The only thing i
can think of is maybe some extra garbage you get when it generates the
file... maybe headers?
--
Aaron Bennett
[EMAIL PROTECTED]

- Original Message -
From: Boget, Chris [EMAIL PROTECTED]
To: 'Brady Hegberg' [EMAIL PROTECTED]; [EMAIL PROTECTED]
Cc: Jorge Alvarez [EMAIL PROTECTED]
Sent: Friday, July 13, 2001 11:33 AM
Subject: RE: [PHP] Export to Excel


  Here's something I found on the PHP Code Exchange:
  Generate Excel files from PHP by Christian Novak on
  2000-11-25 11:47:24 (v for 4.0) is 1974 bytes.
  Small function library to generate Excel files/stream
  directly from PHP.
  http://px.sklar.com/code.html?code_id=488
  I haven't tried it out...it doesn't look terribly sophisticated but it
  might work.

 I just tried it and it didn't work.  At least, not for Excel2k.  It
 created an .xls file but it wasn't something that could be opened
 and read by my version of XL.

 Chris



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




RE: [PHP] peculiar behaviour of large integers with and

2001-07-13 Thread Johnson, Kirk

I am running 4.0.6. Nothing prints to the screen using a cut and paste of
the code below.

 -Original Message-
 From: scott [gts] [mailto:[EMAIL PROTECTED]]
 Sent: Friday, July 13, 2001 12:25 PM
 To: php
 Subject: RE: [PHP] peculiar behaviour of large integers with 
  and 
 
 
 after reading thru the PHP site some more, i found a little
 note mentioning a problem with the way negative integers are
 handled in v4.0.6...
 
 what version are you using?
 what do you see when you run this code?
 
 if (5  -2147483647) {
 print This is printed.;
 }
 
 if (5  -214748364) {
 print This is not.;
 }

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




RE: [PHP] Session Variables and Redirecting

2001-07-13 Thread Johnson, Kirk

You should be able to do exactly what you want, I do this myself. I am
wondering if you are hitting a bug that is present in PHP in versions prior
to 4.0.6, where $someflag and$HTTP_SESSION_VARS[someflag] do not reference
the same value. Try changing two lines in your code to read as below,
instead of using the $HTTP_SESSION_VARS array:

$someflag = somevalue;
$failedattempts++;

Kirk

 -Original Message-
 From: Johnny Nguyen [mailto:[EMAIL PROTECTED]]
 Sent: Friday, July 13, 2001 12:36 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Session Variables and Redirecting
 
 
 I've done this on other platforms ASP,Cold Fusion, but I need 
 to know what's
 the best way to do it on PHP.
 
 1. grab username and password from POST vars.
 2. select count(*) from users where username = '$username' and
 password='$password'... something along these lines
 3. if that user exists and password matches, set a flag on 
 the user and send
 them to the right page, otherwise increment failed attempts 
 and send them
 back to login page.
 
 if (count  0)
 
   session_register(someflag);
   $HTTP_SESSION_VARS[someflag] = somevalue;
   header(Location: secretpage.php);
 }
 else
 
   session_register(failedattempts);
   $HTTP_SESSION_VARS[failedattempts]++;
   header(Location: loginpage.php);
 }
 
 but apparently, i can't start/register a session and then 
 redirect.  Is
 there a better way to do this?
 
 Regards,
 Johnny

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




[PHP] Piping Mime String to Metamail Fails

2001-07-13 Thread Jeff Hill

I've tried everything I can to pipe a string with mime content to
metamail, but it fails in every variation of:

exec(echo $mime_string | /usr/bin/metamail -d -q -r -w -x -y ,
$met_res) ;

I can successfully write the mime string to a tmp file, and then:

exec( cat /tmp/mime_mail | /usr/bin/metamail -d -q -r -w -x -y ,
$met_res) ;

but this seems very inefficient (writing a string to a file only to pass
it to a program). I'm also afraid the file may still be busy from the
write at the time I try to pass it to metamail.

I've tried using PassThru, System and the backtick operator as well.
I've tried the -e switch for echo, with nothing. The closest I've
gotten, running php as a cgi from the terminal, is the bash response:

sh: -c: line 1: syntax error near unexpected token `|'
sh: -c: line 1: ` | /usr/bin/metamail -d -q -r -w -x -y '

I suspect that the problem is in echoing mime content, but I'm uncertain
how else I could pipe the string to metamail? 

This is the last hitch in my script for handling incoming e-mail and
putting the mime into attachments as appropriate in a mysql database. I
looked through the archives at the various methods for handling mime,
and using metamail seemed like the best idea, but now I'm wondering.

Thanks for any suggestions.

Jeff Hill,
No programmer here

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




[PHP] POST data is lost on PHP CGI after shmat() failed. [4.0.5, Linux]

2001-07-13 Thread Steven Haryanto

I have two CGI PHP installation on my Linux system. One of them is
a vanilla build (all defaults except --prefix and
--with-config-file-path, and the other is built with the .spec file
from rpms.arvin.dk).

POST method does not work with the arvin PHP CGI binary, while it
works ok with the vanilla one and with other non-PHP CGI scripts.
After spending a full day focusing on environment variables and
Apache configuration (which is a custom one), I run strace on a
simple script using the arvin PHP. Here's the partial output:

...
shmget(IPC_PRIVATE, 33554432, IPC_CREAT|0x180|0600) = 5079044
shmat(5079044, 0, 0)= -1 ENOMEM (Cannot allocate memory)
shmctl(5079044, IPC_RMID, 0)= 0
close(0)= 0
unlink(/tmp/session_mm.sem)   = -1 ENOENT (No such file or directory)
brk(0x8155000)  = 0x8155000
brk(0x8156000)  = 0x8156000
open(./php.ini, O_RDONLY) = -1 ENOENT (No such file or directory)
open(/etc/php.ini, O_RDONLY)  = 0
getcwd(/path/to/script, 4095) = 46
lstat(/etc, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat(/etc/php.ini, {st_mode=S_IFREG|0644, st_size=20430, ...}) = 0
brk(0x815b000)  = 0x815b000
ioctl(0, TCGETS, 0xb828)= -1 ENOTTY 
(Inappropriate ioctl for device)
read(0, [PHP]\n\n;;;\n; Abo..., 8192) = 8192
read(0, \t; C, E  S respectively, often ..., 8192) = 8192
brk(0x815c000)  = 0x815c000
read(0, t_password\t\t=\t\t; default passwor..., 8192) = 4046
read(0, , 4146)   = 0
...

I am not sure what line of code does the close(0) on the fourth line
shown above, though it has something to do with the MM library, since
after I rebuild PHP --without-mm, all is well.

Could someone shed a light on this?

Regards,
Steve


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




RE: [PHP] Regex Help

2001-07-13 Thread Erick Calder

Sheridan,

I didn't test this in PHP, I'm more familiar with the Perl Regex, but this
might work for you, play with it:

/img\s*src=([^ ]*)/

note: \s = whitespace and the [^ ] means any nonspace character... the only
issue remaining that you might find s or 's around the string matched into
the ().

- e r i c k

-Original Message-
From:   Sheridan Saint-Michel [mailto:[EMAIL PROTECTED]]
Sent:   Friday, July 13, 2001 9:04 AM
To: [EMAIL PROTECTED]
Subject:[PHP] Regex Help

I am trying to write a script that needs a list of all the images in an HTML
file.

I am trying this code

if (eregi ((img.+src=)(.+)[\s],$buffer, $regs ))
{
  echo $regs[2]BRBR;
}

The problem, however is that when it looks at

IMG SRC=images/Logo.gif ALT=Only Child Club - The Place for Only
Children

instead of getting images/Logo.gif like I want I am getting

images/Logo.gif ALT=Only Child Club - The Place for Only Children

I am not as familiar with Regexes as I would like and any help would be
greatly appreciated

Thanks

Sheridan Saint-Michel
Website Administrator
FoxJet, an ITW Company
www.foxjet.com


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




RE: [PHP] peculiar behaviour of large integers with and

2001-07-13 Thread Johnson, Kirk

I'll bet it did! Sorry, nothing unusual here, good luck.

 -Original Message-
 From: scott [gts] [mailto:[EMAIL PROTECTED]]
 Sent: Friday, July 13, 2001 12:50 PM
 To: php
 Subject: RE: [PHP] peculiar behaviour of large integers with 
  and 
 
 
 i guess you've got a more recent version of PHP than i do...
 
 For me, it prints out This is printed but not 
 This is not printed, which made my eyebrows touch the
 ceiling when i first saw that... 

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




Re: [PHP] GD help

2001-07-13 Thread jeremy brand

Hi Chad,

You can follow my example at:
http://www.nirvani.net/software/image_create/

Hope this helps.
Jeremy Brand

Jeremy Brand :: Sr. Software Engineer :: +393485323988 :: [EMAIL PROTECTED]
http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for more
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
LINUX is obsolete  -- Andy Tanenbaum, January 29th, 1992
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  Get your own Free, Private email at http://www.smackdown.com/

On Fri, 13 Jul 2001, the following spilled from the mind of Angerer, Chad:

 Date: Fri, 13 Jul 2001 11:13:47 -0500
 From: Angerer, Chad [EMAIL PROTECTED]
 To: '[EMAIL PROTECTED]' [EMAIL PROTECTED]
 Subject: [PHP] GD help

 I am having some problems generating images with GD.  I am using GD 1.6.2
 and trying to create a .png image.  I know it works.  I have created just a
 generic graphic without trying to put variables into it and am hoping
 someone can help me on this one.  Here is some code snippet

 // here is my gd.php file to create the image

 ?

 Header ( Content-Type: image/png );

 $im  =  ImageCreate ( 10,  200 );
 $red  =  ImageColorAllocate ( $im,  255,  0,  0 );
 $white  =  ImageColorAllocate ( $im ,  255,  255,  255 );
 $blue  =  ImageColorAllocate ( $im ,  0 ,  0 ,  255 );
 $gray  =  ImageColorAllocate ( $im , 0xC0, 0xC0 , 0xC0 );

 ImageFill ( $im , 0 , 0 , $gray );
 ImageFilledRectangle ( $im , 0 ,$bluehg, 3, 200, $blue );
 ImageFilledRectangle ( $im , 6, $redhg, 10, 200, $red );

 // write the image
 ImagePNG( $im );

 // clean up the mess
 ImageDestroy($im);
 ?

 // here is the function that I use to determine the attributes of the image

 // create a function to call gd.php
 function graphic($blueval, $redval)
 {
   $pctrd = round($blueval*100, 1);
   $pctbl = round($redval*100, 1);
   $blueval = ($blueval * 200);
   $redval = ($redval * 200);

   echo table
   tr
   td
 align=\center\$pctbl%/td
   tdimg
 src=\gd.php?bluehg=$bluevalredhg=$redval\ height=\100\ //td
   td
 align=\center\$pctrd/td
   /tr
   /table;
 }

 On the page I get a broken image.  If I view the source I see the image is
 being called with params.

 Any help would be appreciated.

 Thanks.

 Chad






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




[PHP] encryption methods?

2001-07-13 Thread Adrian Teasdale

Hi all

Encryption is not something that I have had dealings in with PHP.  I have a
potential client who wants to have customer account information (8000
records) stored on the internet (minus credit card information) and I was
wondering what options I have for encryption.  My concern is that by storing
the password in php scripts, this means that all someone has to do is gain
access to this to access the data.  I'd be interested in other people's
views and experiences with this.

With thanks

Ade


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




Re: [PHP] Export to Excel

2001-07-13 Thread Reuben D Budiardja

Hmm, I tried it, and my excel 2k could not read it either. I even change the 
echo to fwrite, and delete all the headers. What did you do to your source 
code? just copy it or did you modify it?
Could you possibly send it to me off list?

Thanks
Reuben D. Budiardja

On Friday 13 July 2001 01:36 pm, Aaron Bennett wrote:
 Interesting... I have excel2k, and it worked fine for me... The only thing
 i can think of is maybe some extra garbage you get when it generates the
 file... maybe headers?
 --
 Aaron Bennett
 [EMAIL PROTECTED]

 - Original Message -
 From: Boget, Chris [EMAIL PROTECTED]
 To: 'Brady Hegberg' [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Cc: Jorge Alvarez [EMAIL PROTECTED]
 Sent: Friday, July 13, 2001 11:33 AM
 Subject: RE: [PHP] Export to Excel

   Here's something I found on the PHP Code Exchange:
   Generate Excel files from PHP by Christian Novak on
   2000-11-25 11:47:24 (v for 4.0) is 1974 bytes.
   Small function library to generate Excel files/stream
   directly from PHP.
   http://px.sklar.com/code.html?code_id=488
   I haven't tried it out...it doesn't look terribly sophisticated but it
   might work.
 
  I just tried it and it didn't work.  At least, not for Excel2k.  It
  created an .xls file but it wasn't something that could be opened
  and read by my version of XL.
 
  Chris


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




[PHP] Converting from paradox DB to mysql

2001-07-13 Thread Robert Mena

Hi,

Does anybody knows how can I convert from a Paradox DB
to mysql ?  I've searched freshmeat.net but pxtools
gives me core dump and unixODBC seems to be just the
driver (i.e I'd have to write a convertion tool).

Thanks.

__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

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




[PHP] HTTP Authorization

2001-07-13 Thread Tom Malone

Call me stupid, because this may be a stupid question, but I have searched
all over for the answer and cannot find it.

How can you get the username and password from HTTP_AUTH_USER or another
environment variable in PHP? I need to determine who is logging in so I can
connect to the correct database.

Thank you!
Tom


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




RE: [PHP] Piping Mime String to Metamail Fails

2001-07-13 Thread Don Read

`
On 13-Jul-01 Jeff Hill wrote:
 I've tried everything I can to pipe a string with mime content to
 metamail, but it fails in every variation of:
 
 exec(echo $mime_string | /usr/bin/metamail -d -q -r -w -x -y ,
 $met_res) ;
 

 what about /bin/echo ...

Regards,
-- 
Don Read   [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.

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




RE: [PHP] encryption methods?

2001-07-13 Thread Johnson, Kirk

One approach to password security is to put the passwords in a file outside
Document Root, then include that file in your scripts when you need a
password.

Kirk

 -Original Message-
 From: Adrian Teasdale [mailto:[EMAIL PROTECTED]]
 Sent: Friday, July 13, 2001 1:10 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] encryption methods?
 
 
 Hi all
 
 Encryption is not something that I have had dealings in with 
 PHP.  I have a
 potential client who wants to have customer account information (8000
 records) stored on the internet (minus credit card 
 information) and I was
 wondering what options I have for encryption.  My concern is 
 that by storing
 the password in php scripts, this means that all someone has 
 to do is gain
 access to this to access the data.  I'd be interested in 
 other people's
 views and experiences with this.
 
 With thanks
 
 Ade
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: 
 [EMAIL PROTECTED]
 

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




RE: [PHP] HTTP Authorization

2001-07-13 Thread Don Read


On 13-Jul-01 Tom Malone wrote:
 Call me stupid, because this may be a stupid question, but I have searched
 all over for the answer and cannot find it.
 
 How can you get the username and password from HTTP_AUTH_USER or another
 environment variable in PHP? I need to determine who is logging in so I can
 connect to the correct database.

 
http://localhost/phpmanual/language.variables.predefined.html
http://localhost/phpmanual/function.getenv.html
http://localhost/phpmanual/features.http-auth.html

Regards,
-- 
Don Read   [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.

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




Re: [PHP] Piping Mime String to Metamail Fails

2001-07-13 Thread Jeff Hill

Don Read wrote:
 On 13-Jul-01 Jeff Hill wrote:
  I've tried everything I can to pipe a string with mime content to
  metamail, but it fails in every variation of:
 
  exec(echo $mime_string | /usr/bin/metamail -d -q -r -w -x -y ,
  $met_res) ;
 
  what about /bin/echo ...

Nope, but I do appreciate the thought. Using /bin/echo just results in
$met_res becoming an empty array, as does my example string.

I should have said before that I've also tried this with several
versions of php, primarily 4.0.6 (all on Debian sid linux). 

Regards,

Jeff Hill
 
 Regards,
 --
 Don Read   [EMAIL PROTECTED]
 -- It's always darkest before the dawn. So if you are going to
steal the neighbor's newspaper, that's the time to do it.
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 

--  HR On-Line:  The Network for Workplace Issues --
http://www.hronline.com - Ph:416-604-7251 - Fax:416-604-4708


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




Re: [PHP] encryption methods?

2001-07-13 Thread Butler, Shaun

check out the crypt() function

http://www.php.net/manual/en/function.crypt.php

if you don't care about decrypting the password this works fine.

--Shaun

On Friday 13 July 2001 15:26, Johnson, Kirk wrote:
 One approach to password security is to put the passwords in a file outside
 Document Root, then include that file in your scripts when you need a
 password.

 Kirk

  -Original Message-
  From: Adrian Teasdale [mailto:[EMAIL PROTECTED]]
  Sent: Friday, July 13, 2001 1:10 PM
  To: [EMAIL PROTECTED]
  Subject: [PHP] encryption methods?
 
 
  Hi all
 
  Encryption is not something that I have had dealings in with
  PHP.  I have a
  potential client who wants to have customer account information (8000
  records) stored on the internet (minus credit card
  information) and I was
  wondering what options I have for encryption.  My concern is
  that by storing
  the password in php scripts, this means that all someone has
  to do is gain
  access to this to access the data.  I'd be interested in
  other people's
  views and experiences with this.
 
  With thanks
 
  Ade
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail:
  [EMAIL PROTECTED]

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




[PHP] Variable name declarations?

2001-07-13 Thread Matthew Aznoe



I have to agree that strong typing is not a good fit with PHP.  It really
limits the flexibility of the language that is, at least to me, one it its
strongest appeals.  Often, strong typing can be overly restrictive, and free
typing, when combined with good comments and documentation which should go
alongside any piece of code, allows much easier development in my
experience.

However, I do have one complaint about PHP that seems to have a tendency to
bite me far too often, and that is the lack of variable declaration.  While
I do not think the type of the variable should be required, requiring the
user to specify which variable names are going to be used I think would be
useful.  The reason why I believe this is important is in debugging.  I have
been caught many times misspelling a variable name slightly (ie - ei), and
since PHP does no variable name checking, sometimes it takes a while to
discover the error.  If each variable name had to be declared prior to use,
it would eliminate this problem by warning the user each time an undeclared
name was used.

The syntax could be very simple using constructs that already exist in the
langauge.  The name would be defined by using the var command somewhere in
code prior to the variable being used (as in classes... but here again, the
class elements are not limited to those defined).  The declaration would
reserve only the name of the variable, so the actual type would continue to
be free form.  Arrays could continue to be created as they are now since
only the name of the variable would be checked (you could still have
potential problems in associative arrays).  Global PHP variables (ie
$GLOBALS) would not need to be declared (they would be declared
automatically).

example:

function sum_array( $input_array )
{
var $index;
var $sum = 0;

for( $index = 0; $index  count( $input_array ); $index++ )
$sum += $input_array[ $index ];

return $sum;
}

Potentially, the $index variable could also be declared within the for loop
by adding a var before the first index as well.  To keep things simple and
in line with the current variable scope rules, the scope of the name would
be global for the function in which it was defined.

I do not know all of the logistics behind the parsing and compilation
processes in the PHP engine, but I believe this could be done without too
much overhead.  It could be an optional feature (controlled from the php.ini
file) that could be turned off when released to production to save on
performance.  If this value was defaulted to off in the release, it would
also allow people to upgrade existing  code to the new version without
having to worry about instantly changing their code to the new paradigm.

I do not believe that this would sacrifice very much freedom in the
language, and it would certainly make debugging and maintainence easier on
the developer.  Also, by having all of the variables declared at the top of
the functions, it could help commenting by describing the variable name as
it is being declared, and it would encourage a better coding style.

Does anyone else have any thoughts on this?


Matthew Aznoe
[EMAIL PROTECTED]



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


Re: [PHP] Variable name declarations?

2001-07-13 Thread Zak Greant

Hi Matthew,

Set your error_reporting level to E_ALL. The parser will then report the use
of undeclared variables.

--zak


- Original Message -
From: Matthew Aznoe [EMAIL PROTECTED]
To: php [EMAIL PROTECTED]
Sent: Friday, July 13, 2001 2:22 PM
Subject: [PHP] Variable name declarations?




 I have to agree that strong typing is not a good fit with PHP.  It really
 limits the flexibility of the language that is, at least to me, one it its
 strongest appeals.  Often, strong typing can be overly restrictive, and
free
 typing, when combined with good comments and documentation which should go
 alongside any piece of code, allows much easier development in my
 experience.

 However, I do have one complaint about PHP that seems to have a tendency
to
 bite me far too often, and that is the lack of variable declaration.
While
 I do not think the type of the variable should be required, requiring the
 user to specify which variable names are going to be used I think would be
 useful.  The reason why I believe this is important is in debugging.  I
have
 been caught many times misspelling a variable name slightly (ie - ei),
and
 since PHP does no variable name checking, sometimes it takes a while to
 discover the error.  If each variable name had to be declared prior to
use,
 it would eliminate this problem by warning the user each time an
undeclared
 name was used.

 The syntax could be very simple using constructs that already exist in the
 langauge.  The name would be defined by using the var command somewhere in
 code prior to the variable being used (as in classes... but here again,
the
 class elements are not limited to those defined).  The declaration would
 reserve only the name of the variable, so the actual type would continue
to
 be free form.  Arrays could continue to be created as they are now since
 only the name of the variable would be checked (you could still have
 potential problems in associative arrays).  Global PHP variables (ie
 $GLOBALS) would not need to be declared (they would be declared
 automatically).

 example:

 function sum_array( $input_array )
 {
 var $index;
 var $sum = 0;

 for( $index = 0; $index  count( $input_array ); $index++ )
 $sum += $input_array[ $index ];

 return $sum;
 }

 Potentially, the $index variable could also be declared within the for
loop
 by adding a var before the first index as well.  To keep things simple and
 in line with the current variable scope rules, the scope of the name would
 be global for the function in which it was defined.

 I do not know all of the logistics behind the parsing and compilation
 processes in the PHP engine, but I believe this could be done without too
 much overhead.  It could be an optional feature (controlled from the
php.ini
 file) that could be turned off when released to production to save on
 performance.  If this value was defaulted to off in the release, it
would
 also allow people to upgrade existing  code to the new version without
 having to worry about instantly changing their code to the new paradigm.

 I do not believe that this would sacrifice very much freedom in the
 language, and it would certainly make debugging and maintainence easier on
 the developer.  Also, by having all of the variables declared at the top
of
 the functions, it could help commenting by describing the variable name as
 it is being declared, and it would encourage a better coding style.

 Does anyone else have any thoughts on this?


 Matthew Aznoe
 [EMAIL PROTECTED]








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


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




[PHP] --with-imap-ssl

2001-07-13 Thread alexus

i've tryed --with-imap-ssl in my configure line and i got this..

.
checking for SSL support in IMAP... yes
configure: error: This c-client library does not support SSL. Recompile or
remove --with-imap-ssl from configure line.
su-2.05#

what needs to be done in order to make it work?


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




Re: [PHP] Piping Mime String to Metamail Fails

2001-07-13 Thread Don Read


On 13-Jul-01 Jeff Hill wrote:
 Don Read wrote:
 On 13-Jul-01 Jeff Hill wrote:
  I've tried everything I can to pipe a string with mime content to
  metamail, but it fails in every variation of:
 
  exec(echo $mime_string | /usr/bin/metamail -d -q -r -w -x -y ,
  $met_res) ;
 
  what about /bin/echo ...
 
 Nope, but I do appreciate the thought. Using /bin/echo just results in
 $met_res becoming an empty array, as does my example string.
 

Huh ?

$cmd='/bin/echo'  . $mime_string | /usr/bin/metamail -d -q -r -w -x -y ;
echo ' cmd is:br', $cmd, 'p';
fpassthru($cmd);

Regards,
-- 
Don Read   [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.

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




[PHP] PLZ HELP! php won't compile:( PLZ HELP

2001-07-13 Thread alexus

./configure --with-apxs=/usr/local/apache/bin/apxs --with-mysql=/usr/local/m
ysql/ --with-imap --enable-versioning --enable-ttrack-vars --with-ldap --ena
ble-gd=../gd-1.8.4 --with-png=../libpng-1.0.11 --with-jpg=../jpeg-6b --with-
zlib-dir=../zlib-1.1.3

this is my configuration line.. i dont get any erros while running
./configure but i get this error after doing make
please help

Making all in TSRM
/bin/sh ../libtool --silent --mode=compile
gcc -DHAVE_CONFIG_H -I. -I. -I../main   -DMOD_SSL=208104 -DEAPI -DEAPI_MM -D
USE_EXPAT -DSUPPORT_UTF8 -DXML_BYTE_ORDER=12  -g -O2 -c TSRM.c
/bin/sh ../libtool --silent --mode=compile
gcc -DHAVE_CONFIG_H -I. -I. -I../main   -DMOD_SSL=208104 -DEAPI -DEAPI_MM -D
USE_EXPAT -DSUPPORT_UTF8 -DXML_BYTE_ORDER=12  -g -O2 -c tsrm_strtok_r.c
/bin/sh ../libtool --silent --mode=compile
gcc -DHAVE_CONFIG_H -I. -I. -I../main   -DMOD_SSL=208104 -DEAPI -DEAPI_MM -D
USE_EXPAT -DSUPPORT_UTF8 -DXML_BYTE_ORDER=12  -g -O2 -c tsrm_virtual_cwd.c
tsrm_virtual_cwd.c: In function `virtual_open':
tsrm_virtual_cwd.c:568: `mode_t' is promoted to `int' when passed through
`...'
tsrm_virtual_cwd.c:568: (so you should pass `int' not `mode_t' to `va_arg')
*** Error code 1

Stop in /usr/local/src/php-4.0.6/TSRM.
*** Error code 1

Stop in /usr/local/src/php-4.0.6.

thank you in advance



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




RE: [PHP] Variable name declarations?

2001-07-13 Thread scott [gts]



 -Original Message-
 From: Matthew Aznoe [mailto:[EMAIL PROTECTED]]
 Subject: [PHP] Variable name declarations?
 
 However, I do have one complaint about PHP that seems to have a tendency to
 bite me far too often, and that is the lack of variable declaration.  While
 I do not think the type of the variable should be required, requiring the
 user to specify which variable names are going to be used I think would be
 useful.  The reason why I believe this is important is in debugging.  I have
 been caught many times misspelling a variable name slightly (ie - ei), and
 since PHP does no variable name checking, sometimes it takes a while to
 discover the error.  If each variable name had to be declared prior to use,
 it would eliminate this problem by warning the user each time an undeclared
 name was used.

you are basically describing the use strict; pragma of perl.

if you declare use strict; at the beginning of a perl script,
you must then declare all variables before using them (among
other things that use strict prohibits, but variable declaration
is by far the most noticeable effect of use strict)

my $num = 5;#good

$num = 5;   #error

but the great thing is, is that you can turn strict mode off
for specific code blocks if you find a need to get a little
loose with the rules.

no strict;
$x = 5; #no error


i wish PHP had an equivilent to perl's use strict... 
it would certainly save us all a lot of time, and probably
make us clean our code up a little bit :)

 I do not believe that this would sacrifice very much freedom in the
 language, and it would certainly make debugging and maintainence easier on
 the developer. 

if PHP make variable declaration an optional thing by use of
something similar to perl's use strict pragma, then it wouldnt
sacrifise anything... becuase only people who wanted it would
use it.

if PHP were to mandate variable declaration for all scripts all
the time, then it would certainly sacrifise a lot... 


 Does anyone else have any thoughts on this? 


yes.  i love the idea... just as long as it's an optional feature
that can be turned on and off as the programmer needs.

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




[PHP] Re: Export to Excel

2001-07-13 Thread Tim Frank

Jorge,

I pieced together a way to do this from other suggestions I found on the 
mailing list and elsewhere. This is more of a trick to get Excel to think 
it has an Excel file, but it doesn't truly generate an Excel file.
Thanks to Excel versions 97 and up (don't recall 95) having nice little 
HTML import abilities we can trick it into loading a plain old HTML table 
and treating it as an Excel file.  Here is how you do it.

The following headers will let you throw the file for download so the 
client can save it to their computer.  Just name it with .xls and then 
when they try to open it Excel will automatically convert it from HTML.  
You can change this to inline if you want IE to display it in the 
browser.

header(Content-Type: application/vnd.ms-excel; name='excel');
header(Content-Disposition: attachment; filename=filename.xls);

Now, as far as the data goes, it's simple, just make your run of the mill 
HTML table.  The usual for loop for database records will do, and you 
will just end up with something like this

table
tr
tdColumn with Text/td
tdColumn with Numbers/td
tdColumn with Numbers/Text with leading zeros/td
/tr
tr
tdI am text/td
td1,500.00/td
td=0012/td
/tr
/table

When Excel loads that it will make a 3 column sheet and fill in the data. 
 Any cells you want to keep with leading zerios you use =0012 in the 
HTML table as the data.  Otherwise the column will be treated as numeric 
when it is loaded.  Text stays as text.

There are some tricks as well where you can store forumlas in the actual 
HTML table cells so when the sheet is loaded it would calculate the sum, 
avg, whatever of the columns or sheet.  I don't recall how to do that off 
the top of my head but I think you just plugged in regular formulae into 
the HTML table cells. Try it if you need it.

From there the user might have to set some data types for some columns as 
I don't think they can be set. You might want to check some of the help 
on MS Excel 2K or XP as I'm very sure the HTML capabilities are much more 
advanced than with 97 which we still use.

I hope that helps everyone out a little.  There are limitations with this 
method, but to just get a file that someone can safely open in Excel, it 
is a very convenient way to do it rather than having to muck around with 
binary files.

Have a good weekend,

Tim Frank


 Original Message 

On 7/13/01, 12:58:18 PM, [EMAIL PROTECTED] (Jorge Alvarez) wrote 
regarding Export to Excel:


 One of my clients is requesting me to export some data from PHP-generated
 pages to MS Excel files. I have no clue on how to do such export with 
PHP.
 I'm using PHP/Apache/Linux Mandrake.

 What options do I have?

 Your help is very appreciated.

 Regards,

 Jorge Alvarez
 --
 Let your screen saver contribute to cancer research.
 http://members.ud.com/vypc/cancer/
 A new way to help. Sponsored by Intel.

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




[PHP] How to unsubscribe

2001-07-13 Thread Lara J. Fabans

I hope you all enjoy this as much as I did.
Lara

Subject: How to unsubscribe from the list. :)

You see, all of those to unsubscribe, do this. instructions at the
bottom of the emails sent through this list are wrong. We only put those
there to confuse everyone so that they will never leave the list. Since
you've obviously got more intelligence than to follow instructions from
the list owner ...

here are the *REAL* instructions on how to unsubscribe:

1) Go to A HREF=http://www.dictionary.com/;www.dictionary.com/A and
look up the word unsubscribe.
2) There is a hidden link right above the third word in the
definition.click it.
3) That link will take you to Langley (US Security System).
4) Enter the launch code 345897349 to send a missile to 42 degrees north
latitude, 98 degrees east longitude.
5) Right before the missile lands, there will be a flash on your screen with
directions on how to build a model airplane.
6) Print those instructions and build the plane.
7) Take the plane to the roof of your building and fly it.
8) It will land on the sidewalk on a loose slab of concrete. Pick up the
concrete and put it in the nearest trash can.
9) Dig in the dirt under the concrete and there will be a red button. If you
push the button, you will unsubscribe yourself from this list.

-
Lara J. Fabans
Lodestone Software, Inc
[EMAIL PROTECTED] 


  1   2   >