Re: [PHP] Newbie Help!! Please Look!

2001-04-19 Thread chris herring

right up my alley... I use cuteftp, and it usually does all this stuff for
you. all you have to do is right click on the file you want to edit, and it
opens it up in notepad, or the editor you choose. just make sure you save
the file before you close it. after that cuteftp will have a window that
says "upload" or "cancel".. choose upload. if you wish to change the editor,
just go to editsettings in cuteftp, and find the text that says "helper
applications" in the window that pops up. click that, and you can choose
your program.
- Original Message -
From: "Tony Daniels" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, April 18, 2001 10:18 PM
Subject: [PHP] Newbie Help!! Please Look!


 Hello,

 I need to know if there is a program out there that I can use to edit
 the PHP files.  I use CuteFTP to download the files from my server as I
 need to change some wording around from time to time.  Does anyone know
 the correct procedure for downloading a php file with CuteFTP and then a
 program that I can use to edit the text I need to edit.  Then also, the
 correct way to upload it back to the server using CuteFTP.  Do I use
 Binary or ACII.

 Or, if I am way off and there is a program that makes CuteFTP look
 silly, please let me know this also.  I am open for any suggestions, as
 long as they are detailed.  Please email responses to [EMAIL PROTECTED]
 .

 Thank you!


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


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




Re: [PHP] Newbie Help!! Please Look!

2001-04-19 Thread chris herring

forgot to mention that ascii/binary is auto in cuteftp
- Original Message -
From: "chris herring" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, April 19, 2001 1:51 AM
Subject: Re: [PHP] Newbie Help!! Please Look!


 right up my alley... I use cuteftp, and it usually does all this stuff for
 you. all you have to do is right click on the file you want to edit, and
it
 opens it up in notepad, or the editor you choose. just make sure you save
 the file before you close it. after that cuteftp will have a window that
 says "upload" or "cancel".. choose upload. if you wish to change the
editor,
 just go to editsettings in cuteftp, and find the text that says "helper
 applications" in the window that pops up. click that, and you can choose
 your program.
 - Original Message -
 From: "Tony Daniels" [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Wednesday, April 18, 2001 10:18 PM
 Subject: [PHP] Newbie Help!! Please Look!


  Hello,
 
  I need to know if there is a program out there that I can use to edit
  the PHP files.  I use CuteFTP to download the files from my server as I
  need to change some wording around from time to time.  Does anyone know
  the correct procedure for downloading a php file with CuteFTP and then a
  program that I can use to edit the text I need to edit.  Then also, the
  correct way to upload it back to the server using CuteFTP.  Do I use
  Binary or ACII.
 
  Or, if I am way off and there is a program that makes CuteFTP look
  silly, please let me know this also.  I am open for any suggestions, as
  long as they are detailed.  Please email responses to [EMAIL PROTECTED]
  .
 
  Thank you!
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]


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


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




[PHP] image-resize/convert

2001-04-19 Thread De Bodemschat

Hello,

I'm creating a bunch of photogalleries and wondering about the following:

- Is it possible to convert an image or a whole dir with images (jpg) to 60%
  of the original imagesize using php to automate this task?

I know the gd library is installed, but don't know if it supports jpg... And
what functions do I need to use?

gd-variables in phpinfo():
GD Support enabled
GD Version 1.6.2 or higher
FreeType Support enabled
FreeType Linkage with TTF library
PNG Support enabled


Hope you people can help.
THanks,

Bart Verbeek


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




Re: [PHP] Tip for cookies

2001-04-19 Thread John Monfort



  Is that still true when you include the file?
  Say you have a  notfoo.php file, and include foo.php in it. You don't
  still have to pass the cookies, do you?


__John Monfort_
_+---+_
 P E P I E  D E S I G N S
   www.pepiedesigns.com
"The world is waiting, are you ready?"
-+___+-

On Tue, 17 Apr 2001, Pat Hanna wrote:

 I found out today after suffering from minor headaches and hair loss that if
 you have functions defined in and outside file name 'foo.php', and in those
 functions you use cookies, you must pass those cookies to the function
 called. I tried using a value from a cookie in a function and it never could
 access it unless I passed it. Funny
 --
 Patrick Hanna
 Database integration--E-commerce solutions
 The Wentworth Company



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




Re: [PHP] image-resize/convert

2001-04-19 Thread elias

Hi.

here is my GD report from PHPInfo()
gd
GD Support enabled
GD Version 1.6.2 or higher
FreeType Support enabled
FreeType Linkage with TTF library
GIF Support enabled
JPG Support enabled
PNG Support enabled
WBMP Support enabled

I think you don't have JPG enabled.
As for resizing images yes, you can do that, i wrote bunch of scripts that
does that for you.
Whenever you need them mail me although they will be on my page soon.

-elias
http://www.kameelah.org/eassoft


""De Bodemschat"" [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hello,

 I'm creating a bunch of photogalleries and wondering about the following:

 - Is it possible to convert an image or a whole dir with images (jpg) to
60%
   of the original imagesize using php to automate this task?

 I know the gd library is installed, but don't know if it supports jpg...
And
 what functions do I need to use?
 
 gd-variables in phpinfo():
 GD Support enabled
 GD Version 1.6.2 or higher
 FreeType Support enabled
 FreeType Linkage with TTF library
 PNG Support enabled
 

 Hope you people can help.
 THanks,

 Bart Verbeek


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




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




Re: [PHP] array_count_values

2001-04-19 Thread elias

dunno, what doesn't work exactly
but what if you try:

$array = split ("\n", $contents);
$stuff = array_count_values ($array);
echo $stuff["nuts"];

-elias
http://www.kameelah.org/eassoft

""Matthew Luchak"" [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

can someone give a quick hint as to why this does not work:

$array = split ("\n", $contents);
$stuff = array_count_values ($array);
echo $stuff[nuts];

or even:

$array = array (split ("\n", $contents));
$stuff = array_count_values ($array);
echo $stuff[nuts];


thnx...

matthew

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




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




[PHP] IP address enconding

2001-04-19 Thread elias

Hello.

How can i get the IP address of the user who's browsing my current script?
how can i do it via JavaScript and PHP please.

And if i got an IP address such 192.168.0.2
i believe it will be returned as a stringIs there is a function to
encode it to an Integer and the decode it back to a string? or i have to
code it myself?

-elias
http://www.kameelah.org/eassoft





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




Re: [PHP] Characters counting

2001-04-19 Thread elias

You can use MySql's LEFT() or even substring()
example:
SELECT substring(address,1, 20) as _addr FROM tablename

and you will have to look for field  "_addr" in mysql results.

-elias
http://www.kameelah.org/eassoft

""Jorn van Eck"" [EMAIL PROTECTED] wrote in message
9bkpd8$r77$[EMAIL PROTECTED]">news:9bkpd8$r77$[EMAIL PROTECTED]...
 Hi there,

 Does someone know how to display for example150 characters from a $ set by
 MySQL?
 --
 Jorn van Eck
 Student Information Engineering
 Almere
 Tel: +31 614430902
 E-mail: [EMAIL PROTECTED]
 Website: http://www.iie.nl/~eck13



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




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




Re: [PHP] Global variables

2001-04-19 Thread Ulf Wendel



Aaron Tuller schrieb:
 
 At 1:16 AM + 4/19/01, Philip Olson wrote:
pre
  ?php var_dump($GLOBALS) ?
/pre
 
 don't do that, at least I think it will recursively traverse the
 $GLOBALS arrary (since $GLOBALS itself is $GLOBAL) and you will never
 end.

print_r() does have that bug, not var_dump().
http://www.php.net/manual/en/function.print-r.php

Ulf

-- 
Neu: PEAR Menu 3 - Navigationsstrukturen dynamisch dargestellt
http://www.ulf-wendel.de/projekte/menu/tutorial.php |
http://www.phpdoc.de

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




Re: [PHP] Newbie Help!! Please Look!

2001-04-19 Thread Adrian D'Costa

use wordpad.  

Adrian

On Wed, 18 Apr 2001, Tony Daniels wrote:

 I used notepad and it shows some weird symbols like darkened in squares.  That
 is why I was wondering if there was a specific program.  Is there any way to
 get rid of the squares?
 
 Thank for your help.
 
 Jason Murray wrote:
 
   I need to know if there is a program out there that I can use to edit
   the PHP files.  I use CuteFTP to download the files from my server as I
   need to change some wording around from time to time.  Does anyone know
   the correct procedure for downloading a php file with CuteFTP and then a
   program that I can use to edit the text I need to edit.  Then also, the
   correct way to upload it back to the server using CuteFTP.  Do I use
   Binary or ACII.
 
  PHP files (unless optimised by Zend or something) are just plain text
  files. You can use either Binary or ASCII mode to up/download them, and
  your text editor of choice (Notepad, PFM, HomeSite, or for the masochists,
  MS Word :)) to edit them and save them.
 
  Jason
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 


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




RE: [PHP] php equivalent for `command`

2001-04-19 Thread Greig, Euan

I was hoping to avoid concatenation to make my code more legible (less illegible?).

I take it then that there is no equivalent for the use of ` in Unix.

-Original Message-
From: Plutarck [mailto:[EMAIL PROTECTED]]
Sent: 18 April 2001 15:13
To: [EMAIL PROTECTED]
Subject: Re: [PHP] php equivalent for `command`


 In the second set of code lines, what I need to do is somehow bracket off
the $test++ so it is evaluated before being echoed.

You need to use the string concantenation operator (a period) to use things
like $test++, else PHP get's confused.

 echo "Value of test: $test++ BR";

To get that to work like you want it to, you need only do:

echo 'Value of test: ' . $test++ . ' BR';

It's functionally the same, no brackets needed. If you want it to be
evaluated BEFORE it's echoed, you need to use:

echo 'Value of test: ' . ++$test . ' BR';


--
Plutarck
Should be working on something...
...but forgot what it was.



""Greig, Euan"" [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I deliberately gave a simple example, perhaps too simple.  I want to
output quite long and complicated strings that may involve evaluated
variables, calls to functions etc. But I also want it to as legible as
possible. But even something simple along the lines I quoted gives me
problems. See the following code and its output

 ?php
 $test=1;
 echo $test++ . "BR";
 echo $test++ . "BR";

 $test=1;
 echo "Value of test: $test++ BR";
 echo "Value of test: $test++ BR";
 ?

 The output:

 1
 2
 Value of test: 1++
 Value of test: 1++

 In the second set of code lines, what I need to do is somehow bracket off
the $test++ so it is evaluated before being echoed.

 Euan


 -Original Message-
 From: Jason Brooke [mailto:[EMAIL PROTECTED]]
 Sent: 18 April 2001 09:46
 To: Greig, Euan; [EMAIL PROTECTED]
 Subject: Re: [PHP] php equivalent for `command`


 echo ++$x;

 http://www.php.net/manual/en/language.operators.increment.php



   Is there a php equivalent for the use of ` (I think) in Unix/Perl? So
 for example echo "`$x++`" would first evaluate $x++ and then print the
 resulting value.
  
   Euan Greig
   Technical Consultant
   BRANN DATA
   [EMAIL PROTECTED]
   01285 645997




 **
 Any opinions expressed in this email are those of the individual and
 not necessarily the Company. This email and any files transmitted with
 it, including replies and forwarded copies (which may contain alterations)
 subsequently transmitted from the Company, are confidential and solely for
 the use of the intended recipient. If you are not the intended recipient
 or the person responsible for delivering to the intended recipient, be
 advised that you have received this email in error and that any use is
 strictly prohibited.

 **

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





**
Any opinions expressed in this email are those of the individual and 
not necessarily the Company. This email and any files transmitted with 
it, including replies and forwarded copies (which may contain alterations) 
subsequently transmitted from the Company, are confidential and solely for 
the use of the intended recipient. If you are not the intended recipient 
or the person responsible for delivering to the intended recipient, be 
advised that you have received this email in error and that any use is 
strictly prohibited.

**

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




[PHP] How many color can html recongize in Word.

2001-04-19 Thread Mark Lo \(3\)

Hi,

I would like to know how many colors can html recongized in WORD such as
orange.. red.. blue.. 

eg. font color="blue"Blue/font

where can I find out the sources of how many color can html recrongized in
word.  and what wording should I use..

Thank you so much,

Mark


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




Re: [PHP] Newbie Help!! Please Look!

2001-04-19 Thread Geir Eivind Mork

On Thursday 19 April 2001 05:18, Tony Daniels wrote:
  I need to know if there is a program out there that I can use to edit
  the PHP files.  I use CuteFTP to download the files from my server as I

www.homesite.com
www.ultraedit.com
www.slickedit.com

I assume this have uploadfeatures, atleast the two last ones have. they are 
ranged from the cheapest / useable to the $300 slickedit which just rocks :) 
(and the one I use ofcourse) 

-- 
 php developer / CoreTrek AS| "Jesus may love you, but I think you're 
 Sandnes / Rogaland / Norway| garbage wrapped in skin." -- Michael
 web: http://www.moijk.net/ | O'Donohugh 

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




Re: [PHP] Regular Expression

2001-04-19 Thread Christian Reiniger

On Wednesday 18 April 2001 22:55, you wrote:
 oops. The expression should read '/\[([^\]]+)\]/'

 Thanks all, i used this code and it works:

   preg_match("/\[(.+)\]/",$msg_array[$i],$segments);

Note: This won't do what you expect, since the ".+" part will match as 
much as possible. 
Example: For "This [is a] string [with] multi [brack]ets"
it will match 
"is a] string [with] multi [brack"
A better solution would be "/\[(.+?)\]/"
The '?' after the '+' tells it to match as little as possible.

-- 
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

/* you are not expected to understand this */

- from the UNIX V6 kernel source

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




Re: [PHP] How many color can html recongize in Word.

2001-04-19 Thread Pavel Jartsev

"Mark Lo (3)" wrote:
 
 Hi,
 
 I would like to know how many colors can html recongized in WORD such as
 orange.. red.. blue.. 
 
 eg. font color="blue"Blue/font
 
 where can I find out the sources of how many color can html recrongized in
 word.  and what wording should I use..

Maybe this link helps a little:
http://developer.netscape.com/docs/manuals/htmlguid/colortab.htm


-- 
Pavel a.k.a. Papi

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




Re: [PHP] HTMLSpecialchars

2001-04-19 Thread Christian Reiniger

On Thursday 19 April 2001 07:11, you wrote:

  I'm having a problem with HTMLspecialchars and nl2br interfearing

 // Convert  to lt;, etc
 $output = htmlentities($content);

Little note on the side: htmlentities () is usually better then 
htmlspecialchars (). 
(1) It has a shorter name *g* and (2) it really takes care of *all* HTML 
specialities (e.g. umlauts)

-- 
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

/* you are not expected to understand this */

- from the UNIX V6 kernel source

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




Re: [PHP] IP address enconding

2001-04-19 Thread Knut H. Hassel Nielsen

On Thu, 19 Apr 2001, elias wrote:

 Hello.

 How can i get the IP address of the user who's browsing my current script?
 how can i do it via JavaScript and PHP please.

$REMOTE_ADDR should do the trick (use 'phpinfo()' to see for yourself)

 And if i got an IP address such 192.168.0.2
 i believe it will be returned as a stringIs there is a function to
 encode it to an Integer and the decode it back to a string? or i have to
 code it myself?

 -elias

It is a string, so you couldn't make an integer out of it anymore than making
any other string into an integer. The '.' isn't a legal digit.

You'll have to split it up into different blocks (use split)

-- 
Knut
--
Knut H. Hassel Nielsen
Principal Engineer / Avdelingsingenir
Norwegian University of Science and Technology / NTNU
Department of Computer and Information Science / IDI
N-7491 Trondheim, Norway
Phone Office / Telefon jobb : (+47) 73 59 18 46
Fax   Office / Telefax jobb : (+47) 73 59 17 33
Cell. Phone / Mobiltelefon  :   91 59 86 06


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




[PHP] Problem with apache after installing PHP 4

2001-04-19 Thread Mohamedou

Dear all,

I have apache 1.3.19-3fp and have newly installed PHP 4 using from
rpms.arvin.dk
My problems are:
1-Apache freezes and nothing goes untill I restart it
2-Webmin stops itself.
Furthermore if I give the follow command it sems that no apache but I am
sure apache is running
look:

[root@proxy mohamedou]# rpm qa|grep httpd
[root@proxy mohamedou]# rpm qa|grep apache
[root@proxy mohamedou]# rpm qa|grep http
[--httpproxy host] [--httpport port]
[--httpproxy host] [--httpport port]
[--httpproxy host] [--httpport port]
[root@proxy mohamedou]# rpm qa|grep apache

I thank U

Moh


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


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




Re: [PHP] SESSIONS, a weird, funny yet strange error happens to wrong people...

2001-04-19 Thread Yasuo Ohgaki

Does she use multiple browsers for your site? I think she is doing this.

