I am creating an classifieds section for the newspaper that I work for. I am able to get the ads to display and search them.

I want to add a few features:
Save ad
Print ad
E-mail ad

Does anyone know how to do the Save Ad feature?

Basically you would just checkmark the ad and then be able to view all of the saved ads that you selected, much like the way it's done on this site: http://www.nj.com/classifieds/

I've been trying to find a javascript or something that would make this work but am unable to find one.

Any help is appreciated!

Thanks!

Recommended Answers

All 3 Replies

Dthatsme33,

You say you can "get the adds" but also that you want to be able to save them.

I'm probably being thick, but this doesn't make sense. If the ads are not yet saved, then how do you "get" them and where from?

Airshow

The ads are already in the database. That's where I'm pulling them from. I want the viewer to just be able to save the ads, kind of like how a shopping cart would work. Does that make more sense?

I'm pretty sure I need to do this using cookies but I'm not sure how to script it. I haven't been able to find one that I can use.

OK, it's a users' "Remember this" function.

It's too late in the day here to start thinking about code, but here are some high level considerations.

First thing to decide the timespan the ads need to be remembered.

If it's just for the session, then you can set session variable(s), which will be available to all pages within the user-session.

If it's to span sessions then use database entry if you already have a user login system (or feel the need to install one), or cookie if you don't.

At this stage, you also need to consider the deletion rules. Presumably it's only relevant to remember a particular classified while it is still alive. Therefore you will probably want a mechanism for reviewing users' choices and removing those that relate to expired ads.

I'm tired and fading fast - so I hope that all makes sense.

Airshow

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.