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

  • Home
  • SEARCH
  • 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 8985401
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T21:19:19+00:00 2026-06-15T21:19:19+00:00

Hi I am a beginner PHP deveoloper and I am trying to create a

  • 0

Hi I am a beginner PHP deveoloper and I am trying to create a form generator.I am having some problems with the generated form.When I click for example the “Paragraph” button a form is generated that contains a text field and another button.

I would like when I enter some text in the generated code and press the button to execute some function in my case just print the text.

This is my code:

<form action="" method="post">
   <button type="submit" name ="Paragraph">Paragraph Text</button>
   <button type="submit" name ="MultipleChoice">Multiple Choice</button>
   <button type="submit" name ="Name">Name</button>
   <button type="submit" name ="Adress">Address</button>
   <button type="submit" name ="Number">Number</button>
   <button type="submit" name ="CheckBoxes">Checkboxes</button>
   <button type="submit" name ="DropDown">Drop Down</button>
   <button type="submit" name ="Phone">Phone</button>
   <button type="submit" name ="Email">Email</button>
</form>

<?php 
   require_once 'addform.php';
   $buttons = array('Paragraph', 'MultipleChoice', 'Name', 
              'Adress', 'Number', 'CheckBoxes', 'DropDown', 'Phone', 'Email');
   foreach ($buttons as $button){
     if(isset($_POST[$button])){
        $title;
        $input;
        if($button == 'Paragraph'){
           ?>
           <form action="" methods="post">
             Paragraph title: <input type="text" name="title"/>
             <input type="submit" value="Create" name="create"/>
           </form>
           <?php
           if(isset($_POST['title'])){
             $title = $_POST['title'];
             echo $title;
           }
        }
     }
     break;
}
?>

What am I doing wrong here?

  • 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-06-15T21:19:20+00:00Added an answer on June 15, 2026 at 9:19 pm

    try this, it works, You have used methods instead of method in your paragraph form…
    and also you have used wrong variable name of submit in $_POST[''] it should be isset($_POST['create']).

     <form action="" method="post">
       <button type="submit" name ="Paragraph">Paragraph Text</button>
       <button type="submit" name ="MultipleChoice">Multiple Choice</button>
       <button type="submit" name ="Name">Name</button>
       <button type="submit" name ="Adress">Address</button>
       <button type="submit" name ="Number">Number</button>
       <button type="submit" name ="CheckBoxes">Checkboxes</button>
       <button type="submit" name ="DropDown">Drop Down</button>
       <button type="submit" name ="Phone">Phone</button>
       <button type="submit" name ="Email">Email</button>
    </form>
    
    <?php 
    
       $buttons = array('Paragraph', 'MultipleChoice', 'Name', 
                  'Adress', 'Number', 'CheckBoxes', 'DropDown', 'Phone', 'Email');
       foreach ($buttons as $button){
         if(isset($_POST[$button])){
            $title;
            $input;
            if($button == 'Paragraph'){
               ?>
               <form action="" method="post">
                 Paragraph title: <input type="text" name="title"/>
                 <input type="submit" value="Create" name="create"/>
               </form>
               <?php
    
            }
         }
         break;
    }
         if(isset($_POST['create'])){
    
                 $title = $_POST['title'];
                 echo $title;
               }
    
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm a beginner in php, and I am trying to create a login and
PHP beginner working from a tutorial. I'm trying to do a simple upload from
i'm a beginner to php. i need to use php function which process some
I'm a beginner in PHP. What I'm trying to do is stop Post Data
i'm a beginner in PHP and i'm trying to make a login screen using
I'm a PHP beginner and lately I've been having a problem with my source
I'm a beginner at PHP, and I'm still trying to work out proper file
I am a beginner in php my code to create a directory is given
I am a beginner level php programmer. I was trying to use the MVC
I am a absolute beginner in PHP and I need some help with my

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.