#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Posts
    1
    Rep Power
    0
    I want to be able to process parameters passed along with the url. Something like:
    http://www.thispage.com/help?topic=browsing

    The only ways I currently know how to process the parameters are using a custom CGI script or some server application like ColdFusion. Is there a way to access this via Javascript? Or even something simpler?

    Thanks!

    ------------------
    Dan Gilbert
    dan@26thavenue.com
    http://www.26thavenue.com
  2. #2
  3. No Profile Picture
    Gödelian monster
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jul 1999
    Location
    Central Florida, USA
    Posts
    2,307
    Rep Power
    62
    Sure, all you are doing is setting a variable and giving it a value, which can be accessed in Javascript, or in server-side scripting.

    So when the browser calls this URL:
    http://www.thispage.com/help?topic=browsing

    The variable "topic" now has the value "browsing", which you can now proceed to use in any way you want. In Javascript inside that page you could do

    document.write(topic)

    and the browser would print out

    browsing
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2000
    Posts
    108
    Rep Power
    15
    Hello..

    An alternate means to process URL parameters is with XSSI - which is very browser-independent.

    For more information on XSSI, WebMonkey holds a great tutorial on it at http://hotwired.lycos.com/webmonkey/...tml?tw=backend

    Good Luck!
    Josh http://www.datera.com
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    65
    Rep Power
    15
    Hi, i am new in javascript

    How about passing a javascript variable to the url??

    something like...

    mypage.html?name=username&id=userdi

    can any one help??
  8. #5
  9. No Profile Picture
    fantom
    Guest
    Devshed Newbie (0 - 499 posts)
    Does anyone know if this can be done in PHP3 too?
    It would help me a lot...
  10. #6
  11. No Profile Picture
    Gödelian monster
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jul 1999
    Location
    Central Florida, USA
    Posts
    2,307
    Rep Power
    62
    Of course it can be done in PHP. Just try it and see.

    test.php3:

    <?php
    echo $testvariable;
    ?>

    open http://yourserver/test.php3?testvariable=Hello+World!

  12. #7
  13. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2000
    Location
    SPAIN
    Posts
    47
    Rep Power
    15
    mfkoo:

    You can pass variables between pages using location.search

    An example:

    if you call a page with a javascript generated link like:

    <a href="Profile.htm?Name='Peric Ofpalots';Gender='male';Age=15">View your profile</a>

    Profile.htm must have this code inside the <SCRIPT> tag:

    eval(location.search.substring(1));


    this creates the variables Name,Gender & Age (if they were'nt defined) and puts the specified information inside them.


  14. #8
  15. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 1999
    Posts
    84
    Rep Power
    15
    You can find a tutorial on sending objects from page to page via Javascript here:
    http://www.wsabstract.com/javatutors/send1.shtml

    Spookster

    ------------------
    Visit the WSAbstract Help Forum for your Javascript, DHTML, or General Web Design Questions

Similar Threads

  1. Same domain name in URL across multiple domains?
    By starbellie in forum Apache Development
    Replies: 0
    Last Post: February 20th, 2003, 08:24 AM
  2. mod_rewrite URL parameters problem with % char
    By tow_adam in forum Apache Development
    Replies: 1
    Last Post: February 10th, 2003, 12:52 AM
  3. Redirection - depending upon URL
    By ThePikey in forum HTML Programming
    Replies: 7
    Last Post: January 11th, 2003, 10:18 AM
  4. Getting URL parameters into javascript
    By midntrdr in forum JavaScript Development
    Replies: 2
    Last Post: April 12th, 2002, 08:13 PM
  5. Passing encoded parameters through URL
    By aas in forum PHP Development
    Replies: 6
    Last Post: September 4th, 2000, 03:01 AM

IMN logo majestic logo threadwatch logo seochat tools logo