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 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Nov 2003
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    From URL to web page

    I am creating a page that takes an input from a previous page and displays a paragraph and picture based on the input sent through the URL. I can get the data sent through the web page a show up in a form, but for some reason I cannot get the pictures or words to show up. I am not quite sure what the problem is. Any help would be greatly appreciated. Thank you. The web page is as follows (with sample data already added into the URL):

    http://www.servicelearning.fsu.edu/i...ue='1'

    Thanks again.

  • #2
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You will need to split mySearch once again at (=) for each name,value pair in order to retrieve the value.

    Without rewriting anything.
    This modification will work:
    Code:
     var mySearch = location.search.substr(1).split("&");
     var myPicture = mySearch[0].split("=");
     var myWords = mySearch[1].split("=");
     var pictureFromSearch = myPicture[1];
     var wordsFromSearch = myWords[1];
    And; If you pass the value wrapped in quotes as below.
    You will need to strip those out as well.
    http://www.servicelearning.fsu.edu/i...tmlPics.value='1'&Descript.value='1'


    .....Willy

  • #3
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,068
    Thanks
    0
    Thanked 256 Times in 252 Posts
    There's already a script for parsing querystrings.

    http://www.codingforums.com/showthre...threadid=25786

    For easy parsing, I advise you to use this

    ?Pics=1&Descript=1

    instead of

    ?Pics.value='1'&Descript.value='1'
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #4
    New to the CF scene
    Join Date
    Nov 2003
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks guys, I have it working now. I appreciate the help.


  •  

    Posting Permissions

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