PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, October 11, 2022

[FIXED] How to dynamically update a page with images generated via php GD

 October 11, 2022     gd, html, iframe, jquery, php     No comments   

Issue

Currently I am dynamically generating 1-(N) images via php GD based on user form input, and then posting into an iframe, that displays the image.

But theres a couple of problems:

  1. Iframes seems to be a drag when styling.
  2. The user dont seem to be able to "rightclick->saveas" the images properly when in iframes.

So are there any better methods for doing this?


Solution

Use a fixed size div element with overflow: scroll set on it.

For example:

#container {
    width: 600px;
    height: 300px;
    overflow-y: scroll; //vertical scrolling only
}

It behaves in the same manner as an iframe, but allows you better control of both content via javascript and styling via CSS.



Answered By - Rory McCrossan
Answer Checked By - Dawn Plyler (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing