Jump to content
php.lv forumi

blackhalt

Reģistrētie lietotāji
  • Posts

    763
  • Joined

  • Last visited

Posts posted by blackhalt

  1. Patestē, kā ir citur.

     

    Šiten, datubāzes tabulā, kādā text laukā iedrukā:

    Aa, Āā, Bb, Cc, Čč, Dd, Ee, Ēē, Ff, Gg, Ģģ, Hh, Ii, Īī, Jj, Kk, Ķķ, Ll, Ļļ, Mm, Nn, Ņņ, Oo, Pp, Rr, Ss, Šš, Tt, Uu, Ūū, Vv, Zz, Žž.

     

    http://adminer.sourceforge.net/adminer.php?username=

     

    Vai uztaisi jaunu tabulu un tad.

     

    Vai izmanto SQL komandu (SQL command), lai izveidotu tabulu `test_lv`:

     

     

    CREATE TABLE `test_lv` (
      `vards` text COLLATE 'utf8_general_ci' NOT NULL
    ) COMMENT='' ENGINE='MyISAM';
     

     

     

    un komanda, kas tabulas `test_lv` laukā `vards` ievietos tos LV burtus:

     

     

    INSERT INTO `test_lv` (`vards`)
    VALUES ('Aa, Āā, Bb, Cc, Čč, Dd, Ee, Ēē, Ff, Gg, Ģģ, Hh, Ii, Īī, Jj, Kk, Ķķ, Ll, Ļļ, Mm, Nn, Ņņ, Oo, Pp, Rr, Ss, Šš, Tt, Uu, Ūū, Vv, Zz, Žž.');
     

    Un tad pamēģini uz sava datora ar to pašu http://www.adminer.org/

     

    Ja nesanāk, tad ir jautajums - kādi tad tie latviešu burti "sanāk"?

  2. Vajag UTF-8

     

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    
    <head>
    	<title>untitled</title>
    	
    
    	<meta http-equiv="content-type" content="text/html;charset=utf-8" />
    
    	<!-- Slikts ir ISO-8859-1:
    	<meta http-equiv="content-type" content="text/html;charset=ISO-8859-1" />
    	-->
    	
    	<meta name="generator" content="Geany 0.21" />
    </head>
    
    <body>
    
    <form id="meklis" name="meklis" action="" method="post">
    
    <input name="data" id="data" />
    
    </form>
    
    <?php
    
        $string = "ÆØÅ æøå";
        $find = array(" ", "æ", "ø", "å", "Æ", "Ø", "Å");
        $replace = array("-", "ae", "oe", "aa", "ae", "oe", "aa");
        $link = str_replace($find,$replace,$string);
        echo $link;
    
    echo '<br />';
    
    if(isset($_POST['data'])){
    	
        $link = str_replace($find,$replace,strtolower($_POST['data']));
    	echo $link;
    	
    }
    
    ?>
    
    </body>
    </html>
    
    
  3. @blackhalt Pareizi saprotu, ka manā gadījumā jāturpina lietot 127.0.0.1 un jāaizmirst par šo jautājumu?

    Nezinu, man nav Windows.

    Man my.cnf ir kaut kā tā:

     

    [client]

    port        = 3306

    socket        = /var/run/mysqld/mysqld.sock

     

    ....

     

    bind-address        = 127.0.0.1

  4. 
    

    <?php

     

    # Pieņemsim, ka bildes mercis.png izmērs ir zināms 400 x 300 px

    $image = imagecreatefrompng('mercis.png');

     

    # Šitie divi ir svarīgi, lai viņam būtu pareizais caurspīdīgums:

    imagealphablending($image, false);

    imagesavealpha($image, true);

     

    # Caurspīdīga krāsa, ko izmantosim pildīšanai:

    $col_poly = imagecolorallocatealpha($image, 0, 0, 0, 127);

     

    # Zīmējam "reversu trijstūri" un pildam ar caurspīdīgo krāsu:

    imagefilledpolygon($image, array(

    0, 0,

    0, 300,

    400, 300,

    400, 0,

    0, 0,

    300, 200,

    100, 200,

    0, 0,

    ),

    8,

    $col_poly);

     

    header('Content-type: image/png');

     

    # Drukājam png:

    imagepng($image);

    imagedestroy($image);

     

    ?>

×
×
  • Create New...