Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. Just to point this out.. Sessions will NOT lock the attackers computer
  2. Sounds about right to me
  3. Works fine for me.. not a scripting problem
  4. Add error_reporting(E_ALL); at the start, Any errors?
  5. <?php function login($username,$pass) { GLOBAL $db,$table; $username = trim($username); $pass = md5(trim($pass)); $query = mysql_query("SELECT * FROM $table WHERE userName = '$username' AND userPassword = '$pass'"); $count = mysql_num_rows($query); if($count == 0) return $count; $row = mysql_fetch_assoc($query) echo $row['userBalance']; return $count; } ?>
  6. wouldn't it be better to just update a field in the DB !
  7. after 3rd failed attempt, CAPTCHAS are also required
  8. Sessions won't work.. if the user deletes this cookies or jusr removes the PHPSESSION from the URL, thay can try again i think rhodesa's solution is best but of course more work..
  9. i could be wrong but i think its like this RewriteRule abc.com(.*)$ abc.def.com$1
  10. Maybe add a CAPTCHA to the password entry screen.. also log the IP and maybe stop that trying any login for an hour (yes i know thats not 100%)
  11. Change the first $row to $row1 and the second $row to $row2 Ie <?php $result4 = mysql_query("SELECT predictions.username, `paidplayer`, COUNT(score), AVG(score), SUM(score), COUNT(id) AS Total_Score FROM predictions JOIN users ON predictions.username = users.username GROUP BY `username` ORDER BY Total_Score DESC "); $i=1; while($row1 = mysql_fetch_array($result4)) { $average=$row1['AVG(score)']; $paidplayer=$row1[paidplayer]; $result5 = mysql_query("SELECT SUM(score) FROM predictions WHERE score = '25'"); while($row2 = mysql_fetch_array($result5)) { $score25 = $row2['SUM(score)']; if ($paidplayer== 2) { echo"<tr style=\"color: #FF0000;\">"; }else{ echo "<tr>"; } echo "<td>[". $i ."]</td>"; echo "<td>".$row1['username']."</td>"; echo "<td>".$score25."</td>"; echo "<td>"; echo round($average, 2); echo "</td>"; echo "<td>".$row1[Total_Score]."</td>"; echo "<td>".$row1['COUNT(score)']."</td>"; echo "<td>".$row1['SUM(score)']."</td>"; echo "</tr>"; $i++; }} ?>
  12. replace 3600 with time()-ini_get("session.gc_maxlifetime") the problem is if session.gc_maxlifetime is set to 0 then it means the life time will be until the browser closes.. but this is set from your server.. EDIT: the default is 1440 (24 minutes)
  13. This is really a flash question i think.. but to echo the results just do function login($username,$pass) { GLOBAL $db,$table; $username = trim($username); $pass = md5(trim($pass)); $query = mysql_query("SELECT * FROM $table WHERE userName = '$username' AND userPassword = '$pass'"); $row = mysql_fetch_assoc($query) echo $row['userBalance']; return mysql_num_rows($query); }
  14. Opps, revised, i didn't notice the creation of the table in the loop try this <?php // store the record of the "gold" table into $row $current = ''; // keeps getting the next row until there are no more to get $SetRows = 3; $RowCount = 0; echo "<center><table>\n"; while($row = mysql_fetch_array( $result )) { $id = $row['id']; echo ($RowCount==0)?'<tr>':''; echo '<td><div><a id="thumb1" href="'.$row['image'].'" class="highslide" onclick="return hs.expand(this)"><img src="'.$row['image_th'].'" title="Click to enlarge" /></a><div class="highslide-caption">'.$row['caption'].'</div></td>'."\n"; echo ($RowCount==$SetRows)?"</tr>\n":''; $RowCount = ($RowCount==0)?$SetRows:$RowCount-1; } echo ($RowCount!=$SetRows)?"</tr>\n":""; echo "</table></center>"; echo "<br>"; ?>
  15. Untested but try this <?php // store the record of the "gold" table into $row $current = ''; // keeps getting the next row until there are no more to get $SetRows = 3; $RowCount = 0; while($row = mysql_fetch_array( $result )) { $id = $row['id']; if (!$current) { echo "<center><table>"; $current = $id; } elseif ($current != $id){ echo "</table><br><br><table>"; $current = $id; } echo ($RowCount==0)?'<tr>':''; echo '<td><div><a id="thumb1" href="'.$row['image'].'" class="highslide" onclick="return hs.expand(this)"><img src="'.$row['image_th'].'" title="Click to enlarge" /></a><div class="highslide-caption">'.$row['caption'].'</div></td>'; echo ($RowCount==$SetRows)?'</tr>':''; $RowCount = ($RowCount==0)?$SetRows)?:$RowCount--; } echo ($RowCount!=$SetRows)?'</tr>':''; echo "</table>"; echo "<br>"; ?>
  16. you could try this <?php //Add set_time_limit(0); ini_set ("memory_limit", "64M"); 99. // MAIL HEADERS with attachment 100. 101. $fp = fopen($strresume, "rb"); 102. $file = fread($fp, $strresume_size); ?>
  17. http://www.php.net is probably the best manual on the web.. you can run PHP locally, download and install WAMPServer, other than that your need you try some tutorials Google php tutorials i hope that helps, but overall, experience comes with time.
  18. i would probably do this (was written quickly and on the fly, expect bugs,typos) <?php $item = explode(",", $_GET['p']); foreach($item as $i) { list($iSKU[], $iQty[]) = explode("_", $i); } $SKUs = implode(",",$iSKU[$n]); $query1 = "SELECT * FROM products WHERE sku IN (" $SKUs. ")"; ?> EDIT: LOL well thats sums it up
  19. please read the HEADER ERRORS post also $session_id(); should be session_id();
  20. So.. whats the problem with the one you wrote.. surely your just need to add the article id to the ratign system.. (depends how you wrote it i guess), i think we need more info
  21. I personally like PHPBB & SMF, InvisionPower Board is nice but at a cost.. if this thread is finished please click solved
  22. Okay, change it back and try this 1. rename the current date field to olddate 2. create a new field called newdate 3. query this (update table to the table name) UPDATE table SET newdate = STR_TO_DATE(olddate, '%d/%m/%Y'); 4. check the values of newdate Note always keep a backup
  23. if you mean from SQL then try this SELECT DATE_FORMAT(theDateField, '%M %d, %Y %l:%i%p') as FormattedDate FROM table
  24. A simple forum may take a few days to a few months.. maybe look into SMF (Simple Machines LLC) thats what this forum is, or maybe PHPBB,
×
×
  • 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.