上面输出的应该是Hello Helloworld
你要换行应该用echo "<BR>"
这一行里echo $a,$hello; 变量$hello你根本没有赋过值当然没有东西输出了,而逗号是分隔符你要输出就要在赋值时把它做为字符串的一部分。试试下面的就知道了<?php
$a = "Hello,";
$$a= " world";
$hello= " world";
echo $a,$hello; //输出 Hello, world
echo "<br>";//换行
echo $a,$$a; //输出 也是 Hello, world
?>
你要换行应该用echo "<BR>"
这一行里echo $a,$hello; 变量$hello你根本没有赋过值当然没有东西输出了,而逗号是分隔符你要输出就要在赋值时把它做为字符串的一部分。试试下面的就知道了<?php
$a = "Hello,";
$$a= " world";
$hello= " world";
echo $a,$hello; //输出 Hello, world
echo "<br>";//换行
echo $a,$$a; //输出 也是 Hello, world
?>
$a = "Hello";
$$a= "world";
echo $a,$Hello; //out Helloworld 这里注意大小写
echo "\n";
echo $a,$$a; //out Helloworld
?>页面显示
Helloworld Helloworld
没有html的换行标签所以不换行查看--源文件
Helloworld
Helloworld没有html的换行标签所以不换行
<html>
<head>
<title>test</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head><body>
<form name="form1" method="get" action="regest.php3">
<p>姓名:
<input name="Name" type="text" id="name" size="25" maxlength="25">
<font color="#FF0000">*</font> </p>
<p>E-Mail:
<input name="Mail" type="text" id="mail" size="25" maxlength="25">
<font color="#FF0000">*</font> </p>
<p>地址:
<input name="Address" type="text" id="address" size="25" maxlength="25">
</p>
<p>(<font color="#FF0000">*</font> 是必须填的。)</p>
<p>
<input type="submit" name="Submit" value="Ok">
<input type="submit" name="Submit2" value="Cancel">
<input type="reset" name="Submit3" value="Reset">
</p>
</form>
</body>
</html><?php
mysql_connect (localhost, teddy, 801205) or die ("Problem connecting to DataBase");
mysql_select_db ("example");if ($name=="")
{ print ("请填写完整!");}
elseif($mail=="")
{print ("请MAIL填写完整!");}
else
{
mysql_query ("INSERT INTO tb1 (Name, Mail, Address) VALUES ('$name', '$mail', '$address') "); ?> 为什么不能传值呢,是不是我这里设置有问题
mysql_connect (localhost, teddy, 801205) or die ("Problem connecting to DataBase");
mysql_select_db ("example");if ($Name=="")
{ print ("请填写完整!");}
elseif($Mail=="")
{print ("请MAIL填写完整!");}
else
{
mysql_query ("INSERT INTO tb1 (Name, Mail, Address) VALUES ('$Name', '$Mail', '$Address') "); }
?>
应该是这个