Ciao!
Ho questo codice. si avvia e fa il suo dovere quando viene aperta la pagina.
Come posso fare a farlo attivare tramite pulsante?
Cioe: apro la pagina vedo un botone ci clicco e lo script si attiva..
Codice PHP:
<?
$name = getparam("name", PAR_POST, SAN_FLAT);
$description = getparam("description", PAR_POST, SAN_FLAT);
$add = getparam("addmember", PAR_POST, SAN_FLAT);
$remove = getparam("remove", PAR_POST, SAN_FLAT);
$locked = getparam("locked", PAR_POST, SAN_FLAT);
$string = get_file("misc/groups/1.xml");
$name = get_xml_element("name",$string);
$description = get_xml_element("description",$string);
$mem = get_xml_element("members",$string);
$mem = $mem."caxxo".",";
$locked = get_xml_element("locked",$string);
if($remove != "")
{
$remove = $remove.",";
}
$mem = str_replace($remove,"",$mem);
$found = false;
for($i = 0; $i < count($array); $i++)
{
if($add == $array[$i])
{
$found = true;
}
}
$write = "<name>$name</name>\n";
$write .= "<description>$description</description>\n";
$write .= "<members>$mem</members>\n";
$write .= "<locked>$locked</locked>\n";
fnwrite("misc/groups/1.xml", $write, "w", array("nonull"));
if(isset($_GET['mod']))
{
$modname = getparam("mod",PAR_GET,SAN_FLAT);
}
echo "<div style=\" width: 100%; border: 1px solid #00FF00;\">
";
echo "<center>[b]Modifica avvenuta con successo![/b]</center>
</div>";
// echo"<a href=\"index.php?mod=$modname&id=$id\"></a><meta http-equiv=\"Refresh\" content=\"2; URL=index.php?mod=$modname&id=$id\">";
?>