Jump to content

syntax error T_PAAMAYIM_NEKUDOTAYIM!


co.ador

Recommended Posts

buy.php

 

<form action="cart.php" method="post">
<?php foreach($product['varieties'] as $variety): ?>
    <input style="width:10px; margin-left:9px; " name="price[]" type="checkbox" value="<?php echo $variety['price'] . '_' . $variety['size']; ?>"  />';
<?php end foreach; ?>
</form>

 

 

cart.php

<?php

list($aDoor, size)  = split('_', $_POST['price']); // line 207

  if(empty($aDoor)) 
  {
    echo("You didn't select any buildings.");
  } 
  else 
  {
    	echo "Sum of vlues = ".array_sum($aDoor);
  }
?>

 

 

in cart.php there is the following syntax error.

 

 

syntax error, unexpected ')', expecting T_PAAMAYIM_NEKUDOTAYIM in store/cart.php on line 207

 

I am expecting in cart.php to receive the two index values size and price independetly so I can use it and CSS it where ever i want. I am expecting that with the function list() and split() the variables variety and $aDoor with the price value will able to separate this two variables to be use wherever I want in cart.php

 

 

help.

Link to comment
https://forums.phpfreaks.com/topic/191831-syntax-error-t_paamayim_nekudotayim/
Share on other sites

Just realized you do indicate which line is 207.

 

Also the "split" function is deprecated and highly discouraged (by the php manual). It's also not what you want, it uses regex.

 

Use "explode" instead, same parameters.

 

A Paamayim Nekudotayim is a double colon like :: which you would use to call a static member function of a class.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.