Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Nov 2005
    Posts
    66
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Explode URL and Use Script

    Okay, so right now I have a script that I made that lets a user type in their username & country and then generates a signature image (PNG) for them to put as their signature in a forum.

    Right now, they can go to:

    http://mysitehere.com/sig.html

    Type in Username, Country, and select a signature background image.

    Then it will go through a script: sig.php that builds the image based on their username, country, and selected background.

    The signature also shows their live status, either: Online (browsing the forum) or Offline (not logged in).

    How do I make it so that anyone who goes to:

    http://mysitehere/background1/usa/xibe
    or
    http://mysitehere/backgroundchoice/country/username

    will be taken through the sig.php script and their signature made.

    That way they can go to the forum and use:
    PHP Code:
    [img]http://mysitehere/backgroundchoice/country/username[/img] 
    as their sig.

    I'm sorry this is confusing but does anyone get it??

  • #2
    Senior Coder TheShaner's Avatar
    Join Date
    Sep 2005
    Location
    Orlando, FL
    Posts
    1,126
    Thanks
    2
    Thanked 40 Times in 40 Posts
    sig.html has a form that submits their user name, country, and background selection. These key and value pairs get sent to sig.php. So, if you want those same key and value pairs sent to sig.php, you would do:

    http://mysitehere.com/sig.php?userna...a&background=1

    This is all assuming that the form field for username is called username, the country form field is called country, and the background form fields are called background.

    Also, since you will be posting the values to the query string, you have to make sure that your sig.php script checks both POST values and GET values (i.e. method=post form values and query string values). Or, if the script uses $_POST to grab the form values, you just change them to $_REQUEST, although some may argue you shouldn't use $_REQUEST anymore. And, your last alternative which I think is the best, is to change your form's method to method=get and change your sig.php script to use $_GET to grab the values.

    -Shane

  • #3
    New Coder
    Join Date
    Nov 2005
    Posts
    66
    Thanks
    8
    Thanked 0 Times in 0 Posts
    Thank you SOOO much.

    That worked great.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •