Jump to content

ultigma

New Members
  • Posts

    8
  • Joined

  • Last visited

ultigma's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Problem was I needed to explicitly declare the root url. Before: <link rel="stylesheet" href="stylesheets/style.css" type="text/css" /> After: <link rel="stylesheet" href="/testblog/stylesheets/style.css" type="text/css" /> by putting /testblog/ it solved the problems
  2. I've figured out how Mod rewrite works now however I've come across a new problem. htaccess code RewriteEngine On RewriteRule ^([A-Za-z0-9-]+)/$ http://localhost/testblog/index.php?category=$1 I now know that this: localhost/testblog/dogs/ is equal to : localhost/testblog/index.php?category=dogs however, when i put a link on the index.php file; <a href="dogs/"> Dogs </a> that page (localhost/testblog/dogs/) now has the stylesheet prefixed with dogs/ so the stylesheet looks like 'localhost/testblog/dogs/stylesheets/style.css' but when I link with ahref="index.php?category=dogs" Dogs </a> everything works just fine; 'localhost/testblog/stylesheets/style.css' I find it confusing because I thought that they now equaled the same thing using the .htaccess file? how can i rectify this problem with the prefix? Hopefully I've explained properly Thanks
  3. I'm trying to figure out what the best way to structure a website's folders, for websitel expansion, before I begin building it. I'll try and explain what i think is best and hopefully get opinions for better site structure. hopefully this can be easily understanded. I'm planning o nthe website to be big so I want to get it rright from the start. ------------------------------------------------------------------------------- Public_HTMLindex.php about.php contact.php /shop//football//shirts/ /shoes/ /tennis/ /blog//football//uk/post-about-uk-team.php another-post.php more-posts.php /spain/post-about-spanish-team.php you-get-the-idea.php /other/ /tennis//uk/post-about-uk-player.php Is this the right way to go about structuring a website ooooorrrrrr ----------------------------------------------------------------------------------- Public_HTML index.php about.php contact.php shop.php?category=football shop.php?category=football&item=shirts&product=id shop.php?category=football&item=shoes&product=id shop.php?category=tennis shop.php?category=tennis&item=shirts&product=id shop.php?category=tennis&item=shoes&product=id blog.php?sport=football blog.php?sport=football&country=uk blog.php?sport=football&country=uk&post=id blog.php?sport=tennis and so on? So tell me, which way are most websites structured? perhaps its a combination of the 2; if so, how would it be structured Thanks for everyones time. All opinions welcomed =)
  4. Thanks again Requinix! I'll use post_title perhaps as they'll all be unique =)
  5. thanks for the reply. I can't seem to get my head round it atm. Because of that I want to just plow on to other things. Is there any structure I should follow to allow for easy integration when I am ready to try tackle .htaccess again? the blog will follow a simple structure such as 'website.com/animal-type/post-about-animal' where website.com/animal-type/ would display only the posts about that animal? Would "website.com?category=category_name&post=post_id" be the right way to implement "website.com/animal-type/post-about-animal/" in the future? Thanks
  6. I'm having troubles getting this to work/understanding it. my httpd.conf is set to: "LoadModule rewrite_module modules/mod_rewrite.so LoadModule setenvif_module modules/mod_setenvif.so" Quick overview of the site: I have a category database | category_id | category | | 1 | dogs | | 2 | cats | and a navigation menu, Home | Dogs | Cats | the links are set to index.php?category=['category_id'] so [category_id] equals either 1 or 2 as home is explicitly declared What I am getting is localhost/testblog/index.php?category=1 but what i want the url to look like is localhost/testblog/dogs/ so that it uses the category_id to display posts from only that category. Here is my htaccess code: RewriteEngine On # Turn on the rewriting engine RewriteBase / RewriteRule ^dogs/$ index.php?category=1 [NC,L] RewriteRule ^cats/$ index.php?category=2 {NL,L] Is this COMPLETELY Wrong? Something worth mentioning, I DO NOT have a directory called dog or cat. I was trying to avoid using it. Is it a must to have a directory? Thanks for any help
  7. Ah ok, in that case i'll create a category table and reference that in the 'posts' > 'category' table. I think I need a bit of training on relational databases and get my head round how they are best used Thanks again =)
  8. Hello, I'm new to php and i'm trying to figure out the best way to structure a database about animals. Basically i have a blog database called 'posts' with int | text | text | int ------------------------------------------------- ' id ' | ' title ' | ' content ' | ' category ' and what I want to happen is that depending on the category show only them posts. For example would this be the right way to do it; 1 - Dogs 2 - Cats 3 - Birds 4 - Fish "SELECT * FROM posts WHERE category = 1" to display everything for dogs OR Should I change category to varchar and explicitly call them ' Dog ' - ' Cat ' - ' Bird ' I would prefer the latter as having it explicitly called makes more sense to me. Thanks for anyone that can help =)
  9. Thanks for all the replies. I have armed myself with a few tutorials such as a CMS, Shoutbox, Photo album upload thingy annd an eccomerce tutorial. Hopeully by doing these it's slowly sink in and click with how it all works. I hadnt thought of trying to solve others code, sounds like a good idea! Atm i find it really difficult to read custom code and user made functions but i guess the more i read the more i'll understand. Cheers for the reply guys =)
  10. Hey guys, just learnt the basics of PHP but I keep asking myself, WHAT USE IS THAT?! I want to make real applications and all that! Soooooo, I was wondering if anyone could compile a list of video tutorials for me, and others looking to learn php, from beginner applications to more advanced programming. There are so many to choose from I'm not sure which one to start. Like I said, finding everything about loops, if else statements and what variables are are easy to come by. I'm now looking for something to sink my teeth into that will gradually get harder and harder till I'm a fully fledged php developer =) Additionally, if anyone has been in my position and is now an experienced programmer, which tutorials, in order of watching, did you watch. Thanks to everyone that can help =) Cheers
×
×
  • 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.