php-windows Digest 8 Oct 2002 00:02:34 -0000 Issue 1376

Topics (messages 16214 through 16239):

Re: Auto-submit form
        16214 by: Henrik Hornemann

Re: phpBB won't install
        16215 by: Asendorf, John

Re: IIS 5 - ASP & PHP dev enviorment
        16216 by: Asendorf, John
        16223 by: Uttam

Re: Mail problem
        16217 by: toby z

Re: [PHP] Re: Using date() function
        16218 by: toby z
        16219 by: toby z

Eregi_replace for font tags?!?
        16220 by: Leon
        16221 by: Ignatius Reilly

web crawler(robot,spider,hypertext) search engine
        16222 by: kivanc urgancioglu

Re: Sending data to a script from a form
        16224 by: Uttam
        16225 by: Luis Ferro

Problems refreshing
        16226 by: Aitor
        16227 by: Ignatius Reilly

php and lotus notes
        16228 by: Tim Blackwell

+ACQAXw-FILES+AFs-'file'+AF0AWw-'name'+AF0-
        16229 by: Nino V

Deleting multiple items from database using checkboxes
        16230 by: Davy Obdam
        16235 by: Aitor
        16236 by: Dash McElroy
        16237 by: Davy Obdam

Re: Need SQL Help for PHP_WIN and ODBC/Access !! SOLVED
        16231 by: Williams, Dewey
        16233 by: Naved, Masroor

Re: [PHP] Deleting multiple items from database using checkboxes
        16232 by: Marco Tabini
        16238 by: Ing. Raúl González Rodríguez
        16239 by: John W. Holmes

Can we upload images on the BBS?
        16234 by: Douglas F. Keim

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]


----------------------------------------------------------------------
--- Begin Message ---
Hi,

Since php is a server side language, you can not use it to monitor what is
happening client side. You should be able to do it in javascript, using the
onChange event and check the stringlength and then call submit. Similarly
you can advance the tab key key using the focus function.

hth Henrik Hornemann

-----Oprindelig meddelelse-----
Fra: H Marc Bower [mailto:[EMAIL PROTECTED]]
Sendt: 7. oktober 2002 13:48
Til: [EMAIL PROTECTED]
Emne: [PHP-WIN] Auto-submit form


Is there a way (preferrably using php... but if javascript is necessary and
some kind soul knows how I will use it) to have a form auto-submit when a
field is 'full'?  I want to be able to scan barcodes of a set length and
have a form be automatically submitted to store the information in the
database when the barcode field is scanned.  Since I'm asking potentially
off-topic question anyway, how do I make the fields advance without using
the tab key when one field is 'full'?  For instance, I want to scan a
library card barcode, have the focus shift to the piece barcode field, scan
the book barcode, then be auto-submitted once the book barcode is scanned.

TIA,

(V)

-=-=-=-=-
No testimony is sufficient to establish a miracle unless the testimony be of
such a kind that its falsehood would be more miraculous than the fact which
it endeavours to establish. - David Hume
-=-=-=-=-


--- End Message ---
--- Begin Message ---
This may sound like a silly question, but did you make sure MySQL was the
selected database type during the PHPBB install?  I **just** installed
PHPBB2 this weekend with no hitches...  so, maybe I can help while it's
still fresh in my mind.

---------------------
John Asendorf - [EMAIL PROTECTED]
Web Applications Developer
http://www.lcounty.com - NEW FEATURES ADDED DAILY!
Licking County, Ohio, USA
740-349-3631
Nullum magnum ingenium sine mixtura dementiae fuit


> -----Original Message-----
> From: Douglas F. Keim [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, October 05, 2002 6:30 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] phpBB won't install
> 
> 
> I installed PHP and MySQL.  Tested PHP and started the MySQL 
> server with the
> standard databases, mysql and test.  Server is going on the 
> database with
> the little stop signal green in the tray.  I created a new 
> database for the
> BBS, YodaBBS is the database name.  I can connect to it using 
> DOS MySQL.  I
> extracted and moved the phpBB2 to my website and started the 
> install.php
> page.  I put in what I thought was the correct information, 
> Database name -
> YodaBBS and a username and admin name that were the same 
> "keimdf".  I get a
> phpBB: Critical Error.  Cannot connect to the database.
> 
> PHP and MySQL are installed on Drive D.  php.ini and my.ini are in the
> Windows directory and point to Drive D correctly.
> 
> Running this all on WinXP Pro.
> 
> 
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
--- End Message ---
--- Begin Message ---
I also use both extensively on the same server.  I have had absolutely no
problems running both.

