Re: [PHP] URL for Powered by PHP gif

2002-04-19 Thread Jason Wong

On Saturday 20 April 2002 06:46, Todd Cary wrote:
 Can someone provide me with the URL for a gif that I can place on my pages
 so that I can give credit to PHP (Apache would be nice too).

Presumably you've already looked on www.php.net?

You can get the PHP logo and a Powered by Zend logo using phpinfo().

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

/*
No, no, I don't mind being called the smartest man in the world.  I just 
wish 
 it wasn't this one.
-- Adrian Veidt/Ozymandias, WATCHMEN 
*/

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




Re: [PHP] Attachments

2002-04-19 Thread Jason Wong

On Saturday 20 April 2002 12:29, Jason Soza wrote:

 Using both Perl and PHP to send mail with attachments from forms, the
 attachments get truncated. Since both Perl scripts and PHP scripts do this,
 I'm ruling out coding error, and since my mailserver has been receiving
 e-mails from other sources and has transmitted the whole attachments from
 them, I'm ruling it out too. Does anyone know if Apache has some sort of
 limitation on attachments? Is there a setting for this in httpd.conf? I
 don't have any .htaccess files laying around, just httpd.conf and virtual
 hosts. Is there like a max_file_size thing I need to mess with?

If you're using GET in your form(s) change it to POST.

Also, please do not reply to an existing thread and change the subject. This 
messes up the threading for those of us who use an intelligent mail client. 
Start your own thread.

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

/*
QOTD:
If it's too loud, you're too old.
*/

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




Re: [PHP] Getting All Variables?

2002-04-19 Thread Jason Wong

On Saturday 20 April 2002 07:23, Devin Atencio wrote:
 Is there an easy way in PHP to have it display to screen all the variables
 that
 it has in memory? So i can see what variables there is and what they are
 set to?

print_r($GLOBALS);

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

/*
There has been an alarming increase in the number of things you know
nothing about.
*/

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




Re: [PHP] Empty $_SESSION and $_POST ??

2002-04-19 Thread Jason Wong

On Saturday 20 April 2002 09:41, Andre Dubuc wrote:

 Is there a way I can verify that (a) globals are off and (b) $_SESSION or
 $_POST are on? This probably what's happening -- I can't access the arrays
 at all -- so, I think that might be where the problem lies. The $vars still
 work though throughout all scripts.

Use:

  print_r($GLOBALS);

to see what variables you have.

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

/*
Dr. Jekyll had something to Hyde.
*/

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




Re: [PHP] redirect browser

2002-04-19 Thread Jason Wong

On Saturday 20 April 2002 09:26, Joe wrote:


 =

 ?php



 
 Warning: Cannot add header information - headers already sent
 by (output started at c:\html\html\check.php:4) in
 c:\html\html\check.php on line 42
 

 I had no idea about this.
 Can anyone tell me what's wrong of my code?

You cannot have anything between the beginning of the file and your ?php 
tag. Not even whitespace (spaces, tabs, newlines etc).


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

/*
A real person has two reasons for doing anything ... a good reason and
the real reason.
*/

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




Re: [PHP] some problems about gd in php

2002-04-19 Thread Jason Wong

On Saturday 20 April 2002 09:36, zhaoxd wrote:
 Yeah,I have already restarted web server and there was no error in
 compiling during configure/make/install .Using gd,I get the information
 that concern about GD Support ,GD version,WBMP Support ,etc.as follow:
 
 GD Support ---enabled
 GD Version1.6.2 or higher
 WBMP Support---enabled

If it was a recompile, try to do a clean installation. Remove the directory 
containing your existing php src, untar your tarball, then 
configure/make/install.

   ./configure --with-mysql=/usr/local/mysql
   --with-apache=../apache_1.3.24
 --enable-track-vars
   --with-gd=../gd-1.8.4 --with-png-dir=../libpng --with-zlib-dir=../zlib

Also, what is inside these directories?

../gd-1.8.4
../libpng
../zlib

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

/*
Physician:  One upon whom we set our hopes when ill and our dogs when well.
-- Ambrose Bierce
*/

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




Re: [PHP] header redirection

2002-04-19 Thread Jason Wong

On Saturday 20 April 2002 05:07, Norman Zhang wrote:
 Hi,

 I use header(location: ...) for redirection to another page. But I also
 want to include title, meta and link tags in the other page. Is there
 a way to this? Because php complains that the header already been sent.

Show us your code.

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

/*
Spiritual leadership should remain spiritual leadership and the temporal
power should not become too important in any church.
- Eleanor Roosevelt
*/

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




Re: [PHP] redirect browser

2002-04-20 Thread Jason Wong

On Saturday 20 April 2002 18:49, Joe wrote:
 may be my message are hazy.
 the line =
 is not include in my php code/page, i just use it in this message as to
 divide
 into different section.

Whatever, the answer is still the same:

  You cannot have anything between the beginning of the file and your ?php
  tag. Not even whitespace (spaces, tabs, newlines etc).

Check all your include() files as well for any stray space.

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

/*
Lead us in a few words of silent prayer.
-- Bill Peterson, former Houston Oiler football coach
*/

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




Re: [PHP] Attachments

2002-04-20 Thread Jason Wong

On Saturday 20 April 2002 18:25, Jason Soza wrote:
 Sorry for the thread thing, I wasn't aware I was causing probs. I usually
 just use Reply to save having to enter the e-mail address, just laziness.
 I'll keep from doing in this in the future, thanks for letting me know.

Thanks, you'll annoy fewer people :)

 I'm using 'POST' in my forms - any other ideas or places I could check?
 Thanks again.

There are a couple of settings in php.ini you could look at:

post_max_size
upload_max_filesize


Have you tried varying size attachments to see at what point the attachments 
become truncated?

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

/*
Refreshed by a brief blackout, I got to my feet and went next door.
-- Martin Amis, _Money_
*/

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




Re: [PHP] Simple IF question

2002-04-20 Thread Jason Wong

On Saturday 20 April 2002 18:35, Tom Rogers wrote:
 Hi again
 You can also write it as:
 If (($salutation != Please select)
 Print (Sorry, please select a value in the salutation box);
 Tom

Also the logic seems to be wrong, shouldn't it be:

 if (($salutation == Please select) {
   print (Sorry, please select a value in the salutation box); }
 else {
   ...
 }

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

/*
Men often believe -- or pretend -- that the Law is something sacred, or
at least a science -- an unfounded assumption very convenient to governments.
*/

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




Re: [PHP] Simple IF question

2002-04-20 Thread Jason Wong

On Sunday 21 April 2002 00:27, Denis L. Menezes wrote:
 Thanks Gentlemen.

 After many experiments, I found the answer. It should be = = and not =.

Surely you mean ==, which more than one person has already pointed out?

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

/*
Some people have a great ambition: to build something
that will last, at least until they've finished building it.
*/

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




Re: [PHP] $PHP_SELF empty when using Xitami Web Server

2002-04-20 Thread Jason Wong

On Sunday 21 April 2002 00:51, Ben Edwards wrote:
 The variable $PHP_SELF seems to be blank, I am using PHP 4.1.2 and Xitami
 2.4d9 which are both the latest version.  Has anyone else had this problem
 and do they know how to fix it?

use:

 print_r($GLOBALS) 

to verify.

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

/*
The pathology is to want control, not that you ever get it, because of
course you never do.
-- Gregory Bateson
*/

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




Re: [PHP] Checking database for a value

2002-04-20 Thread Jason Wong

On Sunday 21 April 2002 00:55, Denis L. Menezes wrote:
 hello friends,

 I am looking into 4 books in front of me but somehow cannot find the
 following :

 I have a field userid which the user fills in at registration. Before
 entering the data into the database, I want to check if the userid exists
 in the database.

 Can someone tell me the name of the function I must use, I will look for
 the rest in the php dictionary.

AFAIK there are no built-in functions to do that. You need to run a query 
like SELECT userid FROM table then see whether any rows are returned. If 
you use this often you can wrap it up in a function.

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

/*
I'm reporting for duty as a modern person.  I want to do the Latin Hustle now!
*/

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




Re: [PHP] Checking database for a value

2002-04-20 Thread Jason Wong

On Sunday 21 April 2002 01:10, Jason Wong wrote:
 On Sunday 21 April 2002 00:55, Denis L. Menezes wrote:
  hello friends,
 
  I am looking into 4 books in front of me but somehow cannot find the
  following :
 
  I have a field userid which the user fills in at registration. Before
  entering the data into the database, I want to check if the userid exists
  in the database.
 
  Can someone tell me the name of the function I must use, I will look for
  the rest in the php dictionary.

 AFAIK there are no built-in functions to do that. You need to run a query
 like SELECT userid FROM table then see whether any rows are returned. If
 you use this often you can wrap it up in a function.

That of course should be:

  SELECT userid FROM table WHERE userid='user_id_to_check'

I better get some sleep :)

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

/*
Delta: We never make the same mistake three times.   -- David Letterman
*/

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




Re: [PHP] Better standards in PHP-coding

2002-04-21 Thread Jason Wong

On Sunday 21 April 2002 11:26, The_RadiX wrote:

  Hard in email to show as the character spacing is not equal like good text
  editors..

Set your mail client to use a fixed width font -- Lucida Console is my 
preferred font.

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

/*
Q:  Do you know what the death rate around here is?
A:  One per person.
*/

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




Re: [PHP] Attachments

2002-04-21 Thread Jason Wong

On Sunday 21 April 2002 06:02, Jason Soza wrote:
 They actually vary as to where they become truncated - some are at 633
 bytes, some are at 1kb. The odd thing is that the PHP script I'm using to
 process the form actually pics up the correct filesize, it reports it to me
 under a $filesize variable I've setup. It'll report, say file2_filesize...:
 69147 but the actual attachment is 1kb.

Please post your code.

 Like I said, I have this same problem using both Perl scripts and PHP
 scripts. In php.ini my post_max size is 8M and upload_max_filesize is 2M.
 Looking through the Apache mailing list archives, it looks like others
 running Apache on win32 have experienced the same problems, but there are
 no answers. I'm a little stumped myself!

Have you narrowed down the problem to whether the uploaded file is truncated 
or whether the mail attachment process truncates the file?

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

/*
 EVACUATION ROUTE 
*/

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




Re: [PHP] Variable substitution

2002-04-21 Thread Jason Wong

On Saturday 20 April 2002 17:08, Greg Hulands wrote:
 Hi,
 I am trying to make an e-mail form so that I can generate an e-mail to send
 to all the users of the system. In the message part I want to be able to do
 something like this.

 Dear $fName,
 Welcome to .

 When it then sends the e-mail, it should substitute $fName with the current
 row in the database. For some reason it does not get automatically
 substituted when using mail(to, subject, message). Is there a function that
 substitutes variables with there values and returns a string.

Depending on your existing code, your options include eval(), 
substr_replace(), str_replace().

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

/*
Make me look like LINDA RONSTADT again!!
*/

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




Re: [PHP] Attachments

2002-04-21 Thread Jason Wong

On Monday 22 April 2002 01:51, Jason Soza wrote:
 I haven't been able to identify what process actually truncates the file.

This should be the easiest to nail down. Add a bit of code so that when the 
file gets uploaded, it gets copied somewhere, then you can manually check its 
size. Obviously, if the filesize is OK then the problem is further down the 
line (probably the mail code).

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

/*
f u cn rd ths, itn tyg h myxbl cd.
*/

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




Re: [PHP] Better standards in PHP-coding

2002-04-21 Thread Jason Wong

On Monday 22 April 2002 08:07, Maxim Maletsky wrote:
 I think standardization within the company is what important.

 I prefer tabs because when I have to delete a part of the line, I just
 hit back button once - not four times.

I prefer an editor which allows me to tab using spaces and to delete the 
appropriate number of spaces when backspacing :)

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

