Forum Moderators: coopster
I am hoping that someone may be able to help me as I am at a loss!
I am trying to retrieve data from a URL and then pass this data into a database. I am using php 4.2 and apache 1.3 on a windows XP platform (hope that covers everything!)
The problem is that I can retrieve most of the information from the URL using the $_GET['data']; command, however for some reason this command will not work on the final two variables in the URL. I have included my code below:
<?php
$tCost = $GET_['totalCost'];
$tPrice = $GET_['totalPrice'];
$id = $_GET['id'];
$group = $_GET['group'];
$modId = $_GET['modId'];
$varId = $_GET['varId'];
$trimId = $_GET['trimId'];
$engId = $_GET['engId'];
$colId = $_GET['colId'];
$packOne = $_POST['packOne'];
$packTwo = $_POST['packTwo'];
$packThree = $_POST['packThree'];
?>
<table width=100% cellpadding =10>
<tr bgcolor=#ffffff align=middle>
<td align=middle cellpadding=2 bgcolor=#006699><span class="heading"> <font color=#ffffff>Add new vehicle</font> </span>
</td>
</tr>
<?php
$sql = "INSERT INTO cars (model, der, variant, engine, colour) VALUES ('$modId', '$varId', '$trimId', '$engId', '$colId')";
$added = mysql_query($sql);
print $GET_['totalCost'];
print $tPrice;
print $modId;
print $sql;
?>
The two variables that it won't pick up are totalCost and totalPrice. The URL that I am passing is:
added.php?modId=1&varId=1&trimId=1&engId=1&colId=1&pack1=1&pack2=2&pack3=3&totalCost=5650&totalPrice=8700
it will pick up all of the other variables from the URL except those two, and I am quite confused about it!
If anybody can shed any light on this it would be much appreciated - I suspect I am missing something obvious here :)
Thanks in advance,
Chris