Code out of position

<!DOCTYPE html>
<html lang="es">
<title> App Presupuesto</title>
<meta charset="utf-8">
    padding: 4px 8px;
    color: #666;
    margin-right: 0;
<script src="js/jquery-3.4.1.js"></script>
        $('#type').on('change', function(){
            var typeID = $(this).val();
                $('#module').html('<option value="">Select Type First</option>');

        var registration = $('input[name="registration"]:checked').val();


<link href="" rel="stylesheet" />
<script src=""></script>
<script src="js/select2.js"></script> 

<div class="container">
    $type = $_POST['type'];
    include_once 'dbConfig.php';
    $selecao = "SELECT DISTINCT module.module, concept.module_id FROM concept, module WHERE module.module_id = concept.module_id AND FIND_IN_SET('" . $type . "', concept.type_id)";
    $result = $db->query($selecao) or die($db->error);
    <form action="view.php" method="POST">   
        <?php while ($row = $result->fetch_array()) { ?>
        <?php var_dump($row['module_id']) ?>
        <?php switch ($row['module_id']) {
            case 1 : ?>
                <h2> Do u need Registration & Authorization? </h2>   
                <div id='div_container'>
                    <input type="radio" name="registration" value="yes">Yes<br/>
                    <input type="radio" name="registration" value="no">No<br/>
                <div id="selectregis" style="display: none">
                $consulta = "SELECT concept.concept, hours_dev_time , concept.required FROM concept, module WHERE module.module_id = concept.module_id AND FIND_IN_SET('Registration & Authorization', module.module) > 0 AND concept.type_id = 1 AND concept.platform_id = 1";

                if ($resultado = $db->query($consulta)) {?>
                    <table class="table"> 
                            <tr bgcolor="#ddd">    
                                <td>Hours Dev-Time</td> 
                    <?php while ($row = $resultado->fetch_assoc()) { ?>
                                <td><input type="checkbox" name="concept[]" <?php if ($row['required'] == 1) { echo "checked disabled"; } ?>  value="<?php $row['concept'] ?>"><?php echo $row['concept'] ?><br/>
                                <td><?php echo $row['hours_dev_time'] ?><br/>                   
            } ?>
        <?php break;
        case 2 : ?>
            <?php echo "ola"; ?>
            <?php echo "Mundo"; ?>

        <?php break;
        } }?>
    <input type="submit" value="Submit">       

When i run the code it shows like this

OK, looks like what you told the computer to do. That’s fine… or isn’t it?

No , because i wanted the read after the table, like
Do u need Registration?
–> “string(1)“2” Ola mundo …”

So you need to rearrange the placement of the code. That simple.

i wanted to know how pls

You want to know how to cut code and paste it somewhere else?

My observations of your page…

  1. You are mingling PHP and HTML way too much as you should try to keep PHP and HTML separated as much as possible. It’s easier to debug and easier to read.
  2. A HTML table has no business being inside a form, from what I can decipher you can easily do this without a table with less or about the same HTML.
  3. Put you jQuery library down at the bottom of the page, but personally I would scrap jQuery and just use Vanilla JavaScript.

The most interesting thing about this to me: This looks like it is a form to get a consultation estimate for development work, but cut and paste is too complicated?

Sponsor our Newsletter | Privacy Policy | Terms of Service