-
Posts
9,409 -
Joined
-
Last visited
-
Days Won
1
Everything posted by MadTechie
-
Just to point this out.. Sessions will NOT lock the attackers computer
-
Sounds about right to me
-
Works fine for me.. not a scripting problem
-
Add error_reporting(E_ALL); at the start, Any errors?
-
<?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; } ?>
-
wouldn't it be better to just update a field in the DB !
-
after 3rd failed attempt, CAPTCHAS are also required
-
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..
-
i could be wrong but i think its like this RewriteRule abc.com(.*)$ abc.def.com$1
-
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%)
-
[SOLVED] Two SELECT statements, what am I doing wrong?
MadTechie replied to Siggles's topic in PHP Coding Help
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++; }} ?> -
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)
-
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); }
-
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>"; ?>
-
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>"; ?>
-
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); ?>
-
PHP Installation
MadTechie replied to spectacularstuff's topic in PHP Installation and Configuration
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. -
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
-
please read the HEADER ERRORS post also $session_id(); should be session_id();
-
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
-
I personally like PHPBB & SMF, InvisionPower Board is nice but at a cost.. if this thread is finished please click solved
-
[SOLVED] ordering by date DESC is going by the first Number
MadTechie replied to jesushax's topic in PHP Coding Help
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 -
[SOLVED] MySQL 5.0 PHP TimeStamp Issues.. GRR!!
MadTechie replied to monkeytooth's topic in PHP Coding Help
if you mean from SQL then try this SELECT DATE_FORMAT(theDateField, '%M %d, %Y %l:%i%p') as FormattedDate FROM table -
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,
-
[SOLVED] ordering by date DESC is going by the first Number
MadTechie replied to jesushax's topic in PHP Coding Help
Yep