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
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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.