salve a tutti e innanzitutto grazie, ho tre file php nel mio ftp, il primo è l'index che è fatta in questo modo:
codice:
<?php
include "init.php";
include_once('tbs_class.php');
$TBS = new clsTinyButStrong;
?>
<html>
<head>
<title>B2BMOMO</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<link rel="stylesheet" href="/include/css/bootflat.min.css">
<link rel="stylesheet" href="/include/css/app.css">
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/s/bs/pdfmake-0.1.18,dt-1.10.10,af-2.1.0,b-1.1.0,b-colvis-1.1.0,b-html5-1.1.0,b-print-1.1.0,cr-1.3.0,fc-3.2.0,fh-3.1.0,kt-2.1.0,r-2.0.0,rr-1.1.0,sc-1.4.0,se-1.1.0/datatables.min.css"/>
</head>
<body>
<div align="center">ELENCA TABELLE PRESENTI NEL DB</div>
<form method="post" action="estraitabelle.php" style="text-align: center;">
<INPUT type="submit" value="Invia">
<br><br>
</form>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
<script src="/include/js/bootstrap-contextmenu.js"></script>
<script type="text/javascript" src="/include/js/bootflat.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/s/bs/pdfmake-0.1.18,dt-1.10.10,af-2.1.0,b-1.1.0,b-colvis-1.1.0,b-html5-1.1.0,b-print-1.1.0,cr-1.3.0,fc-3.2.0,fh-3.1.0,kt-2.1.0,r-2.0.0,rr-1.1.0,sc-1.4.0,se-1.1.0/datatables.min.js"></script>
</body>
</html>
il secondo script php è una query mysql chiamata estraitabelle.php che viene eseguita dentro all'index al click di un bottone, che mi mostra tutte le tabelle presenti nel db fatta in questo modo:
Codice PHP:
<?php include "include/init.php"; // VISUALIZZA TABELLE PRESENTI NEL DATABASE $query = "SHOW tables FROM $db_name"; if (mysql_query($query)) { echo "Lista delle tabelle nel db"; } else { echo "Errore: ". mysql_error(); }?>
in init.php invece c'è la connessione al db e altre cose
a me servirebbe un modo per fare la query di estraitabelle.php direttamente nell'index facendo un if di questo tipo se ci sono dati in post allora esegue la query direttamente nell'index altrimenti no, e poi mi servirebbe un modo per spostare la parte di html presente in index, all'interno di un template http://www.tinybutstrong.com/ di questo tipo, e non ho idea di come fare, grazie dell'aiuto