在php页面之间传递值,不起作用! [英] passing values between php pages, not working !!
本文介绍了在php页面之间传递值,不起作用!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,我尝试了几种方法在两个页面之间传递某些数据.
我在第一个php页面中所做的是将var值设置为$ var = somthing.
现在我想要的是将该值传递到下一页,该页面将被写入标签控件或somthing中.我尝试了会话,querystrings,看来我不知道如何正确执行此操作,请指导我.
例子:
hello guys I tried several ways to pass certain data between two pages .
what i do in the first php page, is setting a var value to $var = somthing .
now what i want, is to pass that value on to the next page, which will be written into a label control or somthing . i tried session, querystrings and it seems i dont know how to do this right, please guide me .
example :
$content = "hello"; //if its not string sholud i cast it??
header('location:sms_main_form.php?credits='.$content);
第二页:
2nd page:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?php
echo $_GET['credits']
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
在第二页中,它回显未知命令".
in the 2nd page it echoes "unknown command"
推荐答案
var = somthing.
现在我想要的是将该值传递到下一页,该页面将被写入标签控件或somthing中.我尝试了会话,querystrings,看来我不知道如何正确执行此操作,请指导我.
例子:
var = somthing .
now what i want, is to pass that value on to the next page, which will be written into a label control or somthing . i tried session, querystrings and it seems i dont know how to do this right, please guide me .
example :
内容 = " 你好"; // 如果它不是字符串,那么我将其强制转换? header(' location:sms_main_form.php?credits ='.
content = "hello"; //if its not string sholud i cast it?? header('location:sms_main_form.php?credits='.
content);
content);
第二页:
2nd page:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?php
echo
这篇关于在php页面之间传递值,不起作用!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文