CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Aug 2000
    Posts
    242

    get a variable from another page

    Hello

    I sent a variable from page1.html using the get method
    now I want to show it in page2.html.

    I dont want to use asp.

    is there something in vbscript that can get this parameter(myParam)?

    file:///C:/Documents%20and%20Settings/Desktop/page2.html?myParam=tyiti

    thanks Asaf

  2. #2
    Join Date
    Nov 2003
    Location
    Saint-Petersburg, Russia
    Posts
    21
    NO!!!
    For that You can use server-side script language - PHP, ASP, Perl, Python or other. VBScript and JavaScript are client-side script languages
    at Your service always,
    professorX

  3. #3
    Join Date
    Aug 2000
    Posts
    242

    it just seemed to be so easy - just parsing the url
    in this way or another...

    and getting the parameters I need.

    Anyway
    thanks for saving me the time of chaising this ghost- I wouldn't
    stopped - I was just too sure there is a way :P

    Thanks
    Asaf

  4. #4
    Join Date
    Jul 2002
    Location
    India
    Posts
    505
    I dont recommend this, but since the question was "is this possible?", the answer is yes.

    Check this out...
    http://www.planet-source-code.com/vb...txtCodeId=6987

    Satish

  5. #5
    Join Date
    Nov 2003
    Location
    Saint-Petersburg, Russia
    Posts
    21
    Yes, it's possible, but it's no so good way...

    In JS can try it:

    qs = "?show=blabla1&show=blabla2...";
    qsArray = qs.split(/\?show=|&show=/gi);
    at Your service always,
    professorX

  6. #6
    Join Date
    Oct 2002
    Location
    Right Behind you
    Posts
    238
    easily done in php using

    PHP Code:
    setcookie('name, 'variable', time_to_cancel); 
    ( more info here)
    on the next page

    PHP Code:
    if(isset($_COOKIE['cookie'])){
    'do crap

    "3 out of every 4 people make up 75% of the population"
    ---------------------------------------------
    "If the World didn't suck, we would all fall off"
    ---------------------------------------------
    "No pancake is so flat that it doesnt have two sides"
    ---------------------------------------------

  7. #7
    Join Date
    Nov 2003
    Location
    Saint-Petersburg, Russia
    Posts
    21
    ofcouse, use PHP is better way (I told it), but use cookies is no so good...

    On PHP can do it (if Your url is http//Yourdomain.com/YourPage.phtml?YourVal=Value):

    if ($YourVal != "")
    {
    echo $YourVal;
    }

    In Your example can do so (file:///C:/Documents%20and%20Settings/Desktop/page2.html?myParam=tyiti):

    if ($myParam == "tyiti")
    {
    //instructions
    }
    at Your service always,
    professorX

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured