ComputerForum.com ComputerForum.com  
TigerDirect
 
Go Back   Computer Forum > Computer Software > General Software

Reply
 
LinkBack Thread Tools Display Modes
Old 05-02-2008, 08:10 AM   #1 (permalink)
Platinum Member
 
Join Date: May 2005
Location: here
Age: 22
Posts: 996
Default php send data with link

Hello all,
The code below is for selecting the search criteria, the question that I'd:
near each select box there is a search click, so that the user can click on it and search for the things that he/she want, I want to know what did the user chose from the select box when he click the search?
thanks


PHP Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body>

<table border="1">
<form name="search" method="post">

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

$username        = $_GET['username'];

//Select all Majors
$sql1        = "select * from majors";
$result1    = mysql_query($sql1) or die(mysql_error());
echo
"<tr>";
echo
"<td>Major Name</td>";
echo
"<td><select name='major'>";

while(
$row1    = mysql_fetch_array($result1))
{
    echo
"<option>". $row1['name'] ."</option>";

}
$text    = $_POST['major'];
echo
$text;

echo
"</select></td>
<td><a href='search.php?search=major&text=\'$text\''>search</a></td>
</tr>"
;


//Select all Universities
$sql2        = "select * from lebaneseuniversities";
$result2    = mysql_query($sql2) or die(mysql_error());

echo
"<tr>";
echo
"<td>Universtiy Name</td>";
echo
"<td><select name='university'>";
while(
$row2    = mysql_fetch_array($result2))
    echo
"<option>". $row2['smallname'] ."</option>";

echo
"</select></td>
<td><a href='search.php?search=university'>search</a></td>
</tr>"
;

//Location
echo "<tr>";
echo
"<td>Location</td>";
echo
"<td><select name='branch'>";
echo
"<option>Fidar-Halat</option>";
echo
"<option>Beirut</option>";
echo
"<option>Saida</option>";
echo
"<option>Ashrafieh</option>";
echo
"<option>Koura</option>";
echo
"<option>Hariss</option></td>";
echo
"</select>";
echo
"</td>
<td><a href='search.php?search=location'>search</a></td></tr>"
;

//Tuition Limits
$sql3        = "select distinct Tuition from lebaneseuniversities";
$result3    = mysql_query($sql3) or die(mysql_error());

echo
"<tr>";
echo
"<td>Tuition Range</td>";
echo
"<td><select name='tuition'>";

while(
$row3    = mysql_fetch_array($result3))
    echo
"<option>". $row3['Tuition'] ."</option>";

echo
"</select></td>
<td><a href='search.php?search=Tuition'>search</a></td>
</tr>"
;


?>

</form>
</table>

</body>
</html>
__________________
TechNoloGy ConTrols tHe World
AnD I conTroL the TecHnOl0gy
Gue$s WhO @m i.
HehEhehee :confused:
houssam_ballout is offline   Reply With Quote


Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do we feel about this set up? gmen5681 Desktop Computers 16 07-11-2006 09:42 PM
Could someone exlpain... i.Angel Computer Networking and Servers 2 03-16-2006 01:23 PM
Reading old cassette data tapes Musicanic General Software 0 02-13-2006 08:56 PM
PHP help dragon2309 Operating Systems 25 07-19-2005 04:33 PM
Cannot send files between home computers...please help woah23 Computer Networking and Servers 6 05-26-2005 03:47 AM


All times are GMT. The time now is 07:52 PM.


Powered by: vBulletin Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Copyright © 2002-2007 Computer and Web Design Forum