[advanced search]
Results from the most recent live auction are here.
21 members in the live chat room. Join Chat!
Register Rules & FAQ NP$ Store Active Threads Mark Forums Read
Go Back   NamePros.Com > Design and Development > Programming
User Name
Password

Old 06-03-2006, 07:55 PM   · #1
iNod
Eating Pie
 
iNod's Avatar
 
Name: Steve
Location: Canada
Trader Rating: (66)
Join Date: Nov 2004
Posts: 2,284
NP$: 91.30 (Donate)
iNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud of
Special Olympics AIDS/HIV Cystic Fibrosis Save The Children Baby Health Cystic Fibrosis
PHP Script Image

Hello,

On a site profilepeep.com they give you a code as the following

Code:
<a href="http://www.profilepeep.com/" target="_blank"> <embed src="http://www.profilepeep.com/j/113152.jpg" border="0" height="0" width="0"> </a>


How do they get php into an image? I know that image has php than it displays a 1x1 pixel jpg image.. I know there is also a header("Content-type: image/jpeg"); code in there.. But how do I get it so I can have php in a file something.jpg or something.gif ?? I was thinking mod_rewrite.. OR even having that image "rewrite" to a phpfile like userid.jpg actually is somefile.php?uid=userid

For example
$userid = 1121
stat.php?uid=1121
1121.gif "rewites to" stat.php?uid=1121

Get that?

- Steve


Please register or log-in into NamePros to hide ads
__________________
RegisterDub.com - 200th Customer Milestone
ZuneParts.net - International Zune Parts and Accessories
FeaturedFont.com - One Top Free Font a Day!
iNod is offline   Reply With Quote
Old 06-03-2006, 07:58 PM   · #2
SecondVersion
while ($awake){ code(); }
 
SecondVersion's Avatar
 
Name: Eric
Location: Kentucky
Trader Rating: (142)
Join Date: Mar 2005
Posts: 4,268
NP$: 1152.00 (Donate)
SecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond repute
Member of the Month
MOTM September 2005 Save a Life Child Abuse 9/11/01 :: Never Forget Baby Health Marrow Donor Program AIDS/HIV Breast Cancer Cystic Fibrosis Ethan Allen Fund Animal Cruelty Ethan Allen Fund Ethan Allen Fund Cancer Alzheimer's Protect Our Planet
.htaccess
Code:
AddType application/x-httpd-php .png .gif .jpg


And just open notepad...add your code.. save as .jpg or w/e.
__________________

SecondVersion.com - The Personal Blog of SecondVersion
Domain Name Portfolio - Get your free copy. - Version 1.0.3 now available!!
SecondVersion is offline   Reply With Quote
Old 06-03-2006, 08:00 PM   · #3
iNod
Eating Pie
 
iNod's Avatar
 
Name: Steve
Location: Canada
Trader Rating: (66)
Join Date: Nov 2004
Posts: 2,284
NP$: 91.30 (Donate)
iNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud of
Special Olympics AIDS/HIV Cystic Fibrosis Save The Children Baby Health Cystic Fibrosis
lol.. You know.. That sounds simple lol..

Now next question.. How can I do it so I cna pass variables through the image name? 111111.jpg = stat.php?uid=111111 or something.

Thanks SV.. As always..

- Steve
__________________
RegisterDub.com - 200th Customer Milestone
ZuneParts.net - International Zune Parts and Accessories
FeaturedFont.com - One Top Free Font a Day!
iNod is offline   Reply With Quote
Old 06-03-2006, 08:05 PM   · #4
SecondVersion
while ($awake){ code(); }
 
SecondVersion's Avatar
 
Name: Eric
Location: Kentucky
Trader Rating: (142)
Join Date: Mar 2005
Posts: 4,268
NP$: 1152.00 (Donate)
SecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond repute
Member of the Month
MOTM September 2005 Save a Life Child Abuse 9/11/01 :: Never Forget Baby Health Marrow Donor Program AIDS/HIV Breast Cancer Cystic Fibrosis Ethan Allen Fund Animal Cruelty Ethan Allen Fund Ethan Allen Fund Cancer Alzheimer's Protect Our Planet
Adding that code to .htaccess will treat the file just like a .php file. You could pass params and use $_GET.
__________________

SecondVersion.com - The Personal Blog of SecondVersion
Domain Name Portfolio - Get your free copy. - Version 1.0.3 now available!!
SecondVersion is offline   Reply With Quote
Old 06-03-2006, 08:13 PM   · #5
iNod
Eating Pie
 
iNod's Avatar
 
Name: Steve
Location: Canada
Trader Rating: (66)
Join Date: Nov 2004
Posts: 2,284
NP$: 91.30 (Donate)
iNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud of
Special Olympics AIDS/HIV Cystic Fibrosis Save The Children Baby Health Cystic Fibrosis
I found out how I can do this.

Using mod_rewrite.

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} .*jpg$|.*gif$|.*png$ [NC]
RewriteRule (.*) /showpic.php?pic=$1

I just change an antileech script I found to work for what I need.

- Steve
__________________
RegisterDub.com - 200th Customer Milestone
ZuneParts.net - International Zune Parts and Accessories
FeaturedFont.com - One Top Free Font a Day!
iNod is offline   Reply With Quote
Old 06-03-2006, 09:20 PM   · #6
tsM
NamePros Member
 
Trader Rating: (1)
Join Date: May 2006
Posts: 27
NP$: 0.00 (Donate)
tsM is an unknown quantity at this point
Here's the exact code.

.htaccess
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^(.*)\.jpg$ /showpic.php?pic=$1 [L]


^ The above is all you need.

- tsM
tsM is offline   Reply With Quote
Old 06-04-2006, 10:48 AM   · #7
adrenerlin
NamePros Member
 
Trader Rating: (0)
Join Date: Jun 2006
Posts: 39
NP$: 59.00 (Donate)
adrenerlin is an unknown quantity at this point
nice script there mate
adrenerlin is offline   Reply With Quote
Old 06-07-2006, 10:40 PM   · #8
-NB-
Formerly Array
 
-NB-'s Avatar
 
Name: Nick Berlette
Location: San Diego, CA
Trader Rating: (44)
Join Date: Feb 2006
Posts: 229
NP$: 139.50 (Donate)
-NB- is a name known to all-NB- is a name known to all-NB- is a name known to all-NB- is a name known to all-NB- is a name known to all-NB- is a name known to all
Yes, this is a nice way to track bandwidth, hits, size, etc.
-NB- is offline   Reply With Quote
Closed Thread

NamePros is a revenue sharing forum.

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


Site Sponsors
Hunting Moon RealTechNetwork EscrowDNS
Advertise your business at NamePros
All times are GMT -7. The time now is 09:25 AM.


Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0