Jump to content

adam291086

Members
  • Posts

    1,312
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

adam291086's Achievements

Advanced Member

Advanced Member (4/5)

0

Reputation

  1. Hello, I have this upload script that creates thumbnails. But i keep getting the following errors here is the full script <?php require_once 'Classes/ExtendedFileManager.php'; require_once('config.inc.php'); $file = $_FILES['upload']; $error = 0; $size = 0.45; if(!empty($file)) { $dir = $_POST['dir']; $target = "/home/rubberduckiee/webapps/editor/Xinha/plugins/ExtendedFileManager/files".$dir."/".basename($file['name']) ; $file_extension = strtolower(substr(strrchr($file['name'], "."), 1)); $max_size = $IMConfig['max_filesize_kb_image']; //This is our limit file type condition if(!in_array($file_extension, $IMConfig['allowed_image_extensions'])) { $message = "Please make sure you are uploading the correct file type"; if(is_file($file['tmp_name'])) { unlink($file['tmp_name']); } $error = 1; } else if (file_exists($target)) { $error = 1; $message = "File alread exists"; if(is_file($file['tmp_name'])) { unlink($file['tmp_name']); } } else if(!is_file($file['tmp_name'])) { $message = "Pease make sure you are uploading a file"; $error = 1; if(is_file($file['tmp_name'])) { unlink($file['tmp_name']); $error = 1; } } else if(!is_uploaded_file($file['tmp_name'])) { $message = "Pease make sure you are uploading a file"; $error = 1; if(is_file($file['tmp_name'])) { unlink($file['tmp_name']); } } else if($file['size']>($max_size*1024)) { $message = "File size is too large. Max size is 10Mb"; $error = 1; if(is_file($file['tmp_name'])) { unlink($file['tmp_name']); } } if ($error == 1) { header('Location: http://rubberduckiee.webfactional.com/file/error_upload/'.$message); } else if (in_array($file_extension, array("jpg","bmp","jpeg"))) { if (move_uploaded_file($file['tmp_name'], $target)) { // Get new dimensions list($width_orig, $height_orig) = getimagesize($target); if ($width_orig > $IMConfig['thumbnail_width']) { $width = $width_orig * $size; } else { $width = $width_orig; } if ($height_orig > $IMConfig['thumbnail_height']) { $height = $height * $size; } else { $height = $height_orig; } // Resample $image_p = imagecreatetruecolor($width, $height); $image = imagecreatefromjpeg($target); imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig); $pathToThumbs = "/home/rubberduckiee/webapps/editor/Xinha/plugins/ExtendedFileManager/files".$dir."/thumbnail/"; $fname = "thumbnail_".$file['name']; if (imagejpeg($image_p, "{$pathToThumbs}{$fname}")) { header('Location: http://rubberduckiee.webfactional.com/file/browse'); } else { $message = "file not uploaded"; header('Location: http://rubberduckiee.webfactional.com/file/error_upload/'.$message); unlink($target); } } } else { move_uploaded_file($file['tmp_name'], $target); header('Location: http://rubberduckiee.webfactional.com/file/browse'); } } ?>
  2. what is wrong with this <?php if ($_SERVER['HTTP_REFERER']) { if($_GET['id']) { $con = mysql_connect("","",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("rubberduckiee", $con); $result = mysql_query("SELECT * FROM email_content where id=".$_GET['id']); while($row = mysql_fetch_array($result)) { if($_GET['part'] == "body") { echo $row['email_content_body']; } elseif($_GET['part'] == "footer") { echo $row['email_content_footer']; } elseif ($_GET['part'] == "header") { echo $row['email_content_header']; } } } } ?> i am getting the error Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/rubberduckiee/webapps/editor/email_editor.php on line 17
  3. Hello, I am creating an app for public use. I was after some advice on form security to prevent code injections and 100% secure. Also what are peoples thoughts on passing information through URL's. i.e www.example.com?id=1. Should this information be encrypted or just left?
  4. Hello, I need some advice. I am planning to make a email template system. This will allow a user to select a template, add in the content and send it to a group of users. I was planning to have a collection of templates that have code inside them to grab the content from the database depending on the users ID and content area. Is this the best way to do this?
  5. this is just a simple database with PHP interactions. You will need a simple HTML form submitting info Database table with all the prices PHP and MYSQL for taking the users info and querying it into a database. search for these different items on the internet, this will give you the basic knowledge to make your app. heres an example of forms and php http://www.tizag.com/phpT/forms.php
  6. ok, i was just trying to get some alternative suggestions. I know joomla but there is oftern some smaller open source CMS that are much better
  7. Its because you are going through the while loop using $query and your trying to re set $query in the while loop and therefore messing up the while loop.
  8. The main need is to have a selection of templates the user can select for their websites. A good WYSIWYG editor
  9. also try $query = mysql_query("SELECT * FROM `mp3links` WHERE `scraped` = '1'"); to $query = mysql_query("SELECT * FROM mp3links WHERE scraped = '1'");
  10. change $update = $row[sourcefile]; $update = $row['sourcefile']; thats one error but nothing to do with line 10, not sure whats causeing that error.
  11. check the file type once uploaded with an if statement or switch statement $_FILES['attachement']['type']
  12. google it heres one example http://www.tizag.com/phpT/fileupload.php
  13. try echoing out you variables to make sure they contain information
  14. i have created my own before but the open source ones seem to offer more power and flexibility
  15. Hello, I am after some advice with which CMS to use.
×
×
  • 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.