Jump to content

hackalive

Members
  • Posts

    652
  • Joined

  • Last visited

Everything posted by hackalive

  1. Here is my code: test.php <?php echo "<img src='filehandler.php?file=1' />"; ?> filehandler.php <?php $file = $_GET['file']; // You would need a way to set the extension automatically. $file = 'F:\files\/'.$file.'.jpg'; // I use this $content_type so that the handler can become multi-purpose. //You will need an auto way to adjust the final $file line above. $content_type = mime_content_type($file); header("Content-Type: $content_type"); @readfile($file); ?> All seems to work, without permissions yet.
  2. Thanks thorpe, Ill have a play with it and see what I can get to work
  3. Hello thorpe, I did think my code wasnt totally right Can you provide a link to the sample code?
  4. Hi guys, I am using a MySQL table to store if a user has access permisisons to a file. The files are stored outside the webdirectory in drive F:\ So I have this code I have been playing around with in order to display the file I access and check permissions for: <?php $file = $_GET['file']; $myfile = 'F:\files\/'.$file.'.jpg'; echo "<img src='$myfile' />"; ?> So a sample case would be say on index.php <img src="http://somedomain.com/files?file=abcdefghijkl" /> and only if the current user had permissions to view that file would they see it. Any help on how I can do this is greatly appreciated. I do understand all my above code is probably totally wrong. Cheers
  5. I have found some information that says this is possible but It does not say how it can or has been executed. Any help or suggestions (even the most basic) is appreciated.
  6. Hi guys, I have this problem and id appreciate all your advice in helping solve it. I'm working on a service with is "cloud" hosted. However I want it so when a person employed by Corporation A logs onto myservice.corporationa.com they enter their Corporation A LDAP details but somehow that sends them to myservice.com and authenticates them. I know how to do the get LDAP details part to put on myservice.corporationa.com but no idea how to do the rest and make it send back etc. Any ideas? Many many thanks in advance. (PS - If this all makes sense please do let me know)
  7. It only works if I click on the extreme outer of the frame which is not what I want.
  8. See http://jsfiddle.net/CRSQS/1/ Does not work.
  9. Hi guys I am using the HTML5 object http://www.w3schools.com/html5/tryit.asp?filename=tryhtml5_object and want to know how I can attach a funtion to it for onClick. Obviously <object width="400" height="400" data="helloworld.swf" onClick="alert('a')"></object> does not work, so is there a jQuery solution I can implement? Cheers in advance.
  10. And would I ever use stripslashes?
  11. its JSON its being passed into PHP. I just would like to format it nicely for debug to start with then im happy to let it be all standard and un-formatted.
  12. Thanks thorpe. Problem solved Cheers
  13. If you take a careful look at the function it has the flow of how it gets to the characters etc You can pass ANY JSON string through it. Not just a "timeline" one. http://recursive-design.com/blog/2008/03/11/format-json-with-php/
  14. so will doing the non JS way break my code? (probably will yeah). So how do I do the JS way then?
  15. I tried if (($char == ':{' | $char == ',' || $char == '{' || $char == '[') && $outOfQuotes) { But that didnt help
  16. However it outputs: Code: [select] { "timeline":{ "headline":"FifteenTwo", "type":"default", "startDate":"2012,1" } } When I would rather it be: Code: [select] { "timeline": { "headline":"FifteenTwo", "type":"default", "startDate":"2012,1" } }
  17. Just tell me what I need to add to make it do as I want when the string is passed into it.
  18. More specifically I need to mimick this: { "timeline": { "headline":"FifteenTwo", "type":"default", "startDate":"2012", "text":"<span class='c1'>A blog of</span> <span class='c2'>Innovation</span>", "asset": { "media":"idea.jpg", "credit":"", "caption":"<b>There's a way to do it better - find it.</b> <i>Thomas Edison</i>" }, "date": [ { "startDate":"2012,4,11", "headline":"Where good ideas come ferom", "text":"We all operate in two contrasting modes, which might be called open and closed. The open mode is more relaxed, more receptive, more exploratory, more democratic, more playful and more humorous. The closed mode is the tighter, more rigid, more hierarchical, more tunnel-visioned. Most people, unfortunately spend most of their time in the closed mode. Not that the closed mode cannot be helpful. If you are leaping a ravine, the moment of takeoff is a bad time for considering alternative strategies. When you charge the enemy machine-gun post, don't waste energy trying to see the funny side of it. Do it in the 'closed' mode. But the moment the action is over, try to return to the 'open' mode - to open your mind again to all the feedback from our action that enables us to tell whether the action has been successful, or whether further action is need to improve on what we have done. In other words, we must return to the open mode, because in that mode we are the most aware, most receptive, most creative, and therefore at our most intelligent. In other words, we must return to the open mode, because in that mode we are the most aware, most receptive, most creative, and therefore at our most intelligent. In other words, we must return to the open mode, because in that mode we are the most aware, most receptive, most creative, and therefore at our most intelligent. In other words, we must return to the open mode, because in that mode we are the most aware, most receptive, most creative, and therefore at our most intelligent.", "asset": { "media":"http://youtu.be/NugRZGDbPFU", "credit":"", "caption":"One of our most innovative, popular thinkers takes on-in exhilarating style-one of our key questions: Where do good ideas come from?" } }, { "startDate":"2012,9,27", "headline":"Digital world expo 2012", "text":"Digital World Expo is an annual conference highlighting emerging interactive and digital media channels, with in-depth workshops for attendees and new business for exhibitors and sponsors. Digital World Expo is an engaging event with a cutting edge curriculum, special events and a high-energy, innovative exhibit hall.", "asset": { "media":"http://www.thengashow.com/images/mirage-hotel-las-vegas/mirage_hotel.jpg", "credit":"", "caption":"" } }, { "startDate":"2013,4,11", "headline":"Where good ideas come from", "text":"We all operate in two contrasting modes, which might be called open and closed. The open mode is more relaxed, more receptive, more exploratory, more democratic, more playful and more humorous. The closed mode is the tighter, more rigid, more hierarchical, more tunnel-visioned. Most people, unfortunately spend most of their time in the closed mode. Not that the closed mode cannot be helpful. If you are leaping a ravine, the moment of takeoff is a bad time for considering alternative strategies. When you charge the enemy machine-gun post, don't waste energy trying to see the funny side of it. Do it in the 'closed' mode. But the moment the action is over, try to return to the 'open' mode - to open your mind again to all the feedback from our action that enables us to tell whether the action has been successful, or whether further action is need to improve on what we have done. In other words, we must return to the open mode, because in that mode we are the most aware, most receptive, most creative, and therefore at our most intelligent. In other words, we must return to the open mode, because in that mode we are the most aware, most receptive, most creative, and therefore at our most intelligent. In other words, we must return to the open mode, because in that mode we are the most aware, most receptive, most creative, and therefore at our most intelligent. In other words, we must return to the open mode, because in that mode we are the most aware, most receptive, most creative, and therefore at our most intelligent." } ] } } But am unable to get it to work. Got the bit up to date okay, just not that and beyond (the bit below). "date": [ { "startDate":"2012,4,11", "headline":"Where good ideas come ferom", "text":"We all operate in two contrasting modes, which might be called open and closed. The open mode is more relaxed, more receptive, more exploratory, more democratic, more playful and more humorous. The closed mode is the tighter, more rigid, more hierarchical, more tunnel-visioned. Most people, unfortunately spend most of their time in the closed mode. Not that the closed mode cannot be helpful. If you are leaping a ravine, the moment of takeoff is a bad time for considering alternative strategies. When you charge the enemy machine-gun post, don't waste energy trying to see the funny side of it. Do it in the 'closed' mode. But the moment the action is over, try to return to the 'open' mode - to open your mind again to all the feedback from our action that enables us to tell whether the action has been successful, or whether further action is need to improve on what we have done. In other words, we must return to the open mode, because in that mode we are the most aware, most receptive, most creative, and therefore at our most intelligent. In other words, we must return to the open mode, because in that mode we are the most aware, most receptive, most creative, and therefore at our most intelligent. In other words, we must return to the open mode, because in that mode we are the most aware, most receptive, most creative, and therefore at our most intelligent. In other words, we must return to the open mode, because in that mode we are the most aware, most receptive, most creative, and therefore at our most intelligent.", "asset": { "media":"http://youtu.be/NugRZGDbPFU", "credit":"", "caption":"One of our most innovative, popular thinkers takes on-in exhilarating style-one of our key questions: Where do good ideas come from?" } }, { "startDate":"2012,9,27", "headline":"Digital world expo 2012", "text":"Digital World Expo is an annual conference highlighting emerging interactive and digital media channels, with in-depth workshops for attendees and new business for exhibitors and sponsors. Digital World Expo is an engaging event with a cutting edge curriculum, special events and a high-energy, innovative exhibit hall.", "asset": { "media":"http://www.thengashow.com/images/mirage-hotel-las-vegas/mirage_hotel.jpg", "credit":"", "caption":"" } }, { "startDate":"2013,4,11", "headline":"Where good ideas come from", "text":"We all operate in two contrasting modes, which might be called open and closed. The open mode is more relaxed, more receptive, more exploratory, more democratic, more playful and more humorous. The closed mode is the tighter, more rigid, more hierarchical, more tunnel-visioned. Most people, unfortunately spend most of their time in the closed mode. Not that the closed mode cannot be helpful. If you are leaping a ravine, the moment of takeoff is a bad time for considering alternative strategies. When you charge the enemy machine-gun post, don't waste energy trying to see the funny side of it. Do it in the 'closed' mode. But the moment the action is over, try to return to the 'open' mode - to open your mind again to all the feedback from our action that enables us to tell whether the action has been successful, or whether further action is need to improve on what we have done. In other words, we must return to the open mode, because in that mode we are the most aware, most receptive, most creative, and therefore at our most intelligent. In other words, we must return to the open mode, because in that mode we are the most aware, most receptive, most creative, and therefore at our most intelligent. In other words, we must return to the open mode, because in that mode we are the most aware, most receptive, most creative, and therefore at our most intelligent. In other words, we must return to the open mode, because in that mode we are the most aware, most receptive, most creative, and therefore at our most intelligent." } ]
  19. Hi guys I am putting together an array in PHP for encoding into JSON but how do I make it be like "date": [ and not "date": { ?? Not sure even what to call it or look into. Thanks
×
×
  • 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.