Jump to content

PhpNobody

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

PhpNobody's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Turns out I missed one ' when inserting data into the database, still a weird error :S
  2. So I modified my code a bit and while running it is giving: Forbidden You don't have permission to access /main.php on this server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. This is the part that has the problem it seems: <? $map_query = mysql_query("SELECT * FROM user_map WHERE username='$session_username'"); while($map = mysql_fetch_array($map_query)){ $player[continent] = $map["continent"]; $player[xPos] = $map["xPos"]; $player[xLoc] = $map["xLoc"]; $player[xMap] = $map["xLoc"]; $player[yPos] = $map["yPos"]; $player[yLoc] = $map["yLoc"]; $player[yMap] = $map["yLoc"]; }; if (isset($_POST)){ $move[val] = @key($_POST["move"]); $move = $move[val]; $loc[num] = substr($move, 0, -1); $loc[let] = substr($move, -1); $ll = $loc[let].'Loc'; $lp = $loc[let].'Pos'; mysql_query("UPDATE user_map SET $ll='$player[$ll]'-'1', $lp='$player[$lp]-'1' WHERE id='$player[id]' AND username='$session_username'"); header("Location: ?p=map&view=local");} ?> What is wrong?
  3. Please take a look at the outcomes I get. FF http://sciencewar.hostme.lt/images/ff.bmp IE http://sciencewar.hostme.lt/images/ie.bmp Chrome http://sciencewar.hostme.lt/images/chrome.bmp Opera http://sciencewar.hostme.lt/images/opera.bmp First of, the shortcut icon. Code: <link rel="SHORTCUT ICON" href="htt://sciencewar.hostme.lt/images/icon.ico"> It's 32x32. Why it's only displayed in Opera? And now the tables. In IE it seems that the borders stay not removed. CSS code: .line { border-width:0; background-color:#333333; width: 200px; height: 10px; background-image: url(http://sciencewar.hostme.lt/images/line.png); } I use the line class in <hr/>. Is this the reason why the borders don't get removed in IE? And if so then how should I handle it? Now the missing borders. The missing border is actually part of the image and not a border. Link to it: http://sciencewar.hostme.lt/images/col_left.gif How should I fix it so that they appear in Opera and Chrome? Thanks.
  4. Simon, I actually wanted to leave the same value everywhere and already knew of the way you offered though thanks. Requinix, your code does the trick for me so thank you very much
  5. Hello. I decided to create my own browser game and started learning PHP and HTML. Everything is going quite well now I'm creating a primitive version of the game. I'm reading tutorials and moving forward fast. But I started thinking about the combat system and got stuck. I want to let my users to choose which monster to attack with buttons. I made this form as an example: <p>Choose which monster you want to hunt:</p> Rat<br /> <form action='main.php?p=hunt' method='post'> <input type='submit' name='rat' value='Attack' /><br /><br /> Slime<br /> <form action='main.php?p=hunt' method='post'> <input type='submit' name='slime' value='Attack' /> </form> And I'd like to know what code should I use to know which submit button was pressed, the rat or slime one. I currently only know how to do a lot of IF's to determine it so is there a short way to do it? If anyone can, please help me, and if you can try to explain it simply as I'm still starting to understand php . And also I'd like some suggestions where to run my combat script (the same page where the form is or it should be on a different page, if the page should use id from a rand() function and so on). Thanks
×
×
  • 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.