Results 1 to 2 of 2

Thread: How to create a link based on user input

  1. #1
    Join Date
    Aug 2007
    Location
    Lakeland, Florida
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post How to create a link based on user input

    I have a form that prompts user for a client code (i.e. 0001).
    When the code (0001) is entered and the submit button clicked I need to
    build a link based on client code and link the user
    to https://ipaddress/ABC/0001.


    The variable is the client code

    How do I construct the link then execute it?


  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Assuming you can use PHP, this will work:

    <?php echo 'http://..../.../file.ext?code='.$_GET['code']; ?>

    That will work if the link to the page is ?code=0001, which would be the case with method="get" on the form. If you chose to use method="post", just use $_POST[... instead.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

Bookmarks

Posting Permissions

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