/*
Logic is the chastity belt of the mind!
*/

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




Re: [PHP] some problems about gd in php

2002-04-21 Thread Jason Wong

On Monday 22 April 2002 10:54, zhaoxd wrote:
 Thank you all,I have solved the problem.

What fixed the problem then?

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

/*
There was no difference between the behavior of a god and the operations of
pure chance...
-- Thomas Pynchon, _Gravity's Rainbow_
*/

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




Re: [PHP] [HELP] redirect browser pass variable !

2002-04-21 Thread Jason Wong

On Monday 22 April 2002 10:46, Joe wrote:
 I am using header function to redirect browser.

 {  header(Location: http://www.XXX.edu/index.php;);
   exit;}

 Although it can redirect the browser but variable had not pass to next
 page.

 So can anyone teach me how to pass variable and redirect browser at same
 time?

The easiest way is to pass the variables along with the url:

  header(Location: http://www.XXX.edu/index.php?var1=doovar2=dah;

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

/*
May you have many beautiful and obedient daughters.
*/

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




Re: [PHP] some problems about gd in php

2002-04-21 Thread Jason Wong

On Monday 22 April 2002 13:02, zhaoxd wrote:
 recompile php from scratch.

I should've suggest that earlier. When I had to recompile PHP with support 
for gd, ttf, png etc I had the same problem which was only solved by doing a 
clean installation. Now whenever I recompile, I do it from scratch.

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

/*
One family builds a wall, two families enjoy it.
*/

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




Re: [PHP] Attachments

2002-04-22 Thread Jason Wong

On Monday 22 April 2002 02:33, Jason Soza wrote:
 Hmm... Okay, I used this script I found on hotscripts - it copies the
 entire file to the specified directory:

   echo pcenterTrying to upload to: 
  . $upload_path . $filename . /center/p\n;

   if ( file_exists($upload_path.$filename) ) {
  echo pfont color='red'center
 . $message[fileexists]./font/center/p;

   } else {
  if( move_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name'],
$upload_path.$filename) ) {
 echo pcenter . $message[complete]./center/p;
  } else {
 echo pfont color='red'center
. $message[incomplete]./font/center/p;
  }

 Now why would this work but the e-mail scripts not?

1) Did *you* write both the php  perl scripts? Just checking, if you wrote 
both, then you might have made the same mistake in both ;-) If they're by 
independent authors then the chances of the same mistake are slightly lower.

2) Just to really confirm that the upload process is not the problem can you 
try sending a local existing file using your scripts?

3) In your scripts I can't see where the attachments (ie the files) gets 
encoded to base64. Have I missed something?

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

/*
Who are you?
*/

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




Re: [PHP] Re: Open Download-Box

2002-04-22 Thread Jason Wong

On Monday 22 April 2002 16:39, Martin Thoma wrote:
  this is a problem of IE, not of PHP.

 Year, but since I controll IE with PHP, I thought someone has a
 php-workaround.

You don't control IE, MS does.

Some versions of IE insist on trying to display the file regardless of what 
the headers tell it to do, and regardless of whether or not it has the plugin 
to display such a file. It's a bug which seems to have been fixed, then 
broken, then fixed, then broken, ...!

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

/*
To add insult to injury.
-- Phaedrus
*/

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




Re: [PHP] security

2002-04-22 Thread Jason Wong

On Monday 22 April 2002 17:16, Wilbert Enserink wrote:

 I'm building a site where customers can store their personal information.
 I'm thinking of storing their creditcardno's also. Can you give me some
 general tips with regard to security. What is the way to go here?

This has been discussed in some depth within the last month or so. Searching 
the archives for credit card should yield some results. You may also want 
to search the php-db archives as well.

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

/*
Let the machine do the dirty work.
-- Elements of Programming Style, Kernighan and Ritchie
*/

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




Re: [PHP] Can't Load Data into Mysql Using LOAD DATA

2002-04-24 Thread Jason Wong

On Wednesday 24 April 2002 16:19, Jack wrote:
 Dear all
  I'm trying to load data from a test.csv file into myql database, but it
 seems the data didn't get into the table!!

 I use a GUI Program which i type in the Mysql Command to it and execute it,
 so i type in the following command :
 Load Data Local infile 'c:\test.csv' into to table testdeposite lines
 terminated by ,
 it shows the command had successfully executed, by when i type select *
 from testdeposite which want to check if the data is successfully
 inserted, it say no record exist in table!

 Could someone pls tell me what happen here?

Dunno. Maybe you posted to the wrong list. The mysql list is what you want.

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

/*
Nezvannyi gost'--khuzhe tatarina.
[An uninvited guest is worse than the Mongol invasion]
-- Russian proverb
*/

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




Re: [PHP] problem compiling Apche 2.0.35 and PHP 4.2.0

2002-04-24 Thread Jason Wong

On Wednesday 24 April 2002 04:46, Michael Geier wrote:
 I definitely think MySQL could be the problem...

 RPM installation of 3.23.

You need to install:

MySQL-devel-3.23.X

if you haven't already done so.

 Does anyone have any suggestions (other than installing from source)?  I
 have a few databases running on that machine right now and would rather not
 have to port them over to a new installation, if I can help it.

 A 'whereis mysql' returned 'mysql: /usr/bin/mysql /usr/lib/mysql
 /usr/include/mysql /usr/share/mysql /usr/share/man/man1/mysql.1.gz'

 installing with '--with-mysql=[insert dir from above]' failed on the first

If you want php's built-in mysql support just use:

--with-mysql 

Otherwise:

--with-mysql=/usr


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

/*
Staff meeting in the conference room in %d minutes.
*/

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




Re: [PHP] Once more: [PHP] Array indices - PLEASE HELP!!

2002-04-24 Thread Jason Wong

On Wednesday 24 April 2002 17:14, esivertsen wrote:
 Does nobody have a suggestion to the below?
 Perhaps there is an easy solution, but I cant see it at the time.

 Eivind

  Hi all,
  I have a question regarding array indices:
 
  At a certain point in code, I run array_diff() on two arrays to produce a
  reduced version of one of the argument arrays. Problem is, I dont want
  the key-value associations to be preserved. I need that the returned
  array has new (integer, not string) indices in numerical order from 0...N
  without holes.
 
  Does anybody know how to do this? I have looked at different sort
  functions etc, but I'd rather not do a sort to the array. The code is for
  random selection with reduction of the sample set (i.e. with withdrawal).

just run your array through a foreach loop assigning each key-value pair to a 
new array.

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

/*
Be not anxious about what you have, but about what you are.
-- Pope St. Gregory I
*/

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




Re: [PHP] html mail

2002-04-24 Thread Jason Wong

On Wednesday 24 April 2002 18:59, Wilbert Enserink wrote:

 Hi all,


 I'm studying some mail scripts written in php. When sending html mail the
 scripts all use a method that involves sending an html file as attachment.

 Why not use the mailsend function and send a string containing the whole
 html code?

