Results 1 to 9 of 9

Thread: [Resolved] PHP Dynamic sig

  1. #1

    Thread Starter
    Addicted Member Jazz00006's Avatar
    Join Date
    Feb 2006
    Posts
    185

    Talking [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

  2. #2
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256

    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?
    My evil laugh has a squeak in it.

    kristopherwilson.com

  3. #3
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    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.

  4. #4

    Thread Starter
    Addicted Member Jazz00006's Avatar
    Join Date
    Feb 2006
    Posts
    185

    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.

  5. #5
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    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.

  6. #6

    Thread Starter
    Addicted Member Jazz00006's Avatar
    Join Date
    Feb 2006
    Posts
    185

    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?

  7. #7
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: PHP Dynamic sig

    Interesting,

    Make sure the permissions levels on /roed and /roed/dynamicsig are set to 755.

  8. #8

    Thread Starter
    Addicted Member Jazz00006's Avatar
    Join Date
    Feb 2006
    Posts
    185

    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

  9. #9

    Thread Starter
    Addicted Member Jazz00006's Avatar
    Join Date
    Feb 2006
    Posts
    185

    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
  •  



Click Here to Expand Forum to Full Width