我不认为我这样做是正确的,但是这里就是这样。 我想能够有两个php页面mypage.php和mypage2.php 。 mypage2.php有纯文本数据(例如一个8位数字),它只是通过echo命令显示。
我想知道当我在mypage.php时,如果我可以抓住该号码并将其显示在mypage.php而不是打开mypage2.php并在那里显示它?
所以mypage.php的假设示例可能是:
echo "My secret number is: " . magic_command("mypage2.php");我知道这样做的一种方法是使用$_SESSION ,但这不涉及仍然导航到mypage2.php ,将数字存储在$_SESSION 。 然后告诉它回到mypage.php ?
I do not think that I am doing this the right way, but here goes it. I want to be able to have two php pages mypage.php and mypage2.php. mypage2.php has plain text data on it (say a 8 digit number) and it is just being displayed via the echo command.
I want to know if when I am on mypage.php if I can grab that number and display it on mypage.php rather than open up mypage2.php and display it there?
So a hypothetical example of mypage.php might be:
echo "My secret number is: " . magic_command("mypage2.php");I know that one way to do this is with $_SESSION, but doesn't that involve still navigationg to mypage2.php, storing the number in $_SESSION. Then telling it to go back to mypage.php?
最满意答案
你可以做:
include 'mypage2.php';在mypage.php和mypage2.php :
echo '12345678';易如反掌!
You can do:
include 'mypage2.php';in mypage.php and in mypage2.php:
echo '12345678';Easy as pie!
更多推荐
发布评论