0
  form action="espmusicpurchase.php" method ="POST">
  <b><label for="cname">Your Name</label></b>
  <br>
  <input id = "cname" name = "cname"/>
  <br><br>
  <b><label for="address">Billing Address</label></b>
  <br>
  <input id = "address" name = "address" type="text" />
  <br><br>
  <b><label for="email">Email Address</label></b>
  <br>
  <input id = "email" name = "email" type="text" />

  <br>
  <br>
  <input id = "submit" size=20px name = "submit" type="submit" value = "Submit" class="button" />
  </form>  <!--this is just here for you to see what i want to do, no changes needed for the above-->



  <?php
  session_start();
  $name = $_GET['gname'];//the code gets pulled from the previous page here and is working
  $Price = 10000;
  if (isset($_POST["submit"])) //this is where the trouble seems to come from, it throws the old data away
  {


$email = $_POST["email"];
$address = $_POST["address"];
$cname = $_POST["cname"];



$InsertSQL = "insert into purchase values('".
            $cname."','".
            $name."','".//there is nothing in here
            $address."','".
            $email."','".
            $Price."')";//this is for some reason 0
$rs = mysql_query($InsertSQL,$Con); 

        }   
  ?>

as you can see it wont add the name and price, i have added comments in the code for you to understand what i want. The $name and $price wont add when i press the submit. I understand its some issue with the session, but i need it to be added as well

  • you have to add them into the action as well. action="espmusicpurchase.php?gname=xyz&price=123" alternative create a hidden input field and set them as value. – Manuel Oct 09 '17 at 12:24
  • how about removing all those extra spaces in your html: `` – Ivo P Oct 09 '17 at 12:25
  • how exaclty do I do this? I tried doing that, it doesn't want anything to do with the previous session information – Kevin Harmse Oct 09 '17 at 12:27

0 Answers0