I'm not sure if session "files" handler is using flock() or not. It could be
failing to open file, since file is locked. (I think it should lock file, since
it's possible to get length 0 file w/o it) This problem will not occur unless
someone accessing web site with multiple browsers that have the same session ID.
This is possible when cookie is used for session.

Since "files" handler is bundled, you have 2 options.

1) Modify "files" handler in session module.
2) Make your own session handler.   (If you use database, why not use the
database?)

Hope this helps,
--
Yasuo Ohgaki


"Maxim Maletsky" [EMAIL PROTECTED] wrote in message
DC017B079D81D411998C009027B7112A015ED114@EXC-TYO-01">news:DC017B079D81D411998C009027B7112A015ED114@EXC-TYO-01...

 hello guys...

 On one of our websites, where we use sessions, a funny error have happened.

 err
 Warning: open(/tmp/sess_b5ad1e0878dee63fa8a780df44af3ea7, O_RDWR) failed:
 File exists (17) in page.japaninc.inc on line 109
 /err

 The funny side of it is that no one has ever seen it except our manager
 (what a luck) from his PC only. I guess, we developers, visit our art-work
 much more often than our manager...

 She's seen it twice already, first time was a month-two ago and now again. I
 ignored it the first time, I though - well, happens... But now I start to
 think it is a bit weird (and dangerous for carrier).

 Any of you have any idea why this "rare" error keeps happening on her
 browser and NEVER on any of developer's? (nor even any other employee of our
 200 company ever complained)...

 What to fix?

 Sincerely,

 Maxim Maletsky
 Webmaster, J-Door.com / J@pan Inc.
 LINC Media, Inc.
 TEL: 03-3499-2175 x 1271
 FAX: 03-3499-3109

 [EMAIL PROTECTED]

 www.j-door.com
 www.japaninc.net
 www.lincmedia.co.jp











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


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




[PHP] Starting PHP script with crontab

2001-04-19 Thread Bertjan Schrader

I need tot start a PHP script at night with the crontab. I tried to do it
with lynx (lynx http://www.domain.nl/test.php) as a commandline within the
crontab. Lynx is starting but the PHP script is not working. Anyone an idea
how to do it?

OS:  Redhat Linux 5.2
Apache
PHP as a apache module

thanks!



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




Re: [PHP] how to scale down image using ImageMagick?

2001-04-19 Thread Steve Werby

"Noah Spitzer-Williams" [EMAIL PROTECTED] wrote:
 I have a bunch of pictures all in ranging filesizes and dimensions. I want
 to resize the ones that over 175 pixels wide to a 175 pixel wide picture
 however i want the height to scale down (ie. i dont want a really thin
 picture, i just want it to be what it would be if it were resized). i have
 this but i cant figure out how to just scale down the width:

 c:\progra~1\imagem~1\mogrify.exe -geometry 175x30! picture.jpeg

 the '!' forces those sizes to be used but obvoiusly i dont want the height
 to be 30. i want it to be whatever it should be so the picture doesnt look
 flattened.

I believe imagemagick has an option where you can specify a single dimension
(x or y) and it will set that dimension accordingly and automatically scale
the other dimension.  This should be covered in the manual pages or --help
output of the program.


--
--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/


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




Re: [PHP] IP address enconding

2001-04-19 Thread Jason Brooke


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



 No! I can encode IP address to an Integer:
 192.168.0.1 consider as: a.b.c.d
 and now the formula goes:
 a shl 24 + b shl 16 + c shl 8 + d
 
 but i was looking for something ready made
 
 -elias
 http://www.kameelah.org/eassoft




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




Re: [PHP] IP address enconding

2001-04-19 Thread elias

thanks for the hint!

""Jason Brooke"" [EMAIL PROTECTED] wrote in message
02a801c0c8bd$6f5528c0$[EMAIL PROTECTED]">news:02a801c0c8bd$6f5528c0$[EMAIL PROTECTED]...

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



  No! I can encode IP address to an Integer:
  192.168.0.1 consider as: a.b.c.d
  and now the formula goes:
  a shl 24 + b shl 16 + c shl 8 + d
 
  but i was looking for something ready made
 
  -elias
  http://www.kameelah.org/eassoft




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




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




[PHP] Cookies

2001-04-19 Thread Chi Wa Au


I use cookie to protect my web pages:

setcookie("cookiename", "cookievalue", time()+1800);  // set the expiry
time to 30 minutes

The time zone of my server is set to GMT+8.
The server is running on a Redhat 7, apache and PHP 4 as a apache module.

Now some users always get cookie expired error.  I found that they are from
different time zones, i.e. GMT+6, GMT+5.
The users use IE to access my web pages.

Could anyone tell me how to set the cookie independent of the time zone?

Thanks!

Au Chi Wa
ERG HK


 ERG Group --
 The contents of this email and any attachments are confidential
 and may only be read by the intended recipient.
-


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




Re: [PHP] SESSIONS, a weird, funny yet strange error happens to wrong people...

2001-04-19 Thread Plutarck

 What to fix?


Her ;)


Seriously though, is it possible that she stopped browsing the site long
enough for the session to expire and be cleaned up by the garbage handler,
then she continued on the page with a PHPSESSID that no longer existed?

In that case the error would occur only once, as a new sessid with the same
number would be created right then.


--
Plutarck
Should be working on something...
...but forgot what it was.


"Maxim Maletsky" [EMAIL PROTECTED] wrote in message
DC017B079D81D411998C009027B7112A015ED114@EXC-TYO-01">news:DC017B079D81D411998C009027B7112A015ED114@EXC-TYO-01...

 hello guys...

 On one of our websites, where we use sessions, a funny error have
happened.

 err
 Warning: open(/tmp/sess_b5ad1e0878dee63fa8a780df44af3ea7, O_RDWR) failed:
 File exists (17) in page.japaninc.inc on line 109
 /err

 The funny side of it is that no one has ever seen it except our manager
 (what a luck) from his PC only. I guess, we developers, visit our art-work
 much more often than our manager...

 She's seen it twice already, first time was a month-two ago and now again.
I
 ignored it the first time, I though - well, happens... But now I start to
 think it is a bit weird (and dangerous for carrier).

 Any of you have any idea why this "rare" error keeps happening on her
 browser and NEVER on any of developer's? (nor even any other employee of
our
 200 company ever complained)...

 What to fix?

 Sincerely,

 Maxim Maletsky
 Webmaster, J-Door.com / J@pan Inc.
 LINC Media, Inc.
 TEL: 03-3499-2175 x 1271
 FAX: 03-3499-3109

 [EMAIL PROTECTED]

 www.j-door.com
 www.japaninc.net
 www.lincmedia.co.jp












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



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




Re: [PHP] Site Sessions: Online/Offline - help?

2001-04-19 Thread Richard

Greetings.

I am having some problems with the code itself! I have done like so,
that whenever peopel wishes to see the "onliners", I start a function called
DelOld(). This will not decrease server speed, nor create conflicts when
writing to temporary files and so forth.
Now, I tried to gather the following into an exploded array:

// the date output
$date_output = date("Y-m-d-H-i-A");

As you see, I've seperated all with a "-" so I can simply call [0], [1],
[2],... if I want something. Now, How can I compare if a user is away for
like 10 minutes, or 30 minutes? I have a function called
GetLoggDateofUser($Username) which will retreive the  $date_output, but with
colons and spaces, like so:
date("Y-m-d H:i A").

Do you or anyone else have any suggestions?

- Richard



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




Re: [PHP] Cookies

2001-04-19 Thread Plutarck

rather than using time(), try using one of the GMT time functions.

Check under date/time in the manual, which is the same section that time is
under.


--
Plutarck
Should be working on something...
...but forgot what it was.


