0

i am new to php, may someone have any solution below?

i wan to set this input value to $price

<input type="text" name="subject" id="subject" value="20">

this is the code the variable get the input value

$get = $_GET['subject'];
$p_price =  echo $get ;

but the result is

Parse error: syntax error, unexpected 'echo' (T_ECHO) in ...\classes\class.wci-shortcode.php on line 732

RiggsFolly
  • 93,638
  • 21
  • 103
  • 149
Jessica Wi
  • 21
  • 1

1 Answers1

2

Code like this

$get = $_GET['subject'];
echo $get ;

You cant store echo statement in a variable. if you want to store value of $get variable in another variable do it this way:

$p_price = $get;
Crunch Much
  • 1,537
  • 1
  • 11
  • 14