View Single Post
Old 06-05-2009, 12:46 PM   #1 (permalink)
dodgeqwe
The Wanderer
 
Join Date: Jun 2009
Posts: 11
Thanks: 4
dodgeqwe is on a distinguished road
Default Some one please explain me this part of code

I have completed PHP course , i know basics well .Im doing a case study on project to develop my PHP knowledge , if you have time, please explain me $GET[a],

1.why "a" is needed.
2.From where value is passed to "a"?

the above $GET[a] is repeated in many php pages on this project, i couldnt figure out , why?


if you need complete code,i could send you


Below is the some code of index page. Index page consist of book search and login section.


<?php
session_start();
include 'conn.php';

ConnectDB();
$errMsg = "";
if ($_GET[a]=='2')
{
//$a="search.php?txtsearch=" . $_POST[txtsearch];
$a="search.php?cboCategory=" . $_POST[cboCategory];
$_SESSION[searchtext] = $_POST[txtsearch];
$_SESSION[searchauthor] = $_POST[txtauthor];
$_SESSION[searchbook] = $_POST[txtbook];
$_SESSION[cboCategory] = $_POST[cboCategory];

header("Location: $a");
}

if ($_GET[a]=='1')
{

$sql="select nUserId,cUserType from Users where
dodgeqwe is offline  
Reply With Quote