Because standard email wasn't designed for html mail. If you did what you 
suggest above then the recipient of your mail would just see your html code.

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

/*
We are experiencing system trouble -- do not adjust your terminal.
*/

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




Re: [PHP] Home Finance System / Bill Splitter

2002-04-24 Thread Jason Wong

On Wednesday 24 April 2002 18:05, Dan Horth wrote:

 I was about to set up a spreadsheet again - but since I've started getting
 into learning PHP - and have recently set up our home linux server -
 thought that it would be a lot more exciting / functional to have a system
 running on the server that would allow each person to log in, track the
 current bill status, pay a bill, enter new bills, etc.

It seems strange to me why anyone would want to do such a thing.

 I was wondering if anyone knew of an existing system that would do this for
 me, or if anyone had ideas as to exisiting systems that came close to the
 functionality I'm after - that I could tweak.

And it's even stranger that someone *has* come up with such a thing :)

I think I saw it on freshmeat.net. 

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

/*
Can't open /usr/fortunes.  Lid stuck on cookie jar.
*/

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




Re: [PHP] code with comments is here

2002-04-24 Thread Jason Wong

On Thursday 25 April 2002 00:14, Kirk Babb wrote:
 I have a feeling I am making this much harder than it really is!  I'm a new
 programmer, and I am trying to output x number of characters per line
 without splitting up the words in the string.  I want to approach as best
 as possible a certain number of characters per line, let's say 80
 characters, and then cycle through the remaining parts of the array to
 reconstruct the string in the same manner.

Have you tried the wordwrap() function?

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

/*
There's nothing worse for your business than extra Santa Clauses
smoking in the men's room.
-- W. Bossert
*/

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




Re: [PHP] passing array as hidden field

2002-04-24 Thread Jason Wong

On Thursday 25 April 2002 02:02, Pushkar Pradhan wrote:
 I want to pass a 1 dim. array through a form, I use the hidden field and
 do as follows:
 form method=POST ACTION=\updateHTML.php\
 input type=hidden name=layer[] value=\;
 foreach($layer as $lay) {
print $lay ;
 }
 print \
 This generates the foll. source:
 form method=POST ACTION=updateHTML.php
 input type=hidden name=layer[] value=a b c d e f g h 

 where actually it should be $layer[] = a, b, c, 

Actually you want the input ... inside the loop as well:


  foreach($layer as $lay) {
print input type='hidden' name='layer[]' value='$lay';
  }

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

/*
Old age is always fifteen years old than I am.
-- B. Baruch
*/

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




Re: [PHP] passing array as hidden field

2002-04-24 Thread Jason Wong

On Thursday 25 April 2002 02:09, Kevin Stone wrote:
 Concept is solid, method is wrong.  Understand that name=layer[] is but
 one index in the array.  To produce an array with multiple indicies you
 must create a separate input for each value.  Example..


 foreach ($layer as $lay)
 {
 echo input type='hidden' name='layer[]' value=$lay;
 }

I would always quote the value:

  value='xxx' or value=xxx

a) because the HTML spec requires it?
b) if value contains a space it ain't going to work

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

/*
Advice from an old carpenter: measure twice, saw once.
*/

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




Re: [PHP] newbie: string manipulation

2002-04-24 Thread Jason Wong

On Thursday 25 April 2002 04:04, ROBERT MCPEAK wrote:
 I need code that grabs the file at the end of a file path.
 I have this:

 /usr/blah/doh/yuck/wow/abigfile.html

 And would like to return this:

 abigfile.html

Manual  Filesystem functions

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

/*
Women give to men the very gold of their lives.  Possibly; but they
invariably want it back in such very small change.
-- Oscar Wilde
*/

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




Re: [PHP] Why is imageTTFtext function useless?

2002-04-24 Thread Jason Wong

On Thursday 25 April 2002 10:08, zhaoxd wrote:
 ?
 //define the type of inputting picture;
 Heder(content-type:image/png);

Is this a typo? Should be Header(...).

 //create picture
 $pic=imagecreate(240,30);
 //define color
 $black=imagecolorallocate($pic,0,0,0);
 $white=imagecolorallocate($pic,255,255,255);
 //define font copied from windows2000
 $font=fonts/simhei.ttf;
 //define characters to output
 $str =
 chr(0xE8).chr(0xB5).chr(0x9B).chr(0xE8).chr(0xBF).chr(0xAA).chr(0xE7).chr(0
xBD).chr(0 x91). www.ccidnet.com;
 //write ttf in picture
 imageTTFText($pic,20,0,10,20,$white,$font,$str);
 //create png picture
 imagepng($pic);
 //release the memory occupied by the picture
 imagedestroy($pic);
 ?

I tried this and it works. However the font I used didn't have those 
chr(0xE8), etc defined so I can only see www.ccidnet.com.

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

/*
You are only young once, but you can stay immature indefinitely.
*/

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




Re: [PHP] Parse Error - Help?

2002-04-24 Thread Jason Wong

