Jump to content
php.lv forumi

include


gingerfish
 Share

Recommended Posts

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!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

---

Link to comment
Share on other sites

@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.
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...