Confused why form is not submitting

I don't think there's anything I left out, but the form doesn't seem to be transmitting any data upon hitting submit. My code is as follows, I realize it's kind of long, but I wanted to include the entire form. All of the attached functions just check if the input was valid:

<form name="formname" id="formname" action="database.php" method = post onsubmit="return checker()">

Username: <input type='text' id='un' onchange="checkname(id)" onkeyup="checkempty(id)" ><div id="un1"></div><br>

Reporter Title:<br>

<select id="s2" onblur="checktype(id)" >

<option value="choose">Choose one</option>

<option value="Assistant Director">Assistant Director</option>

<option value="Director">Director</option>

<option value="DB Admin">DB Admin</option>

<option value="Systems Admin">Systems Admin</option>

</select><div id="s21"></div>
<br>

Password: <input type='password' id='pw' onchange="checkpass(id)" onkeyup="checkempty(id)"><div id="pw1"></div><br>

Email: <input type='text' id='eml'onchange="checkemail(id)" onkeyup="checkempty(id)"><div id="eml1"></div><br>

Description:<br> <textarea rows="6" cols="20" id="desc" onchange="checkdesc(id)" onkeyup="checkempty(id)" ></textarea><div id="desc1"></div><br>

Type of Incident:<br>

<select id="s1" onblur="checktype(id)" >

<option value="choose">Choose one</option>

<option value="afs">afs</option>

<option value="password">password</option>

<option value="hardware">hardware</option>

<option value="other">other</option>

</select><div id="s11"></div>
<br>

<?php

include("connect.php");

$ret = mysql_query("SELECT * FROM countries");

echo "Choose your location:<br>";

echo "<select id='countries' onblur='checktype(id)'>";

echo "<option value='choose'>Choose one</option>";

while($array = mysql_fetch_array($ret)){

echo "<option value='{$array['abbrevs']}'>{$array['full']}</option>";

}

echo "</select><br>";


?>

<div id="countries1"></div><br>

<p>
Would you like an email copy?


<select id="s3">

<option value="no">No</option>

<option value="yes">Yes</option>

</select>


<input type="submit" id = "sub" value= "Submit">
</p>


</form>

and the php I tried to receive it with

<?php

include("connect.php");

$username = $_GET['un'];
$password = $_GET['s2'];
$reporter = $_GET['pw'];
$email = $_GET['eml'];
$description = $_GET['desc'];
$type = $_GET['s1'];
$country = $_GET['countries'];
$emailopt = $_GET['s3'];




?>

the checker function:

function checker(){

if(isgood && isgood1 && isgood2 && isgood3 && isgood4 && isgood5 && isgood6)
{
return true;
}
else{

document.getElementById('subb').style.visibility="visible";
document.getElementById('subb').innerHTML = "You must fully complete the form.";
return false;


}

where the "isgoods" where just quick flags I made for validations, which was all working properly.

Answers


Your form's method is POST so you should use $_POST instead of $_GET in your PHP script.

Also you should fix up your HTML so it's valid, you need to quote the method attribute properly:

<form name="formname" id="formname" action="database.php" method="post" onsubmit="return checker()">

Need Your Help

Simplest method for splitting CSV file based on column value

excel csv ms-office openoffice-calc

I'm have a large list of every city in the world that I'm attempting to break down by country. Making this happen manually has been very tedious leading be to believe there is a better way to accom...

How to apply security to login flow through ldap authentication and authorization?

spring-security spring-ldap spring-webflow-2 spring-security-ldap

I realized a login servlet with spring webflow 2 and spring ldap for user authentication. And so far all is ok.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.