DoctorTom 0 Newbie Poster

hi guys

I may say thanks to ardav for his work with this thread and sorry because I was not able to explain myself.

I am going to explain everything more simple. I wrote below some code where it will show a drop down menu with a submit button. Then, How can I make it work?

<html>
<body>

<select>
  <option>Volvo</option>
  <option>Saab</option>
  <option>Mercedes</option>
  <option>Audi</option>
</select>
 <input type="submit" />
</body>
</html>

Thank you


DT

DoctorTom 0 Newbie Poster

Hi ana12!!

thank you and I'll see you around

DoctorTom 0 Newbie Poster

I will show what I did below.

search.php

<!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=utf-8" />
<title>search.php</title>
</head>

<body>
<form id="fmsearch" name="fmsearch" method="get" action="/webroot/phptesting/search_result.php">
<table width="200" border="1">
<tr><td><select name="title" id="title">
	<option selected="selected">Choose one...</option>
 	<option value="1">Yes</option>
 	<option value="0">No</option></select></td>
    <td><input type="button" name="Submit" id="Submit" value="Search" /></td></tr>
</table></form>
</body>
</html>

search_result.php

<?php require_once('Connections/search_db.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}
$title = 0;
$colname_rs83 = "-1";
if ($_POST['title'] == '1') title = 1 {$colname_rs83 = $_POST['title'];}
$colname_rs83 = "-1";
if ($== '1') {$imgsrc = "http://www.pixeldigest.com/images/phpsitesearch/lcd2.gif";}
else{$imgsrc = "http://www.pixeldigest.com/images/phpsitesearch/tv23.gif";} 

mysql_select_db($database_search_db, $search_db);
$query_rs83 = sprintf("SELECT * FROM table1 WHERE tb_name LIKE %s OR tb_desc LIKE %s ", GetSQLValueString("%" . $colname_rs83 . "%", "text"),GetSQLValueString("%" . $colname_rs83 . "%", "text"));
$rs83 = mysql_query($query_rs83, $search_db) or die(mysql_error());
$row_rs83 = mysql_fetch_assoc($rs83);
$totalRows_rs83 = mysql_num_rows($rs83); ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD …
DoctorTom 0 Newbie Poster

hi guys,

I think that I am getting the idea of this, however, I think that something is not working. I tried everything that everyone said, but, my database is not right.

I have SQL Manager for MySQL to create databases. So, imagine that on my drop down menu you select "yes" it will show after submit one image if you select "no" another different image. My database that I did is like you can see on pixeldigest.com

Thanks


DT

DoctorTom 0 Newbie Poster

Hi mackone!!

Thanks for your welcome I really apreciate it.

DoctorTom 0 Newbie Poster

Hi guys,

I wrote below the html code of my drop down menu, ok.
Then, what is missing (it is what I don't know to do) is how to make it work.

So, ardav (thanks for your replies), what I exactly need is how I do work the submit button on my drop down menu. How is the php code in the results php file and how should be the database.

I hope this explanation can help to understand what I want.

<body>
<form method="get" action="">
<table width="250" class="form" id="tablemargin">
<tr><td class="textright"><label for="dropmenu1"><p>dropmenu1</p></label></td>
<td><select class="text" name="dropmenu1">
<option selected="selected">Choose one...</option>
<option>Yes</option>
<option>No</option>
<option>I don't care</option>
</select></td></tr>
<tr><td class="textright"><label for="dropmenu2"><p>dropmenu2</p></label></td>
<td><select class="text" name="dropmenu2">
<option selected="selected">Choose one...</option>
<option>Yes</option>
<option>No</option>
<option>I don't care</option>
</select></td></tr>
<tr><td class="textright"><label for="dropmenu3"><p>dropmenu3</p></label></td>
<td><select class="text" name="dropmenu3">
<option selected="selected">Choose one...</option>
<option>Yes</option>
<option>No</option>
<option>I don't care</option>
</select></td></tr>
<tr><td class="textright"><label for="dropmenu4"><p>dropmenu4</p></label></td>
<td><select class="text" name="dropmenu4">
<option selected="selected">Choose one...</option>
<option>Yes</option>
<option>No</option>
<option>I don't care</option>
</select></td></tr>
<tr><td class="textright"><label for="dropmenu5"><p>dropmenu5</p></label></td>
<td><select class="text" name="dropmenu5">
<option selected="selected">Choose one...</option>
<option>Yes</option>
<option>No</option>
<option>I don't care</option>
</select></td></tr>
<tr><td class="textright"><label for="dropmenu6"><p>dropmenu6</p></label></td>
<td><select class="text" name="dropmenu6">
<option selected="selected">Choose one...</option>
<option>Yes</option>
<option>No</option>
<option>I don't care</option>
</select></td></tr>
<tr><td class="textright"><label for="dropmenu7"><p>dropmenu7</p></label></td>
<td><select class="text" name="dropmenu7">
<option selected="selected">Choose one...</option>
<option>Yes</option>
<option>No</option>
<option>I don't care</option>
</select></td></tr>

DoctorTom 0 Newbie Poster

Hi guys!

Thanks for answer so fast.

Firstly, let's answer to everyone with a better explanation.


I already did a search bar with help from pixeldigest.com.

What I would like to know is instance of a search bar, do a drop down menu like this one www.plus2net.com (even a simple one, it should be right for me).

Correct me if I am wrong, but, I consider that to do this, I will need to do a database conected to php file which is sending back from the server, and obviously another php or htm file where is my form and the rest of my website, I guess.

It is quite hard to do this for someone who doen't know too much, however, it will better after all.

Thanks guys


DT

DoctorTom 0 Newbie Poster

Hi,

I am bulding my own website and I would like to have a drop down selected menu on there.
I would like to do it, creating a database on mySQL connected to a php file to show the results. However, I am not sure if what I wrote above is right because my acknowledges on this issue are not enough.

Thanks for reading my thread and hope hearing from you soon.


DT

DoctorTom 0 Newbie Poster

Hi, people!!!!

This is my first thread which I do to intoduce myself.

Name: Tomas
Nickname: Doc, Tom
Height: 1,75 m
Weight: ?
Hair: Brown
Eyes: Brown
Location: Cambridge, UK
Age: 26
Hobbies: Listening to music, drawing, going out with friends and family, movies and everything about science.

Relationship Status: single

Fav Music: it is awkfull to explain

Education: NONE...

Work: uptodate in a supermarket

Favorite Movies: Greece, Die Hard (all of them) and Forest Gump.

Favorite TV Shows: Friends, House, Mentalist, The Simpsons and Letterman.

Favorite Video Games: Comandos and Diablo.

Stuff you Dislike: Rough people.