troubleshooting Question

make form work with mysql and php

Avatar of James Murrell
James MurrellFlag for United Kingdom of Great Britain and Northern Ireland asked on
DatabasesPHPMySQL Server
10 Comments3 Solutions124 ViewsLast Modified:
Hiya hope you guys can help me once again


yes i know php has changed ...   but how to i write a php page to accept details from this form in a mysql database -


thanks in advance

<?php 
	include('profile/validate.php');
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>cs97jjm3 Fantasy F1</title>

<!--[if (gt IE 9)|!(IE)]><!-->
<script src="js/jquery.mobile.customized.min.js"></script>
<!--<![endif]-->
<script>
 $(window).load(function(){
  $().UItoTop({ easingType: 'easeOutQuart' });
  $('.gallery .gall_item').touchTouch();
 });
 $(document).ready(function(){
     jQuery('#camera_wrap').camera({
      loader: false,
      pagination: true ,
      minHeight: '500',
      thumbnails: false,
      height: '22.42708333333333%',
      caption: true,
      navigation: false,
      fx: 'mosaic'
    });
    $('.gallery .gall-item').touchTouch();
  });
</script>
<!--[if lt IE 9]>
<script src="js/html5shiv.js"></script>
<link href="css/ie.css" media="screen" rel="stylesheet" />
<![endif]-->
<style>
 margin-top: 100px;
 margin-bottom: 100px;
 margin-right: 150px;
  margin-left: 80px;
  </style>

</head>
<body style="background-color: #FFFFFF; background-image: url('../images/main_texture.png'); margin-top: 80px;
 margin-bottom: 100px;
 margin-right: 150px;
  margin-left: 180px;">
<div class="texture">
<!--==============================
              header
=================================-->
<h2 class="ta__left">
<div class="ta__left">
	Register Have you read the 
	<a href="http://f1cs97jjm3.ddns.net/F1/?page_id=680" target="_parent"><strong>rules</strong></a>?,
			</div>
			<span lang="en-gb">Please Note: one team per email address </span>
			<h2 class="ta__left">Entry Form </h2>
<form id="form1"  class="pure-form pure-form-stacked" method="post" name="form1">
<fieldset>

<label for="Email">Email&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </label>
<input id="Email" name="Email" placeholder="Email Address" required="" type="text" maxlength="50" />
<br class="clear" />
<label for="FullName"><br />Full Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </label>
<input id="FullName" name="FullName" placeholder="Your Name" required="" type="text" maxlength="25" />
<label for="TeamName"><br /><br />Team Name&nbsp; </label>
<input id="TeamName" name="TeamName" placeholder="Your F1 Team Name" required="" type="text"  maxlength="25"/>
<label for="Password"><br /><br />Password&nbsp;&nbsp;&nbsp;&nbsp; </label>
<input id="Password" name="Password" placeholder="enter Password" required="" type="password" maxlength="12"  />
<button type="button" id="eye" title = "click here to see your password" data-toggle="tooltip" >
    <img src="https://cdn0.iconfinder.com/data/icons/feather/96/eye-16.png" alt="eye" />
</button>

<br /><br class="clear" />
<label for="Driver1">Select 1st Driver </label>

<select id="Driver1" class="select-sum" name="Driver1" required="" onchange="updateSelect(this,'Driver2');" >
<option data-id="30" value=" 1   Lewis Hamilton  ">Lewis Hamilton  30 Million </option>
<option data-id="25" value=" 822 Valtteri Bottas "> Valtteri Bottas 25 Million </option>
<option data-id="28" value=" 20  Sebastian Vettel ">Sebastian Vettel 28 Million </option>
<option data-id="22" value=" 844 Charles Leclerc ">Charles Leclerc 22 Million </option>
<option data-id="22" value=" 999 Max Verstappen ">Max Verstappen 22 Million </option>
<option data-id="18" value=" 842 Pierre Gasly">Pierre Gasly 18 Million </option>
<option data-id="14" value=" 817 Daniel Ricciardo ">Daniel Ricciardo 14 Million </option>
<option data-id="13" value=" 807 Nico Hulkenberg ">Nico Hulkenberg 13 Million </option>
<option data-id="12" value=" 154 Romain Grosjean ">Romain Grosjean 12 Million </option>
<option data-id="12" value=" 825 Kevin Magnussen  ">Kevin Magnussen 12 Million </option>
<option data-id="10" value=" 839 Lando Norris">Lando Norris 10 Million </option>
<option data-id="10" value=" 832 Carlos Sainz Jr  ">Carlos Sainz Jr 10 Million </option>
<option data-id="9" value=" 815 Sergio Perez Mendoza ">Sergio Perez Mendoza 9 Million </option>
<option data-id="9" value=" 840 Lance Stroll ">Lance Stroll 9 Million </option>
<option data-id="15" value=" 8   Kimi Raikkonen ">Kimi Raikkonen 15  Million </option>
<option data-id="7" value=" 845 Antonio Giovinazzi ">Antonio Giovinazzi  7 Million </option>
<option data-id="6" value=" 4   Alexander Albon ">Alexander Albon 6 Million </option>
<option data-id="6" value=" 838 Daniil Kvyat ">Daniil Kvyat 6 Million </option>
<option data-id="5" value=" 828 George Russell ">George Russell 5 Million </option>
<option data-id="5" value=" 843 Robert Kubica  ">Robert Kubica 5 Million </option>