---------------------
John Asendorf - [EMAIL PROTECTED]
Web Applications Developer
http://www.lcounty.com - NEW FEATURES ADDED DAILY!
Licking County, Ohio, USA
740-349-3631
Nullum magnum ingenium sine mixtura dementiae fuit


> -----Original Message-----
> From: JGreening [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, October 06, 2002 6:20 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] IIS 5 - ASP & PHP dev enviorment
> 
> 
> I have done a little searching and haven't really had a good 
> solid answer
> for my question.
> 
> I mainly use ASP for development (and will continue to), but 
> I wanted to
> dabble in a little PHP for my own curiosity. I am using IIS 5 
> on Win XP Pro
> for my dev machine. I have a few ASP applications going and I 
> am looking for
> some questions as to what to expect to happen if I set up IIS 
> 5 to also run
> PHP. Am I putting my ASP projects in harms way, buy setting 
> up IIS to use
> ASP and PHP?
> 
> Any help would be appreciated, links to information would be 
> just fine.
> 
> Thanks.
> 
> 
> 
> 
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
--- End Message ---
--- Begin Message ---
as far as i understand, in this situation IIS would be configured to process
.php files using php module and .asp files will be processes as usual, so
there should not be any problem.

regds,
-----Original Message-----
From: JGreening [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 07, 2002 03:50
To: [EMAIL PROTECTED]
Subject: IIS 5 - ASP & PHP dev enviorment


I have done a little searching and haven't really had a good solid
answer
for my question.

I mainly use ASP for development (and will continue to), but I wanted to
dabble in a little PHP for my own curiosity. I am using IIS 5 on Win XP
Pro
for my dev machine. I have a few ASP applications going and I am looking
for
some questions as to what to expect to happen if I set up IIS 5 to also
run
PHP. Am I putting my ASP projects in harms way, buy setting up IIS to
use
ASP and PHP?

Any help would be appreciated, links to information would be just fine.

Thanks.





--- End Message ---
--- Begin Message ---
francisco

are u tryin the function on the webserver u will host
ur site on

coz if u r running it from ur local host u will get
the error since ur localhost cant send a  mail

toby .....

 --- Francisco Murillo Montoya
<[EMAIL PROTECTED]> wrote: > Hello;
> 
> I have PHP 4.2.3 on Windows 2000 advanced, and when 
> I try to use the mail funtion, the server returns an
> error.
> 
> <?
> mail("[EMAIL PROTECTED]","Formulario","cuerpo");
> ?>
> 
> The page sais: Warning: Server error in
> c:\url\file.php on line 2.
> 
> I have Imail as Mail Server. Do you know why this
> happen?
> 
> Thank you.
> 
> Francisco Murillo
> 
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>  

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com
--- End Message ---
--- Begin Message ---
davy 

heres my query

$sql = "insert into ctnt_inf (title,
body,summary,date_time, day, month, year ) " .
                                "values ('" . $_POST['title']. "','" .
$_POST['body'] . "','" . $_POST['summary'] . "'," .
time() . ", " . date("d"). ", " . date("m"). ", " .
date("Y"). " ) ";\

n i get the day month n year in my database

hope it helps :)

luck ....

