Sigx

We are the future in the past.
It is currently Sat Aug 08, 2020 3:25 pm

All times are UTC - 8 hours




Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 15 posts ] 
Author Message
 Post subject: How to forward a .php to a png (jpg)
PostPosted: Fri Jan 16, 2004 10:49 am 
Offline
Site Admin

Joined: Thu Jul 03, 2003 1:59 pm
Posts: 454
Location: Los Angeles
you need to create a .htaccess file in your folder (apache only)

Code:
Redirect /sigx/sigx.png http://www.mysite.com/sigx/sigx.php



there might be some modules that need to be enabled, (mod rewrite ??) i dont remmber, this is untested but assumed it should work.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 16, 2004 6:31 pm 
Offline

Joined: Tue Jan 13, 2004 7:24 pm
Posts: 16
Just 301 it.

Or, be a cheater like I can be, and add an
AddType application/x-httpd-php .jpg
(or some other uncommon, but accepted image extension) to your .htaccess in the directory you wish to use the script from.

If your host allows it (some do, some don't), you'll get the same effect as if you were calling the php script.
As example:
Code:
http://bbs.pixelechoes.net/sigx/i-cheat.bmp

Image
Yes, it's a jpeg.

Oh, and you were looking for
Code:
Redirect 301 mysigx.png http://domain.tld/sigx-remote/sigx.php

mod_rewrite is not necessary. All it's doing is modifying headers sent to a given client.
It's also the recommended way to handle "Hey, my site has moved" situations. It keeps you from getting killed on Google, et al.

_________________
Image


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 16, 2004 11:47 pm 
Offline
Site Admin

Joined: Thu Jul 03, 2003 1:59 pm
Posts: 454
Location: Los Angeles
first, id like to say i like your background image.

ya the addtype is a bit tricky way of doing it, for most it should work, but not the best ofcourse.


what i use is the

Code:
RewriteEngine on
RewriteRule ^/images/sigx\.png /image.php


im not sure if this exact thing will work, for this you definatly need the modrewrite module enabled in apache


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 29, 2004 5:09 am 
Offline

Joined: Thu Jan 29, 2004 4:15 am
Posts: 1
<sighs> okay short of sounding like the idiot I am - I can't get this to work.

Whenever I put in the link of 'img]http://url.to/sigx.php[/img' with my domain name (yes the page is directly in the root) then it doesn't load. It tells me its looking for the source of the php page itself. I've got the FULL link to the image in the '$backIMG' section of the php page itself.

I've tried mucking with all this code here for the .htaccess file but its really hard to follow and I have a feeling this would help me. If possible could you make a 'n00b' version of the .htaccess file that would work to redirect to the jpg I've got? Sort of like the actual remote code you're letting us use in the 'change this stuff here if you want it to work' idea.

Sorry but I'd really like to use a custom image... :(


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 29, 2004 11:58 am 
Offline
Site Admin

Joined: Thu Jul 03, 2003 1:59 pm
Posts: 454
Location: Los Angeles
ok, first make sure that your server allows you to have .htaccess files, either ask the admin or create the .htaccess file.



this is what my .htaccess file looks like:

Code:
Redirect /remote/randskin/random.png http://sigx.yuriy.net/remote/randskin/index.php



notice the /remote/randskin/ is a folder, so i had to specify the whole location.

my php file is called index.php, but in your case it can be called sigx.php or anything you like. for this example i'll use sigx.php.

so, if you have a folder on your domain.com called sigx and your php script is called sigx.php, your .htaccess file would look like this:

Code:
Redirect /sigx/sigx.png http://domain.com/sigx/sigx.php



you save that as .htaccess and place it in the same folder as your sigx.php and everything should magically work.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 17, 2004 2:45 am 
Offline

Joined: Tue Mar 16, 2004 10:51 pm
Posts: 15
Bah... I have Apache installed and I can't get PHPs to work at ALL on it... it doesn't matter where I link it from it always just links to the text version... and gives me a broken image... I guess you could say I haven't the slightest what I'm doing... but at least the server is WORKING... :P

Does anyone know (possibly) what I'm doing wrong?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 17, 2004 9:09 am 
Offline

Joined: Sat Jan 17, 2004 3:13 pm
Posts: 181
Landslyde wrote:
Bah... I have Apache installed and I can't get PHPs to work at ALL on it... it doesn't matter where I link it from it always just links to the text version... and gives me a broken image... I guess you could say I haven't the slightest what I'm doing... but at least the server is WORKING... :P

Does anyone know (possibly) what I'm doing wrong?
you don't have php installed and/or configured with apache properly...

_________________
]Image


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 17, 2004 9:21 am 
Offline

