Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6378955
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:04:35+00:00 2026-05-25T02:04:35+00:00

I have problem with: I want to create admin for add questions to quiz

  • 0

I have problem with: I want to create admin for add questions to quiz system. Structure is:

<label>Question 1</label>
<input type='text' name='question' value=''/>  

<label>Possible reply</label>
<input type='text' name='1' /> 
<input type='text' name='2' />
...
<input type='text' name='6' />    
<label>**Correct reply</label>
<input type='text' name='correct' /> 


<label>Question 2 </label>
<input type='text' name='question' value=''/>     
<label>Possible reply </label>
<input type='text' name='1' /> 
<input type='text' name='2' />
...
<input type='text' name='6' />    
<label>Correct reply </label>
<input type='text' name='correct' />     

<label>Question 3 </label>
...
<input type='submit' name='submit' value='submit'>

And I need multiple questions post to Mysql db tables: question, 1,2,3,4,5,6, correct.

I was create this:

<?php
if(isset($_POST['submit']))
 {
$question  $_POST['question '];
$a = $_POST['1'];
$b = $_POST['2'];
$c = $_POST['3'];
$d = $_POST['4'];
$e = $_POST['5'];
$f = $_POST['6'];
correct = $_POST['correct '];

$result=mysql_query("insert into test (question, 1, 2, 3, 4, 5, 6, correct) values ('$result', '$a', '$b', '$c', '$d', '$e', '$f',  '$correct' )");
  }

else
{

?>
<label>Question 1 </label>
<input type='text' name='question' value=''/>  

<label>Possible reply </label>
<input type='text' name='1' /> 
<input type='text' name='2' />
...
<input type='text' name='6' />

<label>Correct reply </label>
<input type='text' name='correct' /> 


<label>Question 2 </label>
<input type='text' name='question' value=''/>  

<label>Possible reply </label>
<input type='text' name='1' /> 
<input type='text' name='2' />
...
<input type='text' name='6' />

<label>Correct reply </label>
<input type='text' name='correct' /> 


<label>Question 3 </label>
...
<input type='submit' name='submit' value='submit'>

<?         
}

But this send only 1 question to DB.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T02:04:35+00:00Added an answer on May 25, 2026 at 2:04 am

    If you can’t use

    <input type='text' name='question_1' value=''/>  
    <input type='text' name='question_1' value=''/>  
    <input type='text' name='question_1' value=''/>  
    

    Write in HTML:

    <input type='text' name='question[]' value=''/>  
    <input type='text' name='reply1[]' />  
    <input type='text' name='reply2[]' />  
    <input type='text' name='reply3[]' />  
    <input type='text' name='reply4[]' />  
    <input type='text' name='reply5[]' />  
    <input type='text' name='reply6[]' />  
    <input type='text' name='correct[]' /> 
    

    In PHP:

    <?php
    if (isset($_POST['submit'])){
        $questions=$_POST['question'];
        $reply1=$_POST['reply1'];
        $reply2=$_POST['reply2'];
        $reply3=$_POST['reply3'];
        $reply4=$_POST['reply4'];
        $reply5=$_POST['reply5'];
        $reply6=$_POST['reply6'];
        $correct=$_POST['correct'];
        foreach($questions as $key=>$value){
             $result=mysql_query("insert into test (question, 1, 2, 3, 4, 5, 6, correct) values ('$value', '".$reply1[$key]."', '".$reply2[$key]."', '".$reply3[$key]."', '".$reply4[$key]."', '".$reply5[$key]."', '".$reply5[$key]."',  '".$correct[$key]."' )");
    
        }
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem with moving animation. I want to create animation which start
I have a problem with switching images in android. I want to create animation
I have the following problem: Within a stylesheet document I want to create an
I have three problems: I want to create resizable shapes with box bounding... I
I have problem with dynamically created image (JavaScript). I want to change the innerHTML
I have created this Fiddle with this code: This is my problem I want
I have a quite specific problem. I created a webapp and want to have
I have a problem and I want to implement the MVC pattern to my
I have a problem when I want to sending data using byte format in
I have problem with fancybox. I want to write a function that will run

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.