Jump to content
php.lv forumi

styles..


GraaBeklis

Recommended Posts

Man ir uztaisiits ka ir 3 veidu krasu dizaini, kuri ir taisiti ar css..

izskati.php man ir taa:

<a href="?style=1">Dzeltens</a>

<a href="?style=2">Zals</a>

<a href="?style=3">Sarkans</a>

Un ka nospiezh piem uz Sarkans lai vinjsh man kaa defaulto uzliek sarkans.css, kaa to izdariit?

plzz paliidziet=]

Edited by GraaBeklis
Link to comment
Share on other sites

if (isset($_GET['style'])=='3') {
echo '<link href="sarkans.css" rel="stylesheet" type="text/css"/>';
}

Šitā jāieliek

17330[/snapback]

 

programeeshana arii priex tewis naw.... wismaz taa izskataas .... manuaalis tak jaalasa .... wai ja 100% nezini tad labaak nemaz neraxti .... :)

Link to comment
Share on other sites

nu šitā te ka jūs man palīdzat man baig lab iespiezhas prātā, kas kā .. vaitad priekš tā nav forumi?? ;]

 

a shitaa kautkaa neder?:

<?php
$style = $_GET['style'];
switch($style) {
case '2':
setcookie ('<link href="styles/2.css" rel="stylesheet" type="text/css"/>', $style);
echo 'Tu uzvēlējies: <link href="styles/1.css" rel="stylesheet" type="text/css"/>';
}
?>

Tikai man raada error: Warning: Cannot add header information - headers already sent by (output started at d:\www\web\index.php:12) in d:\www\web\izskati.php on line 5

Edited by GraaBeklis
Link to comment
Share on other sites

ir priex tam .... bet nu mauaali tachu ir skaidri uzrakxtiic un paraadiits ... piemērs no manuāļa

 

un te buus latviski arii.... priex tiem kas manuaaljus nelasa wai negrib to dariit ... :(

<?php
$var = '';
// This will evaluate to TRUE so the text will be printed.
if (isset($var)) {
  echo "This var is set set so I will print.";
}

$var = 'kaut kas da jebkas'; //sheit naw weertiibas mainiigajam
// mainiigajam vajab pieshkirt veertiibu, tad mainiigais izvadiisies
if (isset($var)) {
  echo "Veertiiba ir un tiek izvadiits shis txt.";
}


?>

Edited by Klez
Link to comment
Share on other sites

nu man jau ar switch un case ir uztaisiits:

<?php
$style = $_GET['style'];
switch($style) {
case '1':
echo '<link href="1.css" rel="stylesheet" type="text/css"/>';    
break;
case '2':
echo '<link href="2.css" rel="stylesheet" type="text/css"/>';
break;
}
?>  

bet vinjsh jau to stylu nomaina tikai uz to briidi kameer nav nospiesta cita izvelne..

Link to comment
Share on other sites

A ko tad tu sākumā prasīji, ja ne šo?

17340[/snapback]

-->> ... Un ka nospiezh piem uz Sarkans lai vinjsh man kaa defaulto uzliek sarkans.css, kaa to izdariit? ... <<--

default vaitad neskaitas tjip kaa visu laiku paliekosh, liidz to nenomaina??

 

Aaa un pie reizes paprasiishu, kapeec man vish vislaik saka ka neiet:

<?php
$ip = "81.198.21.139";
if($_SERVER['REMOTE_ADDR'] == $ip) {
echo '';
} else {
echo 'neiet..';
exit;
}
?>

Edited by GraaBeklis
Link to comment
Share on other sites

nu tad tev sesijaa jaasaglabaa vai cepums jaataisa ....

<?
session_start();
switch($_GET['style']){
case 1: $HTTP_SESSION_VARS['stils'] = 'zalsh'; break;
case 2: $HTTP_SESSION_VARS['stils'] = 'zils'; break;
case 3:$HTTP_SESSION_VARS['stils'] = 'sarkans'; break;
default: $HTTP_SESSION_VARS['stils'] = 'zalsh';
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1257">
<title>Super lapa</title>
<link rel="stylesheet" href="<?=$HTTP_SESSION_VARS['stils']?>.css" type="text/css">
</head>
<body>
Te mana super lapas paareejaa dalja 
</body>
</html>

 

ceru ka iebrauci :)

Link to comment
Share on other sites

iztaisi <?=$_SERVER['REMOTE_ADDR']?>

<?php
$ip = "81.198.21.139";
if($_SERVER['REMOTE_ADDR'] == $ip) { 
echo '';
} else {
echo 'neiet..';
exit;
}

//vienkaarshaax varinats
//ja ip nebuus vienaada ar $ip tad viss apstasies
if (if($_SERVER['REMOTE_ADDR'] != $ip) die("Neiet");
?>

Link to comment
Share on other sites

×
×
  • Create New...