Re: [PHP] LDAP: Write to boolean attribute

2006-11-28 Thread Carsten Gehling
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 - Carsten -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] session issues on ie

2006-11-28 Thread Vincent DUPONT
Hi, do you have any access to the client computers (is it an intranet)? If so, check yourself the existence of the cookie and check JS and cookie settings on their browser.From my own experience, you should never truct the user's comments about their config or actions... Otherwise, you could m

Re: [PHP] LDAP: Write to boolean attribute

2006-11-28 Thread Chris
Carsten Gehling wrote: Hi, I am using PHP's LDAP to read and write information fron user-objects in Active Directory (Windows Server 2003). The AD has been extended with 2 attributes (call them "xx" and "yy") with the field type BOOLEAN How do i write to these fields? If I use ldap_mod_replac

[PHP] LDAP: Write to boolean attribute

2006-11-28 Thread Carsten Gehling
Hi, I am using PHP's LDAP to read and write information fron user-objects in Active Directory (Windows Server 2003). The AD has been extended with 2 attributes (call them "xx" and "yy") with the field type BOOLEAN How do i write to these fields? If I use ldap_mod_replace, and set the values fo

Re: [PHP] Tidy HTML source?

2006-11-28 Thread Fredrik Thuresson
"At one point or another plain HTML has to be generated. " Care to give me an example? I never generate any html in my php code anymore. It's not very pretty when your code looks like echo "\n\t\t\t\t\t\t"; Is that not a form of a templating engine that your are building? Fredrik Satyam wro

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

2006-11-28 Thread Ian Barnes
Hi, $sql1 = "UPDATE members SET $pass WHERE id = '$editid'"; Thats whats on 199. ON line 198 i have: $pass = $_POST['pass']; Thanks, Ian On 11/29/06, Jochem Maas <[EMAIL PROTECTED]> wrote: Ian Barnes wrote: > Hi, > > We recently upgraded our primary webserver to php 5 from php4 and we are

[PHP] Connect to Sybase !

2006-11-28 Thread Le Phuoc Canh
Dear all, 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 !!!

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

2006-11-28 Thread Jochem Maas
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 the ar

Re: [PHP] Detecting naughty sites

2006-11-28 Thread Travis Doherty
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 that site is a porn site via php? >> >> -- >>

Re: [PHP] Readdir

2006-11-28 Thread Jochem Maas
Tom Chubb wrote: > Got it working fine. Thanks Vincent and Jochem for pointing me in the > right direction. Here is the code I used in case anyone's > interested... > > foreach(glob($path.$id."{*.doc,*.pdf,*.txt,*.rtf}", > GLOB_BRACE) as $filename) { $cvs[]=$filename; } > > //Loop through the fo

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

2006-11-28 Thread Jochem Maas
Ian Barnes wrote: > Hi, > > We recently upgraded our primary webserver to php 5 from php4 and we are > now > getting the following errors on the site: > > *Catchable fatal error*: Object of class stdClass could not be converted to > string in /home/www/somesite/somfile.php on line *199 > > *Arou

Re: [PHP] Detecting naughty sites

2006-11-28 Thread Paul Novitski
At 11/28/2006 11:57 AM, 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? What e

Re: [PHP] Re: mail header questions

2006-11-28 Thread Chris
Chantal Rosmuller wrote: Hi Manuel, 1) I can't get the From header right, when I receive the test mail the sender is apache There is From: and From . From is not a real header. It is just set by some MTA to the return path address and is also used as separator in mailbox files with multiple me

RE: [PHP] backing up a database

2006-11-28 Thread Warren Vail
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 select variety. Warren Vail -Original Message-

Re: [PHP] Readdir

2006-11-28 Thread Tom Chubb
Got it working fine. Thanks Vincent and Jochem for pointing me in the right direction. Here is the code I used in case anyone's interested... $cv"; echo ""; } echo "\n"; $i++; } ?> On 28/11/06, Tom Chubb <[EMAIL PROTECTED]> wrote: Thanks guys, Looks like j

Re: [PHP] backing up a database

2006-11-28 Thread Chris
James Tu wrote: Thanks Brad: I'm just surprised that when people mention mysqldump, most of the time they don't talk about locking the tables at all. I'm curious why this is the case. Because you don't need to. More of a mysql-mailing list question to be honest. -- Postgresql & php tutori

