gpt4 book ai didi

php 值不打印

转载 作者:行者123 更新时间:2023-11-28 04:31:57 26 4
gpt4 key购买 nike

我正在尝试完成一项任务。为此,我需要打印 $message(在下面指定)。但它没有打印我不知道似乎是什么问题。我提前感谢你的帮助......我不想在 html 代码中做这个 echo $message 事情......还有一件事你应该知道值在 echo $message 之前打印. php 变量在 echo $message 之前有值,但是当我 echo $message 时,这些相同的变量什么也不打印。它只打印

客户姓名:

客户邮箱:

客户手机:

客户城市:

客户账单地址:

       <?php
if(isset($_POST['sub'])){

$name=$_POST['name'];
$email=$_POST['email'];
$mobile=$_POST['mobile'];
$city=$_POST['city'];
$bill_add=$_POST['message'];
echo $message="
<html><head> </head>

<body>
Customer Name: <?php echo $name; ?>
<br>
Customer Email: <?php echo $email; ?>
<br>
Customer Mobile: <?php echo $mobile; ?>
<br>
Customer City: <?php echo $city; ?>
<br>
Customer Billing Address: <?php echo .$bill_add; ?>
</body></html>";}
?>

HTML 文件:

   <html>
<body>
<form id="contact_form" action="#" method="POST"
enctype="multipart/form-data" style=" padding-left: 121px;">

<div class="row">
<label for="name" style=" margin-left: 9px;">Your name:</label><br />
<input id="name" class="input" name="name" type="text" value=""
size="30" required/><br />
</div>
</br>
<div class="row">
<label for="email" style=" margin-left: 9px;">Your email:</label><br
/>
<input id="email" class="input" name="email" type="text" value=""
size="30" required/><br />
</div>
</br>
<div class="row">
<label for="email" style=" margin-left: 9px;">Mobile #:</label><br />
<input id="email" class="input" name="mobile" type="text" value=""
size="30" required/><br />
</div>
</br>
<div class="row">
<label for="email" style=" margin-left: 9px;">City:</label><br />
<input id="email" class="input" name="city" type="text" value=""
size="30" required/><br />
</div>
</br>
<div class="row">
<label for="message" style=" margin-left: 9px;">Shipping Address:
</label><br />
<textarea id="message" class="input" name="message" rows="7" cols="32"
required></textarea><br />
</div>
</br>
<div class="row">
<input name="sub" id="submit_button" type="submit" value="Order Proceed
Now" style="margin-top: 120px;background-color: green;padding:10px;
color:#FFF; "/>
</div>
</br>
</form>
</body>
</html>

最佳答案

更改您的 $message到:

 echo $message="
<html><head> </head>

<body>
Customer Name: $name
<br>
Customer Email: $email
<br>
Customer Mobile: $mobile
<br>
Customer City: $city
<br>
Customer Billing Address: $bill_add
</body></html>";}
?>

问题是您使用的是 <?php echo进入<?php echo

关于php 值不打印,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31670652/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com