-
Posts
9,409 -
Joined
-
Last visited
-
Days Won
1
Everything posted by MadTechie
-
Change $query3 to the follwoing $query3="SELECT * FROM items where cat_id = '$catid' LIMIT $from, $max_results";
-
what are you trying to do ?
-
try this <?php // display information for each player in a table $link = mysql_connect( "localhost", "ace_ACE", "*****" ); if ( ! $link ) { die( "Couldn't connect to MySQL: ".mysql_error() ); } mysql_select_db( "ace_cf", $link ) or die ( "Couldn't open 'ace_cf': ".mysql_error() ); // workout the page pagination limits etc $limit = 5; $vpage = (int)$_GET['vpage']; $query_count = "SELECT count(*) FROM cf_users"; $result_count = mysql_query($query_count); $totalrows = mysql_num_rows($result_count); if(empty($vpage)){ $vpage = 1; } $limitvalue = $vpage * $limit - ($limit); $query = "SELECT * FROM cf_users LIMIT $limitvalue, $limit"; $result = mysql_query($query) or die("Error: " . mysql_error()); if(mysql_num_rows($result) == 0){ echo("Nothing to Display!"); } //print "<p>$num_rows people have money</p>\n"; echo '<div id = "attack"> <table align="center" class = "fix"> <tr> <td colspan="4"> <center><b>Players</b></center> </td> </tr> <tr> <td><b>Name</b></td> <td><b>Rank</b></td> <td><b>Race</b></td> <td><b>Money</b></td> </tr> <tr> <td colspan="4"> </td> </tr>'; while ($a_row = mysql_fetch_assoc( $result ) ) { $all_name = stripslashes($a_row['username']); $all_rank = stripslashes($a_row['rank']); $all_race = stripslashes($a_row['race']); $all_money = stripslashes($a_row['money']); // change the players race from a integer into a string if($all_race == 0) { $all_race = "British SAS"; } elseif($all_race == 1) { $all_race = "Navy Seal"; } elseif($all_race == 2) { $all_race = "Russian Spetsnaz"; } elseif($all_race == 3) { $all_race = "Australian SAS"; } echo ' <tr> <td>' . $all_name . '</td> <td>' . $all_rank . '</td> <td>' . $all_race . '</td> <td>$' . $all_money . '</td> </tr>'; } echo '</table>'; if($page != 1){ $pageprev = $page--; echo("<a href=\"http://www.crikeygames.com.au/conflictingforces/index.php?page=attack&vpage=$pageprev\">PREV".$limit."</a> "); }else{ echo("PREV".$limit." "); } $numofpages = $totalrows / $limit; for($i = 1; $i <= $numofpages; $i++){ if($i == $vpage){ echo($i." "); }else{ echo("<a href=\"http://www.crikeygames.com.au/conflictingforces/index.php?page=attack?vpage=$i\">$i</a> "); } } if(($totalrows % $limit) != 0){ if($i == $vpage){ echo($i." "); }else{ echo("<a href=\"http://www.crikeygames.com.au/conflictingforces/index.php?page=attack?vpage=$i\">$i</a> "); } } if(($totalrows - ($limit * $vpage)) > 0){ $pagenext = $vpage++; echo("<a href=\"http://www.crikeygames.com.au/conflictingforces/index.php?page=attack?vpage=$pagenext\">NEXT".$limit."</a>"); }else{ echo("NEXT".$limit); } mysql_free_result($result); mysql_close( $link ); echo '</div>';
-
Topic solved is just a tag to you don't have to look in every post to try to help
-
you have already opened a thread here i am also wondering what you had to PM instead of making public!! so i think something fishy is going on here!
-
Can't get my array out of my function
MadTechie replied to slancasterfreak's topic in PHP Coding Help
your currently returning the array to nothing.. as has you want the returned results.. try this $walkerarray = WalkerArray(); // <--- print_r($walkerarray); thus $walkerarray is now the array of course you could use any variable, ie $MT = WalkerArray(); // <--- print_r($MT); -
#1 register here #2 login here problem? try here Or i could just copy and paste their whole site... this is NOT a PHP problem!,
-
$room= mysql_query("SELECT r_no FROM room WHERE rc_id ='$r_type'order by rand() limit 1"); $row = mysql_fetch_assoc($room); //don't need to loop echo $row['r_no']; $r = $row['r_no']; //added mysql_free_result($room); //removed the $r=
-
one idea would be to setup a html file with some tags ie [counter] then read it in via file_get_contents then use str_replace to replace the tags with the values from the php script
-
if solved can you click the solved button please
-
[SOLVED] How Would I Prevent PHP GD Cache?
MadTechie replied to phpQuestioner's topic in PHP Coding Help
this should work.. <?php $borigin = rand(100000,999999); $epurl = $_GET['epurl']; // would be query string mygdpic.php?filename=somephoto.JPG ?> <img src="<?php echo "$epurl?unique=$borigin"; ?>" alt="Image Failed To Load"> <?php $imagesource = $_GET['filename']; $filetype = substr($imagesource,strlen($imagesource)-4,4); $filetype = strtolower($filetype); if($filetype == ".gif") $image = imagecreatefromgif($imagesource); if($filetype == ".jpg") $image = imagecreatefromjpeg($imagesource); if($filetype == ".png") $image = imagecreatefrompng($imagesource); if (!$image) die(); $watermark = imagecreatefromgif('soldv2.gif'); $imagewidth = imagesx($image); $imageheight = imagesy($image); $watermarkwidth = imagesx($watermark); $watermarkheight = imagesy($watermark); $startwidth = (($imagewidth - $watermarkwidth)/2); // divide by "2" to center watermark $startheight = (($imageheight - $watermarkheight)/2); // divide by "2" to center watermark imagecopy($image, $watermark, $startwidth, $startheight, 0, 0, $watermarkwidth, $watermarkheight); header("Cache-Control: no-cache, must-revalidate"); header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); switch($filetype) { case ".gif": header("Content-Type: image/gif"); imagegif($image); break; case ".jpg": case ".jpeg": header("Content-Type: image/jpeg"); imagegif($image); break; case ".png": header("Content-Type: image/png"); imagepng($image); break; } imagedestroy($image); imagedestroy($watermark); ?> -
i just noticed you ignored my last post.. go back and try that it seam your just trying anything to make it work without the understanding
-
PHP to check unread emails on a server email account?
MadTechie replied to hatrickpatrick's topic in PHP Coding Help
Bascially you need to talk to the mail server via sockets i'll see if i can find my old mailing class -
humm.... is this home work or something.. as this question and very close code has been posted few time!
-
without access to the php.ini file <?php // Report all PHP errors (bitwise 63 may be used in PHP 3) error_reporting(E_ALL); // Same as error_reporting(E_ALL); ini_set('error_reporting', E_ALL); ?>
-
PHP to check unread emails on a server email account?
MadTechie replied to hatrickpatrick's topic in PHP Coding Help
yes it can be done -
[SOLVED] How Would I Prevent PHP GD Cache?
MadTechie replied to phpQuestioner's topic in PHP Coding Help
<?php $imagesource = $_GET['filename']; $filetype = substr($imagesource,strlen($imagesource)-4,4); $filetype = strtolower($filetype); if($filetype == ".gif") $image = imagecreatefromgif($imagesource); if($filetype == ".jpg") $image = imagecreatefromjpeg($imagesource); if($filetype == ".png") $image = imagecreatefrompng($imagesource); if (!$image) die(); $watermark = imagecreatefromgif('soldv2.gif'); $imagewidth = imagesx($image); $imageheight = imagesy($image); $watermarkwidth = imagesx($watermark); $watermarkheight = imagesy($watermark); $startwidth = (($imagewidth - $watermarkwidth)/2); // divide by "2" to center watermark $startheight = (($imageheight - $watermarkheight)/2); // divide by "2" to center watermark imagecopy($image, $watermark, $startwidth, $startheight, 0, 0, $watermarkwidth, $watermarkheight); header("Cache-Control: no-cache, must-revalidate"); header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Content-Type: image/jpeg"); imagejpeg($image); imagedestroy($image); imagedestroy($watermark); ?> if this still caches then just add a random number on the URL ie image?rand=637126378 -
Making a redirect faster when posting to same page
MadTechie replied to jjmusicpro's topic in PHP Coding Help
OK lets go back to this.. <TD width="64%" height="47"><form action="process.php?groupid=<?php echo $_GET['groupid'];?>" method="POST"> <div align="center"> <input type="text" maxlength="10" class="searchBox" name="zipcode_entered_search" size="8" /> <input name="Submit" type="image" src="handyman_files/go_button.gif" alt="Request Service from your local Mr. Handyman!"> </div> </form></TD> <?php error_reporting(E_ALL); require_once ('connect.php'); require_once ('opendb.php'); $groupid_sent = (int)$_GET['groupid']; $query = "SELECT * FROM metrogroups WHERE groupid=$groupid_sent"; $result = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_array($result, MYSQL_ASSOC); $groupname = $row['groupname'] ; if( isset($_POST['Submit']) ) { $zipcode = $_POST['zipcode_entered_search']; $query2 = "INSERT INTO zipcodes_searched (zipcode,time_date) VALUES ('$zipcode', NOW())"; $result2 = mysql_query($query2); $query = "SELECT * FROM zipcodes WHERE zipcode='$zipcode' and on_off=1"; $result = mysql_query($query) or die(mysql_error()); $count = mysql_num_rows($result); switch($count) { case 0: header( "location: nf.php?groupid=" . $_GET['groupid'] . "?zipcode_entered_search=" . $_GET['zipcode_entered_search']); echo "location: nf.php?groupid=" . $_GET['groupid'] . "?zipcode_entered_search=" . $_GET['zipcode_entered_search']); exit; break; case 1: $row = mysql_fetch_array($result, MYSQL_ASSOC); $site = $row['redirect_url'] ; header("location: $site"); echo "location: $site"; exit; break; default: $row = mysql_fetch_array($result, MYSQL_ASSOC); header( "location: shared.php?groupid=" . $_GET['groupid'] . '?zipcode_entered_search=' . $_GET['zipcode_entered_search']); echo "location: shared.php?groupid=" . $_GET['groupid'] . '?zipcode_entered_search=' . $_GET['zipcode_entered_search']; exit; break; } } else { echo "Nothing submitted!"; } ?> -
you probably don't have an auto number setup in the database
-
Making a redirect faster when posting to same page
MadTechie replied to jjmusicpro's topic in PHP Coding Help
erm.. thats code has no headers!! also you said that code worked! -
Making a redirect faster when posting to same page
MadTechie replied to jjmusicpro's topic in PHP Coding Help
i assume the php code is in a the called process.php, is this correct and are you clicking on the submit (go button) ? aso for your old code why now just change echo "<META HTTP-EQUIV=Refresh CONTENT=\"0; URL=$site\">"; to Header("location: $site"); ?? -
A Couple Questions .. One On Require.. One On Sessions
MadTechie replied to spdwrench's topic in PHP Coding Help
to speed things up you need to know exactly whats slowing it down.. i assume you know its a file.. the next step is what part.. if its SQL related then maybe some cacheing the fact is i could show you how to check if the file is included but require_once isn't really that slow (it could total up to 2 seconds (total guess) if you had it everywhere over 1000s of files). -
Making a redirect faster when posting to same page
MadTechie replied to jjmusicpro's topic in PHP Coding Help
humm change the form code to <TD width="64%" height="47"><form action="process.php?groupid=<?php echo $_GET['groupid'];?>" method="POST"> <div align="center"> <input type="text" maxlength="10" class="searchBox" name="zipcode_entered_search" size="8" /> <input name="Submit" type="image" src="handyman_files/go_button.gif" alt="Request Service from your local Mr. Handyman!"> </div> </form></TD> also i assume the php code is in a the called process.php -
to advanced for me... or just maybe too little info! ???