Clear form fields after submission [closed] - php

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 years ago.
Improve this question
this is my first question!
I'm working on a simple email spoofer, but the problem is, when you click the submit button, the form fields save the originally entered values, and that means you can spam someone with tons of the same email easily by either pressing the submit button a lot or refreshing the page.
I would like some assistance.
Index.php - http://pastebin.com/dWp5V9vW
Mail.php - http://pastebin.com/DdZs8Rhq

That's because you're dropping the submitted field data into the HTML elements using PHP.
Here is the form HTML without the PHP extras.
<form action="index.php" method="POST">
<input type="text" name="from" placeholder="From" value="">
<input type="text" name="to" placeholder="To" value="">
<input type="text" name="subject" placeholder="Subject" value="">
<textarea name="body"></textarea>
<input type="submit" name="submit" value="Sent">
</form>
Just replace it in your index.php file.
Edit: If you're feeling a bit lazy, I did it for you: http://pastebin.com/XDZyva5T

Related

How to automatically send emails in html [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
I am making a form and I want it to email me whenever somebody completes it. Does anybody know if this can be done in HTML alone or if this has to utilize something more? So basically I want to know if it is possible for when a button is pressed, if that can send an email. Thank You!
<form action="mailto:yourmailadress#xxx.com?Subject=Mail Subject" method="post" enctype="text/plain">
Name:<br>
<input type="text" name="name"><br>
E-mail:<br>
<input type="text" name="mail"><br>
Comment:<br>
<input type="text" name="comment" size="50"><br><br>
<input type="submit" value="Send">
<input type="reset" value="Reset">
</form>
This is the process of sending mail that can be done with html without using a different language.

How to transfer form data from one html page to another? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I have a registration page, having 3 columns username, email, and password. Login Page, consisting of 2 columns email and password now I want to show the username of the corresponding email while logging into the page.
Note- I just want to know how can I fetch the value entered in email to another page.
Thanks in Advance!!
you can get user information like this
sessionService.loadUser().then(user => console.log(user));
you could do this:
page1.php:
<form action="page2.php" method="POST">
<input type="text" name="name" />
<input type="text" name="surname" />
<input type="button" value="Click Me">
</form>
Then once you submit the form the file page2.php will receive the form field values in this way;
page2.php
if($_POST){
var_dump($_POST);
}
good luck!

how to use a common validation for all input fields in a page? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
i have 61 fields in a page, i need input validation , if any one leaves a field blank and enter submit then a error message should show. because i can`t code for every single field validation, quite lengthy. numeric field should accept only numbers, here the field is "phn_no". i am just showing only 2 fields. thank you folks.
<form action="save.php" method="post">
<input type="text" name="name" id="name">
<input type="text" name="phn_no" id="phn_no">
<input type="submit" value="save" name="submit">
</form>
Use input like this
<input type="text" name="name" id="name" required>
required field must be fill then only we submit the form otherwise it display notification.

Php Get and post function not working [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 7 years ago.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Improve this question
I make a simple app without any database in php .just simple post method when i write my input text field and submit it send me to another post and put that input data in that field where i want if work in xammp fine but on live server it show me nothing here is my codes.........
<form action='show.php' method='POST'>
<input type="text" size="30" value="Enter Your Course Code Like &nbsp
&nbsp 'CS101'..." name="text" >
<button name="submit"></button>
</form>
and my show.php code is
<?php
if(isset($_POST['submit'])){
$N = $_POST["text"];
echo ''.$N.'_movie';
}
?>
Where i am wrong?
add type <button name="submit" type="submit"></button>
Tip: Always specify the type attribute for a element. Different browsers use different default types for the element.
also remove name="submit"
You used html element button. It is good choice if you want to add any event with javascript. But if you need to send form normal with backend, you need to use
<input type="submit" value="send" />
OR
<button type="submit">send</button>
the type="submit" mark button as submit form button. You ommited the type so you created only button element.Equivalent for button is
<input type="button" value="Click me" onclick="msg()">
But button does'n invoke send form to the backend.
I think $_POST['submit'] is not set because it doesn't have a value.
Change:
<button name="submit"></button>
To:
<button name="submit" value="1">Submit</button>
Usually you would use a type="submit", then to set the button text you use value:
<input type="submit" value="Submit" />
And now $_POST["submit"] automatically has a value already.

HTML Form not submitting [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 8 years ago.
Improve this question
I have a form like follows:
<form action="" method="GET" data-ronsor-url="http://web-search.tk">
<input id="q">
<input type="submit" value="search">
</form>
But nothing is submitted.
if the form was at http://web-search.tk/?q=mysearch, when the form is submitted, the url is http://web-search.tk/?, why is this. It worked before.
Note: I will delete this question if I get more than 1 downvotes
You need to specify the form action and the name of the input (query) field (instead of, or in addition to, the id):
<form action="http://web-search.tk" method="GET">
<input name="q">
<input type="submit" value="search">
</form>
Try adding a name attribute to the form input:
<form action="" method="GET" data-ronsor-url="http://web-search.tk">
<input id="q" name="q">
<input type="submit" value="search">
</form>
I am not quite sure what are you trying to achieve but if you set the action attr = http://web-search.tk it performs the search at http://web-search.tk website.
You might be depending on some js if you wish to perform the search at your website, but again I'm not quite sure what's yor goal!
Good luck, hope it helps

Categories