Jump to content

lost4words

New Members
  • Posts

    3
  • Joined

  • Last visited

Profile Information

  • Gender
    Male
  • Location
    England, United Kingdom
  • Age
    32

lost4words's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Mysqli was definitely easy to get the handle of (although the old video i was learning from was mysql so had to figure out the latest techniques) but if PDO is the 'standard' happy to get to grips with this and would rather do it at this point when I'm starting out, rather than when I'm a while down the road and its harder to get rid of the bad habit! Sometimes a simple solution is great - I understand what this is doing although I have read that putting stuff in the url is not the most secure method as it takes away the 'hidden' aspect. Although I would like to spend some time learning Javascript if this would be useful. Only been learning PHP for a couple of weeks on and off so far. Therefore the a>b>c method is the easiest for me currently, however if there is a better way (albeit may take some more learning) then I'm up for doing it. My work has a 'Pluralsight' subscription so will see what that has available for Javascript. I have a basic handle of HTML from ages ago but also need to understand css eventually, not too fussed about graphics etc more interested in how the nuts and bolts work behind the scenes currently! I am doing all of this for fun - mainly to see if I can emulate/reproduce a text based game that I used to play when I was younger but now seems to have died Where would you recommend learning about versioning? (currently i am copying old versions into notepad++ but would like to be able to easily back out changes etc once my project gets bigger!)
  2. Hi Gizmola, Thank you for the concise reply - I will take a look at this tomorrow and see if I understand and can learn what you have suggested. Currently once the user clicks the button on the page it takes them to signup.php which has a form with the game details on it - apologies if I didn't make this clear. Its getting late and i'm getting sleepy. Been trying to solve this for a few days but finally bit the bullet after numerous failures. Should've done it sooner! Have read another post on here about moving away from the mysqli_ commands so just doing some learning on PDO atm
  3. Hi All, PHP newbie here. Getting to grips with various aspects of learning PHP however i seem to have hit a bit of a stumbling block. The below code loops through my $available_games (foreach from what i have read is the best way to do this) and outputs a nice table. Users then click on the Sign Up button where they input some details in a form to signup. I am displaying the value from the hidden input box (name="game_name") on the next page so i know what game they have signed up for and can insert this into the database. However currently this only displays the final $available_games['game_name'] in the list (ie if there are 2 available it always shows the 2nd, even if they select the 1st available game - there could be more than 2 but in my test example i am using 2) I want the <input type="hidden" name="game_name" value="<?php echo $available_games['game_name']?>"/> value to be the correct one depending on where in the loop of $available_games it is at. (Ie 1st available game then keep this value and display on the next page - if 2nd is chosen then use this etc etc) I have looked at producing a variable variable in a loop but couldn't get this to work. Any help is appreciated. foreach($available_games as $available_games) { echo "<tr>"; echo "<td>"; $game_name = $available_games['game_name']; $_SESSION['game_name'] = $game_name; echo "<center>" . $game_name . "</center>"; echo "</td>"; echo "<td>"; echo "<center>" . $available_games['speed_modifier'] . "</center>"; echo "</td>"; echo "<td>"; $open = strtotime($available_games['open_date']); $open_date = date("d-m-Y H:i", $open); echo "<center>" . $open_date . "</center>"; echo "</td>"; echo "<td>"; $close = strtotime($available_games['close_date']); $close_date = date("d-m-Y H:i", $close); echo "<center>" . $close_date . "</center>"; echo "</td>"; echo "<td>"; ?> <input type="hidden" name="game_name" value="<?php echo $available_games['game_name']?>"/> <form action="signup.php" method="POST"> <input type="submit" name="signup" value="Sign Up"/> <?php echo "</td>"; echo "</tr>"; } echo "</table>";
×
×
  • 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.