Quote:
ok this is my code, the first code is a code for my first form, second code is for my second form and the last si for my third form
[HTML]<html>
<head>
<title></title>
</head>
<body>
<h5><u>Input Journal Name you want to search:</u></h5>
<form action = second.php method = "POST">
<p style="background-color:lavender;padding:10px;width=10%">
<input type = "text" name= "box"/><p>
<p><input type = "submit" value = "Enter"/>
<input type = "reset" value = "Clear"/></p>
</form>
</body>
</html>
[/HTML]
[PHP]<?php
$text = $_POST["box"];
$out = strtok($text, " ");
$sep = " ";
while ($out !== false)
{
$sep = $sep." (TI + ISSN + ID + CY) Like '%$out%'";
$out = strtok(" ");
if ($out !== false)
{
$sep = $sep. " AND ";
}else{
$sep = $sep. "";
}
}
$sql="SELECT MSNEW.ID, MSNEW.UI, MSNEW.GID, MSNEW.IID, MSNEW.TI, MSNEW.TIYOMI, MSNEW.ORGYOMI, MSNEW.CY, MSNEW.PU, MSNEW.YR, MSNEW.ISSN, MSNEW.ACRONYM, MSNEW.ABBREVIATION, MSNEW.NOTE, MSNEW.VTI, MSNEW.VTI2, MSNEW.VTI3 FROM MSNEW WHERE".$sep;
//$sql2 = "INSERT INTO WebOrderTest (YR, Vol, Issue, Spage, Epage, Author, Subj) VALUES (' ".$_COOKIE["PHPSESSID"]." ',' ".$_POST["YR"]." ',' ".$_POST["Vol"]." ', ' ".$_POST["Issue"]." ',' ".$_POST["Spage"]." ',' ".$_POST["Epage"]." ',' ".$_POST["Author"]." ',' ".$_POST["Subj"]." ')";
echo $sql."</BR>";
//echo "<align = \"center\">";
echo "<p align= center style=\"background-color:lavender;padding:8px;width=5 0%\">";
echo "Result for <b><u> $text </u></b></p>";
$res = ExecInforestaQuery($sql);
$x=0;
while($rec = odbc_fetch_array($res))
{
$ID=$rec['ID']." / ";
$TI=$rec['TI']." / ";
$CY=$rec['CY']." / ";
$ISSN=$rec['ISSN'];
// $output = explode(" ", $ID, $TI, $CY, $ISSN);
echo"<form action=\"third.php\" method=\"POST\">";
echo"<input name=\"ID[]\" type=\"radio\" id=\"ID[]\" value=\"".$ID, $TI, $CY, $ISSN. "\">".$ID, $TI, $CY, $ISSN."<br/>";
$y=0;
$Count=0;
while($x>$y)
{
if ($a[$y][0]==$out)
{
$a[$y][1]=$a[$y][1]+1;
$Count=1;
}
$y=$y+1;
}
if ($Count==0)
{
$a[$x][0]=$out;
$a[$x][1]=1;
$x=$x+1;
}
}
$X=0;
while($X<$x)
{
$X=$X+1;
}
echo "<p><input type=\"submit\" value=\"Enter\" /></p>";
odbc_free_result($res);
function db_connect_ctlg(){
$conn = odbc_connect("sys_foresta_ctlg", "sa", "");
if (!$conn) {
return NULL;
}else{
return $conn;
}
}
function ExecInforestaQuery($query){
$Set =db_connect_ctlg();
if (!$Set){
echo "DB Connect Failer!!<BR>";
return NULL;
}else{
$query_result = odbc_exec($Set,$query);
if (!$Set){
echo "Query Failer!!<BR>";
return NULL;
}else{
return $query_result;
}
}
}
?>
[/PHP]
[PHP]<?php
if(isset($_POST['ID']))
{
$e=$_POST['ID'];
$h=count($e);
$c=0;
$a = " ";
while($c<$h)
{
echo "<p align= center style=\"background-color:lavender;padding:8px;width=5 0%\"><b><u>";
$a = $a.$e[$c] ."</b></u>";
$c++;
}
}
?>
[/PHP]
Quote:
i want to display in the third form the result of the details that i've typed in textbox but it cannot be happen