Jump to content


Photo

passing a variable


  • Please log in to reply
2 replies to this topic

#1 fazzfarrell

fazzfarrell
  • Members
  • PipPipPip
  • Advanced Member
  • 154 posts

Posted 18 October 2006 - 12:43 PM

I am trying to pass a result in to this
<?php
// IntelliCART MX - Add to Cart via Link
if ($HTTP_GET_VARS["imxavl1"]) {
	$IMXADD = new addition;
	while ($row_rsResultsTitles["ID"] != $HTTP_GET_VARS["imxavl1_id"]) {
		$row_rsResultsTitles = mysql_fetch_assoc($rsResultsTitles);
	}
	$IMXADD->column[] = $row_rsResultsTitles['PackID'];
	$IMXADD->column[] = $row_rsResultsTitles['Car'];
	$IMXADD->column[] = $row_rsResultsTitles['Items'];
	$IMXADD->column[] = $row_rsResultsTitles['Year'];
	$IMXADD->column[] = $row_rsResultsTitles['Lang'];
	$IMXADD->column[] = $row_rsResultsTitles['Type'];
	$IMXADD->column[] = $HTTP_SESSION_VARS['MM_Username'];
	$IMXADD->column[] = "1";
	$IMXADD->column[] = $SESSION ['$priceA'];
	$IMXADD->column[] = $row_rsResultsTitles['Weight'];
	$IMXADD->redirect = "results2.php";
	$IMXADD->urlparams = preserve($HTTP_GET_VARS,"imxavl1,imxavl1_id");
	$IMXADD->addRow($HTTP_SESSION_VARS["icJag"]);
}
$HTTP_GET_VARS = preserve($HTTP_GET_VARS);
?>

from this?
<?php
			 //Rob Farrell and Leyon Nevett: add up price and x by currency
             $number1 = $row_rsResultsTitles['Price'];
			 $number2 = $row_rsCurrency['Rate'];
             $newnumber = ($number1 * $number2);
			 echo $english_format_number = number_format($newnumber, 2, '.', '');
			 $priceA = $english_format_number = number_format($newnumber, 2, '.', '');
			 echo $priceA;

?>

Can any one tell me where i am totaly going wrong!"

#2 HuggieBear

HuggieBear
  • Members
  • PipPipPip
  • Advanced Member
  • 1,899 posts
  • LocationEngland, UK

Posted 18 October 2006 - 01:00 PM

What do you mean 'pass a result into this'.... The code you've pasted isn't a function.

I'm not sure exactly what you're after with this.

Regards
Huggie
Advice to MySQL users: Get phpMyAdmin and test your queries work there first, take half the hassle out of diagnosis, also check the reserved words list.

Links: PHP Docs :: RegEx's :: MySQL :: DevGuru :: w3schools

#3 fazzfarrell

fazzfarrell
  • Members
  • PipPipPip
  • Advanced Member
  • 154 posts

Posted 18 October 2006 - 01:04 PM

I have a databe with prices in that appear on the page, when the user chooses Euro it looks up the currency conversion from the the database and uses this to convert the price wich displays on the page.

<?php
			 //Rob Farrell and Leyon Nevett: ad up cost x currency
             $number1 = $HTTP_SESSION_VARS["icJag"]->col("Total");
			 $number2 = $row_rsCurrency['Rate'];
             $newnumber = ($number1 * $number2);
			 echo $english_format_number = number_format($newnumber, 2, '.', '');

?>

At the moment the price added comes from
$HTTP_SESSION_VARS["icJag"]->col("Total");

but I want it to come from echo
$english_format_number = number_format($newnumber, 2, '.', '');[/cpde]

Looking in to the dode it is passed to the cart via


<a href="<?php echo $PHP_SELF; ?>?imxavl1=true&imxavl1_id=
<?php echo $row_rsResultsTitles["ID"]; ?>
<?php echo arrToString($HTTP_GET_VARS); ?>">






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users