i have an issue with this new form im using based roughly on a design template that i found online, it looks great for the purposes that i need it for, but the problem is i cant seem to get the input data from the form to pass to the database with php but i had literally the same exact set up before i simply didnt have a input form formated the way it is now, but how can formating change the fuctionality, any help at all is appreciated.

html form

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Add New User</title>
<link rel="stylesheet" type="text/css" href="view.css" media="all">
<script type="text/javascript" src="view.js"></script>

</head>
<body id="main_body" >

    <img id="top" src="top.png" alt="">
    <div id="form_container">
        <br>
        <form id="form_895800" class="appnitro"  method="post" action="form.html">
                    <div class="form_description">
            <center>
            <h2><font size = "4">Add a New Number to the Do Not Call List</font></h2>
            </center>
        </div>                       
            <ul >

                    <li id="li_1" >
        <label class="description" for="empname">Employee Name: </label>
        <div>
            <input id="empname" name="empname" class="element text medium" type="text" maxlength="255" value=""/> 
        </div> 
        </li>        <li class="section_break">
            <h3>Opt-Out Information</h3>
            <p></p>
        </li>        <li id="li_4" >
        <label class="description" for="firstname">First Name: </label>
        <div>
            <input id="firstname" name="firstname" class="element text medium" type="text" maxlength="255" value=""/> 
        </div> 
        </li>        <li id="li_5" >
        <label class="description" for="lastname">Last Name: </label>
        <div>
            <input id="lastname" name="lastname" class="element text medium" type="text" maxlength="255" value=""/> 
        </div> 
        </li>        <li id="li_6" >
        <label class="description" for="newnum">Phone Number: </label>
        <div>
            <input id="newnum" name="newnum" class="element text medium" type="text" maxlength="10" value=""/> 
        </div> 
        </li>        <li id="li_7" >
        <label class="description" for="email">Email: </label>
        <div>
            <input id="email" name="email" class="element text medium" type="text" maxlength="255" value=""/> 
        </div> 
        </li>        <li id="li_2" >
        <label class="description" for="element_2">Mailing Address </label>


        <div class="left">
            <input id="city" name="city" class="element text medium" value="" type="text">
            <label for="city">City</label>
        </div>

        <div class="right">
            <input id="state" name="state" class="element text medium" value="" type="text">
            <label for="state">State / Province / Region</label>
        </div>

        <div class="left">
            <input id="zip" name="zip" class="element text medium" maxlength="15" value="" type="text">
            <label for="zip">Postal / Zip Code</label>
        </div>

        <div class="right">
            <select class="element select medium" id="prov" name="prov"> 
            <option value="" selected="selected"></option>
