» »

spet ena phpjevska

spet ena phpjevska

Uporabnik ::

tole mi ne prebav.. zarad page=news??

include("../stats/count.php?page=news");

v bistvu naj bi ibl to counter ki bi lahk za vsako stran posebi štel zadetke, stran pa pi podal z page=xxx

any ideas, tnx

Primoz ::

pač napišeš
$page=news
require("../stats/count.php");

:)
There can be no real freedom without the freedom to fail.

yimi ::

Primoz: ja pac napises require blablabla
sam mores pazit!!!
include je takonekako podoben server include se pravi da ti podatke ze obdela v nasprotju z requre, ki pa ti samo includa izvorno kodo kar pomeni da je require enako kot da bi ti tisto kar v fajlo mel

edmund ::

Pa samo en require maš lahko v eni datoteki, medtem ko maš lahko večkrat include...
[28-Jun-2003 15:55:08] Body temperature above normal (error type 215)
[28-Jun-2003 15:55:08] No brain activity (error type 265)

OwcA ::

edmund: v eni datoteki imaš lahko kolikor koli require. Najpomembnejša razlika med require in include je, da se require izvede TAKOJ za razliko od include, ki se izvede šele ko program pride do vrstice v kateri je include (če torej pride pred include do napake se include ne bo izvedel).

yimi ::

No pa še neki!
requre se običajno uporablja, za navedit kaksne spremenljivke ali kodo , ki se veckrat ponavljaja. Npr. da ti ni treba v vsaki datoteki povezat z bazo posebej ali pa navajat kaksne druge spremelnjivke. Samo nardiš en fajl zmečeš not in potem devaš samo require v drugih fajlh.

include pa naprimer, da si narediš eno anketo al pa karkoli in namesto da imaš na vsaki strani izvorno kodo te ankete narediš samo en fajl pa include pa maš anketo kjer hočeš...

edmund ::

aha, moj fehler ;)
[28-Jun-2003 15:55:08] Body temperature above normal (error type 215)
[28-Jun-2003 15:55:08] No brain activity (error type 265)

Tr0n ::

The require() statement replaces itself with the specified file, much like the C preprocessor's #include works.

Unlike include(), require() will always read in the target file, even if the line it's on never executes. If you want to conditionally include a file, use include(). The conditional statement won't affect the require(). However, if the line on which the require() occurs is not executed, neither will any of the code in the target file be executed.

This means that you can't put a require() statement inside of a loop structure and expect it to include the contents of a different file on each iteration. To do that, use an include() statement.

The include() statement includes and evaluates the specified file.

include() differs from require() in that the include statement is re-evaluated each time it is encountered (and only when it is being executed), whereas the require() statement is replaced by the required file when it is first encountered, whether the contents of the file will be evaluated or not (for example, if it is inside an if statement whose condition evaluated to false).

No, ostalo pa vam tak pise v heplu :). Torej nekako tako kot je yimi povedal.


Vredno ogleda ...

TemaSporočilaOglediZadnje sporočilo
TemaSporočilaOglediZadnje sporočilo
»

Apache - localhost JA, IP naslov NE

Oddelek: Omrežja in internet
182668 (2527) ManDriver
»

php skripta za registracijo uporabnikov

Oddelek: Izdelava spletišč
162032 (1613) skorpio
»

Valve & STEAM & On-Line gaming (strani: 1 2 )

Oddelek: Igre
718037 (6459) Tilen
»

PHP sessions

Oddelek: Izdelava spletišč
191423 (1206) rokpok
»

phpBB install

Oddelek: Omrežja in internet
71363 (1250) poweroff

Več podobnih tem