On Thursday 25 April 2002 11:20, Jason Soza wrote:
 Can someone take a look at this code for me? I'm pretty new to programming,
 but looking at it I think it should work. I'm not saying there aren't
 plenty of errors, because I'm sure there are. I'm getting a parse error on
 the last line, and I can't see any reason for it. All of my ifs and
 functions are closed as far as I see. I guess I'm just looking for an
 unbiased eye here, I've been staring at this for a couple hours now. If you
 have comments on to how I could simplify this code, that'd be great too.
 Otherwise, I just need it to get it working. Thanks in advance -


 if ( isset($HTTP_POST_VARS[upload]) ) {


   if ($HTTP_POST_FILES['userfile1']['name']) {
   $orig_name1 = $HTTP_POST_FILES['userfile1']['name'];
   $filename1 = filename_mod ($orig_name1);
   filesize_check ($filesize1);
 if ( $rc == 0 ) {
   if($extval_use=1) {
   ext_valid ($filename1);
   } 
   }
   if ( $rc == 0 ) {
   file_upload ($filename1);
   } - HERE
   }

Could it be this extra closing brace?

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

/*
Semper Fi, dude.
*/

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




Re: [PHP] Getting page with fopen

2002-04-25 Thread Jason Wong

On Thursday 25 April 2002 16:39, Martin Thoma wrote:
 Hello!

 I'm trying to find out on which rank my side is at google automatically.
 I'm trying the following code, but I get a strange error:

  $Url = http://www.google.de/search?q=MySearchWord;; // Gives Warning:
 No error on line [where fopen is]
  $Url = http://www.google.de/;; // Works

  for ($i = 0; $i  100; $i += 10)
  {   $fp = fopen($Url, r);
   while($fp  !feof($fp))
   { $sLine .= fgets($fp, 4096);
   }
 ... do some further things with $sLine
   fclose($fp);
  }

 How can I get more information about the error occuring? Warning: No
 error is not much information...

Google is probably trying to send you a cookie in which case you cannot use 
fopen. You need to use curl or snoopy(?).

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

/*
When the wind is great, bow before it;
when the wind is heavy, yield to it.
*/

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




Re: [PHP] Sorry, this is relate to subscription problem but cant solve it

2002-04-25 Thread Jason Wong

On Thursday 25 April 2002 18:13, M VM wrote:
 Hello, sorry this off-topic msg but I don't know how
 to solve subscription problem to this list.
 Due yahoo email changes (no more pop services), I am
 trying to subscribe this list using alternate email
 address ([EMAIL PROTECTED]) but receive

 =
 Hi. This is the qmail-send program at pb1.pair.com.
 I'm afraid I wasn't able to deliver your message to
 the following addresses.
 This is a permanent error; I've given up. Sorry it
 didn't work out.

 [EMAIL PROTECTED]:
 ezmlm-manage: fatal: I don't accept messages at this
 address (inlocal and/or inhost don't match) (#5.1.1)
 =

 Does anybody know the reason for this one?

You're trying to post to the list before subscribing. Can I ask how did you 
originally subscribe to the list when using yahoo? Just follow the same 
procedure. www.php.net if you've forgotten.

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




Re: [PHP] Unlucky Situation Involving CURL

2002-04-25 Thread Jason Wong

On Thursday 25 April 2002 17:23, Jason wrote:
 I'm developing a website that has the unlucky situation of being situated
 on a host that does not have CURL installed on it.

[snip]

 Does anybody know of a way of doing this without using CURL?

Try snoopy.

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

/*
Clear the laundromat!!  This whirl-o-matic just had a nuclear meltdown!!
*/

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




Re: [PHP] Structuring script execution

2002-04-25 Thread Jason Wong

On Thursday 25 April 2002 22:48, Donna Robinson wrote:


 On the first call everything is fine.
 On the 2nd call (of course) the script stops execution. even sending
 header( Location: otherfile.html) won't work 'cos I get a msg saying
 headers already sent.

Read the manual entry for header(). Or search archives for headers already 
sent.

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

/*
I am not now, nor have I ever been, a member of the demigodic party.
-- Dennis Ritchie
*/

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




Re: [PHP] how to make array_search start from 0?

2002-04-25 Thread Jason Wong

On Friday 26 April 2002 00:30, andy wrote:
 Hi there,

 I am passing an array through the URL with a ',' inbetween:
 var=php,mysql,super
 Parsing is done with: explode (',',$var). This gives me an array starting
 with 0

 Later on I have to search for lets say php with array_search.

 Unfortunatelly array_search requires an array starting with 1. So php is
 not found.

Haven't used this function before, but where does it say anything about 
requiring an array starting with 1? Did you try it anyway?

 Does anybody know a workaround for this?

You can do:

$my_array = array_flip($my_array)
$key = $my_array['search_item'];

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

/*
Conversion, fastidious Goddess, loves blood better than brick, and feasts
most subtly on the human will.
-- Virginia Woolf, Mrs. Dalloway
*/

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




Re: [PHP] passing vars. betn. php and javascript

2002-04-26 Thread Jason Wong

On Saturday 27 April 2002 00:56, Pushkar Pradhan wrote:
 I need to pass an array from php to javascript,
 change the ordering of the elements in javasc..
 pass this reordered array back to php script?
 Is it possible to do this and if so can anyone send me the basic code,
 I've never written javascript? Thanks,

How is the array reordered?

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

/*
Maturity is only a short break in adolescence.
-- Jules Feiffer
*/

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




Re: [PHP] Mail responders

2002-04-26 Thread Jason Wong

On Saturday 27 April 2002 01:13, JSheble wrote:
 How would you set this up via PHP?  I've wanted to do this, but I always
 thought it was something specific to SendMail, and in a hosted environment,
 mucking about with SendMail generally isn't allowed...

 I'd like to send an email to something like [EMAIL PROTECTED]  but have a
 PHP script get the mail and operate on it...

 At 11:56 AM 4/26/2002 -0500, you wrote:
 On Fri, 26 Apr 2002, Dennis Gearon wrote:
   All these lists that have addresses to subscribe, unsubscribe, etc, how
   do they work? Are they using a cron job to poll the mail inbox through
   sendmail? Does all mail not to a specific address at the site go to a
   'catchall' address, which is then polled?
 
 Usually the mail is delivered directly to a program rather than to a
 mailbox. The program receives the incoming message as input and handles it
 as it pleases.

What are you actually trying to do? If you're trying to make a mailing-list 
type program then you're better off using an existing mailing list program.

Otherwise with sendmail you can use procmail. It's clunky but doable.

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

/*
The whole world is about three drinks behind.
-- Humphrey Bogart
*/

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




Re: [PHP] passing vars. betn. php and javascript

2002-04-26 Thread Jason Wong

On Saturday 27 April 2002 01:23, Pushkar Pradhan wrote:
 In my php I had 4 buttons, up, down, top and bottom:
 After detecting which element and which button was clicked I changed the
 element position by
 using array_slice, shift, unshift, array_merge etc..
 I'm not sure what I'll do it JS

Well, depending on how you were reordering the array I was going to suggest 
you use php. Since you already have a version in php and you want to do it in 
javascript then ...

   I've never written javascript? Thanks,

I suggest you learn some javascript then think about how to pass an array 
to it from php :)

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

/*
The profession of book writing makes horse racing seem like a solid,
stable business.
-- John Steinbeck
[Horse racing *is* a stable business ...]
*/

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




Re: [PHP] web application development question

2002-04-26 Thread Jason Wong

On Saturday 27 April 2002 03:50, Erik Price wrote:
 For those of you who write web applications (in any language), what do
 you recommend as the best way to store arbitrary atomic data for the web
 application?  in other words, data that doesn't really need to be stored
 in a relational database, as it does not really relate to anything?

Stick it in an include file?

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

/*
WYSIWYG:
What You See Is What You Get.
*/

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




Re: [PHP] Re: Redirecting

2002-04-26 Thread Jason Wong

On Saturday 27 April 2002 12:00, Julio Nobrega wrote:
   Send head()ers before any html output (including spaces or newlines
 before ?php)

IOW RTFM!

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

/*
Love tells us many things that are not so.
-- Krainian Proverb
*/

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




Re: [PHP] date format

2002-04-27 Thread Jason Wong

On Saturday 27 April 2002 14:43, Ananth Rajaraman wrote:
 Hi all,
 I'm trying to query a date field from mySQL and
 display in a differnet format.

 the mysql date is in the format -MM-DD and I want
 to convert it to DD-MM-

 how do I do that?

Use mysql's extensive date formatting functions.

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

/*
Remember kids, if there's a loaded gun in the room, be sure that you're the 
one holding it
-- Captain Combat
*/

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




Re: [PHP] Apache: SERVER_NAME gone?

2002-04-27 Thread Jason Wong

On Monday 22 January 2001 14:36, The_RadiX wrote:
 Hi Y'all...



 Ok. I just got Apache 1.3.xx and I have PHP4.1.1 and MySQL 3.23.47 on WinXP
 Pro...


 I am currently using IIS5.1 with PHP4 and MySQL but I'd like to move across
 to Apache..

[snip]

 BUT.. when I call $SERVER_NAME in my php's like I always have.. The
 variable seems to no longer exist... what gives??

Use phpinfo() to find out what system/pre-defined variables are available.

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

/*
Nothing makes a person more productive than the last minute.
*/

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




Re: [PHP] Re: Redirecting

2002-04-27 Thread Jason Wong

On Monday 22 January 2001 14:31, The_RadiX wrote:
 IOW ??

 what's this abbrev?

in other words

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

/*
I hold it, that a little rebellion, now and then, is a good thing...
-- Thomas Jefferson
*/

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




Re: [PHP] PHP is making errors for no apparents reason..?

2002-04-27 Thread Jason Wong

On Saturday 27 April 2002 22:19, newton wrote:
 Hi all..

   I've been trying to understand actually what is the error in the
 following code for 2 hours, i played with the code, moved stuff around and
 the like but nothing worked.. Can someone help me please?

 The PHP error is as follow:

 Parse error: parse error in /usr/home/iro/numripps.php on line 13

Instead of making us count (I've only got ten fingers, I'm wearing shoes and 
I can't see my toes), tell us which is line 13.

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

/*
MIT:
The Georgia Tech of the North
*/

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




Re: [PHP] Directory System Splitter

2002-04-27 Thread Jason Wong

On Saturday 27 April 2002 20:34, Randum Ian wrote:

[snip]

 For example:

 http://www.danceportal.co.uk/diary/2002/may/

 has this in the panel:

 Home / Diary / 2002 / May /   -- These are links back down the system of
 directories.

 http://www.danceportal.co.uk/charts/randumian/mon-22-apr-2002.php

 has this:

 Home / Charts / Randum Ian / Monday, April 22, 2002

 Is it possible to automate this in a template so that it can work out where
 it is and create the correct links?

Yes.

http://homepages.tesco.net/~J.deBoynePollard/FGA/questions-with-yes-or-no-answers.html


Presumably you want to know *how* to do it?

Use phpinfo() to see what predefined vars you can use to get your document 
path. Then probably use explode() to get the individual components of the 
path.

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

/*
Are we not men?
*/

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




Re: [PHP] Stop to fast caching/parsing

2002-04-27 Thread Jason Wong

On Saturday 27 April 2002 22:49, Jan Peuker wrote:
 Hi List,

 my Problem is, on the second line of my script I validate a session. If
 it's false, it dies. But in the first line, I require a
 header(html,body,title etc.). Now, if a session fails, my die-Message ends
 in a script-Part, so nobody sees it but gets an error by JS. Is there
 any way to stop parsing PHP before flushing out required headers?

Can't you change the order of your code so that it validates the session 
before doing anything else?

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

/*
Put a rogue in the limelight and he will act like an honest man.
-- Napoleon Bonaparte, Maxims
*/

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




Re: [PHP] PayPal: Instant Payment Notification

2002-04-27 Thread Jason Wong

On Sunday 28 April 2002 00:25, Lauri Vain wrote:

 Has anybody worked with PayPal's Instant Payment Notification?

Not yet, but am about to.

 How exactly does it work -- will the payer ever go to PayPal's site
 itself (and leave my site for a sec) or will all contact with PayPal's
 servers be handled by my script?

No, the user doesn't 'leave' your site, all the processing goes on behind the 
scenes.

 I have to write a system that enables payments via this service, but I'm
 low on documentation and this service is a new one for me.

 An overview of the process and pointers would be great!

Paypal provides some scripts which looks self-explanatory.

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

/*
Never leave anything to chance; make sure all your crimes are premeditated.
*/

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




Re: [PHP] Stop to fast caching/parsing

2002-04-27 Thread Jason Wong

On Saturday 27 April 2002 23:57, Jan Peuker wrote:
 But I WANT to do something else, loading other code!
 But ok, I will check at first, then include a short header before dying.
 This runs, but isn't beautiful. Thanks.

If you want (hopefully) better suggestions, post your code.

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

/*
Research is to see what everybody else has seen, and think what nobody
else has thought.
*/

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




Re: [PHP] simplify if/then statement

2002-04-27 Thread Jason Wong

On Sunday 28 April 2002 02:59, Jim Long wrote:
 Hi,

 I've got the following statement for a state options menu.
 How can this be expressed in a simple manner for all 52 states?


 //choose state

 if ($state == AL) {

 // include class
  include(CalcAL.class.inc);
 }

 else if ($state == AR) {

Take a look at the switch construct.

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

/*
Parsley
 is gharsley.
-- Ogden Nash
*/

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




Re: [PHP] Re: tutorial on global variables

2002-04-27 Thread Jason Wong

On Sunday 28 April 2002 04:39, Henrik Hansen wrote:
 [EMAIL PROTECTED] (John Hughes) wrote:
   Can someone point me toward a tutorial on the proper use of global
   references under PHP4.

The manual has very good information.

  
   I have been declaring
  
   function something()
   {
   global $foo, $bar;
  
   /* some actions */
  
   }
  
   in functions and I understand that this is not the way I'm supposed
   to be doing this. Or there is a new way that is preferred.

That is a perfectly valid declaration, but without knowing your intent one 
cannot say whether it is 'right' or 'wrong'.

The thing you need to remember with PHP is that unlike many other languages, 
by default variables are not global in nature. Thus in order to use a 
variable that is defined outside of a function you need to declare it like 
you have above.

 you can do it that way, but if you want to avoid calling global all
 the time you might consider this approach:

 $GLOBALS[foo] = 123;

  $foo = 123; # No need to use the $GLOBALS array when outside of a function

 function something()
 {
 echo $GLOBALS[foo];
 }

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

/*
...if the church put in half the time on covetousness that it does on lust,
 this would be a better world.  - Garrison Keillor, Lake Wobegon Days
*/

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




Re: [PHP] Apache: SERVER_NAME gone?

2002-04-27 Thread Jason Wong

On Tuesday 23 January 2001 07:55, The_RadiX wrote:
 Hmm

  because $SERVER_NAME is created IF the php
  directive register_globals = on.  this setting
  is off by default as of PHP 4.2.0.  all
  server predefined variables behave this way,
  such as $PHP_SELF, etc.

 Yes so I've heard... One thing though.. I use PHP4.1.1... not 4.2.x

Read the changelog (or history). A lot of default behaviour has changed 
starting from 4.1.X.

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

/*
Happiness isn't something you experience; it's something you remember.
-- Oscar Levant
*/

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




Re: [PHP] NameVirtualHost breaks PHP

2002-04-28 Thread Jason Wong

On Monday 29 April 2002 00:53, Greg Blakely wrote:

 I have an Apache web server (1.0.38) that has been peacefully
 co-existing with php4 for quite some time.  I've interfaced it to mySQL,
 and life was great.

Apache 1.0.38  How old is that? If you're really using such an old 
version you should first upgrade to something modern (1.3.X or the 2.0.X 
series).

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

/*
Chicken Little was right.
*/

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




Re: RE: [PHP] Wrapping Text

2002-04-28 Thread Jason Wong

On Monday 29 April 2002 01:53, John Holmes wrote:
 It should have a % for the width at least, and then it should wrap
 itself.

Not necessarily, if you have a single 'word' (a string of characters with no 
space) that is very long then the width of the table stretches to accomodate 
the length of that 'word'.

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

/*
There's no easy quick way out, we're gonna have to live through our
whole lives, win, lose, or draw.
-- Walt Kelly
*/

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




Re: [PHP] date problem

2002-04-28 Thread Jason Wong

On Sunday 28 April 2002 21:10, Nick Wilson wrote:
 * and then Richard Emery declared

  Third, let Mysql do the conversion for you.  For instance if you
  timestamp field is named mydate:
SELECT DATE_FORMAT(mydate,%e %b %Y) AS thedate FROM mytable

 Nice one, cheers Richard.
 I didn't know about that mysql function...

Can we say, RTFM :)

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

/*
Everything is possible.  Pass the word.
-- Rita Mae Brown, Six of One
*/

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




Re: [PHP] failed query results

2002-04-28 Thread Jason Wong

On Sunday 28 April 2002 20:48, baldey_uk wrote:

 $customer_id_check=(SELECT id FROM $customer_table WHERE firstname =
 '$firstname'  lastname = '$lastname'  email = '$email');
   $result1=mysql_query($customer_id_check);
   if (!$result1) {
  print theres no such customer!;
   }

 which i thought should echo 'theres no such customer!' if a customer didnt
 exist who fitted the query, however it doesnt and if i echo $result1 i get
 'Resource id #2 not what i was expecting (was more expecting something
 along the lines of NULL).

Have a look at the examples in the php manual and learn how to incorporate 
error checking in your code.

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

/*
BTW, does Jesus know you flame?
-- Diane Holt, [EMAIL PROTECTED], to Ed Carp
*/

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




Re: [PHP] redirection

2002-04-28 Thread Jason Wong

On Monday 29 April 2002 10:11, Norman Zhang wrote:
 Hi,

 I want to set up a check that the page cannot be exacted by calling from
 another page. E.g., members.php can only be excited if it called by
 login.php.

 So I set

 if (eregi(members.php, $_SERVER['PHP_SELF'])) Header(Location,
 login.php);

 at the very top of members.php. But I am being redirected to login.php no
 matter if members.php was called from login.php. What's proper way of
 implementing this?

In your code, assuming your regex is correct it matches *all* the time, thus 
no matter how you get to members.php, you'll be redirected to login.php.

And do you really only want to let people access members.php directly after 
visting login.php? How about if they login, go to the members page then go 
somewhere else on your site, then try to go back to the members page and they 
can't!

I would suggest that you use a more robust mechanism, such as sessions, for 
allowing/denying access to certain pages.

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

/*
To generalize is to be an idiot.
-- William Blake
*/

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




Re: [PHP] lookin for a Menuing System...

2002-04-28 Thread Jason Wong

On Monday 29 April 2002 11:11, Dan wrote:
 I could do this myself but I don't want to waist time writing something
 that I could have just asked for..

 what I need is a menuing system..

 When link is clicked the sub-topics appear under the topic you just clicked
 on..

 e.g. if you where to click on Contact.

 Contact
 --becomes:

 Contact
Enquires
Account / Billing
Media Enquiries

 Much like this JavaScript one... except I need it in PHP...
 http://www.dynamicdrive.com/dynamicindex1/navigate1.htm

There are some classes to do this on:

www.phpclasses.org

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

/*
No one can make you feel inferior without your consent.
-- Eleanor Roosevelt
*/

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




Re: [PHP] lookin for a Menuing System...

2002-04-28 Thread Jason Wong

On Monday 29 April 2002 12:46, michael kimsal wrote:
 Miguel Cruz wrote:
 Do it in JavaScript, it works and it's client side so it will be
 faster.
 
  But take care - using JavaScript for site navigation is tricky business.
  Some people don't use it, some people can't use it (not supported by
  their browsers / hardware / corporate policy), and search engines
  certainly won't follow those links.

 Can someone point me to hardware that is still in active use that can't
 handle javascript?

I don't think it's hardware that was problem with javascript.

 Similarly, can someone point me to a company that specifically disables
 javascript as 'corporate policy'?  Back in 96-97, the 'no javascript'
 argument held, and probably holds today some if you're targetting
 handhelds and other 'non standard' devices.  But if someone specifically
 disables Javascript these days, a good portion of their web experience
 will not be as robust as it would otherwise be, and they probably won't
 notice that using your site is any worse than any other site.

Rather it was Microsoft's numerous bugs and vulnerabilities within IE which 
lead people to disable scripting. And of course annoying pop-up windows are 
another major reason to disable javascript.

Konqueror is the only browser (that I've used) which supports per-site 
javascript policy (deny, allow, disable pop-ups).

 IMO, it's now like targetting only websafe colors because some people
 might only browse in 256 colors.  If they do that, about 80% of the
 web's content will look like crap anyway, and they won't specifically
 think my stuff looks all that much worse than anyone else's.

You're comparing apples with spades. I think with most browsers, people need 
to make a conscious decision to disable javascript (ie it's enabled by 
default). In other words these people /should/ know what they're doing by 
disabling it.

On the other hand I don't think many people would actively choose to browse 
in 256 colours when any machine less than 3 years old would most definitely 
support true colour.

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

/*
The strong give up and move away, while the weak give up and stay.
*/

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




Re: [PHP] Unable to Install PHP 4.2 into RH7.0/Apache 1.3

2002-04-28 Thread Jason Wong

On Monday 29 April 2002 12:15, Richard Emery wrote:

 This created a stand-alone PHP binary which executes correctly from the
 command line (I first moved the binary PHP to /usr/sbin).  However, when I
 execute PHP scripts from within Apache, it uses the older 4.0.1p12 version
 which came from the RPM.

Did you change hhtpd.conf to point to the new php binary? Look for the lines 
beginning:

ScriptAlias ...
AddType ...
Action ...

 Question: where to from here?  Must I install Apache from source to create
 the DSO or static version (I prefer DSO, because that's what I've been
 running)?  Or, since I do not have the apxs file, is that something that
 somebody can send to me?

My preference is to install apache-php from source. That way you're not 
dependent on your distro to keep up with the latest versions. I could send 
you the apxs from apache 1.3.23 if you wish, don't know whether it will work. 
Let me know off list.

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

/*
A programming language is low level when its programs require attention
to the irrelevant.
*/

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




Re: [PHP] lookin for a Menuing System...

2002-04-28 Thread Jason Wong

On Monday 29 April 2002 13:05, Martin Towell wrote:
  Konqueror is the only browser (that I've used) which supports per-site
  javascript policy (deny, allow, disable pop-ups).

 Actually, Opera support this too - one reason why I do a lot of my browsing
 in Opera or Lynx, no pop-ups :)

Is is in the 6.x series? With my 5.12, the only options for Javascript are 
[Enable Javascript] and [Report Javascript errors].

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

/*
We have DIFFERENT amounts of HAIR --
*/

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




Re: [PHP] reg-ex again

2002-04-29 Thread Jason Wong

On Monday 29 April 2002 15:22, John Fishworld wrote:
 I'm trying to find files in my array
 for example
 =lg_imode.gif
 and
 =/db/imodeklein/edgar-IMODE-1-.gif

 I want to differentiate between the files with slash at the front and ones
 without so that
 I can add a server path !
 but as usual I' m having problems with the correct regex

Assuming that all those files which have a '/' at the front already have a 
valid path, and thus it is only those without a '/' that needs a path, then 
wouldn't it be far simpler to just check the first character to see whether 
it is a '/' and act accordingly? 

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

/*
 WAIT 
*/

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




Re: [PHP] text problem.

2002-04-29 Thread Jason Wong

On Monday 29 April 2002 17:44, r wrote:
 Greetings all,
 Special greetings to all my new PHP list pals, you know who you are.

 Sorry to be so mysterious in the subject line but i dont know how to
 explain this in one line.

 ever visit a site and you get this text (Or something like this...heheh)

 This morning shockingly Bill Gates claims he is broke!
 The kooky billionaire is...(link)subscribe / login to read this fully.

 Basically, its querying the database and instead of displaying the whole
 results it just taking the first 2 lines or X number of characters and then
 adding the link stuff.any idea how to do this?

You yourself have already outlined how to do it:

  get text from db
  get the first 100 chars from the text
  drop the last 'word' (it may be incomplete), using explode(), array_pop()

You may have to refine the process to suit your needs.

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

/*
The discerning person is always at a disadvantage.
*/

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




Re: [PHP] Re: reg-ex again

2002-04-29 Thread Jason Wong

On Monday 29 April 2002 17:10, John Fishworld wrote:
 No the problem is I'm reading a file into an array and then need
 to change any of the links in the file from relative links to absolute
 links !
 So that my lg_mode.gif gets the full server path in front of it
 http://www.ltest.com/lg_mode.gif

 and exactly the same with the other one but of course I don't won't

 http://www.test.com//folder/name.gif

I'm trying to find files in my array
for example
=lg_imode.gif
and
=/db/imodeklein/edgar-IMODE-1-.gif
   
I want to differentiate between the files with slash at the front and

 ones

without so that
I can add a server path !
but as usual I' m having problems with the correct regex

Not sure if I understand your problem correctly.

Define your server path as: http://www.myserver.com/some/path  (NB no 
trailing slash)

If the first char of file contains '/' use:

  $server_path$file

otherwise use:

  $server_path/$file

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

/*
Why is the alphabet in that order?  Is it because of that song?
-- Steven Wright
*/

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




Re: [PHP] Re: Translation Request--Altavista Babelfish can't do i t

2002-04-29 Thread Jason Wong

On Monday 29 April 2002 20:52, Ford, Mike   [LSS] wrote:
  -Original Message-
  From: Hugh Bothwell [mailto:[EMAIL PROTECTED]]
  Sent: 27 April 2002 01:15
 
  Vins [EMAIL PROTECTED] wrote in message
  [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 
   if(!ereg(^#(.)*$, $buffer[$i]))
   {
   echo ok;
   }
  
   what does this mean?

 [...]

  Boiled down, it is 'ok' if the string
  doesn't start with '#'.

 Um -- I'm no regex expert, but isn't ^ the start of string character? --
 so this is looking for strings which *do* begin with a hash!

Well the ereg is looking for strings beginning with # but then the whole if 
expression is negated (!), so the statement it is 'ok' if the string doesn't 
start with '#' is correct.

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

/*
When it comes to broken marriages most husbands will split the blame --
half his wife's fault, and half her mother's.
*/

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




Re: [PHP] Null character as field seperator in a string.

2002-04-29 Thread Jason Wong

On Monday 29 April 2002 18:26, Dave MacRae wrote:
 For historic reasons, I have a file that contains a number of records in
 which the fields are seperated by the NULL character, i.e,

 field1\0field2\0field3\0field4

 I need to parse out the fields from this string.

 The string is read into the program using

   $buffer = fgets(...).

 This would be no problem in Perl or C but I cannot get this to work in PHP.

 I have tried using

   preg_split(/\0/, $buffer);

 But this fails. I've tried walking through the string but it seems that
 $buffer only has the content up to the first NULL character.

Try using fread() to get your file (it's binary safe). Then use:

  explode(chr(0), $buffer);

to separate your fields.

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

/*
I have gained this by philosophy:
that I do without being commanded what others do only from fear of the law.
-- Aristotle
*/

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




Re: [PHP] image generation Problems (jpeg)

2002-04-29 Thread Jason Wong

On Monday 29 April 2002 20:02, Peter Revill wrote:

 hi, im having a few problems installing GD, ill start from the top:

 I need Jpeg support in my PHP installation, and unfortunatly, GD (the
 verison i have) does not support them, so i figure, ill install it,
 installing the libary jpeg-6b works easily
 however, i attempt to compile from there GD, but the following error is
 produced:

It's usually a good idea to state what kind of setup you have (OS, version 
etc).

 [root gd-1.8.4]# make
 gcc -I. -I/usr/include/freetype2 -I/usr/include/X11
 -I/usr/X11R6/include/X11 -I/usr/local/include -c -o gd_gd2.o gd_gd2.c
 In file included from /usr/include/errno.h:36,
from gd_gd2.c:14:
 /usr/include/bits/errno.h:25: linux/errno.h: No such file or directory
 make: *** [gd_gd2.o] Error 1

Have you checked that you have the file linux/errno.h anywhere in your 
system?

On my RH7.1 system, 

  /usr/include/linux/errno.h

is provided by kernel-headers, so if don't have it and you're using RH, 
install kernel-headers. If you're using something else check with your distro 
vendor.

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

/*
That unit is a woman.
A mass of conflicting impulses.
-- Spock and Nomad, The Changeling, stardate 3541.9
*/

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




Re: [PHP] image generation Problems (jpeg)

2002-04-29 Thread Jason Wong

On Monday 29 April 2002 21:40, Peter Revill wrote:

 Im not even sure myself, linux on 2.2.14 on what should be a redhat box
 i know theres a command something like dsmod to get the info, hmm..

Never mind, as long as you're reasonably sure it's a RH system you're running 
on .

 Have you checked that you have the file linux/errno.h anywhere in your
 system?

 yes, but it wasnt around, errno.h was, but not errno.h like that

So there's your problem :)

 i found the kernel-headers package, but it msut be damaged or something
 (rpm --query says it exists, but i have my doubts as to the files still
 existing)

  rpm -ql kernel-headers

Would show you what files kernel-headers had installed.

 is it OK to install kernel headers of a diffirent kernel number?

I don't know. But if you do try it, let us know what happens :)

 i.e. if i install kernel-headers 2.4.1 or wahtever is that ok? or will
 that cause problems?
 (im betting money on it will cause problems)

If there aren't any special reasons, I would just use the corresponding 
headers for your kernel.

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

/*
Silence is the only virtue you have left.
*/

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




Re: [PHP] return multiple value from function

2002-04-29 Thread Jason Wong

On Monday 29 April 2002 22:11, sanjay wrote:
 Hi List,

 I am new to php programming and wanted to know if it is possible to return
 multiple value from a function like cgi programs.
 How can I get the following result using php.

 ($var1, $var2) = myfunction($a,$b);


 function myfunction($c,$d)
 {
// code
 // code
 return ($e,$f);
 }

No. But it is possible to get similar results.

a) Return an array

  $result = myfunction($a, $b);
  echo $result['e'];
  echo $result['f'];


  function myfunction($c, $d) {
do
something
$result['e'] = $this_is_e;
$result['f'] = $this_is_f;
return $result;
  }


b) Use references

  myfunction($c, $d, $e, $f);

  echo $e;
  echo $f;
 
  function myfunction($c, $d, $e, $f) {
do
something
$e = $this_is_e;
$f = $this_is_f;
  }

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

/*
I didn't know it was impossible when I did it.
*/

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




Re: [PHP] image generation Problems (jpeg)

2002-04-29 Thread Jason Wong

On Monday 29 April 2002 21:55, Peter Revill wrote:

 Its a colbat cube running some sort of modified linux, i think based on
 Redhat
 i doint know what kind of colbat cube

I presume you mean Colbalt ;-) in which case you cannot use the RH rpms.

 If there aren't any special reasons, I would just use the corresponding
 headers for your kernel.

 There is a special reason, namely: i cant find:
 kernel-headers-2.2.14C11-1.rpm
 anywhere :~(

Well, you can try installing a newer kernel-headers, I don't know what effect 
it will have.

Or your better bet is to upgrade the kernel as well.

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

/*
Wouldn't this be a great world if being insecure and desperate were a turn-on?
-- Broadcast News
*/

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




Re: [PHP] _SERVER variable insd prnt sttmnt

2002-04-29 Thread Jason Wong

On Monday 29 April 2002 23:05, Kirk Babb wrote:
 Hi All,

 Thanks alot for all your help with the _SERVER['PHP_SELF'] earlier, I have
 another question related to that:

 What is the correct syntax for the above if I want to use it in a print
 statement like so (I included the whole piece of code so you guys could at
 least see what I'm trying to do):

 $string=ABCDEFGHIJKLMNOPQRSTUVWXYZ;
  $chars = preg_split('//', $string, -1, PREG_SPLIT_NO_EMPTY);
  for ($cnt=0; $cnt  26; $cnt++) {
 //commented out the next line since I couldn't get it to work
 //print LIA HREF='$_SERVER['PHP_SELF']?letter=$chars[$cnt]' .

Normally you would use:

  $_SERVER['PHP_SELF']

But inside a double-quoted string like above you would use:

  $_SERVER[PHP_SELF]

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

/*
Work expands to fill the time available.
-- Cyril Northcote Parkinson, The Economist, 1955
*/

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




Re: [PHP] Pixel Length of text message

2002-04-29 Thread Jason Wong

On Tuesday 30 April 2002 00:17, District Webmaster wrote:
 In html/css you can set a font size in pixels -- in my experience this
 means a letter takes the same number of pixels, regardless of
 resolution. 

That may (or may not) be true, but that's referring to the height of the font.

 With php, can I use string length and font pixel size to
 determine the length of a given string on a screen? Does anyone know an
 algorithm for this that works for any/every font?

Here I would assume you're referring to the width of the text. Thus what you 
want to do is not possible.

You can use a fixed-width font and hope for the best.

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

/*
If the very old will remember, the very young will listen.
-- Chief Dan George
*/

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




Re: [PHP] sort and maintain varible names

2002-04-29 Thread Jason Wong

On Tuesday 30 April 2002 01:19, Jim Long wrote:
 I have a basic sort:

  $orderd_list = array ($onec_rounded_total, $aps_rounded_total,
 $bo_rounded_total, $cap3_rounded_total, $cap3_rounded_total,
 $cap_rounded_total, $cfl_rounded_total, $ecg_rounded_total,
 $ldd_rounded_total, $png_rounded_total, $spr_rounded_total,
 $ist917_rounded_total, $tciac_rounded_total, $tcicl_rounded_total,
 $utl_rounded_total); sort ($orderd_list);
  reset ($orderd_list);
  while (list ($key, $val) = each ($orderd_list)) {
  echo [.$key.] = .$val.br\n;

 It returns

 [0] = 4.90
 [1] = 4.99
 [2] = 5.06
 [3] = 5.60
 [4] = 6.00
 [5] = 6.00
 [6] = 6.90
 [7] = 6.90
 [8] = 6.95
 [9] = 7.00
 [10] = 9.00
 [11] = 10.50
 [12] = 11.00
 [13] = 11.26
 [14] = 13.10

 How do I maintain a varible name (for identification) in this output
 list ie:

 onec = 4.90 //from the varible $onec_rounded_total
 cfl = 4.99
 bo = 5.06
 and so on...

First you need to define your array so that it encapsulates some form of 
identification:

  $orderd_list = array ('onec_rounded_total' = $onec_rounded_total,  
'aps_rounded_total'  = $aps_rounded_total, ...);

Then use asort().

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

/*
Welcome to Lake Wobegon, where all the men are strong, the women are pretty,
and the children are above-average.
-- Garrison Keillor
*/

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




Re: [PHP] Forms

2002-04-29 Thread Jason Wong

On Tuesday 30 April 2002 01:25, Arpan De wrote:

 But I don't know why I am not getting the output. I am just getting the
 following error:

 Notice: Undefined variable: fame in d:\inetpub\wwwroot\php\Form1.php on
 line 3

 In order to pass the Form values to a PHP page, I went through 3-4
 tutorials on the web  all showed this way only to collect the form values
 as what I have done but still I am getting the error. It's damn frustrating
 when even after just copying  pasting the code from the tutorial  then
 running it I get an error. I even tried the above using print($fname) but
 without any luck. But if I include the following line in the PHP code
 before the above PHP line

You're probably using a newer of php (4.1.X) in which the default behaviour 
of many aspects of php had changed.

So if you're using php 4.1.X then you need to reference $fname as:

 $_POST['fname']

Or if you had use the GET method in your form then:

 $_GET['fname']

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

/*
Just because the message may never be received does not mean it is
not worth sending.
*/

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




Re: [PHP] Thumbnails from Binary DB info.

2002-04-29 Thread Jason Wong

On Tuesday 30 April 2002 09:49, Shane wrote:
 Greetings folks. I'm looking for a solution to make thumbnails from my
 binary files inside my mySQL DB.

 Can anyone give me some direction for options besides Image Magick?

Manual  Image functions

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

/*
The San Diego Freeway.  Official Parking Lot of the 1984 Olympics!
*/

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




Re: [PHP] If statement leading to another php page

2002-04-29 Thread Jason Wong

On Tuesday 30 April 2002 12:36, baldey_uk wrote:
 Hello all,

 How can i force a transfer to another php page from an if statement?

 I have been trying:

 if (condition){

 echo A HREF=3Dwww.link.comLink/A;

 }
 else {

 something else
 }

if (something) {
  header(Location: http://www.somewhere.com;); }
else {
  whatever;
}

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

/*
Use an accordion.  Go to jail.
-- KFOG, San Francisco
*/

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




Re: [PHP] parse error after ?

2002-04-29 Thread Jason Wong

On Tuesday 30 April 2002 12:40, Ironfroggy wrote:
 I have a PHP script which gets a parse error on the last line (a
 blank line after the last ?).  I really have no idea what could
 cause this.  I checked for all my closing brackets.

Check for missing braces }  semicolons ;, they're the usual culprits.

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

/*
Politics are almost as exciting as war, and quite as dangerous.  In war,
you can only be killed once.
-- Winston Churchill
*/

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




Re: [PHP] How to see the error from mysql?

2002-04-29 Thread Jason Wong

On Tuesday 30 April 2002 13:56, Jack wrote:
 Dear all
 I had made a page which import some csv file data into Mysql, when i test
 this page, it doesn't show any message or error, but the data didn't load
 into mysql table, so is there anyway i could use in php to show me the
 status of mysql?

RTFM!

mysql_error()

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

/*
purpitation, n.:
To take something off the grocery shelf, decide you
don't want it, and then put it in another section.
-- Sniglets, Rich Hall  Friends
*/

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




Re: [PHP] If value is divisible by 2

2002-04-30 Thread Jason Wong

On Tuesday 30 April 2002 16:05, Marius Ursache wrote:

 if(($i % 2)==0)


Or simply:

  if ($i % 2)

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

/*
To thine own self be true.  (If not that, at least make some money.)
*/

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




Re: [PHP] regular expressions help please

2002-04-30 Thread Jason Wong

On Tuesday 30 April 2002 15:51, Ed Lazor wrote:
 I've been banging my head against regular expressions all night... help
 would be greatly appreciated.  Could you give me examples on how to do the
 following?

Is this for a programming assignment/exercise? Do you /have/ to use regex? 
Other methods may be easier. I'll do the two simple ones:

 Pull everything except a specific word from a sentence.  For example,
 pulling everything except the word run from the water run was steep.

a) Use str_replace(), search for 'run ' (or ' run') and replace with ''.
b) explode() the string, put 'run' (and any other words you don't want) into 
an array, then use array_diff()

 Pull all words from a string starting with a specific letter or
 pattern.  For example, pulling all of the words starting with the letter r
 from run beep burp ran rin ron runt zoot zip pow

a) explode() the string, loop through array check 1st char of each element.

 I apologize in advance if these are really simple.  It's just that I'm new
 to regular expressions and reading all of the web page tutorials, manual
 pages, and mailing list archive messages has left me thinking I'm
 complicating something somewhere, because it really shouldn't be this hard.

As you can see, a bit of lateral thinking can get you the same results 
without the headbanging. Using regex can be expensive in terms of CPU cycles 
and very often simpler methods will suffice. By all means learn regexes as 
they are damn useful. But start simple then build upon it.

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

/*
A full belly makes a dull brain.
-- Ben Franklin

[and the local candy machine man.  Ed]
*/

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




Re: [PHP] Insert in database

2002-04-30 Thread Jason Wong

On Tuesday 30 April 2002 18:15, Ford, Mike   [LSS] wrote:

  echo(Hi ,$_POST['fname'],nbsp;,$_POST['lname'],Thank You For
  Registering !!!);

 You don't need to go as far as that.  Just removing the parentheses from
 the original statement would have done the trick -- the commas are fine.

Or keep the parentheses but replace the commas with a period ( , - . ).

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

/*
Many changes of mind and mood; do not hesitate too long.
*/

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




Re: [PHP] Page Numbers

2002-04-30 Thread Jason Wong

On Tuesday 30 April 2002 18:41, Craig wrote:
 Any one know how to display, go to page number on a record list page

 eg

 Prev 1|2|3|4|5|6... Next

Yes.

http://homepages.tesco.net/~J.deBoynePollard/FGA/questions-with-yes-or-no-answers.html

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

/*
Practical politics consists in ignoring facts.
-- Henry Adams
*/

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




Re: [PHP] regular expressions help please

2002-04-30 Thread Jason Wong

On Tuesday 30 April 2002 16:31, John Fishworld wrote:
 I'm trying to find files in my array
 for example
 =lg_imode.gif
 and
 =/db/imodeklein/edgar-IMODE-1-.gif

Perhaps you should clarify your problem. First of all does your array contain 
just gif files (ie *.gif) or does it contain all sorts of files? (ie 
readme.txt, important.doc, funny.gif etc)

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

/*
In a consumer society there are inevitably two kinds of slaves:
the prisoners of addiction and the prisoners of envy.
*/

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




Re: [PHP] regular expressions help please

2002-04-30 Thread Jason Wong

On Tuesday 30 April 2002 19:17, John Fishworld wrote:
 Okay right I'm experimenting with an i-mode parser !
 I copy the file (url entered) to a local location !
 Then read through the whole file line at a time and change/replace the
 things that need replaceing !
 On of the things that I need to replace is the links to the pictures so
 that they still show even !
 I've already got from the original file the original location
 http://www.whatever.com
 and now want to insert that in front of the gif files
 ie
 $imode_code[$i] = eregi_replace((img src=).+\.gif\ ,
 \\1$next_path\\2,$imode_code[$i]);

 There are just gif files in this !

 Does that make more sense ?

Unfortunately, no. Could you post say 20 lines of this file you're talking 
about.

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

/*
You are in a maze of little twisting passages, all different.
*/

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




Re: [PHP] regular expressions help please

2002-04-30 Thread Jason Wong

On Tuesday 30 April 2002 19:43, John Fishworld wrote:

 $imode_code = file($url_file);
 $file_name = basename($url_file);
 $path = dirname($url_file);
 $stripped_path = eregi_replace(^(.{2,6}://)?[^/]*/, , $path);

  On Tuesday 30 April 2002 19:17, John Fishworld wrote:
   Okay right I'm experimenting with an i-mode parser !
   I copy the file (url entered) to a local location !
   Then read through the whole file line at a time and change/replace the
   things that need replaceing !
   On of the things that I need to replace is the links to the pictures so
   that they still show even !
   I've already got from the original file the original location
   http://www.whatever.com
   and now want to insert that in front of the gif files
   ie
   $imode_code[$i] = eregi_replace((img src=).+\.gif\ ,
   \\1$next_path\\2,$imode_code[$i]);
  
   There are just gif files in this !
  
   Does that make more sense ?
 
  Unfortunately, no. Could you post say 20 lines of this file you're
  talking about.

I mean the file that you're readingparsing, not your program.

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

/*
The absent ones are always at fault.
*/

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




Re: [PHP] Database Duplication

2002-04-30 Thread Jason Wong

On Tuesday 30 April 2002 21:57, Liam Gibbs wrote:
 Maybe I should explain myself a little better. Sorry
 for leaving out what turned out to be crucial details.

I think someone asked in response to your original post what db are you 
using?. You still haven't told us!

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

/*
The kind of danger people most enjoy is the kind they can watch from
a safe place.
*/

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




Re: [PHP] Session Authentication etc...

2002-04-30 Thread Jason Wong

On Tuesday 30 April 2002 22:57, Troy Lynch wrote:
 I'm currently rewriting a website in PHP and something I'm looking to do is
 login and logouts but also have a page to view who is logged at the present
 time. 

Assuming that you do not require a user to logout, there is no reliable 
method to determine whether a user is (still) logged in. The best you can do 
is know (1) When they logged in  (2) When their last request was.

 I've kinda made some login code which basically checks the database
 and then sets a cookie which I think I will change cause it looks like I
 wonna do session variables. Anways anyone either know of a decent
 authentication lib that I can use to check the users online and do
 authentication or can someone point me in the right direction in doing
 this?

There's something called php_lib_login that you can google for.

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

/*
The Army needs leaders the way a foot needs a big toe.
-- Bill Murray
*/

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




Re: [PHP] Files sorted by date?

2002-04-30 Thread Jason Wong

On Wednesday 01 May 2002 00:24, Randum Ian wrote:
 Hi there,

 I got a number of files in the directory /reviews/txt which are reviews.
 They are submitted by people all over the world.

 Can someone please tell me what I need to do so that I can display them in
 date order, newest at the top on a webpage?

First look at Directory functions
Then Filesystem functions
Then Array Functions

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

/*
Support your right to arm bears!!
*/

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




Re: [PHP] regular expressions help please

2002-04-30 Thread Jason Wong

On Tuesday 30 April 2002 21:09, John Fishworld wrote:
 Duh ! lol sorry !

 img src=/db/imodeklein/edgar-IMODE-1-.gif vspace=2br#59091;nbsp;a
 href=imode.fpl?op=imodecardprefix=IMODEnummer=1suffx=uid=55%2eFAGAEpa


Unfortunately, no. Could you post say 20 lines of this file you're
talking about.
 
  I mean the file that you're readingparsing, not your program.

Try this:

  preg_match_all(/src=(\'[a-z0-9_\/-]+\.gif\')/i, $input, $MATCH);
  print_r($MATCH);

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

/*
Money is its own reward.
*/

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




Re: [PHP] Is it possible to verify that a form submision is not being spoofed?

2002-04-30 Thread Jason Wong

On Wednesday 01 May 2002 04:05, Cal Evans wrote:
 Generate a random number when creating a form, store it in the session and
 in a hidden on the form. Then when the post comes back, make sure the
 hidden is there and that it matches the one in the session.

But the flaw in that is if the nasty user was determined, there's nothing to 
stop them from:

1) looking at the source of the legitimate page
2) grabbing the 'hidden' value
3) creating their own form along with that hidden value
4) opening a new window
5) loading their own form and submit away.

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

/*
People say I live in my own little fantasy world... well, at least they
*know* me there!
-- D.L. Roth
*/

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




Re: [PHP] sending data to two tables.

2002-04-30 Thread Jason Wong

On Wednesday 01 May 2002 07:34, Jule wrote:
 Hey,
 This time it's not about missing quotes or parenthasies i hope.
 I'm trying to make a form which sends name, email, website, favsong and
 comments to table guestbook, but when the checkbox mailinglist is checked
 it should send the name and email to table mailinglist, but it doesn;t seem
 to work.

We're not physic! How doesn't it work?

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

/*
A well-known friend is a treasure.
*/

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




Re: [PHP] sending data to two tables.

2002-04-30 Thread Jason Wong

On Wednesday 01 May 2002 11:48, Jule wrote:

 but not the second one:

 if (isset($Guestbook[mailinglist])) {

You should be using: 

if (isset($Guestbook['mailinglist'])) {


          if (mysql_db_query ($DBName, $Query2, $Link)) {
              echo Your e-mail address was sucessfully
 added to our mailinglist;
          } else {
              echo Your e-mail address will not be
 added to the mailinglist;
          }

Are you saying that the else clause gets executed, so you get Your e-mail 
address will not be added to the mailinglist?

If so then your error is within:

if (mysql_db_query ($DBName, $Query2, $Link))

Therefore:

1) add some error checking code -- see examples in manual and also 
mysql_error().
2) echo your queries ($Query2)

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

/*
The meeting of two personalities is like the contact of two
chemical substances: if there is any reaction, both are transformed.
-- Carl Jung
*/

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




Re: [PHP] verify file before linking to another

2002-05-01 Thread Jason Wong

On Wednesday 01 May 2002 23:45, Jas wrote:
 I am wondering if there is a good tutorial or example of code on how to
 verify that a page has been hit before linking to the next.  For example
 say you have a form, the form once all fields have been filled links to a
 confirmation page then from there it links to a thank you page which
 inserts data to a text file, how can one verify that someone is not just
 typing in the name of the last page and therefore inserting a blank entry
 into the text file?  Any help would be great.

With php you can do all that using a single page. Rough outline:

if (no form data submitted) {
  display_form(); }
else if (not confirm) {
  display_confirmation(); }
else {
  display_thankyou();
}

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

/*
There's no trick to being a humorist when you have the whole government
working for you.
-- Will Rogers
*/

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




Re: [PHP] Header Information for Formatting?

2002-05-02 Thread Jason Wong

On Thursday 02 May 2002 21:05, Jay Blanchard wrote:
 G' morning!

 Can someone tell me where to find the various options for the Header
 function as it relates to M$ Excel? Yesterday, thanks to this list, we
 found a way to open a worksheet in the browser and display data retrieved
 from a database. The worksheet opens with no gridlines and displaying zero
 values, I would like to see gridlines and no zero values. Are there options
 that can be placed in the header function. I have looked at MSDN and did a
 Google search that did not reveal much of anything.

 Here is the header info being used...

 header(Content-Type:  application/x-excel);
 header(Content-Disposition: inline; filename=\excel.xls\);
 header(Expires: 0);
 header(Cache-Control: must-revalidate, post-check=0, pre-check=0);

M$ Excel is not a browser (not yet anyway, and hopefully it doesn't evolve 
into one), thus http headers are not pertinent to how Excel displays it's 
data. Try fiddling with Excel's display options.

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

/*
marriage, n.:
Convertible bonds.
*/

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




Re: [PHP] PRIMARY KEY vs. INDEX

2002-05-02 Thread Jason Wong

On Thursday 02 May 2002 20:13, Christoph Starkmann wrote:
 Hi there!

 I guess I got a very easy question for the pros here...
 I've been searching the documentaion of mySQL, but didn't
 find the answer (even though I'm sure it's out there
 somewhere :))...

 Is a primary key in mySQL automatically indexed? And is a
 unique field indexed automatically ?(I don't think and
 don't hope so, but one never knows)

Pardon, I'm new here, but what has this got to do with PHP?

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

/*
It's great to be smart 'cause then you know stuff.
*/

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




<    2   3   4   5   6   7   8   9   10   11   >