<option value="Afghanistan" >Afghanistan</option>
<option value="Albania" >Albania</option>
<option value="Algeria" >Algeria</option>
<option value="Andorra" >Andorra</option>
<option value="Antigua and Barbuda" >Antigua and Barbuda</option>
<option value="Argentina" >Argentina</option>
<option value="Armenia" >Armenia</option>
<option value="Australia" >Australia</option>
<option value="Austria" >Austria</option>
<option value="Azerbaijan" >Azerbaijan</option>
<option value="Bahamas" >Bahamas</option>
<option value="Bahrain" >Bahrain</option>
<option value="Bangladesh" >Bangladesh</option>
<option value="Barbados" >Barbados</option>
<option value="Belarus" >Belarus</option>
<option value="Belgium" >Belgium</option>
<option value="Belize" >Belize</option>
<option value="Benin" >Benin</option>
<option value="Bhutan" >Bhutan</option>
<option value="Bolivia" >Bolivia</option>
<option value="Bosnia and Herzegovina" >Bosnia and Herzegovina</option>
<option value="Botswana" >Botswana</option>
<option value="Brazil" >Brazil</option>
<option value="Brunei" >Brunei</option>
<option value="Bulgaria" >Bulgaria</option>
<option value="Burkina Faso" >Burkina Faso</option>
<option value="Burundi" >Burundi</option>
<option value="Cambodia" >Cambodia</option>
<option value="Cameroon" >Cameroon</option>
<option value="Canada" >Canada</option>
<option value="Cape Verde" >Cape Verde</option>
<option value="Central African Republic" >Central African Republic</option>
<option value="Chad" >Chad</option>
<option value="Chile" >Chile</option>
<option value="China" >China</option>
<option value="Colombia" >Colombia</option>
<option value="Comoros" >Comoros</option>
<option value="Congo" >Congo</option>
<option value="Costa Rica" >Costa Rica</option>
<option value="Côte d'Ivoire" >Côte d'Ivoire</option>
<option value="Croatia" >Croatia</option>
<option value="Cuba" >Cuba</option>
<option value="Cyprus" >Cyprus</option>
<option value="Czech Republic" >Czech Republic</option>
<option value="Denmark" >Denmark</option>
<option value="Djibouti" >Djibouti</option>
<option value="Dominica" >Dominica</option>
<option value="Dominican Republic" >Dominican Republic</option>
<option value="East Timor" >East Timor</option>
<option value="Ecuador" >Ecuador</option>
<option value="Egypt" >Egypt</option>
<option value="El Salvador" >El Salvador</option>
<option value="Equatorial Guinea" >Equatorial Guinea</option>
<option value="Eritrea" >Eritrea</option>
<option value="Estonia" >Estonia</option>
<option value="Ethiopia" >Ethiopia</option>
<option value="Fiji" >Fiji</option>
<option value="Finland" >Finland</option>
<option value="France" >France</option>
<option value="Gabon" >Gabon</option>
<option value="Gambia" >Gambia</option>
<option value="Georgia" >Georgia</option>
<option value="Germany" >Germany</option>
<option value="Ghana" >Ghana</option>
<option value="Greece" >Greece</option>
<option value="Grenada" >Grenada</option>
<option value="Guatemala" >Guatemala</option>
<option value="Guinea" >Guinea</option>
<option value="Guinea-Bissau" >Guinea-Bissau</option>
<option value="Guyana" >Guyana</option>
<option value="Haiti" >Haiti</option>
<option value="Honduras" >Honduras</option>
<option value="Hong Kong" >Hong Kong</option>
<option value="Hungary" >Hungary</option>
<option value="Iceland" >Iceland</option>
<option value="India" >India</option>
<option value="Indonesia" >Indonesia</option>
<option value="Iran" >Iran</option>
<option value="Iraq" >Iraq</option>
<option value="Ireland" >Ireland</option>
<option value="Israel" >Israel</option>
<option value="Italy" >Italy</option>
<option value="Jamaica" >Jamaica</option>
<option value="Japan" >Japan</option>
<option value="Jordan" >Jordan</option>
<option value="Kazakhstan" >Kazakhstan</option>
<option value="Kenya" >Kenya</option>
<option value="Kiribati" >Kiribati</option>
<option value="North Korea" >North Korea</option>
<option value="South Korea" >South Korea</option>
<option value="Kuwait" >Kuwait</option>
<option value="Kyrgyzstan" >Kyrgyzstan</option>
<option value="Laos" >Laos</option>
<option value="Latvia" >Latvia</option>
<option value="Lebanon" >Lebanon</option>
<option value="Lesotho" >Lesotho</option>
<option value="Liberia" >Liberia</option>
<option value="Libya" >Libya</option>
<option value="Liechtenstein" >Liechtenstein</option>
<option value="Lithuania" >Lithuania</option>
<option value="Luxembourg" >Luxembourg</option>
<option value="Macedonia" >Macedonia</option>
<option value="Madagascar" >Madagascar</option>
<option value="Malawi" >Malawi</option>
<option value="Malaysia" >Malaysia</option>
<option value="Maldives" >Maldives</option>
<option value="Mali" >Mali</option>
<option value="Malta" >Malta</option>
<option value="Marshall Islands" >Marshall Islands</option>
<option value="Mauritania" >Mauritania</option>
<option value="Mauritius" >Mauritius</option>
<option value="Mexico" >Mexico</option>
<option value="Micronesia" >Micronesia</option>
<option value="Moldova" >Moldova</option>
<option value="Monaco" >Monaco</option>
<option value="Mongolia" >Mongolia</option>
<option value="Montenegro" >Montenegro</option>
<option value="Morocco" >Morocco</option>
<option value="Mozambique" >Mozambique</option>
<option value="Myanmar" >Myanmar</option>
<option value="Namibia" >Namibia</option>
<option value="Nauru" >Nauru</option>
<option value="Nepal" >Nepal</option>
<option value="Netherlands" >Netherlands</option>
<option value="New Zealand" >New Zealand</option>
<option value="Nicaragua" >Nicaragua</option>
<option value="Niger" >Niger</option>
<option value="Nigeria" >Nigeria</option>
<option value="Norway" >Norway</option>
<option value="Oman" >Oman</option>
<option value="Pakistan" >Pakistan</option>
<option value="Palau" >Palau</option>
<option value="Panama" >Panama</option>
<option value="Papua New Guinea" >Papua New Guinea</option>
<option value="Paraguay" >Paraguay</option>
<option value="Peru" >Peru</option>
<option value="Philippines" >Philippines</option>
<option value="Poland" >Poland</option>
<option value="Portugal" >Portugal</option>
<option value="Puerto Rico" >Puerto Rico</option>
<option value="Qatar" >Qatar</option>
<option value="Romania" >Romania</option>
<option value="Russia" >Russia</option>
<option value="Rwanda" >Rwanda</option>
<option value="Saint Kitts and Nevis" >Saint Kitts and Nevis</option>
<option value="Saint Lucia" >Saint Lucia</option>
<option value="Saint Vincent and the Grenadines" >Saint Vincent and the Grenadines</option>
<option value="Samoa" >Samoa</option>
<option value="San Marino" >San Marino</option>
<option value="Sao Tome and Principe" >Sao Tome and Principe</option>
<option value="Saudi Arabia" >Saudi Arabia</option>
<option value="Senegal" >Senegal</option>
<option value="Serbia and Montenegro" >Serbia and Montenegro</option>
<option value="Seychelles" >Seychelles</option>
<option value="Sierra Leone" >Sierra Leone</option>
<option value="Singapore" >Singapore</option>
<option value="Slovakia" >Slovakia</option>
<option value="Slovenia" >Slovenia</option>
<option value="Solomon Islands" >Solomon Islands</option>
<option value="Somalia" >Somalia</option>
<option value="South Africa" >South Africa</option>
<option value="Spain" >Spain</option>
<option value="Sri Lanka" >Sri Lanka</option>
<option value="Sudan" >Sudan</option>
<option value="Suriname" >Suriname</option>
<option value="Swaziland" >Swaziland</option>
<option value="Sweden" >Sweden</option>
<option value="Switzerland" >Switzerland</option>
<option value="Syria" >Syria</option>
<option value="Taiwan" >Taiwan</option>
<option value="Tajikistan" >Tajikistan</option>
<option value="Tanzania" >Tanzania</option>
<option value="Thailand" >Thailand</option>
<option value="Togo" >Togo</option>
<option value="Tonga" >Tonga</option>
<option value="Trinidad and Tobago" >Trinidad and Tobago</option>
<option value="Tunisia" >Tunisia</option>
<option value="Turkey" >Turkey</option>
<option value="Turkmenistan" >Turkmenistan</option>
<option value="Tuvalu" >Tuvalu</option>
<option value="Uganda" >Uganda</option>
<option value="Ukraine" >Ukraine</option>
<option value="United Arab Emirates" >United Arab Emirates</option>
<option value="United Kingdom" >United Kingdom</option>
<option value="United States" >United States</option>
<option value="Uruguay" >Uruguay</option>
<option value="Uzbekistan" >Uzbekistan</option>
<option value="Vanuatu" >Vanuatu</option>
<option value="Vatican City" >Vatican City</option>
<option value="Venezuela" >Venezuela</option>
<option value="Vietnam" >Vietnam</option>
<option value="Yemen" >Yemen</option>
<option value="Zambia" >Zambia</option>
<option value="Zimbabwe" >Zimbabwe</option>

            </select>
        <label for="prov">Country</label>
    </div> 
        </li>

                    <li class="buttons">
                <input type="hidden" name="form_id" value="895800" />

                <input id="add" class="button_text" type="submit" name="add" value="Submit" />
        </li>
            </ul>
        </form>  
    </div>
    <img id="bottom" src="bottom.png" alt="">
    </body>