Re: [PHP] backing up a database

2006-11-28 Thread James Tu
Thanks Brad: I'm just surprised that when people mention mysqldump, most of the time they don't talk about locking the tables at all. I'm curious why this is the case. -James Does one need to lock(?) MySQL before running mysqldump? Or will the mysqldump command wait for any pending operat

[PHP] session issues on ie

2006-11-28 Thread blackwater dev
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 stumped. Here's the code: //this is from the login routine if ($this

[PHP] Odd error after upgrading from Php4 to Php5

2006-11-28 Thread Ian Barnes
Hi, We recently upgraded our primary webserver to php 5 from php4 and we are now getting the following errors on the site: *Catchable fatal error*: Object of class stdClass could not be converted to string in /home/www/somesite/somfile.php on line *199 *Around that area in the code is some code

Re: [PHP] Process of creating invoices requiring human thought!

2006-11-28 Thread Jon Anderson
James Nunnerley wrote: Can anyone see an easy way of putting that sort of “human thinking” into a script? Any guidance would be gratefully received… You could include a "fuzz" factor that is acceptable to your application. You could also provide a "nicer" fuzz factor to people who don't use up

[PHP] Process of creating invoices requiring human thought!

2006-11-28 Thread James Nunnerley
I’m creating an invoicing system for a children’s nursery, and I’m trying to work out how I can replicate the thought process one would normally go through when working out the bill for each day. I’ve created all the mysql tables that I think I need, with all the info possible; along the follow

Re: [PHP] Detecting naughty sites

2006-11-28 Thread Rory Browne
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? On 11/28/06, Paul Novitski <[EMAIL PROTECTED]> wro

RE: [PHP] backing up a database

