troubleshooting Question

Form not sending information to php script

Avatar of DancingFighterG
DancingFighterG asked on
PHP
3 Comments1 Solution891 ViewsLast Modified:
Hello, I'm having an issue with my form sending information to my php script. When I push register it sends blank information to the php script and inserts blanks into to the database. I don't know right now if it's the form or the script. I've had this working before but for my designer but some new visuals in it but now it's not working. I need help on this ASAP. Thanks!!



Below is the form

<html>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<META NAME="KEYWORDS" CONTENT="SOUL CALBIUR 4, SOUL CALIBUR REGIONALS, SOUL CALIBUR NATIONALS, COMPETITION, TOURNAMENTS, GAMING, NVGA, DANCINGFIGHTERG, National Video Game Association, Soul Calibur, ">
<script src="Scripts/swfobject_modified.js" type="text/javascript"></script>
<head>

<!-- Location/Email/Picked Game function -->

<style type="text/css">
<!--
body {
      background-color: #000000;
      margin-left: 0px;
      margin-top: 0px;
      margin-right: 0px;
      margin-bottom: 0px;
      background-image: url(images/coming-soon.jpg);
      background-repeat: no-repeat;
      background-position: center top;
}
.bkg {

}
.contentTable {
}
body,td,th {
      font-family: Arial, Helvetica, sans-serif;
      font-size: 12px;
}
-->
</style>

<script type = "text/javascript">

function Valname(obj) {

//checks for valid email
var myemail = document.getElementById("Email");

var pos = myemail.value.search(/^[a-z0-9A-Z](.+)@[a-z0-9A-Z](.+).[a-z0-9A-Z](.+)$/);

if (pos != 0) {

alert("The email you entered (" + myemail.value +") is not the correct form. \n" +

  "The correct email form is: " + "yourname@yourdomain.something " +

  "Please go back and fix your email");
 
myemail.focus();

myemail.select();

return false;

}
      
// Checks how you heard about event
if ( document.form.location.selectedIndex == 0 )
{

      alert ( "Please select a location." );

      valid = false;

      return false;
}

// Checks how you heard about event
if ( document.form.hear.selectedIndex == 0 )
{

      alert ( "Please tells how you heard about this tournament." );

      valid = false;

      return false;

}

}
      
</script>
</head>

<title>Soul Calibur 4 Nationals - Hosted by the NVGA</title>
<body>
<table width="100%" height="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
  <td class="bkg">&nbsp;</td>
  <td width="920" height="115" class="bkg">
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="920" height="550" align="middle" id="FlashID">
      <param name="movie" value="flash/soul-calibur-4-nationals.swf">
      <param name="quality" value="high">
      <param name="wmode" value="transparent">
      <param name="swfversion" value="9.0.45.0">
      <!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you dont want users to see the prompt. -->
      <param name="expressinstall" value="Scripts/expressInstall.swf">
      <!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. -->
      <!--[if !IE]>-->
      <object data="flash/soul-calibur-4-nationals.swf" type="application/x-shockwave-flash" width="920" height="550" align="middle">
        <!--<![endif]-->
        <param name="quality" value="high">
        <param name="wmode" value="transparent">
        <param name="swfversion" value="9.0.45.0">
        <param name="expressinstall" value="Scripts/expressInstall.swf">
        <!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. -->
        <div>
          <h4>Content on this page requires a newer version of Adobe Flash Player.</h4>
          <p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" width="112" height="33" /></a></p>
        </div>
        <!--[if !IE]>-->
      </object>
      <!--<![endif]-->
    </object>
