I was browsing around for tutorials that use a PHP session to insert an ID into a form and use it to check for accidental repeated submission of a form. All of these tutorials seem to set the form action to a separate page on which they place the form-processing part of the PHP, which I don't do. This implies that this method cannot be used when the form action points to the same page: the usual lack of info in tutorials leaves me unsure whether that is the case or not. If so, is there a simple alternative to sessions? (It has to be simple and clear. Ideally, I would like to find
Articles similar to Question about sessions and pages:
How to avoid undefined index error before submitting form?
Code:
<?php # Standard Form
$page_title = 'Form';
include ('includes/header.html');
function email () {
// This function will be called if the error checking doesn't find any problems
}
// Check for form submission:
if (isset($_POST['submitted'])) {
// this is where we will do error checking of the fields
}
?>
<h1>Form</h1>
<form action="form.php" method="post">
<p>First name: <input type="text" name="firstname" size="15" maxlength="15" value="<?php if (isset($_POST['firstname'])) echo $_POST['firstname']; ?>" /></p> Animated Form Switching with jQuery
View demoDownload sourceIn this tutorial we will create a simple animated form switch with three very common forms. The idea is not to leave the page when the user goes to another form but instead make the new form appear within the same container, expanding or contracting to the dimensions of the new form.We will ensure that the form switch works as well when JavaScript is disabled in which case we will simply jump to the other’s form page.So, let’s begin by creating and styling the three forms.The MarkupWe will create three different forms, a login form, a registration form and a password reminder form with just one input field. They will all have different sizes and numbers of inputs.Smart web form validation with PHP
Method for cleaning and validating user web form input with PHP. It uses a unique but simple method of passing information about a form field through POST, which is parsed using PHP on submission.What am I missing with this form processor?
Hey all,
I bought a contact form and php script, but the author will not help with troubleshooting if customization has taken place.
I did not need his actual Form, just the php to process it.
I think I'm just missing something small. When testing, I hit submit, and I get the error to please enter a MESSAGE, even though I have. Can anyone please take a few minutes to see what I'm doing wrong?
Here is my HTML form:
HTML Code:
<div id="form">
<form action="contactprocess.php" method="post" id="info">
<div id="message-wrap" class="slider">undefined index error help
Hi
I have a line in a page which recieves form info from a form page
PHP Code:
$additional_info1 = $_REQUEST['additional_info1'] ;
the problem is, if the form which posts to this page does not have the form field 'additional_info1' then it throws up an undefined index error.
How can I stop this error without having to include the 'additional_info1' form field on the form page. This is one of many form fields which react in this way which I would like to only add only on specific pages which post to this php script. I am hoping to do this without suppressing the error reporting
ie:
PHP Code:
<?php //error_reporting (E_ALL ^ E_NOTICE); ?>
Thanks
Paul MMulti-page form logic - how do you do yours?
Hi All,
I am going to build an app which has 5 data input forms (a survey app), to make it easier to fill in I want to put the 5 forms on seperate pages.
When you have designed multi-page surveys in the past, what design did you use?
For example did you :
1) collect all info from form1 and put the items as hidden vars in form2, and continue this all the way to your final form?
2) insert the results of form1 into a temporary table in a DB?
3) Sessions?
4) use some other approach?
Obviously I need to deal with incomplete data submissions, people abandoning the survey half way through, someone pressing the "back-button" halfway through, blanks, etc.
script for bill same as ship info
I have a form & I want the customer to be able to check a box if the bill to information is the same as the ship to information & have the information automaticlly put into the appropriate boxes. I have the following script in the head of my html page:
<script language="JavaScript">
<!--
function shipsame()
{
var form = document.forms[0];
if(form.sameasbilling.checked){
form.shipname.value = form.shipname.value;
form.shipaddress.value = form.billaddress.value;
form.shipaddress2.value = form.billaddress2.value;
form.shipcity.value = form.billcity.value;
form.shipstate.value = form.billstate.value;
