Jump to content


Photo

Another silly question


  • Please log in to reply
2 replies to this topic

#1 spyke01

spyke01
  • Members
  • PipPipPip
  • Advanced Member
  • 74 posts

Posted 21 July 2006 - 02:44 PM

Looking to see why this would have been done

<?=@$amount?>

i know its echoing, but why the @ before the variable, here the places that amount is $defined

$amount = $qr['amount'];
$amount = $amount * $_POST['no_credits'];


[a href="http://www.fasttracksites.com" target="_blank"]Cheap PHP Hosting[/a]

#2 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 21 July 2006 - 02:57 PM

The @ symbol supresses error messages. For example if $amount didn't exist you might get this error:
Notice: Undefined variable: amount in [path to script] on line [line number here]
When you use the @ symbol infront of the $amount variable, the error message will not be shown.

#3 spyke01

spyke01
  • Members
  • PipPipPip
  • Advanced Member
  • 74 posts

Posted 21 July 2006 - 03:18 PM

ahh ok cool, seen it with DB quieries, but never with echoes, thanks mate

[a href="http://www.fasttracksites.com" target="_blank"]Cheap PHP Hosting[/a]




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users