Jump to content


  • Content Count

  • Joined

  • Last visited

Everything posted by OJB

  1. awesome.. I shall give that a go... thanks andy!!
  2. Hello everyone, I am currently installing my new website on the new server I bought but during my local development I never really bothered fixing a problem I knew the site had. Basically, I allow users to upload stuff to folders like this: public_html/upload/1 public_html/upload/2 public_html/upload/3 they are dependant on their user_id... so in effect, user_id 1 uploads to public_html/upload/1 etc These folders are created dynamically in PHP, but I also want to restrict access so users can't get the directory listing of those created folders. The problem is, PHP
  3. thanks everyone.... TCH does indeed rock....
  4. you could always load the IP into a log database table and do a cron job every so often to email you the latest visitors... If you get a lot of visitors to a certain page you are going to get a lot of emails Why do you want to know the IP's of those accessing the page though? What are you planning to do with that data?
  5. As Bruce said if you put the CSS link in your header.php file it will be accessible to the rest of your php files that are included what you need to think of is that when you include a file in PHP it is basically making one bigger file with all the separate file elements in one... they are essentially no longer separate pages. so if you include your CSS in the header.php and use one of your CSS styles in your footer, then it will work
  6. I just bought my 3rd hosting package with TCH.... I have been waiting to do so for a while, needed my pay slip to come through, and it did, so here I am today with 3 virtual hosting packages to my name... 2 deluxe and 1 starter So, how many TCH packages do you own? Always remember people
  7. sorry i missed this I would have helped you out the %s symbol basically tells the sprintf function to "replace this symbol with a string" so then what the sprintf function does is looks at the end of function and replaces it with the string it finds (in this case mysql_real_escape_string($id)) but for every %s you need a substitution at the end of the sprintf, and they have to be in the order that the %s's were in the query string I take it as well there is a typo in your query and it should actually say: AND genreid=genre.id.... not AND genreid-genre.id but yea... feel free
  8. just had a look at this, i know the thread is slightly old... but there seems to be a security issue: >$id = $_GET['id']; $titleinfo = @mysql_query("SELECT title, year, edition, hddvd FROM dvd_reviews WHERE id='$id'"); What this will allow anyone to do is put whatever they want into the query you would execute a mysql statement for whatever they put after ID... this is a big risk because it could result in some variety of sql-injection I would suggest first of all doing the following: >$id = $_GET['id']; $safequery = sprintf("SELECT title, year, edition, hd
  9. try running a foreach() or the $cat_array instead of imploding it! like >foreach($cat_array as $value) { echo $value . '<br/>'; }
  10. As TCH-Dick said MySQL do two nice ones, MySQL Query Browser (for executing queries etc) and MySQL Administrator (i think its called, for managing the structure of the DB itself) I also use PHPMyAdmin (which is what you get in CPanel) on my localhost
  11. I was just about to write back saying "no there is no space" but then I hit delete just in case and there was one... For some reason when writing in Notepad++ the spaces are really small and I couldn't see it!!! HAHAHAH I feel thick now!!! All is working and I am no longer bleeding at the knuckles for punching the screen Thanks alot Bruce, much appreciated. I guess it often takes someone elses eye to spot little mistakes like that
  12. I had this exact error the other day on my IPB 1.3 forum heres the fix: In sources/Board.php find the entire of this query: >SELECT f.*, c.id as cat_id, c.position as cat_position, c.state as cat_state, c.name as cat_name, c.description as cat_desc change it to: >$DB->query("SELECT f.*, c.id as cat_id, c.position as cat_position, c.state as cat_state, c.name as cat_name, c.description as cat_desc, c.image, c.url, m.member_name as mod_name, m.member_id as mod_id, m.is_group, m.group_id, m.group_name, m.mid FROM ( ibf_forums f, ibf_categories c )
  13. Hey guys I am currently building a site in PHP/MySQL and I am skinning the site in CSS. I have a menu at the top of my page which has a darkish gradient background, so I have the following CSS code to control the links in it: >a{ color: #FFFFFF; text-decoration: none; } a:hover { color:#FFFFFF; text-decoration: underline; } pretty simple... Now, The main background of my site is actually white, which means links within the main block will of course not be visible. So I created the following CSS code for the links: >a .tablelink{ color: #000000; text-deco
  14. I thought I would update this in case someone else has the same problem. Today I finally solved the problem. As mentioned before it was setting the folder ownership to be "nobody" In order to over come this I used umask() >if (!is_dir($dir)) { $oldumask = umask(0); mkdir($dir, 0777); umask($oldumask); } Now the folders and files created within them I can remove via FTP, which is a relief.
  15. Cheers bruce!!! Could anyone explain why this was happening because despite solving the problem I still don't fully understand why it did what it did!
  16. I think I have solved the problem now... I removed the hashes (#) from the .htaccess file lines and now it works fine... I guess those were comments.
  17. Hey guys I have done quite a bit of looking around on google to try and solve this issue I am having with one of my sites that im developing. It is written in PHP and dynamically creates links to the 3 newest news articles so the user can read the article in full, as on the main page only a short description of each article is displayed. For some reason though the PHPSESSID keeps getting appended to the end of these links, but to no others. This results in my site failing its W3C validation, which is something I really don't want to happen. As I said, all my other links don't get t
  18. I am doing it via CPanel, going into Backups then downloading the MySQL backups individually. My usual backup routine involves downloading the home directory, plus the aliases/filters and MySQL databases individually (as opposed to the full backup) Thanks for the response, I shall contact the help desk in a few minutes.
  19. Hey guys, Recently I have had a few issues which I didnt have before when it comes to backing up. The problem occurs when I backup my forum database. From the period between starting the backup and it finishing I am unable to access the forum itself, and occasionally I will even get a too many connections MySQL error at which point I contact the help desk to get them to reset the connections for me. Is there any reason why EVERY time I backup my forum (which is the main aspect of my site and the .gz file is 26MB) it becomes inaccessible?? I understand that taking a backup uses up SQL
  20. ^ How would I go about setting a suitable owner upon file upload then? And what should the owner and group ID be set to? This is all rather new to me so has me a bit confused. Sorry!
  21. I downloaded that upload script you suggested bruce. It looks good, but instead of just using it as is I wanted to try get my head around the code and make sure I understand what is going on. The problem I have at the moment is that I have managed to change the permissions on my uploaded files successfully to 666 (and whatever else I wanted them to be) but I still can't delete the files. The reason for this is not permissions but rather file ownership. All the files I upload have the ownership set to UID: 99 GID:99 Basically I think this means they are set to "nobody". I already co
  22. thanks again bruce I have also had the help desk CHMOD my files so I can now remove them
  23. Thanks for the info Bruce. I shall contact the help-desk and get them to delete the files for me for now.. The mime-type check I actually got from the w3 school site: http://www.w3schools.com/php/php_file_upload.asp most of my upload script is the same, but obviously modified to suit my particular needs. I shall browse hotscripts for a more suitable upload script Cheers again
  24. Hey all I am currently developing a PHP/MySQL site whereby clients are able to upload certain file types (.zip and .rar) for a specific use. I have written an upload script but first of all it doesn't seem to be limiting the file types to just zip and rar Basically what the code does is creates a directory for each client (if there isnt one already) based on their user ID which is stored in their session header.... then from a form on a different page it is supposed to upload the file they choose to their directory. It is working correctly in the sense that the files are going to t
  25. I agree, I only use FTP for uploading personally I just thought that if I had clients who had to upload large files it would be easiest if it was browser based and I didnt have to explain to them FTP and make them download an FTP client. Does anyone else know of a way to do this from the browser?
  • Create New...