Jump to content

Ninjakreborn

Members
  • Posts

    3,922
  • Joined

  • Last visited

Everything posted by Ninjakreborn

  1. It sounds to me like you have a website with different domain names. In this case you just parse the url (check the server variable will have all you need, do a print r to see it's contents and work from that).
  2. Then stop wasting time and do what I originally said . Copy the css into a .css file and include it on the page where needed. That's all that is needed.
  3. Well if it's dynamic you can auto-generate the .css file (and the code to include it in the page) dynamically from a database.
  4. Well I advise setting it up the hard way when you can. it teaches you how to do it, and teaches you more about the inner workings of php, apache, mysql, and the relationship they share in the backend. As well as how they work together. However, do this on a test server so you dont' mess something up on your main system. When I first starting manually installing servers I corrupted more than 1 of my computers at first.
  5. $email = $_REQUEST['email'] ; Change that line to $email = $_REQUEST['email'] . ', email@address.com'; Insert the email into the slot where I listed the second email. That should work for you without a problem.
  6. To keep it simple and error free (since your relateively new to php) I would just add a , emailhere to the current email address. It'll send a copy to both listed email addresses, better than trying to add new variables when you are just starting. If not then put here exactly what is happening when it runs.
  7. to be honest it looks as if your doing unnecessary work. I suggest just attaching the css file like normal. a .txt file is not going to do anything, put it in a .css file and just include it where you want the files to go.
  8. Basically OOP is a style of programming. Programming can be done in many different techniques. OOP is a programming methodology that gained populatiry based on the fact that a lot of high level languages are full oop (forgive me if I am wrong on that one sentence). The idea behind OOP is the theory behind it. Using objects/classes in a specifically organized manner to make code more re-usable, maintanable, and easier to read. Mixed together with a good programming pattern (MVC, Factory, or what heve you) it can be a very powerful force that can save hours (if not days) off overall development time. Just like OOP procedural is it's own style. Also referred to as "Sphagetti code" but often looked down on because it's all over the place, hard to read, hard to maintain, and even harder to keep up with. OOP is generally module based programming allowing you to add/remove modules from a system without affecting the core code. This gives you a chance to have a lot easier time updated/upgrading a code. Those the reason 90% of all 'good' third party and open source systems (no matter what the langauge) are done using OOP methodologies. BEcause it would be a lot more cumbersome, and difficult to manage if it was done in standard procedural programming. I also believe procedural has it's place (for example in cake and code igniter some of there helpers are written procedural) those are perfect situations where procedural can be really helpful.
  9. I don't believe it's useless, I just think it has it's uses. * Prevents honest people from making honest mistakes. * Saves server load (potential large amounts on a very traffic heavy site) * Look's more professional than a bare (server only) form.
  10. @igor yes that is a very valid option. However when it comes to image uploading, you need a server type as fast. Generally only a malicous user would be trying to insert it like that and they just have to disable javascript. Javascript (in my opinion) so always be a first stage of "validation" but never forget to do all forms server side as well in case of malicious users (in which javascript is useless, it's only to keep the good one's staying good).
  11. It's not too big of a decision. Get if you want them to be able to visit it via url. Post if you don't. Each one has there good uses and bad uses. There is also sessions, cookies, and push. I suggest if it's something security related (maintaining state for long periods of time) to use standard sessions.
  12. Attempt to use xxamp, or wamp. You will find it alot easier and it comes with a lot more by default.
  13. There are hundreds of potential issues with sessions. Make sure you call session start on each page. make sure they are set right. Are you getting any error messages, show some of the relevant code for us to look at as well as provide a synopsis on what is happening to your sessions?
  14. I advise getting rid of what you have and using OOP (phpmailer is a good example) instead of what you have. What you have is hard to read, insecure, and not easy to maintain if you needed to update it later on down the road. You could repeat what you have done there in half of the code or better (10 times more readable, and easier to upgrade) by using a class, or atleast restructuring the code.
  15. I guarantee you taking the time to learn OOP and implementing it in your game will save you HUNDREDS of hours later on down the road. The development will take longer if you are starting out but once you learn the time spent later on down the road cutting down on development time, making it easier to make code changes, and making new feature enhancements will literally triple in speed if programmed right.
  16. I would avoid using shorthand if possible. IT will confuse you later on.
  17. * Require the class into the page(s) you are going to use it on. * Instantiate the class * Use it's various properties/methods to achieve the end result. To be honest you probably want to ease into it if you have never done OOP before. Google a few basic tutorials on OOP concepts, and research some practice implementations. Given some research it won't take you but a few days to get the overall hang of it and be able to head in the direction you are wanting to go.
  18. This can be very tricky, I have had many problems with this in the past. If you try to do the improper type of check then the file won't show up. THe "best" way I can think of to do this, is urge the user to "not" click on the file area if they do not intend to upload. Then you can check to see if the file exists when they do an upload. There was something specific I used in the past I just don't remember which project I had that problem on and what I used to guarantee it worked right.
  19. Also test out the query itself (echo the $sql variable) and verify that the sql is being created properly.
  20. If you wanted fullproof you will have to check if it's set, null, or empty (empty string) then populate it with a default value.
  21. The way you are trying to do it is a little messy. I advice getting a class for it, (you can google some good classes) and keep it cleaner. This will allow you to modify it, and will probably fix the errors you are having naturally. Pagination can be a pain without having controlled modules to help figure out what's causing the problems and a class can help you do that.
  22. So you are saying your entire php page is returning a blank white page (no errors)?
×
×
  • 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.