</select> <br /><br class="clear" />
<label for="Driver2">Select 2nd Driver</label>
<select id="Driver2" class="select-sum" name="Driver2" required="" onchange="updateSelect(this,'Driver1');" >
<option data-id="30" value=" 1   Lewis Hamilton  ">Lewis Hamilton  30 Million </option>
<option data-id="25" value=" 822 Valtteri Bottas "> Valtteri Bottas 25 Million </option>
<option data-id="28" value=" 20  Sebastian Vettel ">Sebastian Vettel 28 Million </option>
<option data-id="22" value=" 844 Charles Leclerc ">Charles Leclerc 22 Million </option>
<option data-id="22" value=" 999 Max Verstappen ">Max Verstappen 22 Million </option>
<option data-id="18" value=" 842 Pierre Gasly">Pierre Gasly 18 Million </option>
<option data-id="14" value=" 817 Daniel Ricciardo ">Daniel Ricciardo 14 Million </option>
<option data-id="13" value=" 807 Nico Hulkenberg ">Nico Hulkenberg 13 Million </option>
<option data-id="12" value=" 154 Romain Grosjean ">Romain Grosjean 12 Million </option>
<option data-id="12" value=" 825 Kevin Magnussen  ">Kevin Magnussen 12 Million </option>
<option data-id="10" value=" 839 Lando Norris">Lando Norris 10 Million </option>
<option data-id="10" value=" 832 Carlos Sainz Jr  ">Carlos Sainz Jr 10 Million </option>
<option data-id="9" value=" 815 Sergio Perez Mendoza ">Sergio Perez Mendoza 9 Million </option>
<option data-id="9" value=" 840 Lance Stroll ">Lance Stroll 9 Million </option>
<option data-id="15" value=" 8   Kimi Raikkonen ">Kimi Raikkonen 15  Million </option>
<option data-id="7" value=" 845 Antonio Giovinazzi ">Antonio Giovinazzi  7 Million </option>
<option data-id="6" value=" 4   Alexander Albon ">Alexander Albon 6 Million </option>
<option data-id="6" value=" 838 Daniil Kvyat ">Daniil Kvyat 6 Million </option>
<option data-id="5" value=" 828 George Russell ">George Russell 5 Million </option>
<option data-id="5" value=" 843 Robert Kubica  ">Robert Kubica 5 Million </option>

</select> 
<br /><br class="clear" />
<label for="Team1">Your Constructor </label>
<select class="select-sum" id="Team1" name="Team1" required="">
<option data-id="30" value="131 Mercedes ">Mercedes AMG Petronas Motorsport 30 Million </option>
<option data-id="22" value="6   Ferrari  ">Scuderia Ferrari Mission Winnow 22 Million </option>
<option data-id="20" value="9   Red Bull  ">Aston Martin Red Bull Racing 20 Million </option>
<option data-id="15" value="4   Renault  ">Renault F1 Team 15 Million </option>
<option data-id="14" value="210 Haas ">Rich Energy Haas F1 Team 14 Million </option>
<option data-id="13" value="1   McLaren ">McLaren F1 Team 13 Million </option>
<option data-id="12" value="10  Racing Point  ">Racing Point F1 Team 12 Million </option>
<option data-id="11" value="15  Alfa Romeo Racing  ">Alfa Romeo Racing 11 Million </option>
<option data-id="11" value="5   Toro Rosso  ">Red Bull Toro Rosso Honda 11 Million </option>
<option data-id="10" value="3   Williams  ">Williams Martini Racing 10 Million </option>




</select> <br />


<br /><label for="MyRaceId">Double Points Race&nbsp;&nbsp;&nbsp;&nbsp; </label>
<select id="MyRaceId" name="MyRaceId" required="">
<option value="989 Australian Grand Prix">Australian Grand Prix</option>
<option value="990 Bahrain Grand Prix">Bahrain Grand Prix</option>
<option value="991 Chinese Grand Prix">Chinese Grand Prix</option>
<option value="992 Azerbaijan Grand Prix">Azerbaijan Grand Prix</option>
<option value="993 Spanish Grand Prix">Spanish Grand Prix</option>
<option value="994 Monaco Grand Prix">Monaco Grand Prix</option>
<option value="995 Canadian Grand Prix">Canadian Grand Prix</option>
<option value="996 French Grand Prix">French Grand Prix</option>
<option value="997 Austrian Grand Prix">Austrian Grand Prix</option>
<option value="998 British Grand Prix">British Grand Prix</option>
<option value="999 German Grand Prix">German Grand Prix</option>
<option value="1000Hungarian Grand Prix">Hungarian Grand Prix</option>
<option value="1001Belgian Grand Prix">Belgian Grand Prix</option>
<option value="1002Italian Grand Prix">Italian Grand Prix</option>
<option value="1003Singapore Grand Prix">Singapore Grand Prix</option>
<option value="1004Russian Grand Prix">Russian Grand Prix</option>
<option value="1005Japanese Grand Prix">Japanese Grand Prix</option>
<option value="1007Mexican Grand Prix">Mexican Grand Prix</option>
<option value="1006United States Grand Prix">United States Grand Prix</option>
<option value="1008Brazilian Grand Prix">Brazilian Grand Prix</option>
<option value="1009Abu Dhabi Grand Prix">Abu Dhabi Grand Prix</option>

