Jump to content

shoaibi

Members
  • Posts

    21
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

shoaibi's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hmmm well i am a mediocre kindda programer of PHP as of yet and work on hit and trial basis. So i created a script which hides the actual location of the file i.e. an anti leech script, though it may not be perfect, and i was using readfil() function to allow users to download files. But it took to much time for files greater then 2MB. so i created another function, infact copied from a place and modified it as i needed which is provided as below. [code] function readfile_chunked ($filename) { $chunksize = 50*(1024*1024); // how many bytes per chunk $buffer = ''; $handle = fopen($filename, 'rb'); if ($handle === false) { return false; } while (!feof($handle)) { $buffer = fread($handle, $chunksize); print $buffer; } return fclose($handle); } [/code] So now the problem is that files upto 100MB can be handled easily while files with 172,700MB or 2GB size aren't handles as fast as they should be. Infact i am creating an anime download site and for that i wanna make the script fastest. Any suggestions?
  2. i need almost same features as that of Download Sentinel located at this link: http://dsplus.sourceforge.net/ I downloaded the latest Download sentinel from the site, First i wanna check it on my own PC and then upload it to the server. I am using XAMPP. i extracted all the files and placed them in the htdocs folders such that now the structure is: htdocs/dsplus htdocs/ds_files Now when i try to run the installation by doing this: http://localhost/dsplus/install.php or even by trying this to see the pic: http://localhost/dsplus/plus.gif i get this error: Server error! The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script. If you think this is a server error, please contact the webmaster. Error 500 localhost 08/30/06 19:59:43 Apache/2.2.2 (Win32) DAV/2 mod_ssl/2.2.2 OpenSSL/0.9.8b mod_autoindex_color PHP/5.1.4 ================================================== =================================== Whereas there is another folder called images, and there when i try to access a file like this: http://localhost/images/imgtest.html or even directly http://localhost/images/main.gif the expected content is show there...... any idea what's happening? So now i wanna try so other good content protection script, can anybody give a link to free script?
  3. Please copy these codes first and then read afterwards: home.php [code] <?php session_start(); if($_SESSION['loggedin']==1) $showlogin=0; else $showlogin=1; include_once "./login.php"; ?> <title>Welcome to MySite</title> <style type="text/css"> body { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; color:#C4B2B2; cursor:crosshair;   scrollbar-arrow-color: #2C3A5D;   scrollbar-track-color: #19181E;   scrollbar-face-color: #19181E;   scrollbar-highlight-color: #47272C;   scrollbar-3dlight-color: #19181E;   scrollbar-darkshadow-color: #19181E;   scrollbar-shadow-color: #47272C;} table { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px} .menu {font-family: Geneva, Arial, Helvetica, san-serif;         font-size:12px; color:#C4B2B2;         text-align:center;         background-image:url('images/linkback.jpg'); border: #323951; border-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px } A:link, a:visited, a:active {color: #C4B2B2; text-decoration: none;} A:hover{color:#C4B2B2;text-decoration:underline} </style> <body bgcolor=#FFFFFF background="images/background.jpg"> <img border="0" src="images/mainimage.jpg" style="position:absolute; left:0; top:0; width=765; height=600;"> </div> <div id="navigation" style="position:absolute; left:16px; top:145px; width:197px; height: 290px;"> <center> <p class="menu">Navigation</p></center> <!----- This is navigation menu, add links---> <center> <p class="menu">User's Menu</p></center> <?php if ($showlogin==0) {           //Welcome user, show PMs, give link to Control panel and options etc etc         } else { echo "Welcome Guest! <BR>Please Login Below<BR>"; loginform(); echo "<BR><BR><BR>"; } ?> <center> <BR><BR> </div> <div id="navigation2" style="position:absolute; left:239px; top:367px; width:156px; height: 286px;"> </div> <div id="content" style="position:absolute; left:414px; top:564px; width:338px; height: 350px;"> <center><p class="menu">Updates</p></center> <br><br> </div> </body> [/code] login.php [code] <?php ob_start(); session_start(); function loginform() { ?> <FORM METHOD="POST" ACTION="login.php"> <input type="hidden" name="action" value="ausr">             &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ID&nbsp;&nbsp;<INPUT TYPE="TEXT" NAME="id" SIZE="8" style="color: #460046; font: 11px Verdana; background-color: #FFFFFF; border-width: 1; border-color: #000000; border-style: solid;"><BR>         Password&nbsp;&nbsp;<INPUT TYPE="PASSWORD" NAME="pwd" SIZE="15" style="color: #460046; font: 11px Verdana; background-color: #FFFFFF; border-width: 1; border-color: #000000; border-style: solid;"> <center><INPUT TYPE="SUBMIT" VALUE="LOGIN" style="color: white; font-family: verdana; font-size: 8pt; font-weight: bold;border-color: red; border-width: 1px;background-color: black;"></center>         </FORM>   &#xA7; <a href="forgotpassword.php">Forgot UserID/Password?</a> <br>   &#xA7; <a href="register.php" >New?</a> <br>     &#xA7; <a href="sendvcode.php" >NO Verification Email?</a> <br> <?php } function authuser($id, $pwd) {   global $user; db_connect(); $query = "SELECT * FROM $user                             WHERE id = '$id'";   $result = mysql_query($query);   if(!mysql_num_rows($result)) return 0;   else   {   $arr=mysql_fetch_array($result);   if($pwd!=$arr['pwd']) return 1;   else if ($arr['status']==0) return 2;   else return 5; } } if($_POST['action']=="ausr") { $name = authuser($_POST['id'], $_POST['pwd']);   if($name==0 OR $name==1 OR $name==2) {       echo "<h1>Authorization failed.</h1> ";       if($name==2)       { echo "<BR>Ooops! Your account isn't verified as of yet.<BR>".         "<A HREF=\"verify.php\">Click Here</A> to verify your email address.<BR>".                                                   "If you haven't recieved any Verification email <A HREF=\"sendvcode.php\">Click here</A><BR>"; exit; } else if($name==0) echo "<BR>Ooops! Your provided UserID doesn't even exits!<BR>" ; else echo "<BR>Ooops! Your password isn't correct!<BR>"; echo "Click on the following link to try again.<BR>\n";       echo "<A HREF=\"login.php\">Login</A><BR>";       echo "If you're not a member yet, click " .           "on the following link to register.<BR>\n";       echo "<A HREF=\"$register_script\">Membership</A>";       exit;   }   else {     $usr=$_POST['id'];   $pwd=$_POST['pwd'];   $_SESSION['loggedin']=1;   $_SESSION['usr']=$usr;   $_SESSION['pwd']=$pwd;   header("Refresh: 5; URL=home.php");   echo "<center> Welcome back ";   echo $_SESSION['usr']."<BR> Please wait while you are redirected.<BR>".   "You are being redirected to Homepage in 5 seconds";       exit;   }   } ?> [/code] The problem is: if i include login.php and try to visit home.php the page comes as blank, while if i visit login.php with a direct function call to login form then it goes well and good. What to do?
  4. nope that's not the case, i am not dumb enough to leakout my actual code like this even if just a inch of it ;), just wanna be more secure
  5. [quote author=mastermike707 link=topic=102670.msg407874#msg407874 date=1154501497] [quote]//login.php ob_start(); SESSOIN_START();[/quote] I think the misspelling of SESSION_START() might have something to do with it. [/quote] That's the problem you found here, but in the actuall code its not.... ;)
  6. [quote author=ryen link=topic=102679.msg407869#msg407869 date=1154501246] HERE: http://www.phptutorial.info/iptocountry/identification_of_specific_countries.html [/quote] [color=red] [size=10pt][size=10pt][size=10pt][size=10pt][size=10pt][size=10pt][u][b]NOTE: Sorry got the answer!!!!!![/b][/u][/size][/size][/size][/size][/size][/size][/color] and that's for to respond in a certain why, suppose that i want to repond to US only and Display a meesage showing that your ip is not allowed to visit then i would have to download the US database as well as others? Or i can downlaod US one and then set a if else check?
  7. Thanks manmadareddy and ryen though ryen seemed to be more accurate ;) See you all later when i will have problem regarding these ;)
  8. [quote author=redarrow link=topic=102670.msg407861#msg407861 date=1154500935] what about using POST['varable_names']; [/quote] sorry redarrow but if i had to come back to the POST and why did i used sessions, the only thing i wanted was that more secure, more reliable. and also easy, POST won't be easy as i don't thing except then the form you cna use POST to transfer information from one place to other.
  9. [quote author=BillyBoB link=topic=102679.msg407862#msg407862 date=1154500944] can i ask why you want to ban all people except for a few countries i dont really know how to ban all except a few tho [/quote] Well nothing much, except that its a site meant only for those people. and then also i wanna save bandwidth. think of it as a download site which it actually is, but thought the material posted is neither copyrighted nor offensive, but its just meant for the people of those countries, i.e. those who support me,
  10. [quote author=BillyBoB link=topic=102679.msg407857#msg407857 date=1154500746] um i dont really get your question but are u trying to ban ips from ur whole site if so are you using php and mysql (you dont need mysql but php) ? [/quote] I want to ban all ips from my whole site except then a few countries specified....
  11. [quote author=redarrow link=topic=102670.msg407854#msg407854 date=1154500446] what in these then require("inc.php"); include_once "./cmndb.php"; include_once "./pm.php"; somethink must be dragging it down. [/quote] cmndb is a file as the name points common database, it gives connects to database for the profile information retrieval, and pm.php is a file containg function to read pm, delete, compose and etc... nothing much, even tried deleting these files or commenting these lines of code,
  12. [quote author=redarrow link=topic=102670.msg407852#msg407852 date=1154500267] main has not got it. [/quote] main has included the inc.php thus it also have got it. and evne if i write, nothing much happens as the code as soon as it read the inc.php it gets redirected to the login page as there isn't any session that exists while inc.php
  13. [quote author=redarrow link=topic=102670.msg407850#msg407850 date=1154499915] every page got to have the <? session_start(); on it. [/quote] as you can see the code segments that i attached in the first post do have that, don't they?
  14. Okay look at me, i am a newbie, not quite one, but still one of the beginners, i know about .htacess and all that. I wanna allow one one country people to view my site. You people tell me what's the best and cheapest method to do that. And is there a place from where i can get the ip ranges so that i cna do something like that: allow Tha.tIP.Ra.n.ge deny all ???
  15. [quote author=upuaut link=topic=102646.msg407838#msg407838 date=1154497854] sorry, turns out i'm running mysql 4.0.24-standard [/quote] i really have no idea what's happening. Then why do you ahve to use it from prompt, can't you just use the script?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.