Jump to content

bob_the _builder

Members
  • Posts

    206
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

bob_the _builder's Achievements

Member

Member (2/5)

0

Reputation

  1. Is there away to format links that are loading pages via jquery/ajax so search engines can index the pages? Thanks
  2. Thanks for all you help Barand! Just one more thing.. MAX(DATETIME(t.timeslot)) as latest Should that not show the date and time printing when $latest?
  3. Ops I should have looked harder.. It does appear to be bringing back the correct clientid's.. but listing the timeslot field as DESC.. The reason for SELECT * is so within the query loop, taking firstname, email, timeslot etc and dispatch an email to those clients.. The date field needs to be the latest (last) appointment date/time so we can say your last visit was on ####. Can the query be altered to bring the latest timeslot as the result? Thanks
  4. It looks like it is briging back their first appointment ever.. Should it not bring back any results at all, seems like a random result.. If I do 32 days ago I get: Fri 01 Jun 2012 @ 4:00 pm -> Josh Thu 26 Jul 2012 @ 11:00 am -> Chris Again, a match that doesnt fall within 32 days old.. Lost on this one.
  5. I just run the query based on 15 days ago.. Tue 10 Jan 2012 @ 1:00 pm -> Geoff Fri 20 Jan 2012 @ 12:00 pm -> Keith Fri 24 Feb 2012 @ 11:30 am -> Greg Mon 14 May 2012 @ 2:00 pm -> Darion Wed 23 May 2012 @ 5:30 pm -> Eroll Mon 03 Sep 2012 @ 2:00 pm -> Michelle Wed 12 Sep 2012 @ 11:30 am -> Lisa Some of these dates are going back months.. The idea is to pull out records that are exactly 15 days older than today, so they only get notifiyed once.. $sql = mysql_query("SELECT c.*, t.* FROM timeslots as t JOIN clients as c ON c.clientid = t.clientid GROUP BY c.clientid HAVING MAX(DATE(timeslot)) = CURDATE() - INTERVAL 15 DAY");
  6. I run a test using my code and got one result of latest appointment being 30 days ago.. When I run you code I got no result.. I should have got back the same one result, as that is the latest appointment = 30 days ago. I guess because the field is date/time.. and your code is taking the time stamp into consideration so looking for appointment exactly 30 days to the minute?
  7. Not exactly.. thats what my posted script does.. I need to pluck out anyone who had an appointment 30 days ago, but disregard anyone who had made an appointment within that 30 days or ay time in the future.. Its so an email can be dispatched to any client that hasnt been in for 30 days and havnt booked another appointment since then.. But let me check that.. I may have read your post wrong..
  8. This is based on appointment time slots.. The following code grabs any clients who had an appointment 30 days ago.. $sql = mysql_query("SELECT t.*, c.* FROM timeslots as t JOIN clients as c ON c.clientid = t.clientid WHERE timeslot >= CURRENT_DATE - INTERVAL 31 DAY AND timeslot < CURRENT_DATE - INTERVAL 30 DAY"); But I also need to exclude anyone that has another appointment booked between 29 days ago and into the future.. if that makes sence? An example of results from the above script: These people had an appointment 30 days ago, so would be emailed.. Fri 31 Aug 2012 @ 8:30 am -> Alan Fri 31 Aug 2012 @ 12:30 pm -> Martin Fri 31 Aug 2012 @ 3:00 pm -> Craig Fri 31 Aug 2012 @ 9:00 am -> Sue Fri 31 Aug 2012 @ 2:00 pm -> Kellie Fri 31 Aug 2012 @ 9:30 am -> Karen But these 2 names allready have up coming appointments.. Thu 13 Sep 2012 @ 1:00 pm -> Kellie Fri 14 Sep 2012 @ 3:30 pm -> Martin So need to be excluded from the results above.. Basically looking for people that havnt been back in the last 30 days and havnt booked any further appointments.. Thanks
  9. It appears to work just using prefix path ../home/###/files/
  10. Via script is the plan.. Already have my cart code sorted, but files are being uploaded to a public folder via the admin area..
  11. Uploading the files to the directory.. I have them going to a folder in the public directory.. should I shift them after upload or can they be uploaded directly to that location
  12. Ahh yes I tried / and ./ but not ../ which works..
  13. Here is what I am trying to make work.. But get responce 'Requested file does not exist' When you say ouside web root you mean in Root Directory? I know the $hiddenPath exist as I have connected via ftp and uploaded a few files.. // Path to downloadable files $hiddenPath = "home/####/files/"; // Variables if (!empty($_GET['file'])){ $file = str_replace('%20', ' ', $_GET['file']); $category = (!empty($_GET['category'])) ? $_GET['category'] . '/' : ''; } $file_real = $hiddenPath . $category . $file; $ip = $_SERVER['REMOTE_ADDR']; // Check to see if the download script was called if (basename($_SERVER['PHP_SELF']) == 'getfile.php'){ if ($_SERVER['QUERY_STRING'] != NULL){ // Hack attempt check if ((substr($file, 0, 1) == '.') || (strpos($file, '..') > 0) || (substr($file, 0, 1) == '/') || (strpos($file, '/') > 0)) { // Display hack attempt error echo("Hack attempt detected!"); die(); } // If requested file exists if (file_exists($file_real)){ // Get extension of requested file $extension = strtolower(substr(strrchr($file, "."), 1)); // Determine correct MIME type switch($extension){ case "png": $type = "video/x-ms-asf"; break; case "avi": $type = "video/x-msvideo"; break; case "jpg": $type = "application/octet-stream"; break; case "jpeg": $type = "video/quicktime"; break; case "mp3": $type = "audio/mpeg"; break; case "mpg": $type = "video/mpeg"; break; case "gif": $type = "video/mpeg"; break; case "rar": $type = "encoding/x-compress"; break; case "txt": $type = "text/plain"; break; case "wav": $type = "audio/wav"; break; case "pdf": $type = "text/plain"; break; case "doc": $type = "audio/wav"; break; case "jpeg": $type = "text/plain"; break; case "bmp": $type = "audio/wav"; break; case "wma": $type = "audio/x-ms-wma"; break; case "wmv": $type = "video/x-ms-wmv"; break; case "zip": $type = "application/x-zip-compressed"; break; default: $type = "application/force-download"; break; } // Fix IE bug $header_file = (strstr($_SERVER['HTTP_USER_AGENT'], 'MSIE')) ? preg_replace('/\./', '%2e', $file, substr_count($file, '.') - 1) : $file; // Prepare headers header("Pragma: public"); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Cache-Control: public", false); header("Content-Description: File Transfer"); header("Content-Type: " . $type); header("Accept-Ranges: bytes"); header("Content-Disposition: attachment; filename=\"" . $header_file . "\";"); header("Content-Transfer-Encoding: binary"); header("Content-Length: " . filesize($file_real)); // Send file for download if ($stream = fopen($file_real, 'rb')){ while(!feof($stream) && connection_status() == 0){ //reset time limit for big files set_time_limit(0); print(fread($stream,1024*); flush(); } fclose($stream); } }else{ // Requested file does not exist (File not found) echo("Requested file does not exist"); die(); } } }
  14. Yea I have googled it, hence my asking if that is the best option.. Was just after some opinions of other as to the best way.. whether I could just have a folder in the public directory with maybe an index page to hide the contents and download.php script from there.. I have been playing with a script, but it keeps sayng file doesnt exist even tho I know it does.. Wondering if the folder I am trying to use cant be accessed without a password.. The folder I am trying to access is in the Root Directory apposed to WWW Directory
  15. Thats not where the problem is.. I am wanting to know the best way to secure the files so they cant just be accessed by anyone.. so posibally by storing the files outside the public folder and accessing them using headers, file path hidden etc
×
×
  • 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.