You are here: Help with $PHP_SELF « PHP Programming Language « IT news, forums, messages
Help with $PHP_SELF

Posted by zek2005 on 10/17/69 11:35

Hi!!!

I need to retrieve the information of a database in 2 steps. First,
depending on the number of a branch, I have to show in a combo the
commercial campaigns available for that branch. Then when the user
select one campaign I need to chow the customers of that campaign.

I have two errors
(http://www.historiadelpais.com.ar/bp/acciones_vigentes.php).

First: As I do not have the second variable when I load the page I
receive the first error.
Second: When I enter a branch (example: 17 or 20), the combo box works
but when I try to retrieve the customers I have another error.

Thak you for your help!!!!

Zek

This is the code:

<html>
<head>
<title>Clientes</title>
</head>
<body>
<p align="center"><u><b>Acciones Vigentes</b></u></p>
<form method="POST" action="<?=$PHP_SELF?>">
<p align="center"><b><font face="Tahoma"
size="2">Sucursal&nbsp;&nbsp;&nbsp;&nbsp;
</font></b><input type="text" size="6" name
="suc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="submit" value="Ingresar"></p>
</form>

<?PHP

$dbase = mysql_connect("localhost", user , pass);
mysql_select_db(historia,$dbase);

$respuesta = mysql_query("SELECT distinct codigo, descripcion
FROM `det_acciones`
INNER JOIN acciones
ON acciones.accion = det_acciones.codigo
WHERE oficial_id =$suc", $dbase);
?>
<form method="POST" action="<?=$PHP_SELF?>">
<select name="campania">

<?PHP

printf("<option selected value=\"\"> Seleccionar Acción
</option>");
while($row = mysql_fetch_array($respuesta))
{
printf("<option value=\"%s\"> %s
</option>",$row["codigo"],$row["descripcion"]);
}

?>
</select>
<input type="submit" value="Ver clientes">
</form>

<?PHP
$response = mysql_query("SELECT nombre
FROM `acciones`
WHERE oficial_id =$suc and accion=$campania", $dbase);

while($row = mysql_fetch_array($response))
{
echo($row[nombre]);
}
?>

</body>
</html>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация