Jump to content
php.lv forumi

Kads nevar izpalidzet


GeRik

Recommended Posts

Ka man ieladet sho visu

<?

$languages = array('en' => 'English',
                  'ru' => 'Russian',
                  'lv' => 'Latvian');

 if (isset($_GET['valoda'])) {

 $lang = $_GET['valoda'];

 setcookie('valoda', $lang, time()+(3600*24*365));

}else if (isset($_COOKIE['valoda'])) {
 $lang = $_COOKIE['valoda'];
} else {
 $lang = 'lv';
}

if (!(in_array($lang, array_keys($languages)))) {
 die("ERROR: Trukst Valodas fails!");
}
include("valoda/$lang.php");

?>

shada veida

<script type="text/javascript">
$(document).ready(function(){
	$("#pedreg").load('includes/top5.php');
});
</script>

Link to comment
Share on other sites

zna4it ja ir Javascript ielade zna4it man web lapai bus errori ? jo ja ir javascript ielade katra faila kuru ielade vaig pievienot tadu pashu (lai raditos tulkojums) a ja nav pievienots tad nerada bet ka nomaina valodu visur errorus izmet header already sent un valoda nomainas bet uz nakama linka vairs jau nav ta valoda taka diezgan liela problema kura nevaru iebraukt

Link to comment
Share on other sites

ja tev piemēram ir index.php:

<?

$languages = array('en' => 'English',
                  'ru' => 'Russian',
                  'lv' => 'Lat...

?> 
[...] <html><head>...
  <script type="text/javascript">
       $(document).ready(function(){
               $("#pedreg").load('includes/top5.php');
       });
</script>...

 

 

tas top5.php skripts ielādēsies atsevišķi, kā jauns pieprasījums bez tā valodas skripta.

 

tātad vai nu dari tā <div id="pedreg"><? include('includes/top5.php');?></div>

 

vai arī liec vēl vienu valodas skripta kopiju tajā top5.php

 

EDIT: tie punktiņi domāti, lai saīsinātu.

Edited by Indian
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...
×
×
  • Create New...