""Chi Wa Au"" [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

 I use cookie to protect my web pages:

 setcookie("cookiename", "cookievalue", time()+1800);  // set the expiry
 time to 30 minutes

 The time zone of my server is set to GMT+8.
 The server is running on a Redhat 7, apache and PHP 4 as a apache module.

 Now some users always get cookie expired error.  I found that they are
from
 different time zones, i.e. GMT+6, GMT+5.
 The users use IE to access my web pages.

 Could anyone tell me how to set the cookie independent of the time zone?

 Thanks!

 Au Chi Wa
 ERG HK


  ERG Group --
  The contents of this email and any attachments are confidential
  and may only be read by the intended recipient.
 -


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




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




[PHP-CVS] cvs: CVSROOT / avail cvsusers gen_acl_file.m4

2001-04-19 Thread Stig Bakken

ssb Thu Apr 19 04:57:04 2001 EDT

  Modified files:  
/CVSROOTavail cvsusers gen_acl_file.m4 
  Log:
  * added "kaltoft" with access to PEAR
  
  
Index: CVSROOT/avail
diff -u CVSROOT/avail:1.147 CVSROOT/avail:1.148
--- CVSROOT/avail:1.147 Tue Apr 17 00:31:35 2001
+++ CVSROOT/avail   Thu Apr 19 04:57:04 2001
@@ -2,12 +2,12 @@
 unavail
 avail|andi,andrei,jimw,rasmus,rubys,sas,ssb,thies,zeev,shane|CVSROOT
 
avail|andi,andrei,jimw,rasmus,rubys,sas,ssb,thies,zeev,shane,cmv,tcobb,gareth,jah,eschmid,ronabop,derick,sterling,stas,phildriscoll,jmoore,andre,sniper,david,lyric,zimt,mk,goba,zak,jmcastagnetto,dams|phpweb
-avail|andi,andrei,jimw,rasmus,rubys,sas,ssb,thies,zeev,shane,fmk,hirokawa,jah,eschmid,dbeu,sbergmann,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,sniper,changelog,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,shuric,svanegmond,rjs,vlad,jimjag,emile,wez,sasha,camber,ohrn,romolo,martin,lurcher,wsanchez,dreid,dbenson,bmcadams,swm,zhang,kevin,jon,rael,jlp,sbergmann,troels,urs,jpm,adaniel,tuupola,mj,ssb,metallic,heyesr,aj,andre,zimt,uw,jeichorn,bjoern,chregu,bkelly,tfromm,subjective,cox,mboeren,fireclaw,jmcastagnetto|php4/pear,pearweb,pear
+avail|andi,andrei,jimw,rasmus,rubys,sas,ssb,thies,zeev,shane,fmk,hirokawa,jah,eschmid,dbeu,sbergmann,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,sniper,changelog,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,shuric,svanegmond,rjs,vlad,jimjag,emile,wez,sasha,camber,ohrn,romolo,martin,lurcher,wsanchez,dreid,dbenson,bmcadams,swm,zhang,kevin,jon,rael,jlp,sbergmann,troels,urs,jpm,adaniel,tuupola,mj,ssb,metallic,heyesr,aj,andre,zimt,uw,jeichorn,bjoern,chregu,bkelly,tfromm,subjective,cox,mboeren,fireclaw,jmcastagnetto,kaltoft|php4/pear,pearweb,pear
 
avail|andi,andrei,jimw,rasmus,rubys,sas,ssb,thies,zeev,shane,fmk,hirokawa,jah,eschmid,dbeu,sbergmann,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,sniper,changelog,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,shuric,svanegmond,rjs,vlad,jimjag,emile,wez,sasha,camber,ohrn,romolo,martin,lurcher,wsanchez,dreid,dbenson,bmcadams,swm,zhang,kevin|php4,php3,php31,phpfi
 
avail|andi,andrei,jimw,rasmus,rubys,sas,ssb,thies,zeev,shane,fmk,hirokawa,jah,eschmid,dbeu,sbergmann,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,sniper,changelog,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,shuric,svanegmond,rjs,vlad,jimjag,emile,wez,sasha,camber,ohrn,romolo,martin,lurcher,wsanchez,dreid,dbenson,bmcadams,swm,zhang,kevin,hholzgra|functable
-avail|rasmus,sterling,jimw,ssb,thies|pres
+avail|rasmus,sterling,jimw,ssb|pres
 
avail|jalal,zak,andre,ultrapingo,lyric,jmoore,ronabop,sbergmann,joey,sniper,torben,hellekin,cnewbill|qaweb
-avail|andi,andrei,jimw,rasmus,rubys,sas,ssb,thies,zeev,shane,fmk,hirokawa,jah,eschmid,dbeu,sbergmann,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,sniper,changelog,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,shuric,svanegmond,rjs,vlad,jimjag,emile,wez,sasha,camber,ohrn,romolo,martin,lurcher,wsanchez,dreid,dbenson,bmcadams,swm,zhang,kevin,php_ext,chad,torben,lynch,kk,ted,kwazy,aka,affinity,paul,skaag,pglat,mbritton,coar,lwest,joey,bibi,mrobinso,lwh,perugini,hamoralesr,tzwenny,hirokawa,drews,paulsen,hartmann,philross,leon,valdirh,dmarion,dubois,jonen,tschuer,tfromm,manuel,stas,danbeck,sli,jmcastagnetto,mohrt,cris,goba,samesch,jon,soneca,kaufm,ronabop,glace,latoserver,phpguru_dk,lojmann,rafael,jan,jcmeloni,chrullrich,mk,sbergmann,troels,mathieu,voize,phaethon,mgx,mj,corean,pandach,brown,cycle98,vizvil,openlife,regina,cynic,jpm,dams,alponce,menuconfig,obst,topgoods,karoora,pcraft,suvia,zak,zimt,mgx,sintoris,jmoore,ftfuture,uttam,ag315,ropik,jbi1979,bbonev,malo,afortaleza,neotron,cg,delrom,dickmeiss,jkj,hellekin,kgergely,andreroq,eduardh,cnewbill,fuzzy74,inki,bjoern,fams,smasiello,dim,lucasr,cpereira,lagflores,kjh90,ernani,theseer,cevm,noribsd,eskaly,mctrash,berto,leobopp,tcr,subjective,mboeren,ufux,virtual,fireclaw,hadar_p,asautins,dbenson|phpdoc

[PHP] List Files

2001-04-19 Thread KPortsmout

Hi,

Does anyone know how I can list all the files begining with help in one of my 
pages.

So I have a dir which has various files, like so:

help_me.php
help_you.php
help_us.php

Is there some command I can use to select all the files and then print them 
out?

TIA
Ade

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




Re: [PHP] Connection with a Palm

2001-04-19 Thread Daniel Tryba

On Wed, Apr 18, 2001 at 09:22:32AM -0500, Plutarck wrote:
 Hm...can't say I've seen many subjects about this, but you might want to
 look around for information on WAP/WML.
 
 Maybe someone else would know more though, because I have no experiance with
 non-PC browsers.

For Palm/PocketPC/blala handhelds one can use AvantGo channels
(http://www.avantgo.com/) to get content to the handheld. Together with
PHP to rip/strip/filter/create the content it's a solution for my needs.


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




RE: [PHP] Password Generator?

2001-04-19 Thread Grimes, Dean

Be carefull though, this password generator is not as random as it looks at
first glance:

Example:
Here is a list 100 seemingly random passords:

crastije 
cranocus 
frukaphe 
thogivot 
dricrope 
chevacot 
wrasipha 
staspofr 
spuphara 
prothidi 
prohopra 
clicafri 
besliruc 
catokipr 
gupaprus 
holofrec 
jodruwud 
kibreleb 
mewosliw 
masluwre 
puswewor 
rowrolum 
solugole 
uihestuh 
vedotrec 
wewusabo 
trategep 
brurosto 
frowrudr 
thidreto 
drebruha 
chedaclo 
wraclidr 
stuswuti 
sporanan 
swimicli 
slijudru 
clefracr 
batrinuc 
duuubesw 
dupraspu 
hosticre 
jichunot 
kekajebr 
lagiswow 
nubabrat 
puveuosi 
rosojano 
tinaswik 
tichepha 
jogucrod 
kibenabr 
liuihutr 
neruspau 
panecrir 
ruchiuap 
sofrujil 
uocreswu 
vibichid 
wepruuuc 
dricrope 
chevacot 
pheslepr 
staspofr 
spuphara 
swolekom 
prohopra 
clicafri 
bevewabo 
catokipr 
gupaprus 
guphewri 
jodruwud 
kibreleb 
lecidutr 
masluwre 
puswewor 
rupisepu 
solugole 
uihestuh 
uibritho 
wewusabo 
trategep 
cruswicl 
frowrudr 
thidreto 
drijomif 
chedaclo 
wraclidr 
wruuocru 
sporanan 
swimicli 
prichosp 
clefracr 
batrinuc 
cabohipr 
dupraspu 
hosticre 
jimouudr 
kekajebr


Here is the same list in sorted order:

batrinuc 
batrinuc 
besliruc 
bevewabo 
brurosto 
cabohipr 
catokipr 
catokipr 
chedaclo 
chedaclo 
chevacot 
chevacot 
clefracr 
clefracr 
clicafri 
clicafri 
cranocus 
crastije 
cruswicl 
drebruha 
dricrope 
dricrope 
drijomif 
dupraspu 
dupraspu 
duuubesw 
frowrudr 
frowrudr 
frukaphe 
gupaprus 
gupaprus 
guphewri 
holofrec 
hosticre 
hosticre 
jichunot 
jimouudr 
jodruwud 
jodruwud 
jogucrod 
kekajebr 
kekajebr 
kibenabr 
kibreleb 
kibreleb 
lagiswow 
lecidutr 
liuihutr 
masluwre 
masluwre 
mewosliw 
neruspau 
nubabrat 
panecrir 
pheslepr 
prichosp 
prohopra 
prohopra 
prothidi 
puswewor 
puswewor 
puveuosi 
rosojano 
rowrolum 
ruchiuap 
rupisepu 
slijudru 
sofrujil 
solugole 
solugole 
sporanan 
sporanan 
spuphara 
spuphara 
staspofr 
staspofr 
stuswuti 
swimicli 
swimicli 
swolekom 
thidreto 
thidreto 
thogivot 
tichepha 
tinaswik 
trategep 
trategep 
uibritho 
uihestuh 
uihestuh 
uocreswu 
vedotrec 
vibichid 
wepruuuc 
wewusabo 
wewusabo 
wraclidr 
wraclidr 
wrasipha 
wruuocru

As you can see, almost every password is duplicated at least once.


-Original Message-
From: Nathan Cassano [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 18, 2001 5:04 PM
To: 'Ashley M. Kirchner'; [EMAIL PROTECTED]
Subject: RE: [PHP] Password Generator?


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

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

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



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

AMK4


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

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




Re: [PHP] how to scale down image using ImageMagick?

2001-04-19 Thread Noah Spitzer-Williams

Is there a way to install the GD library on windows nt systems? i can't get
this thing to not scale it if its smaller than a certain width

""Steve Werby"" [EMAIL PROTECTED] wrote in message
00ae01c0c848$8a802bb0$6501a8c0@workstation7">news:00ae01c0c848$8a802bb0$6501a8c0@workstation7...
 "Noah Spitzer-Williams" [EMAIL PROTECTED] wrote:
  I have a bunch of pictures all in ranging filesizes and dimensions. I
want
  to resize the ones that over 175 pixels wide to a 175 pixel wide picture
  however i want the height to scale down (ie. i dont want a really thin
  picture, i just want it to be what it would be if it were resized). i
have
  this but i cant figure out how to just scale down the width:
 
  c:\progra~1\imagem~1\mogrify.exe -geometry 175x30! picture.jpeg
 
  the '!' forces those sizes to be used but obvoiusly i dont want the
height
  to be 30. i want it to be whatever it should be so the picture doesnt
look
  flattened.

 I believe imagemagick has an option where you can specify a single
dimension
 (x or y) and it will set that dimension accordingly and automatically
scale
 the other dimension.  This should be covered in the manual pages or --help
 output of the program.


 --
 --
 Steve Werby
 President, Befriend Internet Services LLC
 http://www.befriend.com/


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




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




[PHP] search results return by relevancy

2001-04-19 Thread Jen Hall

Hi there
I have some scripts that do a search in a MySQL database
table.
I want to be able to return rows that match a query, in
order of relevancy.
For example, say I have a table that has the following data

|row_id|  data
|--|-
|  1   |  cat
|  2   |  cat cat
|  3   |  cat cat cat
|  4   |  cat cat
|  5   |  cat cat cat cat cat cat cat
|  6   |  cat
|  7   |  cat cat cat cat
|  8   |  cat cat cat cat cat

I want to do a search that would return row_id 5 first, then

row_id 8, then row_id 7, then 3, etc.
So I want to order the return by relevancy.
What should the sql query look like?
select * from table where data like '%cat%' order by ?

thanks
-jen



[PHP] multiple connects

2001-04-19 Thread Randy Johnson

how do I make sure the right connection is being used when I have 2
persistent connections.   is there any documentation on this ?

thanks

Randy


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




RE: [PHP] search results return by relevancy

2001-04-19 Thread Brian Paulson

You might try this article on devshed on how to create a search engine using
MySql and php.

http://www.devshed.com/Server_Side/PHP/Search_Engine/

I currently use this same Technique to run our classifieds at
http://www.chieftainclassifieds.com


Thank you
Brian Paulson
Sr. Web Developer
[EMAIL PROTECTED]
http://www.chieftain.com
1-800-269-6397


-Original Message-
From: Jen Hall [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 19, 2001 7:57 AM
To: php3 Mailing List
Subject: [PHP] search results return by relevancy


Hi there
I have some scripts that do a search in a MySQL database
table.
I want to be able to return rows that match a query, in
order of relevancy.
For example, say I have a table that has the following data

|row_id|  data
|--|-
|  1   |  cat
|  2   |  cat cat
|  3   |  cat cat cat
|  4   |  cat cat
|  5   |  cat cat cat cat cat cat cat
|  6   |  cat
|  7   |  cat cat cat cat
|  8   |  cat cat cat cat cat

I want to do a search that would return row_id 5 first, then

row_id 8, then row_id 7, then 3, etc.
So I want to order the return by relevancy.
What should the sql query look like?
select * from table where data like '%cat%' order by ?

thanks
-jen


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




Re: [PHP] best way to include html?

2001-04-19 Thread Plutarck

Easiest way I've possibly found is to shove it inside of a function which
will echo it out, but with all the variables in their proper place.

When I want to display something I just use:

$front_page .= 'Text goes here';

In the function outout_html() I just put $front_page wherever I want it to
be displayed (in the main table). If I'd like to change the format a page is
displayed in I can just adjust the function or make a new one entirely, and
I can avoid making a call to string replacement functions.


Seems to work pretty well. I stick the declaration in a global file that all
my scripts use to keep things simple.

I haven't used a tag other than p, /p, and br in weeks.


--
Plutarck
Should be working on something...
...but forgot what it was.



""Duke"" [EMAIL PROTECTED] wrote in message
002301c0c87d$9f1e3c80$[EMAIL PROTECTED]">news:002301c0c87d$9f1e3c80$[EMAIL PROTECTED]...
 I'm setting up an html "shell" for my webpage that I include with my php
 code so I don't have to see html crap and whatnot.
 I'm wondering what the best way is to insert the html "shell" into my
code?
 Should I just echo the file, should I include(), require(),
include_once(),
 or require_once()??
 One section of the shell, which is in a separate file, is an html form -
 would that change the way I include that particular section of html?
 Thanks.


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




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




Re: [PHP] array_count_values

2001-04-19 Thread Plutarck

 echo $stuff[nuts];

It should work, but it's becomg a depreciated practice and may break in
future versions. Always quote a non-numeric array key.

Beyond that, use print_r($array) and see if there is a "nuts" key in there
at all.


--
Plutarck
Should be working on something...
...but forgot what it was.


""Matthew Luchak"" [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

can someone give a quick hint as to why this does not work:

$array = split ("\n", $contents);
$stuff = array_count_values ($array);
echo $stuff[nuts];

or even:

$array = array (split ("\n", $contents));
$stuff = array_count_values ($array);
echo $stuff[nuts];


thnx...

matthew

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




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




RE: [PHP] stripslashes() equivalent when magic_quotes_sybase = on?

2001-04-19 Thread Johnson, Kirk

You know, I tried this before sending my email, and it didn't work as you
describe. And yes, then I re-checked my .htaccess file, and yes, I had
"sybase" turned off. Doh!

Kirk

 -Original Message-
 From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
 
 stripslashes() sees the magic_quotes_sybase setting and behaves
 accordingly.
 
 -Rasmus
 
 On Wed, 18 Apr 2001, Johnson, Kirk wrote:
 
  With magic_quotes_sybase = on, a single quote in 
 Get/Post/Cookie data gets
  escaped with another single quote. Is there a function analagous to
  stripslashes that will strip off the escaping quote?
 
  TIA
 
  Kirk
 

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




RE: [PHP] multiple connects

2001-04-19 Thread Sam Masiello


Well, you won't have two persistent connections to the same database (for
the same username/password).  So, as long as you use the link identifier as
the third argument to the mysql_query function (or mysql...whichever you are
using), that is guarantee enough.

HTH

Sam Masiello
Systems Analyst
Chek.Com
(716) 853-1362 x289
[EMAIL PROTECTED]

 -Original Message-
From:   Randy Johnson [mailto:[EMAIL PROTECTED]]
Sent:   Wednesday, April 18, 2001 1:08 PM
Cc: [EMAIL PROTECTED]
Subject:[PHP] multiple connects

how do I make sure the right connection is being used when I have 2
persistent connections.   is there any documentation on this ?

thanks

Randy


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


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




Re: [PHP] How many color can html recongize in Word.

2001-04-19 Thread Plutarck

For internet explorer:

http://msdn.microsoft.com/workshop/design/color/colorname.asp


Due to the near randomness with which different browsers render color names,
and often some browsers support nearly no color names, to avoid headaches
use one simple rule: Never user color names.

Just stick to hex values unless you absolutely _have_ to use the names.

If you have problems with hex, use this:

http://www.visibone.com/

Great collection of tools to fine the exact color you want.


--
Plutarck
Should be working on something...
...but forgot what it was.


"Pavel Jartsev" [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 "Mark Lo (3)" wrote:
 
  Hi,
 
  I would like to know how many colors can html recongized in WORD
such as
  orange.. red.. blue.. 
 
  eg. font color="blue"Blue/font
 
  where can I find out the sources of how many color can html recrongized
in
  word.  and what wording should I use..

 Maybe this link helps a little:
 http://developer.netscape.com/docs/manuals/htmlguid/colortab.htm


 --
 Pavel a.k.a. Papi

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




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




Re: [PHP] how to scale down image using ImageMagick?

2001-04-19 Thread Morgan Curley

Yeah, it is unfortunate that ImageMagick uses those chars since they have 
other meanings on the cmd line.

just escape it ( \ ) and that should work ( works on a linux box )

morgan

At 07:53 PM 4/18/2001, you wrote:
morgan,
 this is starting to work! the 175x175 does resize it to a width of 175
while retaining the aspect ratio.

 however when i tried using the less than sign, the windows nt
command prompt is treating it as saving the output to a file:

c:\progra~1\imagem~1\mogrify.exe -geometry 175x175 picture.jpeg

imagemagick replies with : missing image file name. this is because the 
sign is telling windows to save the output to a file.
i tried putting a 1 after the  sign and it made a blank file with filename
of '1'.

how can i get around this? i couldnt figure out how to use -identify, it was
not in the docs

Thanks so much!

- Noah

- Original Message -
From: "Morgan Curley" [EMAIL PROTECTED]
Newsgroups: php.general
Sent: Wednesday, April 18, 2001 5:55 PM
Subject: Re: [PHP] how to scale down image using ImageMagick?


according to the docs use
-geometry 175x175 picture.jpeg

man mogrify:
   -geometry widthxheight{+-}x offset{+-}y offset{%}{!}{}{}
preferred width and height of the image.  See X(1) for
details about the geometry specification.

By default, the width and height are maximum values.  That
is, the image is expanded or contracted to
fit the width and height value while maintaining the aspect
ratio of the image.  Append an exclamation
point to the geometry to force the image size to exactly the
size you specify.  For example, if you
specify 640x480! the image width is set to 640 pixels and
height to 480.  If only one factor is speci
fied, both the width and height assume the value.

To specify a percentage width or height instead, append
%.  The image size is multiplied by the width
and height percentages to obtain the final image
dimensions.  To increase the size of an image, use a
value greater than 100 (e.g. 125%).  To decrease an image's
size, use a percentage less than 100.

Use  to change the dimensions of the image only if its size
exceeds the geometry specification.  
resizes the image only if its dimensions is less than the
geometry specification.  For example, if you
specify 640x480 and the image size is 512x512, the image
size does not change.  However, if the image
is 1024x1024, it is resized to 640x480.

it looks like mogrify bases its resizing on the first value that is diff
than the one supplied i.e. if your image is 200x50 it will scale it to
175x? but if it is 50x200 it will scale it to ?x175

if it is important you not resize based on height use identify to get the
geometry first.

morgan


At 04:27 PM 4/18/2001, Noah Spitzer-Williams wrote:
 I have a bunch of pictures all in ranging filesizes and dimensions. I want
 to resize the ones that over 175 pixels wide to a 175 pixel wide picture
 however i want the height to scale down (ie. i dont want a really thin
 picture, i just want it to be what it would be if it were resized). i have
 this but i cant figure out how to just scale down the width:
 
 c:\progra~1\imagem~1\mogrify.exe -geometry 175x30! picture.jpeg
 
 the '!' forces those sizes to be used but obvoiusly i dont want the height
 to be 30. i want it to be whatever it should be so the picture doesnt look
 flattened.
 
 Thanks! - Noah
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]



Re: [PHP] php equivalent for `command`

2001-04-19 Thread Plutarck

Short answer: nope, sorry lol ;)


Personally though I concatenate every string I have that needs to have a
variable in it. Makes it so the variables are highlighted in my syntax
editor for one thing, but it's also a bit faster to use only single quoted
strings with string concatenation, rather than just stuff them all inside a
double quoted string.

Not that it would really effect you much unless you had a hugely long script
though.


--
Plutarck
Should be working on something...
...but forgot what it was.


""Greig, Euan"" [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I was hoping to avoid concatenation to make my code more legible (less
illegible?).

 I take it then that there is no equivalent for the use of ` in Unix.

 -Original Message-
 From: Plutarck [mailto:[EMAIL PROTECTED]]
 Sent: 18 April 2001 15:13
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] php equivalent for `command`


  In the second set of code lines, what I need to do is somehow bracket
off
 the $test++ so it is evaluated before being echoed.

 You need to use the string concantenation operator (a period) to use
things
 like $test++, else PHP get's confused.

  echo "Value of test: $test++ BR";

 To get that to work like you want it to, you need only do:

 echo 'Value of test: ' . $test++ . ' BR';

 It's functionally the same, no brackets needed. If you want it to be
 evaluated BEFORE it's echoed, you need to use:

 echo 'Value of test: ' . ++$test . ' BR';


 --
 Plutarck
 Should be working on something...
 ...but forgot what it was.



 ""Greig, Euan"" [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  I deliberately gave a simple example, perhaps too simple.  I want to
 output quite long and complicated strings that may involve evaluated
 variables, calls to functions etc. But I also want it to as legible as
 possible. But even something simple along the lines I quoted gives me
 problems. See the following code and its output
 
  ?php
  $test=1;
  echo $test++ . "BR";
  echo $test++ . "BR";
 
  $test=1;
  echo "Value of test: $test++ BR";
  echo "Value of test: $test++ BR";
  ?
 
  The output:
 
  1
  2
  Value of test: 1++
  Value of test: 1++
 
  In the second set of code lines, what I need to do is somehow bracket
off
 the $test++ so it is evaluated before being echoed.
 
  Euan
 
 
  -Original Message-
  From: Jason Brooke [mailto:[EMAIL PROTECTED]]
  Sent: 18 April 2001 09:46
  To: Greig, Euan; [EMAIL PROTECTED]
  Subject: Re: [PHP] php equivalent for `command`
 
 
  echo ++$x;
 
  http://www.php.net/manual/en/language.operators.increment.php
 
 
 
Is there a php equivalent for the use of ` (I think) in Unix/Perl?
So
  for example echo "`$x++`" would first evaluate $x++ and then print the
  resulting value.
   
Euan Greig
Technical Consultant
BRANN DATA
[EMAIL PROTECTED]
01285 645997
 
 
 
 
 
**
  Any opinions expressed in this email are those of the individual and
  not necessarily the Company. This email and any files transmitted with
  it, including replies and forwarded copies (which may contain
alterations)
  subsequently transmitted from the Company, are confidential and solely
for
  the use of the intended recipient. If you are not the intended recipient
  or the person responsible for delivering to the intended recipient, be
  advised that you have received this email in error and that any use is
  strictly prohibited.
 
 
**
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 




 **
 Any opinions expressed in this email are those of the individual and
 not necessarily the Company. This email and any files transmitted with
 it, including replies and forwarded copies (which may contain alterations)
 subsequently transmitted from the Company, are confidential and solely for
 the use of the intended recipient. If you are not the intended recipient
 or the person responsible for delivering to the intended recipient, be
 advised that you have received this email in error and that any use is
 strictly prohibited.

 **

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




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




RE: [PHP] List Files

2001-04-19 Thread Joe Sheble (Wizaerd)


exec( "ls -1 help*.*", $arFiles );

foreach( $arFiles as $cFile ) {
 print( $cFile );
}

At 08:44 AM 4/19/01 -0400, Matthew Luchak wrote:


$path='/root/helpfiles/';
$dir_handle = opendir($path);

   while ($file = readdir($dir_handle)) {
if ((ereg("help",$file)){
INCLUDE "$path$file";

OR

echo 'A HREF=".$path$file.'"'.$file.'/A

}
 }






Matthew Luchak
Webmaster
Kaydara Inc.
[EMAIL PROTECTED]


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 19, 2001 8:25 AM
To: [EMAIL PROTECTED]
Subject: [PHP] List Files


Hi,

Does anyone know how I can list all the files begining with help in one
of my
pages.

So I have a dir which has various files, like so:

help_me.php
help_you.php
help_us.php

Is there some command I can use to select all the files and then print
them
out?

TIA
Ade

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


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


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




Re: [PHP] how to scale down image using ImageMagick?

2001-04-19 Thread Joe Sheble (Wizaerd)


I use ImageMagik all the time for thumbnail creations...  this doesn't 
resize the image, it creates a new image, a thumbnail... but the principle 
is the same

$cWidth = 175;
$picture_src = "fullSize/somepic.jpg";
$thumb_dest = "fthumbNail/somepic.jpg";

$aImageInfo = getimagesize( $picture_src );

if( $aImageInfo[0]  $cWidth ) {
 exec("convert -geometry $cWidth -colors 256 -colorspace 
yuv  $picture_src $thumb_dest" );
}

At 08:59 AM 4/19/01 -0400, Noah Spitzer-Williams wrote:
Is there a way to install the GD library on windows nt systems? i can't get
this thing to not scale it if its smaller than a certain width

""Steve Werby"" [EMAIL PROTECTED] wrote in message
00ae01c0c848$8a802bb0$6501a8c0@workstation7">news:00ae01c0c848$8a802bb0$6501a8c0@workstation7...
  "Noah Spitzer-Williams" [EMAIL PROTECTED] wrote:
   I have a bunch of pictures all in ranging filesizes and dimensions. I
want
   to resize the ones that over 175 pixels wide to a 175 pixel wide picture
   however i want the height to scale down (ie. i dont want a really thin
   picture, i just want it to be what it would be if it were resized). i
have
   this but i cant figure out how to just scale down the width:
  
   c:\progra~1\imagem~1\mogrify.exe -geometry 175x30! picture.jpeg
  
   the '!' forces those sizes to be used but obvoiusly i dont want the
height
   to be 30. i want it to be whatever it should be so the picture doesnt
look
   flattened.
 
  I believe imagemagick has an option where you can specify a single
dimension
  (x or y) and it will set that dimension accordingly and automatically
scale
  the other dimension.  This should be covered in the manual pages or --help
  output of the program.
 
 
  --
  --
  Steve Werby
  President, Befriend Internet Services LLC
  http://www.befriend.com/
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 



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


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




[PHP-CVS] cvs: php4 /ext/gd config.m4

2001-04-19 Thread Wez Furlong

wez Thu Apr 19 07:16:09 2001 EDT

  Modified files:  
/php4/ext/gdconfig.m4 
  Log:
  Patch from Adam Dickmeiss to make configure detect libtff again.
  
  
Index: php4/ext/gd/config.m4
diff -u php4/ext/gd/config.m4:1.57 php4/ext/gd/config.m4:1.58
--- php4/ext/gd/config.m4:1.57  Mon Apr 16 18:02:37 2001
+++ php4/ext/gd/config.m4   Thu Apr 19 07:16:09 2001
@@ -110,6 +110,7 @@
 AC_CHECK_LIB(gd, gdImageCreateTrueColor,   [AC_DEFINE(HAVE_LIBGD20, 1, [ ])])
 AC_CHECK_LIB(gd, gdImageSetTile,   
[AC_DEFINE(HAVE_GD_IMAGESETTILE, 1, [ ])])
 AC_CHECK_LIB(gd, gdImageSetBrush,  
[AC_DEFINE(HAVE_GD_IMAGESETBRUSH, 1, [ ])])
+AC_CHECK_LIB(gd, gdImageStringFTEx,
+[AC_DEFINE(HAVE_GD_STRINGFTEX, 1, [ ])])
 ])
 
 
@@ -249,7 +250,7 @@
   ])
 
   AC_MSG_CHECKING(whether to include FreeType 1.x support)
-  if test "$with_freetype_dir" = "no" ; then
+  if test "$with_freetype_dir" = "no" -o "$with_freetype_dir" = ""; then
 if test -n "$CHECK_TTF" ; then
for i in /usr /usr/local "$CHECK_TTF" ; do
if test -f "$i/include/freetype.h" ; then



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




Re: [PHP] search results return by relevancy

2001-04-19 Thread Rasmus Lerdorf

Note that a LIKE query like that is going to be very slow.  You are
better off defining those fields as fulltext fields and using MySQL's
built-in fulltext search capability which will automatically return a
relevance value for each hit.

See http://www.mysql.com/doc/F/u/Fulltext_Search.html

-Rasmus

On Thu, 19 Apr 2001, Jen Hall wrote:

 Hi there
 I have some scripts that do a search in a MySQL database
 table.
 I want to be able to return rows that match a query, in
 order of relevancy.
 For example, say I have a table that has the following data

 |row_id|  data
 |--|-
 |  1   |  cat
 |  2   |  cat cat
 |  3   |  cat cat cat
 |  4   |  cat cat
 |  5   |  cat cat cat cat cat cat cat
 |  6   |  cat
 |  7   |  cat cat cat cat
 |  8   |  cat cat cat cat cat

 I want to do a search that would return row_id 5 first, then

 row_id 8, then row_id 7, then 3, etc.
 So I want to order the return by relevancy.
 What should the sql query look like?
 select * from table where data like '%cat%' order by ?

 thanks
 -jen



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




Re: [PHP] SESSIONS, a weird, funny yet strange error happens to wrong people...

2001-04-19 Thread Yasuo Ohgaki
I was curious about your post, so I take a look at the module source.

It seems you could be right if O_EXCL is not defined when PHP is compiled. If
O_EXCL is defined, it creates if there is no session data file.

--
Yasuo Ohgaki


""Plutarck"" [EMAIL PROTECTED] wrote in message
9bmjl2$rc4$[EMAIL PROTECTED]">news:9bmjl2$rc4$[EMAIL PROTECTED]...
  What to fix?


 Her ;)


 Seriously though, is it possible that she stopped browsing the site long
 enough for the session to expire and be cleaned up by the garbage handler,
 then she continued on the page with a PHPSESSID that no longer existed?

 In that case the error would occur only once, as a new sessid with the same
 number would be created right then.


 --
 Plutarck
 Should be working on something...
 ...but forgot what it was.


 "Maxim Maletsky" [EMAIL PROTECTED] wrote in message
 DC017B079D81D411998C009027B7112A015ED114@EXC-TYO-01">news:DC017B079D81D411998C009027B7112A015ED114@EXC-TYO-01...
 
  hello guys...
 
  On one of our websites, where we use sessions, a funny error have
 happened.
 
  err
  Warning: open(/tmp/sess_b5ad1e0878dee63fa8a780df44af3ea7, O_RDWR) failed:
  File exists (17) in page.japaninc.inc on line 109
  /err
 
  The funny side of it is that no one has ever seen it except our manager
  (what a luck) from his PC only. I guess, we developers, visit our art-work
  much more often than our manager...
 
  She's seen it twice already, first time was a month-two ago and now again.
 I
  ignored it the first time, I though - well, happens... But now I start to
  think it is a bit weird (and dangerous for carrier).
 
  Any of you have any idea why this "rare" error keeps happening on her
  browser and NEVER on any of developer's? (nor even any other employee of
 our
  200 company ever complained)...
 
  What to fix?
 
  Sincerely,
 
  Maxim Maletsky
  Webmaster, J-Door.com / J@pan Inc.
  LINC Media, Inc.
  TEL: 03-3499-2175 x 1271
  FAX: 03-3499-3109
 
  [EMAIL PROTECTED]
 
  www.j-door.com
  www.japaninc.net
  www.lincmedia.co.jp
 
 
 
 
 
 


 
 


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



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



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


