Originally posted by Jordan
Yeah, it would be interesting, but I don't know if it would be interesting enough to do all of the work to get it working!![]()
if($replytype == "express")
{
$typetracked = mysql_query("UPDATE Posttracker SET Express = Express +1");
}
elseif($replytype == "post")
{
$typetracked = mysql_query("UPDATE Posttracker SET Post = Post +1");
}
else
{
$typetracked = mysql_query("UPDATE Posttracker SET Notrack = Notrack +1");
}
Originally posted by Jordan
You're quite a developer, Giles!![]()
Unbelievable....Originally posted by GilesGuthrie
Meh, that would be quite easy! Assuming that both ways use the same form handler to actually write the post:
Create a new table "Posttracker" in MySQL:
Express: Bigint
Post: Bigint
Notrack: Bigint
Then put a hidden field in each form:
<input type="hidden" name="replytype" value="express">
or
<input type="hidden" name="replytype" value="post">
Then in the form handler:
PHP:if($replytype == "express") { $typetracked = mysql_query("UPDATE Posttracker SET Express = Express +1"); } elseif($replytype == "post") { $typetracked = mysql_query("UPDATE Posttracker SET Post = Post +1"); } else { $typetracked = mysql_query("UPDATE Posttracker SET Notrack = Notrack +1"); }
If different form handlers are used, you wouldn't need to worry about the if...elseif...else system, you'd just do the if...else to test for the relevant method for the form handler.
I do this sort of thing quite often for usage tracking.