Jump to content
Old threads will finally start getting archived ×

Zixtyy

New Members
  • Posts

    5
  • Joined

  • Last visited

Zixtyy's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I chose the separate column part so I could easily sort the data for analytics etc (month-by-month attendance rates etc). + I just realised I'd forgotten to type that on the post - it's there really!
  2. I..I'm still not sure. Can you clarify what you mean by form field name and array key? (Or spoonfeed me, lol, I'm desperate)
  3. Hi, I'm working on my Computing project for A2, and I'm a little stuck on working out how to process a bunch of data for a pupil register. At the moment, the process works by the script pulling the classes which a teacher is assigned to, and then the pupils assigned to the class, and displaying them in a table, along with a dropdown box for a mark for the teacher to select, Present, Absent or Late. However, i'm not sure how I can process each line, match it with a specific pupil ID, attach a timestamp and send it off to the database. (As in taking POST data and parsing it into queries.) The code which presents the options is currently: echo "<td><select name='mark-" . $row2['id'] . "'><option value='Present'>Present</option> <option value='Absent'>Absent</option><option value='Late'>Late</option></td>"; (Assigns the pupils ID to the select box name) Fields in the attendance table are: RecordID, PupilID, Day, Month, Year Any help would be greatly appreciated.
  4. Nice one! That's a lot neater than my code too. Thanks!
  5. Hey I'm running a website where I get quite a few proxy users evading bans. As an attempt to block them, I added this code: if(@fsockopen($_SERVER['REMOTE_ADDR'], 80, $errstr, $errno, 1)) die("Your magical proxy adventure ends here."); if(@fsockopen($_SERVER['REMOTE_ADDR'], 3128, $errstr, $errno, 1)) die("Your magical proxy adventure ends here."); if(@fsockopen($_SERVER['REMOTE_ADDR'], 8080, $errstr, $errno, 1)) die("Your magical proxy adventure ends here."); I know it probably could be a little shorter, but it worked which was the main thing. However, a few of my users run legitimate websites off their home networks, so they ended up being blocked by this. I've attempted something, but I am receiving the error: syntax error, unexpected '{', expecting '(' on the first ELSE IF clause. The full code is: if (in_array($_SERVER['REMOTE_ADDR'], $whitelist)) { // User is whitelisted, so we continue without going to the check. } else if { if (@fsockopen($_SERVER['REMOTE_ADDR'], 80, $errstr, $errno, 1) || (@fsockopen($_SERVER['REMOTE_ADDR'], 8080, $errstr, $errno, 1) || (@fsockopen($_SERVER['REMOTE_ADDR'], 3128, $errstr, $errno, 1) } else { // User isn't whitelisted, but is not a proxy, continue! } Can anyone point me in the right direction?
×
×
  • 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.