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

Posted by countach on 05/23/07 10:48

En las nuevas, el shotokan99 escribiσ:
> 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


A idea:


$h='';
switch ($_GET['delphase'])
case 'conf':
// Asking for delete
$h.= 'Deleting file '.$id.'?<br>';
$h.= '<a href="del.php?id='.$id.'&dbf='.$dbf_new.'&delphase=delok">OK!</a>
';
$h.= '<a
href="del.php?id='.$id.'&dbf='.$dbf_new.'&delphase=delcancel">Cancel</a>';
break;
case 'delok':
// Answer OK
ulink ($id); // OR whatever you must do to delete the file
$h.= 'File '.$id.' deleted!<br>';
break;
case 'delcancel':
// Answer Cancel
$h = 'Deleting file '.$id.' not done';
// Not breaking to let normal text (default part) show
default:
// Normal behabiour, note the use of delphase parameter
$h.= '<a
href="del.php?id='.$id.'&dbf='.$dbf_new.'&delphase=conf">delete</a>';
break;
}

echo' <td bgcolor="'.$color.'" width="40"><font face="Verdana" size="1">';
echo $h;
echo '</ font></td>';




Hope it works for you.

 

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

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация