Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Closed 9 years ago.
Improve this question
When pressing send on my contact page (www.mainmanfilms.com/contact.html) I am sent to my contact-form-handler.php page that requires the visitor to re-type their information. Is there a way to may it one-fluid step? Ideally, they press send and receive my thank-you message. Anything you can offer is appreciated.
Yes. You can leave the action attribute empty and configure the form to POST to itself.
Normally, you'd do something like this:
<form action="contact-form-handler.php" method="post">
If you want to process the form and display the output in the same page, you need to make the following change (note the action attribute being empty:
<form action="" method="post">
An example:
<?php
if (isset($_POST['formsubmit'])) {
//form was submitted, do other stuff
echo $_POST['username']; //example
}
?>
<form action="" method="post">
<input type="text" name="username" />
<input type="submit" name="formsubmit" />
</form>
Related
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!
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
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
what I want to do is start a php session for the username, right after the form so it brings up the username once the user has pressed submit.
Here's the code for the form I have:
<form name="login" method="post">
<input type="text" name="username" placeholder="Username"/>
<input type="submit" name="login" value="Login" />
</form>
What do I do after that? Thanks.
Here is a simplified way; put this on top of the page (above) the html code:
if (isset($_POST['login']) {
session_start();
$_SESSION['name'] = $_POST['name'];
}
Now use that new Session variable where you need as the username. If you close your browser. It's no longer stored. (Unless you set a cookie.)
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
<form name="form11" method="post" action="hpdata.php" enc type="multipart/form-data">
<input name="pro" id="pro" type="hidden" value= "CMS" />
<input name="piror" id="piror" type="hidden" value= "P1" />
<input name="stat" id="stat" type="hidden" value= "In Progress" />
<input type="submit" name="submit" id="submit" class="groovy button" value="...">
</form>
in this code I can't see the data
hidden attribute just use for hide item from the UI. but still you can acsess them after form is submitted using $_POST['id here'] (if form method is get you should get it through $_GET[])
the code you provided has nothing to do with mysql.
It is a html fragment. It contains hidden inputs. If you want to make them visible remove type="hidden".
But most likely there is a purpose why they are hidden. Often this is done to keep values for different form pages or to present the user with pretty values, but send easier to handle versions to the server. (e.g. dates can have different formats in different countrys, but its easier to just send them in a standardized form --> this one would be in a hidden input.)
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
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.
Closed 7 years ago.
Improve this question
Is there a service that allows you to post a form to it from an html page (my php mail isn't working temporarily and I need a quick solution) and it will automatically send an email with specified content to a specified address?
The address it comes from is insignificant.
Check out formspree.
https://github.com/asm-products/formspree
For action you simply put:
<form action="http://formspree.io/you#email.com" method="post">
<input type="text" name="name">
<input type="email" name="_replyto">
<input type="submit" value="Send">
After verifying your email after the first send this will email you the contents of the form. One thing to keep in mind is that this will take the input names. If you do not include input names it won't send you that form field.
There's no perfect solution because they are still encoded as url variables. Setting the enctype to plaintext makes it somewhat more acceptable.
<form action="mailto:email#example.com" enctype="text/plain">
<textarea></textarea>
</form>
I don't believe you can within the website. As the others stated, you can use mailto:someone#blahblah.com, but that is not automatic and it opens the user's default email editor. You could use http://www.emailmeform.com/ though. It lets you make a form and it will send an email to you.
in your html form provide a mailto action.
for example
<form action="mailto:yourdest#email.com">
.....
</form>