</html>

php code

<?php

$con = mysqli_connect("localhost", "root", "", "numbers") or die(mysqli_error($con));
//submission code, inserting data into mysql database   
$min_length = 10;
$newnum = NULL;
$mySqlDate = date('Y-m-d');
$mySqlTime = date('g:i a');

if(isset($_GET['add']))
{
    $empname = $_GET['empname'];
    $newnum = $_GET['newnum'];
    $firstname = $_GET['firstname'];
    $lastname = $_GET['lastname'];
    $email = $_GET['email'];
    $streetadd = $_GET['streetadd'];
    $state = $_GET['state'];
    $zip = $_GET['zip'];
    $city = $_GET['city'];
}

if(strlen($newnum) == $min_length)
{
    //filter out non numeric and special characters
    $empname = mysqli_real_escape_string($con, $_GET['empname']);
    $newnum = mysqli_real_escape_string($con, $_GET['newnum']);
    $firstname = mysqli_real_escape_string($con, $_GET['firstname']);
    $lastname = mysqli_real_escape_string($con, $_GET['lastname']);
    $email = mysqli_real_escape_string($con, $_GET['email']);
    $streetadd = mysqli_real_escape_string($con, $_GET['streetadd']);
    $state = mysqli_real_escape_string($con, $_GET['state']);
    $zip = mysqli_real_escape_string($con, $_GET['zip']);
    $city = mysqli_real_escape_string($con, $_GET['city']);


    $check = mysqli_query($con, "SELECT count(*) FROM usernumdata WHERE numb = '".$newnum."'") or die();
    $row = mysqli_fetch_row($check);

    if ($row[0] == 0)
    {
        $sql="INSERT INTO usernumdata (empname, numb, firstname, lastname, email, date, time, streetadd, state, zip, city) VALUES ('".$empname."','".$newnum."','".$firstname."','".$lastname."','".$email."','".$mySqlDate."','".$mySqlTime."','".$streetadd."','".$state."','".$zip."','".$city."')";

        if (!mysqli_query($con,$sql)) {
            die('Error: ' . mysqli_error($con));
        }
        //header('Location: /search/index.php');
    }
    else
    {
        echo "testing";
        //echo "<div style='text-align: center'> <font size='6' color='red'>Number Already Exists In Do Not Call List</font> <div>";
    }
}