toby .....




 
--- Davy Obdam <[EMAIL PROTECTED]> wrote: > Hi John,
> 
> How do u use UNIX_TIMESTAMP or DATE_FORMAT in your
> query. My query now
> looks like this:
> 
> "SELECT * FROM guestbook2002 ORDER BY entryID DESC
> LIMIT $entry, $show";
> 
> Can u help me;-) Thanks for your time
> 
> Best regards,
>  
> Davy Obdam,
> mailto:[EMAIL PROTECTED]
> 
> 
> -----Original Message-----
> From: John W. Holmes
> [mailto:[EMAIL PROTECTED]] 
> Sent: Sunday, October 06, 2002 3:31 PM
> To: 'Davy Obdam'; [EMAIL PROTECTED];
> [EMAIL PROTECTED];
> [EMAIL PROTECTED]
> Subject: [PHP-WIN] RE: [PHP] Re: Using date()
> function
> 
> 
> > Using $entry_date = date('l, d F Y
> H:i:s',$sql['date']); now gives me 
> > back Tuesday, 19 January 2038 04:14:07 with ever
> entry. $sql['date']
> is
> > a TIMESTAMP and looks like this 20021006141256 in
> the datebase. It 
> > should give me Sunday, 06 October 2002 14:12:56..?
> Wierd eh? Do u know
> a
> > solution?
> 
> No, not weird. MySQL uses a timestamp in the
> YYYYMMDDHHMMSS format.
> Date() is expecting a UNIX timestamp, which is the
> number of seconds
> since Jan 1, 1970. 
> 
> So... you can either use DATE_FORMAT() in your
> query, with is the MySQL
> equivalent of date(). Look up the format in the
> manual. Or, you can use
> UNIX_TIMESTAMP() in your query to select out the
> unix timestamp instead
> of the mysql timestamp, and then use that value
> within date() in your
> PHP script.
> 
> ---John Holmes...
> 
> 
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>  

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com
--- End Message ---
--- Begin Message ---
heres my query

$sql = "insert into ctnt_inf (title,
body,summary,date_time, day, month, year ) " .
                                "values ('" . $_POST['title']. "','" .
$_POST['body'] . "','" . $_POST['summary'] . "'," .
time() . ", " . date("d"). ", " . date("m"). ", " .
date("Y"). " ) ";\

n i get the day month n year in my database

hope it helps :)

luck ....

