Jump to content

Stooney

Members
  • Posts

    1,093
  • Joined

  • Last visited

Everything posted by Stooney

  1. So I've been working on a file hosting site.  Now each account has a limited amount of storage space, but how would I go about limiting how much bandwidth the account can use?  The upload files are publicly accessible, so is there a way to monitor say a specific folder and keep track of how much bandwidth it is using?  (outside of my hosts logs, so I can limit their bandwidth via my own scripts)
  2. thats not so easy, you would have to edit all the scripts to use the same session variables and the same users database.
  3. try mysql_query() and not query() maybe
  4. say hello to explode() [code] $part1=""; $text="all the words"; $text2=explode(" ", $text); for($i=0; $i<200; $i++)        //to get the first 200 words {       $part1.=$text2[$i]. " ";  //adds the next word to part 1 with a space after each word. } $num=count($text2); for($i=200; $i<=$num; $i++) {       $part2.=$text2[$i]. " "; } [/code] that will leave part1 with the first 200 words, and part2 with whatever else was left.  At least I think, and hope.
  5. hmmm...i see what your saying maybe something like this... [code] if(!isset($frameID)) {       header("Location:  http://address.com?frameID=1"); } [/code] or if you have other variable you wanna keep in there:  (assuming var1 and var2 are already set) [code] if(!isset($frameID)) {       $url="http://address.com?var1=".$var1."&var2=".var2."&frameID=1";       header("Location:  $url"); } [/code] im pretty sure that the "header("Location:  $url");"  should work (unsure about variable inside there).  Hope that helped. Also, just thought of this, if you just need the variable set for the page and not in the address: [code] if(!isset($frameID)) {       $frameID=1; } [/code]
  6. Its not the login that im having issues with.  Its restricting access to certain folders, like sam only has access to the 'users/sam' folder when logged in.  If your not logged in all directories are not accessible.
  7. you have [code]$result = mysql_query('SELECT * FROM blogs WHERE Name=sada');[/code] try [code]$result = @mysql_query("SELECT * FROM blogs WHERE Name='sada'");[/code] Also, might try checking that your table name is 'Name', might be 'name'.
  8. This might help a bit, its as simple a way as i can think of. //form <form action="login.php" method="post"> <input type="text" name="username"> <input type="password" pass="password"> <input type="submit" value="Log In"> </form> //log in $sql = @mysql_query("SELECT * FROM plateau_pros WHERE username='$username'"); I promise that works, $username will be set properly and the query will work.  Of course there no form validation or anything else in there, but try to just build off of it.
  9. well like i said, a simple mysql query can have whatever you want in the db, in there.  (gotta have a database of course) 
  10. As far as uploading files goes, I highly suggest reading this.  http://us3.php.net/features.file-upload Its has everything you need to know for uploading the files. Not quite sure what you meant by 'submit it into a db', im assuming you want the users data (name, etc) in the db.  Thats just a simple mysql query (ex. "insert into users (name, email, age) values ('$name', '$email', '$age')").  Hope it helps
  11. Its possible.  ex: function check() {     //checks stuff     //if(all is ok){  make_account($user, $pass); } } function make_account($user, $pass) {     //makes account } you can call function from function from function over and over.  :D
  12. What is the best way to go about protected directories?  What I'm trying to do is this: -User Registers     -info stored in mysql database     -a new directory is created (named his username) under the 'members' directory     -can upload files to the directory I have all that working, no sweat.  Now what I want is for all the directories to be password protected, meaning you can only access a folder by logging into the corresponding account.  I've tried .htaccess, but thats not quite the way I'm trying to go about it.  I want 1 login and they're in their account and have access to their folder.  I guess you could look at it like a photobucket, only the pictures aren't open to the public.  Any help/ideas would be appreciated.  Thanks
×
×
  • 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.