Jump to content

methomps

Members
  • Posts

    13
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

methomps's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thought I'd bump this up to see if anyone had any ideas
  2. Hi guys, I'm having a bit of trouble with my .htaccess file. I have it setup to funnel everything to index.php, but it is not supposed to do this for requests to files that actually exist (like my css). However, given that some of my session variable tracking page views jumps by 2-6 every page load, I suspect it is not working properly. What am I doing wrong? This code: is intended to tell stop execution of any other rules if the file actually exists, but it doesn't appear to be doing that.
  3. Correction, the last part of that should be: //if it has to be in the format you specified $array1 = array(); foreach($array2 as $key=>$value) { $array1[] = array('name'=> $key, 'amount'=> $value); }
  4. <?php $array1 = array(array('name'=>'CAR', 'amount'=>1000), array('name'=>'BUS', 'amount'=>500), array('name'=>'CAR', 'amount'=>750)); $array2 = array(); foreach($array1 as $miniarray) { if(isset($array2[$miniarray['name']])) { $array2[$miniarray['name']] += $miniarray['amount']; } else { $array2[$miniarray['name']] = $miniarray['amount']; } } //if it has to be in the format you specified $array1 = array(); foreach($array2 as $key=>$value) { $array1[] = array($key=>$value); } ?>
  5. $username = $_POST['username']; $password = $_POST['password']; This should go in the page processing the form data, not the page creating the form. <?php session_start(); $username = $_POST['username']; $password = $_POST['password']; $handle = fopen("users.txt", "r"); $valid = false; while ($userinfo = fscanf($handle, "%s:%s\n")) { list ($name, $pass) = $userinfo; if ($username == $name && $password == $pass) { $valid = true; } } fclose($handle); if ($valid) { $_SESSION['logged_in'] = true; echo 'yay ur in'; } else { echo 'You entered a wrong password'; } ?> You should also check to make sure the info is sent (among other validation tasks) if (isset($_POST['username'])) { $username = $_POST['username']; }
  6. Hi guys, I was wondering if anyone had any suggestions on a forum application that is well-suited to these needs: - ability to automate creation of subforums and auto-assign moderator functions to those subforums - ability for users to post as alter-egos (eg, both the user and as a character) - ability to integrate with site's userbase (eg, registering with the site automatically creates the user in the forums, logging in with the site logs in with the forum) I am creating an online baseball game. When someone creates a team, I want a subforum created with them as the moderator. I want users to be able to indicating they are posting as their baseball player.
  7. Is there a specific seeding you want? One idea would be to have a table in your database with these columns: team_id seed wins Seed the teams 1 through 16. 1-16 --------- 8-9 ============= 4-13 --------- 5-12 ============= 3-14 --------- 6-11 ============= 7-10 --------- 2-15 Since it is single elimination and you track how many wins a team has, you can figure out where each team is. If the 1-seed has 1 win, it is in the second round and facing either 8 or 9 (whoever has a win). If it has 2 wins, it is in the semi-finals and facing the 4-5-12-13 team with 2 wins. And so on.
  8. I would have my database table setup like this: username password location When they login, pull the location and use header() to redirect them there.
  9. Are you sure there is anything in $description? Is something getting stored to the database?
  10. It doesn't seem you need any knowledge of weather as the prompt tells you what values to use.
  11. Hi guys, I was wondering if I could get some advice. I had an idea for a baseball MMORPG that I've decided to take a stab at. I have a smattering of programming background (took high school computer science 7 years ago, got away from it in college, made some .asp websites over 5 months after college, got away from it when I went to law school, now finished law school and learning php). I have just started over the last week to learn OOP. I'm getting the basics, but haven't yet had that breakthrough where I know how to use it to my advantage (still programming procedurally with objects, as it were). I'm going to commit more time to getting OOP down. Does it make sense for me to learn a framework at this time? I plan to only make one website (although I guess plans can always change). If so, and since people are saying Zend has a high value but steep learning curve, what do you suggest?
  12. Because a subject can belong to more than one category.
×
×
  • 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.