 |
Results from the most recent live auction are here.
21 members in the live chat room. Join Chat!
| |
06-03-2006, 07:55 PM
|
· #1 | | Eating Pie Name: Steve Location: Canada Join Date: Nov 2004
Posts: 2,284
NP$: 91.30 ( Donate)
| 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 |
| |
06-03-2006, 07:58 PM
|
· #2 | | while ($awake){ code(); } Name: Eric Location: Kentucky Join Date: Mar 2005
Posts: 4,268
NP$: 1152.00 ( Donate)
| .htaccess Code:
AddType application/x-httpd-php .png .gif .jpg
And just open notepad...add your code.. save as .jpg or w/e. |
| |
06-03-2006, 08:00 PM
|
· #3 | | Eating Pie Name: Steve Location: Canada Join Date: Nov 2004
Posts: 2,284
NP$: 91.30 ( Donate)
| 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 |
| |
06-03-2006, 08:05 PM
|
· #4 | | while ($awake){ code(); } Name: Eric Location: Kentucky Join Date: Mar 2005
Posts: 4,268
NP$: 1152.00 ( Donate)
| Adding that code to .htaccess will treat the file just like a .php file. You could pass params and use $_GET. |
| |
06-03-2006, 08:13 PM
|
· #5 | | Eating Pie Name: Steve Location: Canada Join Date: Nov 2004
Posts: 2,284
NP$: 91.30 ( Donate)
| 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 |
| |
06-03-2006, 09:20 PM
|
· #6 | | NamePros Member | Here's the exact code. .htaccess
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^(.*)\.jpg$ /showpic.php?pic=$1 [L]
^ The above is all you need.
- tsM |
| |
06-04-2006, 10:48 AM
|
· #7 | | NamePros Member | nice script there mate |
| |
06-07-2006, 10:40 PM
|
· #8 | | Formerly Array Name: Nick Berlette Location: San Diego, CA Join Date: Feb 2006
Posts: 229
NP$: 139.50 ( Donate)
| Yes, this is a nice way to track bandwidth, hits, size, etc.  |
| |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | |