预定义变量的问题
_server(“QUERY_STRING”)查询(query)的字符串,谁能帮我解释一下它的意思,什么是查询的字符串。还有表单是如何与php交互的,假如我把php代码和表单写在一个文件中该如何让代码工作呀?谢谢 还是建议你分离表现层和逻辑层,不然PHP和ASP有什么区别咧 :mrgreen:,可以使用KaraMac的Renderor Engine表现层
<form action="your_php_file.php" method="post" name="your_form">
<!-- some form components go here -->
<input name="create" type="submit" value="创建" />
</form>
逻辑层,如your_php_file.php
<?php
if ( isset($_POST['create']) ){
// do your stuff here...
}
?>
谢谢,可是还没有说_server(“QUERY_STRING”)查询(query)的字符串,什么是查询的字符串?
echo $_SERVER['QUERY_STRING'];
输出start_debug=1&debug_port=10000&debug_host=127.0.0.1
PHP手册介绍:
'QUERY_STRING'
The query string, if any, via which the page was accessed.
页:
[1]