<div class="contentTable">
  <table width="800" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td width="50%">
            <form action="register_playerSC4.php" method="post" name = "form" id="form" onsubmit = "return Valname(this);">
              <table width='323' border='0' align = "center" cellpadding="0" cellspacing="10" bordercolor="#999999" id='table1'>
                <tr>
                  <th height="32" colspan='2' align="left" valign="top"><font color="#CCCCCC" size="2">Want too know more about the
                    Regionals and National event submit your email address here: </font></th>
          </tr>
                <tr>
                  <td width="101" align="left" valign="top"> <div align="center"><font color="#FFFFFF" size="2">Email:</font></div></td>
            <td width="292" align="left" valign="top">  <font size="2">
              <input name='Email' type='text' id="email" size='30' maxlength="255" value = ''>
              </font></td>
          </tr>
                <tr>
                  <td height="30" align="left" valign="top"><div align="center"><font color="#FFFFFF" size="2">Location:</font></div></td>
            <td height="30" align="left" valign="top"> <font size="2">
              <select name="Location" id="Location">
                <option value="0" selected="selected">Select a State</option>
                <option value="AL">Alabama</option>
                <option value="AK">Alaska</option>
                <option value="AZ">Arizona</option>
                <option value="AR">Arkansas</option>
                <option value="CA">California</option>
                        <option value="CN">Canada</option>
                <option value="CO">Colorado</option>
                <option value="CT">Connecticut</option>
                <option value="DE">Delaware</option>
                <option value="DC">District Of Columbia</option>
                <option value="FL">Florida</option>
                <option value="GA">Georgia</option>
                <option value="HI">Hawaii</option>
                <option value="ID">Idaho</option>
                <option value="IL">Illinois</option>
                <option value="IN">Indiana</option>
                <option value="IA">Iowa</option>
                <option value="KS">Kansas</option>
                <option value="KY">Kentucky</option>
                <option value="LA">Louisiana</option>
                <option value="ME">Maine</option>
                <option value="MD">Maryland</option>
                <option value="MA">Massachusetts</option>
                        <option value="MX">Mexico</option>
                <option value="MI">Michigan</option>
                <option value="MN">Minnesota</option>
                <option value="MS">Mississippi</option>
                <option value="MO">Missouri</option>
                <option value="MT">Montana</option>
                <option value="NE">Nebraska</option>
                <option value="NV">Nevada</option>
                <option value="NH">New Hampshire</option>
                <option value="NJ">New Jersey</option>
                <option value="NM">New Mexico</option>
                <option value="NY">New York</option>
                <option value="NC">North Carolina</option>
                <option value="ND">North Dakota</option>
                <option value="OH">Ohio</option>
                <option value="OK">Oklahoma</option>
                <option value="OR">Oregon</option>
                <option value="PA">Pennsylvania</option>
                        <option value="PR">Puerto Rico</option>
                <option value="RI">Rhode Island</option>
                <option value="SC">South Carolina</option>
                <option value="SD">South Dakota</option>
                <option value="TN">Tennessee</option>
                <option value="TX">Texas</option>
                <option value="UT">Utah</option>
                <option value="VT">Vermont</option>
                <option value="VA">Virginia</option>
                <option value="WA">Washington</option>
                <option value="WV">West Virginia</option>
                <option value="WI">Wisconsin</option>
                <option value="WY">Wyoming</option>
              </select>
            </font></td>
          </tr>
                <tr>
                  <td width="101" height="30" align="left" valign="top"> <div align="center"><font color="#FFFFFF" size="2">How
                    did hear about the Nationals:</font></div></td>
            <td width="292" height="30" align="left" valign="top"> <font size="2">
              <select name="Hear" id="Hear">
                        <option value="0">How did you hear about this event
                        <option value="web" selected>Fan Website</option>
                        <option value="nvga">NVGA</option>
                        <option value="friend">Friend</option>
                        <option value="Gamestop">Gamestop</option>
                        <option value="PSN">PSN</option>
                        <option value="Xbox Live">Xbox Live</option>
                      </select>
            </font></td>
          </tr>
          </table>
         <p>&nbsp;</p>
         <p align="center">
         <input type="submit" name="Submit" value="Register" />
         </p>
         <div align="center">
         <p>&nbsp;</p>
         </div>      
            </form>        
            </td>
            <td width="50%" align="left" valign="top"><table width="300" height="222" border="0" align="center">
                <tr>
                  <td width="43%" height="106" align="right" valign="bottom"><a href="http://www.nvgaonline.com" target="_blank"><img src="images/NVGA.jpg" width="329" height="122" border="0"></a></td>
                </tr>
                <tr>
                  <td height="118" align="right" valign="bottom">&nbsp;</td>
                </tr>
              </table></td
          ></tr>
        <tr>
          <td><p><i><font size="1"><i><font size="1" color="#FFFFFF">For any comments
                or questions for this site email </font></i><a href="mailto:caliburnationals@gmail.com">caliburnationals@gmail.com</a></font></i></p>
              <p><br>
                <br></td>
            <td>&nbsp;</td>
          </tr>
      </table>
    </div></td>      
  <td bgcolor="#FFFFFF" class="bkg">&nbsp;</td>
</table>
<script type="text/javascript">
<!--
swfobject.registerObject("FlashID");
//-->
</script>

<!-- Start of StatCounter Code -->
<script type="text/javascript">
var sc_project=3933291;
var sc_invisible=1;
var sc_partition=47;
var sc_click_stat=1;
var sc_security="0951e5c1";
</script>

