Показать сообщение отдельно

  #7971  
Старый 19.01.2009, 23:27
geforce
Постоянный
Регистрация: 21.08.2008
Сообщений: 302
С нами: 9326973

Репутация: -25
Wink

Цитата:
Сообщение от LASS0  
Я вот хотел сделать небольшой тест на php,
Только незнаю как сделать так, чтобы при нажатии на кнопку "Начать тест" появлялись только вопросы и варианты,
А сама кнопочка "Начать тест" исчезала
Кто нибудь может помочь?

PHP код:
<?php
$SCRIPT_NAME
=$_SERVER['SCRIPT_NAME'];?>
<form action="<? echo $SCRIPT_NAME?>" method="POST">
<?

echo '

<input type="submit" name="test" value="Начать тест!!!"><br>'
;


@
$test=$_POST['test'];

if (isSet(
$test))
{
 echo 
'Вопрос1:<br><input type="submit" name="test1" value="a">
        <br><input type="submit" name="test1" value="b">'
;
@
$test1=$_POST['test1'];
}

elseif (isSet(
$test1)) 
{
echo 
'Вопрос2:<br><input type="submit" name="test2" value="a">
        <br><input type="submit" name="test2" value="b"></form>'
;

@
$test2=$_POST['test2'];
?>
Создай два пхп файла:
1. index.php

PHP код:
<form action="test.php" method="POST">
<
input type="submit" name="test" value="Начать тест!!!">
</
form
test.php
PHP код:
<?php
$SCRIPT_NAME
=$_SERVER['SCRIPT_NAME'];?>
<form action="<? echo $SCRIPT_NAME?>" method="POST">
<?php

@$test=$_POST['test'];

if (isSet(
$test))
{
 echo 
'Вопрос1:<br><input type="submit" name="test1" value="a">
        <br><input type="submit" name="test1" value="b">'
;
@
$test1=$_POST['test1'];
}

elseif (isSet(
$test1)) 
{
echo 
'Вопрос2:<br><input type="submit" name="test2" value="a">
        <br><input type="submit" name="test2" value="b"></form>'
;

@
$test2=$_POST['test2'];

?>
 
Ответить с цитированием