php 条件HTML选择选项值无效

ztyzrc3y  于 2022-12-21  发布在  PHP
关注(0)|答案(1)|浏览(105)

我想发送一个条件选项值(从HTML选择标签)到MySQL表。我测试了每一个方法,但没有成功。正常的选择选项值插入工作正常,但条件选项值没有插入,更新为空。还自动生成编号($client_id =“ICO 01”;)只工作了10次后就不工作了,删除数据后又工作了。有人知道解决办法吗?这是我的代码:
'

//database conection
    <?php include 'dashboard/dbcon.php' ?>
    <?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

    $query2 = "SELECT * FROM quote_form order by reg desc limit 1";
    $result2 = mysqli_query($conn, $query2);
    $row = mysqli_fetch_array($result2);
    $last_id = $row['reg'];

    if ($last_id == "")
        {
            $client_id = "ICO01";
        }
    else
        {
            $client_id = substr($last_id, 3);
            $client_id = intval($client_id);
            $client_id = "ICO0" . ($client_id + 1);
        }
?>

<div class="about-section">

        <!--Quote Form-->
        <div class="quote-form">
            <h3>Get our free consultancy <span>at Your doorsteps</span></h3>
            
            <form action="" method="POST">
            <div class="dnone" style="display: ;"><input type="text" id="reg" name="reg" value="<?php echo $client_id; ?>" readonly ><br></div>
                <label for="name">Name</label><br>
                <input type="text" id="name" name="name" placeholder="Your Name" required><br>
                <label for="phone">Phone No</label><br>
                <input type="phone" id="phone" name="phone" placeholder="+91 00000 0000" required><br>
                <label for="email">Email</label><br>
                <input type="email" id="email" name="email" placeholder="youremail@rmail.com" required><br>
                <label for="pan">PAN No.</label><br>
                <input type="text" id="pan" name="pan" placeholder="ABCTY1234D" required><br>
                <label for="address">Address</label><br>
                <input type="text" id="address" name="address" placeholder="Your Address" required><br>
                <label for="who">Type of Service</label><br>
                <select  name="service" id="who">
                    <option value=""  disabled selected value class="custom-select">Select One</option>
                    <option name="service" value="Registration Related Assistance">Registration Related Assistance</option>
                    <option name="service" value="Licencing Related Assistance">Licencing Related Assistance</option>
                    <option name="service" value="Financing Related Assistance">Financing Related Assistance</option>
                    <option name="service" value="Intellectual Properties Related Assistance">Intellectual Properties Related Assistance</option>
                    <option name="service" value="Taxation Related Assistance">Taxation Related Assistance</option>
                    <option name="service" value="Companies Act-2013">Companies Act-2013</option>
                    <option name="service" value="Valuation">Valuation</option>
                    <option name="service" value="Finance and Accounts">Finance and Accounts</option>
                    <option name="service" value="Taxation">Taxation</option>
                    <option name="service" value="RBI & FEMA">RBI & FEMA</option>
                    <option name="service" value="MSME">MSME</option>
                    <option name="service" value="Others">Others</option>
                </select>
                <br><label>Select Service </label><br>
                <select class="select"  name="blank" id="blank" onchange="location = this.value;"> 
                    <option value="" disabled selected value>Select One &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</option>
                </select>
                <select name="tser" id="register">
                    <option name="tser" value="Company registration">Company registration</option>
                    <option name="tser" value="Start-up Registration" >Start-up Registration</option>
                    <option name="tser" value="MSME Registration" >MSME Registration</option>
                    <option name="tser" value="Society/Trust/NGO registration" >Society/Trust/NGO registration</option>
                    <option name="tser" value="GST Registration" >GST Registration</option>
                    <option name="tser" value="NBFC Registration" >NBFC Registration</option>
                    <option name="tser" value="Shops and Establishments Registrations" >Shops and Establishments Registrations</option>
                    <option name="tser" value="Others" >Others</option>
                </select>
                <select name="tservice"  id="licencing">
                    <option  value="Trade Licence">Trade Licence</option>
                    <option   name="tser" value="Labour, Factory, FSSI, Environment">Labour, Factory, FSSI, Environment</option>
                    <option   name="tser" value="Drug Licence">Drug Licence</option>
                    <option   name="tser" value="Import Export Code, EOU, etc.">Import Export Code, EOU, etc.</option>
                    <option   name="tser" value="Others">Others</option>
                </select>

                <select name="tservice"  id="financing">
                    <option   name="tser" value="Project Reports">Project Reports</option>
                    <option   name="tser" value="CMA data and Projections">CMA data and Projections</option>
                    <option   name="tser" value="Financial Advisory Services for Loan Proposals">Financial Advisory Services for Loan Proposals</option>
                    <option   name="tser" value="Preparation and submission of Loan Proposals to Banks">Preparation and submission of Loan Proposals to Banks</option>
                    <option   name="tser" value="Project Management Consultancy Services">Project Management Consultancy Services</option>
                    <option   name="tser" value="Obtaining Approval of SIPB/FIPB, etc.">Obtaining Approval of SIPB/FIPB, etc.</option>
                </select>

                <select name="tservice"  id="intellectual">
                    <option   name="tser" value="Trademark Application and further Compliances">Trademark Application and further Compliances</option>
                    <option   name="tser" value="Copyright Applications and further Compliances">Copyright Applications and further Compliances</option>
                    <option   name="tser" value="Patent Registration and Further Compliances">Patent Registration and Further Compliances</option>
                </select>

                <select name="tservice"  id="taxat">
                    <option   name="tser" value="Income Tax and GST advisory">Income Tax and GST advisory </option>
                    <option   name="tser" value="Management of ITR/ GST Returns/TDS returns, etc.">Management of ITR/ GST Returns/TDS returns, etc.</option>
                    <option   name="tser" value="Tax management and tax planning">Tax management and tax planning</option>
                    <option   name="tser" value="Compliances with respect to Income tax and GST">Compliances with respect to Income tax and GST</option>
                </select>

                <select name="tservice"  id="companies">
                    <option   name="tser" value="Issue and Allotment of  of equity Shares under:">Issue and Allotment of  of equity Shares under:</option>
                    <option   name="tser" value="Right Issue ">Right Issue </option>
                    <option   name="tser" value="Private Placement">Private Placement</option>
                    <option   name="tser" value="ESOP">ESOP</option>
                    <option   name="tser" value="Sweat Equity">Sweat Equity</option>
                    <option   name="tser" value="Issue of Preference shares">Issue of Preference shares</option>
                    <option   name="tser" value="Issue of Bonds & Debentures">Issue of Bonds & Debentures</option>
                    <option   name="tser" value="Dematerilization of Securities of Companies">Dematerilization of Securities of Companies</option>
                    <option   name="tser" value="Charge Registration and Modification/ Charge Management">Charge Registration and Modification/ Charge Management</option>
                    <option   name="tser" value="Drafting of Notice/Agenda and Minutes of Meetings">Drafting of Notice/Agenda and Minutes of Meetings</option>
                    <option   name="tser" value="Maintainance of Statutory Registers">Maintainance of Statutory Registers</option>
                    <option   name="tser" value="AGM, Dividend distribution, etc.">AGM, Dividend distribution, etc.</option>
                    <option   name="tser" value="Merger/Demerger and acquisition">Merger/Demerger and acquisition </option>
                    <option   name="tser" value="Liquidition /Winding up">Liquidition /Winding up</option>
                </select>

                <select name="tservice"  id="valuation">
                    <option   name="tser" value="valuation of Shares">valuation of Shares</option>
                    <option   name="tser" value="Valuation of Debentures/Bonds, etc.">Valuation of Debentures/Bonds, etc.</option>
                    <option   name="tser" value="Valuation of Land and Building">Valuation of Land and Building</option>
                    <option   name="tser" value="Valuation of Plant and Machinary">Valuation of Plant and Machinary</option>
                </select>

                <select name="tservice"  id="accounts">
                    <option   name="tser" value="Statutory Audit of Company/LLP/Partnership/NGO,etc.">Statutory Audit of Company/LLP/Partnership/NGO,etc.</option>
                    <option   name="tser" value="Certification of Annual Returns of Companies/LLP">Certification of Annual Returns of Companies/LLP</option>
                    <option   name="tser" value="Internal Audit">Internal Audit</option>
                    <option   name="tser" value="Search Reports for Banks">Search Reports for Banks</option>
                    <option   name="tser" value="Due Diligence Reports for Banks">Due Diligence Reports for Banks</option>
                    <option   name="tser" value="Concurrent Audit">Concurrent Audit</option>
                    <option   name="tser" value="Turnover Certificate ">Turnover Certificate </option>
                    <option   name="tser" value="Net worth Certificate">Net worth Certificate</option>
                    <option   name="tser" value="Loan Utilization Certificate">Loan Utilization Certificate</option>
                    <option   name="tser" value="Book Debt Certificates">Book Debt Certificates</option>
                    <option   name="tser" value="Share Capital Reconcilation Audit Report (Quarterly )">Share Capital Reconcilation Audit Report (Quarterly )</option>
                    <option   name="tser" value="Deposit Certificates (Annualy)">Deposit Certificates (Annualy)</option>
                    <option   name="tser" value="Cash Flow/ALM, etc certificates">Cash Flow/ALM, etc certificates</option>
                    <option   name="tser" value="Certification of Annual Return (MGT-8)">Certification of Annual Return (MGT-8)</option>
                    <option   name="tser" value="Secreterial Audit Report">Secreterial Audit Report </option>
                    <option   name="tser" value="Others">Others</option>
                </select>

                <select name="tservice"  id="taxation">
                    <option   name="tser" value="Tax Audit Report">Tax Audit Report</option>
                    <option   name="tser" value="Appearance at Income Tax Hearings">Appearance at Income Tax Hearings</option>
                    <option   name="tser" value="Income & Expenditure Certificate">Income & Expenditure Certificate</option>
                    <option   name="tser" value="GST Act Compliances, Hearings and Certifications">GST Act Compliances, Hearings and Certifications</option>
                </select>

                <select name="tservice"  id="rbi_fema">
                    <option   name="tser" value="CS Certificate for FDI">CS Certificate for FDI </option>
                    <option   name="tser" value="Reporting to RBI for Inward Remittence">Reporting to RBI for Inward Remittence</option>
                    <option   name="tser" value="Reporting to RBI for any transfer of securities outside Ind">Reporting to RBI for any transfer of securities outside Ind</option>
                    <option   name="tser" value="Approval form RBI and certification as and when require">Approval form RBI and certification as and when require</option>
                </select>

                <select name="tservice"  id="msme">
                    <option   name="tser" value="Govt subsidy and promotional schemes for industries">Govt subsidy and promotional schemes for industries</option>
                </select>
                <div class="front-hide">
                    <label for="name">Date of Registration</label><br>
                    <input type="date" id="rdate" name="rdate" value="please select date"><br>
                    <label for="name">Deliver Date</label><br>
                    <input type="date" id="ddate" name="ddate" value="please select date"><br>
                    <label for="name">Documents Submitted</label><br>
                    <input type="text" id="doc" name="doc" value="Type here Document Types" required><br>
                    <label for="name">Documents Uploaded</label><br>
                    <input type="file" id="filename" name="filename" accept="image/jpg, image/jpeg"><br>
                    <label for="name">Mode of Enrollment </label><br>
                    <input type="text" id="mode" name="mode" value="type here enrolment type"><br>
                </div>

                <textarea   name="tser"  name="tser" id="others" rows="3" cols="50" placeholder="Please Input which Type Service are you Looking for.."></textarea>
                <br><input type="submit" value="Send Now" class="submit-btn">
            </form>
        </div>
        <!--End Quote Form-->
