0

hi i cant send name to another page

i want to make exam online script but when i want to get a name and send to another page i have this error

( ! ) Notice: Undefined index: name in C:\wamp\www\daneshtranse\exam\answer.php on line 2
Call Stack
#   Time    Memory  Function    Location
1   0.0003  239520  {main}( )   ..\answer.php:0

//

require_once '../database/connection.php';

$FetchedEdit = SelectSolo('exam', 'ASC');
?>
<form action="answer.php" method="post">
    <div class="row">
        <div class="container">
            <div class="exam pull-left">
                <?php
                //           <?php
                // input1, input2, input3, input4
                while($queryFetched = $FetchedEdit->fetch_assoc()){?>
                    <h5><?php echo $queryFetched['id'];?> - <?php echo $queryFetched['question'];?></h5>
                    <input type="radio" class="myRadio" name="<?php echo $queryFetched['id'];?>" value="<?php echo $queryFetched['input1'];?>"><?php echo $queryFetched['input1'];?><br>
                    <input type="radio" class="myRadio" name="<?php echo $queryFetched['id'];?>" value="<?php echo $queryFetched['input2'];?>"><?php echo $queryFetched['input2'];?><br>
                    <input type="radio" class="myRadio" name="<?php echo $queryFetched['id'];?>" value="<?php echo $queryFetched['input3'];?>"><?php echo $queryFetched['input3'];?><br>
                    <input type="radio" class="myRadio" name="<?php echo $queryFetched['id'];?>" value="<?php echo $queryFetched['input4'];?>"><?php echo $queryFetched['input4'];?><br>
                    <br><hr>
                    <?php
                }
                ?>
                <button type="button" id="submit" class="btn btn-sauces" value="ثبت" name="submit">ssss</button>
            </div>
        </div>
    </div>
</form>

this is answer page

<?php
echo $_POST["name"];

what should I do

  • here:- `name=""` you are setting some `id` into `name` parameter. so how can you ten access it with `$_POST["name"]`? Do `echo "
    ";print_r($_POST);` on `answer.php` and see the POST array. then you come to know what indexes are coming. Show that data to us also?
    – Alive to die - Anant Aug 25 '17 at 21:01
  • i use it this and work it but i cant use the index of
    !       how can i use this index?
    – Hamed Khoda Aug 26 '17 at 13:56

0 Answers0