Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff
Author Message
drjackal
New Member
New Member



Joined: Dec 14, 2004
Posts: 2

PostPosted: Tue Dec 21, 2004 4:05 am Reply with quote

i having some difficulty with this scripts...
somehow whenever i clicked the download link ... i jumped to mainpage

can someone help me here ?
------------------------------------
function getit($lid){
//add a new line of code for each $lid to block for registered users only
$lidArray[]=intval;

global $prefix,$dbi,$user,$admin;
if(!is_user($user)&&in_array($$lidarray)&&!is_admin($admin)){
$pagetitle="-"._ACCESSDENIED."";
include("header.php");
title("$sitename:"._ACCESSDENIED."");
opentable();
echo"<center<b>"._RESTRICTEDAREA."</b><br><br>"
.""._MODULEUSERS.""
.""._GOBACK."";
closetable();
include("footer.php");
die();
}
sql_query("update".$prefix."downloads_downloads set hits=hits+1
WHERE lid=$lid",$dbi);
$result=sql_query("SELECT url FROM ".$prefix."_downloads_downloads WHERE lid_$lid",$dbi);
Header("Location:$url");
}

//function getit($lid) {
//global $prefix,$dbi;
//$lid=intval($lid);
//$hits=intval($hits);
//sql_query("update".$prefix."_downloads_downloads set hits=hits+1 WHERE lid=$lid",$dbi);
//update_points(17);
//$result = sql_query("SELECT url FROM ".$prefix."_downloads_downloads WHERE lid='$lid'",$dbi);
//list($url)=sql_fetch_row($result,$dbi);
//header("Location:$url");
//}
----------------------------
the one with "//" are original coding.

need help asap ...
i want to let members to download, but only have limited transfer bandwitdh ...dont want outsider leeching


thanks ^^
 
View user's profile Send private message Visit poster's website
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Tue Dec 21, 2004 5:33 am Reply with quote

You're not completing your sql. You select the row but have forgotten to 'fetch' it. Instead of
Code:
$result=sql_query("SELECT url FROM ".$prefix."_downloads_downloads WHERE lid_$lid",$dbi); 

Header("Location:$url");

Try
Code:
$result=sql_query("SELECT url FROM ".$prefix."_downloads_downloads WHERE lid_$lid",$dbi); 

list($url)=sql_fetch_row($result,$dbi); 
Header("Location:$url");
die();
 
View user's profile Send private message
drjackal







PostPosted: Mon Dec 27, 2004 4:03 am Reply with quote

somehow .. is not working ....
is the 3rd row correct ?
------------------------
$lidArray[]=intval;
-----------------------
 
Raven







PostPosted: Mon Dec 27, 2004 5:03 am Reply with quote

I can't see how it could be.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff

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
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©