With that code, the first time I clicked the approve link it actually pulled it all, every time after that it would only pull the $type value.
I mess around with it some more, looking over vairous pages of code and threw together this and so far its working, although I am not sure that it is correctly written.
Code:
function SAffiliatesAprove($afid, $name, $url, $description, $image, $hits, $type, $email) {
global $prefix, $dbi;
$result = sql_query("select name, url, description, image, hits, type from ".$prefix."_affiliates_validate", $dbi);
while(list($name, $url, $description, $image, $hits, $type) = sql_fetch_row($result, $dbi))
sql_query("insert into ".$prefix."_affiliates values(NULL, '$name', '$url', '$description', '$image', '$hits', '$type')", $dbi);
sql_query("delete from ".$prefix."_affiliates_validate where afid='$afid'", $dbi);
Header("Location: admin.php?op=AffiliatesAdmin");
}
So to sum it up, I have a link set to "Approve" and when called on it reads the values in the affiliates_validate table, and then writes them to the affiliates table, and then drops the original line in the affiliates_validate table. Does this look proper to you?
Joined: Aug 27, 2002 Posts: 16987 Location: Kansas
Posted:
Fri Mar 19, 2004 4:08 pm
Well, I would offer up 2 suggestions. First of all I would not delete w/o checking for a successful insert and secondly, add an exit(); statement after the header statement.
View next topic View previous topic
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum