answersLogoWhite

0

<form method="post" action="$_SERVER['PHP_SELF']>

(form contents here)

</form>

User Avatar

Wiki User

16y ago

What else can I help you with?

Continue Learning about Engineering

What are the methods of retrieving data from HTML form?

An old way is to use an email in the form's action attribute, but this requires the user to have a mail account/application set up on his or her computer, which isn't very handy. The other way is to use php to either insert/update the data in a database or to return the information in another web page, or both. This can be done by specifying your receiving php file in the form's action tag, for example: &lt;form action="receive.php" method="POST"&gt;Insert form elements here&lt;/form&gt; However, using php requires that your webserver supports php.


How do you create a simple questionnaire using php?

Here's a quick example on how to do it. &lt;?php if(isset($_POST['send'])) { if($_POST['answer'] == 'My Answer') echo 'You got it!'; else echo 'Wrong answer.'; } ?&gt; &lt;form method="post" action="you_file_name_here"&gt; What is the answer to this question? &lt;br&gt; &lt;input type="text" name="answer"&gt; &lt;input type="submit" name="send" value="Check it!"&gt; &lt;/form&gt;


Php code to insert value from textbox into dropdownlist?

Once you submit a form you can use the $_POST[] array to grab the data from a form with PHP. You can then use this data to insert it into a form. Here is an example: &lt;?php if($_POST['submit']){ $text_box_contents = $_POST['comments']; echo ' &lt;select&gt; &lt;option&gt;'.$text_box_contents .'&lt;/option&gt; &lt;/select&gt;'; }else{ echo ' &lt;form method="post" action="$_SERVER['self']"&gt; &lt;textarea name="comments" cols="40" rows="5"&gt; hostmysite.com Enter your comments here... &lt;/textarea&gt;&lt;br&gt; &lt;input type="submit" value="Submit" /&gt; &lt;/form&gt;'; } ?&gt;


How do you write a password script using JavaScript in PHP with a form?

This question is too broad, be more specific.


Form's action attributes in HTML?

A form's action attribute in HTML is used to tell the browser where the data collected from the form will be submitted. This collection is usually some kind of backend programming, written in a language like ASP or PHP. The place where the action attribute is pointed towards will process the data, saving it, running a query, or whatever else is supposed to happen to it.

Related Questions

How can you make a PHP form in HTML and submit without using a php file or email?

To submit a file, you don't even need a PHP file. The PHP portion is for processing the form results. You just make a button and make sure you defined the action URL.Name: Gender:Boy: Girl:


How do you make a login using PHP?

Create an HTML form with METHOD="post" and ACTION="login2.php". In login2.php check if the entered username and password are correct. You can get the username with $_POST['name_of_username_input']. The same goes for the password.


How do you go from HTML form to php?

Build your form in HTML and specify your PHP file in the action of the document. HTML does the form stuff, PHP the processing (although you can - of course - use HTML inside PHP via print() or echo(), too)


What are the methods of retrieving data from HTML form?

An old way is to use an email in the form's action attribute, but this requires the user to have a mail account/application set up on his or her computer, which isn't very handy. The other way is to use php to either insert/update the data in a database or to return the information in another web page, or both. This can be done by specifying your receiving php file in the form's action tag, for example: &lt;form action="receive.php" method="POST"&gt;Insert form elements here&lt;/form&gt; However, using php requires that your webserver supports php.


Passing details to a same page using PHP?

PHP is server side producing a webpage that is served to your browser. In order to pass details to a php script you will need to send then via a form. This can be done via a standard form with method="post" or method="get" the variables are read by php as $_GET['var_name'] or $_POST['var_name'] with var_name being the name of the INPUT on the form. If you omit the action (action="page2.php") then the form will post to itself (no matter what you call it) and not specifically page2.php If you want to pass values but not refresh the page then lookup 'ajax'. Its a method of posting forms using javascript which will then wait for the result and deal with the text response. eg. OK or ERROR:email not valid


How do you create a simple questionnaire using php?

Here's a quick example on how to do it. &lt;?php if(isset($_POST['send'])) { if($_POST['answer'] == 'My Answer') echo 'You got it!'; else echo 'Wrong answer.'; } ?&gt; &lt;form method="post" action="you_file_name_here"&gt; What is the answer to this question? &lt;br&gt; &lt;input type="text" name="answer"&gt; &lt;input type="submit" name="send" value="Check it!"&gt; &lt;/form&gt;


Php code to insert value from textbox into dropdownlist?

Once you submit a form you can use the $_POST[] array to grab the data from a form with PHP. You can then use this data to insert it into a form. Here is an example: &lt;?php if($_POST['submit']){ $text_box_contents = $_POST['comments']; echo ' &lt;select&gt; &lt;option&gt;'.$text_box_contents .'&lt;/option&gt; &lt;/select&gt;'; }else{ echo ' &lt;form method="post" action="$_SERVER['self']"&gt; &lt;textarea name="comments" cols="40" rows="5"&gt; hostmysite.com Enter your comments here... &lt;/textarea&gt;&lt;br&gt; &lt;input type="submit" value="Submit" /&gt; &lt;/form&gt;'; } ?&gt;


How do you restore the value of textbox from one page to another in PHP?

You could do something like this: pg.1.htm &lt;form method="post" action="pg2.php"&gt; &lt;input type="text" name="txt1" size="20" /&gt; &lt;/form&gt; pg2.php &lt;?php $textbox = $_POST['txt1']; ?&gt; &lt;input type="text" name="txt2" size="20" value="&lt;?php echo $textbox; ?&gt;" /&gt; Is that what you were asking for?


How do you post the data from an input type checkbox in a form to MySQL tables using PHP?

using the post command.$_POST['checkboxname'];


How do you write a password script using JavaScript in PHP with a form?

This question is too broad, be more specific.


Does android supports PHP?

It supports websites made on php but not coding in php. There are workarounds for coding in PHP using Android.


Is there any widget that can take details and email them?

I dont know about widget but using php you can create a form that will then email it to you. I would suggest you try a tutorial on http://www.tutorialized.com under php.