toby .....




 
--- Davy Obdam <[EMAIL PROTECTED]> wrote: > Hi John,
> 
> How do u use UNIX_TIMESTAMP or DATE_FORMAT in your
> query. My query now
> looks like this:
> 
> "SELECT * FROM guestbook2002 ORDER BY entryID DESC
> LIMIT $entry, $show";
> 
> Can u help me;-) Thanks for your time
> 
> Best regards,
>  
> Davy Obdam,
> mailto:[EMAIL PROTECTED]
> 
> 
> -----Original Message-----
> From: John W. Holmes
> [mailto:[EMAIL PROTECTED]] 
> Sent: Sunday, October 06, 2002 3:31 PM
> To: 'Davy Obdam'; [EMAIL PROTECTED];
> [EMAIL PROTECTED];
> [EMAIL PROTECTED]
> Subject: [PHP-WIN] RE: [PHP] Re: Using date()
> function
> 
> 
> > Using $entry_date = date('l, d F Y
> H:i:s',$sql['date']); now gives me 
> > back Tuesday, 19 January 2038 04:14:07 with ever
> entry. $sql['date']
> is
> > a TIMESTAMP and looks like this 20021006141256 in
> the datebase. It 
> > should give me Sunday, 06 October 2002 14:12:56..?
> Wierd eh? Do u know
> a
> > solution?
> 
> No, not weird. MySQL uses a timestamp in the
> YYYYMMDDHHMMSS format.
> Date() is expecting a UNIX timestamp, which is the
> number of seconds
> since Jan 1, 1970. 
> 
> So... you can either use DATE_FORMAT() in your
> query, with is the MySQL
> equivalent of date(). Look up the format in the
> manual. Or, you can use
> UNIX_TIMESTAMP() in your query to select out the
> unix timestamp instead
> of the mysql timestamp, and then use that value
> within date() in your
> PHP script.
> 
> ---John Holmes...
> 
> 
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>  

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com
--- End Message ---
--- Begin Message ---
Hi all

I would like to know if anyone on this list has a possible solution for
replacing FONT tags in HTML being submitted to a site.

My idea was to use eregi_replace ... but how do I tell eregi_replace to take
a string that starts with '<font' and ends with '>' and replace it. This is a
variable string of course because of the input and needs to work differently
for different inputs.

This is for the use of stylesheets.... thus <font class instead of all
others.

Thanks and Cheers


Leon Jansen van Nieuwenhuizen
Personal Computing Services
Information & Communication Technology Services
University of Cape Town
Phone (Work): +27 21 650 3683
Phone (Cell): +27 82 44 66 743
Email: [EMAIL PROTECTED]
__________________________
__________________________


--- End Message ---
--- Begin Message ---
Try:

   $patterns = array(
    "/<FONT([[:alnum:]]|[[:space:]]|_|\'|\"|=)*>/" ,
    etc

   ) ;
   $replace = array(
    "replacement_string"  ,
    etc
   ) ;
   $text = preg_replace( $patterns, $replace, $text ) ;

Deserves to be tested extensively, though, depending on what you may have in
your data

HTH
Ignatius
____________________________________________
----- Original Message -----
From: "Leon" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, October 07, 2002 2:53 PM
Subject: [PHP-WIN] Eregi_replace for font tags?!?


> Hi all
>
> I would like to know if anyone on this list has a possible solution for
> replacing FONT tags in HTML being submitted to a site.
>
> My idea was to use eregi_replace ... but how do I tell eregi_replace to
take
> a string that starts with '<font' and ends with '>' and replace it. This
is a
> variable string of course because of the input and needs to work
differently
> for different inputs.
>
> This is for the use of stylesheets.... thus <font class instead of all
> others.
>
> Thanks and Cheers
>
>
> Leon Jansen van Nieuwenhuizen
> Personal Computing Services
> Information & Communication Technology Services
> University of Cape Town
> Phone (Work): +27 21 650 3683
> Phone (Cell): +27 82 44 66 743
> Email: [EMAIL PROTECTED]
> __________________________
> __________________________
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
I'll write an webcrawler in php,but I don't know the
main algorithm to retrieve links from a webpage.

__________________________________________________
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos & More
http://faith.yahoo.com
--- End Message ---
--- Begin Message ---
use $_GET['user'] and $_GET['address']...

output.php

    <html>
    <head>
    <title></title>
    </head>
    <body>
    <?php
    echo "welcome <b>$_GET['user']</b><p>\n\n";
    echo "your address is:<p>\n\n<b>$_GET['address']</b>";
    ?>
    </body>
    </html>


regds,
-----Original Message-----
From: R Strang [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 07, 2002 04:12
To: [EMAIL PROTECTED]
Subject: Sending data to a script from a form


hi im having problems with running PHP4 and MySQL on Windows 98 with PWS

im using this simple script to input an name and dysplay it on another
page it was taken from a book example but i get an error

PHP Notice: Undefined variable: user in c:\Inetpub\wwwroot\output.php on
line 7 PHP                         Notice:Undefined variable: address in
c:\Inetpub\wwwroot\output.php on line 8 


input.php

    <html>
    <head>
    <title></title>
    </head>
    <body>
    <form action="output.php" method="get">
    <input type="text" name="user">
    <br>
    <textarea name="address rows="5" cols="40">
    </textarea>
    <br>
    <input type="submit" value="hit it!">
    </form>
    </body>
    </html>


output.php

    <html>
    <head>
    <title></title>
    </head>
    <body>
    <?php
    print "welcome <b>$user</b><p>\n\n";
    print "your address is:<p>\n\n<b>$address</b>";
    ?>
    </body>
    </html>

--- End Message ---
--- Begin Message ---
This behavior happens because in the php.ini there is an option 
"register_globals" which is turned off (as it should, as security 
advises)... Keep in mind that in most host providers, the stated option 
is turned on...

As a safe and universal way to access vars, don't assume anything 
regarding the register_globals configuration...

Cheers...
Luis Ferro


Uttam wrote:

>use $_GET['user'] and $_GET['address']...
>
>output.php
>
>    <html>
>    <head>
>    <title></title>
>    </head>
>    <body>
>    <?php
>    echo "welcome <b>$_GET['user']</b><p>\n\n";
>    echo "your address is:<p>\n\n<b>$_GET['address']</b>";
>    ?>
>    </body>
>    </html>
>
>
>regds,
>-----Original Message-----
>From: R Strang [mailto:[EMAIL PROTECTED]]
>Sent: Monday, October 07, 2002 04:12
>To: [EMAIL PROTECTED]
>Subject: Sending data to a script from a form
>
>
>hi im having problems with running PHP4 and MySQL on Windows 98 with PWS
>
>im using this simple script to input an name and dysplay it on another
>page it was taken from a book example but i get an error
>
>PHP Notice: Undefined variable: user in c:\Inetpub\wwwroot\output.php on
>line 7 PHP                         Notice:Undefined variable: address in
>c:\Inetpub\wwwroot\output.php on line 8 
>
>
>input.php
>
>    <html>
>    <head>
>    <title></title>
>    </head>
>    <body>
>    <form action="output.php" method="get">
>    <input type="text" name="user">
>    <br>
>    <textarea name="address rows="5" cols="40">
>    </textarea>
>    <br>
>    <input type="submit" value="hit it!">
>    </form>
>    </body>
>    </html>
>
>
>output.php
>
>    <html>
>    <head>
>    <title></title>
>    </head>
>    <body>
>    <?php
>    print "welcome <b>$user</b><p>\n\n";
>    print "your address is:<p>\n\n<b>$address</b>";
>    ?>
>    </body>
>    </html>
>
>
>  
>



---
[This E-mail scanned for viruses by Declude Virus]

--- End Message ---
--- Begin Message ---
Hi, I'm working on a PHP and mySQL website based but I have a problem refreshing the 
information of the webs. When I load/change information on the mySQL throught the PHP 
site the new information is not displayed on the site because the browser use the web 
from the cache memory. How can I force the browse to reload the information everytime 
the web is loaded?

if you want to try the web and tell if it works this is the URL : 
Http://www.7islands.net/Aerena/
It's in spanish!

Thanks!
--- End Message ---
--- Begin Message ---
You can append a variable that is sure to change, such as time():

 <SCRIPT language="JavaScript">
  function redirect() {
   location.href = "http://mydomain.fr?nocache=<?php echo( time() ) ; ?>" ;
  }
 </SCRIPT>

HTH
Ignatius
____________________________________________
----- Original Message -----
From: "Aitor" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, October 07, 2002 5:53 PM
Subject: [PHP-WIN] Problems refreshing


Hi, I'm working on a PHP and mySQL website based but I have a problem
refreshing the information of the webs. When I load/change information on
the mySQL throught the PHP site the new information is not displayed on the
site because the browser use the web from the cache memory. How can I force
the browse to reload the information everytime the web is loaded?

if you want to try the web and tell if it works this is the URL :
Http://www.7islands.net/Aerena/
It's in spanish!

Thanks!

--- End Message ---
--- Begin Message ---
does anyone out there use php in lotus notes--i'm looking for a function
that can access the NAB for user authentication.

thanks,

tim


--- End Message ---
--- Begin Message ---
Hi,
can anyone help me (a newbie) to understand why uploading a file I always
loose the original name of the file and I get a temp name like p9150.TMP in
+ACQAXw-FILES+AFs-'userfile'+AF0AWw-'name'+AF0-?

Thanks,
Nino

--- End Message ---
--- Begin Message ---
Hi people,.

I have a guestbook admin page were i would like to delete one item or
more items from the database if necessary. I have modified my normal
guestbookpage so that it has checkboxes in front of every entry. This is
my code:

<input type=\"checkbox\" name=\"dele[]\" value=\"".$sql['entryID']."\">

Now i can select multiple items. But i have tried to delete em, but it
only deletes one item from the database, my query looks like this :
DELETE  FROM gastenboek WHERE entryID=$dele . Can anyone help me. Thanks
for your time.


Best regards,
 
Davy Obdam,
mailto:[EMAIL PROTECTED]


--- End Message ---
--- Begin Message ---
>my querylooks like this :
>DELETE  FROM gastenboek WHERE entryID=$dele .

I think that the mySQL query should look like:

DELETE * FROM gastenboek WHERE entryID=$dele

so, you should do something like this:

DELETE $thinks_to_delete FROM gastenboek WHERE entryID=$dele

After the "DELETE" you must say what to delete from the table. If you want
to delete more than one thing you should use more than one variable, one for
each entry.

I hope this help you because I'm a newbie with this. :)

--- End Message ---
--- Begin Message ---
Wouldn't you want to do a foreach() loop?

i.e.

foreach($dele as $whatever) {
        mysql_query(DELETE  FROM gastenboek WHERE entryID=$whatever);
}

I'm sure the syntax on the mysql_query line isn't right...

The multiple database calls can be expensive if you're deleting lots of
information.

-Dash

-----Original Message-----
From: Davy Obdam [mailto:[EMAIL PROTECTED]] 
Sent: Monday, October 07, 2002 1:05 PM
To: Php Mailinglist; Php-Windows Mailing
Subject: [PHP-WIN] Deleting multiple items from database using checkboxes


Hi people,.

I have a guestbook admin page were i would like to delete one item or
more items from the database if necessary. I have modified my normal
guestbookpage so that it has checkboxes in front of every entry. This is
my code:

<input type=\"checkbox\" name=\"dele[]\" value=\"".$sql['entryID']."\">

Now i can select multiple items. But i have tried to delete em, but it
only deletes one item from the database, my query looks like this :
DELETE  FROM gastenboek WHERE entryID=$dele . Can anyone help me. Thanks
for your time.


Best regards,
 
Davy Obdam,
mailto:[EMAIL PROTECTED]



-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hi Dash,..

Your right i forgot the * in my mysql_query, it should be DELETE * FROM
gastenboek WHERE entryID=$whatever

Best regards,
 
Davy Obdam,
mailto:[EMAIL PROTECTED]


-----Original Message-----
From: Dash McElroy [mailto:[EMAIL PROTECTED]] 
Sent: Monday, October 07, 2002 11:15 PM
To: 'Davy Obdam'; Php-Windows Mailing
Subject: RE: [PHP-WIN] Deleting multiple items from database using
checkboxes


Wouldn't you want to do a foreach() loop?

i.e.

foreach($dele as $whatever) {
        mysql_query(DELETE  FROM gastenboek WHERE entryID=$whatever); }

I'm sure the syntax on the mysql_query line isn't right...

The multiple database calls can be expensive if you're deleting lots of
information.

-Dash

-----Original Message-----
From: Davy Obdam [mailto:[EMAIL PROTECTED]] 
Sent: Monday, October 07, 2002 1:05 PM
To: Php Mailinglist; Php-Windows Mailing
Subject: [PHP-WIN] Deleting multiple items from database using
checkboxes


Hi people,.

I have a guestbook admin page were i would like to delete one item or
more items from the database if necessary. I have modified my normal
guestbookpage so that it has checkboxes in front of every entry. This is
my code:

<input type=\"checkbox\" name=\"dele[]\" value=\"".$sql['entryID']."\">

Now i can select multiple items. But i have tried to delete em, but it
only deletes one item from the database, my query looks like this :
DELETE  FROM gastenboek WHERE entryID=$dele . Can anyone help me. Thanks
for your time.


Best regards,
 
Davy Obdam,
mailto:[EMAIL PROTECTED]



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

================================================================
Deze e-mail is door E-mail VirusScanner van Planet Internet
gecontroleerd op virussen. Op http://www.planet.nl/evs staat een
verwijzing naar de actuele lijst waar op wordt gecontroleerd.


--- End Message ---
--- Begin Message ---
It seems the use of LIKE in an sql statement requires the 'wild-card' %
instead of * when sending to an Access (and other?) databases.  If anyone
knows WHY, I would like an explanation.

Dewey Williams
[EMAIL PROTECTED] 

-----Original Message-----
From: Williams, Dewey [mailto:[EMAIL PROTECTED]]
Sent: Thursday, October 03, 2002 3:59 PM
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] Need SQL Help for PHP_WIN and ODBC/Access


HELP!

I need the WHERE statement to use LIKE and wrap the variable $ProdVar in *
so users can do a text search on the field.

--- End Message ---
--- Begin Message ---
Dewey,

I believe that the % wildcard is ANSI SQL requirement. I know at least
Oracle, MS SQL Server, & Sybase use it.

-Masroor

-----Original Message-----
From: Williams, Dewey [mailto:[EMAIL PROTECTED]] 
Sent: Monday, October 07, 2002 4:08 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP-WIN] Need SQL Help for PHP_WIN and ODBC/Access !! SOLVED


