Jump to content

deansaddigh

Members
  • Posts

    440
  • Joined

  • Last visited

    Never

Everything posted by deansaddigh

  1. Can anyone point me to a really good script for building an online shop. ive tried zencart and dont really like it tbh. Cheers guys
  2. Whats the best way to protect phpmyadmin. Im not that techy and im trying to learn about securuity. how would i use htacess to protect it. and also should i rename the phpmyadmin folder to something more obscure
  3. Ok so im assuming after doing alot of research that the htacess file is only allowing the maintanance page to be displayed, so do i need to modify the htacess code to show the css aswell?
  4. any ideas at all. ive still been tying to figure it out for awhile now
  5. i have this code RewriteEngine On RewriteBase / RewriteCond %{REMOTE_ADDR} !^11\.111\.111\.111 RewriteCond %{REQUEST_URI} !^/maintenance\.html$ RewriteRule ^(.*)$ http://www.brewskies.co.uk/maintenance.html [R=307,L] Which redirects to a maintance page ignore the allowed ip for now, im jst testing and what to see the maintanance page. the site can be seen here http://www.brewskies.co.uk/maintenance.html why isnt the css being displayed, if i look at firefox and check the css its all there. I am veery confused any any help would be lovely. kind regards Dean
  6. Hey and thanks for the link. Would it be to much trouble to show me how i implement that on my code. The reason i ask you to do that if possible , is i have been trying for a week with this to no avail what so ever. So if you could possibly show me how to implement it, ill know for future reference. Kind Regards Dean
  7. Hi guys, i have a form that uploads a school photo. All i want to do is resize the image to its widest dimension of a width of 480 px and then obviously constrain the height. can anyone help me, ive tried to do this myself but when it comes to image properties i really struggle etc. heres my upload code. <?php include("includes/connection.php"); // Where the file is going to be placed $schoolimage = "SchoolImages/"; //This path will be stored in the database as it does not contain the filename $currentdir = getcwd(); $path = $currentdir . '/' . $schoolimage; // Get the schoolid for the image and school linker table $schoolid = $_POST['schoolid']; //Get the school name $query = "SELECT * FROM school WHERE school_id = ".$schoolid; $result = mysql_query($query) or die("Error getting school details"); $row = mysql_fetch_assoc($result); $schoolname = $row['name']; //Use this path to store the path of the file in the database. $filepath = $schoolimage . $schoolname; //Create the folder if it does not already exist if(!file_exists('SchoolImages')) { if(mkdir('SchoolImages')) { echo 'Folder ' . 'SchoolImages' . ' created.'; } else { echo 'Error creating folder ' . 'SchoolImages'; } } //Store the folder for the course title. if(!file_exists( $filepath )) { if(mkdir( $filepath )) { echo 'Folder ' . $schoolname . ' created.'; } else { echo 'Error creating folder ' . $schoolname; } } // Where the file is going to be placed $target_path = $filepath; // Add the original filename to our target path. Result is "uploads/filename.extension" echo $target_path = $target_path . '/' . basename( $_FILES['uploadedfile']['name']); if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) { echo "The file ". basename( $_FILES['uploadedfile']['name'])." has been uploaded"; $filename = $_FILES['uploadedfile']['name']; //Store the filename, path other criteria in the database echo $query = "INSERT INTO image(image_id, name, path) VALUES(0, '$filename', '$filepath')"; //Perform the query $add = mysql_query($query, $conn) or die("Unable to add the image details to the database"); $imageid = mysql_insert_id(); //Store the filename, path other criteria in the database echo $query = "INSERT INTO image_school( image_id, school_id ) VALUES('$imageid', '$schoolid')"; //Perform the query $add = mysql_query($query, $conn) or die("Unable to add the image details to the database"); $message = 'Upload Successful'; } else { $message = 'There was an error uploading the file, please try again!'; } //Close the connection to the database mysql_close($conn); header("Location: add_school_photo_form.php? message={$message}&schoolid={$schoolid}"); //header("Location: add_school_photo_form.php? message=$message, schoolid=$schoolid"); exit(); ?> Id be eternially gratefull. Kind Regards Dean
  8. Many thanks, this looks easy enough to follow.
  9. I have an upload script which uploads photos. However i want them to all be resized to the same size, as at the moment im having to manually hardcode the dimensions when i want to show them on the front end. Heres my code <?php include("includes/connection.php"); // Where the file is going to be placed $schoolimage = "SchoolImages/"; //This path will be stored in the database as it does not contain the filename $currentdir = getcwd(); $path = $currentdir . '/' . $schoolimage; // Get the schoolid for the image and school linker table $schoolid = $_POST['schoolid']; //Get the school name $query = "SELECT * FROM school WHERE school_id = ".$schoolid; $result = mysql_query($query) or die("Error getting school details"); $row = mysql_fetch_assoc($result); $schoolname = $row['name']; //Use this path to store the path of the file in the database. $filepath = $schoolimage . $schoolname; //Create the folder if it does not already exist if(!file_exists('SchoolImages')) { if(mkdir('SchoolImages')) { echo 'Folder ' . 'SchoolImages' . ' created.'; } else { echo 'Error creating folder ' . 'SchoolImages'; } } //Store the folder for the course title. if(!file_exists( $filepath )) { if(mkdir( $filepath )) { echo 'Folder ' . $schoolname . ' created.'; } else { echo 'Error creating folder ' . $schoolname; } } // Where the file is going to be placed $target_path = $filepath; // Add the original filename to our target path. Result is "uploads/filename.extension" echo $target_path = $target_path . '/' . basename( $_FILES['uploadedfile']['name']); if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) { echo "The file ". basename( $_FILES['uploadedfile']['name'])." has been uploaded"; $filename = $_FILES['uploadedfile']['name']; //Store the filename, path other criteria in the database echo $query = "INSERT INTO image(image_id, name, path) VALUES(0, '$filename', '$filepath')"; //Perform the query $add = mysql_query($query, $conn) or die("Unable to add the image details to the database"); $imageid = mysql_insert_id(); //Store the filename, path other criteria in the database echo $query = "INSERT INTO image_school( image_id, school_id ) VALUES('$imageid', '$schoolid')"; //Perform the query $add = mysql_query($query, $conn) or die("Unable to add the image details to the database"); $message = 'Upload Successful'; } else { $message = 'There was an error uploading the file, please try again!'; } //Close the connection to the database mysql_close($conn); header("Location: add_school_photo_form.php? message={$message}&schoolid={$schoolid}"); //header("Location: add_school_photo_form.php? message=$message, schoolid=$schoolid"); exit(); ?> If anyone can help me that would be brilliant because i have no idea, how to implement it even after searching google. thanks guys
  10. Cheers guys, i didnt even realise people posted a reply. thanks for your help
  11. i want to remove any links which get pulled out in my general information query. $general_info = $row['general_info']; $general= preg_replace('/<a href="([^<]*)">([^<]*)<\/a>/', '', $general_info); echo '<h2>General Information : <img src="images/mag.png"></h2>'; echo '<div id="featurecontent">'; echo '<p>'. ucfirst($general).'</p>'; echo '</div>'; But the above code doesnt seem to be stripping out links. Can anyone see what i am doing wrong. Kind Regards Dean
  12. Many thanks, i have done it. thanks again mate kind regards Dean
  13. i would like to resize it before its saved onto the server ideally
  14. could you possibly show me how to implement that on to the code i specified at all? im just not sure how to do that part Kind Regards Dean
  15. The below code inserts image details to db and uploads pic to folder, can anyone show me how to resize it aswell. please <?php include("includes/connection.php"); // Where the file is going to be placed $schoolimage = "SchoolImages/"; //This path will be stored in the database as it does not contain the filename $currentdir = getcwd(); $path = $currentdir . '/' . $schoolimage; // Get the schoolid for the image and school linker table $schoolid = $_POST['schoolid']; //Get the school name $query = "SELECT * FROM school WHERE school_id = ".$schoolid; $result = mysql_query($query) or die("Error getting school details"); $row = mysql_fetch_assoc($result); $schoolname = $row['name']; //Use this path to store the path of the file in the database. $filepath = $schoolimage . $schoolname; //Create the folder if it does not already exist if(!file_exists('SchoolImages')) { if(mkdir('SchoolImages')) { echo 'Folder ' . 'SchoolImages' . ' created.'; } else { echo 'Error creating folder ' . 'SchoolImages'; } } //Store the folder for the course title. if(!file_exists( $filepath )) { if(mkdir( $filepath )) { echo 'Folder ' . $schoolname . ' created.'; } else { echo 'Error creating folder ' . $schoolname; } } // Where the file is going to be placed $target_path = $filepath; // Add the original filename to our target path. Result is "uploads/filename.extension" echo $target_path = $target_path . '/' . basename( $_FILES['uploadedfile']['name']); if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) { echo "The file ". basename( $_FILES['uploadedfile']['name'])." has been uploaded"; $filename = $_FILES['uploadedfile']['name']; //Store the filename, path other criteria in the database echo $query = "INSERT INTO image(image_id, name, path) VALUES(0, '$filename', '$filepath')"; //Perform the query $add = mysql_query($query, $conn) or die("Unable to add the image details to the database"); $imageid = mysql_insert_id(); //Store the filename, path other criteria in the database echo $query = "INSERT INTO image_school( image_id, school_id ) VALUES('$imageid', '$schoolid')"; //Perform the query $add = mysql_query($query, $conn) or die("Unable to add the image details to the database"); $message = 'Upload Successful'; } else { $message = 'There was an error uploading the file, please try again!'; } //Close the connection to the database mysql_close($conn); header("Location: add_school_photo_form.php? message={$message}&schoolid={$schoolid}"); //header("Location: add_school_photo_form.php? message=$message, schoolid=$schoolid"); exit(); ?>
  16. Hey there. my main problem is the upload script, does indeed upload the images to the server, But doesnt do any inserts to the db. I think that this problem has beaten me, i think ill find a better upload script, because this seems to be more hassle that its worth just for a pretty upload. Kind regards Dean ps. if someone has got uploadify working with uploading details to db please let me know how you done it.
  17. trying to get uploadify to then save details to db Can anone give me some pointers at all please cause i am stumped. heres the 2 relevant pieces of code on the add photos page. <link href="uploadify/uploadify.css" rel="stylesheet" type="text/css" media="screen" /> <script type="text/javascript" src="uploadify/jquery-1.3.2.min.js" ></script> <script type="text/javascript" src="uploadify/swfobject.js"></script> <script type="text/javascript" src="uploadify/jquery.uploadify.v2.1.0.min.js"></script> <script type="text/javascript"> $(document).ready(function() { $("#fileInput2").uploadify({ 'uploader' : 'uploadify/uploadify.swf', 'script' : 'uploadify/uploadify_student_photos.php', 'cancelImg' : 'uploadify/cancel.png', 'folder' : '../studentimages', 'multi' : true }); }); </script> <p> <strong>Select accreditation logos To upload</strong></p> <input id="fileInput2" name="fileInput2" type="file" /> <a href="javascript:$('#fileInput2').uploadifyUpload();">Upload Files</a> | <a href="javascript:$('#fileInput2').uploadifyClearQueue();">Clear Queue</a></div> The proccessing page where im just trying to get it to write to the db thats why i have specifiacally put some strings in the insert code. as of yet its not putting anything in the db <?php include("includes/connection.php"); ?> <?php include "securitycheck.php";?> <?php /* Uploadify v2.1.0 Release Date: August 24, 2009 */ if (!empty($_FILES)) { $tempFile = $_FILES['Filedata']['tmp_name']; $targetPath = $_SERVER['DOCUMENT_ROOT'] . $_REQUEST['folder'] . '/'; $targetFile = str_replace('//','/',$targetPath) . $_FILES['Filedata']['name']; // $fileTypes = str_replace('*.','',$_REQUEST['fileext']); // $fileTypes = str_replace(';','|',$fileTypes); // $typesArray = split('\|',$fileTypes); // $fileParts = pathinfo($_FILES['Filedata']['name']); // if (in_array($fileParts['extension'],$typesArray)) { // Uncomment the following line if you want to make the directory if it doesn't exist // mkdir(str_replace('//','/',$targetPath), 0755, true); move_uploaded_file($tempFile,$targetFile); echo "1"; // } else { // echo 'Invalid file type.'; // } //Store the filename, path other criteria in the database $query = "INSERT INTO studentphotos(image_id, name, path) VALUES(0, '3', '5')"; //Perform the query $add = mysql_query($query, $conn) or die("Unable to add the image details to the database"); } ?> Kind Regards Dean
  18. Does this look correct to you, because im getting a 500 error faster than lightining. htacess AuthName "Restricted Area" AuthType Basic AuthUserFile ../private/.htpasswd AuthGroupFile /dev/null <Files phpmyadmin> require valid-user </Files> <Files admin> require valid-user </Files>
  19. Thanks again wildeteen, you have been really helpful to me, and i really appreciate it . Kind Regards Dean
  20. deansaddigh

    Keywords

    Firstly appolagies if this is in the wrong place, Couldnt find where this post would be appropriate. Ok basically i need some help with keywords etc. <meta name="description" content="The Uk's largest International Student Services,Free advice & Placement Service for International Students wishing to study in the UK." /> <meta name="keywords" content="Languageschoolsuk.com UK English Language School the International Student Services, learn english course, english school UK, english language, school in England, english courses in England, learn English in England, english course, learn English in Bournemouth, ielts, IELTS, study English as a second language at Charminster UK school, learn English in Britain, intensive english course in England, toefl exam, TOEFL, toefl tests, business english,english for university access, university foundation course in oxford, work and study in England, study english in south England, summer english courses, Cambridge first certificate, Cambridge examinations, english lessons, south coast, Bournemouth beach, English in Bournemouth"/> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>language schools uk-International Student Services placing students in Uk language schools </title> Does this look ok what i have done, can anyone give me some pointers, have i got to much info have i dont it wrong complty Any help at all would be brilliant Kind Regards Dean
  21. im trying to make .htpasswd files. but i dont know how to get what the directory is called above htdocs, as its meant to be kept outside root, can anyone help ive included a pic [attachment deleted by admin]
  22. Oh yeah i see, how very annoying. good news ive fixed it. basically in the control panel, they have custom error pages, so i just set the 404 error to be 404.php and it seems to have fixed it, maybe they have an overide function that overides htaccess . and you have to use there custom error pages in the control panel Thanks again man
×
×
  • 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.