Jump to content

taith

Members
  • Posts

    1,514
  • Joined

  • Last visited

Everything posted by taith

  1. in its truest form... ajax is javascript... just a different extension of it... ajax turns on the image, does the php query, hides the image...
  2. as php is only server sided scripting, the "only" way of doing that, would be via ajax
  3. yup... iframes are completly seperate from the originating page... only 4 ways of passing info from one page to another... $_POST... if you create a form, with a target of that frame... $_GET... where you ?var=$var;... $_SESSION... and cookies...
  4. um... the only way of never running out of space, is never running out of money to buy more space ;-) one of the perks of being last years most popular page ;-)
  5. personally... i suggest you learn and master the basics of php... before you start to build long-winded codes... once you can do the small things perfectly... then you can do the big things perfectly... you cant expect everyone else to do your work forever... no offence intended
  6. yup! mine was just to show ya how... once the files are hidden... you need to know where to find them, in order to steal em... so put em in a safe place /azaewr/ab5nsj478sn.txt for example :-)
  7. just to give ya an idea ;-) basically, on upload, it scrambles the url to any of a billion+ possibilities... and on download, it switches it back to the original :-) a) on upload... $target_path = "files/"; $ext=get_filetype(basename($_FILES['uploadedfile']['name'])); $realpath = $target_path.randomkeys(rand(10,40)).$ext; $path = $target_path . basename( $_FILES['uploadedfile']['name']); if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $realpath)){ $date=date(z); mysql_query("INSERT INTO im_files (`uid1`, `uid2`, `path`, `date`, `realpath`) VALUES('$id','$key','$path','$date','$realpath')"); $text=popup('`6'.get_username($id).' has added files',"files.php?op=viewall&key=$key"); $seconds=get_seconds(); $text = addslashes($text); mysql_query("INSERT INTO im_messages (`text`, `uid1`, `uid2`, `date`, `time`, `from`) VALUES('$text', '$id', '$key','$date','$seconds','0')") or die(mysql_error()); echo '<script language="JavaScript">setTimeout("close()",0);</script>'; exit; } b) on download $fid=$_GET[id]; $result=mysql_query("SELECT * FROM im_files WHERE `id`='$fid' LIMIT 1") or die(mysql_error()); $row=mysql_fetch_array($result); if($row[uid2]==$id){ $filename = $row[realpath]; $filename = realpath($filename); $file_extension = strtolower(substr(strrchr($filename,"."),1)); switch($file_extension){ case "pdf": $ctype="application/pdf"; break; case "exe": $ctype="application/octet-stream"; break; case "zip": $ctype="application/zip"; break; case "doc": $ctype="application/msword"; break; case "xls": $ctype="application/vnd.ms-excel"; break; case "ppt": $ctype="application/vnd.ms-powerpoint"; break; case "gif": $ctype="image/gif"; break; case "png": $ctype="image/png"; break; case "jpe": case "jpeg": case "jpg": $ctype="image/jpg"; break; default: $ctype="application/force-download"; } if(!file_exists($filename)){ mysql_query("DELETE FROM im_files WHERE `id`='$fid'") or die(mysql_error()); die('<script language="JavaScript">setTimeout("close()",0);</script>'); } header("Pragma: public"); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Cache-Control: private",false); header("Content-Type: $ctype"); header("Content-Disposition: attachment; filename=\"".basename($row[path])."\";"); header("Content-Transfer-Encoding: binary"); header("Content-Length: ".@filesize($filename)); @set_time_limit(0); @readfile("$filename") or die("File not found."); $result=mysql_query("SELECT * FROM im_files WHERE `path`='$row[path]' AND `uid2`='$id'") or die(mysql_error()); while($row=mysql_fetch_array($result)){ unlink($row[realpath]); mysql_query("DELETE FROM im_files WHERE `id`='$row[id]'") or die(mysql_error()); } } die('<script language="JavaScript">setTimeout("close()",0);</script>');
  8. just put a session counter... $_SESSION[logincounter]++; onto your login script... then on your loginsript say if($_SESSION[logincounter]>10) die('FIND SOMETHING BETTER TO DO!');
  9. again... echo "Klikk . "<a href="" . $user_name . "/" . $imgupload['name'] . " target="_blank">her</a>" . "for å se bildet ditt.";
  10. if($user_class != "Moderator" && $user_class != "Administrator") {
  11. install apache http://www.apachefriends.org/en/xampp.html that way no host, and you use it just like html files(GO NOTEPAD!)
  12. $dif=time()-$_SESSION[signedintime]; $hours=0; while($dif>=3600){ $hours++; $dif-=3600; } $minutes=0; while($dif>=60){ $minutes++; $dif-=60; } echo "You have been online for $hours hours, $minutes minutes and $dif seconds";
  13. $_SESSION[signedintime]=time(); #put me on login page $dif=time()-$_SESSION[signedintime]; while($dif>=60){ $minutes++; $dif-=60; } then just continue on for hours, days, weeks, monts... whatever :-)
  14. taith

    IPV6

    as of yet... i doubt it... not many computers are ipv6 compatable... vista, debian, mac... even then, it has to be supported by the isp... so i doubt it... but try print_r($_SERVER); see if its being forwarded via headers already...
  15. ya... but that would give me 1 of everything... i only want ones that are only in there once... if its more, scratch if off the list...
  16. taith

    <?= ??

    better practice maybe... but i prefer to work outside the box and its only better practice because php doesnt like <?php=$var?> lol
  17. ok... heres what i'm trying to do... 1) i have a database divinelive_messages table with a sessid column 2) i need to find out rows from the database, which only show that sessid in there once any ideas?
  18. i like the blind blocking idea... a) require them to sign up, b) put a filter on the email script, so they would never know the difference when you forward them to the "success" page
  19. no change... and yes... its for netscape...
  20. this still doesnt work... its not giving me any errors, so it is "working"... just not as its supposed to... :-( <s cript> function disablemouse(){ document.body.onselectstart=function(){return false;} document.body.onmousedown=function(){return false;} document.body.style.MozUserSelect="none"; } function enablemouse(loc){ loc.onselectstart=function(){return true;} loc.onmousedown=function(){return true;} return true; } window.onload=disablemouse; </s cript> <span onmouseover="javascript:enablemouse(this);">i dont work either</span>
  21. $admins = array(); $result = mysql_query("SELECT fname FROM users WHERE srank='Admin'"); while($row = mysql_fetch_array($result)) { array_push($admins, $row['fname']); } foreach ($admins as $key=>$val){ $sql = "INSERT INTO pms (pmid,to_name,from_name,time_sent,subject,message,opened) VALUES ('', '$val', '$from_name', '$time_sent', '$subject', '$message', 'n')"; $result = mysql_query($sql) or die ('I could not add information to the database because ' . mysql_error()); }
  22. easiest if you use a database... but thats your choice... $username = "someuser"; $password = "somepassword"; $username2 = "someotheruser"; $password2 = "someotherpassword"; if(($_POST['txtUsername']==$username&&$_POST['txtPassword']==$password)||($_POST['txtUsername']==$username2&&$_POST['txtPassword']==$password2)) {
  23. on your database, put a `key` field, with a random based string... and a `activated` field, so when you send them an email, it has a link with that random based string, goes to the database, and activates the account with that key :-)
×
×
  • 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.