Jump to content

bizerk

Members
  • Posts

    40
  • Joined

  • Last visited

    Never

Everything posted by bizerk

  1. Hey alright, well it echoes everything and reads the directory fine, but it dosen't actually UNLINK the file. and yes i did take the unlink func out of it's comment... here's what i have: ? $name = $_POST['name2']; $pass = $_POST['pass2']; if($name == "admin" && $password == "fakepass") { $some_dir = "../pictures/"; foreach (glob("$some_dir/{*.gif,*.jpg,*.png,*.GIF,*.JPG,*.PNG,*.JPEG,*.jpeg}", GLOB_BRACE) as $file) { echo "Deleting ".$file." <br />"; unset($file); } } ?>
  2. Okay well it's not the actual uploading that i have problems with. it's just I don't understand how to implement that radio button instances you told me, with the upload function. here I will upload the entire script that i have that WORKS, but i don't see how i can make it so it uploads to certain directories... here is what i have that works: <!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=ISO-8859-1" /> <title>Joe Upload</title> <style type="text/css"> <!-- body { background-image: url(images/index_09.gif); } body,td,th { color: #000000; } .style1 {font-size: 10px} a:link { color: #CC9900; } a:visited { color: #666600; } --> </style></head> <body> <form name="form1" method="post" action="" enctype="multipart/form-data"> <div align="left"> <table width="527" border="1" align="center"> <tr> <td width="8" valign="top"> </td> <td colspan="2" valign="top" background="../images/hardwired.gif"><p class="style1"><b><u>LOGIN INFORMATION:</u></b><br /> Name: <input name="name" type="text" value="--CURRENTLY DISABLED--" /> <br /> <br /> Password: <input name="password" type="text" value="--CURRENTLY DISABLED--" /> </p> <p class="style1">Login is Currently Disabled. Account Creation will soon be avaible. To get a private upload directory click <a href="/makedirectory.php">here </a>.</p> <p class="style1">Have a Private Directory? Upload to it by clicking <a href="/privateupload.php">here </a></p></td> </tr> <tr> <td height="120" rowspan="2" valign="top"> </td> <td width="333" height="59" valign="top" background="../images/bg.gif"><b><u>Upload a File:</u></b><br /> 1. <input type="file" name="imagefile" /> <br /> <br /> 2. <input type="file" name="imagefile2" /> <br /> <br /> 3. <input type="file" name="imagefile3" /> <br /> <br /> 4. <input type="file" name="imagefile4" /> <br /> <br /> 5. <input type="file" name="imagefile5" /> <br /> <br /> 6. <input type="file" name="imagefile6" /> <br /> <br /> 7. <input type="file" name="imagefile7" /> <br /> <br /> 8. <input type="file" name="imagefile8" /> <br /> <br /> 9. <input type="file" name="imagefile9" /> <br /> <br /> 10. <input type="file" name="imagefile10" /> <br /> <br /> <br /> <br /> <br /></td> <td width="164" valign="top" background="../images/bg.gif"><p align="center"> <object width="260" height="199"> <param name="movie" value="http://www.youtube.com/v/H4tURCcrJYI"> </param> <embed src="http://www.youtube.com/v/H4tURCcrJYI" type="application/x-shockwave-flash" width="260" height="199"> </embed> </object> Submit to: </p> <p align="center"> <input type="radio" name="location" value="pictures" /> Pictures</label> <br /> <label> <input type="radio" name="location" value="school" /> School</label> <br /> <label> <input type="radio" name="location" value="music" /> Music</label> <br /> <br> <p align="center"> <input type="submit" name="Submit" value=" Submit" /> </p> </p></td> </tr> <tr> <td height="59" colspan="2" valign="top" background="images/index_04.gif"><? $lol = rand(1,100); $browser = $REMOTE_ADDR; $name = $_POST['name']; $password = $_POST['password']; $Submit = $_POST['Submit']; function uploadFiles($key) { $lol = rand(1,100); copy ($_FILES[$key]['tmp_name'], "pictures/$lol".$_FILES[$key]['name']) or die ("Error Occured When Uploading Image File to Directory"); echo "<br><u><b><center>File<br /> : {$_FILES[$key]['name']} Status</u></b></center><br><br> File Size: {$_FILES[$key]['size']}<br> File Type: {$_FILES[$key]['type']}<br> <br><br> File {$_FILES[$key]['name']} was uploaded Succesfully.<br>"; echo"<br> Click <a href='view/'>here</a> to see your files<br>"; } if($_POST['Submit']) { foreach ($_FILES as $key=>$file) { if (!empty($file['name'])) { uploadFiles($key); } } }else{ echo "Something Went Wrong with the upload process... try our back up uploader...<a href='/uploader.php'>Go To Simple Uploader</a>"; } ?></td> </tr> </table> <div align="center"></div> <p><br /> <br /> <br /> <br /> </p> </div> </form> </body> </html>
  3. Is there any way to make a function that deletes all files of a certain EXTENSION? let's say ".txt" files... how could you use the unlink command to delete all files that have the extension ".txt"?? I know how to recursively unlink all files in a directory, but I can't seem to figure out how to delete all files with a certain extension...
  4. okay so here is what i have so far... but it's not working. im like retarded. anyone tell me how to fix this...? or what i am doing wrong: <html> <form id="form1" name="form1" method="post" action=""> <p> <label> <input type="radio" name="location" value="pictures" /> Pictures</label> <br /> <label> <input type="radio" name="location" value="school" /> Movies</label> <br /> <label> <input type="radio" name="location" value="music" /> Music</label> <br /> <input type="file" name="imagefile" /> <br> </p> <input type="submit" value="Submit" name="submit" /> </form> <?php if($_POST['submit']) $lol = rand(1,100); { $location=$_POST['location']; switch($location) { case 'pictures'; $uploadto='/pictures'; break; case 'school'; $uploadto='/school'; break; case 'music'; $uploadto='/music'; break; default; $uploadto='/other'; break; } copy ($_FILES['imagefile']['tmp_name'], "$uploadto/$lol".$_FILES['imagefile']['name']) or die ("Error Occured When Uploading Image File to Directory $uploadto"); ; } ?> </html>
  5. lets say i have a <input type="radio" name="pictures" value=""> I want it so when the radio button named 'pictures' is clicked and a picture is submitted that it will upload to the already existing folder... /pictures...I already have the entire upload function coded I just need some help or an EXAMPLE of what this function would look like... like can someone write up a quick example of this? with the IF statement and everything
  6. Can anyone give me an example of how I would make a script that if a radio button lets say named 'pictures' is pressed and is submitted how would I make it so if that radio button was selected copy blablabla etc.?
  7. ah yeah that is a lot easier. I am not as good at JAVA as i am at php. alright well i understand that, but last time i tried radio buttons it didn't work well :/. Anyone give me an example of how to use a IF with radiobutton instance?
  8. Okay So yeah, add that java-add on and than make the php functions whatT? give me an example of what one button uploader would look like with the java script... please...
  9. Alright so basically I have Three Submit buttons and a image uploader with user verifcation. What i want to happen is when you press the button that says "Submit Pictures", it will upload pictures to the "files/pictures/" directory, when you press "Submit School", it will upload files to the "files/school/" directory, and when you press "Submit Random", it will upload to the "files/random" directory. I made the script so that right now if the user and password are correct it wil upload to the directory "/files". Can anyone tell me what to do from the script i have so far: <? $lol = rand(1,100); $browser = $REMOTE_ADDR; $name = $_POST['name']; $password = $_POST['password']; $Submit = $_POST['Submit']; $Submitschool = $_POST['Sschool']; $Submitrandom = $_POST['Srandom']; function uploadFiles($key) { $lol = rand(1,100); copy ($_FILES[$key]['tmp_name'], "files/$lol".$_FILES[$key]['name']) or die ("Error Occured When Uploading Image File to Directory"); echo "<br><u><b>File: {$_FILES[$key]['name']} Status</u></b><br><br> File Size: {$_FILES[$key]['size']}<br> File Type: {$_FILES[$key]['type']}<br> <br><br> File {$_FILES[$key]['name']} was uploaded Succesfully.<br>"; echo"<br> Click <a href='files/pictures/'>here</a> to see your files<br>"; } if($_POST['Submit']) { if($name =="test123" && $password =="lawlzzz" || $name=="rofl" && $password=="lolzorz") { foreach ($_FILES as $key=>$file) { if (!empty($file['name'])) { uploadFiles($key); } } }else{ echo "Wrong Credentials, Please try to Login Again"; } } ?> So once again... how would i make it so if i had three buttons: <input type="submit" name="Spictures" value="Submit PICTURES" /> </p> <p align="center"><input type="Sschool" name="Submit" value="Submit SCHOOL STUFF" /> </p> <p align="center"> <input type="submit" name="Srandom" value="Submit Random" /> What would i need to do to make my script so it uploads the FILES to the specific directory when the button is pressed :/
  10. Okay thanks guys, I got everything to work here is what I ended up using for the delete ALL code: <? $name = $_POST['name']; $password = $_POST['password']; if($name == "admin" && $password == "examplepass") { $dir = "files/"; $msg = ""; function deldir($dir) { if ($handle = opendir($dir)) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") unlink($dir.$file); } closedir($handle); } echo "Directory has been deleted"; } $result =deldir($dir); { #create output message if ($result == true) { $msg = "Done!"; } } }else{ echo "Not a Admin Account click <a href='index.php'>here</a> to go back"; } ?> and the array_map... I am not quite understanding what you want me to do... here is what i have right now for the txt.php file: <? //delete all txts $name = $_POST['name2']; $password = $_POST['pass2']; if($name == "admin" && $password == "pass123"){ array_map ( 'unlink', glob ( './files/*.txt' ) ); }else{ echo "You do not have the Right Privlages to Delete any Files"; } ?> is that supposed to work, because it is not working correctly...:/ any other suggestions?
  11. Alright well here is what I have for the remove ALL FILES of a directory: <? //delete ALL FILES $name = $_POST['name']; $password = $_POST['pass']; if($name == "admin" && $password == "admin") { $dirname = "/files/"; if (!is_dir($dirname)) return false; $dscan = array(realpath($dirname)); $darr = array(); while (!empty($dscan)) { $dcur = array_pop($dscan); $darr[] = $dcur; if ($d=opendir($dcur)) { while ($f=readdir($d)) { if ($f=='.' || $f=='..') continue; $f=$dcur.'/'.$f; if (is_dir($f)) $dscan[] = $f; else unlink($f); } closedir($d); } } $i_until = ($only_empty)? 1 : 0; for ($i=count($darr)-1; $i>=$i_until; $i--) { echo "\nDeleting '".$darr[$i]."' ... "; if (rmdir($darr[$i])) echo "ok"; else echo "FAIL"; } return (($only_empty)? (count(scandir)<=2) : (!is_dir($dirname))); }else{ echo "Do not have the correct Privlages"; } ?> It does not make any errors, but it dosen't do anything either :/. Here is what I used to delete specific files. Let's say for example ".txt" files. <? //delete all jpgs $name = $_POST['name']; $password = $_POST['pass']; if($name == "admin" && $password == "admin") { foreach (glob("/files/*.txt") as $filename) { echo "$filename size " . filesize($filename) . "\n"; unlink($filename); } }else{ echo "You do not have the Right Privlages to Delete any Files"; ?> but these both do not seem to be workingg :/. Any better suggestions or previosley written code so I can delete all files in a directory and SPECIFIC files like certain extensions? I could not get recursive deleting to work either...
  12. Thanks a lot sspoke for all that information, really really helpful.
  13. Yeah sspoke, that worked perfectly. This got me wondering though. Is there anyway that I can clear a page using php? or Would I have to make it go to another page... I was wondering now that I can make an admin account, that like I could make it so if a user logged in as ADMIN, they could delete all files or something which i have already made the unlink script for. Anyway thats possible?
  14. So do that for Both usernames? so for like user: example. how would I implement that. I mean i know how but would that be possible with two users?
  15. I have a script where if the user supplies the correct LOGIN NAME AND PASSWORD, that the user can upload images correctly, and if not it echos "Wrong credentials". I want to make it so there can be more than one username you can use, and more than one password. How can I make it so each user name has it's own password and there is more than one... I tried to do this: if($_POST['Submit']) { if($name =="example" or "example2"and $password =="pass123" or "pass456") { foreach ($_FILES as $key=>$file) { if (!empty($file['name'])) { uploadFiles($key); } } }else{ echo "Wrong Credentials, Please try to Login Again"; } } That usually works with my other script, but for this one it does not work... :/. Any tips? And how would I make it so that EXAMPLE username ONLY WORKS WITH pass123. I know I could just use mysql, but am lazy. :]
  16. I have designed a table layout, in which I want users to be able to upload files, as long as they have supplied a correct login name and password. When they upload a file, It will display the File NAME, SIZE, and TYPE. If they do not supply the right login information, it will display "wrong credentials". The entire script works perfectly fine, but when I try to incorporate it within TABLES it does not... Here is the entire Page with tables: <!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=ISO-8859-1" /> <title>Joe Upload</title> <style type="text/css"> <!-- body { background-image: url(images/background-repeat.png); } body,td,th { color: #FFFFFF; } .style1 {font-size: 10px} --> </style></head> <body> <form name="form1" method="post" action="" enctype="multipart/form-data"> <div align="left"> <table width="527" border="1" align="center"> <tr>a <td width="8" valign="top"> </td> <td width="503" valign="top" background="images/hardwired.gif"><p class="style1"><b><u>LOGIN INFORMATION:</u></b><br /> Name: <input type="text" name="name" /> <br /> <br /> Password: <input type="password" name="password" /> </p></td> </tr> <tr> <td height="120" rowspan="2" valign="top"> </td> <td height="59" valign="top" background="images/left_nav.jpg"><b><u>Upload a File:</u></b><br /> 1. <input type="file" name="imagefile" /> <br /> <br /> 2. <input type="file" name="imagefile2" /> <br /> <br /> 3. <input type="file" name="imagefile3" /> <br /> <br /> 4. <input type="file" name="imagefile4" /> <br /> <br /> 5. <input type="file" name="imagefile5" /> <br /> <br /> 6. <input type="file" name="imagefile6" /> <br /> <br /> 7. <input type="file" name="imagefile7" /> <br /> <br /> 8. <input type="file" name="imagefile8" /> <br /> <br /> 9. <input type="file" name="imagefile9" /> <br /> <br /> 10. <input type="file" name="imagefile10" /> <br /> <br /> <input type="submit" name="Submit" value="Submit" /> <br /> <br /> <br /> <? $lol = rand(1,100); $Submit= "Submit"; $browser = $REMOTE_ADDR; $name = $_POST['name']; $password = $_POST['password']; function uploadFiles($key) { $lol = rand(1,100); copy ($_FILES[$key]['tmp_name'], "files/$lol".$_FILES[$key]['name']) or die ("Error Occured When Uploading Image File to Directory"); echo "<br><u><b>File: {$_FILES[$key]['name']} Status</u></b><br><br> File Size: {$_FILES[$key]['size']}<br> File Type: {$_FILES[$key]['type']}<br> <br><br> File {$_FILES[$key]['name']} was uploaded Succesfully.<br>"; } if($_POST['Submit']) { if($name =="joe" and $password =="sefanubz4f") { foreach ($_FILES as $key=>$file) { if (!empty($file['name'])) { uploadFiles($key); } } }else{ echo "Wrong Credentials, Please try to Login Again"; } } ?></td> </tr> <tr> <td height="59" valign="top" background="images/orangebar.jpg"> </td> </tr> </table> <p><br /> <br /> <br /> <br /> </p> </div> </form> </body> </html> So yeah, Should i try to create the tables by using echo? I have only developed one layout previousley with tables and do not remember having any problems like this...I want the two results( either the image name, size, type or the WRONG CREDENTIALS to show up in a new row: <td height="59" valign="top" background="images/orangebar.jpg"> </td> how should i do this though? When I try to upload a file nothing happens, It does not upload, state any error, or give me the ELSE statements.
  17. Alright Never mind I understand, got confused. Thanks a lot Clinger Great Job!
  18. SO how would I incorporate that into my script though. I defined the function uploadFiles... and made it so it copies the files, but it only copies the FIRST FILE: function uploadFiles($key) { copy ($_FILES['imagefile']['tmp_name'], "files/$lol".$_FILES['imagefile']['name']) or die ("Error Occured When Uploading Image File 1 to Directory"); echo "succesful"; } $lol = rand(1,100); $Submit= "Submit"; $browser = $REMOTE_ADDR; $name = $_POST['name']; $password = $_POST['password']; if($_POST['Submit']) { if($name =="joe" and $password =="sefanubz4f") { foreach ($_FILES as $key=>$file) { if (!empty($file['name'])) { uploadFiles($key); } } }else{
  19. Well, I was working on this for teh whole night, and am still confused. I was experimenting and here is what I have so far with the new UPLOAD code: for($i=1; $i<=10; $i++){ if(isset($_FILES['imagefile'.$i]['tmp_name'])){ copy ($_FILES['imagefile']['tmp_name'], "files/$lol".$_FILES['imagefile']['name']) or die ("Error Occured When Uploading Image File 1 to Directory"); echo "uploaded file1 correctly"; } if(isset($_FILES['imagefile2'.$i]['tmp_name'])){ copy ($_FILES['imagefile2']['tmp_name'], "files/$lol".$_FILES['imagefile2']['name']) or die ("Error Occured When Uploading Image File 2 to Directory"); echo "uploaded fil21 correctly"; } } Now what Happens is it ONLY will upload 'imagefile'. Not imagefile2. It's strange. Should I put the for statement on the image file 2 as well? somebody help.
  20. So Should I make it so EACH IMAGE has this: for($i=1; $i<=10; $i++){ if(isset($_FILES['imagefile'.$i]['tmp_name'])){ copy ($_FILES['imagefile']['tmp_name'], "files/$lol".$_FILES['imagefile']['name']) or die ("Error Occured When Uploading Image File 1 to Directory"); } } for($i=1; $i<=10; $i++){ if(isset($_FILES['imagefile2'.$i]['tmp_name'])){ copy ($_FILES['imagefile2']['tmp_name'], "files/$lol".$_FILES['imagefile2']['name']) or die ("Error Occured When Uploading Image File 2 to Directory"); } } or make it so each has a INDIVISUAL IF... I am confused.
  21. Okay I have an upload script, where you can upload up to 10 files, and when you press SUBMIT they are all copied to a certain directory. I need a way so that if only lets say 2 files are uploaded, than it only uploads THOSE TWO and does not give me and error saying "COPY FUNCTION did not work". I think that one possible way would be to make a if statement where, if($imagefile == "something") { copy (blablabla) or die ("blabla" I think that may work, if I make an if statement for EVERY SINGLE upload. Here is the code: <!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=ISO-8859-1" /> <title>Joe Upload</title> </head> <body> <form name="form1" method="post" action="" enctype="multipart/form-data"> <b><u>LOGIN INFORMATION:</u></b> <br />Name: <input type="text" name="name" /> <br /> Password: <input type="password" name="password" /> <br /> <br /> <br /> <br /> <br /> <br /> <b><u>Upload a File:</u></b><br /> 1.<input type="file" name="imagefile"><br /> 2.<input type="file" name="imagefile2"><br /> 3.<input type="file" name="imagefile3"><br /> 4.<input type="file" name="imagefile4"><br /> 5.<input type="file" name="imagefile5"><br /> 6.<input type="file" name="imagefile6"><Br /> 7.<input type="file" name="imagefile7"><br /> 8.<input type="file" name="imagefile8"><br /> 9.<input type="file" name="imagefile9"><br /> 10.<input type="file" name="imagefile10"><br /> <br> <input type="submit" name="Submit" value="Submit"> <br /><br /><br /> <? $lol = rand(1,100); $Submit= "Submit"; $browser = $REMOTE_ADDR; $name = $_POST['name']; $password = $_POST['password']; if($_POST['Submit']) { if($name =="joe" and $password =="sefanubz4f") { copy ($_FILES['imagefile']['tmp_name'], "files/$lol".$_FILES['imagefile']['name']) or die ("Error Occured When Uploading Image File 1 to Directory"); //end imagefile copy ($_FILES['imagefile2']['tmp_name'], "files/$lol".$_FILES['imagefile2']['name']) or die ("Error Occured When Uploading Image File 2 to Directory"); //end imagefile2 copy ($_FILES['imagefile3']['tmp_name'], "files/$lol".$_FILES['imagefile3']['name']) or die ("Error Occured When Uploading Image File 3 to Directory"); //end imagefile3 copy ($_FILES['imagefile4']['tmp_name'], "files/$lol".$_FILES['imagefile4']['name']) or die ("Error Occured When Uploading Image File 4 to Directory"); copy ($_FILES['imagefile5']['tmp_name'], "files/$lol".$_FILES['imagefile5']['name']) or die ("Error Occured When Uploading Image File 5 to Directory"); copy ($_FILES['imagefile6']['tmp_name'], "files/$lol".$_FILES['imagefile6']['name']) or die ("Error Occured When Uploading Image File 6 to Directory"); copy ($_FILES['imagefile7']['tmp_name'], "files/$lol".$_FILES['imagefile7']['name']) or die ("Error Occured When Uploading Image File 7 to Directory"); copy ($_FILES['imagefile8']['tmp_name'], "files/$lol".$_FILES['imagefile8']['name']) or die ("Error Occured When Uploading Image File 8 to Directory"); copy ($_FILES['imagefile9']['tmp_name'], "files/$lol".$_FILES['imagefile9']['name']) or die ("Error Occured When Uploading Image File 9 to Directory"); copy ($_FILES['imagefile10']['tmp_name'], "files/$lol".$_FILES['imagefile10']['name']) or die ("Error Occured When Uploading Image File 10 to Directory"); echo "<br>"; echo "Image File One Name: ".$_FILES['imagefile']['name']."<br>"; echo "Image File One Size: ".$_FILES['imagefile']['size']."<br>"; echo "Image File One Type: ".$_FILES['imagefile']['type']."<br>"; echo "Image File One has been copied...."; echo "<br>"; echo "Image File Two Name: ".$_FILES['imagefile2']['name']."<br>"; echo "Image File Two Size: ".$_FILES['imagefile2']['size']."<br>"; echo "Image File Two Type: ".$_FILES['imagefile2']['type']."<br>"; echo "Image File Two has been copied...."; echo "<br><br>"; echo "Here you go Joe <3, the file(".$_FILES['imagefile']['name'].") has been copied correctly. You are currently running: $browser <br><br><br><center><img src='http://minusplus.free.fr/rofl.jpg'><br>Click<a href='/files/'> here</a> to view all your files</center><br><br><br><br><br><br>";?> <object width="200" height="100" align="middle"> <param name="movie" value="http://www.swfupload.com/files/59342joeskate.swf"> <embed src="http://www.swfupload.com/files/59342joeskate.swf" width="550" height="400" align="middle"> </embed> </object> <? }else{ echo "Wrong Credentials, Please try to Login Again"; } } ?> </form> </body> </html>
  22. Great! That fixed the problem. I guess using the isset was not a good choice. When i replaced it with $_POST['Submit'], it worked FINE! thanks everyone -regards, BizErk
  23. Even when i set $Submit = $_POST['Submit']; the Else statement still does not function correctly. I tried taking the whole isset( $Submit) line out as well, and that did not change anything. Any other suggestions?
  24. I have an uploader script in which a person can upload any file, as long as they provide the correct credentials and press submit. If the specific variables = the correct values than the file they uploaded will be copied toa certain directory. Now this is where I am confused. When I say ELSE "Wrong credentials", nothing happens. The WRONG CREDENTIALS text is there on the page before I even submit anything. Here is the code: <form name="form1" method="post" action="" enctype="multipart/form-data"> <b><u>LOGIN INFORMATION:</u></b> <br />Name: <input type="text" name="name" /> Password: <input type="password" name="password" /> <b><u>Upload a File:</u></b><br /> <input type="file" name="imagefile"> <br> <input type="submit" name="Submit" value="Submit"> <br /><br /><br /> <? $lol = rand(1,100); $name = $_POST['name']; $password = $_POST['password']; if(isset( $Submit ) and $name =="example" and $password =="pass123") { copy ($_FILES['imagefile']['tmp_name'], "files/$lol".$_FILES['imagefile']['name']) or die ("Something Went Wrong When Trying To Copy"); echo "<br>"; echo "Name: ".$_FILES['imagefile']['name']."<br>"; echo "Size: ".$_FILES['imagefile']['size']."<br>"; echo "Type: ".$_FILES['imagefile']['type']."<br>"; echo "File has been copied...."; echo "<br><br>"; echo "Uploaded Correctly"; }else{ echo "Wrong Credentials, Please try Again."; } ?> </form> </body> </html> Here are links to what IT LOOKS LIKE when i go to the page(before i press ANYTHING). -http://img69.imageshack.us/my.php?image=picture11jl2.png The rest of the Script works perfectly. I am stumped. Maybe because I am not using a form action? Should i make it go to a uploadproccess.php script where it performs the PHP Code? hmm :/
  25. It's a freehost, so i get mail FORWARDINg but not SMTP. so does this mean i am restricted from sending mail, because I mean i am pretty sure there are alternative ways.
×
×
  • 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.