Jump to content

deansatch

Members
  • Posts

    300
  • Joined

  • Last visited

Everything posted by deansatch

  1. @oni-kun - I don't have access to the vsftpd.conf file. Can this be done via htaccess or php.ini?
  2. I'm still struggling to find an answer for this that works. Basically, I want to stop files from within directoy www.site.com/limitedperson/ accessing files in root (www.site.com/) i.e. disallow include(), require(), fopen() etc... e.g. If they create a file: site.com/limitedperson/get_access.php and put within that file: <?php include('../index.php'); ?> I want it to fail - "access denied" - rather than showing the index page that they shouldn't have access to.
  3. I don't. I have created an ftp login within my hosting account for a specific directory and want to make sure that person can not include or edit files outside of the directory.
  4. I have given someone ftp access to a folder which is placed at the root. Obviously if he wanted to, he could access all the main site files at the root by doing a simple include(../private-stuff.php); or even go as far as writing a script that deletes all the files in the root. Is there a way I can restrict access so he can only include files from within his directory and he can't delete or read any files in the root? Possibly not a php solution but maybe using htaccess?
  5. Define the variable as '' at the start of your script. e.g. $email_error = '';
  6. I have my db and fetch theresults in alphabetical order using "select * from table order by name" but I need on of the entries to be next to another as a one-off exception. e.g Alfred Bob Malcolm <---the odd one Edward Frank George Larry Kyle Morris Norris Is there any way of doing this without creating an 'order' column and assigning numbers to every entry?
  7. I know it will involve ajax which is fine...the part I am unsure about is the fact that my ajax script will be using a php script to query the database every couple of seconds - which I assume will not be a good thing if I get a lot of traffic and have a big database. I'm wondering what is the best, least server intensive way of checking for new db entries and then return the results only if there is a new result to return.
  8. If I have entries in a mysql db and I want to display the most recent entry on a web page in real time, how would I go about this? Would I have to write a script that queries the database every couple of seconds? Or is there a way to get the database to communicate with a script so that it only gets queried when there is a new entry? I am just thinking about the best way of not overusing the server by checking every 1-2 seconds. Something a bit like a forum "users currently online are: etc.." but up to date within a few seconds.
  9. If the links are to your own websites pages, you could just check the referrer in your web stats tracking. I made my own simple tracking which gets the referrer and ip and sticks the info into a db so I can see who visits what page, where they came from and which pages they go to next and for how long etc...
  10. Are you sure they can decrypt? Do they not just populate a database with a dictionary of words and match them up with the md5() hash to allow people to do a search? In other words, a password like HOUbue8838ufhn won't be 'decrypted' if you enter the md5 version of that.
  11. Create "last_logged_in" column. Upon successfully logging in, update that users row with the time(). During logging in check the last_logged_in value against the current time()
  12. Apologies if I am way off here but I didn't read the rest of the thread. I just notice you aren't fetching the results from the db. $sql="SELECT * FROM $tbl_name WHERE username='$username' and password='$password'"; $result=mysql_query($sql); $row = mysql_fetch_assoc($result); $access=$row['access'];
  13. Sounds like you are altering the wrong file to me. Are you sure you are looking at the right fileand filepath?
  14. You can't really have www.mysite.com all the time otherwise the server wouldn't know when you are on a different page. You can, however, use mod rewrite to make you url more friendly and perhaps make your variable less obvious e.g. www.mysite.com?user_id=4&page=start can be made into: www.mysite.com/4/start -- obviously this way it's harder to work out what the variables are since you are only shown values
  15. Create a variable $todays_date, and another variable $five_days_later. Then you can change your query to: SELECT * FROM tableName WHERE date_added >= '$todays_date' AND date_added <= '$five_days_later' ORDER BY date_added ASC You can use mktime() to set $five_days_later
  16. I did. In fact I rewrote a full working version in my last post
  17. The problem is where you are adding your extra day. It is giving the 1970 result. Try this: <?php $startDate = strtotime(date("2009-08-01")); $endDate = strtotime(date("2009-10-30")); $todaysDate = date("Y-m-d"); $recurrenceType = 1; $recurrenceNumber = 1; for ($loopDate = $startDate; $loopDate <= $endDate; $loopDate = mktime(0,0,0,date("m",$loopDate),date("d",$loopDate)+1,date("Y",$loopDate))) { $count++; // Daily if ($recurrenceType == 1) { if ($recurrenceNumber == 1) echo date('Y-m-d',$loopDate)."<br />"; else { if (($count % $recurrenceNumber) == 1) { echo date('Y-m-d',$loopDate)."<br />"; } } } // Weekly elseif ($recurrenceType == 2) { if (($count % (7 * $recurrenceNumber)) == 1) { echo date('Y-m-d',$loopDate)."<br />"; } } // Monthly elseif ($recurrenceType == 3) { if (($count % (30 * $recurrenceNumber)) == 1) { echo date('Y-m-d',$loopDate)."<br />"; } } } ?>
  18. select name from table_users where id = '$id'
  19. md5() has been decrypted???? When, who...where???
  20. This was something I was really interested in but couldn't find a solution, as I noticed my ip address changes each time my router is rebooted, after a power cut, every so often for no reason etc... If everyone was given a static ip it would be great.
  21. Error message: Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 9088 bytes) I always get this error message when doing a file upload with a imagecopyresampled() & imagecreatefromjpeg() function if the image large in dimensions (NOT filesize) i.e. a 3000x3000px image will fail whether it is 50kb or 50MB but a 200x200 image will be fine, even if it is 300MB. I understand that the user resizing their image down a bit would solve this - is there a solution? I can only increase memory limit so much. The likes of facebook don't seem to have any trouble. Is it because the upload and resampling /resizing of the image is done in one go? If the only solution is to have the user resize before uploading, is there a way I can alert them before running the script to the point of error? I know when I am checking if a file is too large that I have to let the script upload the file first, then get the size and show the message. But I don't know how I can do this for the dimensions. Especially since I don't really know what the limits are before it does run out of memory. Any help greatly appreciated. I am not posting any code as this seems to happen with any image upload code I have used that uses imagecopyresampled,imagecopyresized, imagecreatefromjpeg and move_uploaded_file and it is more of a general question.
  22. Sometimes, on a slow connection, if someone clicks on a submit button, it inserts the info into the db but as the page is still showing the submit button, the impatient user has another angry click and it inserts the data again before resolving to the thankyou page. Is there a way to stop this happening? And on a similar note, when you have a page with a form on that posts to itself e.g. action="", how can I make it so that refreshing the page doesn't repost?
  23. Awww! Go on! It would save 2 rows of your database on about 40% of the threads that are started. You could stick a little notice just above the textarea when they click on "new topic". You know it makes sense!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.