PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Mon Jul 22, 2019 7:57 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Sat May 17, 2008 12:13 am 
Offline
Forum Newbie

Joined: Sun May 11, 2008 2:52 am
Posts: 8
Hello all i am creating one iplogger which also takes data from user like user name etc etc ...
how to use .jpg instead of .php

i hear we have to use .htaccess file.. any idea?

e.g this...
<a href="http://www.nbfun.net/image" target="_blank"><img src="http://nbfun.net/image.gif?uid=11219363453928193824&string=ip&text=YOUR+TEXT+HERE" alt="www.nbfun.net"></a>

Image


Top
 Profile  
 
PostPosted: Sat May 17, 2008 12:45 am 
Offline
DevNet Master
User avatar

Joined: Wed Dec 06, 2006 5:14 pm
Posts: 3635
Location: Toronto, Canada
You have two options:

add jpg as a PHP script extension for that folder
[code=.htaccess]AddType application/x-httpd-php .php .jpg

or silently redirect using mod_rewrite to a PHP file:
[code=.htaccess]Options +FollowSymLinks +Indexes
RewriteEngine on
RewriteBase /
RewriteRule ^image.([^.]+)\.jpg$ image.php?text=$1 [L]
that last snippet cleans up the request to turn image.123.jpg into image.php?text=123. The benefit of that is browsers will cache the image and save you some overhead. Also, it looks nicer IMO and is easier to remember / say / type.


Top
 Profile  
 
PostPosted: Sun May 18, 2008 5:16 am 
Offline
Forum Newbie

Joined: Sun May 11, 2008 2:52 am
Posts: 8
hello thanks for great help :-) its works ..
Its now looks like this : :D :D :D

Reg
Prashant


Last edited by onion2k on Sun May 18, 2008 6:56 am, edited 1 time in total.
Image removed. Don't display people's IP addresses. It's a security risk.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group