claws wrote:1. i noticed few times that @ (at the rate) symbol is used in php. what is this symbol. and in which context it is used?
error supression
claws wrote:2. why does the code inside <script> tags doesnt work if introduced using ajax. i mean
say if the response of my ajax query is
<script>alert("I Love PHP");</script>
now. using dom if i introduce this response at some node of the page. its not going to alert. why??
extract the scripts (using javascript) from the ajax return and add them to the head, then they'll run
claws wrote:
3. i am builing a portal in which i have a field named "validity". this is the validity period of the user's data. i mean say if validity=30 days (which is default value iam using) after thirty days that user's data will be deleted automatically. daily its value should be reduced by 1.
but how to implement this.i cant daily run a script. i want to automate this task. how to do that.
i heard of something called CRON. how to implement it?
cron = crontab, only on linux, normally found under /etc/crontab - you can edit it via vim/nano or such like - cron checks this file at regular intervals to see if there's anything it needs to run.
here's a line from mine:
Code: Select all
5 * * * * root php -f /home/sites/domain.com/maildaemon.php
this runs a script called mailerdeamon via the command line every hour.
however in your case, you don't really need to decrement daily, all you need to do is know when the user signed up, then run a script every day that checks for expired users (signup date + 30 I'd presume) - and does the work. You could even add it to your index.php
if(!$clean_up_code_has_run_today) {
run_clean_up_code();
}
it means one visitor will take the weight of the clean up job, but thats only one visitor on one page call per day..
ps: why delete, why not just "deactivate"??