It's fairly simple: at the top of your script, have a block of code similar
to the following, and have the link point to 
-- 
$_SERVER['PHP_SELF']."?rm_id=".$id_to_be_deleted
--  
I'll leave out all but the essential elements.

<code>
<?php
  if (isset($_GET['rm_id']))
  {
    $query = "REMOVE FROM whatever WHERE id = ".$_GET['rm_id']." LIMIT 1";
    mysql_query($query);
  }
?>
</code>

Will Collins

-----Original Message-----
From: Robert Cummings [mailto:[EMAIL PROTECTED] 
Sent: Friday, May 14, 2004 8:49 PM
To: Ryan A
Cc: PHP-General
Subject: Re: [PHP] How to duplicate this functionality?

On Fri, 2004-05-14 at 21:23, Ryan A wrote:
> Hi,
> I just visited a popular swedish based site that is mostly powered via
ASP,
> they have one little piece of functionality this is really puzzling me and
I
> would like to add it to one of my working apps (a shopping cart)...
> 
> Its a bit hard to explain so will give you the steps so you can go to the
> site and see for yourself...Its all pretty much written in swedish but
will
> try to explain.
> 
> 1. go to http://www.blocket.se/
> 2. on the right side of the screen there are some numbers (1 to 23) and
next
> to each number is a Swedish city...click on any one of them.
> 3. You should be presented by a lot of "text ads"...click on any one of
them
> to open them (the ones with teh little camera symbol at the side will also
> display a pic of the product)
> 4.Scroll to the bottom of any ad and you should see " Spara i
> Annonsbevakningen " which roughly translates to "save this ad"...click it.
> It will save the ad for you (via cookies most probably..dont know for
> sure...but I visited much later and even after I closed->reopened my
browser
> and revisited the site,it was still there)
> 5.Click the back button a few times so that you can save a bunch of
> ads...then
> 
> This is the part I like, when you click on "Ta bort" next to any of your
> saved ads ("Ta bort" means "Remove")...it just goes from the page...very
> smooth and does not need for the page to be "script processed" again or
> anything...HOW? What is it? Javascript..? DHTML? what?

In linux under Netscape 7 and Opera 7.2 it reloaded the page :/ That
said looking at the URL when the mouse is over the link:

    http://www.blocket.se/new?caller=ogl_s&l=0&rm_id=2595475&city=0

The rm_id is being set as a GET variable with an appropriate ID to
remove the entry. So when the page reloads it first deletes the entry.
This is standard functionality in many websites.

Cheers,
Rob.
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

-- 
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

Reply via email to