?>

im sure its probably something stupid that im not seeing, i just need some direction as to why its not working now.

hi check your form action you are sending your data in a .html file try making a .php file

thank you for the response, and dont worry about multi repsonse, its all good :)

and as for the html thing, my files may seem like they are seperate but it is the same file just two seperate code snippets. what i would love to do is set this to go back to th eprevious page after the submit button has been clicked, if this is not possible that is fine, i would be ok with making a seperate button that would be only for returning to the previous page.

See what its doing now is just submitting but no info is actually going through, idk why this is cause its worked fine before, maybe im just not seeing a simple issue, idk lol but ive been working on it so long im become sick of looking at it lol.

Member Avatar for diafol
<form id="form_895800" class="appnitro"  method="post" action="form.html">

html files can't usually process php code unless you made a change to your Apache .htaccess files allowing them to do so. Is this the case?

ok thats interesting and i did not know that, so if this is the case then would it be easier to just rename the file to a PHP file and then include the html code in it? Im just getting ideas as to how to approach this cause what i want is the file to process the info from the form that is through html and then take that info and add it to the database with PHP. So can i do this? would it be easier this way? would this look better?

<form id="form_895800" class="appnitro"  method="post" action="form.php">
Member Avatar for diafol

Ok as long as the page is actually called form.php have you tried it?

alright i got it all, i figured out that i was assigning values to the form variables twice AND i was posting instead of getting, lol gotta love those tiny errors, i will post fixed code

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Add New User</title>
<link rel="stylesheet" type="text/css" href="view.css" media="all">
<script type="text/javascript" src="view.js"></script>

