将变量的内容从一个页面带到另一个页面时遇到问题。 [英] Having a problem bringing contents of a variable from one page to another.

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

问题描述




我正在写一个包含大量链接的php脚本。点击时每个链接都会重定向到同一页面,但点击的链接曾经是一个文本字段。然后,一旦用户输入了输入,用户就会键入文本字段,此时文本字段再次成为链接,页面再次重定向到自身。该链接是用户输入前一个文本字段的wutever。我这样做是通过使用$ _REQUEST [....]来获取用户输入的wutever。到目前为止,我只能使其中一个能够工作。我遇到的问题是当用户在完成该过程后单击另一个链接时,前一个过程的变量被删除并输出默认链接。有人可以帮我解决这个问题吗?我发布了一段我的剧本。


谢谢


[PHP] $ outer_link1 ="< a href = \ ;展开= outer_link1\" > outer_link1< / a>" ;;

if($ _REQUEST [''展开''] ==" outer_link1")

{

$ TextField1 ="< input type = text name = outer1 onChange =''submit();''" ;;

echo("< td> $ TextField1< / td>");



}


其他

{


$ outer_link1_contents = $ _REQUEST [''outer1''];


if($ outer_link1_contents)

{

$ outer_link1a ="< a href = \"?Expand = outer_link1 \" > $ outer_link1_contents< / a>" ;;

echo("< td> $ outer_link1a< / td>");


}

其他

{

echo("< td> $ outer_link1< / td>");

}


}


$ outer_link2 ="< a href = \"?Expand2 = outer_link2 \" > outer_link2< / a>" ;;



if($ _REQUEST [''Expand2''] ==" outer_link2")

{

$ outer_link1_contents = $ _REQUEST [''outer1''];

if($ outer_link1_contents)

{

$ outer_link1a ="< a href = \"?Expand = outer_link1 \" > $ outer_link1_contents< / a>" ;;

echo("< td> $ outer_link1a< / td>");



}

其他

{

echo("< td> $ outer_link1< / td>");

}

$ TextField2 ="< input type = text name = outer2 onChange =''submit();''" ;;

echo("< td> $ TextField2< / td>");



}


else

{


$ outer_link2_contents = $ _GET [''outer2''];

if($ outer_link2_contents)

{

$ outer_link2a ="< a href = \"?Expand2 = outer_link2 \" > $ outer_link2_contents< / a>" ;;

echo(" $ outer_link2a");

}

其他

{

echo("< td> $ outer_link2< / td>" ;);


}


} [/ PHP]

Hi

I am writing a php script that contains a bunch of links. Each link when clicked redirects to the same page however where the clicked link once was is now a textfield. The user then types into the text field once the user has entered input the page redirects to itself again this time where the text field was is a link again. The link is wutever the user typed into the previous text field. I am doing this by using $_REQUEST[....] to get wutever the user types in. So far Ive only been able to get one of these to work. The problem I am having is when the user clicks another link after the process is completed the previous process''s variable is erased and the default link is outputted. Can someone help me with this problemF? I am posting a piece of my script.

Thanks

[PHP]$outer_link1 = "<a href=\"?Expand=outer_link1\" >outer_link1</a>";
if ($_REQUEST[''Expand''] == "outer_link1")
{
$TextField1 = "<input type=text name=outer1 onChange=''submit();'' ";
echo("<td>$TextField1</td>");



}

else
{

$outer_link1_contents= $_REQUEST[''outer1''];

if ($outer_link1_contents)
{
$outer_link1a = "<a href=\"?Expand=outer_link1\" >$outer_link1_contents</a>";
echo("<td>$outer_link1a</td>");

}
else
{
echo("<td>$outer_link1</td>");
}


}

$outer_link2 = "<a href=\"?Expand2=outer_link2\" >outer_link2</a>";



if ($_REQUEST[''Expand2''] == "outer_link2")
{
$outer_link1_contents= $_REQUEST[''outer1''];
if ($outer_link1_contents)
{
$outer_link1a = "<a href=\"?Expand=outer_link1\" >$outer_link1_contents</a>";
echo("<td>$outer_link1a</td>");


}
else
{
echo("<td>$outer_link1</td>");
}
$TextField2 = "<input type=text name=outer2 onChange=''submit();'' ";
echo("<td>$TextField2</td>");



}


else
{


$outer_link2_contents= $_GET[''outer2''];
if ($outer_link2_contents)
{
$outer_link2a = "<a href=\"?Expand2=outer_link2\" >$outer_link2_contents</a>";
echo("$outer_link2a");
}
else
{
echo("<td>$outer_link2</td>");

}

} [/PHP]

推荐答案

_REQUEST [....]让用户输入wutever。到目前为止,我只能使其中一个工作。我遇到的问题是当用户在完成该过程后单击另一个链接时,前一个过程的变量被删除并输出默认链接。有人可以帮我解决这个问题吗?我发布了一段我的剧本。


谢谢


[PHP]
_REQUEST[....] to get wutever the user types in. So far Ive only been able to get one of these to work. The problem I am having is when the user clicks another link after the process is completed the previous process''s variable is erased and the default link is outputted. Can someone help me with this problemF? I am posting a piece of my script.

Thanks

[PHP]


outer_link1 = "< a href = \"?Expand = outer_link1 \" > outer_link1< / a>" ;;

if(
outer_link1 = "<a href=\"?Expand=outer_link1\" >outer_link1</a>";
if (


_REQUEST [''Expand''] ==" outer_link1")

{
_REQUEST[''Expand''] == "outer_link1")
{


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

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