- Home
- Categorie
- Coding e Sistemistica
- PHP
- richimamo pagina pr variabile
-
richimamo pagina pr variabile
Ciao a tutti e scusate x il titolo
visto che sto studiando php, il libro alle volte sembra dire
vai su di un forum se non hai capitoho una pagina chiamata index.php
e una chiamata pippo.php
e una chiamata topolino.phpcon un ciclo for o while tiro fuori dei dati dal db
e formo un menu
il problema sta nel fatto che x richiamare le pagine di cui sopra
non so cosa devo mettere nell'href
anzi meglio dire, so che il tutto deve essere fatto tramite una variabile
xrò come si sa tra il dire e il fare c'è la foresta
[PHP]
<?php
//richiamo il file di configurazione
require 'Config.php';
//richiamo il file di connessione
require 'Connect.php';//creo la SELECT
$query="SELECT * FROM categorie ORDER BY descrizione";
//eseguo la query
$risultato=mysql_query($query);
if(!$risultato)
{
die("errore nella query;".mysql_error());
}
//chiudo la connessione
mysql_close();
?>
<html>
<head>
<title>TEMPLATE BY ALIBI74.IT</title>
<link rel="stylesheet" type="text/css" href="style.css">
<meta name="generator" content="Namo WebEditor v5.0">
</head>
<body leftmargin=0 topmargin=0 marginheight="0" marginwidth="0" bgcolor="#E6E6E6">
<table border="0" cellpadding="0" cellspacing="0" width="758" align="center">
<tr valign="top">
<td><img src="images/logo.gif" alt="" width="184" height="129" border="0"></td>
<td>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td colspan="2">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><img src="images/but01.gif" width="115" height="30" alt="" border="0"></td>
<td><img src="images/but02.gif" alt="" width="114" height="30" border="0"></td>
<td><img src="images/but03.gif" width="112" height="30" alt="" border="0"></td>
<td><img src="images/but04.gif" width="116" height="30" alt="" border="0"></td>
<td><img src="images/but05.gif" width="117" height="30" alt="" border="0"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td background="images/fon_top01.gif" colspan="2" height="37">
<table border="0" cellpadding="0" cellspacing="0" width="100%" background="">
<tr>
<td><p class="menu01"><a href=""><img src="images/e01.gif" width="8" height="7" alt="" border="0"> Company history</a></p></td>
<td><p class="menu01"><a href=""><img src="images/e01.gif" width="8" height="7" alt="" border="0"> Executives management</a></p></td>
<td><p class="menu01"><a href=""><img src="images/e01.gif" width="8" height="7" alt="" border="0"> Contact Info</a></p></td>
<td><p class="menu01"><a href=""><img src="images/e01.gif" width="8" height="7" alt="" border="0"> Our Partners</a></p></td>
<td><p class="menu01"><a href=""><img src="images/e01.gif" width="8" height="7" alt="" border="0"> Contacts</a></p></td>
</tr>
</table>
</td>
</tr>
<tr>
<td><img src="images/form01.gif" width="341" height="22" alt="" border="0"></td>
<td><img src="images/form02.gif" width="233" height="22" alt="" border="0"></td>
</tr>
<tr>
<form action="" method="post">
<td height="40" background="images/form03.gif" width="341" alt="" border="0" align="center">
<input type="Text" name="" value=" USERNAME" size="10">
<input type="Text" name="" value=" PASSWORD" size="10">
<input type="image" src="images/b_login.gif" width="79" height="20" alt="" border="0" align="absbottom">
</td>
</form>
<td background="images/form04.gif" width="233" height="40">
<table border="0" cellpadding="0" cellspacing="0" width="100%" background="">
<tr align="center">
<td><p style="color: #FFFFFF; font-size: 10px;"><b>TOTAL<br>$11500,00</b></p></td>
<td><a href=""><img src="images/b_vew.gif" width="79" height="20" alt="" border="0"></a></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="758" align="center">
<tr valign="top">
<td width="185" background="images/fon_left03.gif">
<table border="0" cellpadding="0" cellspacing="0" background="images/fon_left01.gif" width="100%">
<tr>
<td align="right">
<table border="0" cellpadding="0" cellspacing="0" width="165" background="images/fon_left02.gif">
<tr>
<td background="images/left01.gif" height="26"><p class="title">NAVIGAZIONE</p></td>
</tr>
<?php
//while($riga=mysql_fetch_array($risultato,MYSQL_ASSOC))
$num_ris = mysql_num_rows($risultato);
for($x=0; $x<$num_ris; $x++)
{
print"
<tr>";
print"
<td><p class='b01'>
<img src='images/e02.gif' width='6' height='5' border='0' align='absmiddle'>
<a href=''>".mysql_result($risultato,$x,'descrizione')."</a></p>
<div align='center'><img src='images/hr01.gif' width='137' height='3' border='0'></div>
</td>";
print"
</tr>";
}
?>
[/PHP]da dove cominciare?
grazie tante
-
Ma è lo stesso dell'altro thread... perchè non continui di là? archiviamo un problema e passiamo a quello dopo...
keiske
-
scusa pensavo che risolto uno poi si chiudeva
scusamiciao
-
ragazzi almeno un inizio
sto sciumunen (diventando scemo)grazie ciao da danny