Jump to content

[SOLVED] Arrays


altemur

Recommended Posts

Hi mates

 

i have code which takes the information from mysql database.

 

Hw i can change for gettin informatins with $_GET function from the form. So i wont get the info from database. it will come with a forum.

 

These are the code i have ( Sorry i am not so familiar to php)

 

><?
                  $iss = 0;
                  $query = "SELECT news.cuff FROM news, category where category.status2 = 1 and category.id = news.category order by news.id desc limit 11";
                  $result = mysql_query ($query) or die ("error");
                  while ($line = mysql_fetch_array($result)){

                  $cuff ="";
                                  $cuffx = strtolower($line[cuff]);
                                  $cuffx = str_replace("\'", "'", $cuffx);
                                  $cuffx = str_replace("\\\"", "\"", $cuffx);

and it continues.

 

shortly i will try to eplain here what i will do with these codes.

 

Getting a word by $_GET function and writing the word with pictures of letters.

i have a picture of every letter.

 

see you

Link to comment
https://forums.phpfreaks.com/topic/45173-solved-arrays/
Share on other sites

No i dont think so. it will read and will write with picture.

it will take images of letetrs from a file.

it will put together all the images of letter.  as a result it will write the word

 

İ have made a change myself like this

 
$iss = 0;

$line = $_GET['s1'];
$cuff ="";

 

But it reads only first letter.

 

Link to comment
https://forums.phpfreaks.com/topic/45173-solved-arrays/#findComment-219294
Share on other sites

İ will pu all what i have used here

 

<?
                  $iss = 0;


                  $line = $_GET['s1'];


                  $cuff ="";

                                  $cuffx = strtolower($line[cuff]);
                                  $cuffx = str_replace("\'", "'", $cuffx);
                                  $cuffx = str_replace("\\\"", "\"", $cuffx);

                                  $karakter =  strlen($cuffx);


                  for($i=0; $i<strlen($cuffx); $i++)
                  $cuff[] = $cuffx{$i};

                                  if($karakter == "26"){$res_size = "15";}
                                  if($karakter == "25"){$res_size = "16";}
                                  if($karakter == "24"){$res_size = "17";}
                                  if($karakter == "23"){$res_size = "18";}
                                  if($karakter == "22"){$res_size = "19";}
                                  if($karakter == "21"){$res_size = "20";}
                                  if($karakter == "20"){$res_size = "21";}
                                  if($karakter == "19"){$res_size = "22";}
                                  if($karakter == "18"){$res_size = "23";}
                                  if($karakter == "17"){$res_size = "24";}
                                  if($karakter == "16"){$res_size = "25";}
                                  if($karakter == "15"){$res_size = "26";}
                                  if($karakter == "14"){$res_size = "27";}
                                  if($karakter == "13"){$res_size = "28";}

                                  if($karakter == "12"){$res_size = "29";}
                                  if($karakter == "11"){$res_size = "31";}
                                  if($karakter == "10"){$res_size = "33";}
                                  if($karakter == "9"){$res_size = "35";}
                                  if($karakter == "8"){$res_size = "37";}
                                  if($karakter == "7"){$res_size = "39";}
                                  if($karakter == "6"){$res_size = "41";}
                                  if($karakter == "5"){$res_size = "43";}
                                  if($karakter == "4"){$res_size = "45";}
                                  if($karakter == "3"){$res_size = "47";}
                                  if($karakter == "2"){$res_size = "49";}
                                  if($karakter == "1"){$res_size = "51";}
                                  if($cuff[$ix] == "'"){$res_size = "20";}

                                  ?>
                <?if($iss == 0){?>
                  <DIV id=manset<?=$iss;?>a>

                  <?}else{?>
                  <DIV id=manset<?=$iss;?>a style="DISPLAY: none">
                    <?}?>
                    <NOBR>
                    <center>
                      <?
                        $ix = 0;
                        while($ix < count($cuff)){

                                             if($cuff[$ix] == "ç"){$cuff[$ix] = "c2";}
                                                if($cuff[$ix] == "Ç"){$cuff[$ix] = "c2";}
                                                if($cuff[$ix] == "ş"){$cuff[$ix] = "s2";}
                                                if($cuff[$ix] == "Ş"){$cuff[$ix] = "s2";}
                                                if($cuff[$ix] == "ğ"){$cuff[$ix] = "g2";}
                                                if($cuff[$ix] == "Ğ"){$cuff[$ix] = "g2";}
                                                if($cuff[$ix] == "ö"){$cuff[$ix] = "o2";}
                                                if($cuff[$ix] == "Ö"){$cuff[$ix] = "o2";}
                                                if($cuff[$ix] == "ü"){$cuff[$ix] = "u2";}
                                                if($cuff[$ix] == "Ü"){$cuff[$ix] = "u2";}
                                                if($cuff[$ix] == "ı"){$cuff[$ix] = "xxx";}

                                                if($cuff[$ix] == "i"){$cuff[$ix] = "i2";}
                                                if($cuff[$ix] == "I"){$cuff[$ix] = "xxx";}
                                                if($cuff[$ix] == "İ"){$cuff[$ix] = "xxx";}
                                                if($cuff[$ix] == "'"){$cuff[$ix] = "tirnak";}
                                                if($cuff[$ix] == "\""){$cuff[$ix] = "tirnak";}
                                                if($cuff[$ix] == "!"){$cuff[$ix] = "unlem";}
                                                if($cuff[$ix] == "?"){$cuff[$ix] = "soru";}
                                                if($cuff[$ix] == "-"){$cuff[$ix] = "tire";}
                                                if($cuff[$ix] == "."){$cuff[$ix] = "nokta";}
                                                if($cuff[$ix] == "%"){$cuff[$ix] = "yuzde";}
                                                $cuff[$ix] = strtolower($cuff[$ix]);
                                                ?>


         <IMG height=70 src="<?if($cuff[$ix] != " "){?>word/<?=$cuff[$ix];?>.gif<?}else{?>word/empty.gif<?}?>" width=<?if(($cuff[$ix] == "ı") or ($cuff[$ix] == "ı")){?>13<?}else{?><?=$res_size;?><?}?>>
                    
                     
              <?
                        $xxx = "";
                        $ix++;
                        }
         ?>

 

As a result i get only first letter of the word. and allways uppercase

Link to comment
https://forums.phpfreaks.com/topic/45173-solved-arrays/#findComment-219301
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.