It seems the use of LIKE in an sql statement requires the 'wild-card' %
instead of * when sending to an Access (and other?) databases.  If anyone
knows WHY, I would like an explanation.

Dewey Williams
[EMAIL PROTECTED] 

-----Original Message-----
From: Williams, Dewey [mailto:[EMAIL PROTECTED]]
Sent: Thursday, October 03, 2002 3:59 PM
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] Need SQL Help for PHP_WIN and ODBC/Access


HELP!

I need the WHERE statement to use LIKE and wrap the variable $ProdVar in *
so users can do a text search on the field.


-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Try WHERE EntryID IN (" . implode ($dele, ',') . ")"

However:

1) Anybody could fake a form post or query url to delete any data in
your database
2) It would also be possible to create a more dangerous post that could
give the attacker control over your entire database

Thus, I assume that you will want to put a *lot* of checking around that
code!


Marco

On Mon, 2002-10-07 at 16:05, Davy Obdam wrote:
> Hi people,.
> 
> I have a guestbook admin page were i would like to delete one item or
> more items from the database if necessary. I have modified my normal
> guestbookpage so that it has checkboxes in front of every entry. This is
> my code:
> 
> <input type=\"checkbox\" name=\"dele[]\" value=\"".$sql['entryID']."\">
> 
> Now i can select multiple items. But i have tried to delete em, but it
> only deletes one item from the database, my query looks like this :
> DELETE  FROM gastenboek WHERE entryID=$dele . Can anyone help me. Thanks
> for your time.
> 
> 
> Best regards,
>  
> Davy Obdam,
> mailto:[EMAIL PROTECTED]
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