</div>



<?php 
//form data pickup by php
if ($_SERVER['REQUEST_METHOD'] == 'POST'){
    $reg         =    $_POST['reg'];
    $name        =    $_POST['name'];
    $phone       =    $_POST['phone'];
    $email       =    $_POST['email'];
    $pan         =    $_POST['pan'];
    $address     =    $_POST['address'];
    $service     =    $_POST['service'];
    $tservice    =    $_POST['tser'];
    $rdate       =    $_POST['rdate'];
    $ddate       =    $_POST['ddate'];
    $doc         =    $_POST['doc'];
    $filename    =    $_POST['filename'];
    $mode        =    $_POST['mode'];

    //extract($_POST);{
    if($name != ""){

        
        //$query = "INSERT INTO contact_form  VALUES ( '$name', '$email', '$phone', '$subject', '$discription')";
        $query = "INSERT INTO `quote_form` (`id`, `reg`, `name`, `phone`, `email`, `pan`, `address`, `tservice`, `dservice`, `register`, `delivery`, `doc`, `img`, `mode`) VALUES (NULL, '$reg', '$name', '$phone', '$email', '$pan', '$address', '$service', '$tservice', '$rdate', '$ddate', '$doc', '$filename', '$mode')";

         $data = mysqli_query ($conn, $query); 
         

        if($data){
            echo '<script type="text/javascript">'; 
            echo 'alert("Your Request is Succefully Sumitted, Please be Patient, We contact You Soon..")'; 
            echo '</script>';  
            ?>
            <meta http-equiv = "refresh" content = "0; url = quote.php" />

            <?php
        }
        else{
           
            echo '<script type="text/javascript">'; 
            echo 'alert("Something Wrong, Please try Again")'; 
            echo '</script>';  
        }
    }

}


?>

'
我会尝试找到解决方案或应用许多解决方案,但不工作,请帮助

x4shl7ld

x4shl7ld1#

option〉标记中不需要name属性。

<option value="Trademark Application and further Compliances">Trademark Application and further Compliances</option>

相关问题