Jump to content

Notice: Use of undefined constant variable - assumed 'variable' in ...


erme

Recommended Posts

I have just re-installed Xampp and suddenly my sites are now displaying lots of:

 

Notice: Use of undefined constant name - assumed 'name' in ...

Notice: Use of undefined constant price - assumed 'price' in ...

 

this is an example of the line its refering too:

 

$defineProducts[1001] = array(name=>'This is a product', price=>123);

I have tried

 

$defineProducts[1001] = array("name=>Loom Style Conservatory Suite in White Cane, price=>375");

 

and

 

$defineProducts[1001] = array("name=>Loom Style Conservatory Suite in White Cane", "price=>375");

 

and

 

$defineProducts[1001] = array(name=>"Loom Style Conservatory Suite in White Cane", price=>"375");

 

but doesn't work

The manual section on Arrays will tell you everything you need to know about proper array syntax.

 

Also, you were developing without error-reporting turned on before.  Always turn it on and leave it on, otherwise one day you'll realize every single line of array access is wrong.

 

-Dan

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.