<script type="text/javascript" src="http://www.statcounter.com/counter/counter.js"></script><noscript><div class="statcounter"><a title="site stats" href="http://www.statcounter.com/" target="_blank"><img class="statcounter" src="http://c.statcounter.com/3933291/0/0951e5c1/1/" alt="site stats" ></a></div></noscript>
<!-- End of StatCounter Code -->


</body>
</html>


and the script
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 
<html>
 
<head>
 
<title>Registered Users</title>
 
</head>
 
 
 
<body bgcolor="black" text="#FFFFFF">
<?php 
 
 
 
 
	$email = $HTTP_POST_VARS['Email'];
 
	$location = $HTTP_POST_VARS['Location'];
 
	$hear = $HTTP_POST_VARS['Hear'];
	
	$CO1email = "colorado_cutthroat_connection@yahoo.com";
	
	$CO2email = "lrandall3@yahoo.com";
	
	$NMemail = "Jason_Montoya@cable.comcast.com";
	
	$TX2email = "dugfinn@gmail.com";
	
	$TX1email = "ryan.champ@gmail.com";
	
	$MO1email = "brian@agzonline.com";
	
	$MO2email = "vernon@agzonline.com";
	
	$OKemail = "saif@okgamers.com";
	
	$GAemail = "dez_moss@yahoo.com";
	
	$NVemail = "dmillion7@gmail.com";
	
	$CAemail = "Zzzfilesk1@aol.com";
	
	$AZemail = "jedirobb@thetemplearcade.com";
	
	$LAemail = "Zzzfilesk1@aol.com";
	
	$NJemail = "jaxel@crookedjester.com";
	
	$SCA1email = "binkley@gmail.com";
	
	$SCA2email = "cheapdavid@hotmail.com";
	
	$SCA3email = "t.r.atkinson@gmail.com";
	
	$NCAEmail = "BrianHatesYou@gmail.com";
	
	$WIemail = "congo_kongo@yahoo.com";
	
	$NCemail = "will3dean@gmail.com";
	
	$MXemail = "vegasan9@hotmail.com";
	
	$CNemail = "russell@ordona.ca";
	
	$PRemail = "dlvicens@gmail.com";
	
	$NEemail = "dlavault@hotmail.com";
 
 
		$host = "test.com";
 
		$login = "test.com";
 
		$password = "test.com";		
 
		//connect to server, then test for failure
 
		if(!($dbLink = mysql_connect("$host", "$login", "$password"))) {
 
			print("Failed to connect to databases!<br>\n");
 
			print("Aborting!<br>\n");
 
			exit();
 
		}
 
				
 
		//select database on dibroo, then test for failure
 
		if(!($dbResult = mysql_select_db("nvgadb", $dbLink))) {
 
			print("Can't use the test database!<br>\n");
 
			print("Aborting!<br>\n");
 
			exit();
 
		}
		
		$result = mysql_query("INSERT INTO SC4Nationals (email, location, hear)
             VALUES('$email','$location','$hear')");
          if (!$result)
          {
                 print("Could not Insert the individual ".mysql_error());
                 return 0;
           }
           else
           {
			print("Thank You for Registering for information on the Soul Calibur 4 National and Regional event!!<br />");
			print("<br />");
			echo'<a href="index.php">Go Back to Soul Calibur 4 Nationals</a>';
			print("<br />");
			echo "Email: $email";
            }
			
			$body = "Thank you for registering for information on the Soul Calibur Regional and National Event. We will have more news to come soon!!	
 
			Email: $email
			
			Location: $location
 
			How did your hear about this event: $hear
			
			Thank you for registering. Stay tuned!!";
			
			$body2 = "Email: $email";
 
			mail($email, 'Thank you for registering for information on the Soul Calibur Regional and National Event. We will have more news to come soon!!', $body, 'From: caliburnationals@gmail.com');
 
			// Colorado
			if($location == 'CO')
			{
				mail($CO1email, 'Attention Chapter Leader!! Someone from your chapter has registered for information on the Soul Calibur 4 National Event', $body2, 'From: caliburnationals@gmail.com');
				mail($CO2email, 'Attention Chapter Leader!! Someone from your chapter has registered for information on the Soul Calibur 4 National Event', $body2, 'From: caliburnationals@gmail.com');
			}
			// Georgia
			if($location == 'GA')
			{
				mail($GAemail, 'Attention Chapter Leader!! Someone from your chapter has registered for information on the Soul Calibur 4 National Event', $body2, 'From: caliburnationals@gmail.com');
			}
			// New Mexico
			if($location == 'NM')
			{
				mail($NMemail, 'Attention Chapter Leader!! Someone from your chapter has registered for information on the Soul Calibur 4 National Event', $body2, 'From: caliburnationals@gmail.com');
			}
			// Texas
			if($location == 'TX')
			{
				mail($TX1email, 'Attention Chapter Leader!! Someone from your chapter has registered for information on the Soul Calibur 4 National Event', $body2, 'From: caliburnationals@gmail.com');
				mail($TX2email, 'Attention Chapter Leader!! Someone from your chapter has registered for information on the Soul Calibur 4 National Event', $body2, 'From: caliburnationals@gmail.com');
			}
			// Missouri
			if($location == 'MO')
			{
				mail($MO1email, 'Attention Chapter Leader!! Someone from your chapter has registered for information on the Soul Calibur 4 National Event', $body2, 'From: caliburnationals@gmail.com');
				mail($MO2email, 'Attention Chapter Leader!! Someone from your chapter has registered for information on the Soul Calibur 4 National Event', $body2, 'From: caliburnationals@gmail.com');
			}
			// Nevada
			if($location == 'NV')
			{
				mail($NVemail, 'Attention Chapter Leader!! Someone from your chapter has registered for information on the Soul Calibur 4 National Event', $body2, 'From: caliburnationals@gmail.com');
			}
			// Arizona
			if($location == 'AZ')
			{
				mail($AZemail, 'Attention Chapter Leader!! Someone from your chapter has registered for information on the Soul Calibur 4 National Event', $body2, 'From: caliburnationals@gmail.com');
			}
			// LA
			if($location == 'CA')
			{
				mail($LAemail, 'Attention Chapter Leader!! Someone from your chapter has registered for information on the Soul Calibur 4 National Event', $body2, 'From: caliburnationals@gmail.com');
				mail($SCA1email, 'Attention Tournament Director!! Someone from your region has registered for information on the Soul Calibur 4 National Event', $body2, 'From: caliburnationals@gmail.com');
				mail($SCA2email, 'Attention Tournament Director!! Someone from your region has registered for information on the Soul Calibur 4 National Event', $body2, 'From: caliburnationals@gmail.com');
				mail($SCA3email, 'Attention Tournament Director!! Someone from your region has registered for information on the Soul Calibur 4 National Event', $body2, 'From: caliburnationals@gmail.com');
				mail($NCAemail, 'Attention Tournament Director!! Someone from your region has registered for information on the Soul Calibur 4 National Event', $body2, 'From: caliburnationals@gmail.com');
 
			}
			// Mexico
			if($location == 'MX')
			{
				mail($MXemail, 'Attention Tournament Director!! Someone from your region has registered for information on the Soul Calibur 4 National Event', $body2, 'From: caliburnationals@gmail.com');
			}
			// North Carolina
			if($location == 'NC')
			{
				mail($NCemail, 'Attention Tournament Director!! Someone from your region has registered for information on the Soul Calibur 4 National Event', $body2, 'From: caliburnationals@gmail.com');
			}
			// New Jersey
			if($location == 'NJ')
			{
				mail($NJemail, 'Attention Tournament Director!! Someone from your region has registered for information on the Soul Calibur 4 National Event', $body2, 'From: caliburnationals@gmail.com');
			}
			// Canada
			if($location == 'CN')
			{
				mail($CNemail, 'Attention Tournament Director!! Someone from your region has registered for information on the Soul Calibur 4 National Event', $body2, 'From: caliburnationals@gmail.com');
			}
			// New England
			if($location == 'CT' || $location == 'ME' || $location == 'NI')
			{
				mail($NEemail, 'Attention Tournament Director!! Someone from your region has registered for information on the Soul Calibur 4 National Event', $body2, 'From: caliburnationals@gmail.com');
			}
			// Wisconsin
			if($location == 'WI')
			{
				mail($WIemail, 'Attention Tournament Director!! Someone from your region has registered for information on the Soul Calibur 4 National Event', $body2, 'From: caliburnationals@gmail.com');
			}
			// OKgamers
			if($location == 'OK')
			{
				mail($OKemail, 'Attention Tournament Director!! Someone from your region has registered for information on the Soul Calibur 4 National Event', $body2, 'From: caliburnationals@gmail.com');
			}
			// Puerto Rico
			if($location == 'PR')
			{
				mail($PRemail, 'Attention Tournament Director!! Someone from your region has registered for information on the Soul Calibur 4 National Event', $body2, 'From: caliburnationals@gmail.com');
			}
?>
<p>&nbsp;</p>
</body>
 
 
 
</html>
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 3 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros