Click to See Complete Forum and Search --> : get a variable from another page


giladasaf
November 29th, 2003, 02:54 AM
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

professorX
November 29th, 2003, 04:28 AM
NO!!!
For that You can use server-side script language - PHP, ASP, Perl, Python or other. VBScript and JavaScript are client-side script languages

giladasaf
November 29th, 2003, 04:42 AM
:(
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

Satishpp
December 1st, 2003, 04:42 PM
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/scripts/ShowCode.asp?lngWId=4&txtCodeId=6987

Satish

professorX
December 2nd, 2003, 01:56 AM
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);

morrowasted
December 3rd, 2003, 11:08 PM
easily done in php using


setcookie('name, 'variable', time_to_cancel);

( more info here (http://us3.php.net/manual/en/function.setcookie.php))
on the next page


if(isset($_COOKIE['cookie'])){
'do crap
}

professorX
December 4th, 2003, 02:27 AM
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
}