PHP

Ova skripta ce napraviti linkove od direktorijuma koji se nalaze tu gde je sama skripta…

<?php

$dirs = array();
$d= getcwd();
$x= scandir($d);

echo “<ul>”;

foreach ($x as $dir)
{
if (is_dir($dir) && $dir !=”.” && $dir != “..” && $dir != “direktorijumkojsenevidi”)

{
array_push($dirs,$dir);
echo ‘<li><a href=”.$dir.”>”.$dir.”</a></li>’;
}

}

echo “</ul>”;

?>

——————————————————————————————————————————–

funkcije.php

<?php

function ukljuci($fajl) {

ob_start();
include($fajl);
$s = ob_get_contents();
ob_end_clean();
return $s;

}

?>

—————————————————————————————————————————————-

index.php

<?php
header(“Cache-Control: no-cache”);
header(“Pragma: no-cache”);
require_once ‘funkcije.php’;
echo $bafer = ukljuci(‘putanja/do/fajla.php’);
?>

————————————————————————————————————————————–

video.php

<?php

if ($_SERVER[“REQUEST_METHOD”] == “POST”) {

?> 

<object width=”425″ height=”350″>
<param name=”movie” value=”http://www.youtube.com/v/&lt;?php echo $_POST[“YouTubeID”]; ?>”> </param> <embed src=”http://www.youtube.com/v/&lt;?php echo $_POST[“YouTubeID”]; ?>” type=”application/x-shockwave-flash” width=”425″ height=”350″> </embed> </object>

<?php

} else {

?>

<form method=”post” action=””>
YouTube ID: <input type=”text” name=”YouTubeID” />
</form>

<?php

}

?>

——————————————————————————————————————————

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: