February 8, 201412 yr Aight, so I've made a dynamic signature, all that is fine, etc however, for some reason, even when specified to output a png image, I get a php page. The code (this is a test for it, this theoretically should work): <?php $my_img = imagecreate( 200, 80 ); $background = imagecolorallocate( $my_img, 0, 0, 255 ); $text_colour = imagecolorallocate( $my_img, 255, 255, 0 ); $line_colour = imagecolorallocate( $my_img, 128, 255, 0 ); imagestring( $my_img, 4, 30, 25, "testing", $text_colour ); imagesetthickness ( $my_img, 5 ); imageline( $my_img, 30, 45, 165, 45, $line_colour ); header( "Content-type: image/png" ); imagepng( $my_img ); imagecolordeallocate( $line_color ); imagecolordeallocate( $text_color ); imagecolordeallocate( $background ); imagedestroy( $my_img ); ?> Output: http://www.zscriptz.x10.mx/gensig/12.php Notice that when you go there, it will say "12.php" not "12.png" Could this be my webhost? Any help is appreciated
February 8, 201412 yr That's because you haven't actually saved it as a png file. You need to modify .htaccess to allow a png file to be parsed as a php file.
February 8, 201412 yr As mentioned above, modify your .htaccess file. Code: RewriteRule ^gensig.png$ gensig.php [L]
February 8, 201412 yr To be quite honest with you I cried when you showed that you do not understand file extensions.
February 8, 201412 yr Author To be quite honest with you I cried when you showed that you do not understand file extensions. To be quite honest I don't give a fuck
February 8, 201412 yr Author Figure it out on yourself then. All I did was ask for help. What I didn't ask for is for you to vent your superiority issues on me. I don't know what you're trying to prove here, that I'm not as skilled as you in a language that I have learned very little about? Because you're right. There was absolutely no need for your comment other than to enlarge dat e-peen, which I guess you did. So congrats.
February 8, 201412 yr All I did was ask for help. What I didn't ask for is for you to vent your superiority issues on me. I don't know what you're trying to prove here, that I'm not as skilled as you in a language that I have learned very little about? Because you're right. There was absolutely no need for your comment other than to enlarge dat e-peen, which I guess you did. So congrats. I gave you an answer and I gave my own opinion. This had nothing at all to do with the language, it's basic understanding of file extensions which any computer user who has more knowledge than my grandmother should know about. It's not like I only posted the insult, I posted it together with an answer. Now either you can continue bitching about it or take it as a man and take a look at the answer I provided you with, it's up to you. Edited February 8, 201412 yr by Parameter
February 8, 201412 yr Author I gave you an answer and I gave my own opinion. This had nothing at all to do with the language, it's basic understanding of file extensions which any computer user who has more knowledge than my grandmother should know about. It's not like I only posted the insult, I posted it together with an answer. Now either you can continue bitching about it or take it as a man and take a look at the answer I provided you with, it's up to you. <?php header('Content-Type: image/png'); ?> So tell me why this didn't work?
February 8, 201412 yr <?php header('Content-Type: image/png'); ?> So tell me why this didn't work? Alright. You see, you've saved the file as .php, the file extension won't magically change so you'll need to save it as .png if you want it to look like a .png file. Now, here comes the 'tricky' part, you need to modify (or create if you don't already have it) your .htaccess file. Why? Then your .png files will be parsed as .php files.
February 8, 201412 yr Author EDIT: For anyone who may use this at a later, none of the above worked for me. I came up with another solution however; .htaccess: <Files fakelogo.png> //whatever file you use below ForceType application/x-httpd-php //parses it as a php file </Files> Then create a fakelogo (mine was fakelogo.png), edit it and put your output method Edited February 8, 201412 yr by zScripz
February 9, 201412 yr EDIT: For anyone who may use this at a later, none of the above worked for me. I came up with another solution however; .htaccess: <Files fakelogo.png> //whatever file you use below ForceType application/x-httpd-php //parses it as a php file </Files> Then create a fakelogo (mine was fakelogo.png), edit it and put your output method You do know that's exactly what we told you to do lol
February 12, 201412 yr Actually, all you need to do is edit the .htaccess, like mentioned above.Output: Edited February 16, 201412 yr by BrainDeadGenius
Create an account or sign in to comment