Keylogger's Profile User Rating: *****

Reputation: 7 Worker
Active Members
Active Posts:
348 (0.18 per day)
14-February 11
Profile Views:
Last Active:
User is offline Jan 28 2016 10:17 AM

Previous Fields

Dream Kudos:
Icon   Keylogger has not set their status

Posts I've Made

  1. In Topic: Print iframe with PDF not working

    Posted 27 Jan 2016

    The hidden class has nothing to do with the problem, and I'm reaching more conclusions. I have several online servers where I can try several things.

    I went to a new hosting and added the code I told you in my previous post...and it worked.

    Until now, the feature wasn't working at all online, only in local environment. So I compared the two response headers (of PDF while being loaded) from the server where the code doesn't work and the server where it works.

    Where it doesn't work:
    Cache-Control:no-cache, no-store, must-revalidate
    Date:Wed, 27 Jan 2016 22:15:34 GMT
    Last-Modified:Wed, 27 Jan 2016 21:53:03 GMT

    Where it works:
    Date:Wed, 27 Jan 2016 22:16:50 GMT
    Last-Modified:Wed, 27 Jan 2016 22:04:08 GMT

    I instantly notice the cache control thing, because I have set in my .htaccess something to implement that.
    <IfModule mod_headers.c>
        Header set Cache-Control "no-cache, no-store, must-revalidate"
        Header set Pragma "no-cache"
        Header set Expires 0

    So I went to the file and removed it and gave it another try and it seems the .htaccess is cached (?), so I tried in incognito mode but the cache persists.

    Do you see anything relevant? Might be this the problem?

    Edit: What's even more strange is that if I set an image or a page url instead of a PDF into the iframe it works, but with PDF it doesn't even though the PDF was well loaded into the iframe.
  2. In Topic: Print iframe with PDF not working

    Posted 27 Jan 2016

    View PostArtificialSoldier, on 27 January 2016 - 11:44 AM, said:


    Keep in mind I just want this to work on chrome not other browsers.

    What does that mean? Does Chrome have a special non-standard way to print or something?

    Yes. Chrome has a print preview dialog (the image in my post) which others have not, at least that I know. In my code I detect that the user is currently viewing the page by chrome and I send the PDF to the iframe otherwise I send the PDF to a new tab.

    So this feature is just for chrome.

    Edit: If you use chrome, you can try this example at your local environment, just copy paste and get one pdf for testing (like:

    		<script src=""></script>
    		<iframe src="somefile.pdf" id="iframePdf"></iframe>
    		<script type="text/javascript">
  3. In Topic: Print iframe with PDF not working

    Posted 27 Jan 2016

    View PostArtificialSoldier, on 27 January 2016 - 10:27 AM, said:

    If it works locally but not on the server then try increasing that timeout to make sure that it has finished loading before you try to print it.


    Thanks for the response. I have already tried that. And increase for 10 seconds, but I want to be sure that wasn't setTimeout issue so I implemented a button to call the print and didn't work as well.

    Keep in mind I just want this to work on chrome not other browsers.
  4. In Topic: [Solved] CodeIgniter file_exists not working

    Posted 16 Jul 2014


    Since the problem was on file_exists() and it seems that the function goes to the root directory, all I had to do was to change a little the algorithm.

    function getImage($image){
        if(file_exists('public/images/' . $image) == FALSE || $image == null){
            return base_url() . './public/images/no_image.png';
        return base_url() . './public/images/' . $image;
  5. In Topic: [Solved] CodeIgniter file_exists not working

    Posted 16 Jul 2014

    Just for the record the problem is on the function file_exists ONLY.

    If I change my original function:
    function getImage($image){
    	$path = base_url() . 'public/images/';
    	if(file_exists($path . $image) === FALSE || $image == null){
    		return $path . "no_image.png";
    	return $path . $image;

    To this:
    function getImage($image){
    	$path = base_url() . 'public/images/';
    	return $path . $image;

    It works. However, if the image does not exists in the folder I should show the image "no_image.png", that's why I use file_exists to check if exists or not.

    View PostCTphpnwb, on 15 July 2014 - 03:28 PM, said:

    What's the value of $row->picture? More importantly, what's the value returned ($path . $image) by your function?

    The value of $row->picture is users/1/image_name.jpg.

    View Postastonecipher, on 15 July 2014 - 04:51 PM, said:

    Also, what is base_url() showing?

    The `base_url()` by himself shows correctly: http://localhost/myproject/

    Edit: Btw, I'm not calling the function in my root (http://localhost/myproject/), but yes in http:// localhost/myproject/dashboard/products.

    Edit 2: A topic with the same issue

    The solution told there I already tried and it keep not working for me.
    They tell to use something like:

    And adapting that to my code becomes:
    if(file_exists(dirname(FCPATH) . "/public/images/" . $image) === FALSE || $image == null){
        return $path . "no_image.png";

    Which continues not to work because if I output the dirname(FCPATH):
    return dirname(FCPATH) . "/public/images/" . $image;
    //output to img src:
    <img src="C:\xampp\htdocs/public/images/users/1/image_name.jpg" class="thumbnail-image">

    And when I click to open the link of src in a new tab the url is:
    http:// localhost/myproject/dashboard/C:/xampp/htdocs/public/images/users/1/image_name.jpg

    Other solution said in that topic is to use:

    Again, adapting to my code:
    return "./public/images/" . $image;
    //output to img src:
    <img src="./public/images/users/1/image_name.jpg" class="thumbnail-image">

    And when I open the link of src in a new tab I get:

    which is incorrect, should be:

My Information

Member Title:
D.I.C Regular
Age Unknown
Birthday Unknown

Contact Information




Keylogger has no profile comments yet. Why not say hello?