Jump to content

Arkanto5

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Everything posted by Arkanto5

  1. And how exactly do I do that? I get the idea, but I can't figure out to put it in some coding...
  2. Hello I have included a simple login system into my website. When a user logs in, a session is started and he stays connected throughout the whole website until logging out again. The user logs in via his e-mailaddress and a password, which are stored in a mysql database. Now I want to add a page on which a user that is logged in, can see and edit his own information (password, cellphone number, e-mail, etc.). Or easier: instead of showing "Welcome!" showing "Welcome, John!". I thought about storing the e-mailaddress into the session, and then trying to access it to select the correct record (to edit afterwards). But so far, I haven't booked any success. I have to say that this is the first time I'm working with sessions as well, so this is very new to me. Thank you in advance for any help!
  3. Good idea! I never thought of using a link instead of a button... It works like a charm now! Thank you very much !
  4. Hello I'm making a website for our football team, and we have a page with certain statistics. The idea is that our coach can update the statistics via a certain page, where all the team members are listed. He then just have to click on a + or - when for example a player has scored a goal or has been booked. Now, to list the players, I have the following code: <table> <tr><td>Speler</td><td>Aanwezig</td></tr> <?php $query="select * from contacts ORDER BY familienaam"; $rt=mysql_query($query); echo mysql_error(); while($nt=mysql_fetch_array($rt)){ $nr=$nt[id]; echo " <tr> <td>$nt[familienaam]</td> <td>[color=green]$test [/color] <form action=\"aanwezigpluseen.php\" method=\"post\"> <input type=\"submit\" id=\"aanwezigpluseen\" value=\"+\"> </form> <input type=\"button\" id=\"aanwezigmineen\" value=\"-\"></td></tr>"; } ?> </table> and the page aanwezigpluseen.php consist of the following: <?php $con = mysql_connect("localhost","#######","#######"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("db_online_be", $con); $query="select * from contacts ORDER BY familienaam"; $rt=mysql_query($query); $sql="UPDATE contacts SET aanwezig=aanwezig+1 WHERE id=[b]$nr[/b]"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } include('admin.php'); ?> Now, the problem is with the part in bold... When I just write a number (8, for example), then the user with ID 8 gets an extra point added, and the coach gets redirected to the same page to add another one if necessary. In the first part of my codes, the part in green shows the correct user ID. THAT user ID must be used in my second code part, as in WHERE id= (the user id...). Any help? I hope that my problem is a bit clear with this description! Thanks in advance for your help!
×
×
  • 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.