</head>
<body id="main_body" >

    <img id="top" src="top.png" alt="">
    <div id="form_container">
        <br>
        <form id="form_895800" class="appnitro"  method="get" action="form.php">
                    <div class="form_description">
            <center>
            <h2><font size = "4">Add a New Number to the Do Not Call List</font></h2>
            </center>
        </div>                       
            <ul >

                    <li id="li_1" >
        <label class="description" for="empname">Employee Full Name: </label>
        <div>
            <input id="empname" name="empname" class="element text medium" type="text" maxlength="255" value=""/> 
        </div> 
        </li>        <li class="section_break">
            <h3>Opt-Out Information</h3>
            <p></p>
        </li>        <li id="li_4" >
        <label class="description" for="firstname">First Name: </label>
        <div>
            <input id="firstname" name="firstname" class="element text medium" type="text" maxlength="255" value=""/> 
        </div> 
        </li>        <li id="li_5" >
        <label class="description" for="lastname">Last Name: </label>
        <div>
            <input id="lastname" name="lastname" class="element text medium" type="text" maxlength="255" value=""/> 
        </div> 
        </li>        <li id="li_6" >
        <label class="description" for="newnum">Phone Number: </label>
        <div>
            <input id="newnum" name="newnum" class="element text medium" type="text" maxlength="10" value=""/> 
        </div> 
        </li>        <li id="li_7" >
        <label class="description" for="email">Email: </label>
        <div>
            <input id="email" name="email" class="element text medium" type="text" maxlength="255" value=""/> 
        </div> 
        </li>        <li id="li_2" >
        <label class="description" for="element_2">Locale Information </label>


        <div>
            <input id="streetadd" name="streetadd" class="element text medium" value="" type="text">
            <label for="streetadd">Mailing Address</label>
        </div>

        <div class="left">
            <input id="city" name="city" class="element text medium" value="" type="text">
            <label for="city">City</label>
        </div>

        <div class="right">
            <input id="state" name="state" class="element text medium" value="" type="text">
            <label for="state">State / Province / Region</label>
        </div>

        <div class="left">
            <input id="zip" name="zip" class="element text medium" maxlength="15" value="" type="text">
            <label for="zip">Postal / Zip Code</label>
        </div>

        <div class="right">
            <select class="element select medium" id="prov" name="prov"> 
            <option value="" selected="selected"></option>
