Jump to content

Passing variable problem or not?


Dunce

Recommended Posts

Hi all!

 

I like to make a flash gallery which shows the folder names as links and if somebody clicks on a link then the flash gallery shows the images from the folder which was the link name (so for example: Link name is: 1st Folder then it sows the pictures from 1st Folder)

So my problem is that if i set the $actfolder fix (for example to "1") then it works fine and the flash shows the "1" folder's pictures, but if i change it to GET it from variable then the flash is not working :(

I hope it was clear, but i  attached the files i used for this; flash.php contains the flash gallery and test2.php is the xml generator script...

I hope you can help me out...

<?php
$actfolder = $_GET['foldername'];
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>"; 
echo "<pics>";

$path = "../php/gallery/$actfolder";
$folder = "/gallery/$actfolder/";

$directory= $_SERVER['HTTP_HOST'] .$_SERVER['PHP_SELF'];
$directory=dirname($directory);
$handle = opendir($path);
while($file = readdir($handle)) {
if(is_file("$path/$file")) {
	echo "<pic src=\"http://$directory$folder$file\" title=\"Gallery\" />";
    }
}
closedir($handle);

echo "</pics>";
?>

 

 

[attachment deleted by admin]

Link to comment
https://forums.phpfreaks.com/topic/182157-passing-variable-problem-or-not/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.