2

i'm new to php this is my php code and it is working fine in the normal html code. but when it is loading from the php echo bootstrap grid is not working any help ? other css is loading correctly.

<?php
echo"<html>";
echo"   <head>";
echo"      <link href='css/bootstrap.min.css' rel='stylesheet'>";
echo"   </head>";
echo"   <body>";
echo"      <div class='container-fluid'>";
echo"         <div class='row'>";
echo"            <div class='col-md-12'>";
echo"               <h3 class='text-center text-primary'>PHP Form Builder</h3>";
echo"               <div class='row'>";
echo"                  <div class='col-md-6'>";
echo"                     <div class='panel panel-primary'>";
echo"                        <div class='panel-heading'>";
echo"                           <h3 class='panel-title'>Components</h3>";
echo"                        </div>";
echo"                        <div class='panel-body'>";
echo"                           <label class='col-md-4 control-label' for='input01'>Text input</label>";
echo"                           <input id='txt_textInput' type='text' placeholder='title' class='form-control input-md'>";
echo"                           <p class='help-block'></p>";
echo"                           <button id='btn_textInput' type='button' class='col-md-4 btn btn-info'>Add</button> ";
echo"                        </div>";
echo"                        <div class='panel-footer'></div>";
echo"                     </div>";
echo"                     <button type='button' class='btn btn-warning btn-block'>Reset Form</button>";
echo"                  </div>";
echo"                  <div class='col-md-6'>";
echo"                     <div class='panel panel-info'>";
echo"                        <div class='panel-heading'>";
echo"                           <h3 class='panel-title'>From Preview</h3>";
echo"                        </div>";
echo"                        <div class='panel-body'>";
echo"                        </div>";
echo"                        <div class='panel-footer'></div>";
echo"                     </div>";
echo"                     <button type='button' class='btn btn-block btn-success'>Save</button>";
echo"                  </div>";
echo"               </div>";
echo"            </div>";
echo"         </div>";
echo"      </div>";
echo"      <script src='js/bootstrap.min.js'></script>";
echo"   </body>";
echo"</html>";
?>
3
  • path is ok and everything should be from raw php Commented Feb 9, 2016 at 6:39
  • I can't read all your tag atm, but please, if you have no vars in your html, please don't use echo. Just use pure html. Commented Feb 9, 2016 at 6:46
  • @MaxExplode solved :) !! Commented Feb 9, 2016 at 6:48

1 Answer 1

4

Your code is working fine, when i change the src of script, and src of css, i am sure you must have error in path.

see code.

<?php
echo"<html>";
echo"   <head>";
echo"      <link href='https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha/css/bootstrap.css' rel='stylesheet'>";
echo"   </head>";
echo"   <body>";
echo"      <div class='container-fluid'>";
echo"         <div class='row'>";
echo"            <div class='col-md-12'>";
echo"               <h3 class='text-center text-primary'>PHP Form Builder</h3>";
echo"               <div class='row'>";
echo"                  <div class='col-md-6'>";
echo"                     <div class='panel panel-primary'>";
echo"                        <div class='panel-heading'>";
echo"                           <h3 class='panel-title'>Components</h3>";
echo"                        </div>";
echo"                        <div class='panel-body'>";
echo"                           <label class='col-md-4 control-label' for='input01'>Text input</label>";
echo"                           <input id='txt_textInput' type='text' placeholder='title' class='form-control input-md'>";
echo"                           <p class='help-block'></p>";
echo"                           <button id='btn_textInput' type='button' class='col-md-4 btn btn-info'>Add</button> ";
echo"                        </div>";
echo"                        <div class='panel-footer'></div>";
echo"                     </div>";
echo"                     <button type='button' class='btn btn-warning btn-block'>Reset Form</button>";
echo"                  </div>";
echo"                  <div class='col-md-6'>";
echo"                     <div class='panel panel-info'>";
echo"                        <div class='panel-heading'>";
echo"                           <h3 class='panel-title'>From Preview</h3>";
echo"                        </div>";
echo"                        <div class='panel-body'>";
echo"                        </div>";
echo"                        <div class='panel-footer'></div>";
echo"                     </div>";
echo"                     <button type='button' class='btn btn-block btn-success'>Save</button>";
echo"                  </div>";
echo"               </div>";
echo"            </div>";
echo"         </div>";
echo"      </div>";
echo"      <script src='https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha/js/bootstrap.min.js'></script>";
echo"   </body>";
echo"</html>";
?>

please check and let me know.

Thanks Amit

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.