php-general Digest 29 Nov 2006 08:40:34 -0000 Issue 4486

2006-11-29 Thread php-general-digest-help
php-general Digest 29 Nov 2006 08:40:34 - Issue 4486 Topics (messages 245246 through 245266): Re: Process of creating invoices requiring human thought! 245246 by: Jon Anderson Odd error after upgrading from Php4 to Php5 245247 by: Ian Barnes 245255 by: Jochem Maas

Re: [PHP] Odd error after upgrading from Php4 to Php5

2006-11-29 Thread Jochem Maas
Ian Barnes wrote: Hi, $sql1 = UPDATE members SET $pass WHERE id = '$editid'; you might consider that $editid is not what you think. use var_dump() et al to discover what is really in each var. Thats whats on 199. ON line 198 i have: $pass = $_POST['pass']; which means I can inject just

Re: [PHP] Re: mail header questions

2006-11-29 Thread Chantal Rosmuller
On Wednesday 29 November 2006 00:45, Chris wrote: you will most likely change what I forgot to mention that I can't set the return-path either. That can *only* be an email address - you can't include a name in the return-path. Also it can't be changed if safe-mode is on for the server.

[PHP] Passwords suddenly not working

2006-11-29 Thread Dave M G
PHP List, I have a few scripts that have been around for a while. In one, is a simple login function: $query = SELECT * FROM forum_members WHERE memberName = ' . $username . ' AND passwd = MD5(' . $password . '); $result = mysql_query($query); This was working fine, but recently I haven't

Re: [PHP] mail header questions solved

2006-11-29 Thread Chantal Rosmuller
You can use the fifth parameter: [EMAIL PROTECTED] This will cause the from to be from [EMAIL PROTECTED] instead of from [EMAIL PROTECTED] Regards, Emmett Hi Emmett, Thanks this works. I already tried this on my local machine and it didn't work but it does work on the webserver so

Re: [PHP] LDAP: Write to boolean attribute

2006-11-29 Thread Jochem Maas
Carsten Gehling wrote: Sorry for that - I couldn't see the previous post. I've tried true/false, but I think PHP might be converting this to string values (eg. and 1) before sending to AD any reason to think this? have you tried passing the strings 'false', 'true' or 'FALSE', 'TRUE'? -

Re: [PHP] Tidy HTML source?

2006-11-29 Thread Satyam
- Original Message - From: Fredrik Thuresson [EMAIL PROTECTED] To: php-general@lists.php.net Sent: Wednesday, November 29, 2006 5:45 AM Subject: Re: [PHP] Tidy HTML source? At one point or another plain HTML has to be generated. Care to give me an example? I never generate any

Re: [PHP] Detecting naughty sites

2006-11-29 Thread Robin Vickery
On 29/11/06, Travis Doherty [EMAIL PROTECTED] wrote: Tom Chubb wrote: On 28/11/06, Dave Goodchild [EMAIL PROTECTED] wrote: Hi all. I am building a web app and as part of it advertisers can upload their ad image and website URL to go with their ad. Is there a good way to detect whether

Re: [PHP] Tidy HTML source?

2006-11-29 Thread Paul Novitski
At 11/28/2006 05:05 AM, Satyam wrote: May I invite you to check http://satyam.com.ar/pht/? This is a project I started some time ago to help me produced HTML in a more clean and efficient way. Usually, producing good HTML involves running a sample output through some HTML validator or

Re: [PHP] Detecting naughty sites

2006-11-29 Thread Paul Novitski
At 11/29/2006 01:51 AM, Robin Vickery wrote: Cubist Porn - very big in certain 'artistic' circles. What, both eggs on the same side of the sausage? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] hiding passwd in cmdlines that appear in the process list

2006-11-29 Thread Jochem Maas
I have been using exec() for a number of things recently - one of the things I'm using it for it to run mysql in order to import SQL scripts so I have some code that looks like: // build the cmdline $cmd = sprintf('mysql -h %s --user=%s --password=`cat %s` -D %s %s 21',

Re: [PHP] Tidy HTML source?

