1
我无法比较set变量为null。我的代码运行作为通过if语句比较空数据
.......some code
echo "Question1 is" . $q1. "is Question-1";
?>
<html>
<head>
<form method="post" method="post" action="jobprocess.php">
<?
if($q1!="")
{ ?>
<h3> Answer the below simple questions related to the job and apply </h3>
<div align="center">
<input type="text" name="q1" required placeholder="<?php echo $q1;?>"><br>
<? } ..... some more code
结果显示为
问题1 ISIS问题1
回答与工作有关的以下简单的问题,并应用
[文本框]
虽然第一行确认变量我无法理解为什么它进入!$ q1 =“”循环
感谢您的耐心等待 我已经经历了=== null和empty($ var)的用法,张贴了这个,我无法弄清楚什么是错我的代码
更新:我曾尝试为0 SQL表中设置默认值和比较为0,仍它进入循环。我感觉到逻辑错误比语法错误 –
http://php.net/manual/en/types.comparisons.php –
'print_r($ q1)'的输出是什么;' –