Jump to content

lewis987

Members
  • Posts

    214
  • Joined

  • Last visited

    Never

Everything posted by lewis987

  1. grr... cant edit again... anyway new address: New link *press "Refresh" on load otherwise it wont work... damned ads...
  2. aight... sorry but i cant keep my PC on 24/7 and getting a server isnt an option at the minute, got too mucht o pay for... literally... and ill keep it online for as long as possible! il see if i caN set up some free hosting for the time being...
  3. aight... i dunno what the problem with the register script is... ill take a look... and i just deleted the user "test"... so thats the reason you got kicked from it //Edit: Can't find any error of the register script here. Very strange... Do you get the login box???
  4. Damn, cant edit... anyway... im not going to post code as there is over 8 different pages of code! so if there is a problem with something, just say here an i will make it perfect... well... try to anyway
  5. Aight... i have been coding this for a short while... (well about 2 weeks)... like the title says... its just another shoutbox... but its got a difference... im not gonna spoil it so take a look: Here ya go Please do all the normal XSS and SQL injection hacks you can think of so i can try and stop them... yes the colors need sorting but that will be the last thing on the adgender... thanks for testing it! (if you do..)
  6. <input value="<?php echo $display_date_written; ?>" name="date_written" type="text" class="text_background" id="date_written" size="10" maxlength="10" readonly="true" /> no need for javascript as you can see... there is an atribute for input fields to be readonly
  7. then again... you are only 14... and im 18... well nearly... but ive been doing php for almost a year... and jsut started to learn javascript... so yea... just tell me if thats all you needed to know likwidmonster. Due to the fact that it did give you an error, kinda makes it obvious that php is enabled. so just install any php script. and you domain will probably have MySQL aswell... so have a look into that and see what you can really achieve
  8. This code is all ok (by craygo) apart from the HTML part. Ive corrected it below for you: (I assume that the code is going to be included into another page, or this is just a fraction of the code) <?php // open database connection $connection = mysql_connect($db_host, $db_user, $db_passwd) or die ("Unable to connect!"); // select database mysql_select_db($db_name) or die ("Unable to select database!"); if(isset($_POST['submit'])){ // Get ID $id=mysql_real_esacpe_string($_POST['select']); // generate and execute query $query = "DELETE FROM upload WHERE id = '{$id}'"; $result = @mysql_query($query); if($result){ echo "Delete Successfull<br />"; } else { die ("Error in query: $query. " . mysql_error()."<br />"); } // close database connection mysql_close($connection); // print result echo "<font size=-1><a href=update.php>Go back to the main page</a></font>"; } else { //show form //AND EXECUTE QUERY TO GET ALL THE ID's IN THE DATABASE: $SQL = "SELECT * FROM `upload` ORDER BY `id` ASC"; $Q = mysql_query($SQL) echo('<form action="'.$_SERVER['PHP_SELF'].'" method="POST" enctype="multipart/form-data" name="delete">'); echo('<p align="center"> </p> <p>'); if(mysql_num_rows($Q) > 0){ echo('<select name="select" id="3"> <option>Update</option>'); while($DATA = mysql_fetch_assoc($Q){ echo('<option value="'.$DATA['id'].'">'.$DATA['id'].'</option>'); } echo('</select>'); }else{ echo('There are no records in the database!'); } echo(' </p> <p align="center"> <input type="submit" name="Submit" id="Submit" value="Submit"> </p> </form>'); } ?>
  9. HAHA... this has literally made me laugh!!! anyway... the problem with the code, if no-one else hasn't already noticed, it says: <?PHP echo "PHP is working; ?> That is wrong, it is meant to be: <?PHP echo "PHP is working"; ?> You MUST close ALL quotes (" OR ') otherwise you will get stupid (really stupid) errors. But go ahead and try the correct code in this post and, since it has given you an error, PHP IS WORKING!
  10. Aight, i coded up a shoutbox with ajax (maybe dhtml aswell) and php, myself... no prototype crap... but it intergates a register system. And its the register javascript thats not working for me. Pretty much the whole thing is AJAX and works in Safari, Opera, and firefox (i hope it works in firefox anyway). But, back to the subject, when i attempt to register in IE, it fails, Something about "Member not found", I dunno how this works, but every other browser works fine. so here is the scripts: Register.php (gets included with php hence the if defined): <?PHP if(defined("SCRIPT")){ //Generate random string: $CHARS = array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'); $LIMIT = 6; for($i = 0; $i <= $LIMIT; $i++){ $RAND = rand(0, count($CHARS)); $SECURITY .= $CHARS[$RAND]; $SECURITY2 .= $CHARS[$RAND]." "; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Register</title> <script language="javascript" type="text/javascript" src="script2.js"> </script> </head> <body> <div id="body"> <h2>Register to _drw_shoutbox</h2><br /> <br /> <br /> <form action="?act=reg" method="post" onsubmit="reg(document.getElementById('usr').value, document.getElementById('usrsucc').value, document.getElementById('pwd').value, document.getElementById('pwdsucc').value, document.getElementById('codesucc').value)"> <div id="usrname"> Username:<br /> <input name="usr" type="text" onkeyup="regUsername(this.value)" id="usr" size="20" maxlength="35" /> </div> <div id="usrname2"> </div> <input type="hidden" id="usrsucc" value="2" /> <br /> <div id="password"> Password:<br /> <input name="pwd" type="password" onkeyup="regPassword(this.value)" id="pwd" size="20" maxlength="35" /> </div> <div id="password2"> </div> <input type="hidden" id="pwdsucc" value="2" /> <br /> <!-- Security stuff here --> <div id="sec1" style="width: 400px;"> Security Code:<br /> Enter: " <?PHP echo $SECURITY2; ?> " into the box below <br /> (without the spaces and quotes):<br /> <input type="text" name="secur" onkeyup="security(this.value ,'<?PHP echo $SECURITY ?>')" size="20" maxlength="<?PHP echo $LIMIT * 2; ?>" /> </div> <div id="sec2"> </div> <input type="hidden" id="codesucc" value="2" /> <br /> <input name="regi" id="regi" type="button" value="Register" onclick="reg(document.getElementById('usr').value, document.getElementById('usrsucc').value, document.getElementById('pwd').value, document.getElementById('pwdsucc').value, document.getElementById('codesucc').value);" /> </form> </div> </body> </html> <?PHP }else{ echo "Error"; } ?> script2.js (the trouble): // JavaScript Document function createRequestObject() { var xmlHttp; var work; try { work2 = 'Internet Explorer'; xmlReq = new ActiveXObject("Msxml2.XMLHTTP"); work = 1; } catch (e) { try { xmlReq = new ActiveXObject("Microsoft.XMLHTTP"); work = 1; } catch (e) { try { work2 = 'Firefox, Opera 8.0+, Safari'; xmlReq = new XMLHttpRequest(); work = 1; } catch (e) { work = 2; } } } if(work == 1){ return xmlReq; }else{ alert("Your browser does not support AJAX!"); } } // Set all variables here var http = createRequestObject(); function regUsername(username){ http.onreadystatechange = function(){ if(http.readyState == 4 && http.status == 200){ var response = http.responseText; if(response) { if(response == 1){ }else if(response == 2){ document.getElementById('usrsucc').value = 1; document.getElementById('usrname').style = 'background-color: #afa; border-top: #0f0 thin solid; width: 400px; border-left: #0f0 thin solid; width: 400px; border-right: #0f0 thin solid; width: 400px;'; document.getElementById('usrname2').innerHTML = 'Username: "'+username+'" is avaiable!'; document.getElementById('usrname2').style = 'background-color: #afa; border-bottom: #0f0 thin solid; width: 400px; border-left: #0f0 thin solid; width: 400px; border-right: #0f0 thin solid; width: 400px;' }else{ document.getElementById('usrname').style = 'background-color: #faa; border-top: #f00 thin solid; width: 400px; border-left: #f00 thin solid; width: 400px; border-right: #f00 thin solid; width: 400px;'; if(response == 3){ document.getElementById('usrsucc').value = 2; document.getElementById('usrname2').innerHTML = 'Username: "'+username+'" isn\'t avaiable!'; document.getElementById('usrname2').style = 'background-color: #faa; border-bottom: #f00 thin solid; width: 400px; border-left: #f00 thin solid; width: 400px; border-right: #f00 thin solid; width: 400px;'; }else{ document.getElementById('usrsucc').value = 2; document.getElementById('usrname2').innerHTML = 'Username: "'+username+'" is too short!'; document.getElementById('usrname2').style = 'background-color: #faa; border-bottom: #f00 thin solid; width: 400px; border-left: #f00 thin solid; width: 400px; border-right: #f00 thin solid; width: 400px;'; } } } } } http.open('get', 'data.php?act=regUsername&name='+username, true); http.send(null); } function regPassword(password){ http.onreadystatechange = function(){ if(http.readyState == 4 && http.status == 200){ var response = http.responseText; if(response) { if(response == 1){ }else if(response == 2){ document.getElementById('pwdsucc').value = 1; document.getElementById('password').style = 'background-color: #afa; border-top: #0f0 thin solid; width: 400px; border-left: #0f0 thin solid; width: 400px; border-right: #0f0 thin solid; width: 400px;'; document.getElementById('password2').innerHTML = 'Password is OK!'; document.getElementById('password2').style = 'background-color: #afa; border-bottom: #0f0 thin solid; width: 400px; border-left: #0f0 thin solid; width: 400px; border-right: #0f0 thin solid; width: 400px;'; }else{ document.getElementById('pwdsucc').value = 2; document.getElementById('password').style = 'background-color: #faa; border-top: #f00 thin solid; width: 400px; border-left: #f00 thin solid; width: 400px; border-right: #f00 thin solid; width: 400px;'; document.getElementById('password2').innerHTML = 'Password too short!'; document.getElementById('password2').style = 'background-color: #faa; border-bottom: #f00 thin solid; width: 400px; border-left: #f00 thin solid; width: 400px; border-right: #f00 thin solid; width: 400px;'; } } } } http.open('get', 'data.php?act=regPassword&pwd='+password, true); http.send(null); } function security(entered, created){ http.onreadystatechange = function(){ if(http.readyState == 4 && http.status == 200){ var response = http.responseText; if(response) { if(response == 1){ }else if(response == 2){ document.getElementById('codesucc').value = 1; document.getElementById('sec1').style = 'background-color: #afa; border-top: #0f0 thin solid; width: 400px; border-left: #0f0 thin solid; width: 400px; border-right: #0f0 thin solid; width: 400px;'; document.getElementById('sec2').innerHTML = 'Code is OK!'; document.getElementById('sec2').style = 'border-right: #0f0 thin solid; width: 400px; border-left: #0f0 thin solid; width: 400px; border-bottom: #0f0 thin solid; width: 400px; background-color: #afa;'; }else{ document.getElementById('codesucc').value = 2; document.getElementById('sec1').style = 'background-color: #faa; border-top: #f00 thin solid; width: 400px; border-left: #f00 thin solid; width: 400px; border-right: #f00 thin solid; width: 400px;'; document.getElementById('sec2').innerHTML = 'Code is wrong!'; document.getElementById('sec2').style = 'background-color: #faa; border-bottom: #f00 thin solid; width: 400px; border-left: #f00 thin solid; width: 400px; border-right: #f00 thin solid; width: 400px;'; } } } } http.open('get', 'data.php?act=regCode&org='+created+'&cre='+entered, true); http.send(null); } function reg(usr, usrSuccessful, pwd, pwdSuccessful, codeSuccessful){ if(usrSuccessful == 1 && pwdSuccessful == 1 && codeSuccessful == 1){ http.onreadystatechange = function(){ if(http.readyState == 4 && http.status == 200){ var response = http.responseText; if(response) { if(response == 1){ alert('Error: Username and password are the same!'); }else if(response == 2){ alert("Error: Username or password is blank!"); }else if(response == 3){ alert("Error: Password too short!"); }else if(response == 4){ alert("Error: Username has been taken!"); }else if(response == 5){ alert("Error: Cannot insert data into database!"); }else if(response == 6){ document.getElementById('body').innerHTML = '<h2>Login</h2><br /><h3>Registered with the username: '+usr+'</h3><br/><form action="?act=login" method="post">Username: <input name="usr" id="usr" type="text" size="20" maxlength="100" /><br />password: <input name="pwd" id="pwd" type="password" size="20" maxlength="100" /><br /><input name="login" type="submit" onclick="this.value = \'Logging in...\'; document.title=\'Logging in...\';" value="Login" /><br /></form>'; }else{ } } } } http.open('get', 'data.php?act=reg&usr='+usr+'&pwd='+pwd, true); http.send(null); }else{ alert('Error'); } } Errors: When entering something in the username field, IE gives: Line: 62 char: 7 error: Member not found Code: 0 When entering something into the password field, IE gives: Line: 97 char: 7 error: Member not found Code: 0 And for the Security code field, IE gives: Line: 38 Char: 1 Error: Object doesnt support this action Code: 0 so can anyone give me more light on this?
  11. You need to set up the XML thingy first... I cant do everything in ajax (im just a beginner aswell) but i knowq a couple of things <html> <head> <title> AJAX TEST </title> <script language="javascript" type="text/javascript"> // JavaScript Document function createRequestObject() { var req; if(window.XMLHttpRequest){ // Firefox, Safari, Opera... req = new XMLHttpRequest(); } else if(window.ActiveXObject) { // Internet Explorer 5+ req = new ActiveXObject("Microsoft.XMLHTTP"); } else { // There is an error creating the object, // just as an old browser is being used. alert('Problem creating the XMLHttpRequest object'); } return req; } // Make the XMLHttpRequest object var http = createRequestObject(); function sendRequest(oldData, Column) { if(confirm('Message')){ // Open PHP script for requests http.onreadystatechange = function(){ if(http.readyState == 4 && http.status == 200){ // Text returned FROM the PHP script var response = http.responseText; if(response) { // UPDATE ajaxTest content document.getElementById('results').innerHTML = response; } } } http.open('get', 'data.php?oldData='+oldData+'&Column='+Column, true); http.send(null); }else{ document.getElementById("results").innerHTML = "Button clicked but not accepted"; } }</script> </head> <body> <div id="results"> BUTTON NOT CLICKED</div> <input name="aa" value="test" type="button" onClick="sendRequest('res','ults')"> </body> </html> data.php (where all the work will be done...) if($_GET['oldData'] != "" && $_GET['Column'] != ""){ echo("DATA is ".$_GET['oldData']." AND THE COLUMN is ".$_GET['Column']); }else{ echo("Invalid data recieved"); } Before you click on the button, you will see it says "BUTTON NOT CLICKED", when you click on it, you will get a conformation message. It is located in the sendRequest javascript function (if(confirm('Message')){) You can remove this however. Thats basically how it works... just copy the code and try it out. Oh and the data.php file can be renamed to whatever you want it to be (change 'data.php?oldData='+oldData+'&Column='+Column); to whatever you want). hopefully this helps you.
  12. Its the SQL you've used... $query = ("UPDATE $tbl_name SET Member_No = $memberno1 WHERE Time_Slot_No = '".$_GET["Time_Slot_No"]."' LIMIT 1"); Should be: $query = "UPDATE `".$tbl_name."` SET `Member_No` = '".$memberno1."' WHERE `Time_Slot_No` = '".$_GET["Time_Slot_No"]."' LIMIT 1";
  13. or you can explode the file name at the "." so your code would look like: <?php // some vars for the image // $image_file_name = $_FILES['image']['name']; $image_file_size = $_FILES['image']['size']; $image_file_temp = $_FILES['image']['tmp_name']; $image_file_type = $_FILES['image']['type']; // do an extension check before it goes to the function for resizing // // first check what the files extension is and lower case it // // This explodes the string at "."'s, then countsd how many "."s there are // // Then gives the file extension $explode = explode(".", $image_file_name); $count = count($explode) -1; // Remember and minus 1 from the count, as the var count will show one more than there should be. $file_extention = $explode[$count]; // if the file doesn't have the correct extension then reject // if($file_extention != "jpg" || $file_extention != "gif" || $file_extention != "png") { standard_error("Error","Your image file is not one of the allowed types only <b>.jpg</b> <b>.gif</b> and <b>.png</b> are allowed to be uploaded."); } ?>
  14. your trying to include a file under this: SITE_ROOT (Folder)/presentation/application.php Try: require_once("presentation/application.php"); instead..
  15. Well... if you want to implement AJAX then just give me a shout and ill help...
  16. YOu will need to use either: AJAX or javascript... it is pretty easy to use ajax... ill post up some code if you want, but you will need to supply me with the original code you have...
  17. lewis987

    Help

    ok... this is going to be hard to describe so bear with me... I have a script that im coding up for a friend (its been in development for over 6 months now) and now ive hit a dead end. Its basically "Bebo" but on php instead... So i want to allow users to edit their profiles... Which does happen, They can change whats enabled and whats not. The script i am currently coding is to allow users to change where everything is located on the profile. So the blog doesnt always have to sit in the same place. Everything is stored in a database, so i need to make a loop that works with the new and old places. Page LAYOUT: |--------| | HEADER | |--------| | 1 || 2 | | 3 || 4 | | 5 || 6 | | 7 || 8 | |--------| so say someone wants to move number 5 to number 2, i want to make the script move everything down one, instead of swapping 5 and 2 around. I mean, 5 -> 2, 2 -> 3, 3 -> 4, 4 -> 5. So everything is moved... i know i can do it the other way, which will do until i can get a solution. I will post code if you require it.
  18. Hi, newbie to javascript... i usually code PHP and wanting more interactivity in my project now... im making a messenger system in PHP, the recpient field is for suggestions, so onChange, it sends the info to the suggest.php file. The suggest script takes the query sent and sends back the info... if any... so if you enter a members name, eg: admin, it comes up admin as a clickable link. onClick, it changes the "to_msg" input field to the username. This works as intended, But, say i have 500+ names, its not very convient, so i though, after click to remove all the results out of the div, ive tried and tried and tried but its not working... If you need the code... ill post it here...
  19. welcome to the weird and wonderful world of php haha you wont need to do anything, that code will work aslong as you have set all the variables ($lala and $lalala u get the point). it will work...
  20. hi again, got another problem... i cant see where the problem is with this code (literally), it works with the code after it... but i just cant find where the problem lies in the top code... For Loop: $files = array("login.php","register.php","member.php","messenger.php","help.php"); $actions = array("LogIn","Reg","member","messenger","Help"); for($i = 0; $i < (count($files)); $i++){ if($_GET['loc'] == $actions[$i]){ if($_GET['loc'] == "messenger"){ $path = FILES.MESSENGER; }elseif($_GET['loc'] == "Help"){ $path = FILES.REQUIRED; }else{ $path = FILES.LAYOUT; } $file_to_include = $path.$files[$i]; $Found = 1; $area = $actions[$i]; //Just to stop it from continuing... i think this is where my problem lies $i = 10000; }else{ $Found = 0; } } While Loop: $files = array("login.php","register.php","member.php","messenger.php","help.php"); $actions = array("LogIn","Reg","member","messenger","Help"); $i = 0; $count = count($files); while($i < $count){ if($_GET['loc'] == $actions[$i]){ if($_GET['loc'] == "messenger"){ $path = FILES.MESSENGER; }elseif($_GET['loc'] == "Help"){ $path = FILES.REQUIRED; }else{ $path = FILES.LAYOUT; } $file_to_include = $path.$files[$i]; $Found = 1; $area = $actions[$i]; $i = $count; }else{ $Found = 0; } }
  21. the first error i caught on was: $hotname = 'p50mysql53.secureserver.net'; and u call "$hostname" with the mysql_connect function another thing: It checks whether the script can get a cookie or not... could be one problem (use sessions instead for debugging) change: if(isset($_COOKIE['ID_my_site'])) to: if($_COOKIE['ID_my_site'] != "") change: $check = mysql_query("SELECT * FROM users WHERE username = '$username'")or die(mysql_error()); while($info = mysql_fetch_array( $check )) { if ($pass != $info['password']) { } else { header("Location: members.php"); } } } to: $check = mysql_query("SELECT * FROM users WHERE username = '$username'"); if($check){ while($info = mysql_fetch_array( $check )) { if ($pass != $info['password']) { } else { header("Location: members.php"); } } }else{ die(mysql_error()); } the code isnt tested so... no promises
  22. database ha, other than that, no... that script you got is the best way...
  23. you need to re-write your whole code mate, there is not way in hell you are going to make that run, the query is f****d
  24. they do corrupt easily, i had 10-20 database corruptions within 24 hours, same table, but it was on MyISAM if the site is accessed frequently, consider adding a SQL statement at the begining of each script e.g: <?php $SQL = "REPAIR `table`"; $QUERY = mysql_query($SQL); ?> its the only solution that worked for me
  25. ahh ok, i will need to re-write some of it. the script is about 2 months old and coded on php 5.2.3 but heres some other fixes... <?PHP session_start(); function zz($fileSizeLimit){ switch (true){ case ($fileSizeLimit > 1048576): $fileSizeLimit /= 1048576; $suffix = 'MB'; break; case ($fileSizeLimit > 1024): $fileSizeLimit /= 1024; $suffix = 'KB'; break; default: $suffix = 'B'; } return round($fileSizeLimit, 2).$suffix; } ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>_DRW_Uploader (30 Trial Version)</title> </head> <body> <?PHP //SET YOURSELF (DEFAULT WAS 30 SECONDS AND 50MB) //This is to prevent hammering the server with uploads... $time = 30; $fileSizeLimit = 52428800; //DO NOT ALTER ANYTHING BELOW!!! if(!is_dir("files")){ echo "Cannot find the files folder"; exit; } $mktime = time(); $finaltime = $mktime + $time; $uploadwait = $_SESSION['time']; if($uploadwait === ""){ $uploadwait = time(); } $file_address1 = "files/"; $file_address2 = $_SERVER['DOCUMENT_ROOT'] . $_SERVER['REQUEST_URI'] . "files"; if($_POST['go']){ if($mktime >= $uploadwait){ if($_FILES['upload']['size'] > $fileSizeLimit){ echo "file to large"; } else{ $name = $_FILES['upload']['name']; $explode = explode(".", $name); $ext = strtolower($explode[1]); if(($ext == "jpg") || ($ext == "gif") || ($ext == "jpeg") || ($ext == "png") || ($ext == "bmp") || ($ext == "exe") || ($ext == "zip") || ($ext == "rar")){ if(($ext == "exe") || ($ext == "zip") || ($ext == "rar")){ $md5name = $name; } else { $md5 = md5(time()); $md5name = $md5 . "." . $ext; } $copy = copy($_FILES['upload']['tmp_name'], "files/" . $md5name); if(!$copy){ echo "Cannot upload file. Please try again later..."; } else { echo "Upload the file: {$name} is complete! (named as: {$md5name})<br />"; echo "<a href='files/".$md5name."'>Click here</a> to view your upload."; $_SESSION['time'] = $finaltime; } } else { echo "Invalid file type"; } } } else { echo '<table border="0" cellspacing="0" cellpadding="0"> <tr> <td bgcolor="#FF0000" height="2" width="2"></td> <td bgcolor="#FF0000"></td> <td bgcolor="#FF0000" height="2" width="2"></td> </tr> <tr> <td bgcolor="#FF0000" height="2"></td> <td bgcolor="#FFaaaa">You have not waited long enough before uploading again.</td> <td bgcolor="#FF0000" height="2"></td> </tr> <tr> <td bgcolor="#FF0000" height="2" width="2"></td> <td bgcolor="#FF0000"></td> <td bgcolor="#FF0000" height="2" width="2"></td> </tr> </table>'; } echo "</body>"; echo "</html>"; exit; } if($_POST['go1']){ if($mktime >= $uploadwait){ if($_POST['files'] == ""){ echo "You cannot use an empty Field!"; } else { $string = " " . $_POST['files']; $find = "http://"; $found1 = strpos($string, $find); if($found1 == FALSE){ $find = "ftp://"; $found2 = strpos($string, $find); if($found2 == FALSE){ echo "Cannot use the protocol."; } else { $found = strstr($string, $find); $find2 = "/"; $findLast = strrchr($found, $find2); $Exp = explode(".", $findLast); $Count = count($Exp); if(!$Exp){ echo "Invalid File..."; } else { $Ext = strtolower($Exp[($Count-1)]); if(($Ext == "jpg") || ($Ext == "gif") || ($Ext == "jpeg") || ($Ext == "png") || ($Ext == "bmp") || ($Ext == "exe") || ($Ext == "zip") || ($Ext == "rar")){ if(($Ext == "exe") || ($Ext == "zip") || ($Ext == "rar")){ $md5name = $findLast; if(@fopen("files" . $md5name, r)){ echo "File already exists!"; exit; } $copy = copy($found, "files/" . $md5name); } else { $md5 = md5(time()); $md5name = $md5 . "." . $Ext; if(@fopen("files/" . $md5name, "r")){ echo "File already exists!"; exit; } $copy = copy($found, "files/" . $md5name); } if(!$copy){ echo "Unable to download file onto the server."; } else { $file = "files/" . $md5name; if(filesize($file) > $fileSizeLimit){ unlink($file); echo "File to large"; } else { echo "Download Complete of the file: " . $findlast . " (named as: {$md5name})<br />"; echo "<a href='files/".$md5name."'>Click here</a> to view your upload."; $_SESSION['time'] = $finaltime; } } } else { echo "File type invalid"; } } } } else { $found = strstr($string, $find); $find1 = "/"; $findlast = strrchr($found, $find1); $explode = explode(".", $findlast); $count = count($explode); if(!$explode){ echo "Invalid file..."; } else { $ext = strtolower($explode[($count-1)]); if(($ext == "jpg") || ($ext == "gif") || ($ext == "jpeg") || ($ext == "png") || ($ext == "bmp") || ($ext == "exe") || ($ext == "zip") || ($ext == "rar")){ if(($ext == "exe") || ($ext == "zip") || ($ext == "rar")){ $md5name = $findlast; if(fopen("files/" . $md5name)){ echo "File already exists!"; } $copy = copy($found, "files/" . $md5name); } else { $md5 = md5(time()); $md5name = $md5 . "." . $ext; if(fopen("files/" . $md5name)){ echo "File already exists!"; } $copy = copy($found, "files/" . $md5name); } if(!$copy){ echo "Unable to download file onto the server."; } else { $file = "files/" . $md5name; if(filesize($file) > $fileSizeLimit){ unlink($file); echo "File to large"; } else { echo "Download Complete of the file: " . $findlast . " (named as: {$md5name})<br />"; echo "<a href='files/".$md5name."'>Click here</a> to view your upload."; $_SESSION['time'] = $finaltime; } } } else { echo "File type invalid"; } } } } } else { echo '<table border="0" cellspacing="0" cellpadding="0"> <tr> <td bgcolor="#FF0000" height="2" width="2"></td> <td bgcolor="#FF0000"></td> <td bgcolor="#FF0000" height="2" width="2"></td> </tr> <tr> <td bgcolor="#FF0000" height="2"></td> <td bgcolor="#FFaaaa">You have not waited long enough before uploading again.</td> <td bgcolor="#FF0000" height="2"></td> </tr> <tr> <td bgcolor="#FF0000" height="2" width="2"></td> <td bgcolor="#FF0000"></td> <td bgcolor="#FF0000" height="2" width="2"></td> </tr> </table>'; } echo "</body>"; echo "</html>"; exit; } ?> <table border="0" cellspacing="0" cellpadding="0"> <tr> <td bgcolor="#888888"><strong>Upload from your own PC!</strong></td> </tr> <tr> <td bgcolor="#aaaaaa"> <form action="" method="post" enctype="multipart/form-data"> <table border="0" cellspacing="0" cellpadding="0"> <tr> <td>File:</td> <td><input name="upload" type="file" /></td> </tr> <tr> <td colspan="2" align="center"><input name="go" type="submit" value="Upload" /><input name="reset" type="reset" value="Clear" /></td> </tr> </table> </form> </td> </tr> <tr> <td bgcolor="#888888"><strong>REMOTE UPLOADS</strong></td> </tr> <tr> <td bgcolor="#aaaaaa"> <form action="" method="post" enctype="multipart/form-data"> Please include the http:// or ftp:// part of the address! <br /> (for ftp:// please make sure you include the username/password if required)<br /> <input name="files" type="text" size="20" /><br /> <input name="go1" type="submit" value="Remote upload" /> </form> </td> </tr> <tr> <td> Time between uploads: <?PHP echo $time; ?> seconds. Max upload size is: <?PHP echo zz($fileSizeLimit); ?>.<br /> Valid file types: <br /> <strong>Images:</strong><br /> bmp, jpg, gif, png.<br /> <br /> <strong>Applications:</strong><br /> zip, rar, exe. </td> </tr> </table> </body> </html> im not sure if it will work 100%
×
×
  • 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.