2006-11-29 Thread Satyam
- Original Message - From: Paul Novitski [EMAIL PROTECTED] At 11/28/2006 05:05 AM, Satyam wrote: May I invite you to check http://satyam.com.ar/pht/? This is a project I started some time ago to help me produced HTML in a more clean and efficient way. Usually, producing good HTML

[PHP] Re: backing up a database

2006-11-29 Thread David Giragosian
On 11/28/06, Warren Vail [EMAIL PROTECTED] wrote: I think it becomes an issue only if the database structure is complex with multiple related tables, and have lots of update activity. I think most people design applications that don't require anything so complex, and most queries are of the

RE: [PHP] backing up a database

2006-11-29 Thread Kristen G. Thorson
-Original Message- From: James Tu [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 28, 2006 5:03 PM To: PHP General List Subject: Re: [PHP] backing up a database Thanks Brad: I'm just surprised that when people mention mysqldump, most of the time they don't talk about locking

Re: [PHP] Tidy HTML source?

2006-11-29 Thread Fredrik Thuresson
is ever generated by anyone at anytime? Most pre-packaged applications such as blogs, CMS, picture galleries do produce HTML directly without template engines which would require a separate installation issues and dependencies which most designers try to avoid. Even template engines have

[PHP] passing an object using session var

2006-11-29 Thread list arama
Why am I not able to access the obj name field in script 2? thanks in advance, --script1--- ?php include(TestClass.php); session_start(); session_register('obj'); ob_start(); $obj = new TestClass(); $obj-setName('MyName'); $obj-display();// outputs 'MyName' header(Location:

Re: [PHP] passing an object using session var

2006-11-29 Thread Thomas Munz
Try that: --script1--- ?php include(TestClass.php); session_start(); $obj = new TestClass(); $obj-setName('MyName'); $obj-display();// outputs 'MyName' $str_object = serialize($obj); //-- You need to serialize an object ( see php.net manual ) in order to make an object working via

RE: [PHP] hiding passwd in cmdlines that appear in the process list

2006-11-29 Thread bruce
hi jochem... if no one provides you with a solution.. you might replicate what's already been done in one of the php/mysql/web admin apps. given that these apps already manage the mysql functions, so i'm willing to bet that some of them have resolved this issue... -Original Message-

Re: [PHP] hiding passwd in cmdlines that appear in the process list

2006-11-29 Thread Jochem Maas
bruce wrote: hi jochem... if no one provides you with a solution.. you might replicate what's already been done in one of the php/mysql/web admin apps. given that these apps already manage the mysql functions, so i'm willing to bet that some of them have resolved this issue... they don't

Re: [PHP] passing an object using session var

2006-11-29 Thread Jochem Maas
Thomas Munz wrote: Try that: --script1--- ?php include(TestClass.php); session_start(); $obj = new TestClass(); $obj-setName('MyName'); $obj-display();// outputs 'MyName' $str_object = serialize($obj); //-- You need to serialize an object ( see php.net manual ) in order

Re: [PHP] Passwords suddenly not working

2006-11-29 Thread Janet Valade
Dave M G wrote: PHP List, I have a few scripts that have been around for a while. In one, is a simple login function: $query = SELECT * FROM forum_members WHERE memberName = ' . $username . ' AND passwd = MD5(' . $password . '); $result = mysql_query($query); This was working fine, but

Re: [PHP] Tidy HTML source?

2006-11-29 Thread Sancar Saran
OUCH, man this was avesome, probably best idea after php himself. More than 6 years I punching php code. I try tons of aproach to find better solution for html output and this one far more advanced any of them. I'll check it now Many thanks Regards Sancar On Tuesday 28 November 2006

RE: [PHP] hiding passwd in cmdlines that appear in the process list

2006-11-29 Thread tg-php
Would it be possible, Jochem, to just make a shell script that does the call to mysql and have PHP exec() the shell script? I don't know if you'd have the same problem or not. I've never done something like this in *nix and paid attention to the process list. Also, I'm guessing you're seeing

Re: [PHP] hiding passwd in cmdlines that appear in the process list

2006-11-29 Thread Stut
[EMAIL PROTECTED] wrote: I don't know if this would work, but maybe something like this: cat /my/sql/root/passwd/file | mysql -h localhost --user=admin -D somedb /my/import/script.sql 21 No idea if that'd work, but it might put you in the right ballpark. You can't do this. The pipe gets

Re: [PHP] hiding passwd in cmdlines that appear in the process list

2006-11-29 Thread tg-php
Ah.. makes sense. Good old DOS is stupid enough not to card most times. You can create a text file with a Y in it, and redirect it into a command like: del . y.txt Guess that's not a pipe technically. And some commands may be smart enough to prevent something like this. Thanks for the

Re: [PHP] hiding passwd in cmdlines that appear in the process list

2006-11-29 Thread Stut
[EMAIL PROTECTED] wrote: Ah.. makes sense. Good old DOS is stupid enough not to card most times. You can create a text file with a Y in it, and redirect it into a command like: del . y.txt Guess that's not a pipe technically. And some commands may be smart enough to prevent something

[PHP] counting clicks

2006-11-29 Thread Ross
Anyone got a script so I can count clicks on adverts. Doesn't have tosve to myqsl or anything just a text file will do. Ta Ross -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] counting clicks

2006-11-29 Thread Jay Blanchard
[snip] Anyone got a script so I can count clicks on adverts. Doesn't have tosve to myqsl or anything just a text file will do. [/snip] ?php if(yes == $adClicked){ $adClickCountFile = fopen(countClick.txt, w); $getCount = fgets($adClickCountFile, 4096); $newCount = $getCount + 1;

Re: [PHP] passing an object using session var

2006-11-29 Thread Eric Butera
On 11/29/06, Jochem Maas [EMAIL PROTECTED] wrote: Thomas Munz wrote: Try that: --script1--- ?php include(TestClass.php); session_start(); $obj = new TestClass(); $obj-setName('MyName'); $obj-display();// outputs 'MyName' $str_object = serialize($obj); //-- You need to

Re: [PHP] passing an object using session var

2006-11-29 Thread list arama
Here's what I came up with: --script1--- ?php include('TestClass.php'); session_start(); $obj = $_SESSION['obj']; // session_register($obj);// recommended not to use - said to be outdated usage ob_start(); $obj = new TestClass(); $obj-setName('MyName'); $obj-display(); header(Location:

Re: [PHP] passing an object using session var

2006-11-29 Thread list arama
errata: $newObj-display();// this *does* work On 11/29/06, list arama [EMAIL PROTECTED] wrote: Here's what I came up with: --script1--- ?php include('TestClass.php'); session_start(); $obj = $_SESSION['obj']; // session_register($obj);// recommended not to use -

RE: [PHP] counting clicks

2006-11-29 Thread Richard Lynch
On Wed, November 29, 2006 11:21 am, Jay Blanchard wrote: [snip] Anyone got a script so I can count clicks on adverts. Doesn't have tosve to myqsl or anything just a text file will do. [/snip] ?php if(yes == $adClicked){ $adClickCountFile = fopen(countClick.txt, w); $getCount =

Re: [PHP] hiding passwd in cmdlines that appear in the process list

2006-11-29 Thread Richard Lynch
Don't use exec. ;-v Or, perhaps, write a shell script that reads the password and provides it to MySQL somehow without invoking another exec of some kind. You also could look into other MySQL authentication mechanisms such as SSL keys and whatnot -- which I only vaguely recall seeing somewhere

RE: [PHP] counting clicks

2006-11-29 Thread Jay Blanchard
[snip] This has a race condition where a busy server, or even a not-so-busy one where 2 people happen to click at the same time, at least one of them will be missed, at best. There's also a distinct possiblity of the counter file getting completely trashed, depending on the OS and its underlying

Re: [PHP] Connect to Sybase !

2006-11-29 Thread Richard Lynch
On Tue, November 28, 2006 8:01 pm, Le Phuoc Canh wrote: I want to make a connection to sybase database with PHP on win32 platform, but i can't recompile PHP with extension --with-cybase-ct. Please help me In the .zip file you downloaded for PHP, there should have been, hopefully, a file named

Re: [PHP] session issues on ie

2006-11-29 Thread Richard Lynch
On Tue, November 28, 2006 3:47 pm, blackwater dev wrote: I have code which logs someone in and then allows them to see certain info if they are logged in. I have users who claim it works fin in some of their browsers, firefox, safari, etc and some versions of IE but not all and I'm

Re: [PHP] SEGINT, readline extension clean script exit - how to do it

2006-11-29 Thread Richard Lynch
On Tue, November 28, 2006 7:25 am, Jochem Maas wrote: so the question is how can I use readline() and handle the SIGINT gracefully whilst not waiting for readline() to return control to my script? I'm just guessing here, but you probably don't. You could, howver, write your own PHP function

RE: [PHP] CLI script exec() - how to control what gets dumped on the screen.

2006-11-29 Thread Richard Lynch
exec() doesn't show anything on the screen, I don't think... You'd have to echo implode('', $output) to show the results on the screen... On Tue, November 28, 2006 5:37 am, Edward Kay wrote: As a check, does 'apache2ctl graceful' actually output anything to STDOUT? I would expect your exec

[PHP] Maybe an HTML prob?

2006-11-29 Thread Frank Reichenbacher, Bio-Concepts, Inc.
I am trying to pass the results of a form to a simple php mail() routine. Everything works except the checkbox, Permission. No matter what state the checkbox is in, the php says it is whatever the value is set to on the form. I must not be trying to pull the checkbox state correctly. I've tried

Re: [PHP] combining a text sizer and text only link

2006-11-29 Thread Richard Lynch
Store their current choice of text_only and/or text_size in $_SESSION. http://php.net/session_start //start the session: session_start(); //use saved setting: $text_only = isset($_SESSION['text_only']) ? $_SESSION['text_only'] : 0; //override saved if they clicked on link and it's in GET:

RE: [PHP] Maybe an HTML prob?

2006-11-29 Thread Brad Fuller
if ($Permission = Yes) should be if ($Permission == Yes) It's one of those elusive little oversights we've all come across in our time. :) -B -Original Message- From: Frank Reichenbacher, Bio-Concepts, Inc. [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 29, 2006 1:53 PM To:

Re: [PHP] Maybe an HTML prob?

2006-11-29 Thread David Giragosian
On 11/29/06, Frank Reichenbacher, Bio-Concepts, Inc. [EMAIL PROTECTED] wrote: I am trying to pass the results of a form to a simple php mail() routine. Everything works except the checkbox, Permission. No matter what state the checkbox is in, the php says it is whatever the value is set to on

Re: [PHP] Detecting naughty sites

2006-11-29 Thread tedd
At 8:57 PM +0100 11/28/06, Rory Browne wrote: I didn't mean something quite that simple, or as an absolute solution. I meant something slightly more advanced, but based on that idea. From a robot point of view, what do you think is the difference between the php archives and a porn site?

Re: [PHP] Maybe an HTML prob?

2006-11-29 Thread Dave Goodchild
Indeed. A good habit to get into to avoid that is the write it like this: if ('yes' == $Permission) that way, if you write = rather than == you catch the error On 11/29/06, Brad Fuller [EMAIL PROTECTED] wrote: if ($Permission = Yes) should be if ($Permission == Yes) It's one of those

Re: [PHP] func_get_args as a hash? (faster constructors)

2006-11-29 Thread Richard Lynch
On Mon, November 27, 2006 7:57 pm, Kelly Jones wrote: If I define a function like this: function foo ($x, $y, $z) {} and then call: foo(1,2,bar); is there a function I can call inside foo() that yields this hash: {x = 1, y = 2, z = bar} In other words, gives me the values *and names* of

Re: [PHP] Running AMP from CD

2006-11-29 Thread Richard Lynch
You'll need to trick wget into downloading all the .php? content, even if it is a link embedded in the JS. How hard this is or isn't is more than I can tell you, as I also only understand about half the switches of wget, and have been known to wrap my own PHP program around wget to do what is

Re: [PHP] Maybe an HTML prob?

2006-11-29 Thread Richard Lynch
On Wed, November 29, 2006 12:52 pm, Frank Reichenbacher, Bio-Concepts, Inc. wrote: $Permission = $_POST[Permission]; if ($Permission = Yes) { In addition to the aforementioned = versus == error, your code will generate an E_NOTICE for an unchecked Permission box. HTML/HTTP simply does not

RE: [PHP] Maybe an HTML prob?

2006-11-29 Thread Frank Reichenbacher, Bio-Concepts, Inc.
Well, my code worked fine with that one simple change from = to == -Original Message- From: Richard Lynch [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 29, 2006 13:47 To: [EMAIL PROTECTED] Cc: php-general@lists.php.net Subject: Re: [PHP] Maybe an HTML prob? On Wed,

RE: [PHP] Maybe an HTML prob?

2006-11-29 Thread Frank Reichenbacher, Bio-Concepts, Inc.
Aha! The secret handshake. That was it. Thanks to Brad and to David for pointing me to an invaluable online php resource. Frank -Original Message- From: Brad Fuller [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 29, 2006 12:42 To: php-general@lists.php.net Subject: RE: [PHP]

Re: [PHP] regular expressions

2006-11-29 Thread Dotan Cohen
On 20/11/06, Paul Novitski [EMAIL PROTECTED] wrote: Børge, Here's how I would think this one through: First, I'm having to make several guesses at the nature of your text content: - You use the single word topic but I'll assume this can be multiple words and spaces. - Your source string

Re: [PHP] Tidy HTML source?

2006-11-29 Thread Paul Novitski
At 11/29/2006 05:13 AM, Satyam wrote: - Original Message - From: Paul Novitski [EMAIL PROTECTED] What I find to be a much greater problem is the human readability of logic code when HTML is mixed throughout. Your innovation is helpful here, as you're nearly making HTML tags into PHP

[PHP] LDAP password question

2006-11-29 Thread Ray Hauge
I'm working on integrating an application with an AD server, and I was wondering if the password is encrypted at all, or if I need to go through the troubles of setting up ldaps:// I checked the documentation, but I couldn't find any information about plain-text vs. encrypted. Thanks!

[PHP] several sites sharing the same script

2006-11-29 Thread [EMAIL PROTECTED]
Hello all, I am writing new php application which will be used by several sites. All sites will use same script (all files), but every will have its own config.php file. I would like to place all necessary files to separate directory and all sites should share them, so all sites will be

Re: [PHP] several sites sharing the same script

2006-11-29 Thread Curt Zirzow
On 11/29/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hello all, I am writing new php application which will be used by several sites. All sites will use same script (all files), but every will have its own config.php file. I would like to place all necessary files to separate directory and

RE: [PHP] Connect to Sybase !

2006-11-29 Thread Le Phuoc Canh
Of course I know edit my php.ini, but the problem here that when I test use sybase_connect() function and run by command line, a message This application has failed to start because libct.dll was not found. Can you help me to solve that problem. BR -Original Message- From: Richard

[PHP] cURL: can't prevent url redirect

2006-11-29 Thread Andrew Warner
This login script works when I use Snoopy (php http class), but here with php curl the response is the redirected page. The script is following a 302 redirect and I don't want it to because I need some header info from the 302 page. The curl_setopt($ch, CURLOPT_MAXREDIRS, 0); doesn't seem

Re: [PHP] Connect to Sybase !

2006-11-29 Thread Chris
Le Phuoc Canh wrote: Of course I know edit my php.ini, but the problem here that when I test use sybase_connect() function and run by command line, a message This application has failed to start because libct.dll was not found. ..so it's not that php doesn't support it, it's that php can't

Re: [PHP] cURL: can't prevent url redirect

2006-11-29 Thread Chris
Andrew Warner wrote: This login script works when I use Snoopy (php http class), but here with php curl the response is the redirected page. The script is following a 302 redirect and I don't want it to because I need some header info from the 302 page. The curl_setopt($ch, CURLOPT_MAXREDIRS,

Re: [PHP] cURL: can't prevent url redirect

2006-11-29 Thread Andrew Warner
Actually, the problem is that the site isn't recognizing my cookies. Is there anything wrong with the below code? Same thing in Snoopy works perfectly. Going to stick with Snoopy. $the_headers = array( Language: en, Accept: */*, User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X;

Re: [PHP] cURL: can't prevent url redirect

2006-11-29 Thread Chris
Andrew Warner wrote: Actually, the problem is that the site isn't recognizing my cookies. Is there anything wrong with the below code? Same thing in Snoopy works perfectly. Going to stick with Snoopy. $the_headers = array( Language: en, Accept: */*, User-Agent: Mozilla/5.0

Re: [PHP] func_get_args as a hash? (faster constructors)

2006-11-29 Thread Larry Garfield
On Tuesday 28 November 2006 20:09, Jochem Maas wrote: Kelly Jones wrote: If I define a function like this: function foo ($x, $y, $z) {} and then call: foo(1,2,bar); is there a function I can call inside foo() that yields this hash: {x = 1, y = 2, z = bar} In other words,

[PHP] magic_quotes

2006-11-29 Thread Johannes Lindenbaum
Evening, I am new to this list, so please if this email is offensive to anyone I didn't know any better. Not here to start a war or similar. I have a couple questions about magic_quotes and it's deletion in PHP 6. I've been lazily following php.internals and read about register_globals and

Re: [PHP] cURL: can't prevent url redirect

2006-11-29 Thread Andrew Warner
oops... I see my mistake: foreach($restored_cookies as $name=$value) array_push($the_headers, Cookie: .$name.'='.$value); should be: $cookie=''; foreach($restored_cookies as $name=$value) $cookie .= $key=$value; ; $cookie = substr ($cookie,0,-2); Then either:

Re: [PHP] magic_quotes

2006-11-29 Thread Chris
Johannes Lindenbaum wrote: Evening, I am new to this list, so please if this email is offensive to anyone I didn't know any better. Not here to start a war or similar. I have a couple questions about magic_quotes and it's deletion in PHP 6. I've been lazily following php.internals and read

Re: [PHP] Re: mail header questions

2006-11-29 Thread Chris
Chantal Rosmuller wrote: On Wednesday 29 November 2006 00:45, Chris wrote: you will most likely change what I forgot to mention that I can't set the return-path either. That can *only* be an email address - you can't include a name in the return-path. Also it can't be changed if safe-mode is

[PHP] problems with exec()

2006-11-29 Thread Ray
hello; I am trying to write a script to do some auto configuration of my webserver. Part of the process involves copying some configuration files from other places on the server to a working directory where they can be modified. I am running freeBSD 6.0, Apache 2.2.3, php 5.1.5 I can't seem to get

Re: [PHP] counting clicks

2006-11-29 Thread clive
Ross wrote: Anyone got a script so I can count clicks on adverts. Doesn't have tosve to myqsl or anything just a text file will do. What about using mysql, but use a memory resident heap table, then every once in a while write this to a file or even better to a myisam table Ta Ross

RE: [PHP] Connect to Sybase !

2006-11-29 Thread Le Phuoc Canh
Thanks Chris, I understand my problem, but can you show me where to find the libct.dll or where I can get libct.dll Thanks Best Regard -Original Message- From: Chris [mailto:[EMAIL PROTECTED] Sent: Thursday, November 30, 2006 11:14 AM To: Le Phuoc Canh Cc: PHP Mailing Subject: Re:

Re: [PHP] Connect to Sybase !

2006-11-29 Thread Chris
Le Phuoc Canh wrote: Thanks Chris, I understand my problem, but can you show me where to find the libct.dll or where I can get libct.dll Search for it. libct.dll sybase returns a few results. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List

Re: [PHP] problems with exec()

2006-11-29 Thread admin
Try exec('/path/to/copy', $return); print_r($return); read the manual : http://nl3.php.net/manual/en/function.exec.php Description string exec ( string command [, array output [, int return_var]] ) gr, Thijs On Wed, 29 Nov 2006 23:22:13 -0700, Ray [EMAIL PROTECTED] wrote: hello; I am trying