Jump to content


Photo

Passing parameters using Java Script to another PHP and open it


  • Please log in to reply
1 reply to this topic

#1 darantes

darantes
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 19 May 2006 - 03:02 PM

Hi all !

Let me see if anyone can help me with that. I spent hours and hours on this, but in the end, I abandoned cause I really think this has no solution.

The whole thing is:
* I have a login page;
* I enter my username and password and click Login;
* An ajax request queries the database to validate my login;
* I receive the request response and, at this point, I deny the login or I grant it.
* When granting the login, I call the next page and everything is ok, [!--coloro:#FF0000--][span style=\"color:#FF0000\"][!--/coloro--]unless if you want to send some variables to the next page.[!--colorc--][/span][!--/colorc--]

[!--coloro:#FF0000--][span style=\"color:#FF0000\"][!--/coloro--]This is my blocking point[!--colorc--][/span][!--/colorc--]. The next page that is called when the login is well done I will need the user name, id, email, etc...

My question is: How to send variables through POST or GET without submiting a form and thus reloading the page ?

I tried to make another Ajax request to my next page, but it definitely makes no sense ! Also I thought using cookies would easily solve my problem, but I don't like the idea regarding that many users have cookies disabled on their browsers.

I know it is possible to do because I see Gmail working like that ! But even tracking its login page java script source code, I didn't find out how they do it.

One can say it is worthless because all this work will only prevent the page from reloading, and instead I could submit the form, but here my aim is to turn the pages every time more dynamic using new technologies and surely, giving the web a more beautiful look ;)

Anyone have any idea ?


#2 nogray

nogray
  • Members
  • PipPipPip
  • Advanced Member
  • 930 posts
  • LocationSan Francisco CA

Posted 25 May 2006 - 07:34 AM

Have you tried domain.com/page.php?Var1=value&Var2=value2? This will send the variables as a get request. Also, you always can use sessions (in php) to store the data from one page to another.

NoGray.com





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users