You are here: Re: making an alert with php « PHP Programming Language « IT news, forums, messages
Re: making an alert with php

Posted by Joe Scylla on 05/23/07 09:27

Geoff Berrow wrote:
> Message-ID: <4653f9c2$0$328$e4fe514c@news.xs4all.nl> from Erwin Moller
> contained the following:
>
>>> i have this code that when the user click it will delete the record:
>>>
>>> echo' <td bgcolor="'.$color.'" width="40"><font face="Verdana"
>>> size="1">
>>> <a href="del.php?id='.$id.'&dbf='.$dbf_new.'">delete</a></
>>> font></td>';
>>>
>>> i wanted to do a little confirmation before commiting the action. how
>>> to do it?
>>>
>>> tnx
>> Wrong group again dude. ;-)
>>
>> Try comp.lang.javascript.
>
> EEEK! No! If that page ever accidentally got spidered, all the records
> would be deleted. Spiders don't run JavaScript, they just 'click'
> links.
>
> PHP would be better. I usually pass items to be deleted to an interim
> page (store them in a session or hidden field) and ask users to click a
> button to confirm the delete.

well if a guest user (like a spider) is able to delete you've made
something terrible wrong ;).

Also afaik spider don't execute javascript code.

I use a solution like this:

<a href="#" onclick="gui_delete('delete.php?id=123');">delete</a>
function gui_delete(url)
{
var r = confirm("Delete entry?");
if (r)
{
document.location.href = url;
}
}

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация