Forum Moderators: coopster

Message Too Old, No Replies

parse error, unexpected T_STRING

need a fresh set of eyes on this

         

lorax

1:17 pm on Apr 30, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



The code:
function order_status_update(&$d) {
if ($d["order_status"] == "S"){
   $db = new ps_DB;
...

The line implicated by the error is the last one. I can't see a problem there can you?

grahamstewart

1:28 pm on Apr 30, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hmm.. nothing obvious.

Are you sure that $d is an array?
Why are you using pass-by-reference?

Could be caused by a problem higher up the code I guess - like an open brace or something.

Nick_W

1:30 pm on Apr 30, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



No curly brace on the end of the function?
Have you tried ['singlequotes'] on the array?

added -- I expect it's one of those annoying ones. What happens if you take that function out? - Bet you still get the error but on a different line right?

Nick

lorax

1:45 pm on Apr 30, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



>> Are you sure that $d is an array?

Yup. The rest of the code outside the if statement uses the array and if I remove the if statement it all works fine.

>> Why are you using pass-by-reference?

Dunno - not my code - it's a freebie cart that worked great until I add this if statement (which simply emails the customer when the status of an order changes to Shipped).

>>No curly brace on the end of the function?

The function is fine. If I remove the if statement all goes well. If I add the if statement and remove everything within it I get the same error but on the closeing } of the statement.

>> Have you tried ['singlequotes'] on the array?
I have - no dif.

Re: annoying - yup. I suspect I'll need to do the digging as I'm not as familiar with this code and the supporters forum for this particular add on says it all works fine. Hmmmph.

daisho

2:13 pm on Apr 30, 2003 (gmt 0)

10+ Year Member



I see no error with that snippet. It could be a problem that was introduced earlier in the code and finally died here. I've had that a few times.

daisho

lorax

4:02 pm on Apr 30, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



As it turns out there was no error with the code - only with the hidden characters I couldn't see. The additional code was available on support forum for the cart and I copied and pasted it into my function. The result bombed. But when I wrote the code by hand - it worked fine. Only took me 3 hours to figure it out.

Nick_W

4:06 pm on Apr 30, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Arrrrrgh! - I HATE those, what an absolute waste!

Happens to me on a fairly regular basis ;)

Nick

daisho

4:42 pm on Apr 30, 2003 (gmt 0)

10+ Year Member



Gotta love those. It's scarry to see how many times that happens.

daisho

lorax

4:54 pm on Apr 30, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



It's a blinkin pain in the arse. What's worse is I shoulda thought of it sooner! :)