|
08-23-2005, 04:15 PM
|
Slayer of clock cycles
|
|
Join Date: Nov 2004
Server: Oasis
Posts: 3,464
|
|
You did rename the php file to filename.gif?
Also did it ever work? Like before you added the htaccess could you go to that url and it would show up in your brawser?
|
08-24-2005, 03:55 AM
|
|
A Grove Wisp
|
|
Join Date: Jan 2005
Server: Mistmoore
Posts: 27
|
|
Toran, your sig is a gif file. I guess I just want to know how to do it. Can you walk me thru, step buy step? I am a nurse by profession, not a php geek (just an eq geek, lol )
Its in my sig right now. I just cant get it to "fake" out the bb by being a .gif file.
I saw this info, but didnt make sense to me.
http://www.scriptygoddess.com/archiv...-a-php-script/
Quote:
October 19 2004
Lessons learned | Script snippet: gifs that execute a php script
Problem: (somewhat in line with my last post) I needed to run a script in the "background", but I only had the ability to present the script as a .gif.
Solution: actually, I came up with two ways of doing this and both use .htaccess to pull it off.
1) I'm a gif but really I'm a php script
This one is fairly straightfoward. I put my script in a seperate directory, (that doesn't actually include any images!) and renamed it from filename.php to filename.gif (or filename.jpg) (Yes, I know it's not really an image file. Hang in there)
Then, in the htaccess file for JUST THAT FOLDER! (similar to this trick) I added this:
AddType application/x-httpd-php .php .jpg .gif
FYI - in your php file (that now looks like a .gif or .jpg) make sure you don't have any headers/text echoed, and at the end of the file add this to your php code:
header('Content-Type: image/gif');
@readfile( '/SERVERPATH/TO/A/REAL/IMAGE/spacer.gif' );
You can then include the "script" as if it were an image file, it will run the script, but only display a gif to the user.
You can even pass it variables like filename.gif?somevariable=somevalue&anotervariable=anothervalue, but there's another way to do that too without the ugly URL.
2) I'm a gif that's actually a php script super-powered with rewrite
Ok, starting from the beginning. You have your script (filename.php) in a folder, add the following to the .htaccess file in that folder:
RewriteEngine On
RewriteBase /
RewriteRule ^(.*)/(.*)/spacer.gif /YOURFOLDER/FILENAME.php?somevar=$1&anothervar=$2 [QSA]
Before we continue, I must tell you that I dont' completely understand rewrite rules. There's a LOT of holes in my knowledge. So if you have a better way, PLEASE post it in the comments. I would LOVE to be able to understand what the hell I'm doing. LOL.
OK, moving along. Now you can call your script by actually calling that "phantom" spacer.gif, with the variables in the URL as if they're directories like this:
"http://www.yourdomain.com/YOURFOLDER/somevalue/anothervalue/spacer.gif"
Again, make sure you have this at the end of you php code in your filename.php:
header('Content-Type: image/gif');
@readfile( '/SERVERPATH/TO/A/REAL/IMAGE/spacer.gif' );
Posted by Jennifer
|
Last edited by Denuve : 08-24-2005 at 04:00 AM.
|
08-24-2005, 09:03 AM
|
Slayer of clock cycles
|
|
Join Date: Nov 2004
Server: Oasis
Posts: 3,464
|
|
You have to rename the image.php file to image.gif on your host. Then the .HTACCESS should do its job. If you have already renamed it to .gif let me know, because its still reporting as image.php.
What the code in the .HTACCESS is doing is telling the server any time it calls/sends the file image.gif to send it as a .gif but to run it as a .php file.
Last edited by Landiin : 08-24-2005 at 09:10 AM.
|
08-24-2005, 11:19 AM
|
|
A Grove Wisp
|
|
Join Date: Jan 2005
Server: Mistmoore
Posts: 27
|
|
Im thinking I cant set the sethandler info on my server. My .htaccess file keeps dissapearing after I ftp it. Its there for a few mins, then gone. My gif never shows up. I have posted the code I am using above, changed the file name to .gif, ftp the htaccess file to the same directory. And nothing. Just a place holder for the picture. When I check the code of the page, the php code shows up. So I know its the right file.
Anymore suggestions? Thanks for replying, its been a pain for months now, I just didnt post anything till now.
www.wawwb.com/eq2sig/denuvesig.gif is the file
Den
|
08-24-2005, 12:51 PM
|
Slayer of clock cycles
|
|
Join Date: Nov 2004
Server: Oasis
Posts: 3,464
|
|
Hmm does that server suport php? When I click the link, I get a your files code and not the processed php. kind of like its a text file and makes me think that the server dosn't suport php.
What ftp client are you using? Some have trouble showing .anything files.
|
08-24-2005, 01:39 PM
|
|
A Grove Wisp
|
|
Join Date: Jan 2005
Server: Mistmoore
Posts: 27
|
|
It supports it, i have 5 databases, my website is postnuke and my sig is php that im using now.
Sorry to bother you, but I dont think you understand what I am talking about. But thanks for the help.
Its possible I need to change the sethandler info on the server, which I cannot do without the hosting company doing it for me.
|
08-24-2005, 04:58 PM
|
|
EQ2MAP Updater Author
|
|
Join Date: Nov 2004
Server: Antonia Bayle
Posts: 1,349
|
|
instead of trying to change the set handler, to make a gif run as php why not use the htaccess to redirect to the php file while showing that its a gif. this would only work if you are able to use htaccess though, and it looks like you said you might not be able to.
example:
http://www.kastechnology.com/44487783.png
what it really goes to:
http://www.kastechnology.com/sig.php?id=44487783
code in the htaccess file:
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^([0-9]*)\.png$ /sig.php?id=$1 [NC]
you will obviously want to modify the htaccess because its used for a totally diffrent script and game so the information it needs is different(and its even a png instead of gif). if you dont know how to modify it to what you need let me know and i will. its just a simple regex so its nothing complicated.
EDIT: looks like this is basically what denvue posted, sorry i didnt read up a few posts.
Last edited by taco-man : 08-24-2005 at 05:01 PM.
|
08-31-2005, 11:28 PM
|
A Coastal Crab
|
|
Join Date: Jun 2005
Server: Crushbone
Posts: 1
|
|
Quote:
Originally Posted by Mithriler
Anyone knows why i'm getting this error?
9:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'ENGINE=MyISAM' at line 1
|
FWIW, I got this too initially. Even though the fix was posted:
Quote:
Originally Posted by taliesan
figured out what my problem with the database was.. It didnt like me defining the Engine.
By Changing This:
,PRIMARY KEY(`id`)) ENGINE=MyISAM;";
To This:
,PRIMARY KEY(`id`));";
The problem was resolved.
|
This fix corrected my error too, ty poster
Quote:
Originally Posted by Mikeablah
That ;nsbps thingy on the bottom left is what you referring to? Its been doing that since the update to eq2players.
|
-It shows instead of the player rank
The fix for this is very easy actually, but took me a few hours of sifting to find. (hope you dont mind me digging in, 0ctavius)
In the image.php file, there are 3x instances of:
*also 3x instances in test.php, fwiw*
change these to:
Another anomaly id like to see squashed is in Advanced mode:
-It shows 'ToolTip' in the mental number
...also shows addition of ' ToolTip' text in the DB as well as in test.php:
http://www.clanmist.com/eq2sig/test.php?cid=318550207
Havent figured this one out yet, 'cept just a str_replace to get rid of it altogether in the global.php, get_html function.
I for one like your code, not my style of writing, but definately not bloated, good job.
Last edited by P05tM0rtm : 09-01-2005 at 02:10 AM.
|
12-20-2005, 02:28 AM
|
A Brown Bear
|
|
Join Date: Apr 2005
Server: Lavastorm
Posts: 12
|
|
Hi i have been trying to get the sig generator to work but i cant get it to display any guild info.
When i set guild = true my sig doesnt display.
Code:
$secure['guild'] = FALSE; // only allow a specific guild id? (TRUE / FALSE)
$secure['gid'] = 163117; // guild id to allow if 'guild' is set to TRUE
?>
sig
Also the Player Status is the member number. How do i change to it said that.
Thank you
|
12-20-2005, 03:32 AM
|
|
A Griffon
|
|
Join Date: Oct 2004
Server: Antonia Bayle
Posts: 3,287
|
|
The page's code in which the generator parses, has since changed since what was posted. Therefor, the code has to be updated, basically by guess and check of which section it's looking at, and assigned to the status variable.
I dunno about the guild thing. Don't use it.
|
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
|
|
|
All times are GMT -5. The time now is 11:15 PM.
|
|