将变量从页面传递到另一个页面 [英] passing a variable from page to another page

查看:60
本文介绍了将变量从页面传递到另一个页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我想问一个关于如何在页面之间传递变量的问题。例如,我有第一页用于登录并使用了一个带cookie的会话,在成功提交并将我的页面重定向到另一个页面之后,我想要显示Hello Smith或Welcome Smith等语句,但它无法正常工作。任何人都知道洗礼会受到赞赏。谢谢

Hi there, I would like to ask a question about how to pass a variable from page to page. For example, I have my first page for login and used a session with cookie and after submitting successfully and redirect my page to another page I want show statement like Hello Smith or Welcome Smith, and it doesn''t work properly. Anyone knows the soulution would be appreciated. Thanks

展开 | 选择 | Wrap | 行号

推荐答案

嘿。


第24行有一个语法错误。 if else else if 语句不匹配。


通常最好总是使用带有if语句的括号,即使它们只在代码行上执行。这有助于避免这些问题。

Hey.

There is a syntax error there on line 24. The if, else and else if statements don''t match up.

It is generally best to always use brackets with if statements, even if they only execute on line of code. It helps to avoid problems like these.

展开 | 选择 | Wrap | 行号


其实我写了代码而且我知道它这是错的,因为我选择了如何将会话变量传递到另一个页面的例子,我问的是这个。无论如何,感谢很多人通过我的帖子。
Actually the I wrote the code and I knew that it''s wrong because I picked up just for example of how to pass session variable to another page and I was asking about this. Anyway thanks a lot of passing my thread.


你可以试试这个

you can try this

展开 | 选择 | 换行 | 行号


这篇关于将变量从页面传递到另一个页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