xyn Posted October 22, 2006 Share Posted October 22, 2006 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 usechmodd to check the license.Basically when they user purchases a product when the paymentis accepted via paypal i make a random ID, which then saves intoa database, then i make a file called 'product_RANDOMID.txt' thisis then saved in my clients directory, on their site everytime theyuse the main config (always used) it will check my site for their fileand if the chmodd = 0000 the license needs renewing, or if the filedoesnt exist they get they panel deleted.Focusing on the CHMODD first, My problem is unexpected '{' on line 6.my code:<?php$host_dir = 'http://www.MYURL.co.uk';$host_lang = 'en';$panel_id = 'dpanel_1234567.txt'; //their codeif(!is_writable($host_dir/$host_lang/$panel_id)[color=red]{[/color]//LINE6 echo('license renew');}else{ echo('fine');}?> Quote Link to comment https://forums.phpfreaks.com/topic/24744-unexpected/ Share on other sites More sharing options...
Orio Posted October 22, 2006 Share Posted October 22, 2006 You are missing a ")" at the end of the if.if(!is_writable($host_dir/$host_lang/$panel_id)[color=red])[/color]Orio. Quote Link to comment https://forums.phpfreaks.com/topic/24744-unexpected/#findComment-112673 Share on other sites More sharing options...
xyn Posted October 22, 2006 Author Share Posted October 22, 2006 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 wantedtheir panel to get removed, the following code doesn'twork.[code=php:0]<?PHPif(!file_exists('$host_dir/$host_lang/$panel_id')){ @rmdir('./panel'); echo ('Please contact our administration team');}?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/24744-unexpected/#findComment-112679 Share on other sites More sharing options...
redbullmarky Posted October 22, 2006 Share Posted October 22, 2006 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:[code]if(!file_exists("$host_dir/$host_lang/$panel_id"))[/code]example:[code]<?php$test = 'hello world';echo '$test'; // outputs: $testecho "$test"; // outputs: hello world?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/24744-unexpected/#findComment-112682 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.