0

如何在表单的同一行显示回显消息?

现场版

<form name="form1" method="post" action="">Correo: <input type="text" name="mail"><input type="submit" name="Suscribir" value="Suscribir"></form>
<?php
$email = $_POST['mail'];
//the data
$data = "$email\n";
//open the file and choose the mode
$fh = fopen("users.txt", "a");
fwrite($fh, $data);
//close the file
fclose($fh);

if (count($_POST)>0) echo "Suscripcion dado de alta"; 

?>

谢谢

4

1 回答 1

1

只需将 cssdisplay:inline属性放在您的表单上:

<form style="display:inline-block;">

或者把你的 php 放到你的<form>

于 2013-03-08T11:54:40.960 回答