2006-11-28 Thread Brad Fuller
> -Original Message- > From: James Tu [mailto:[EMAIL PROTECTED] > Sent: Tuesday, November 28, 2006 1:21 PM > To: PHP General List > Subject: Re: [PHP] backing up a database > > Does one need to lock(?) MySQL before running mysqldump? > Or will the mysqldump command wait for any pending ope

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

2006-11-28 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2006-11-27 18:57:54 -0700: > 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 the arguments to foo? > > func_get_args just yields the values. > > Having this fun

Re: [PHP] Detecting naughty sites

2006-11-28 Thread Paul Novitski
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 that site is a porn site via php? If the sites home page contains the words sex, babes, and a few other choice words, which I'll l

Re: [PHP] backing up a database

2006-11-28 Thread James Tu
Does one need to lock(?) MySQL before running mysqldump? Or will the mysqldump command wait for any pending operations to finish, lock the tables for dumping and once finished release the lock? -James On Nov 27, 2006, at 2:21 AM, David Robley wrote: Sumeet wrote: Brad Fuller wrote: $com

Re: [PHP] Detecting naughty sites

2006-11-28 Thread Tom Chubb
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 that site is a porn site via php? -- http://www.web-buddha.co.uk I remember

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

2006-11-28 Thread Jochem Maas
Edward Kay wrote: >> my fault was indeed thinking along such 'the result' lines - I did >> not consider that stderr was not part of 'the result' and that most >> programs seem to happily spit out their output to stderr (e.g. apache2ctl, >> cvs, mysql to name a few that I was calling in the problem

RE: [PHP] Detecting naughty sites

2006-11-28 Thread Arno Kuhl
One way that could work is to check the urls against a list of keywords and if a match is found put these submissions into a pending state waiting for you to check and approve or decline. You could also have a second "hot" keyword list that rejects the submissions outright if you find a match in th

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

2006-11-28 Thread Edward Kay
> my fault was indeed thinking along such 'the result' lines - I did > not consider that stderr was not part of 'the result' and that most > programs seem to happily spit out their output to stderr (e.g. apache2ctl, > cvs, mysql to name a few that I was calling in the problem script) and yes > I'm

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

2006-11-28 Thread Jochem Maas
Myron Turner wrote: > exec() doesn't output anything. It fills the array with the result 'the result' is a bit of a nebulous concept - exec() fills the output array with whatever the called script/program *spat out on stdout*. my fault was indeed thinking along such 'the result' lines - I did no

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

2006-11-28 Thread Jochem Maas
bruce wrote: > if i understand correctly, you want to run a system cmd from inside a php > app. you also want to return/display the result of the system action. well I wanted to grab the output so that I could parse it and determine what went wrong if anything did go wrong - (and possibly dump the

[PHP] LDAP: Write boolean attribute in Active Directory

2006-11-28 Thread Carsten Gehling
Hi, I am using PHP's LDAP to read and write information fron user-objects in Active Directory (Windows Server 2003). The AD has been extended with 2 attributes (call them "xx" and "yy") with the field type BOOLEAN How do i write to these fields? If I use ldap_mod_replace, and set the values fo

Re: [PHP] Detecting naughty sites

2006-11-28 Thread Rory Browne
If the sites home page contains the words sex, babes, and a few other choice words, which I'll leave to your imagination, then chances are it's a porn site. On 11/28/06, Jochem Maas <[EMAIL PROTECTED]> wrote: Dave Goodchild wrote: > Hi all. I am building a web app and as part of it advertisers c

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

2006-11-28 Thread bruce
if i understand correctly, you want to run a system cmd from inside a php app. you also want to return/display the result of the system action. here's a sample of what i use in a php/cli test app. if i recall, i've done the same thing in php web apps as well.. $rm_conf = "rm -f /svntest/%

[PHP] LDAP: Write boolean attribute in Active Directory

2006-11-28 Thread Carsten Gehling
Hi, I am using PHP's LDAP to read and write information fron user-objects in Active Directory (Windows Server 2003). The AD has been extended with 2 attributes (call them "xx" and "yy") with the field type BOOLEAN How do i write to these fields? If I use ldap_mod_replace, and set the values fo

Re: [PHP] Detecting naughty sites

2006-11-28 Thread Jochem Maas
Dave Goodchild 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 that site is a porn site via php? buy a screen, a PC, a heartrate monitor and small man from thailand - plu

Re: [PHP] Readdir

2006-11-28 Thread Tom Chubb
Thanks guys, Looks like just what I need. Will test it out later. Tom On 28/11/06, Vincent DUPONT <[EMAIL PROTECTED]> wrote: yes, glob works well. here is an example to get pictures inside a folder ($path) foreach(glob($path."/*/{*.gif,*.jpg,*.JPG,*.jpeg,*.JPEG,*.png}", GLOB_BRACE) as $filen

[PHP] Detecting naughty sites

2006-11-28 Thread Dave Goodchild
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 that site is a porn site via php? -- http://www.web-buddha.co.uk

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

2006-11-28 Thread Jochem Maas
hi people, I have a script - if I run it and then hit CTRL+C the script dies and I'm returned to the prompt, only this leads to an unclean shutdown and the directory one was in when the script was runs will contain a file named 'session_mm_cli0.sem' - this quikly becomes messy. so I went looking

Re: [PHP] Tidy HTML source?

2006-11-28 Thread Satyam
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 looking at the HTML and checking it out by ha

[PHP] reading exif infos

2006-11-28 Thread Merlin
Hi there, I would like read the camera info from a picture during uploading it. The library PEL offers such a functionality but requires PHP5, but I do not want to upgrade now from PHP4, neither do I want to recompile PHP for it with exif. Is there any other way to get the name of the camera

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

2006-11-28 Thread Jochem Maas
clive wrote: > Jochem Maas wrote: >> I have been trying to figure out how to use exec to run some commandline >> scripts (some perl scripts & mysql in this case) WITH the output of >> the commands >> run via exec being shown on the screen. > > have you tried shell_exec ? no - but that's because i

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

2006-11-28 Thread Jochem Maas
Stut wrote: > Jochem Maas wrote: >> I have been trying to figure out how to use exec to run some >> commandline scripts (some perl scripts & mysql in this case) WITH the >> output of the commands run via exec being shown on the screen. >> >> neither of these examples have the desired effect: >>

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

2006-11-28 Thread Jochem Maas
Edward Kay wrote: > As a check, does 'apache2ctl graceful' actually output anything to STDOUT? I well apparently the 'Syntax OK' message is output by apache2ctl to STD_ERR; which is weird if you ask me - not what I would expect (how in any way is 'Syntax OK' an error?) oh well I guess I have a lo

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

2006-11-28 Thread clive
Jochem Maas wrote: I have been trying to figure out how to use exec to run some commandline scripts (some perl scripts & mysql in this case) WITH the output of the commands run via exec being shown on the screen. have you tried shell_exec ? clive -- PHP General Mailing List (http://www.php.ne

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

2006-11-28 Thread Stut
Jochem Maas wrote: I have been trying to figure out how to use exec to run some commandline scripts (some perl scripts & mysql in this case) WITH the output of the commands run via exec being shown on the screen. neither of these examples have the desired effect: $output = array(); $exit =

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

2006-11-28 Thread Edward Kay
As a check, does 'apache2ctl graceful' actually output anything to STDOUT? I would expect your exec commands to work - try with something like 'ls' or 'whoami' and see if you get any results that way. Edward > I have been trying to figure out how to use exec to run some commandline > scripts (som

RE: [PHP] Readdir

2006-11-28 Thread Vincent DUPONT
yes, glob works well. here is an example to get pictures inside a folder ($path) foreach(glob($path."/*/{*.gif,*.jpg,*.JPG,*.jpeg,*.JPEG,*.png}", GLOB_BRACE) as $filename){ $pics[]=$filename; } vincent -Original Message- From: Jochem Maas [mailto

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

2006-11-28 Thread Jochem Maas
I have been trying to figure out how to use exec to run some commandline scripts (some perl scripts & mysql in this case) WITH the output of the commands run via exec being shown on the screen. neither of these examples have the desired effect: $output = array(); $exit = 0; exec('apache2c

Re: [PHP] Readdir

2006-11-28 Thread Børge Holen
something like this? while ( gettype ( $file = @readdir (@opendir ( $dirname )) ) != boolean ){ check if correct extension, else -> something completely else? } On Tuesday 28 November 2006 09:55, Tom Chubb wrote: > What would be the best way to retrieve a list of files from an upload > fo

Re: [PHP] Readdir

2006-11-28 Thread Jochem Maas
Tom Chubb wrote: > What would be the best way to retrieve a list of files from an upload > folder that are called "id" where the extension could be .doc .txt or > .pdf > For example, I have a folder where people can upload a document and > the document is renamed as their user id. They can upload a

Re: [PHP] Re: mail header questions

2006-11-28 Thread Chantal Rosmuller
Hi Manuel, > > 1) I can't get the From header right, when I receive the test mail the > > sender is apache > > There is From: and From . From is not a real header. It is just set by > some MTA to the return path address and is also used as separator in > mailbox files with multiple messages in the

[PHP] combining a text sizer and text only link

2006-11-28 Thread Ross
$text_only = isset($_GET['text_only']) ? $_GET['text_only'] : 1; if ($text_only==1) { ?> off // import css here on // import css here secondly the text size links A A A these work great independently but when I use one the other switches off. any ideas how I can combine them?

RE: [PHP] Readdir

2006-11-28 Thread Vincent DUPONT
If you are working in pure PHP5 OOP, you could like to try the new SPL iterators. see http://www.phpro.org/tutorials/Introduction-to-SPL.html#12 vincent -Original Message- From: Tom Chubb [mailto:[EMAIL PROTECTED] Sent: Tue 28/11/2006 9:55 To: [php] PHP General List Subject: [PHP] Read

[PHP] Readdir

2006-11-28 Thread Tom Chubb
What would be the best way to retrieve a list of files from an upload folder that are called "id" where the extension could be .doc .txt or .pdf For example, I have a folder where people can upload a document and the document is renamed as their user id. They can upload a PDF, DOC or TXT file. The

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

2006-11-28 Thread Vincent DUPONT
Well, I would reply that this is probably as easy to read ... You should think about poeple having digg into your code, or about you in a few month... Moreover, having much parameters (more than 4) is not a good idea (for the same reading and understanding reasons). Functions having more than 4

Re: [PHP] Tidy HTML source?

2006-11-28 Thread Frank Arensmeier
As Richard already pointed out, "ugly" code can be a real problem occasionally. Besides that, I assume that you have some kind of coding standrad for your PHP code already, right? Basically, why do someone would make a difference between pretty styled PHP code and pretty styled html/CSS? Be