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

Monday, October 10, 2022

[FIXED] How to save an image without using the imagepng() function?

 October 10, 2022     gd, php     No comments   

Issue

So I have been manipulating images using the GD library, and would like to first save those images and then redirect the user to another page. However, with the imagepng() function that appears to be impossible.

see below:

/// image manipulations beforehand
imagepng($image, $savepath);
echo '<meta http-equiv="refresh" content="0;URL=different_page.php"/> ';

Whilst it does save the images in question, it doesn't allow for any redirections afterwards. Hence my question: what other way is there to save these images without using imagepng?


Solution

Do not use meta element with php to redirect, use php location header.

imagepng($image, $savepath);
header('Location: different_page.php');


Answered By - Giacomo M
Answer Checked By - Mildred Charles (PHPFixing Admin)
  • 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