Jump to content


Unexpected '{'

  • Please log in to reply
3 replies to this topic

#1 xyn

  • Members
  • PipPipPip
  • Advanced Member
  • 779 posts
  • LocationNorthampton

Posted 22 October 2006 - 02:20 PM

hey guys,
I'm trying to make a license thing, where i store a product ID,
in my database and a product id in a directory, then i use
chmodd to check the license.

Basically when they user purchases a product when the payment
is accepted via paypal i make a random ID, which then saves into
a database, then i make a file called 'product_RANDOMID.txt' this
is then saved in my clients directory, on their site everytime they
use the main config (always used) it will check my site for their file
and if the chmodd = 0000 the license needs renewing, or if the file
doesnt exist they get they panel deleted.

Focusing on the CHMODD first, My problem is unexpected '{' on line 6.
my code:
$host_dir = 'http://www.MYURL.co.uk';
$host_lang = 'en';
$panel_id = 'dpanel_1234567.txt'; //their code
echo('license renew');

#2 Orio

  • Staff Alumni
  • Advanced Member
  • 2,491 posts

Posted 22 October 2006 - 02:25 PM

You are missing a ")" at the end of the if.

Think you're smarty?

(Gone until 20 to November)

#3 xyn

  • Members
  • PipPipPip
  • Advanced Member
  • 779 posts
  • LocationNorthampton

Posted 22 October 2006 - 02:38 PM

I have another problem with the other aprt now:
basically if they install the product in a folder called
'panel' and i deleted their file from my website, i wanted
their panel to get removed, the following code doesn't
   echo ('Please contact our administration team');

#4 redbullmarky

  • Staff Alumni
  • Advanced Member
  • 2,863 posts
  • LocationBedfordshire, England

Posted 22 October 2006 - 03:25 PM

the problem with your code is that the error suppressor (@) makes it hard to see what's going on in the event of something going wrong. remove it for the time being and try it again to see what error you're getting, if any.

also, variables contained within single quotes will not be parsed. so you need to change your 'if' line to use double quotes:



$test = 'hello world';

echo '$test'; // outputs: $test

echo "$test"; // outputs: hello world

"you have to keep pissing in the wind to learn how to keep your shoes dry..."

I say old chap, that is rather amusing!

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users