1. <?php
2. $_page = null;
3. include(MODS_DIRECTORY."/client.php");
4. $auth_url = "http://localhost/server.php";
5. $data = file_get_contents();
6. $result = json_decode($result);
7. if($result['valid'] != true){
8.    die("Invalid Key.  Script Stopped!")
9. }
10. ?>

I'm bit new to PHP. Could anyone please tell me what's wrong in the above code snippet?
I'm getting Syntax Parse error: Unexpected '}' at line no.9

Thanks!

Recommended Answers

All 3 Replies

Hi,
Welcome to Daniweb.

die("Invalid Key. Script Stopped!") should be followed by a ';' semi-colon. :D

Use echo statement for regular HTML tags, this will solve the error.

Member Avatar for diafol

As mentioned you need a ';'. This looks dicky:

$data = file_get_contents();
$result = json_decode($result);

Don't understand where the $result comes from and $data points at nothing.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.