--- End Message ---
--- Begin Message ---
You can use the following code to delete multiple items:

  if(isset($dele) && (count($dele) > 0)) {
     $sql = "delete from gastenboek where (entryID='$dele[0]')";
     for($i=1; $i<count($dele); $i++)
          $sql .= " or (entryID='$dele[$i]')";
     $res = mysql_query($sql, $connection);
  }

Raul

----- Original Message -----
From: "Davy Obdam" <[EMAIL PROTECTED]>
To: "Php Mailinglist" <[EMAIL PROTECTED]>; "Php-Windows Mailing"
<[EMAIL PROTECTED]>
Sent: Monday, October 07, 2002 4:05 PM
Subject: [PHP] Deleting multiple items from database using checkboxes


> Hi people,.
>
> I have a guestbook admin page were i would like to delete one item or
> more items from the database if necessary. I have modified my normal
> guestbookpage so that it has checkboxes in front of every entry. This is
> my code:
>
> <input type=\"checkbox\" name=\"dele[]\" value=\"".$sql['entryID']."\">
>
> Now i can select multiple items. But i have tried to delete em, but it
> only deletes one item from the database, my query looks like this :
> DELETE  FROM gastenboek WHERE entryID=$dele . Can anyone help me. Thanks
> for your time.
>
>
> Best regards,
>
> Davy Obdam,
> mailto:[EMAIL PROTECTED]
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


