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
Related
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  
  '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.
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
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 8 years ago.
Improve this question
im trying to pass a variable with a submit button and it doesn't work.
<FORM METHOD="LINK" ACTION=<?php echo "\"add_event.php?email=".$email."\""?>>
<INPUT TYPE="submit" VALUE="add event">
</FORM>
$email is fine in the page that's calling it.
http://localhost/aproject/add_event.php?
that is the url that's passed.
not
http://localhost/aproject/add_event.php?email=myemail#email.com
as I want.
Any thoughts are appreciated.
edit:
the generated html is
<form method="LINK" action="add_event.php?email=closeded#gmail.com">
<input type="submit" value="add event">
</form>
There is no such form method as LINK, so your form is using GET (the default).
When you submit a GET form, you will destroy any existing query string on the form action and replace it with one generated from the form data.
Use a hidden input to store your data instead.
<form action="add_event.php">
<input type="hidden" name="email" value="<?php echo htmlspecialchars($email); ?>">
<input type="submit" VALUE="add event">
</form>
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.
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>