<option value="Afghanistan" >Afghanistan</option>
<option value="Albania" >Albania</option>
<option value="Algeria" >Algeria</option>
<option value="Andorra" >Andorra</option>
<option value="Antigua and Barbuda" >Antigua and Barbuda</option>
<option value="Argentina" >Argentina</option>
<option value="Armenia" >Armenia</option>
<option value="Australia" >Australia</option>
<option value="Austria" >Austria</option>
<option value="Azerbaijan" >Azerbaijan</option>
<option value="Bahamas" >Bahamas</option>
<option value="Bahrain" >Bahrain</option>
<option value="Bangladesh" >Bangladesh</option>
<option value="Barbados" >Barbados</option>
<option value="Belarus" >Belarus</option>
<option value="Belgium" >Belgium</option>
<option value="Belize" >Belize</option>
<option value="Benin" >Benin</option>
<option value="Bhutan" >Bhutan</option>
<option value="Bolivia" >Bolivia</option>
<option value="Bosnia and Herzegovina" >Bosnia and Herzegovina</option>
<option value="Botswana" >Botswana</option>
<option value="Brazil" >Brazil</option>
<option value="Brunei" >Brunei</option>
<option value="Bulgaria" >Bulgaria</option>
<option value="Burkina Faso" >Burkina Faso</option>
<option value="Burundi" >Burundi</option>
<option value="Cambodia" >Cambodia</option>
<option value="Cameroon" >Cameroon</option>
<option value="Canada" >Canada</option>
<option value="Cape Verde" >Cape Verde</option>
<option value="Central African Republic" >Central African Republic</option>
<option value="Chad" >Chad</option>
<option value="Chile" >Chile</option>
<option value="China" >China</option>
<option value="Colombia" >Colombia</option>
<option value="Comoros" >Comoros</option>
<option value="Congo" >Congo</option>
<option value="Costa Rica" >Costa Rica</option>
<option value="Côte d'Ivoire" >Côte d'Ivoire</option>
<option value="Croatia" >Croatia</option>
<option value="Cuba" >Cuba</option>
<option value="Cyprus" >Cyprus</option>
<option value="Czech Republic" >Czech Republic</option>
<option value="Denmark" >Denmark</option>
<option value="Djibouti" >Djibouti</option>
<option value="Dominica" >Dominica</option>
<option value="Dominican Republic" >Dominican Republic</option>
<option value="East Timor" >East Timor</option>
<option value="Ecuador" >Ecuador</option>
<option value="Egypt" >Egypt</option>
<option value="El Salvador" >El Salvador</option>
<option value="Equatorial Guinea" >Equatorial Guinea</option>
<option value="Eritrea" >Eritrea</option>
<option value="Estonia" >Estonia</option>
<option value="Ethiopia" >Ethiopia</option>
<option value="Fiji" >Fiji</option>
<option value="Finland" >Finland</option>
<option value="France" >France</option>
<option value="Gabon" >Gabon</option>
<option value="Gambia" >Gambia</option>
<option value="Georgia" >Georgia</option>
<option value="Germany" >Germany</option>
<option value="Ghana" >Ghana</option>
<option value="Greece" >Greece</option>
<option value="Grenada" >Grenada</option>
<option value="Guatemala" >Guatemala</option>
<option value="Guinea" >Guinea</option>
<option value="Guinea-Bissau" >Guinea-Bissau</option>
<option value="Guyana" >Guyana</option>
<option value="Haiti" >Haiti</option>
<option value="Honduras" >Honduras</option>
<option value="Hong Kong" >Hong Kong</option>
<option value="Hungary" >Hungary</option>
<option value="Iceland" >Iceland</option>
<option value="India" >India</option>
<option value="Indonesia" >Indonesia</option>
<option value="Iran" >Iran</option>
<option value="Iraq" >Iraq</option>
<option value="Ireland" >Ireland</option>
<option value="Israel" >Israel</option>
<option value="Italy" >Italy</option>
<option value="Jamaica" >Jamaica</option>
<option value="Japan" >Japan</option>
<option value="Jordan" >Jordan</option>
<option value="Kazakhstan" >Kazakhstan</option>
<option value="Kenya" >Kenya</option>
<option value="Kiribati" >Kiribati</option>
<option value="North Korea" >North Korea</option>
<option value="South Korea" >South Korea</option>
<option value="Kuwait" >Kuwait</option>
<option value="Kyrgyzstan" >Kyrgyzstan</option>
<option value="Laos" >Laos</option>
<option value="Latvia" >Latvia</option>
<option value="Lebanon" >Lebanon</option>
<option value="Lesotho" >Lesotho</option>
<option value="Liberia" >Liberia</option>
<option value="Libya" >Libya</option>
<option value="Liechtenstein" >Liechtenstein</option>
<option value="Lithuania" >Lithuania</option>
<option value="Luxembourg" >Luxembourg</option>
<option value="Macedonia" >Macedonia</option>
<option value="Madagascar" >Madagascar</option>
<option value="Malawi" >Malawi</option>
<option value="Malaysia" >Malaysia</option>
<option value="Maldives" >Maldives</option>
<option value="Mali" >Mali</option>
<option value="Malta" >Malta</option>
<option value="Marshall Islands" >Marshall Islands</option>
<option value="Mauritania" >Mauritania</option>
<option value="Mauritius" >Mauritius</option>
<option value="Mexico" >Mexico</option>
<option value="Micronesia" >Micronesia</option>
<option value="Moldova" >Moldova</option>
<option value="Monaco" >Monaco</option>
<option value="Mongolia" >Mongolia</option>
<option value="Montenegro" >Montenegro</option>
<option value="Morocco" >Morocco</option>
<option value="Mozambique" >Mozambique</option>
<option value="Myanmar" >Myanmar</option>
<option value="Namibia" >Namibia</option>
<option value="Nauru" >Nauru</option>
<option value="Nepal" >Nepal</option>
<option value="Netherlands" >Netherlands</option>
<option value="New Zealand" >New Zealand</option>
<option value="Nicaragua" >Nicaragua</option>
<option value="Niger" >Niger</option>
<option value="Nigeria" >Nigeria</option>
<option value="Norway" >Norway</option>
<option value="Oman" >Oman</option>
<option value="Pakistan" >Pakistan</option>
<option value="Palau" >Palau</option>
<option value="Panama" >Panama</option>
<option value="Papua New Guinea" >Papua New Guinea</option>
<option value="Paraguay" >Paraguay</option>
<option value="Peru" >Peru</option>
<option value="Philippines" >Philippines</option>
<option value="Poland" >Poland</option>
<option value="Portugal" >Portugal</option>
<option value="Puerto Rico" >Puerto Rico</option>
<option value="Qatar" >Qatar</option>
<option value="Romania" >Romania</option>
<option value="Russia" >Russia</option>
<option value="Rwanda" >Rwanda</option>
<option value="Saint Kitts and Nevis" >Saint Kitts and Nevis</option>
<option value="Saint Lucia" >Saint Lucia</option>
<option value="Saint Vincent and the Grenadines" >Saint Vincent and the Grenadines</option>
<option value="Samoa" >Samoa</option>
<option value="San Marino" >San Marino</option>
<option value="Sao Tome and Principe" >Sao Tome and Principe</option>
<option value="Saudi Arabia" >Saudi Arabia</option>
<option value="Senegal" >Senegal</option>
<option value="Serbia and Montenegro" >Serbia and Montenegro</option>
<option value="Seychelles" >Seychelles</option>
<option value="Sierra Leone" >Sierra Leone</option>
<option value="Singapore" >Singapore</option>
<option value="Slovakia" >Slovakia</option>
<option value="Slovenia" >Slovenia</option>
<option value="Solomon Islands" >Solomon Islands</option>
<option value="Somalia" >Somalia</option>
<option value="South Africa" >South Africa</option>
<option value="Spain" >Spain</option>
<option value="Sri Lanka" >Sri Lanka</option>
<option value="Sudan" >Sudan</option>
<option value="Suriname" >Suriname</option>
<option value="Swaziland" >Swaziland</option>
<option value="Sweden" >Sweden</option>
<option value="Switzerland" >Switzerland</option>
<option value="Syria" >Syria</option>
<option value="Taiwan" >Taiwan</option>
<option value="Tajikistan" >Tajikistan</option>
<option value="Tanzania" >Tanzania</option>
<option value="Thailand" >Thailand</option>
<option value="Togo" >Togo</option>
<option value="Tonga" >Tonga</option>
<option value="Trinidad and Tobago" >Trinidad and Tobago</option>
<option value="Tunisia" >Tunisia</option>
<option value="Turkey" >Turkey</option>
<option value="Turkmenistan" >Turkmenistan</option>
<option value="Tuvalu" >Tuvalu</option>
<option value="Uganda" >Uganda</option>
<option value="Ukraine" >Ukraine</option>
<option value="United Arab Emirates" >United Arab Emirates</option>
<option value="United Kingdom" >United Kingdom</option>
<option value="United States" >United States</option>
<option value="Uruguay" >Uruguay</option>
<option value="Uzbekistan" >Uzbekistan</option>
<option value="Vanuatu" >Vanuatu</option>
<option value="Vatican City" >Vatican City</option>
<option value="Venezuela" >Venezuela</option>
<option value="Vietnam" >Vietnam</option>
<option value="Yemen" >Yemen</option>
<option value="Zambia" >Zambia</option>
<option value="Zimbabwe" >Zimbabwe</option>

            </select>
        <label for="prov">Country</label>
    </div> 
        </li>

                    <li class="buttons">

                <div class "left">
                <input id="add" class="button_text" type="submit" name="add" value="Submit" />
                </div>

        </li>
            </ul>
        </form>  
        <li class="buttons">
        <form action="/search/" >
                <center>
                <input id="return" class="button_text" type="submit" name="return" value="Go Back" />
                </center>
        </form>
        </li>
        <br>
    </div>
    <img id="bottom" src="bottom.png" alt="">
    </body>
