This topic is locked
[SOLVED]

 syntax error: Whats the difference between php in notepa

10/18/2010 5:34:28 PM
PHPRunner General questions
J
johnf1957 author

I am trying to learn a little php so I have bought various books and slowly grasping what this is all about. However what worls in php in notepad (and Localhost) does not work in the Visual Editor php snippet's. It tells me there is a Syntax error.

Example in the book shows MATH with Variables....first line

$total = 100; (forget the rest as it does not like the first line urrrgg)
works fine (well the total example works fine in notepad and localhost)
but Mr snippets in phprunner says
syntax error, unexpected T_VARIABLE, expecting ',' or '
Q.

Whats the difference between php in notepad and snippets?
WAYTTD (What are you trying to do)

(I am trying to follow examples in php and translate them directly into php runner so that I can understand how to manipluate data in phprunner. This is a learning exercise so its the journey that is important not the data, this chapter is 3.6 Math Lesson)
any help with this would be greatfuly received

cheers

john

P
procheck 10/18/2010

Hi John,
I tried this code $total = 100;

It works fine in a snippet. The error could be in the line above it.

Maybe a semi-colon is missing. Try commenting out some code until your

error message disappears and then you've found your error.
Look in the manual for "Adding PHP code snippet" to see what they are about.
Al

J
johnf1957 author 10/19/2010

Will do