Klokjis Posted July 15, 2005 Report Share Posted July 15, 2005 reku lieta taada... http://paste.php.lv/2204 skriptinjsh ir ar registred_globals on... nesen saaku burties par PHP ar PHP booku pa LV... un bija tur taads skripc... bet kaut kaa nerekomendeejas tie registred globals - on... so vinju var uztjuuneet taa lai nebuutu lietotie r-globalie pie $m_arr[count($m_arr)]... te buutu varianc taads ka skripc pac nolasa foldera saturu un kur atrod gif u ar saakumaa m_ un tur meklee taadu pashu failu bet .inc un bez m_. a kaa kaut kaados normaalos saitos tiek taisiita automaatika? piem bez gif pogaam... kaa tiek noraadiiti .inc faili uz hyperlinka... ?! Link to comment Share on other sites More sharing options...
Delfins Posted July 15, 2005 Report Share Posted July 15, 2005 ak dievs. izlasiju un nesapratu. Link to comment Share on other sites More sharing options...
bubu Posted July 15, 2005 Report Share Posted July 15, 2005 Un man likās, ka es vienīgais tāds neattapīgs :blink: Link to comment Share on other sites More sharing options...
Delfins Posted July 15, 2005 Report Share Posted July 15, 2005 Un man likās, ka es vienīgais tāds neattapīgs :blink: 19392[/snapback] mega-romāns 6 sējumos uz vienas pus-lapas B) PS: virs topika veidošanas formas derētu sīki zrakstīt, kā jautāt pareizi. Link to comment Share on other sites More sharing options...
leisure Posted July 15, 2005 Report Share Posted July 15, 2005 Sho skritpu kk esmu redzeejis :))) Aptuveni tads bija (vai tieshi taads) Ziiverta rokas graamataa apr PHP... Link to comment Share on other sites More sharing options...
Klokjis Posted July 15, 2005 Author Report Share Posted July 15, 2005 nu jaa... :unsure: tas ir tas pac :D nu ideja taada bish vinju noredigejeet taa lai nevajadzeetu lietot registred_globals un lai nevajadzeetu gifus blakus inc failiem. a kaa piem. lielaakos saitos tiek taisiita sisteema - uz katru .inc diez vai ir gifs... so kaut kur pogas nosaukums glabaajas... vai arii pogas nosaukumus pac saraxta un kaa tad uz to pogu noraada mainiigaa ?id= veertiibu?! un kur tad atkal noraada ja id = 1, tad jaaliek attieciigais fails saturaa... ?! Link to comment Share on other sites More sharing options...
Delfins Posted July 15, 2005 Report Share Posted July 15, 2005 (edited) ergh... <?php $d_handle = opendir("."); $m_arr = Array(); while(($f_name = readdir($d_handle)) != false) { if( eregi('^m_.+\.gif$',$f_name) ) { $m_arr[] = $f_name; } } closedir($d_handle); sort($m_arr); foreach ($m_arr as $m_item) { preg_match( '/^m_(.+)\.gif$/i', $m_item, $m ); $m_item_id = $m[1]; print ('<p><a href="?id='.$m_item_id.'"><img src="'.$m_item.'" width="150" height="30" border="0"></a></p>'); } if (isset($_GET['id'])){ $file = $_GET['id'].'.inc'; if (file_exists($file) && is_file($file) ) { include $file; } } ?> PS: neizmanto .inc paplašinājumu. jālieto .php!! Edited July 15, 2005 by Delfins Link to comment Share on other sites More sharing options...
Delfins Posted July 15, 2005 Report Share Posted July 15, 2005 cik saprotu, tas ir MENU tipa ? vai tad nav ērtāk visu glabāt masīvā un indeksēt to masīvu, tikai tad kad kaut klas mainās? sanāk overkills - listdir, sort, print_menu (a pilnīgi pietiek ar vienkāršu print_menu) Link to comment Share on other sites More sharing options...
Klokjis Posted July 15, 2005 Author Report Share Posted July 15, 2005 a kaa tad iznaak ar address tur kas paraadaas? vnk nevajag lai paraadaas piem - viens.inc.php... vnk 4 security Link to comment Share on other sites More sharing options...
Delfins Posted July 15, 2005 Report Share Posted July 15, 2005 a kaa tad iznaak ar address tur kas paraadaas? vnk nevajag lai paraadaas piem - viens.inc.php... vnk 4 security 19438[/snapback] vai tad konkrētajā gadījumā tā nav ? tu kodu māki lasīt? Link to comment Share on other sites More sharing options...
Klokjis Posted July 15, 2005 Author Report Share Posted July 15, 2005 nu nez... ok nelec gljuki... adresee arii mainiigo id veertiibas mainaas... bet main logaa texc neparaadaas... a kaa piem tiek lietota liidziiga sisteema lielaakos saitos kur gif pogas neizmanto?! Link to comment Share on other sites More sharing options...
Delfins Posted July 16, 2005 Report Share Posted July 16, 2005 nu nez... ok nelec gljuki... adresee arii mainiigo id veertiibas mainaas... bet main logaa texc neparaadaas... a kaa piem tiek lietota liidziiga sisteema lielaakos saitos kur gif pogas neizmanto?! 19461[/snapback] http://php.lv/f/index.php?showtopic=2668&v...indpost&p=19397 Link to comment Share on other sites More sharing options...
Klokjis Posted July 18, 2005 Author Report Share Posted July 18, 2005 aa... superglobal $_GET lai atpaziitu kompis vajag buut Registred_globals = on? vnk man ir >> switch($_GET['id']) { ...<< un vinjsh noraada, ka "Undefined variable: _GET" Link to comment Share on other sites More sharing options...
bubu Posted July 18, 2005 Report Share Posted July 18, 2005 Nē, register_globals = off un tā tam ir palikt. $_GET vienmēr un visur jāredz. Iepriekš neesi izdzēsis/pārrakstījis to mainīgo? Link to comment Share on other sites More sharing options...
Klokjis Posted July 18, 2005 Author Report Share Posted July 18, 2005 (edited) Nee... 1.x scriptaa $_GET paraadaas: <?php switch($_GET['id']) { case "Jaunumi": include('jaunumi.inc.php'); break; case "Par Mani": include('parmani.inc.php'); break; default: include('jaunumi.inc.php'); break; } ?> Edited July 18, 2005 by Klokjis Link to comment Share on other sites More sharing options...
Recommended Posts