IMG SRC PHP -> PNG
Moderator: General Moderators
IMG SRC PHP -> PNG
I know the title doesn't explain a lot, but here it goes. I an working with a captcha thing, and when I use the src attribute, instead of using captcha.php i want it to be captcha.png. Any way to make this possible?
- Kaleb Klein
------------------------------------
Web Developer | Software Developer
https://kalebklein.com
PGP Key: https://keybase.io/pazuzu156
------------------------------------
Web Developer | Software Developer
https://kalebklein.com
PGP Key: https://keybase.io/pazuzu156
Re: IMG SRC PHP -> PNG
Yes though you'd need to tell the web server than captcha.png is actually a PHP file and should be processed as such.
If you're using Apache you can do this with a .htaccess file something like:
<FilesMatch "^captcha.png$">
ForceType application/x-httpd-php
AcceptPathInfo On
</FilesMatch>
If you're using Apache you can do this with a .htaccess file something like:
<FilesMatch "^captcha.png$">
ForceType application/x-httpd-php
AcceptPathInfo On
</FilesMatch>
Re: IMG SRC PHP -> PNG
How would I use that to map captcha.png to the php file?
- Kaleb Klein
------------------------------------
Web Developer | Software Developer
https://kalebklein.com
PGP Key: https://keybase.io/pazuzu156
------------------------------------
Web Developer | Software Developer
https://kalebklein.com
PGP Key: https://keybase.io/pazuzu156
- phazorRise
- Forum Contributor
- Posts: 134
- Joined: Mon Dec 27, 2010 7:58 am
Re: IMG SRC PHP -> PNG
yes, you can do that with editing/including .htaccess file in that particular directory.
But you need to edit it for that purpose.
Although, i guess/suggest you do it with traditional way (you've mentionem) because when you use .htaccess, it causes overhead on server searching each directory for .htaccess file.
But you need to edit it for that purpose.
Although, i guess/suggest you do it with traditional way (you've mentionem) because when you use .htaccess, it causes overhead on server searching each directory for .htaccess file.
- phazorRise
- Forum Contributor
- Posts: 134
- Joined: Mon Dec 27, 2010 7:58 am
Re: IMG SRC PHP -> PNG
You don't need to worry about that. Server will take care of it with .htaccess file.Pazuzu156 wrote:How would I use that to map captcha.png to the php file?