Joined: Mon Mar 15, 2004 1:48 pm
Posts: 1397
Location: Los Angeles
you probably need to add the php module into your apache config file.

_________________
Image

Image

Image


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 17, 2004 6:32 pm 
Offline

Joined: Tue Mar 16, 2004 10:51 pm
Posts: 15
I have PHP installed and everything... I've switched back to Abyss as I find it much easier to use... now whenever I attempt to load the php I get this...

Quote:
Notice: Undefined variable: bkIMG in C:\Hosted\sigx.php on line 95

Fatal error: Call to undefined function: imagefontwidth() in C:\Hosted\sigx.php on line 101


Anyone know how to fix it?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 17, 2004 7:55 pm 
Offline

Joined: Mon Mar 15, 2004 1:48 pm
Posts: 1397
Location: Los Angeles
define it.

_________________
Image

Image

Image


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 17, 2004 10:07 pm 
Offline

Joined: Tue Mar 16, 2004 10:51 pm
Posts: 15
Riiiiiigggghhhhhtttt... as what... and how?

I've never coded PHP before... and it reminds me too much of Java... *shudders*

Edit:

Now I have THIS!

Quote:
Notice: Undefined variable: curWidth in sigx.php on line 102

Notice: Undefined variable: defaultWidth in sigx.php on line 102

Notice: Undefined variable: curWidth in sigx.php on line 102

Notice: Undefined variable: defaultWidth in sigx.php on line 102

Notice: Undefined variable: curWidth in sigx.php on line 102

Notice: Undefined variable: defaultWidth in sigx.php on line 102

Notice: Undefined variable: curWidth in sigx.php on line 102

Notice: Undefined variable: defaultWidth in sigx.php on line 102

Notice: Undefined variable: curWidth in sigx.php on line 102

Notice: Undefined variable: defaultWidth in sigx.php on line 102

Notice: Undefined variable: defaultWidth in sigx.php on line 106

Notice: Undefined variable: defaultWidth in sigx.php on line 107

Fatal error: Call to undefined function: imagefontheight() in sigx.php on line 110


I dunno... defined it and then it still gave me the imagefontheight error... :P

Edit AGAIN! :

I have it saying this now...

Quote:
Fatal error: Call to undefined function: imagefontwidth() in C:\Hosted\sigx.php on line 101


And I'm not sure how to fix it... btw folks... sorry for the stupid questions... XD[/quote]


Last edited by Landslyde on Wed Mar 17, 2004 10:16 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 17, 2004 10:11 pm 
Offline

Joined: Mon Mar 15, 2004 1:48 pm
Posts: 1397
Location: Los Angeles
you need GD installed

_________________
Image

Image

Image


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 17, 2004 11:18 pm 
Offline

Joined: Tue Mar 16, 2004 10:51 pm
Posts: 15
Ok after dicking around with it (and turning off report errors... which was my MAIN problem) I finally got it working... :P


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 05, 2004 8:49 pm 
Offline

Joined: Mon Apr 05, 2004 8:37 pm
Posts: 335
Location: /home/chair/sitting down/
Well, just for anyone who is too lazy to work with .htaccess and so many other things, give this a shot

Code:
http://www.site.com/sigx/page.php?ext=.png


that'll trick a buncha different bb systems into thinking that its a png. Replace png with whichever extension you need

heres is an example of it in true, working form

Image

a friend suggested this, and amazingly, it worked

it also works in links : http://www.dh5.net/sig/DHFlat04.php?ext=.png

_________________
Image
My Site: www.dh5.us
I'll kill you Brian Anderson


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 05, 2004 9:32 pm 
Offline

Joined: Mon Apr 05, 2004 8:37 pm
Posts: 335
Location: /home/chair/sitting down/
I had spent about 5 seconds in mspaint on that one, now i spent 2 minutes, and added some cool text stuff

I havent modified the imagecreate/imagecreatetruecolor, so I'm not sure what i'm using

and it is supposed to look kinda fuzzy, i mean, thats what spraypaint tool does

But, i was trying to demonstrate the http://www.site.com/sigx/page.php?ext=.png tool...not show off my sig

_________________
Image
My Site: www.dh5.us
I'll kill you Brian Anderson


Last edited by DarkHorizon on Mon Apr 05, 2004 10:10 pm, edited 1 time in total.

Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 15 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 1 guest


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

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group