Jump to content

Amplivyn

Members
  • Posts

    26
  • Joined

  • Last visited

Everything posted by Amplivyn

  1. Perhaps use functions which do some basic things? For example, let's say for a player, you had an array with the some levels and their scores similar to $player = array($level_1 => 1000, $level_2 => 4000); You may then have a function to add the total score of the player such as function add_scores($scores) { $total = 0; foreach($scores as $level => $score) { $total = $total + $score; // $total += $score would also work } return $total; } And then simply call it as add_scores($player); Of course, you may not want to use this particular function, but this is the general idea. Write out functions so you can reuse them later on and make your pages easier to read. As with any other project, take things one step at a time, don't freak out if it seems like such a large workload, split it into smaller parts and work on them one by one. Maybe think more about the problem itself rather than the solution. Also, if you feel that the required PHP skills are a bit overwhelming, perhaps it's time to hit the books again, but more importantly, practice and experiment more. So many have done it, surely you can too.Good luck! Cheers, Amp
  2. Well, I can't give you a complete solution, but I can give you some tips. Take things one step at a time. As with any project, start with a plan. Perhaps draw out the basic site structure/database relationships on paper. You may have databases including the users, the website pages, the file links and so on. Where relationships go, you may have some link between the users and the file links to know which files they can access. When you have file links, you can use PHP to retrieve those links and list them out for each user, for example, using a loop and echo "<li>"; echo $link; echo "</li>" is one possible way. You can worry about how it is actually represented later, I generally leave styling to the end once the main structure is set up. Once you've set up some basic functionality, you might then wish to add a user creation section. Of course, a form with required fields, validation and error handling and so on would be useful here. After that, you will want to work on logging in users, perhaps use sessions and cookies to make sure no one accesses anyone else's pages. If you are going to have a massive amount of users, you should also be concerned with what server you will be using and whether it can handle such large amounts of users. You will also need to provide a method to upload files and store them appropriately on your server. If you wish to provide users with the option to alter/send their files, one way of doing it is to provide the receiver with permission to access that file's link (if it is private). Be aware that the suggestions may go on forever for such an open ended question as this, do not expect anyone to give you a detailed guide to building the website just the way you want to. Again, do not tackle the problem as a whole but rather, split the problem into smaller, more easily solvable parts and build on that. Also, if it is a really large project, consider getting a partner or even a team, your work flow should be smoother and you will be able to come up with more ideas. If you plan to do so, get people who will complement your skills, who perhaps do better in some web development aspects than you do, in the end, working with another you isn't what you want. Do some research and experiment, if you have any questions that someone can answer in a realistic amount of time, you'll be able to find more precise answers, good luck! Cheers, Amp
  3. Thanks, that was exactly what I was looking for, will look into it more, cheers!
  4. Hello! I was just wondering, are there any ways to change the look of links with $_GET variables? For example, say I had www.website.com/index.php?action=some_page. Is it possible to change this to www.website.com/some_page or similar? I can think of some ways by creating directories and more files (perhaps create an index.php in that directory and retrieve information), but it would be nice to have some more dynamic way of doing things. Cheers, Amp
  5. Use a database. And,... Start out by drawing some basic website structure on paper so that you can refer to it anytime throughout the project. You may start with some general website sections such as a public area and a staff area. You might then choose to be more specific and add subsections such as an "Edit content" area and "Add users" area to the staff area. It's always good to have a general picture of whatever project you are working on. Depending on your skill, you should then start off with as much as you can comfortably handle without worrying about the size of the project. Being new to PHP, for my first PHP website, I found it easier for me to start off with basic functionality and structure before worrying about bigger things such as usability/security. For instance, you may start out by creating some simple layout like a header,body and a footer. You may then wish to store the header and footer in external files and include them in your pages using PHP, effectively creating a template. Next, you may want to add a database to create dynamic pages. I generally left styling to the very end because you never know when you might just decide to add some layout block that will have to squeeze in somehow. For instance, one method of linking pages is by storing them in a database. Say for instance you had a table called pages with fields "id", "page_name" and "content". You may then access those pages using PHP from your browser. Since you are able to send information with URLs, you can have a single file display many pages, basically, display different content that is retrieved from the database. In the website you mentioned, notice how all of those maps start with "../map_info.php?". Everything after the question mark is simply stored in $_GET for the open page. If you had "map=8b1_brickngrass", then somewhere in map_info.php there would be some script to retrieve the map with ID "8b1_brickngrass" and display it there with other information stored in the database (Mapper, Beaten, Date and so on). Books will only get you so far, experiment and try things out. Good luck! Cheers, Amp
  6. Only time can tell, but indeed web development is pretty cool. What I am more interested in though, is large scale software production or similar and it may in fact be web related. In my vision, I start out alone and as time passes, I try to exponentiate the size of whatever project I am working on. I'm currently aiming to start something as soon as possible but I need some form of education (which I am working on) first. That being said, I'm only aiming for a degree as a backup plan but it is going very well so far.
  7. Some very nice suggestions, I'll be sure to look more into it, thanks!
  8. I am thinking of converting a website I had previously made for my brother from HTML to PHP. The website's structure isn't too complicated so I'm not worried about links and so on. However, being new to PHP, is using $_GET content a great way to access page content (e.g. from a database)? Say, page 1 has some content in the database and page 2 has some other content, is using .../content.php?page=1 and .../content.php?page=2 safe? Secure? Coming from HTML where every page was in a separate file, it just seems somewhat dodgy. Which brings us to, what would be a good way to incorporate tables, images and so on into a Content Management System? It seems fairly simple to provide a page name, visibility button, a content box for text and such, but what would be an easy way to add images/tables (for someone who does not want to use HTML/CSS)? Should I consider making a simple word processor style editor for the page (wysiwyg)? It still seems fairly complex but I suppose doable, I suppose it will mostly use client-side code for the editing and PHP to save changes. I'm not too worried about the coding that will have to be done but more, what would be a good way of representing an easy to use user-interface? Being new to PHP, I'm open to new ideas! Cheers, Amp
  9. Greetings! Fellow phpfreaks, as this is my first time here, I'll start off with a small introduction. I'm 19 and studying computer engineering, starting second year in February. While I am not doing engineering, as you may have guessed, I have taken web development as a hobby and only recently started learning PHP. I'm at an intermediate level with Python, Matlab and I already have some experience with HTML and CSS, as well as a little bit of Javascript. PHP seems incredible when compared to HTML and phpfreaks.com seems like a great way to meet others with a passion for programming. I'm looking forward to gain and give as much as possible while around here, would be really keen for projects and such where we can share the excitement of building something together. Cheers, Amp
×
×
  • 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.