</select> 

<br class="clear" />
<input id="Amount" name="Amount" placeholder="Your F1 Team Name" required="" type="hidden" size="3" hidden /><br>
<h1>Tie-Break </h1>
<label for="LewisEndofyearPosition">Lewis Hamilton's championship position at the end of year&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </label>
<select id="LewisEndofyearPosition" name="LewisEndofyearPosition">
<!--	<label for="LewisEndofyearPosition"><br>Postion for Lewis at end of year </label><select name="LewisEndofyearPosition" id="LewisEndofyearPosition" required>
-->
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="14">14</option>
<option value="15">15</option>
<option value="16">16</option>
<option value="17">17</option>
<option value="18">18</option>
<option value="19">19</option>
<option value="20">20</option>
<option value="21">21</option>
</select> <br /><br class="clear" />
<label for="Total">The constructor who wins the most pole positions in qualifying&nbsp;<br></label><select id="Total" name="Total" required="">
<option  value="131 Mercedes ">Mercedes AMG Petronas Motorsport  </option>
<option  value="6   Ferrari  ">Scuderia Ferrari Mission Winnow </option>
<option value="9   Red Bull  ">Aston Martin Red Bull Racing  </option>
<option  value="4   Renault  ">Renault F1 Team  </option>
<option  value="210 Haas ">Rich Energy Haas F1 Team  </option>
<option  value="1   McLaren ">McLaren F1 Team  </option>
<option  value="10  Racing Point  ">Racing Point F1 Team  </option>
<option  value="15  Alfa Romeo Racing  ">Alfa Romeo Racing  </option>
<option  value="5   Toro Rosso  ">Red Bull Toro Rosso Honda  </option>
<option  value="3   Williams  ">Williams Martini Racing  </option>
</select> <br class="clear" /><br />
<!--<input type="text" name="MyRaceId" id="MyRaceId" required/>-->

 
  <!-- Latest compiled and minified JavaScript -->
<h3>Your Total is Spend in Millions is  <div id="result"> </div> </h3> 

<button type="submit" value="Submit Team" class="btn" id="submit-button">Submit</button>

	
	


 <p></p>
</fieldset>
			</form>
		</div>
	</div>
	
	
	
	<!--==============================
              footer
=================================-->
    </div>

</section>
</div>
<footer id="footer">


<div class="copyright"> 
      </div>
    </div>
  </div>
  <div class="clear"></div>
</footer>
<a id="toTop" class="fa fa-chevron-up" href="#"></a>
<script src="js/isotop_ini.js"></script>
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script>
$(function() {
  setScore();
  $('.select-sum').change(function() {
	setScore();
  });
});
function setScore()
{
    var total = 0;
    $('.select-sum').each(function() {
      var sel = $(this).find('option:selected').data('id');
      total += sel;
    });

    // Set a boolean based on score < 45
    // this is used to set the disabled state
    // without using an if statement
    var disabled = total > 48;

    // because not all submit buttons are <input>'s
    // use the disabled status above to set disabled state
    $('#submit-button').prop({disabled: disabled});
	

    $('#result').html(total);
    var my_txt = $('#result').text(); 
	$("input[name='Amount']").val(my_txt);
}
</script>

<script>
function updateSelect(changedSelect, selectId) {
   var otherSelect = document.getElementById(selectId);
   for (var i = 0; i < otherSelect.options.length; ++i) {
       otherSelect.options[i].disabled = false;
   }
   if (changedSelect.selectedIndex == 0) {
      return;
   }
   otherSelect.options[changedSelect.selectedIndex].disabled = true;
}</script>

<script>
function show() {
    var p = document.getElementById('Password');
    p.setAttribute('type', 'text');
}

function hide() {
    var p = document.getElementById('Password');
    p.setAttribute('type', 'password');
}

var pwShown = 0;

document.getElementById("eye").addEventListener("click", function () {
    if (pwShown == 0) {
        pwShown = 1;
        show();
    } else {
        pwShown = 0;
        hide();
    }
}, false);
</script>
</body>
</html>
	
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 3 Answers and 10 Comments.
Start Free Trial
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 3 Answers and 10 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