John Davidson

Using php to echo a form but with includes

0 comments
Message:


This is a simple question, I need to return an html <form> using a php echo'';
I can perfectly return the function by typing:


echo'
<form method="post" action="passwordResetUser.php">
<input type="password" type="password" name="passwordResetUser" placeholder="Select new password" class="form-control1">
<input type="password" type="password" name="passwordResetUserRetype" placeholder="Retype the new password" class="form-control1">

<button type="submit" name="rP006" >Reset my password.</button>
</form>';

But I would like to include <?php include('errors.php'); ?> before the first <form> so the result would be like this:


echo'
<form method="post" action="passwordResetUser.php">
<?php include('errors.php'); ?>
<input type="password" type="password" name="passwordResetUser" placeholder="Select new password" class="form-control1">
<input type="password" type="password" name="passwordResetUserRetype" placeholder="Retype the new password" class="form-control1">

<button type="submit" name="rP006" >Reset my password.</button>
</form>';


But that just throws an error, to point out that I am learning PHP by myself and those things got me crazy.
Thanks in advance and sorry for maybe the obnoxious question.


:)



My Answer:















Rate this post

5 of 5 based on 1089 votes

Comments




© 2024 Hayatsk.info - Personal Blogs Platform. All Rights Reserved.
Create blog  |  Privacy Policy  |  Terms & Conditions  |  Contact Us