Jump to content

reyna12

Members
  • Posts

    11
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

reyna12's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Now what i have the problem with is, it worked before putting it into the member system  :D It does show the register options when trying to access it when not logged in, but when you are it keeps saying downloading download.php then error, cannot download download.php rather than the file. [code=php:0] <? session_start(); include('./config.php'); if(!check_login($username, $password)) { $title = "Guest Page"; $msg = "<h2>Welcome Guest</h2> <p>Hi there.  I see that you're a guest to this site, in order to get the best experience out of ". SITE_NAME .", you must be registered.  Registering is totally free and requires only a few minutes of your time, we promise!  If you're interested, you can register <a href='login.php?do=reg'>here</a>.</p><p>If you're not a guest, and simply haven't logged in, you may log in <a href='login.php'>here</a>."; } else { if ( !isset ( $_GET['file'] ) ) { header ( 'HTTP/1.0 404 Not Found' ); die ( 'File not found.' ); } $File = $_GET['file']; $Directory = '/home/designht/public_html/dan/1/2/d/'; $File = $Directory . preg_replace ( '#([^\w\d_\-\. ])#', '', $File ); if ( !is_file ( $File ) ) { header ( 'HTTP/1.0 404 Not Found' ); die ( 'File not found: ' . $File ); } header ( 'HTTP/1.1 200 OK' ); header ( 'Date: ' . date ( 'D M j G:i:s T Y' ) ); header ( 'Last-Modified: ' . date ( 'D M j G:i:s T Y' ) ); header ( 'Content-Type: application/force-download' ); header ( 'Content-Lenght: ' . (string) ( filesize ( $File ) ) ); header ( 'Content-Transfer-Encoding: Binary' ); header ( 'Content-Disposition: attachment;filename=' . basename ( $File ) ); readfile ( $File ); } ?> <html> <head> <title><?php echo $title; ?></title> </head> <body> <?php echo $msg, $footer; ?> </body> </html>[/code]
  2. Yeah it suddenly hit me! Got it setup to get the file from directory set (goes through several just so it can't "easily" be found. Thanks for your help everyone :)
  3. The mp3 itself will be created by me so no issues with copyright etc... I'd never thought of that, that script won't do it (or i am failing to understand it) but it could be a link "Download" but it wouldnt actually show the url to the file. I am guessing that, that script might be part of it but how would i go about actually setting teh file to download?
  4. What i want I have an mp3 file, only available for logged in users, but i want to make it so that it is downloadable, only by logged in users so that the link cannot be passed around, is this hard to do? Also would need to add something to the member system that alerts if the user has logged in from several ip addresses, is there something available for this? Thanks for any advice
  5. In DESPERATE NEED of a script which allows max of 5 photo uploads and sends those photos via email. I have tried one script, only sent a few of the images (out of 5) some of the time, tried something else which gets a fatal error of allowed memory size X bytes exhausted.... It pulls info from a form and sends the info and image uploads (5 image upload forms in total, not all or if any at all have to be used) This is the one with fatal error, [code]<?php // Read POST request parms into global vars $email = $_POST['email']; $subject = "Caricature Details"; $fullname = $_POST['fullname']; $telephone = $_POST['telephone']; $address = $_POST['address']; $postcode = $_POST['postcode']; $emailmessage = $_POST['message']; $country = $_POST['country']; $orderid = $_POST['orderid']; $website = $_POST['website']; $ThankyouURL = "thanks.php"; $BadAddy = "error.php"; $YourWebsiteURL = "test.php"; $to = "sales@funny-faces.co.uk"; // Format the message body $message = "" . "Order ID: " . $orderid . " "   . "Full Name: " . $fullname . " " . "Email Address: " . $email . " " . "Telephone: " . $telephone . " " . "Address: " . $address . " " . "Postcode: " . $postcode  . " " . "Country: " . $country . " " . "Can we use your characature on our website? " . $website . " " . "How did you hear about us? " . $hear . " "   . "Specification: \n\n"     . $emailmessage . ""; // Obtain file upload vars $fileatt = $_FILES['fileatt']['tmp_name']; $fileatt_type = $_FILES['fileatt']['type']; $fileatt_name = $_FILES['fileatt']['name']; $fileatt2 = $_FILES['fileatt2']['tmp_name']; $fileatt_type2 = $_FILES['fileatt2']['type']; $fileatt_name2 = $_FILES['fileatt2']['name']; $fileatt3 = $_FILES['fileatt3']['tmp_name']; $fileatt_type3 = $_FILES['fileatt3']['type']; $fileatt_name3 = $_FILES['fileatt3']['name']; $fileatt4 = $_FILES['fileatt4']['tmp_name']; $fileatt_type4 = $_FILES['fileatt4']['type']; $fileatt_name4 = $_FILES['fileatt4']['name']; $fileatt5 = $_FILES['fileatt5']['tmp_name']; $fileatt_type5 = $_FILES['fileatt5']['type']; $fileatt_name5 = $_FILES['fileatt5']['name']; $headers = "From: $email"; if (is_uploaded_file($fileatt) || is_uploaded_file($fileatt2) || is_uploaded_file($fileatt3) || is_uploaded_file($fileatt4) || is_uploaded_file($fileatt5)) {  // Read the file to be attached ('rb' = read binary)  if (is_uploaded_file($fileatt)) {   $file = fopen($fileatt,'rb');   $data = fread($file,filesize($fileatt));   fclose($file);   // Base64 encode the file data   $data = chunk_split(base64_encode($data));  }  if (is_uploaded_file($fileatt2)) {   $file2 = fopen($fileatt2,'rb');   $data2 = fread($file2,filesize($fileatt2));   fclose($file2);   // Base64 encode the file data   $data2 = chunk_split(base64_encode($data2));  }  if (is_uploaded_file($fileatt3)) {   $file3 = fopen($fileatt3,'rb');   $data3 = fread($file3,filesize($fileatt3));   fclose($file3); // Base64 encode the file data   $data3 = chunk_split(base64_encode($data3));  }  if (is_uploaded_file($fileatt4)) {   $file4 = fopen($fileatt4,'rb');   $data4 = fread($file4,filesize($fileatt4));   fclose($file4); // Base64 encode the file data   $data4 = chunk_split(base64_encode($data4));  }  if (is_uploaded_file($fileatt5)) {   $file5 = fopen($fileatt5,'rb');   $data5 = fread($file5,filesize($fileatt5));   fclose($file5);   // Base64 encode the file data   $data5 = chunk_split(base64_encode($data5));  }  // Generate a boundary string  $semi_rand = md5(time());  $mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";    // Add the headers for a file attachment  $headers .= "\nMIME-Version: 1.0\n" . "Content-Type: multipart/mixed;\n" . " boundary=\"{$mime_boundary}\"";  // Add a multipart boundary above the plain message  $message = "This is a multi-part message in MIME format.\n\n" .             "--{$mime_boundary}\n" .             "Content-Type: text/plain;\n charset=\"iso-8859-1\"\n" .             "Content-Transfer-Encoding: 7bit\n\n" .             $message . "\n\n" . "--{$mime_boundary}\n";  // Add file attachment(s) to the message  if ($fileatt_name > "") {   $message .= "Content-Type: {$fileatt_type};\n" .             " name=\"{$fileatt_name}\"\n" .              "Content-Transfer-Encoding: base64\n" .               "Content-Disposition: attachment;\n" .               " filename=\"{$fileatt_name}\"\n\n" .              $data . "\n" .              "--{$mime_boundary}\n"; }  if ($fileatt_name2 > "") {   $message .=  "Content-Type: {$fileatt_type2};\n" .             " name=\"{$fileatt_name2}\"\n" .              "Content-Transfer-Encoding: base64\n" .               "Content-Disposition: attachment;\n" .               " filename=\"{$fileatt_name2}\"\n\n" .              $data2 . "\n" .              "--{$mime_boundary}\n"; }  if ($fileatt_name3 > "") {   $message .=  "Content-Type: {$fileatt_type3};\n" .             " name=\"{$fileatt_name3}\"\n" .              "Content-Transfer-Encoding: base64\n" .               "Content-Disposition: attachment;\n" .               " filename=\"{$fileatt_name3}\"\n\n" .              $data3 . "\n" .              "--{$mime_boundary}\n"; }  if ($fileatt_name4 > "") {   $message .=  "Content-Type: {$fileatt_type4};\n" .             " name=\"{$fileatt_name4}\"\n" .              "Content-Transfer-Encoding: base64\n" .               "Content-Disposition: attachment;\n" .               " filename=\"{$fileatt_name4}\"\n\n" .              $data4 . "\n" .              "--{$mime_boundary}\n"; }  if ($fileatt_name5 > "") {   $message .=  "Content-Type: {$fileatt_type5};\n" .             " name=\"{$fileatt_name5}\"\n" .              "Content-Transfer-Encoding: base64\n" .               "Content-Disposition: attachment;\n" .               " filename=\"{$fileatt_name5}\"\n\n" .              $data5 . "\n" .              "--{$mime_boundary}"; } $message .=  "--\n\n"; } //Validate the email address used if (eregi('^[a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.([a-zA-Z]{2,4})$', $_POST['email'])) { // Send the message $ok = @mail("$to", $subject, $message, $headers); if ($ok) { header("Location: $ThankyouURL"); } else { echo "<p>Mail could not be sent. Sorry!</p>"; } } else { header("Location: $BadAddy"); } ?>[/code] Thanks :)
  6. naming the login image shows the new xy variables, login_x and login_y, any suggestions on what i can do with them Array (     [domain] => utilityservers.net     [logintype] => cpanel     [user] => utility     [pass] => *********     [login_x] => 10     [login_y] => 14 )
  7. I have tested in both ie7 and firefox, not working with either but heres the script with that code added IE7 [code] Array (     [domain] => utilityservers.net     [logintype] => cpanel     [user] => utility     [pass] => *******     [x] => 22     [y] => 16 ) [/code] Firefox: Same as above just different x,y [code]     [x] => 30     [y] => 17 [/code]
  8. Have tried adding name="" yeah didn't work either
  9. It works fine with a normal submit button, but it doesn't appear to be doing anything when i use the image, the cologin page remains blank. Any ideas? cplogin.php [code]<?php   if(!$_POST['login']) {   exit;   }   // Change Domain from form page, <input name="domain" type="hidden" value="utilityservers.net">   $domain = $_POST['domain'];;     // States that the variable user will be what the user type in to username field   $user = $_POST['user'];     // States that the variable pass will be what the user type in to password field   $pass = $_POST['pass'];     // If the user added their domain name to username this will remove it   $user = str_replace("@$domain","",$user);     switch($logintype){ // You could set this form to log in to others but it is not needed   case "cpanel": // What to log in to   $port = "2082"; // Port Number Cpanel Is On $prefix = "http://"; // Protocol, http or https $user = $user; // Username is set to username typed in   break;   default:   $port = "2082"; // Port Number Cpanel Is On $prefix = "http://"; // Protocol, http or https $user = $user; // Username is set to username typed in   break;   } ?> <html> <body onLoad="setTimeout('document.forms[0].submit();',10)"> <form action="<?php echo "".$prefix."".$domain.":".$port."/login/"; ?>" method="post"> <input type="hidden" name="user" value="<?php echo $user; ?>"> <input type="hidden" name="pass" value="<?php echo $pass; ?>"> </form> </body> </html> [/code] The Form: [code]   <form action="cplogin.php" method="post">   <input name="domain" type="hidden" value="utilityservers.net">   <input type="hidden" name="logintype" value="cpanel">             <table width="171" border="0" cellspacing="1" cellpadding="1">               <tr>                 <td width="171" height="20" class="sideboxheader"><div align="center">Client  Login </div></td>               </tr>               <tr>                 <td class="logintablefor"><table width="100%" border="0" cellspacing="0" cellpadding="0">                     <tr>                       <td width="34%">Username:</td>                       <td width="66%"><input name="user" type="text" size="15" /></td>                     </tr>                 </table></td>               </tr>               <tr>                 <td class="logintablefor"><table width="100%" border="0" cellspacing="0" cellpadding="0">                     <tr>                       <td width="34%">Password:</td>                       <td width="66%"><input name="pass" type="password" size="15" /></td>                     </tr>                 </table></td>               </tr>               <tr>                 <td><div align="center">                   <label>                   <input type="image" src="imgs/loginbutton.gif" />                   </label>                   <img src="imgs/spacer.gif" width="3" height="8" />                     <label></label>                     <a href="javascript:hideshowCommon(document.getElementById('forgotpassword'),'toggle0')"><img src="imgs/forgottenpass.gif" width="98" height="20" border="0" /></a></div></td>               </tr>             </table>           </form>[/code]
×
×
  • 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.