Jump to content

mckgr

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

About mckgr

  • Birthday 04/30/1989

Contact Methods

  • MSN
    me@iammikerees.co.uk

Profile Information

  • Gender
    Male
  • Location
    Leicester, UK

mckgr's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. If you'd prefer not to use an OO method, the concept can be done procedurally. Create an array of where clauses, and the use implode() to put " AND " between them all. Loop through your POST variables and use !empty() to determine whether it needs to be added to the array of where clauses.
  2. You shouldn't use the submit button as your variable for checking if a form has been submitted. Some browsers don't carry information about the button across.
  3. Ah yea. That would need to be set to chat.php I think.
  4. You have a semicolon at the end of the first line of your while loop. That's probably the cause.
  5. Can you go into a little more detail please? Is your problem that it is sometimes going above 30? If so, is it going above 34? What are the $total_hp and $player variables supposed to represent? I would hazard a guess that this is the problem. This should work better, and will make the upper limit for HP hard: <?php session_start(); $_SESSION['turns']--; if($_SESSION['player_hp'] < 30){ $_SESSION['player_hp'] += 5; echo "You Still Have More recovery to do!"; } else { if($_SESSION['player_hp'] > 30) $_SESSION['player_hp'] = 30; echo "You are fully recovered!"; } ?> I've cut out the middle man here, as well. It now stores directly into the session.
  6. The action element needs to be changed to reflect the new filename. So you would want to set it to chat.php... A more general solution, since this page is submitting to itself, would be to just use action="", causing it to submit to itself, arguements and all (were there any set).
  7. mckgr

    Hello

    Yea, most forums seem to be plagued with that issue. I hope I stick around too... I've just started working on a large application so no doubt I will have plenty of things that I could post about
  8. mckgr

    Hello

    Well this board doesn't seem to garner many replies, but I'll introduce myself anyway. I'm Mike Rees, a 21 year old student in the UK studying Artificial Intelligence with Robotics at De Montfort University. I'm currently on my placement year, working at a local (to the Uni) web development company that I won't name... We work primarily in PHP, though recently there's been a lot of Actionscript and some C++ work. On a personal level, I've been programming since I was 11. I got into PHP when I was 14, and haven't stopped working with it since. Despite this, I'm slow on the uptake with new concepts, and in general with changes to my (somewhat narrow) view of how I want to code. For example, I only started programming in OO late 2009, because of a Java module for my course that finally allowed me to grasp it. Since starting my placement, however, I've had to program in a variety of situations regardless of my opinions, because I'm working for money, and I've opened up to the idea that maybe the elitists are right, not just assholes... Anyway, I've joined because my friend base of programmers that I talk to online has shrunk to 1. An unreliable 1, who lives 2000 miles away. I'm interested in making friends, giving and receiving help, etc... 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.