Reputation: 1236
This is my simple html from.
<form action="" method="post" enctype="multipart/form-data">
Save your Contact form: <br>
<textarea name="code" placeholder="Write your form html" rows="30" cols="100">
<?php if(isset($_POST['code'])){ echo htmlentities($_POST['code']) ; } ?>
</textarea>
<br>
Password<br>
<input type="password" name="password"><br>
<button type="submit">Create</button>
</form>
Output of it is:
Now put sample input in the form code:
<form action="" method="post">
</form>
Now press "Create" button 2 times. First time it is ok. But in the second time I am getting unexpected output. How to solve this problem?
1:
Upvotes: 2
Views: 71
Reputation: 631
put header("X-XSS-Protection: 0"); after if(isset($_POST['code'])){
this issue is due to XSS Auditor refused to execute a script
Upvotes: 2
Reputation: 1454
.php
script and then gets manipulated. Submit buttom
more than once? even though you are doing it - are you checking if same data is getting submitted ?VALIDATION
rules in place through JS or PHP to prevent any problems on form submission.Upvotes: 0
Reputation: 824
Use Following code for button
<button type="submit">Create</button>
Upvotes: 0