[PHP-CVS] cvs: php4 /ext/sablot sablot.c

2001-04-19 Thread Sterling Hughes

sterlingThu Apr 19 07:59:34 2001 EDT

  Modified files:  
/php4/ext/sablotsablot.c 
  Log:
  fix crash bug 10400.
  
  
  
Index: php4/ext/sablot/sablot.c
diff -u php4/ext/sablot/sablot.c:1.37 php4/ext/sablot/sablot.c:1.38
--- php4/ext/sablot/sablot.c:1.37   Sat Mar  3 17:09:36 2001
+++ php4/ext/sablot/sablot.cThu Apr 19 07:59:33 2001
@@ -70,7 +70,7 @@
 /* Macro's */
 
 /* Free macros */
-#define S_FREE(__var) if (__var) efree(__var);
+#define S_FREE(__var) if (__var) { efree(__var); __var = NULL; }
 #define FUNCH_FREE(__var) if (__var) zval_ptr_dtor((__var));
 
 /* ERROR Macros */
@@ -208,9 +208,10 @@
 
 static void php_sablot_init_globals(SABLOTLS_D)
 {
-   SABLOTG(processor)= NULL;
-   SABLOTG(errors)   = NULL;
-   SABLOTG(errorHandler) = NULL;
+   SABLOTG(processor) = NULL;
+   SABLOTG(errors)= NULL;
+   SABLOTG(errorHandler)  = NULL;
+   SABLOTG(output_transform_file) = NULL;
 }
 
 



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




RE: [PHP] Password Generator?

2001-04-19 Thread Jon Snell

There is code in the source for NetHack to create pronounceable words.
Also, combining words would probably be somewhat easy.  A lazy coder could
import a unix dictionary file into a MySQL table and do "select word from
word order by rand limit 2" and just combine the results.

