PHP קוד:
<form method="POST">
<input type="hidden" name="post" value="1">
<input name="url" size="26"> <input type="submit" value="Shortcut >>">
</form>
<?php
if($_POST['post'] == "1") {
$rand = rand(1111, 9999);
mkdir("$rand", 0777);
$url = $_POST['url'];
$myFile = "/$rand/index.html";
$fh = fopen($myFile, 'w') or die("can't open file");
$stringData = "
<html> <script>location.href='$url'</script> </html>
";
fwrite($fh, $stringData);
fclose($fh);
}
?>
זה נותן שגיאה כזאת:
ציטוט:
Warning: fopen() [function.fopen]: open_basedir restriction in effect. File(/8947/index.html) is not within the allowed path(s): (/home/startzero/:/tmp:/usr/local/lib/php/) in /home/startzero/domains/startzero.net/public_html/u/url.php on line 15
Warning: fopen(/8947/index.html) [function.fopen]: failed to open stream: Operation not permitted in /home/startzero/domains/startzero.net/public_html/u/url.php on line 15
can't open file
|