Search found 7 matches

by josh_
Mon May 21, 2007 4:09 am
Forum: PHP - Code
Topic: LIMITS
Replies: 4
Views: 540

in your database, have a column for number of downloads each user has used. before a user makes a download, check that they are not beyond the limit. increment that number for every download your user makes. run a cron job to reset the number at the end of the month. :D
by josh_
Mon May 21, 2007 3:58 am
Forum: PHP - Code
Topic: problems in creating a cms
Replies: 9
Views: 1011

if this is to be used on more than one server, you may want to consider using "`" (tick) marks in your queries and avoid short tags (ie use "<?php" instead of "<?") since not all servers would respond to the code you have there. it's simple enough to implement on your f...
by josh_
Mon May 21, 2007 3:43 am
Forum: PHP - Code
Topic: Loss of Session using "require"
Replies: 4
Views: 494

Thanks for your help. I ended up biting the bullet and changed every iteration of the code to: $errorRef = 'xxxx'; require '../folder/errorLogScript.php'; No need to pass the error in a session variable when using include or require. Hindsight is 20/20. I should have just done that at the beginning....
by josh_
Sun May 20, 2007 10:16 am
Forum: PHP - Code
Topic: problems in creating a cms
Replies: 9
Views: 1011

1. ENT_QUOTES is a paramter of the function htmlentities(). see http://www.php.net/manual/en/function.htmlentities.php 3. If you're looking to retrieve the stored article for viewing, I would pass the id of the article (in the url, perhaps). Then query the database to pull the title, subject, text, ...
by josh_
Sun May 20, 2007 9:54 am
Forum: PHP - Code
Topic: problems in creating a cms
Replies: 9
Views: 1011

I don't know if I fully understand your questions...but here's my best answer. maybe someone else will be able to offer better advice... 1. I use htmlentities($variableName, ENT_QUOTES) to avoid harmful scripts and tags from being used. It seems to work for me but I don't know how easy it is to defe...
by josh_
Sun May 20, 2007 9:28 am
Forum: PHP - Code
Topic: Loss of Session using "require"
Replies: 4
Views: 494

It would be a good idea to use an absolute path for errorLogScript.php or any include I was hoping that was what I was accomplishing by using $errorPath. Is it not? I tried removing "http://" as you suggested and got the error: [function.main]: failed to open stream: No such file or direc...
by josh_
Sun May 20, 2007 6:52 am
Forum: PHP - Code
Topic: Loss of Session using "require"
Replies: 4
Views: 494

Loss of Session using "require"

Hello, Upon detecting an error, my code redirects the user to another page which logs the data, sends an email to the administrator, and alerts the user of the error. The user's data is stored using $_SESSION variables. In order to log the error, I pass the error number in the URL to the required fi...