-Original Message-
From: Plutarck [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 18, 2001 4:52 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Password Generator?


I believe there is an article on phpbuilder.com on "pronouncable passwords",
which is probably what you'll want to actually do. Using real words would
just be way too resource intensive.

I'd give you the direct link to the article, but it seems my internet
connection only works for NNTP and ftp downloads...my HTTP has broken for
the moment, and I have no idea why ;(


--
Plutarck
Should be working on something...
...but forgot what it was.


""Ashley M. Kirchner"" [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

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

 AMK4

 --
 W |
   |  I haven't lost my mind; it's backed up on tape somewhere.
   |
   ~
   Ashley M. Kirchner mailto:[EMAIL PROTECTED]   .   303.442.6410 x130
   SysAdmin / Websmith   . 800.441.3873 x130
   Photo Craft Laboratories, Inc. .eFax 248.671.0909
   http://www.pcraft.com  . 3550 Arapahoe Ave #6
   .. .  .  . .   Boulder, CO 80303, USA



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




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



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




[PHP] replace function in a file.

2001-04-19 Thread Mark Lo

Hi,

Is there any function exists which to open a specific file, then find a
specific word, if found, then replace that word with something else.

re: I know fopen is to open, read, and write to specific file, but not
finding and replacing..

Thank you


Mark


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




Re: [PHP] replace function in a file.

2001-04-19 Thread Avetis Avagyan

Hello,
something like this:

$filename="your_file_name.txt";
$fp = fopen($filename, "r+") or die ("Could not open file");
$content = fread ($fp, filesize($filename));
$new_content = str_replace("old_word", "new_word", $content);
rewind($fp);
fwrite($fp, $new_content);
ftruncate($fp, ftell($fp));
fclose($fp);


Regards,
Avetis

Mark Lo wrote:

 Hi,

 Is there any function exists which to open a specific file, then find a
 specific word, if found, then replace that word with something else.

 re: I know fopen is to open, read, and write to specific file, but not
 finding and replacing..

 Thank you

 Mark

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




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




[PHP] PHP Help!

2001-04-19 Thread Anthony Daniels

Hello,

I am a Newbie at PHP and I have what may be a simple question.

I will try and describe my situation the best I can.

I am trying to setp up a form that does an automatic execution between mine and 
another's site.  I have a list of tasks that need to be done.  They are all the same 
tasks, but each have different variables from the 
database, like codes and amounts, etc.

When I click on "Perform Now" on one of the tasks, it works perfectly., but then when 
I clcik on the next task, it stated that I already did that task.  It appears that it 
is using the same info from the last task, instead of 
updating the form with the new task's info.  Even when I hit refresh it says the same 
thing.  The only way I can go on to the next task is by opening an entirely new 
window.  This defeats the purpose of time saving, 
because if I open a new window, I have to type in my login and password information to 
even get into the admin section.  Then have to click on the link to get tot the page.  
Then I would have to do it all over again for 
the over two hundred tasks I have.

I hope you can understand what I am trying to do.  Is there a code that resets the 
variables to nill, so that it can grab the new info?  

Hopefully, you won't need the code that I've used in order to answer my problem, but 
if you do, I will privately email it to you.

Thank you in advance for your help for my situation.

Anthony


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




Re: [PHP] replace function in a file.

2001-04-19 Thread Steve Werby

"Mark Lo" [EMAIL PROTECTED] wrote:
 Is there any function exists which to open a specific file, then find
a
 specific word, if found, then replace that word with something else.

In addition to the solution mentioned using PHP filesystem functions, you
could use Unix command like grep, sed, etc. called from within your PHP
script to accomplish this.  Or you could use a search and replace program
like rpl (happens to be free) which you can download from
http://www.laffeycomputer.com/rpl.html.  rpl's syntax is very simple - "rpl
'old_string' 'new_string' filename" and you can call it using one of the
program execution functions or by enclosing it within backticks.

--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/


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




[PHP] Site Searchable function

2001-04-19 Thread Kevin A Williams

Hi,

I was wondering whether anyone could direct me in the direction of creating a search 
function like the one on php.net?

I have tried looking rather fruitlessly to implement a system, would one possible 
implementation be to use reference files for the information and then use string 
matching to analyse the information, or search the source .php files (although 
security issues of revealing scripts).

Thanks in advance




RE: [PHP] Site Searchable function

2001-04-19 Thread John Huggins

You may not like this answer, but before anyone gets too far along with any
site search engine method using PHP, I would suggest a review of something
like http://www.htdig.org/.  It is free, it works fast and searches your
site just like a web browser so what it indexes is what your viewers see.

Here are some other references:

http://www.phpbuilder.com/forum/archives/1/2000/10/1/104324

http://www.phpbuilder.com/forum/archives/1/2000/9/1/103222


I use htdig with great success and index my site each morning so all new
forum posts are captured for use during the day.

John

 -Original Message-
 From: Kevin A Williams [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, April 19, 2001 1:11 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Site Searchable function


 Hi,

 I was wondering whether anyone could direct me in the direction
 of creating a search function like the one on php.net?

 I have tried looking rather fruitlessly to implement a system,
 would one possible implementation be to use reference files for
 the information and then use string matching to analyse the
 information, or search the source .php files (although security
 issues of revealing scripts).

 Thanks in advance




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




RE: [PHP] Site Searchable function

2001-04-19 Thread Matthew Luchak


there is a good starting point for walking a directory tree and printing
out the names of the files at:
http://www.php.net/manual/en/function.readdir.php

it should be no mean feat to add a search file function and voila

 
Matthew Luchak 
Webmaster
Kaydara Inc. 
[EMAIL PROTECTED]


-Original Message-
From: Kevin A Williams [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 19, 2001 1:11 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Site Searchable function


Hi,

I was wondering whether anyone could direct me in the direction of
creating a search function like the one on php.net?

I have tried looking rather fruitlessly to implement a system, would one
possible implementation be to use reference files for the information
and then use string matching to analyse the information, or search the
source .php files (although security issues of revealing scripts).

Thanks in advance


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




[PHP] `AM_PROG_LIBTOOL' not found in library

2001-04-19 Thread Pablo Sabatino

 Thank you, Kelly
I tried compiling again and seems like was good!

 The ./configure that ok.
Now, when I execute $./gmake come to error...


 pablo@pablito:~/php4  gmake
 Making all in Zend
 gmake[1]: Entering directory `/home/pablo/php4/Zend'
 /bin/sh ../libtool --silent --mode=compile
 gcc -DHAVE_CONFIG_H -I. -I. -I../main   -DLINUX=2 -DUSE_HSREGEX -DUSE_EXPAT
 -DSUPPORT_UTF8 -DXML_BYTE_ORDER=12  -g -O2 -c zend_ini_parser.c
 /usr/share/bison.simple:157: conflicting types for `ini_parse'
 ./zend_ini_parser.y:51: previous declaration of `ini_parse'
 /usr/share/bison.simple: In function `ini_parse':
 /usr/share/bison.simple:219: number of arguments doesn't match prototype
 /usr/share/bison.simple:157: prototype declaration
 gmake[1]: *** [zend_ini_parser.lo] Error 1
 gmake[1]: Leaving directory `/home/pablo/php4/Zend'
 gmake: *** [all-recursive] Error 1

 Please, help me!!!
Pablo Sabatino.



 - Original Message -
 From: "Kelly Cochran" [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Wednesday, April 18, 2001 8:30 PM
 Subject: Re: [PHP] `AM_PROG_LIBTOOL' not found in library


 
  Do a 'which libtool' and I'd hazard a guess that it'll find the one in
  /usr/local/bin first.  As it's using that libtool (dir: /usr/local/bin)
  and your normal automake (dir: /usr/bin), the dirs don't match and
  aclocal fails, as the warning mentions.  Either switch your path around
  to move /usr/local/bin after /usr/bin (and end up using the libtool your
  system came with), or reconfigure and reinstall libtool 1.3.5 starting
  with "./configure --prefix=/usr" which will cause it to install into
  /usr/bin, /usr/share, etc.  (otherwise it defaults to /usr/local which
  is likely the problem you have right now).
 
  Pablo Sabatino wrote:
  
 Hello!!
 I am using php4-cvs on Linux Suse 6.4.
 I issued the command ./buildconf and got a message:
  
 pablo@pablito:~/php4  ./buildconf
 buildconf: checking installation...
 buildconf: autoconf version 2.13 (ok)
 buildconf: automake version 1.4 (ok)
 buildconf: libtool version 1.3.5 (ok)
  
  
 WARNING: automake and libtool are installed in different
  directories.  This may cause aclocal to fail.
  continuing anyway
 aclocal: configure.in: 810: macro `AM_PROG_LIBTOOL' not found in
 library
 make[1]: *** [aclocal.m4] Error 1
 make: *** [all] Error 2
 pablo@pablito:~/php4 
  
 pablo@pablito:~/php4  whereis libtool
 libtool: /usr/bin/libtool /usr/local/bin/libtool /usr/share/libtool
 pablo@pablito:~/php4  whereis automake
 automake: /usr/bin/automake /usr/share/automake
 pablo@pablito:~/php4  whereis automake
 automake: /usr/bin/automake /usr/share/automake
 pablo@pablito:~/php4 
  
 I installed libtool-1.3.5.
 Help me, please!!
 Pablo Sabatino..
 
  -- -
  Kelly Cochran  [EMAIL PROTECTED]
  Technical Staff - funschool.com Corporation
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 



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




Re: [PHP] search results return by relevancy

2001-04-19 Thread Clarence


Try "MATCH (FULLTEXT index columns) AGAINST ('keyword')"

Check the MySQL manual at: http://www.mysql.com and search for "match 
against" or "fulltext"
You need to build FULLTEXT indexes on the columns you want to search 
before you can use the above syntax.

However, it will search and sort by relevance.


On Thursday, April 19, 2001, at 09:56 AM, Jen Hall wrote:

 Hi there
 I have some scripts that do a search in a MySQL database
 table.
 I want to be able to return rows that match a query, in
 order of relevancy.
 For example, say I have a table that has the following data

 |row_id|  data
 |--|-
 |  1   |  cat
 |  2   |  cat cat
 |  3   |  cat cat cat
 |  4   |  cat cat
 |  5   |  cat cat cat cat cat cat cat
 |  6   |  cat
 |  7   |  cat cat cat cat
 |  8   |  cat cat cat cat cat

 I want to do a search that would return row_id 5 first, then

 row_id 8, then row_id 7, then 3, etc.
 So I want to order the return by relevancy.
 What should the sql query look like?
 select * from table where data like '%cat%' order by ?

 thanks
 -jen

--
Clarence

- [EMAIL PROTECTED]

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




Re: [PHP] how to scale down image using ImageMagick?

2001-04-19 Thread FredrikAT

Hi!

This is what I do:

  if (!empty($picture)) {
$size = GetImageSize ("pics/$picture");
if ($size[0] = '175') {
  $width = '175';
  $height = $size[1] * ($width / $size[0]);
} else {
  $width = $size[0];
  $height = $size[1];
}
  }

echo "img src=\"pics\$picture\" height=\"$height\" width=\"$width\"";

Fredrik A. Takle
Bergen, Norway


""Joe Sheble (Wizaerd)"" [EMAIL PROTECTED] skrev i melding
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

 I use ImageMagik all the time for thumbnail creations...  this doesn't
 resize the image, it creates a new image, a thumbnail... but the principle
 is the same

 $cWidth = 175;
 $picture_src = "fullSize/somepic.jpg";
 $thumb_dest = "fthumbNail/somepic.jpg";

 $aImageInfo = getimagesize( $picture_src );

 if( $aImageInfo[0]  $cWidth ) {
  exec("convert -geometry $cWidth -colors 256 -colorspace
 yuv  $picture_src $thumb_dest" );
 }

 At 08:59 AM 4/19/01 -0400, Noah Spitzer-Williams wrote:
 Is there a way to install the GD library on windows nt systems? i can't
get
 this thing to not scale it if its smaller than a certain width
 
 ""Steve Werby"" [EMAIL PROTECTED] wrote in message
 00ae01c0c848$8a802bb0$6501a8c0@workstation7">news:00ae01c0c848$8a802bb0$6501a8c0@workstation7...
   "Noah Spitzer-Williams" [EMAIL PROTECTED] wrote:
I have a bunch of pictures all in ranging filesizes and dimensions.
I
 want
to resize the ones that over 175 pixels wide to a 175 pixel wide
picture
however i want the height to scale down (ie. i dont want a really
thin
picture, i just want it to be what it would be if it were resized).
i
 have
this but i cant figure out how to just scale down the width:
   
c:\progra~1\imagem~1\mogrify.exe -geometry 175x30! picture.jpeg
   
the '!' forces those sizes to be used but obvoiusly i dont want the
 height
to be 30. i want it to be whatever it should be so the picture
doesnt
 look
flattened.
  
   I believe imagemagick has an option where you can specify a single
 dimension
   (x or y) and it will set that dimension accordingly and automatically
 scale
   the other dimension.  This should be covered in the manual pages
or --help
   output of the program.
  
  
   --
   --
   Steve Werby
   President, Befriend Internet Services LLC
   http://www.befriend.com/
  
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
   To contact the list administrators, e-mail:
[EMAIL PROTECTED]
  
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


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




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




[PHP] Advanced Search on MySQL

2001-04-19 Thread Augusto Cesar Castoldi

How can I do a advanced "string" search in my MySQL tables?

Something like: I have a form with name, phone, age, e-mail... and I want
to fill some of those and search in the database where name has "name
typed in the form" and phone has "number typed in the form"

How Can I do that by a MySQL command?

I don't know if it's somethin like: select * from users where name like
"%$name%"

regards,

Augusto Cesar Castoldi


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




Re: [PHP] how to scale down image using ImageMagick?

2001-04-19 Thread Morgan Curley

This is a neat bit of code to fill in image height and width info but it 
does not affect the actual file size like resizing the image would

morgan

At 02:43 PM 4/19/2001, FredrikAT wrote:
Hi!

This is what I do:

   if (!empty($picture)) {
 $size = GetImageSize ("pics/$picture");
 if ($size[0] = '175') {
   $width = '175';
   $height = $size[1] * ($width / $size[0]);
 } else {
   $width = $size[0];
   $height = $size[1];
 }
   }

echo "img src=\"pics\$picture\" height=\"$height\" width=\"$width\"";

Fredrik A. Takle
Bergen, Norway


""Joe Sheble (Wizaerd)"" [EMAIL PROTECTED] skrev i melding
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 
  I use ImageMagik all the time for thumbnail creations...  this doesn't
  resize the image, it creates a new image, a thumbnail... but the principle
  is the same
 
  $cWidth = 175;
  $picture_src = "fullSize/somepic.jpg";
  $thumb_dest = "fthumbNail/somepic.jpg";
 
  $aImageInfo = getimagesize( $picture_src );
 
  if( $aImageInfo[0]  $cWidth ) {
   exec("convert -geometry $cWidth -colors 256 -colorspace
  yuv  $picture_src $thumb_dest" );
  }
 
  At 08:59 AM 4/19/01 -0400, Noah Spitzer-Williams wrote:
  Is there a way to install the GD library on windows nt systems? i can't
get
  this thing to not scale it if its smaller than a certain width
  
  ""Steve Werby"" [EMAIL PROTECTED] wrote in message
  00ae01c0c848$8a802bb0$6501a8c0@workstation7">news:00ae01c0c848$8a802bb0$6501a8c0@workstation7...
"Noah Spitzer-Williams" [EMAIL PROTECTED] wrote:
 I have a bunch of pictures all in ranging filesizes and dimensions.
I
  want
 to resize the ones that over 175 pixels wide to a 175 pixel wide
picture
 however i want the height to scale down (ie. i dont want a really
thin
 picture, i just want it to be what it would be if it were resized).
i
  have
 this but i cant figure out how to just scale down the width:

 c:\progra~1\imagem~1\mogrify.exe -geometry 175x30! picture.jpeg

 the '!' forces those sizes to be used but obvoiusly i dont want the
  height
 to be 30. i want it to be whatever it should be so the picture
doesnt
  look
 flattened.
   
I believe imagemagick has an option where you can specify a single
  dimension
(x or y) and it will set that dimension accordingly and automatically
  scale
the other dimension.  This should be covered in the manual pages
or --help
output of the program.
   
   
--
--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/
   
   
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail:
[EMAIL PROTECTED]
   
  
  
  
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 



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



Re: [PHP] IP address enconding

2001-04-19 Thread Don Read


On 19-Apr-01 elias wrote:
 No! I can encode IP address to an Integer:
 192.168.0.1 consider as: a.b.c.d
 and now the formula goes:
 a shl 24 + b shl 16 + c shl 8 + d
 
 but i was looking for something ready made
 

PHP3 (returns a float, not an integer):

function inet_aton($a) {
$inet = 0.0;
$t = explode(".", $a);
for ($i = 0; $i  4; $i++) {
$inet *= 256.0;
$inet += $t[$i];
};
return $inet;
}

function inet_ntoa($n) {
$t=array(0,0,0,0);
$msk = 16777216.0;
$n += 0.0;
if ($n  1)
return('nbsp;');
for ($i = 0; $i  4; $i++) {
$k = (int) ($n / $msk);
$n -= $msk * $k;
$t[$i]= $k;
$msk /=256.0;
};
$a=join('.', $t);
return($a);
}

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

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




Re: [PHP] Advanced Search on MySQL

2001-04-19 Thread Steve Werby

"Augusto Cesar Castoldi" [EMAIL PROTECTED] wrote:
 How can I do a advanced "string" search in my MySQL tables?

 Something like: I have a form with name, phone, age, e-mail... and I want
 to fill some of those and search in the database where name has "name
 typed in the form" and phone has "number typed in the form"

 How Can I do that by a MySQL command?

 I don't know if it's somethin like: select * from users where name like
 "%$name%"

SELECT *
FROM users
WHERE name='$name' AND phone='$phone'

Only use the wildcard character '%' if you want to match records with *part*
of the form text contained in the field.  If some of the form fields may be
left blank, you'll have to build the SQL statement programatically so the
WHERE clause only contains the fields that are pertinent to the search.
Trying to work around that by using the '%' wildcard and including all
possible fields in the WHERE clause could greatly increase the time
necessary to run the query *and* it's not helping you learn how to program
efficiently in PHP.

--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/


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




Re: [PHP] SESSIONS, a weird, funny yet strange error happens to wrong people...

2001-04-19 Thread Christian Reiniger

On Thursday 19 April 2001 13:52, you wrote:
  What to fix?

 Her ;)


 Seriously though, is it possible that she stopped browsing the site
 long enough for the session to expire and be cleaned up by the garbage
 handler, then she continued on the page with a PHPSESSID that no longer
 existed?

  err
  Warning: open(/tmp/sess_b5ad1e0878dee63fa8a780df44af3ea7, O_RDWR)
  failed: File exists (17) in page.japaninc.inc on line 109
  /err

Then at least the error message should be worded differently. Failure 
because the file exists should be impossible for open (..., O_RDWR)

-- 
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

REALITY.SYS corrupted ... reboot Universe [Y,n]?

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




Re: [PHP] Can PHP run without php.ini?

2001-04-19 Thread Christian Reiniger

On Thursday 19 April 2001 15:48, you wrote:
 Hi, I ran into strange problem. I was not able to configure my php.ini
 file so it would show up in PHP when running on my IIS5 server (at
 least showing up in via php_info()) so I tried to delete all the
 php.ini files on my computer (I have a backup though :) and restarted
 the computer - you know what, the PHP works perfectly and show the
 default settings! How come?

Because it uses the default settings :)

-- 
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

REALITY.SYS corrupted ... reboot Universe [Y,n]?

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




Re: [PHP] Which is better coding style...

2001-04-19 Thread Christian Reiniger

On Thursday 19 April 2001 19:57, you wrote:
 Which is better?

 function blah() {
   switch( $bob ) {
 case 1:
return "this";


 function blah() {
   $retval = "";

   switch( $bob ) {
 case 1:
$retval = "this";
break;


 In other words, is it good practice to exit out of a block (any
 block... not just switch; if, for, while) prematurely as demon-
 strated in the first example?  Or should you do it as demon-
 strated in the second example?

Well, what is more readable, understandable, clearer?

-- 
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

REALITY.SYS corrupted ... reboot Universe [Y,n]?

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




Re: [PHP] search results return by relevancy

2001-04-19 Thread CC Zona

However, note that MySQL does not include stopwords in the FULLTEXT index 
--and it currently considers any word of three characters or less to be a 
"stopword".  So if you really are searching for words as short as "cat", 
this isn't the solution (or else you're going to need to make some 
modifications to the MySQL source and re-compile).


In article [EMAIL PROTECTED],
 [EMAIL PROTECTED] (Clarence) wrote:

 Try "MATCH (FULLTEXT index columns) AGAINST ('keyword')"
 
 Check the MySQL manual at: http://www.mysql.com and search for "match 
 against" or "fulltext"
 You need to build FULLTEXT indexes on the columns you want to search 
 before you can use the above syntax.
 
 However, it will search and sort by relevance.
 
 
 On Thursday, April 19, 2001, at 09:56 AM, Jen Hall wrote:
 
  Hi there
  I have some scripts that do a search in a MySQL database
  table.
  I want to be able to return rows that match a query, in
  order of relevancy.
  For example, say I have a table that has the following data
 
  |row_id|  data
  |--|-
  |  1   |  cat
  |  2   |  cat cat
  |  3   |  cat cat cat
  |  4   |  cat cat
  |  5   |  cat cat cat cat cat cat cat
  |  6   |  cat
  |  7   |  cat cat cat cat
  |  8   |  cat cat cat cat cat

-- 
CC

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




[PHP] Mail form error in script

2001-04-19 Thread John Silverio

Whenever I try to mail a form I receive this message:

Warning: ?php_track_vars? is no longer supported - please use the
track_vars INI directive instead in
/mnt/web/guide/corvettebuyers/www/do_sendfeedback.php on line 1

The form is on a UNIX server with PHP installed. The INI directive has me
confused? Thank you.



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




RE: [PHP] Password Generator?

2001-04-19 Thread ..s.c.o.t.t.. [gts]

you could try swapping out some letters with
look-alike alphanum characters to make the password
a bit more secure

a=@
s=$
d=

thus, "password" = "p@$$wor"



 -Original Message-
 From: Jon Snell [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, April 19, 2001 11:47 AM
 To: [EMAIL PROTECTED]
 Subject: RE: [PHP] Password Generator?
 
 
 There is code in the source for NetHack to create pronounceable words.
 Also, combining words would probably be somewhat easy.  A lazy coder could
 import a unix dictionary file into a MySQL table and do "select word from
 word order by rand limit 2" and just combine the results.
 
 -Original Message-
 From: Plutarck [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, April 18, 2001 4:52 PM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] Password Generator?
 
 
 I believe there is an article on phpbuilder.com on "pronouncable passwords",
 which is probably what you'll want to actually do. Using real words would
 just be way too resource intensive.
 
 I'd give you the direct link to the article, but it seems my internet
 connection only works for NNTP and ftp downloads...my HTTP has broken for
 the moment, and I have no idea why ;(
 
 
 --
 Plutarck
 Should be working on something...
 ...but forgot what it was.
 
 
 ""Ashley M. Kirchner"" [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 
  Is there an easy way to generate generic passwords based on
  (combined) dictionary words?  (ej: take two different words and put them
  together)
 
  AMK4
 
  --
  W |
|  I haven't lost my mind; it's backed up on tape somewhere.
|
~
Ashley M. Kirchner mailto:[EMAIL PROTECTED]   .   303.442.6410 x130
SysAdmin / Websmith   . 800.441.3873 x130
Photo Craft Laboratories, Inc. .eFax 248.671.0909
http://www.pcraft.com  . 3550 Arapahoe Ave #6
.. .  .  . .   Boulder, CO 80303, USA
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 

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




RE: [PHP] Which is better coding style...

2001-04-19 Thread ..s.c.o.t.t.. [gts]

i say the first style.

unneeded variables and other thingies just
obscure things and make it harder to maintain.


 -Original Message-
 From: Boget, Chris [mailto:[EMAIL PROTECTED]]
 Subject: [PHP] Which is better coding style...
 
 Which is better?
 
 function blah() {
   switch( $bob ) {
 case 1:
return "this";
 
 case 2:
   return "that";
 
 default:
   return "other";
 
   }
 }
 


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




RE: [PHP] Newbie Help!! Please Look!

2001-04-19 Thread Si

i can honestly recommend phped, infact im amazed no one else has mentioned
it.  Great win32 php programming ide.

hint: ignore the project stuff in it tho as it kinda sucks ;-)

you can grab it from here

http://www.soysal.com/PHPEd/

Si.


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




[PHP] text formatting

2001-04-19 Thread george

  I have a text area which the client types information into, but is it
possible to format the text for example if the user hits enter ,then it will
place a line break  there,


TIA

george



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




php-general Digest 19 Apr 2001 19:45:45 -0000 Issue 637

2001-04-19 Thread php-general-digest-help


php-general Digest 19 Apr 2001 19:45:45 - Issue 637

Topics (messages 49329 through 49410):

Re: Tip for cookies
49329 by: John Monfort

Re: image-resize/convert
49330 by: elias

Re: array_count_values
49331 by: elias
49370 by: Plutarck

IP address enconding
49332 by: elias
49344 by: Knut H. Hassel Nielsen
49349 by: elias
49350 by: Jason Brooke
49351 by: elias
49398 by: Don Read

Re: Newbie Help!!  Please Look!
49333 by: elias
49336 by: Adrian D'Costa
49339 by: Geir Eivind Mork
49409 by: Si

Re: Characters counting
49334 by: elias

Re: Global variables
49335 by: Ulf Wendel

Re: php equivalent for `command`
49337 by: Greig, Euan
49375 by: Plutarck

How many color can html recongize in Word.
49338 by: Mark Lo \(3\)
49342 by: Pavel Jartsev
49373 by: Plutarck

Re: regex and mysql - looking for opinions.
49340 by: Christian Reiniger

Re: Regular Expression
49341 by: Christian Reiniger

Re: HTMLSpecialchars
49343 by: Christian Reiniger

Problem with apache after installing PHP 4
49345 by: Mohamedou

Re: SESSIONS, a weird, funny yet strange error happens to wrong people...
49346 by: Yasuo Ohgaki
49353 by: Plutarck
49380 by: Yasuo Ohgaki
49402 by: Christian Reiniger

Starting PHP script with crontab
49347 by: Bertjan Schrader

Re: how to scale down image using ImageMagick?
49348 by: Steve Werby
49360 by: Noah Spitzer-Williams
49374 by: Morgan Curley
49377 by: Joe Sheble (Wizaerd)
49395 by: FredrikAT
49397 by: Morgan Curley

Cookies
49352 by: Chi Wa Au
49355 by: Plutarck

Re: Site Sessions: Online/Offline - help?
49354 by: Richard

List Files
49356 by: KPortsmout.aol.com
49358 by: Matthew Luchak
49376 by: Joe Sheble (Wizaerd)

Re: Connection with a Palm
49357 by: Daniel Tryba

Re: Password Generator?
49359 by: Grimes, Dean
49381 by: Jon Snell
49407 by: ..s.c.o.t.t.. [gts]

Re: best way to include html?
49361 by: Michael Kimsal
49369 by: Plutarck

Multiple Connections
49362 by: Randy Johnson
49379 by: Rasmus Lerdorf

Easy Form problem
49363 by: Fates
49365 by: Matt Schroebel

Can PHP run without php.ini?
49364 by: SED
49403 by: Christian Reiniger

search results return by relevancy
49366 by: Jen Hall
49368 by: Brian Paulson
49378 by: Rasmus Lerdorf
49394 by: Clarence
49405 by: CC Zona

multiple connects
49367 by: Randy Johnson
49372 by: Sam Masiello

Re: stripslashes() equivalent when magic_quotes_sybase = on ?
49371 by: Johnson, Kirk

replace function in a file.
49382 by: Mark Lo \(3\)
49383 by: Avetis Avagyan
49387 by: Thomas Deliduka
49388 by: Steve Werby

PHP Help!
49384 by: Anthony Daniels
49386 by: Jack Dempsey

PHP Sessions Problem
49385 by: Luke Muszkiewicz

Site Searchable function
49389 by: Kevin A Williams
49390 by: John Huggins
49392 by: Matthew Luchak

Which is better coding style...
49391 by: Boget, Chris
49404 by: Christian Reiniger
49408 by: ..s.c.o.t.t.. [gts]

`AM_PROG_LIBTOOL' not found in library
49393 by: Pablo Sabatino

Advanced Search on MySQL
49396 by: Augusto Cesar Castoldi
49399 by: Steve Werby

xml with php
49400 by: steve lee

Re: [PHP-WIN] xml with php
49401 by: James Moore

Mail form error in script
49406 by: John Silverio

text formatting
49410 by: george

Administrivia:

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

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

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


--





  Is that still true when you include the file?
  Say you have a  notfoo.php file, and include foo.php in it. You don't
  still have to pass the cookies, do you?


__John Monfort_
_+---+_
 P E P I E  D E S I G N S
   www.pepiedesigns.com
"The world is waiting, are you ready?"
-+___+-

On Tue, 17 Apr 2001, Pat Hanna wrote:

 I found out today after suffering from minor headaches and hair loss that if
 you have functions defined in and outside file name 'foo.php', and in those
 functions you use cookies, you must pass those cookies to the function
 called. I tried using a value from a cookie in a function and it never could
 access it unless I passed it. Funny
 --
 Patrick Hanna
 Database integration--E-commerce solutions
 The Wentworth Company






Hi.

here is my GD report from PHPInfo()
gd
GD Support enabled
GD 

Re: [PHP] Which is better coding style...

2001-04-19 Thread Steve Lawson

Personally, I hate trailing {'s

I think this

function blah()
{
   switch( $bob )
   {
  case 1:
 $var = "whatever";
  break;
   }
}

Is much easier to read and follow.  As for the exiting question...

The "proper" way is to use the breaks.  "They" say that multiple returns in
any function = bad programming.  The .0001 second that it takes to break and
return the value will never matter.

Plus, you or someone else may have to add to that function later.  Let's say
I wanted to add "/B" to the end of $retval.  If you use the normal way I
can just make one change, return $retval . "/B"; instead of changing 3
different returns.

SL.



- Original Message -
From: "Boget, Chris" [EMAIL PROTECTED]
To: "Php (E-mail)" [EMAIL PROTECTED]
Sent: Thursday, April 19, 2001 11:57 AM
Subject: [PHP] Which is better coding style...


 Which is better?

 function blah() {
   switch( $bob ) {
 case 1:
return "this";

 case 2:
   return "that";

 default:
   return "other";

   }
 }

 function blah() {
   $retval = "";

   switch( $bob ) {
 case 1:
$retval = "this";
break;

 case 2:
   $retval = "that";
break;

 default:
   $retval = "other";
break;

   }

   return $retval;

 }


 In other words, is it good practice to exit out of a block (any
 block... not just switch; if, for, while) prematurely as demon-
 strated in the first example?  Or should you do it as demon-
 strated in the second example?

 Chris



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




[PHP] ENUM or SET and PHP

2001-04-19 Thread Jason Caldwell

Does PHP sport an ENUM or SET statement?

Or, equivalent?

Thanks.
Jason



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




[PHP] SQL Select Unique() ?

2001-04-19 Thread James, Yz

Hi Guys,

Is there a method of extracting rows from a MySQL table Uniquely (as in only
once) ?. For example, when a user performs a search, using two words,
it may return the same row twice if the search is spread over two or more
SQL "selections".  An example:

If hypothetical row 129 is a Public House, but the public house doubles up
as a restaurant, a search like this might return the same result twice.
Here is our hypothetical pub:

id = 129
name = The Blue Bell Inn
category = Public House
description = The Blue Bell Inn is a hypothetical pub, in the heart of rural
England.  Why not visit, have a drink and perhaps even dine in our fine
Restaurant area.

The user might perform the search, searching by "category" OR by
"description".  So if they typed "Public House / Restaurant" as the query,
the following would occur:

$sql = "SELECT * FROM table WHERE category LIKE 'Public House / Restaurant'
OR description LIKE 'Public House / Restaurant'";

Surely that would bring the same row back twice.  Is there any way of
selecting from the table just once, without having to restrict the search
facility to something like:

"SELECT * FROM table WHERE category LIKE '%$searchtext%'";

as opposed to having the "OR" in as well?

Thanks, as always,

James.



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




Re: [PHP] Site Searchable function

2001-04-19 Thread Steve Lawson

Hey,
Well, I would write two scripts.  One to pregen a reference database and
one to search using that database.

The pregen could use the readdir function that Matthew Luchak suggested.
You could use the fopen command to get the pages.
fopen("http://localhost/name-of-file") will return the rendered page instead
of the page with the mixed-in source.  You could then use the striptags()
function.  Now you have just the text and it has any dynamic content from
the php code.  Parse that file, throw out any words that are less than like
3 characters.

There are tons of ways to store the words and pages, the simpilest being to
just to store the word and then a list of the pages that it appears on.
Maybe even tie in how many times it appears in each page.

Anyway, throw that pregen page into a daily or hourly cron and boom, done.

Then write a search page that just looks for each word, find the correct
pages, and makes links to them.

I don't know of any sites that explain how to do search engines but this way
will work :)

SL.

- Original Message -
From: "Kevin A Williams" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, April 19, 2001 11:11 AM
Subject: [PHP] Site Searchable function


Hi,

I was wondering whether anyone could direct me in the direction of creating
a search function like the one on php.net?

I have tried looking rather fruitlessly to implement a system, would one
possible implementation be to use reference files for the information and
then use string matching to analyse the information, or search the source
.php files (although security issues of revealing scripts).

Thanks in advance




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




RE: [PHP] Which is better coding style...

2001-04-19 Thread Sander Pilon

Definitely the second style :)

(If we were talking about C(++) then the first would have even been
forbidden by my companies coding standard as well as several coding
standards of other companies I worked for.)

The reason is this - a function has one entrypoint (duh) and one
exitpoint. Jumping out of a function somewhere in the middle leads to
unmaintainable code, and bugs when extending that function and that
return is overlooked. But, as with the indenting and bracket placing, it
is a matter of religion. They would have to torture me for three weeks
to get me to place the brackets like you did in your example :)


function blah() 
{
$retval = "";

switch( $bob ) 
{
 case 1:
$retval = "this";
break;

case 2:
$retval = "that";
break;

default:
$retval = "other";
break;
}
  
return $retval;
}

 -Original Message-
 From: ..s.c.o.t.t.. [gts] [mailto:[EMAIL PROTECTED]] 
 Sent: 19 April 2001 21:31
 To: Php-General
 Subject: RE: [PHP] Which is better coding style...
 
 
 i say the first style.
 
 unneeded variables and other thingies just
 obscure things and make it harder to maintain.
 
 
  -Original Message-
  From: Boget, Chris [mailto:[EMAIL PROTECTED]]
  Subject: [PHP] Which is better coding style...
  
  Which is better?
  
  function blah() {
switch( $bob ) {
  case 1:
 return "this";
  
  case 2:
return "that";
  
  default:
return "other";
  
}
  }
  
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: 
 [EMAIL PROTECTED] To contact the list 
 administrators, e-mail: [EMAIL PROTECTED]
 
 


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




[PHP-CVS] cvs: php4 /ext/odbc php_odbc.c

2001-04-19 Thread Dan Kalowsky

kalowskyThu Apr 19 12:55:05 2001 EDT

  Modified files:  
/php4/ext/odbc  php_odbc.c 
  Log:
  appling patch for joey since he has no ODBC karma.  this is for bug #10252
  
  
Index: php4/ext/odbc/php_odbc.c
diff -u php4/ext/odbc/php_odbc.c:1.80 php4/ext/odbc/php_odbc.c:1.81
--- php4/ext/odbc/php_odbc.c:1.80   Wed Apr 18 21:16:27 2001
+++ php4/ext/odbc/php_odbc.cThu Apr 19 12:55:05 2001
@@ -20,7 +20,7 @@
+--+
  */
 
-/* $Id: php_odbc.c,v 1.80 2001/04/19 04:16:27 andi Exp $ */
+/* $Id: php_odbc.c,v 1.81 2001/04/19 19:55:05 kalowsky Exp $ */
 
 #include "php.h"
 #include "php_globals.h"
@@ -1929,6 +1929,7 @@
chardsnbuf[300];
short   dsnbuflen;
char*ldb = 0;
+   int ldb_len = 0;
 
if (strstr((char*)db, ";")) {
direct = 1;
@@ -1937,8 +1938,9 @@
ldb = (char*)emalloc(strlen(db) + strlen(uid) + 
strlen(pwd) + 12);
sprintf(ldb, "%s;UID=%s;PWD=%s", db, uid, pwd);
} else {
-   ldb = (char*)emalloc(strlen(db) + 1);
-   strcat(ldb, db);
+   ldb_len = (strlen(db)+1);
+   ldb = (char*)emalloc(ldb_len);
+   strlcpy(ldb, db, ldb_len);
}
}
 



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




Re: [PHP] Starting PHP script with crontab

2001-04-19 Thread Steve Lawson

Sup,
You have to make the output write to a file.

Like

lynx http://www.page.come  /home/me/bleh.htm

SL.

- Original Message -
From: "Bertjan Schrader" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, April 19, 2001 4:15 AM
Subject: [PHP] Starting PHP script with crontab


 I need tot start a PHP script at night with the crontab. I tried to do it
 with lynx (lynx http://www.domain.nl/test.php) as a commandline within the
 crontab. Lynx is starting but the PHP script is not working. Anyone an
idea
 how to do it?

 OS:  Redhat Linux 5.2
 Apache
 PHP as a apache module

 thanks!



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



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




Re: [PHP] Which is better coding style...

2001-04-19 Thread Martín Marqués

On Jue 19 Abr 2001 23:35, Miles Thompson wrote:
 Amen! For both elimination of trailing {'s , and a good clear break.

 I don't know how trailing {'s came about, but I find the blocks are harder
 to follow. I consider them HIDDEN rather than trailing, but I cut my teeth
 on Pascal, and FoxPro. While we're at it, how about plain old carriage
 returns to terminate the line and elimination of the ";"?

 I still do a fair bit of work in Visual FoxPro, where the semi-colon
 indicates line continuation. Some days I introduce strange bugs when
 switching from PHP to VFP, and vice versa.

Well, first I would have to say tat there are a lot of other (better) 
languages then Visual FoxPro out there!!!

Check C, C++ sintax.

And to finish, I think Visual FoxPro should change there definition of the 
";".

Saludos... :-)

-- 
El mejor sistema operativo es aquel que te da de comer.
Cuida tu dieta.
-
Martin Marques  |[EMAIL PROTECTED]
Programador, Administrador  |   Centro de Telematica
   Universidad Nacional
del Litoral
-

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




[PHP] Authentication

2001-04-19 Thread Navid Yar

Hello,

I'm somewhat new to PHP. I'm having problems with a script and I don't know
why. It is from a book, yet it does not work for some reason. Both Apache
and MySQL are on and are working fine on my system. The code deals with
creating tables within a database (the database already exists. The error is
that it could connect to the database, but couldn't create the table within
the specified DB. Below are two PHP files that work together for this
specific project. Any help with this is much appreciated. Here are the
scripts:

Script #1


?php

// Check that the user entered the info. If not then direct them back to the
form

if ((!$table_name) || (!$num_fields)) {
header ("Location:
http://localhost/examples/dynamic/authentication/auth_app/show_createtable.h
tml");
exit;
}

$form_block =  "form method=\"post\" action=\"do_createtable.php\"
input type=\"hidden\" name=\"table_name\"
value=\"$table_name\"
table cellspacing=\"5\" cellpadding=\"5\"
tr
thFIELD NAME/ththFIELD TYPE/ththFIELD
LENGTH/th/tr
";

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

$form_block .= "tr
td align=\"center\"input type=\"text\"
name=\"field_name[]\" size=\"30\"/td

td align=\"center\"
select name=\"field_type[]\"
option value=\"char\"char/option
option value=\"date\"date/option
option value=\"float\"float/option
option value=\"int\"int/option
option value=\"text\"text/option
option value=\"varchar\"varchar/option
/select
/td

td align=\"center\"input type=\"text\"
name=\"field_length[]\" size=\"5\"/td
";
}

$form_block .= "tr
td align=\"center\" colspan=\"3\"input type=\"submit\"
value=\"Create Table\"/td
/tr
/table
/form
";
?

html
head
titleCreate a Database Table: Step 2/title
/head
body

h1Define fields for ?php echo "$table_name"; ?/h1
?php echo "$form_block"; ?

/body
/html





Script #2


?php

$db_name="testDB";

$connection = @mysql_connect("localhost", "afghan", "office939") or
die ("Couldn't connect.");

$db = @mysql_select_db($db_name, $connection)
or die("Couldn't select database.");

$sql = "CREATE TABLE $table_name (";

for ($i = 0; $i  count($field_name); $i++) {
$sql .= "$field_name[$i] $field_type[$i]";
if ($field_length[$i] != "") {
$sql .= "(field_length[$i]),";
} else {
$sql .= ",";
}
}

$sql = substr($sql, 0, -1);

$sql .= ")";

$result = @mysql_query($sql,$connection) or die("Couldn't execute query.");

if ($result) {
$msg = "p$table_name has been created!/p";
}

?

html
head
titleCreate a Database Table: Step 3/title
/head
body

h1Adding table to ?php echo "$db_name"; ?.../h1

?php echo "$msg"; ?

/body
/html


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




Re: [PHP] Which is better coding style...

2001-04-19 Thread Miles Thompson

Amen! For both elimination of trailing {'s , and a good clear break.

I don't know how trailing {'s came about, but I find the blocks are harder 
to follow. I consider them HIDDEN rather than trailing, but I cut my teeth 
on Pascal, and FoxPro. While we're at it, how about plain old carriage 
returns to terminate the line and elimination of the ";"?

I still do a fair bit of work in Visual FoxPro, where the semi-colon 
indicates line continuation. Some days I introduce strange bugs when 
switching from PHP to VFP, and vice versa.

Miles

At 01:48 PM 4/19/01 -0600, Steve Lawson wrote:
Personally, I hate trailing {'s

I think this

function blah()
{
switch( $bob )
{
   case 1:
  $var = "whatever";
   break;
}
}

Is much easier to read and follow.  As for the exiting question...

The "proper" way is to use the breaks.  "They" say that multiple returns in
any function = bad programming.  The .0001 second that it takes to break and
return the value will never matter.

Plus, you or someone else may have to add to that function later.  Let's say
I wanted to add "/B" to the end of $retval.  If you use the normal way I
can just make one change, return $retval . "/B"; instead of changing 3
different returns.

SL.



- Original Message -
From: "Boget, Chris" [EMAIL PROTECTED]
To: "Php (E-mail)" [EMAIL PROTECTED]
Sent: Thursday, April 19, 2001 11:57 AM
Subject: [PHP] Which is better coding style...


  Which is better?
 
  function blah() {
switch( $bob ) {
  case 1:
 return "this";
 
  case 2:
return "that";
 
  default:
return "other";
 
}
  }
 
  function blah() {
$retval = "";
 
switch( $bob ) {
  case 1:
 $retval = "this";
 break;
 
  case 2:
$retval = "that";
 break;
 
  default:
$retval = "other";
 break;
 
}
 
return $retval;
 
  }
 
 
  In other words, is it good practice to exit out of a block (any
  block... not just switch; if, for, while) prematurely as demon-
  strated in the first example?  Or should you do it as demon-
  strated in the second example?
 
  Chris
 


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


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




RE: [PHP] Authentication

2001-04-19 Thread Jack Dempsey

check and see if you have create_privilege on the database, and also make
sure your code is clean...echo the sql statement before you use it and type
it into mysql from the mysql command line and see if it works then...

-jack

-Original Message-
From: Navid Yar [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 19, 2001 5:00 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Authentication


Hello,

I'm somewhat new to PHP. I'm having problems with a script and I don't know
why. It is from a book, yet it does not work for some reason. Both Apache
and MySQL are on and are working fine on my system. The code deals with
creating tables within a database (the database already exists. The error is
that it could connect to the database, but couldn't create the table within
the specified DB. Below are two PHP files that work together for this
specific project. Any help with this is much appreciated. Here are the
scripts:

Script #1


?php

// Check that the user entered the info. If not then direct them back to the
form

if ((!$table_name) || (!$num_fields)) {
header ("Location:
http://localhost/examples/dynamic/authentication/auth_app/show_createtable.h
tml");
exit;
}

$form_block =  "form method=\"post\" action=\"do_createtable.php\"
input type=\"hidden\" name=\"table_name\"
value=\"$table_name\"
table cellspacing=\"5\" cellpadding=\"5\"
tr
thFIELD NAME/ththFIELD TYPE/ththFIELD
LENGTH/th/tr
";

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

$form_block .= "tr
td align=\"center\"input type=\"text\"
name=\"field_name[]\" size=\"30\"/td

td align=\"center\"
select name=\"field_type[]\"
option value=\"char\"char/option
option value=\"date\"date/option
option value=\"float\"float/option
option value=\"int\"int/option
option value=\"text\"text/option
option value=\"varchar\"varchar/option
/select
/td

td align=\"center\"input type=\"text\"
name=\"field_length[]\" size=\"5\"/td
";
}

$form_block .= "tr
td align=\"center\" colspan=\"3\"input type=\"submit\"
value=\"Create Table\"/td
/tr
/table
/form
";
?

html
head
titleCreate a Database Table: Step 2/title
/head
body

h1Define fields for ?php echo "$table_name"; ?/h1
?php echo "$form_block"; ?

/body
/html





Script #2


?php

$db_name="testDB";

$connection = @mysql_connect("localhost", "afghan", "office939") or
die ("Couldn't connect.");

$db = @mysql_select_db($db_name, $connection)
or die("Couldn't select database.");

$sql = "CREATE TABLE $table_name (";

for ($i = 0; $i  count($field_name); $i++) {
$sql .= "$field_name[$i] $field_type[$i]";
if ($field_length[$i] != "") {
$sql .= "(field_length[$i]),";
} else {
$sql .= ",";
}
}

$sql = substr($sql, 0, -1);

$sql .= ")";

$result = @mysql_query($sql,$connection) or die("Couldn't execute query.");

if ($result) {
$msg = "p$table_name has been created!/p";
}

?

html
head
titleCreate a Database Table: Step 3/title
/head
body

h1Adding table to ?php echo "$db_name"; ?.../h1

?php echo "$msg"; ?

/body
/html


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



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




Re: [PHP] Authentication

2001-04-19 Thread Kath

In the future, do not post your mysql password on the list

Just a little piece of advice ;)

Also, try checking the online errata for the book (You didn't mention which
book so I can't point you in the right direction).

- Kath



- Original Message -
From: "Navid Yar" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, April 19, 2001 4:59 PM
Subject: [PHP] Authentication


 Hello,

 I'm somewhat new to PHP. I'm having problems with a script and I don't
know
 why. It is from a book, yet it does not work for some reason. Both Apache
 and MySQL are on and are working fine on my system. The code deals with
 creating tables within a database (the database already exists. The error
is
 that it could connect to the database, but couldn't create the table
within
 the specified DB. Below are two PHP files that work together for this
 specific project. Any help with this is much appreciated. Here are the
 scripts:

 Script #1


 ?php

 // Check that the user entered the info. If not then direct them back to
the
 form

 if ((!$table_name) || (!$num_fields)) {
 header ("Location:

http://localhost/examples/dynamic/authentication/auth_app/show_createtable.h
 tml");
 exit;
 }

 $form_block =  "form method=\"post\" action=\"do_createtable.php\"
 input type=\"hidden\" name=\"table_name\"
 value=\"$table_name\"
 table cellspacing=\"5\" cellpadding=\"5\"
 tr
 thFIELD NAME/ththFIELD TYPE/ththFIELD
 LENGTH/th/tr
 ";

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

 $form_block .= "tr
 td align=\"center\"input type=\"text\"
 name=\"field_name[]\" size=\"30\"/td

 td align=\"center\"
 select name=\"field_type[]\"
 option value=\"char\"char/option
 option value=\"date\"date/option
 option value=\"float\"float/option
 option value=\"int\"int/option
 option value=\"text\"text/option
 option value=\"varchar\"varchar/option
 /select
 /td

 td align=\"center\"input type=\"text\"
 name=\"field_length[]\" size=\"5\"/td
 ";
 }

 $form_block .= "tr
 td align=\"center\" colspan=\"3\"input type=\"submit\"
 value=\"Create Table\"/td
 /tr
 /table
 /form
 ";
 ?

 html
 head
 titleCreate a Database Table: Step 2/title
 /head
 body

 h1Define fields for ?php echo "$table_name"; ?/h1
 ?php echo "$form_block"; ?

 /body
 /html





 Script #2


 ?php

 $db_name="testDB";

 $connection = @mysql_connect("localhost", "afghan", "office939") or
 die ("Couldn't connect.");

 $db = @mysql_select_db($db_name, $connection)
 or die("Couldn't select database.");

 $sql = "CREATE TABLE $table_name (";

 for ($i = 0; $i  count($field_name); $i++) {
 $sql .= "$field_name[$i] $field_type[$i]";
 if ($field_length[$i] != "") {
 $sql .= "(field_length[$i]),";
 } else {
 $sql .= ",";
 }
 }

 $sql = substr($sql, 0, -1);

 $sql .= ")";

 $result = @mysql_query($sql,$connection) or die("Couldn't execute
query.");

 if ($result) {
 $msg = "p$table_name has been created!/p";
 }

 ?

 html
 head
 titleCreate a Database Table: Step 3/title
 /head
 body

 h1Adding table to ?php echo "$db_name"; ?.../h1

 ?php echo "$msg"; ?

 /body
 /html


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



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




[PHP] mail() and stripslashes()

2001-04-19 Thread Isaac Force

I'm using the mail() function to send email out via the web, and I've run in a problem 
with escaped characters showing the slash in the emails.

I get the text for the email ($email_text, lets say) and then I strip the slashes and 
put the new version in another variable ($nice_email_text). When using the mail 
function, $nice_email_text is the data that gets sent out, but the slashes in the 
escaped characters still show up in the messages. (With OE)

Any ideas what would be causing this? The scripts I've made are sending out emails to 
customers, and I don't want all the " and ' characters to show up with slashes next to 
them.



RE: [PHP] Which is better coding style...

2001-04-19 Thread ..s.c.o.t.t.. [gts]

OOooo...

it drives me nuts when i see beginning brackets
on seperate lines ;)

i like to start brackets on the same line as the
statement and finish them on a line of their own.

if (...) {
}
else {
}

(it drives me nuts to see  "} else {" also)


 -Original Message-
 From: Sander Pilon [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, April 19, 2001 4:32 PM
 To: 'Php-General'
 Subject: RE: [PHP] Which is better coding style...
 
 
 Definitely the second style :)
 
 (If we were talking about C(++) then the first would have even been
 forbidden by my companies coding standard as well as several coding
 standards of other companies I worked for.)
 
 The reason is this - a function has one entrypoint (duh) and one
 exitpoint. Jumping out of a function somewhere in the middle leads to
 unmaintainable code, and bugs when extending that function and that
 return is overlooked. But, as with the indenting and bracket placing, it
 is a matter of religion. They would have to torture me for three weeks
 to get me to place the brackets like you did in your example :)
 
 
 function blah() 
 {
   $retval = "";
 
   switch( $bob ) 
   {
case 1:
   $retval = "this";
   break;
 
   case 2:
   $retval = "that";
   break;
 
   default:
   $retval = "other";
   break;
   }
   
   return $retval;
 }
 
  -Original Message-
  From: ..s.c.o.t.t.. [gts] [mailto:[EMAIL PROTECTED]] 
  Sent: 19 April 2001 21:31
  To: Php-General
  Subject: RE: [PHP] Which is better coding style...
  
  
  i say the first style.
  
  unneeded variables and other thingies just
  obscure things and make it harder to maintain.
  
  
   -Original Message-
   From: Boget, Chris [mailto:[EMAIL PROTECTED]]
   Subject: [PHP] Which is better coding style...
   
   Which is better?
   
   function blah() {
 switch( $bob ) {
   case 1:
  return "this";
   
   case 2:
 return "that";
   
   default:
 return "other";
   
 }
   }
   
  
  
  -- 
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: 
  [EMAIL PROTECTED] To contact the list 
  administrators, e-mail: [EMAIL PROTECTED]
  
  
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 

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




[PHP] submit form values to new site after validation

2001-04-19 Thread Tom Beidler

I'm trying to modify and e-commerce site which originally sent an email with
the credit card info in an email. Now they would like to pass credit card
numbers to a payment-processing service. For this particular service,
Authorize.net, you would normally direct the form data to the
payment-processing service. The page is currently setup to resubmit to
itself and validate fields before anything else.

I would like to keep that functionality but I'm wondering how to pass the
values onto the payment-processing center after the validation. The flow
would be, hit the submit button and send the data to the page to validate
the fields and then send the info to Authorize.net. The form currently has
about 15 fields to validate and only needs to pass 3 of them to the
payment-processing center.

I'm still relatively new to this and I'm thinking the only way to pass
variables is through a submitted form or the url and I don't want to put the
credit card info in the url.

Any help would be greatly appreciated.

Tom

.
Tom Beidler
Orbit Tech Services
805.682.8972 (phone)
805.682.5833 (fax)
[EMAIL PROTECTED]
http://www.orbittechservices.com/
.



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




[PHP] Newbie Technical Question

2001-04-19 Thread Nashirak Bosk

I have a php file with a lot of user defined funtions and wraper
functions in the this global file.  Almost all my pages then use the
funtions in this one file (and variables), this is so I can keep my
website very modulure.  However I know that having php go through the
file takes a bit of processor time and was wondering if it would be wise
to break up this global file or (into global 1 and 2) or something and
then only use the global 1 when those function are needed and visa
versa.  Am I correct in assuming that if that global file gets too big
PHP is going to have to chew on it longer and therefore hold up the
page?

 Thanks

--
---

Clayton Bluhm

Computer Engineering Student

[EMAIL PROTECTED] (School)
[EMAIL PROTECTED] (home)





RE: [PHP] PHP4.0.4pl1+PdfLib3.03+SCO

2001-04-19 Thread Grimes, Dean

Chris  Paul,

Try using the new pdflib-4.0.0  It works great.
Here is what you have to do:

Goto: http://www.pdflib.com/pdflib/download/index.html

and download the source for unix.

Unzip and untar.

cd to pdflib-4.0.0/bind/php/ext/pdf

copy * php-4.0.4pl1/ext/pdf --- You may want to remove the current contents
of this directory first...

cd pdflib-4.0.0
configure --enable-php
make - you will get an error indicating that a makefile was not found ...
just ignore it.
make install

Link the newly created libraries to the /usr/lib directory:
ln -s /usr/local/lib/libpdf* /usr/lib

Next just rebuild PHP as normal only add --with-pdflib.

Have fun...


Dean





-Original Message-
From: Chris Fry [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 17, 2001 7:01 PM
To: Paul Gardiner
Cc: Grimes, Dean; [EMAIL PROTECTED]
Subject: Re: [PHP] PHP4.0.4pl1+PdfLib3.03+SCO


Guys,

I've admitted defeat and set up a Redhat 6.0 box which runs the web site and
talks to the SCO server as a database server. I'm doing this for a large
client
who wants a "Business Card Generator" on his site and PDF seems to be the
best
way to go as the printer wants a PDF file with the info to print on his
shells
(pre-printed sheets).

Tried to make this work about a year ago, PHP on Redhat talking to an
Informix
database on SCO, and failed miserably. Took about 15 minutes this time - I
read
the error messages!

The secret was that, even though DBPATH was set on the SCO machine it wasn't
being read by the Linux box. I modified the connect statement to the db to
include the DBPATH - hey presto!

$dbh = ifx_connect("/dbpath/dbname@dbserver", "userid", "password");

Performance is pretty good as well.

For this client this is actually the optimum solution, the SCO box was
running a
National e-commerce solution and acting as a dbserver for his internal sales
organisation as well. This takes the load off the SCO box and probably
provides
some extra security as well.

If you would like more info let me know.

Chris

Paul Gardiner wrote:

 Hello again Dean, Chris,

 Snap I'm afraid. I didn't spend too much time on it but it's on the list
of
 things to do. If I manage to get any further I'll let you know.

 If this is urgent though Chris, let me know your exact configure/build
 procedure and which versions you're using of the tiff, jpeg etc and also
how
 you built these. As there's not as many of us on SCO it maybe better if we
 put our heads together to get it sorted - you know what they say :o)

 Best regards,
 - Paul -

 - Original Message -
 From: "Grimes, Dean" [EMAIL PROTECTED]
 To: "'Chris Fry'" [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Tuesday, April 17, 2001 1:36 PM
 Subject: RE: [PHP] PHP4.0.4pl1+PdfLib3.03+SCO

  I had the exact same problem Haven't had time to work it though.
 
  -Original Message-
  From: Chris Fry [mailto:[EMAIL PROTECTED]]
  Sent: Monday, April 16, 2001 3:26 AM
  To: [EMAIL PROTECTED]
  Subject: [PHP] PHP4.0.4pl1+PdfLib3.03+SCO
 
 
  Pdflib 3.03 compiles OK and builds a static library -
  /usr/local/lib/libpdf.a.
 
  PHP fails to configure - cannot find PDF_show_boxed in the library -
  pdflib extension requires pdflib 3.x.
 
  This command is in the library and the header file. Configure finds my
  tiff  jpeg library (--with-tiff-dir=/usr/local
  --with-jpeg-dir=/usr/local) but is either not finding the library
  (--with-pdflib=/usr/local) or is not able to find PDF_show_boxed in the
  library.
 
  Can anyone help??
 
  Chris
 
  --
  Chris Fry
  Quillsoft Pty Ltd
  Specialists in Secure Internet Services and E-Commerce Solutions
  10 Gray Street
  Kogarah
  NSW  2217
  Australia
 
  Phone: +61 2 9553 1691
  Fax: +61 2 9553 1692
  Mobile: 0419 414 323
  eMail: [EMAIL PROTECTED]
  http://www.quillsoft.com.au
 
  You can download our Public CA Certificate from:-
  https://ca.secureanywhere.com/htdocs/cacert.crt
 
  **
 
  This information contains confidential information intended only for
  the use of the authorised recipient.  If you are not an authorised
  recipient of this e-mail, please contact Quillsoft Pty Ltd by return
  e-mail.
  In this case, you should not read, print, re-transmit, store or act
  in reliance on this e-mail or any attachments, and should destroy all
  copies of them.
  This e-mail and any attachments may also contain copyright material
  belonging to Quillsoft Pty Ltd.
  The views expressed in this e-mail or attachments are the views of
  the author and not the views of Quillsoft Pty Ltd.
  You should only deal with the material contained in this e-mail if
  you are authorised to do so.
 
  This notice should not be removed.
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
  --
  PHP General Mailing List (http://www.php.net/)
  

Re: [PHP] `AM_PROG_LIBTOOL' not found in library

2001-04-19 Thread Pablo Sabatino

Hello!!!

I changed the version to bison 1.28...here is the log:
checking for working automake... found
checking for working autoheader... found
checking for working makeinfo... found
checking whether to enable maintainer-specific portions of Makefiles... no
checking host system type... i686-pc-linux-gnu
checking for mawk... (cached) gawk
checking for bison... (cached) bison -y
checking bison version... 1.28 (ok)
checking for gcc... (cached) gcc
checking whether the C compiler (gcc  ) works... yes
checking whether the C compiler (gcc  ) is a cross-compiler... no
checking whether we are using GNU C... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking how to run the C preprocessor... (cached) gcc -E
checking for AIX... no
checking for gcc option to accept ANSI C... (cached) none needed
checking for ranlib... (cached) ranlib
checking whether gcc and cc understand -c and -o together... (cached) yes
checking whether ln -s works... (cached) yes

what do you think is going on???

Pablo Sabatino.



- Original Message -
From: "Kelly Cochran" [EMAIL PROTECTED]
To: "Pablo Sabatino" [EMAIL PROTECTED]
Sent: Thursday, April 19, 2001 5:37 PM
Subject: Re: [PHP] `AM_PROG_LIBTOOL' not found in library



 Did it warn you during configure about your bison version?  I think
 1.28 is required, and that error will pop up if you have an earlier
 version.

 Pablo Sabatino wrote:
 
  Thank you, Kelly
  I tried compiling again and seems like was good!
 
  The ./configure that ok.
  Now, when I execute $./gmake come to error...
 
  pablo@pablito:~/php4  gmake
  Making all in Zend
  gmake[1]: Entering directory `/home/pablo/php4/Zend'
  /bin/sh ../libtool --silent --mode=compile
 
gcc -DHAVE_CONFIG_H -I. -I. -I../main   -DLINUX=2 -DUSE_HSREGEX -DUSE_EXPAT
  -DSUPPORT_UTF8 -DXML_BYTE_ORDER=12  -g -O2 -c zend_ini_parser.c
  /usr/share/bison.simple:157: conflicting types for `ini_parse'
  ./zend_ini_parser.y:51: previous declaration of `ini_parse'
  /usr/share/bison.simple: In function `ini_parse':
  /usr/share/bison.simple:219: number of arguments doesn't match prototype
  /usr/share/bison.simple:157: prototype declaration
  gmake[1]: *** [zend_ini_parser.lo] Error 1
  gmake[1]: Leaving directory `/home/pablo/php4/Zend'
  gmake: *** [all-recursive] Error 1
 
  Please, help me!!!
  Pablo Sabatino.
 
  - Original Message -
  From: "Kelly Cochran" [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Wednesday, April 18, 2001 8:30 PM
  Subject: Re: [PHP] `AM_PROG_LIBTOOL' not found in library
 
  
   Do a 'which libtool' and I'd hazard a guess that it'll find the one in
   /usr/local/bin first.  As it's using that libtool (dir:
/usr/local/bin)
   and your normal automake (dir: /usr/bin), the dirs don't match and
   aclocal fails, as the warning mentions.  Either switch your path
around
   to move /usr/local/bin after /usr/bin (and end up using the libtool
your
   system came with), or reconfigure and reinstall libtool 1.3.5 starting
   with "./configure --prefix=/usr" which will cause it to install into
   /usr/bin, /usr/share, etc.  (otherwise it defaults to /usr/local which
   is likely the problem you have right now).
  
   Pablo Sabatino wrote:
   
  Hello!!
  I am using php4-cvs on Linux Suse 6.4.
  I issued the command ./buildconf and got a message:
   
  pablo@pablito:~/php4  ./buildconf
  buildconf: checking installation...
  buildconf: autoconf version 2.13 (ok)
  buildconf: automake version 1.4 (ok)
  buildconf: libtool version 1.3.5 (ok)
   
   
  WARNING: automake and libtool are installed in different
   directories.  This may cause aclocal to fail.
   continuing anyway
  aclocal: configure.in: 810: macro `AM_PROG_LIBTOOL' not found in
  library
  make[1]: *** [aclocal.m4] Error 1
  make: *** [all] Error 2
  pablo@pablito:~/php4 
   
  pablo@pablito:~/php4  whereis libtool
  libtool: /usr/bin/libtool /usr/local/bin/libtool
/usr/share/libtool
  pablo@pablito:~/php4  whereis automake
  automake: /usr/bin/automake /usr/share/automake
  pablo@pablito:~/php4  whereis automake
  automake: /usr/bin/automake /usr/share/automake
  pablo@pablito:~/php4 
   
  I installed libtool-1.3.5.
  Help me, please!!
  Pablo Sabatino..
  
   -- -
   Kelly Cochran  [EMAIL PROTECTED]
   Technical Staff - funschool.com Corporation
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
   To contact the list administrators, e-mail:
[EMAIL PROTECTED]
  

 -- -
 Kelly Cochran  [EMAIL PROTECTED]
 Technical Staff - funschool.com Corporation
 Phone: 408-453-7280x113  FAX: 408-453-7285
 Cell:  408-772-0657


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

Re: [PHP] Add data to three tables at once from one form

2001-04-19 Thread Julian Wood


 That's it.  There's nothing special to do.

Except if one insert fails and the others succeed, you run into a bit of
sync trouble. This is what transactions are for. You might want to consider
a BDB table type, which supports transactions, then you have the option to
rollback the other inserts if one of them fails.

Julian

on 4/18/01 6:33 PM, Steve Werby at [EMAIL PROTECTED] wrote:

 
 "Fates" [EMAIL PROTECTED] wrote:
 I know how to add data to one table but how do I add data to three
 tables from one form?
 
  I want to do this with just one form and on one web page so it doesn't
 post to another page.
 
 How do I set up the insert statement?
 
$query = "INSERT INTO $table VALUES ('$menu_id', '$server',
 '$menunumber', '$menuname')";
 
  $result = mysql_db_query($dbname, $query);
 
 Add two more sets of statements like those you have for the first query.
 That's it.  There's nothing special to do.
 
 --
 Steve Werby
 President, Befriend Internet Services LLC
 http://www.befriend.com/
 


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




Re: [PHP] Which is better coding style...

2001-04-19 Thread Norbert Pfeiffer

Hi,

This participates the clearest for me,
but unfortunately not usual.

if (...)
   {...commands...
switch(...)
  {case commands...
   case commands...
   case commands...
   }
while(...)
 {...commands...
  }
}
else
   {...commands...
}

it participates maybe uncomfortable to write,
however, simply to debug...

I learning be doing,
but this already many years... ;-)


m.f.G. N. Pfeiffer
___
www.uris.de[EMAIL PROTECTED]
0177-2363368   02292-681769
---
e.o.m.


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




RE: [PHP] Which is better coding style...

2001-04-19 Thread Philip Olson


coding style?  here's what pear has to say :

  http://www.php.net/manual/en/pear.standards.php
  http://www.php.net/manual/en/pear.standards.control.php

  [ example ]

  switch (condition) {
  case 1:
  action1;
  break;

  case 2:
  action2;
  break;

  default:
  defaultaction;
  break;

  }

  [ /example ]


variables can be very useful. 
return is cool too.

:)

regards,
philip



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




Re: [PHP] submit form values to new site after validation

2001-04-19 Thread Phillip Bow

Using the POST method will prevent the credit card data from being included
in the url.  I would still be careful about sending data like this via a
POST to a form handler on an entirely different site.  It would be better if
there was some sort of secure socket to transfer the data through.
--
phill

"Tom Beidler" [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I'm trying to modify and e-commerce site which originally sent an email
with
 the credit card info in an email. Now they would like to pass credit card
 numbers to a payment-processing service. For this particular service,
 Authorize.net, you would normally direct the form data to the
 payment-processing service. The page is currently setup to resubmit to
 itself and validate fields before anything else.

 I would like to keep that functionality but I'm wondering how to pass the
 values onto the payment-processing center after the validation. The flow
 would be, hit the submit button and send the data to the page to validate
 the fields and then send the info to Authorize.net. The form currently has
 about 15 fields to validate and only needs to pass 3 of them to the
 payment-processing center.

 I'm still relatively new to this and I'm thinking the only way to pass
 variables is through a submitted form or the url and I don't want to put
the
 credit card info in the url.

 Any help would be greatly appreciated.

 Tom

 .
 Tom Beidler
 Orbit Tech Services
 805.682.8972 (phone)
 805.682.5833 (fax)
 [EMAIL PROTECTED]
 http://www.orbittechservices.com/
 .



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



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




[PHP] killing a session

2001-04-19 Thread Ellis Heckman

This does seem to work well. Thanks a lot.

unlink(session_save_path().'/sess_'.$PHPSESSID); 
setcookie('PHPSESSID','',time()-3600,'/'); 

Ellis Heckman
[EMAIL PROTECTED]
http://www.sigmathree.com/


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




Re: [PHP] killing a session

2001-04-19 Thread Phillip Bow

Check out http://php.net/manual/en/function.session-destroy.php
--
phill

""Ellis Heckman"" [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 This does seem to work well. Thanks a lot.

 unlink(session_save_path().'/sess_'.$PHPSESSID);
 setcookie('PHPSESSID','',time()-3600,'/');

 Ellis Heckman
 [EMAIL PROTECTED]
 http://www.sigmathree.com/


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



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




[PHP] Newbie - treestructure

2001-04-19 Thread Johan Evers Petersen

I'm Newbie - sorry if this is the wrong list! 

I'm trying to print this treestructure I've made, but it doesn't seem to print more 
than the first level. The
 subtree array of the children is empty, perhaps because I do not
use the correct reference passing? 

Thank you for helping me out. 

This is the code:
?php require('database.php'); // $databaseis defined here $database = new db(); class 
TreeNode
{
var $data;  //Database object reference
var $id;//Unique ID from the database
var $subtree;   //Array of treenodes that are the children of $currentNode
var $level; //Level in the tree. The toplevel = 0   function 
TreeNode($id, $data, $level) //Constructor
{
$this-id = $id;
$this-data = $data;
$this-level = $level;
$this-subtree = array();
}   function add($currentNode)
{
//This function is used to add a TreeNode, $currentNode to the subtree
print "parent: ". $this-id ." New node: ". $currentNode-id ."br";
$this-subtree[] = $currentNode;
}   function output()
{
for ($i=0;$icount($this-subtree);$i++)
{
$tree = $this-subtree[$i];
if (is_object($tree))
print "ID: ".$tree-id."BR";
print "Count: ".count($tree-subtree)."BR";
$tree-output();
} /*foreach ($this-subtree as $tree) //Skal vre en while 
lkke, da $tree-subtree er tomt.
{
if (is_object($tree))
   print "ID: ".$tree-id."BR";
   $tree-output();
}
*/
}
} //Initialize
$treetop = new TreeNode(0, 0, -1);  // You have to have a start position
$nodehash = array();// This is only used to find the 
parents //Make the query
$sql = "SELECT * FROM page_table WHERE visible=1 ORDER BY id, title";
$query = new query($database, $sql); while ($obj = $query-getobj())
{
if($obj-parent_id  0){//If the node is not on the toplevel
$parent = $nodehash["id_$obj-parent_id"]; //Finds the 
parent in the $nodehash
}
else
{
$parent = $treetop;//If the node is on 
the toplevel then the parent is $treetop
}
$level = $parent-level + 1;//The tree level of $currentNode is of 
course one more than the $parent (level
 is not stored in db)   //when we have found the level of $currentnode we are ready to 
construct the $currentNode using the parameters
 from the database and the $level
$currentNode = new TreeNode($obj-id, $obj, $level);
$nodehash["id_$obj-id"] = $currentNode; //Insert the $currentNode 
into the $nodehash so we can find it again
 if it has any children
$parent-add($currentNode); //Use the add function of the $parent to 
put $currentNode into $parent's subtree

} //Something has to be printed out...
$treetop-output(); 
?


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




Re: [PHP] Which is better coding style...

2001-04-19 Thread Chris Adams

On 19 Apr 2001 14:08:13 -0700, ..s.c.o.t.t.. [gts] [EMAIL PROTECTED]
wrote:
OOooo...

it drives me nuts when i see beginning brackets
on seperate lines ;)

i like to start brackets on the same line as the
statement and finish them on a line of their own.

Very strong agreement here. I think a lot of it depends on your environment.
Some have syntax highlighting and, better yet, syntax highlighting which will
prominently mark unbalanced braces, brackets, etc. Also very nice are things
like a brace-matching hotkey or options to highlight the matching open
character when you close it. If you have all of these tools to help show
syntax, I don't think you need as help from the source formatting.  (The only
times I've liked having them on separate lines is when I've been working with
an editor which lacks this)

It also helps to properly indent things. I think code like this makes it pretty
easy to see which code is in which block:

if () {
...
if () {
if () {
// Do something
} else {
// Do something else
}
}
} else {
...
}

This is one thing I've always liked about Python. Forcing people to indent
consistently is a little harsh but it does have the advantage of making strange
code easier to decipher.

(it drives me nuts to see  "} else {" also)

Here, I have to differ - using anything else makes me itch. 

-- 
"Any sufficiently accurate worldview is indistinguishable from cynicism"

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




[PHP] Treestructure

2001-04-19 Thread Johan Evers Petersen

I'm Newbie - sorry if this is the wrong list!

I'm trying to print this treestructure I've made, but it doesn't seem to
print more than the first level. The
 subtree array of the children is empty, perhaps because I do not
use the correct reference passing?

Thank you for helping me out.
This is the code:
?php
require('database.php'); // $databaseis defined here $database = new db();
class TreeNode
{
 var $data;  //Database object reference
 var $id;  //Unique ID from the database
 var $subtree; //Array of treenodes that are the children of $currentNode
 var $level;  //Level in the tree. The toplevel = 0  function TreeNode($id,
$data, $level) //Constructor
 {
  $this-id = $id;
  $this-data = $data;
  $this-level = $level;
  $this-subtree = array();
 }  function add($currentNode)
 {
  //This function is used to add a TreeNode, $currentNode to the subtree
  print "parent: ". $this-id ." New node: ". $currentNode-id ."br";
  $this-subtree[] = $currentNode;
 }  function output()
 {
  for ($i=0;$icount($this-subtree);$i++)
  {
   $tree = $this-subtree[$i];
  if (is_object($tree))
   print "ID: ".$tree-id."BR";
  print "Count: ".count($tree-subtree)."BR";
  $tree-output();
  } /*  foreach ($this-subtree as $tree) //Skal være en while løkke, da
$tree-subtree er tomt.
  {
  if (is_object($tree))
  print "ID: ".$tree-id."BR";
 $tree-output();
  }
*/
 }
} //Initialize
$treetop = new TreeNode(0, 0, -1);  // You have to have a start position
$nodehash = array();// This is only used to find the parents //Make the
query
$sql = "SELECT * FROM page_table WHERE visible=1 ORDER BY id, title";
$query = new query($database, $sql); while ($obj = $query-getobj())
{
  if($obj-parent_id  0){ //If the node is not on the toplevel
   $parent = $nodehash["id_$obj-parent_id"]; //Finds the parent in the
$nodehash
  }
  else
  {
   $parent = $treetop;   //If the node is on the toplevel then the parent
is $treetop
  }
  $level = $parent-level + 1; //The tree level of $currentNode is of course
one more than the $parent (level
 is not stored in db)  //when we have found the level of $currentnode we are
ready to construct the
 $currentNode using the parameters
 from the database and the $level
  $currentNode = new TreeNode($obj-id, $obj, $level);
  $nodehash["id_$obj-id"] = $currentNode; //Insert the $currentNode into
the $nodehash so we can find it again
 if it has any children
  $parent-add($currentNode); //Use the add function of the $parent to put
$currentNode into $parent's subtree
}

//Something has to be printed out...
$treetop-output();
?



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




  1   2   >