473,397 Members | 2,099 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

how to make this code work?

http://localhost/download.php?lt=a&sr=0&sp=9

lt = letter(eg:- a,b)
sr = start
sp = stop
Expand|Select|Wrap|Line Numbers
  1.    <?php
  2.     if(isset($_GET['lt'])){
  3.         $lt = $_GET['lt'];
  4.         if(isset($_GET['sr'])&&isset($_GET['sp'])){
  5.         $sr = $_GET['sr'];
  6.         $sp = $_GET['sp'];
  7.             if(!empty($lt)){
  8.                 if(!empty($sr)&&!empty($sp)&&$sp!=9){
  9.                     if(strlen($lt) == 1){
  10.                         echo '<h2>'.strtoupper($lt).' Games</h2>';
  11.                         $nquery = "SELECT * FROM `games` WHERE `flname` = '".$lt."' OR '".strtoupper($lt)."' ORDER BY `created` ASC LIMIT ".$sr." ".$sp."";
  12.                         if($nquery_result = mysql_query($nquery)){
  13.                             if($nquery_num = mysql_num_rows($nquery_result)){
  14.                                 while($nquery_r = mysql_fetch_assoc($nquery_result)){
  15.                                 $nquery = "SELECT * FROM `games` WHERE `flname` = '".$lt."' OR '".strtoupper($lt)."' ORDER BY `created` ASC LIMIT ".$sr." ".$sp."";
  16.                                 $nquery_result = mysql_query($nquery);
  17.                                 $nquery_r = mysql_fetch_assoc($nquery_result);
  18.                                 echo '<article>';
  19.                                 echo '<a href="game.php?id='.$nquery_r['id'].'"><div id="g_head">'.$nquery_r['name'].'</div></a><br>';
  20.                                 echo '<a href="game.php?id='.$nquery_r['id'].'"><img src="'.$nquery_r['image'].'" alt="'.$nquery_r['alt'].'" width = "150px"></a>';
  21.                                 echo '</article>';                
  22.                                 }
  23.                                 while($sp<$nquery_num){
  24.                                     $sr = $sr + 10; 
  25.                                 }
  26.                             }else{
  27.                                 echo 'Ok2';
  28.                             }
  29.                         }else{
  30.                             echo 'Ok3';    
  31.                         }
  32.                     }
  33.                 }
  34.             }
  35.         }
  36.     }else{
  37.         echo '<h2>Latest Games</h2>';
  38.         $nquery = "SELECT * FROM `games` ORDER BY `created` DESC LIMIT 9";
  39.         if($nquery_run = mysql_query($nquery)){
  40.             while($nquery_result = mysql_fetch_assoc($nquery_run)){
  41.                 echo '<article>';
  42.                 echo '<a href="game.php?id='.$nquery_result['id'].'">'.$nquery_result['name'].'</a><br>';
  43.                 echo '<a href="game.php?id='.$nquery_result['id'].'"><img src="'.$nquery_result['image'].'" alt="'.$nquery_result['alt'].'" width = "150px"/></a><br>';
  44.                 echo '</article>';
  45.             }
  46.         }
  47.     }
  48.     ?>
  49.  
Mar 6 '12 #1
1 1481
r035198x
13,262 8TB
What is the code doing and what do you want the code to do instead?
Mar 6 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Chris Krasnichuk | last post by:
Hello every one, Does anyone know how to make php work on your computer? please reply I need help Chris
3
by: Cool Mentalist | last post by:
function lightUp(light){ light.style.background="yellow" } hello hello2 hello3 etc etc
2
by: Wayne Wengert | last post by:
I found an interesting article on automatically populating the city and state after the user enters a ZIP code...
7
by: Tom | last post by:
How can I make code not execute for a debug build, but do execute for a production build? I have code which prompts for an account and password when the program starts up. It is a pain to have to...
6
by: jonefer | last post by:
It seems that the following code should work - (if not why is the event there?) (Do I need some sort of client side script to awaken it?) Private Sub chkRefresh_CheckedChanged(ByVal sender As...
4
by: Franky | last post by:
I have a Command Prompt window open and select all the characters and copy them to the clipboard. I then read them from the clipboard str = CType(DataO.GetData(DataFormats.OemText, False),...
48
by: Nathan Sokalski | last post by:
Ever since I found out that they didn't give us a way to install both IE6 and IE7 on the same machine, I have been more frustrated and annoyed with Microsoft than I ever have been with any company...
0
by: ml41782 | last post by:
I have this working but not as clean as it should be. I'm new to Perl and This has been my first project to monitor my solar equipment. Here is the data stream ...
1
by: FlashT | last post by:
Hello, I got a script: http://www.mattkruse.com/javascript/autocomplete/index.html It works fine on IE and Opera, but does not on FF. It does something on FF, but not what it should do (check...
7
by: jharrison | last post by:
I'm finding it hard to make this code work in Python 3.0. Been looking at it for some time now: # import module for random functions import random # List of words for the computer to pick...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.