--- End Message ---
--- Begin Message ---
I think someone already mentioned this, but you can also do this:

if(isset($dele) && count($dele) > 0)
{
  $ids = "'" . implode("','",$dele) . "'";
  $sql = "delete from gastenboek where entryID IN ($ids)";
  $result = mysql_query($sql);
}

might want to add in a is_array() somewhere in there...

---John Holmes...

> -----Original Message-----
> From: Ing. Raúl González Rodríguez [mailto:[EMAIL PROTECTED]]
> Sent: Monday, October 07, 2002 4:48 PM
> To: Php Mailinglist; Php-Windows Mailing
> Subject: Re: [PHP] Deleting multiple items from database using
checkboxes
> 
> You can use the following code to delete multiple items:
> 
>   if(isset($dele) && (count($dele) > 0)) {
>      $sql = "delete from gastenboek where (entryID='$dele[0]')";
>      for($i=1; $i<count($dele); $i++)
>           $sql .= " or (entryID='$dele[$i]')";
>      $res = mysql_query($sql, $connection);
>   }
> 
> Raul
> 
> ----- Original Message -----
> From: "Davy Obdam" <[EMAIL PROTECTED]>
> To: "Php Mailinglist" <[EMAIL PROTECTED]>; "Php-Windows
Mailing"
> <[EMAIL PROTECTED]>
> Sent: Monday, October 07, 2002 4:05 PM
> Subject: [PHP] Deleting multiple items from database using checkboxes
> 
> 
> > Hi people,.
> >
> > I have a guestbook admin page were i would like to delete one item
or
> > more items from the database if necessary. I have modified my normal
> > guestbookpage so that it has checkboxes in front of every entry.
This is
> > my code:
> >
> > <input type=\"checkbox\" name=\"dele[]\"
value=\"".$sql['entryID']."\">
> >
> > Now i can select multiple items. But i have tried to delete em, but
it
> > only deletes one item from the database, my query looks like this :
> > DELETE  FROM gastenboek WHERE entryID=$dele . Can anyone help me.
Thanks
> > for your time.
> >
> >
> > Best regards,
> >
> > Davy Obdam,
> > mailto:[EMAIL PROTECTED]
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



--- End Message ---
--- Begin Message ---
I am putting together a BBS for my family.  I would like to be able to
upload/download images.  Can this be done with phpbb?


--- End Message ---

Reply via email to