jam Posted August 11, 2005 Report Share Posted August 11, 2005 Ir šāda probza: divi variabi $dir = $_SERVER['DOCUMENT_ROOT'] . '/usr_img/-PORTFOLIO-/'.$dira; $dir2 = $_SERVER['SERVER_NAME'] . '/usr_img/-PORTFOLIO-/'.$dira.'/'; function thumb($dir,$img, $wt, $ht, $resize) { $file=$dir.$img; //šito $dir redz $file2=$dir2.$img; // šito $dir2 neredz } Ja variablis definēts "ārpus" funkcijas, tad iekšā to dabūt nevar ar vienkāršiem paņēmieniem? Link to comment Share on other sites More sharing options...
MC_ Posted August 11, 2005 Report Share Posted August 11, 2005 (edited) $dir = $_SERVER['DOCUMENT_ROOT'] . '/usr_img/-PORTFOLIO-/'.$dira; $dir2 = $_SERVER['SERVER_NAME'] . '/usr_img/-PORTFOLIO-/'.$dira.'/'; function thumb($dir,$img, $wt, $ht, $resize) { global $dir, $dir2; $file=$dir.$img; //šito $dir redz $file2=$dir2.$img; // šito $dir2 neredz } No funkcijas parametriem liidzar to nonjem $dir function thumb($img, $wt, $ht, $resize) Edited August 11, 2005 by MC_ Link to comment Share on other sites More sharing options...
Recommended Posts