bonjour voila ma source
Code HTML :
<html>
<head>
<title>Enregistreur de lien</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<script type="text/javascript">
function hideObj(o){
obj = document.getElementById(o);
if (obj.style.visibility=="hidden" )
obj.style.visibility = "visible";
else if (obj.style.visibility=="visible" )
obj.style.visibility = "hidden";
}
</script>
<body bgcolor="#000000" text="#ffffff">
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<form name="form" method="post" action="">
<p align="center"><font size="5">
<input type="text" name="lien" size="100" value="http://www.skyrock.com/chat/chat20080110/popup.php" style="width:100px;height:22px;visibility:hidden">
</font></p>
<div align="center">
<input type="submit" name="Submit" value="enter" onClick="generer();">
<br>
<script>
function generer()
{
var str1 = document.forms.form.lien.value;
document.write('<body bgcolor="#000000" text="#ffffff"><p align="center"><br><br><br><br><br><font size="5"><a href="'+str1+'">ICI</a> ');
document.write(''};
</script>
</div>
</form>
</body>
</html>
enfaite je vourdrai incorporé dans cette fonction
function generer()
{
var str1 = document.forms.form.lien.value;
document.write('<body bgcolor="#000000" text="#ffffff"><p align="center"><br><br><br><br><br><font size="5"><a href="'+str1+'">ICI</a> ');
document.write(''};
se code php pour qu'il me laffiche dans la méme page pour utiliser le +str1+
Code PHP :
<?php
if (!empty($_POST['url']))
{
foreach ($_POST['url'] as $url)
{
if (!empty($url))
{
$path_parts = pathinfo($url);
set_time_limit (0);
$nom = preg_replace("#([^\w.\-_ ])#Ssi","_",$path_parts["basename"]);
$a = copy($url,"/home/batlynds/web/www/".$nom);
echo 'site en construction<br />';
}
else
{
echo 'Upload impossible';
}
}
}
$max = empty($_GET['max']) ? 1 : $_GET['max'];
echo '<form method="post">'."\n";
for ($i=1;$i<=$max;$i++) {
echo '<input type="text" size="100" value="+str1+" name="url[$i] "style="width:100px;height:22px;visibility:hidden"><br />';
}
<?php');
<br /><input type="submit" value="afficher">
</form>
</p>