gingerfish Posted July 19, 2011 Report Share Posted July 19, 2011 Sveiki! Vai kāds man lūdzu pateiktu, kāds kods ir vajadzīgs, lai es varētu piem. lapā nr.1, ielikt lapas nr.6 saturu... Atceros, ka bija kautkas ar include kodu, tikai neatceros kā un kas bija jāraksta! P.s Esmu iesācējs, tapēc varētu izlkausīties mazliet aplami, taču ceru, ka domu sapratāt! Quote Link to comment Share on other sites More sharing options...
briedis Posted July 19, 2011 Report Share Posted July 19, 2011 http://php.net/manual/en/function.include.php Quote Link to comment Share on other sites More sharing options...
gingerfish Posted July 19, 2011 Author Report Share Posted July 19, 2011 http://php.net/manual/en/function.include.php Paldies! Quote Link to comment Share on other sites More sharing options...
daGrevis Posted July 19, 2011 Report Share Posted July 19, 2011 Apsver domu lietot require(), en include(). Quote Link to comment Share on other sites More sharing options...
gingerfish Posted July 21, 2011 Author Report Share Posted July 21, 2011 Apsver domu lietot require(), en include(). Ar ko require atšķiras no include? Quote Link to comment Share on other sites More sharing options...
waplet Posted July 21, 2011 Report Share Posted July 21, 2011 ja require failo, tad viss webs feilo, ja include feilo, tad webs turpina darboties uzrādot erroru Quote Link to comment Share on other sites More sharing options...
daGrevis Posted July 21, 2011 Report Share Posted July 21, 2011 ja require failo, tad viss webs feilo, ja include feilo, tad webs turpina darboties uzrādot erroru Khmmhmharggh. Tikai otrādāk. Uzskatu, ka jebkurš fails, kas tiek pieprasīts, ir svarīgs! Ja kāds fails tomēr neeksistē, bet lapa turpina darboties bez tā, Tu - nemanot, pakļauj lapu ievaonotībām. Quote Link to comment Share on other sites More sharing options...
xPtv45z Posted July 21, 2011 Report Share Posted July 21, 2011 Nezinu gan, ja tas ir, piemēram, kaut kāds include('gribu_lai_mana_lapa_rada_laika_zinas.php'); tad nekas briesmīgs arī nebūtu, ja šis nofeilo, lietotāji pie pārējās informācijas tiek. Quote Link to comment Share on other sites More sharing options...
daGrevis Posted July 21, 2011 Report Share Posted July 21, 2011 Tas pēc idejas nav pieņemami, ka kāda daļa no lapas nav pieejama - kamēr pārējās ir. Pēc Manām domām, protams. Quote Link to comment Share on other sites More sharing options...
Grey_Wolf Posted July 22, 2011 Report Share Posted July 22, 2011 Tas pēc idejas nav pieņemami, ka kāda daļa no lapas nav pieejama - kamēr pārējās ir. Pēc Manām domām, protams. nu ja tiešām tās ir laika zīņas tad savādāk, bet starp require() un include() ir pāris stipri būtiskas atšķirības Ja nav ar require() izsaucamais fails, td buus fatal errors , include gadijumā tikai warning vel ir tāda atšķirība ka include var veikt Return() darbības. // Handling Returns: It is possible to execute a return() statement inside an included file in order to terminate processing in that file and return to the script which called it. Also, it's possible to return values from included files. You can take the value of the include call as you would a normal function. This is not, however, possible when including remote files unless the output of the remote file has valid PHP start and end tags (as with any local file). You can declare the needed variables within those tags and they will be introduced at whichever point the file was included. // reguire() to nepieļauj --- Quote Link to comment Share on other sites More sharing options...
daGrevis Posted July 22, 2011 Report Share Posted July 22, 2011 Vai tad? foo.php: $x = require('bar.php'); echo $x['a']; bar.php: return array('a' => 'Hello, world!'); Quote Link to comment Share on other sites More sharing options...
marcis Posted July 22, 2011 Report Share Posted July 22, 2011 @Grey_Wolf tas tā ir kaut kādā tāvā sevišķajā php versijā vai varbūt php3 tā bija? :) Vispār palasam manuāli: http://php.net/require require() is identical to include() except upon failure it will also produce a fatal E_COMPILE_ERROR level error. In other words, it will halt the script whereas include() only emits a warning (E_WARNING) which allows the script to continue. Quote Link to comment Share on other sites More sharing options...
mad182 Posted July 22, 2011 Report Share Posted July 22, 2011 Lapas darbībai kritiskiem failiem require, mazsvarīgiem include. Katram ir sava vieta. Quote Link to comment Share on other sites More sharing options...
daGrevis Posted July 22, 2011 Report Share Posted July 22, 2011 Manā lapā laikam nav mazvarīgu failu... tātad. Quote Link to comment Share on other sites More sharing options...
EdgarsK Posted July 22, 2011 Report Share Posted July 22, 2011 daGrevis, tava lapa man personigi ir mazsvariga, tatad. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.