Click to See Complete Forum and Search --> : How do I auto update without form


Parabola
03-02-2007, 03:12 AM
Hi there,

I am trying to run a counter so when a person clicks on a banner, it updates the db with a new number.
I have called the banner link: ad_counter.php?id=1
I have a field in my table called ad_counter

Then im setting a recordset to GET the data.
I am using:

$last = $row_Recordset1['ad_counter'];
$add = 1;
$ad_counter = $last + $add;

What I want to do is auto form fill and update the database, and proceed to their website without this process even being seen.

Is this possible without having a form?
A basic statistics gatherer for businesses who wish to advertise.

Thankyou

ava
03-02-2007, 07:24 AM
I would probably use an Ajax script.
The user clicks on the banner, which calls a php script using Ajax, which updates the database. All without bothering the user with extra windows.

Zipline
03-02-2007, 10:55 AM
You don’t need a form you can just use a script to update the database on click. My guess is Ajax is probably going to be far too complicated for what you’re trying to achieve. All you really need to do is write a query to grab the current total of clicks for that URL/ID then add one and update the database then user header() to send the user to the correct URL.

theuedimaster
03-03-2007, 02:43 AM
Easiest way is to send user to a transition page where the database is updated. Then use a header like Zipline suggested.