PHP - Website Help And Opinions
Ok I am into sports games for the PS3 and I help run a baseball league for MLB 12 The Show. We currently use a website for stat tracking called LeagueDaddy (http://www.leaguedaddy.com). I created this site (http://www.stlbleague.com) and I am pulling player stats from the LeagueDaddy site and exporting them into my databases. What I would like to do is set up a database structure so we can enter stats on our server and they will be updated in real time. Now I have figured out how to use the .php?id feature (as you can see here http://www.stlbleague.com/tm.php?tid=10).
Now I have an idea for a database structure and here it is: Players Table - ID, Name, Photo, Age, other personal info Stats Table - Player ID, and then all the player's stats Teams Table - Team ID, and all the general Team Info Schedules Table - Game ID, Team IDs as the home and away team Those are the 4 major tables that I would need. I already have the players and teams tables set up properly. My question is, how could I get stats to store for each individual game so I could pull standings and many other things? Is this a reasonable idea given what I already have set up? What would you recommend that I look at as for a tutorial on how to do this? There is a site www.nnlcentral.com that already achieves what I want but for a different game; I welcome all tips and suggestions Similar TutorialsHi I am looking for opinions on the best way to secure user passwords. I am currently using crypt() with a 32 bit salt string... now my main question here would be: Should I store a randomly generated md5 hashed salt in the database for each user, or maybe a single salt string in a config file? I am looking for the most secure option here. I am finally getting my blog started. Actually having allot of fun with it to be honest, so far what I have been thinking about is actually working for a change lol. This is more in some ways to show you what I can do actually aswell, all of the below code is obviously in procedural, but would you change anything at all? I mean I know all of the below code is going to be a matter of preference, it works though so far, but I have been reading a few books and sort of memorised allot of it, all of the code below is my own perceptions of course, what do you think? Here's my logic (I have excluded my 'inc.database.php' file, as that's got my mysql database login details), here it is anyways: Code: [Select] <?php ini_set('display_errors', 1); // include the database connection! require_once 'inc.database.php'; function get_category($category_id) { $sql = 'SELECT category FROM blog_categories WHERE category_id = '.$category_id; $result = mysql_query($sql); $row = mysql_fetch_assoc($result); extract($row); return $category; } // function get_responses($category_id, $post_id){ function get_responses($post_id){ $post_id = mysql_real_escape_string($post_id); $sql = 'SELECT post_title, post_text, date FROM blog_posts WHERE isreply = 1 AND parent = '.$post_id; $result = mysql_query($sql); return mysql_num_rows($result); } require_once 'header.html'; // if user has not selected a category in the URL then display the category links! if(!isset($_GET['category'])) { printf("<p>Please select a blog category</p>\n"); $sql = 'SELECT category_id, category FROM blog_categories WHERE avail = \'Y\' ORDER BY category'; $result = mysql_query($sql); // weird but if there's an error show the user firstly! if(!$result) { printf("<p class=\"error\">Could not contact server, please try again later.</p>"); } else { if(mysql_num_rows($result) > 0) { // else loop and output the category as links, so get can be retrieved the find all the posts: while($row = mysql_fetch_assoc($result)) { extract($row); // turns headings of column names into variables, so dont have to use $row['colname'] in database, like so: printf("<p><a href=\"index.php?category=%d\">%s</a><br /></p>\n", $category_id, $category); } } else { printf("<p>No categories available</p>"); } } } else { // trim the category, so someone isnt being stupid and tries to create like a DOS with empty spaces in the category URL trim($_GET['category']); // removes any blank spaces // if category ident is not empty: if($_GET['category'] != ''){ // make input safe: $category_id = mysql_real_escape_string($_GET['category']); // now need to select from which category it is! $sql = "SELECT post_id, post_title, post_text, date, username, category FROM blog_posts LEFT JOIN blog_users ON blog_posts.user_id = blog_users.user_id INNER JOIN blog_categories ON blog_posts.category_id = blog_categories.category_id WHERE blog_posts.category_id = $category_id AND approved = 1 AND isreply != 1"; $result = mysql_query($sql); printf("\n<h2>%s</h2>\n", get_category($category_id)); // calls a function to get the category name! if(mysql_num_rows($result) > 0) { // display the rows of posts: while($row = mysql_fetch_assoc($result)) { extract($row); printf("<h3>%s</h3>\n %s<br />\n By %s %s \n<br />", $post_title, $post_text, $username, $date); // get the no of replies and maybe even at some point show the oldest replies first: // get_responses($category_id, $post_id); printf("No of comments %d</p>",get_responses($post_id)); } } else { printf("<p>No posts exist in this category</p>\n"); } } else { printf("<p class=\"error\">You did not select a blog category, please try again.</p>"); } } require_once 'footer.html'; ?> Of course with the init_set('display_errors', 1) is set to true just for debugging though, when I am happy with it going live I will make this 0, so no errors appear to the user, but what do you think? It is of course entirely reading from the database, no input on this page, as that will be on other scripts. Thanks and I look forward to any replies, Jez. I'm trying to make a League of Legends (a video game) community website, both as a personal project and for practice. Now the game has a lot of champions, each of whom have 5 unique abilities. Now, I thought about manually inputting all the details about each champion into a MySQL database, but that would long and tedious, and I don't really have the time for it now. Also, the game patches very oftern (like, once every 2 weeks) which changes many of the stats, etc. of the champion, and it is not possible for me to keep manually updating these every time there is a patch. Fortunately, there is a League of Legends Wiki which has all the data I need in their specific champion pages, which they keep updated per patch. So I was wondering if there was any way to get the data from the divs in the wiki, and have it display on my site. What I want to do in my website is that whenever someone types a champion's name (in a post or whatever), I want it to display a hover-over dialog with some of the champions details. And a lot of other features such as that. In plain English I need a way to : > Tell PHP to go to the wiki's source code on a specific page > Find a specific div container > Get X data from there > Pass X data into a function to display the hover-over I think this way, I would not have to maintain a database as I can leech off the wiki's data. I have not coded anything like this before, so I would like a few pointers as to how to achieve this. Any help will be appreciated! I tried searching on google but couldn't find any relevant information, please redirect me to relevant source or help me with the code. I want to pass a domain name in text field which will be scanned and then the script will display entire site map. Not external links or links on a page. Sorry it is not easy for me to explain. Eg. if i pass abc.com Script will display abc.com/12/adn.php abc.com/asd/asd/ etc Whatever their url format is. All the links on that domain. hello My database is in a same server with seperate domain name , then I want to insert from website1 mysql data on website2 mysql data. can anyone help me? Is it possible to download files from a website to my online websites root directory? reason I'm asking is because I have been downloading large video files to my computer which take about 20 minutes!! Then I use FTP to upload them to my site but it takes about 2-3 hours per video!! I was looking for a faster way! All help would be great! Hello everybody!
I have been asked by a customer to develop a GTP website (Get To Pay, those websites where people earn money from clicking on ads). I managed to write the backend, signup and login but I am unsure how the ads part, with built-in user-tracking works and fallback link works.
I would really appreciate any kind of help.
Thank you very much!
P.S. For the user tracking I was thinking of sessions with matching ip and user agents together with an anti-proxy online service (e.g. MaxMind, Proxystop, ...)
Hi, I haven't used any php for a while, but i am making a website, and i need some advice on how to do the following: I want the website to change an image once every 24 hours, the image will revert back to the original image after 2 minutes. Does anyone have an idea how I could start doing this? This would be an example of a page I'm referring to: http://www.curse.com...other-downloads
I want to get the file name and compare it to another name (to see if they are the same or not). I have no idea how to access that page from my website. I'm guessing PHP would be best although if you don't think so tell me what you think would be better (I was thinking javascript but don't think that's cross-site compatible). Is there a PHP function to get the value of the href which is in this case (as of this posting) "Railcraft 9.4.0.0".
I used inspect element to see the code of the page but have no idea if this is possible or if I'm even going about this the right way. The code would have to work on this entire website (all pages have the smae layout as this one though! Any help is greatly appreciated!
Hello everyone and thank you for reading this.
My goal: Build a site like sportingnewschicago.com
What it does? It has different sectiions of different teams. Then it displays the tittle of the news and makes them be able to click on to go to the news site. The site some how checks a list of sites and post them on their respected section. But only ones that have not already been listed.
What i want to do? Well i want to try to learn how to do this. Is this something i can make with the help of members here? It would only have index.php and thats it.
Please let me know if anyone would be interested in teaching me as i do it. If not i would understand. Thank you.
My code on website is not validate on W3 Validator.
<?xml version="1.0" encoding="ISO-8859-1"?> I am working on a website and I am at a standstill. I would rather speak to someone one on one but its been very difficult to find someone that could help. I have the scripts that I want but when I add the scripts to the mainpage everything stops working. I really don't want to go to wordpress because I am almost done with this one. Thanks.
Hi there Can anyone please help me. I am trying to get my website working but i am struggling big time with the php. The things i need to do are not to complicated however my lack of skill with php is making me struggle. I need help in making the php work on my website. Can anyone help please. (Please note it is not a commercial or business website.) Anyone who can help please contact me. Thanks Hi I'm after a solution to a problem I have. I'm building a small site for charity which the the client wants to email(with a url link) to say 1000 selected companies but only wants them to be able to view the site and register interest and not anyone else or if they forward the mail to a non prefered client? Any help to point me in the right direction would be good thank-you. hi, how can i make a autoupdate currency table currency value CHF USD EURO KD (Kuwaiti Dinars) 1 Converted Value Converted Value Converted Value when the page loads, it will convert the currency and the value of CHF, USD and EURO are real time please kindly help tia Hi, I have a requirement of making the single website for different locations, customer running a enterprise, and he wants me to show corresponding items for corresponding locations(nearly around 30 locations) I am very confused how to make this(making separate sub domains for separate location), pls help me regarding this. Thanks, Hi how can I have the same website in a different language? So for the visitor, they would click on the appropriate flag and the site would then be displayed in their language. Hey guys im looking at doing a project that involves sending SMS(Text Message) from an online website. Im just wondering how hard it is to setup using php? For example: If i have registered user (manager) and i want to send a SMS to my team mates from the website itself, how hard would this be? Hi, I am wondering if it is possible to monitor how long someone is on a website for and to limit them for example: 30 minutes. An example of this would be one of those Tv Online websites which allow you to only watch 30 minutes of video time. If you try refreshing the page it will still not allow you. My question is, Is it an ip check which does this? Sorry If it such a broad topic. Nick Hi, I'm working on a design for a new website of mine, but I'm kind of stuck on how to fit in the php aspect of it. There's going to be a lot of different pages and different things you're able to do on each page. I guess I'm trying to figure out how to take my design for the website and break it up into a template system. I don't know anything about using templates though. The last time I tried to make a template I just winged it and it turned out really bad with a lot of confusing code slapped together with html all around it. Right now all I have is a single page made (front page) and I want to use this as my base template. Could anyone explain to me the proper way to go about this, or perhaps link me to a tutorial covering this. Thanks, |