|
Posted by Carl Anatorian on 06/14/06 13:25
Mladen Gogala 写道:
> On Wed, 14 Jun 2006 21:09:17 +0800, Carl Anatorian wrote:
>
>> I want to it to show the text I enter in the input when I press the
>> 'submit' botton.But it doesn't work.
>
> Because PHP picks "name" attribute, not "id" attribute. Try with this:
> <html>
> <body>
> <?php
> if(isset($_POST['tt'])) {
> echo $_POST['tt']."<br/><br/><br/>";
> }
> ?>
> <form action=<?=$_SERVER['PHP_SELF']?> method="POST" >
> <input type="text" name="tt" />
> <input type="submit" value="submit" name="submit" />
> </form>
> </body>
> </html
>
Another one :
<?php
if($_COOKIE['hello'] != "world") {
$result = setcookie("hello","world",60*10);
}
?>
<html>
<body> <?php
if(isset($_COOKIE['hello'])) {
echo "hello !";
}
?>
</body>
</html>
I think it will show "hello !" when I access it the second time, but it
never.Why? I don't disable my browser's cookies.
[Back to original message]
|