</html>

<?php

$con = mysqli_connect("localhost", "root", "", "numbers") or die(mysqli_error($con));
//submission code, inserting data into mysql database   
$min_length = 10;
$newnum = NULL;
$mySqlDate = date('Y-m-d');
$mySqlTime = date('g:i a');

if(isset($_GET['add']))
{
    //filter out non numeric and special characters
    $empname = $_GET['empname'];
    $newnum = $_GET['newnum'];
    $firstname = $_GET['firstname'];
    $lastname = $_GET['lastname'];
    $email = $_GET['email'];
    $streetadd = $_GET['streetadd'];
    $state = $_GET['state'];
    $zip = $_GET['zip'];
    $city = $_GET['city'];
    $prov = $_GET['prov'];
}


    $check = mysqli_query($con, "SELECT count(*) FROM usernumdata WHERE numb = '".$newnum."'") or die();
    $row = mysqli_fetch_row($check);

    if ($row[0] == 0)
    {
        $sql="INSERT INTO usernumdata (empname, numb, firstname, lastname, email, date, time, streetadd, state, zip, city, prov) VALUES ('".$empname."','".$newnum."','".$firstname."','".$lastname."','".$email."','".$mySqlDate."','".$mySqlTime."','".$streetadd."','".$state."','".$zip."','".$city."','".$prov."')";

        if (!mysqli_query($con,$sql)) {
            die('Error: ' . mysqli_error($con));
        }
    }
    else
    {
        echo "testing";
        //echo "<div style='text-align: center'> <font size='6' color='red'>Number Already Exists In Do Not Call List</font> <div>";
    }


?>

This is the entire one file code complete with a return button but ull need to change the address to something that fits your need.

Thanks for all the help and support, idk how id get any of this without you guys :D

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.