Salve a tutti,ho letto l'articolo .....XML-RPC: far dialogare server e programmi con PHP
e anche l'altro articolo...Php, Socket e HTTP (articolo completo).
Ho questo problema e vi sarei molto grato se mi deste una mano.
Ho questo script che sul mio sever funziona ma che voglio far funzionare da remoto su di un sito presente su un'altro server, come posso fare?
Come dovrebbereo essere(mi fate vedere) gli script lato client e lato server per far funzionare questo script.
avete altre soluzioni da proporre, se si quali(faccio presente che il server sql accetta solo "localhost")?
<?
$destinazione="public/downz/";
$sql_new="select * from downz where name_downz";
if($HTTP_POST_VARS['azione']=="S")
{
//echo "entrato";
$y=0;
$where="";
for($j=0;$j<$HTTP_POST_VARS['nr_valute'];$j++)
{
if($HTTP_POST_VARS[$j]!="")
{
//$a=$j*2;
$a=($j*2)+1;
$b=$j+2;
if($y>0){$where.=" and ";}
//$where.="substr($a,$b,$j)";
//$where.="substring(name_downz,$a,2)='".$HTTP_POST_ VARS[$j]."'";
$nome.=$HTTP_POST_VARS[$j];
if($y==0){
$sql_new.=" like '%".$HTTP_POST_VARS[$j]."%'";
}
else {
$sql_new.=" and name_downz like '%".$HTTP_POST_VARS[$j]."%'";
}
$y++;
}
}
if($HTTP_POST_VARS['nr_valute']>0) {
$where="name_downz='".$nome.".".$exte."'";
}
/*if($exte!="")
{
if($y>0){$where.=" and ";}
$where.="exte='".$exte."'";
}
*/
$sql_search="select * from downz";
if($where!=""){$sql_search=$sql_search." where ".$where;}
$sql_new.=" and name_downz like '%.".$HTTP_POST_VARS['exte']."'";
$numero=($HTTP_POST_VARS['nr_valute']+1
)*3;
if ($HTTP_POST_VARS['exte'] == "dm")
{
$numero = $numero - 1;
//echo $HTTP_POST_VARS['exte'];
}
$sql_new.=" and LENGTH(name_downz) = ".$numero."";
//echo 'Nuova :'.$sql_new;
// if($exe_query_search=mysql_query($sql_se
arch))
if($exe_query_search=mysql_query($sql_n
ew))
{
echo "<table cellspacing=0 cellpadding=0 border=0 width='80%' align=center>";
if(mysql_num_rows($exe_query_search)>0)
{
while($rw_sr=mysql_fetch_array($exe_q
uery_search))
{
echo "<script>x = window.setInterval(\"doBlink()\", 500);</script>";
echo "<tr height=20><td colspan=3 align=center></td></tr>";
echo "<tr><td colspan=\"3\" align=\"center\" class=\"style4\" ><div id=\"blink\" style=\"color:#0000FF\">Clicca qui!</div></td></tr>";
echo "<tr onclick='location.href=\"public/downz/".$rw_sr['name_downz']."\"' bgcolor=#F1F1F1 class=\"style3\"><td>".$rw_sr['name_downz']."</td><td>".filesize($destinazione.$rw_sr['name_downz'])." byte</td><td width=1>[img]../images/downz.gif[/img]</td></tr>";
echo "<tr><td height=15></td></tr>";
echo "<tr><td height=5 colspan=3><hr width=\"50%\"></td></tr>";
echo "<tr><td height=1></td></tr>";
}
}
else
{
echo "<tr height=20><td colspan=3 align=center></td></tr>";
echo "<tr><td height=4 colspan=3 align=center>[b]<font size=2 color=red face=verdana>La seguente ricerca non ha dato nessun risultato</font></td></tr>";
}
echo "</table>";
//}else{echo $sql_search." ".mysql_error();}
}else{echo $sql_new." ".mysql_error();}
}
/* Sezione recupero data file inseriti */
/*
$sql1 = "select max(id_downz) as massimo from downz";
$eseguo_query = mysql_query($sql1);
$risultato = mysql_fetch_array($eseguo_query);
$risultato = $risultato['massimo'];
$sql2 ="select name_downz from downz where id_downz = \"".$risultato."\" ";
$eseguo_query = mysql_query($sql2);
$risultato = mysql_fetch_array($eseguo_query);
$risultato = $risultato['name_downz'];
$filename = "public/downz/".$risultato;
if (file_exists($filename)) {
$data = date ("F d Y ", filemtime($filename));
}
*/
$file = "public/downz/eu.bin";
if (file_exists($file)) {
$data_eu = date ("d/m/Y ", filemtime($file));
}
$file = "public/downz/us.bin";
if (file_exists($file)) {
$data_us = date ("d/m/Y ", filemtime($file));
}
$file = "public/downz/gb.bin";
if (file_exists($file)) {
$data_gb = date ("d/m/Y ", filemtime($file));
}
$file = "public/downz/ch.bin";
if (file_exists($file)) {
$data_ch = date ("d/m/Y ", filemtime($file));
}
$file = "public/downz/ye.bin";
if (file_exists($file)) {
$data_ye = date ("d/m/Y ", filemtime($file));
}
$file = "public/downz/au.bin";
if (file_exists($file)) {
$data_au = date ("d/m/Y ", filemtime($file));
}
$file = "public/downz/ca.bin";
if (file_exists($file)) {
$data_ca = date ("d/m/Y ", filemtime($file));
}
$file = "public/downz/si.bin";
if (file_exists($file)) {
$data_si = date ("d/m/Y ", filemtime($file));
}
$file = "public/downz/ru.bin";
if (file_exists($file)) {
$data_ru = date ("d/m/Y ", filemtime($file));
}
$file = "public/downz/se.bin";
if (file_exists($file)) {
$data_se = date ("d/m/Y ", filemtime($file));
}
$file = "public/downz/mx.spa";
if (file_exists($file)) {
$data_mx = date ("d/m/Y ", filemtime($file));
}
$file = "public/downz/cu.spa";
if (file_exists($file)) {
$data_cu = date ("d/m/Y ", filemtime($file));
}
$file = "public/downz/no.bin";
if (file_exists($file)) {
$data_no = date ("d/m/Y ", filemtime($file));
}
$file = "public/downz/dk.bin";
if (file_exists($file)) {
$data_dk = date ("d/m/Y ", filemtime($file));
}
$file = "public/downz/ni.bin";
if (file_exists($file)) {
$data_ni = date ("d/m/Y ", filemtime($file));
}
$file = "public/downz/rp.bin";
if (file_exists($file)) {
$data_in = date ("d/m/Y ", filemtime($file));
}
$file = "public/downz/eu-ba.ita";
if (file_exists($file)) {
$data_ba = date ("d/m/Y ", filemtime($file));
}
?>
<form action="search_downz.php" name="down" method="post">
....................
.
continua cmq. si inseriscono dati in questo form ed in base ad essi lo script restituisce un file da scaricare....CHIARO?
GRAZIE INFINITE PER L'ATTENZIONE.