369 users online (0 members and 369 guests)  


  Results 1 to 3 of 3

Related

  1. Problem In Passing Variables    Forum: PHP Forum
    Replies: 2
  2. Replies: 1
  3. Replies: 3
  4. Javascript Variables    Forum: Javascript Forum
    Replies: 2
  5. Hidden Form Variables    Forum: HTML Forum
    Replies: 2
  1. #1
    lcp's Avatar
    New User

    Status
    Offline
    Join Date
    May 2008
    Posts
    1

    build a URL with variables in it

    Hi, I would like to include variables into a URL that I am passing to Yahoo Pipes. In the URL below, I would like to have a variable for EndTime (set below to yesterday) and StartDate (set below to 15+days).
    http://pipes.yahoo.com/pipes/pipe.run?EndDate=yesterday&StartDate=%2B15+days&_id=23e0135e18323711db0d9db51ccca684&_render=kml
    This URL is being passed in my html code that generates a google map:
    var geoXml2 = new GGeoXml(http://pipes.yahoo.com/pipes/pipe.run?EndDate=yesterday&StartDate=%2B15+days&_id=23e0135e18323711db0d9db51ccca684&_render=kml;
    If I could assign the EndTime and StartTime to variables, then I could control what comes back from the Yahoo Pipe onto the map. I think php is the right way to do this, but I'm not sure how. Thanks!

  2. #2
    jthayne's Avatar

    Status
    Offline
    Join Date
    Aug 2008
    Location
    Texas
    Posts
    508

    Re: build a URL with variables in it

    In PHP, do it this way:

    PHP Code:
    // Since these are now PHP variables, you can assign whatever value will work best for you.
    $sDate "15+days";
    $eDate "yesterday";

    $yURL "http://pipes.yahoo.com/pipes/pipe.run?EndDate=" $eDate "&StartDate=%2B" $sDate "&_id=23e0135e18323711db0d9db51ccca684&_render=kml";

    print 
    "var geoXml2 = new GGeoXml(" $yURL ");"

  3. #3
    jthayne's Avatar

    Status
    Offline
    Join Date
    Aug 2008
    Location
    Texas
    Posts
    508

    Re: build a URL with variables in it

    That is how I control the variables within a URL using PHP. Another way would be to enter them into a form and submit it using a GET method.

    If you know a better way, please post it.



Tags for this Thread