Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

How do i put PHP in a image?


ghost's Avatar
0 0

How do i put PHP in a image?


ghost's Avatar
0 0

Open image in hex editor and put php code into file. Usually adding it just before the end doesn't corrupt the image (you will need to replace some existing data, as far as I know you couldn't add new data withoud corrupting the file)


ghost's Avatar
0 0

Create a new file. Put your PHP code into it. Save it as whatever.jpg or whatever image extension you want.

Now you need to edit your (or create) htaccess file to force whatever.jpg to be read as a PHP application. Try a quick google search on htaccess forcing or something similar.

Slodave: that would not work because it would not execute as PHP.


ghost's Avatar
0 0

Yep, you have right. It must be executed throught include, or you had to change extensition to php. The type which I discribe is useful to bypass upload filters (if it use only mime veritification).


ghost's Avatar
0 0

Assassin8 wrote: Create a new file. Put your PHP code into it. Save it as whatever.jpg or whatever image extension you want.

Now you need to edit your (or create) htaccess file to force whatever.jpg to be read as a PHP application. Try a quick google search on htaccess forcing or something similar.

Slodave: that would not work because it would not execute as PHP.Thank you

What extension should i save the htaccess file?


ghost's Avatar
0 0

Michael33 I recomend you to read tutorial about what htacess is: http://httpd.apache.org/docs/howto/htaccess.html

Theorethically you have to force server to read your file (like image file in your case), this can be done with htaccess in which you set which file types was processed by server. It can also be done by processing image file throught include()…


ghost's Avatar
0 0

Where can I get hex editor??


ghost's Avatar
0 0

Where can I get hex editor??