Jump to content

MrCat

Members
  • Posts

    21
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

MrCat's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I have multiple domain names pointing to the same site. This works fine in the root folder: mysite.com and myothersite.com begin at mysite.com/index.php and I can change display settings depending on HTTP_HOST (which is either set to mysite.com or myothersite.com). It doesn't work when I go one folder deeper: mysite.com/start and myothersite.com/start are always seen as mysite.com/start/index.php - destroying the HTTP_HOST variable. What can I do? I'm on a shared host so can't do much in the way of config. Any help appreciated
  2. Yeah I know what you mean. What I'm wanting to do is pass a 'get' variable like ?page=thisone26 I can always do ?page=thisone&value=26 or something like ?page=thisone.26 and look for the separator. Just thought my original layout was the nicest but it's looking like it's not worth the trouble!
  3. Thanks for that. It would be nice if something like intval just worked. I always worry about time/processing penalties when using something unnecessarily complicated like preg_match!
  4. Is there an easy way to find a numeric value in a string if I don't know what the string will contain? For example I want '52' out of: mystring52 Hopefully there is already a simple function to do this? I'm thinking there may not be as the string having more than one group of numbers may confuse matters. I'm just dealing with abcdef123 or similar in this case though.
  5. Thanks for that. I have decided to do similar to what you've suggested and completely re-organised the links in my site now. Was hoping for a quick fix but I don't actually think it was possible!
  6. I'm using <base href> to set my HTML path for links, and chdir() to set PHP's base path. (Entering site at www.mysite.com/account then resetting my paths back to root for simplicity). Both of these are working fine, however I've found Javascript ignores <base href> so it's working directory is still a subfolder of root. OK - so I could add '../' to all Javascript links (which is what I was trying to get away from!) but I've read that it's only IE that ignores <base href> and other browsers accept it. This will mean my links break unless I either stop using <base href> entirely and go back to using '../' in ALL links, or I can find a way to set Javascript's base link pointer... This is driving me crazy! Any ideas of how to do it?
  7. Are you sure that allows multiples? Their demo won't let me select more than one file at a time...
  8. I too would like a recommendation for a good multiple-file upload script / system. I take on board the "make one yourself" suggestion, but I don't know much Javescript and don't have time to make my own at this stage. I want something that's free that I can just download and add to my site. Any help appreciated!
  9. Thanks guys - the <base href> tag appears to be the solution I was looking for. Sorry I missed your suggestion xyph. I'd never heard of it and had to research it. All I was trying to do was to avoid ../ on every link if I enter my site at a level other than the root directory.
  10. To try and clarify what I mean: I don't want my 'secret' site to exist through mysite.com I also want user accounts that are accessed simply by typing mysite.com/Username The index.php in mysite.com/Username doesn't redirect - it changes the PHP directory pointer up one level and then includes the 'main page' file which is in mysite.com Changing the directory pointer is simply so I don't have to start all subsequent links with ../ to reach files common to all accounts - mysite.com/images etc. The HTML directory however remains as mysite.com/Username so all links in HTML have to begin with ../
  11. I'm entering my site via a sub folder, e.g. mysite.com/BeginHere (which triggers index.php in the BeginHere folder) and then including my main page which is in the root folder. I change the directory pointer with chdir( '../' ) so now I'm officially back in the root folder. This works fine - but the HTML still points to one directory down. Is there any way I can move this up one level as well?
  12. Good idea. I haven't used comments enough in the past. Scripts always seem to end up more complicated than anticipated!
  13. Thanks guys. I hadn't actually tried to access files above the webroot folder before. I'm on a commercial shared server and I didn't realise I could use relative addressing to go backwards past the site root folder. It seems to work fine. Apart from someone guessing the url, I'm still not clear on how it could be discovered if it has a crazy file name (or maybe a crazy folder name in the path). I know a PHP programming error might do it. What about a server error where just PHP goes down? If PHP went down but Apache was still running, what happens? Are the PHP files revealed as plain text?
  14. If someone such as an admin has access to the filesystem, wouldn't they also have access to read a PHP script that contained a database username and password?
  15. Thanks for that. When you say "it'll be accessible to the world", are you saying there are still teqhniques for browsing files and folders when htaccess disallows that directory and an index file is present?
×
×
  • 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.