Received: from mung.bundabergcity.qld.gov.au ([203.48.46.3]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f0M0Y2065901 for ; Sun, 21 Jan 2001 19:34:03 -0500 (EST) (envelope-from stefang@bundabergcity.qld.gov.au) Received: from bert.bundabergcity.qld.gov.au ([172.16.0.22]) by mung.bundabergcity.qld.gov.au (8.11.0/8.11.0) with ESMTP id f0L6AbK11716 for ; Sun, 21 Jan 2001 16:10:42 +1000 Received: from bundabergcity.qld.gov.au (trinity.bundabergcity.qld.gov.au [172.16.0.26]) by bert.bundabergcity.qld.gov.au with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2448.0) id DM0Y5B3N; Mon, 22 Jan 2001 10:35:19 +1000 Message-ID: <3A6B8264.5040902@bundabergcity.qld.gov.au> Date: Mon, 22 Jan 2001 10:44:20 +1000 From: s User-Agent: Mozilla/5.0 (X11; U; Linux 2.2.12-20 i686; en-US; m18) Gecko/20010114 X-Accept-Language: en MIME-Version: 1.0 To: pgsql-php@postgresql.org Subject: query checking Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Archive-Number: 200101/63 X-Sequence-Number: 128 I am writing a site that does select/insert SQL commands with users input. There is a potential hazard if some one tries to execute there own commands in an input box eg. the user types into the input box on a form - [ "; delete * from table; ] I'm after a regular expression (that'd be nice) or an algorithm to tell that only one query is being passed to psql at a time. The query string will be processed if Either - one SELECT command only - one INSERT command only - one UPDATE command only ELSE - dont process query Any input would be much appreciated. thanks, stef