paparanch Posted June 18, 2008 Share Posted June 18, 2008 wazup guyz! i have another problem regarding varaibles...how could i pass the value of a variable from one php to another external php file without any form? well, this is the situation....i have here the code from my gallery.php...and i wanted to pass the variable $file to get the filename of every picture i have in my folder.... //code from gallery.php <?php Header("content-type: application/x-javascript"); function returnimages($dirname=".") { $pattern="\.(jpg|jpeg|png|gif|bmp)$"; $files = array(); $curimage=0; if($handle = opendir($dirname)) { while(false !== ($file = readdir($handle))){ if(eregi($pattern, $file)){ $filedate=date ("M d, Y H:i:s", filemtime($file)); echo 'galleryarray[' . $curimage .']=["' . $file . '", "'.$filedate.'"];' . "\n"; $curimage++; } } closedir($handle); } return($files); } echo "var galleryarray=new Array();" . "\n"; returnimages(); ?> Link to comment https://forums.phpfreaks.com/topic/110703-pass-variable-from-one-php-file-to-another-without-using-formpls-help/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.