matx Posted April 4, 2005 Report Share Posted April 4, 2005 megjinashu izteikties pec iespejas skaidraak- veletos lai man pienjemsim 1dienaa saakumaa atvertos index1.htm lapa 2dienaa index2.htm lapa... etc, tas vispar ir uzmeistarojams??? varbut varat pamest kadu domu>? Link to comment Share on other sites More sharing options...
Kavacky Posted April 4, 2005 Report Share Posted April 4, 2005 Tas jau ir PHP lauks. Link to comment Share on other sites More sharing options...
matx Posted April 4, 2005 Author Report Share Posted April 4, 2005 Tas jau ir PHP lauks. 15956[/snapback] ok kaa panakt ar php taadu "efectu" ? Link to comment Share on other sites More sharing options...
Kavacky Posted April 4, 2005 Report Share Posted April 4, 2005 (edited) Sliktais veids: if ( $diena == 1 ) { include('1diena.html'); } elseif ( $diena == 2 ) { include('2diena.html'); } ... Labais veids: Visu glabājam datubāzē un, atkarībā no dienas, rādām vajadzīgo. Edited April 4, 2005 by Kavacky Link to comment Share on other sites More sharing options...
matx Posted April 4, 2005 Author Report Share Posted April 4, 2005 Sliktais veids: if ( $diena == 1 ) { include('1diena.html'); } elseif ( $diena == 2 ) { include('2diena.html'); } ... Labais veids: Visu glabājam datubāzē un, atkarībā no dienas, rādām vajadzīgo. 15958[/snapback] un kaa dabuut dienu? resspektivi kaa vinjsh zinaas kura diena? Link to comment Share on other sites More sharing options...
Kavacky Posted April 4, 2005 Report Share Posted April 4, 2005 $diena = date('w'); Ar 'w' nosaka pašreizējo nedēļas dienu, kur svētdiena == 0 un sestdiena == 6. Tad attiecīgi jātaisa pārbaude. Link to comment Share on other sites More sharing options...
matx Posted April 4, 2005 Author Report Share Posted April 4, 2005 ok pamegjinasim- liels paldies! ;) Link to comment Share on other sites More sharing options...
Delfins Posted April 5, 2005 Report Share Posted April 5, 2005 Sliktais veids: if ( $diena == 1 ) { include('1diena.html'); } elseif ( $diena == 2 ) { include('2diena.html'); } ... Labais veids: Visu glabājam datubāzē un, atkarībā no dienas, rādām vajadzīgo. 15958[/snapback] nu cmukāk būtu $day = date('w'); $file = sprintf( 'index%d.htm', $day ); if ( file_exists($file) ) { include_once( $file ); } else { include_once( 'default.htm' ); } Link to comment Share on other sites More sharing options...
Venom Posted April 5, 2005 Report Share Posted April 5, 2005 ūuuu sprintf( 'index%d.htm', $day ) if (!@include_once('index'.date('w').'.htm')) include_once 'default.htm'; Link to comment Share on other sites More sharing options...
Delfins Posted April 5, 2005 Report Share Posted April 5, 2005 ūuuu sprintf( 'index%d.htm', $day ) if (!@include_once('index'.date('w').'.htm')) include_once 'default.htm'; 15982[/snapback] tikai vai tas būtu labs stils tā rakstīt iesācējam ? Kodam nav jābūt īsam (līdz `nesaprotu`). jābūt smukumam arī :) Link to comment Share on other sites More sharing options...
Venom Posted April 5, 2005 Report Share Posted April 5, 2005 mjā, un sprintf() nevietā ir _baigi_ feini Link to comment Share on other sites More sharing options...
tamster Posted April 5, 2005 Report Share Posted April 5, 2005 Es, protams, kā vienmēr nevietā, bet kas pie velna tas par vārdu Apvietnots, kreisajā malā (pie usera info)? :) Link to comment Share on other sites More sharing options...
Venom Posted April 5, 2005 Report Share Posted April 5, 2005 ap ("no" nozīmē) - vietnots t.i. ierādīta vieta, piereģistrēts Link to comment Share on other sites More sharing options...
matx Posted April 10, 2005 Author Report Share Posted April 10, 2005 Paldies taa sanaaca... tachu tagad atkal viens jauns jautajums- domaju viegls prieksh jums, taatad es gribu lai uzspiezjot uz linka incluudotos kaads links piemeram kautaks.html ieksh taas vietas kur es vinju gribeetu. can you help? Link to comment Share on other sites More sharing options...
Kavacky Posted April 10, 2005 Report Share Posted April 10, 2005 Un pats arī kaut ko mācies? "Search" funkciju izmanto? Link to comment Share on other sites More sharing options...
Recommended Posts