让jquery知道哪个是最后访问的php页面? [英] let jquery know which was the last visited php page?
问题描述
这有点棘手.
通常,当某人单击要求他进行注册的链接时,此人将被重定向到注册页面,然后返回到上次访问的页面.这可能是因为该链接通过url将GET密钥发送到了registration.php,该注册使用该密钥返回到上次访问的页面.
usually when someone clicks on a link that requires him to register, this person will be redirected to the registration page and then back to the last visited page. this is possible cause the link sent a GET key through the url to the registration.php which uses the key to go back to last visited page.
但是我打算使用jquery ajax进行注册.基本上香港专业教育学院有3个不同的PHP页面.它们都包含相同的header.php.和在header.php香港专业教育学院有一个注册按钮,我有我的标签.当单击此按钮($(#registration_button).click()...)时,jquery将显示一个带有注册信息的框(隐藏在浏览器中央的div).然后他将注册,我将他重定向到上次访问的页面,即他看到的当前页面.我必须刷新php页面才能显示注册用户可以看到的所有链接,这就是为什么我必须使用window.location.href.
but i intend to use jquery ajax for registration. basically ive got 3 different php pages. all of them include the same header.php. and in header.php ive got a registration button which i have id tagged. when this button is clicked ( $(#registration_button).click()... ) jquery will show a box (a div that was hidden in the center of the browser) with registration information. then he will register and i will redirect him to the last visited page, that is to say the current one he sees. i have to refresh the php-page to be able to show all links that a registered user can see, thats why i have to use window.location.href.
现在问这个问题.我如何让jquery知道他正在访问哪个页面?香港专业教育学院有3个php页面.
now to the question. how do i let jquery know which page is the current one he is visiting? ive got 3 php-pages.
如果您不了解某些内容,请随时提问. 或者,如果您有其他解决方案的建议,请告诉我.但我真的想立即显示注册框,而无需将其重定向到另一页.
if there is something you dont understand, please free to ask. or if you got suggestions of other solutions, let me know. but i really want to display the registration box right away without redirecting him to another page.
推荐答案
您可以最初在php中设置cookie,然后通过js更新/读取它们.
You can set cookies initially in php and then update/read them via js.
这篇关于让jquery知道哪个是最后访问的php页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!