|
-
May 31st, 2006, 08:22 PM
#1
Thread Starter
Addicted Member
[Resolved] PHP Dynamic sig
Thanks to a friend i got a script working below but i would like to make it so i can give out the link with a small alteration so people can have their username in the window
eg: http://sf.greyfyre.info/roed/dynamicsig/Jazz00006
or
http:http://sf.greyfyre.info/roed/dynamic.../Some_one_else
is there any way to do this?
all i have at the moment is http://sf.greyfyre.info/roed/dynamicsig/index.jpg which is a php script in disguise and a htaccess file making the browser treat it like a jgp for PHPBB reasons
Last edited by Jazz00006; Jun 1st, 2006 at 06:12 PM.
Reason: resolved
-
May 31st, 2006, 09:09 PM
#2
Stuck in the 80s
Re: PHP Dynamic sig
Can you place a query string behind it? Like index.jpg?user=alfonso ?
Also, why does it have to have a .jpg extension? Does PHPBB check file extensions in signatures?
-
May 31st, 2006, 09:16 PM
#3
Re: PHP Dynamic sig
Use mod_rewrite. That allows you to both include the username in the URL and save having to assign .jpg to PHP using .htaccess.
Code:
RewriteEngine On
RewriteRule ^dynamicsig/([a-z0-9_\-]{1,})/index\.jpg$ dynamicsig/index.php?user=$1
that will transform the following URL:
http://sf.greyfyre.info/roed/dynamicsig/penagate/index.jpg
to this:
http://sf.greyfyre.info/roed/dynamicsig/index.php?user=penagate
Should solve any problems with users and file extensions.
-
May 31st, 2006, 09:27 PM
#4
Thread Starter
Addicted Member
Re: PHP Dynamic sig
So do i put
RewriteEngine On
RewriteRule ^dynamicsig/([a-z0-9_\-]{1,})/index\.jpg$ dynamicsig/index.php?user=$1
in the HTaccess file? or where else?
and is there anything else i need to do because im new to php and dont know anything (much)
Last edited by Jazz00006; May 31st, 2006 at 09:31 PM.
-
May 31st, 2006, 09:38 PM
#5
Re: PHP Dynamic sig
Put that in an .htaccess file in the "roed" directory.
Assuming it works, it will allow you to use the first form of url to access the sig (dynamicsig/abc/index.jpg) and behind the scenes on your server it will be transformed to the second form (dynamicsig/index.php?user=abc). So within your script it will be as if the user requested that URL, when really it's transparently handled by mod_rewrite.
-
May 31st, 2006, 09:42 PM
#6
Thread Starter
Addicted Member
Re: PHP Dynamic sig
Forbidden
You don't have permission to access /roed/dynamicsig/penagate/index.jpg on this server.
did i do something wrong?
-
May 31st, 2006, 09:51 PM
#7
Re: PHP Dynamic sig
Interesting,
Make sure the permissions levels on /roed and /roed/dynamicsig are set to 755.
-
May 31st, 2006, 09:54 PM
#8
Thread Starter
Addicted Member
Re: PHP Dynamic sig
Ill have to ask my friend to do that (im leeching from his server and don't know how to do it) (or i dont have access to it) Cheers, ill get back to you when hes replyed
-
Jun 1st, 2006, 06:11 PM
#9
Thread Starter
Addicted Member
Re: PHP Dynamic sig
Cheers guys it works
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|