French text in PHP

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
kumarangopi
Forum Newbie
Posts: 10
Joined: Wed Oct 18, 2006 7:43 am

French text in PHP

Post by kumarangopi »

Kindly have a look at the attachment. I don't know why that text is not formatted. It is french text, below text is also french but that is displaying correctly. Both are coming from DB. Kindly help. I am not a techie to get into the code deeper. Kindly help
Attachments
1.JPG
1.JPG (21.36 KiB) Viewed 373 times
User avatar
jackpf
DevNet Resident
Posts: 2119
Joined: Sun Feb 15, 2009 7:22 pm
Location: Ipswich, UK

Re: French text in PHP

Post by jackpf »

Ok...
Is your DB, PHP file, and content-type set to UTF-8?

Just a guess...but if not, it could be something to do with that.
kumarangopi
Forum Newbie
Posts: 10
Joined: Wed Oct 18, 2006 7:43 am

Re: French text in PHP

Post by kumarangopi »

In table that fields are given as long text and utf-8 as collation
User avatar
jackpf
DevNet Resident
Posts: 2119
Joined: Sun Feb 15, 2009 7:22 pm
Location: Ipswich, UK

Re: French text in PHP

Post by jackpf »

How about your script and content type header/meta tag?
kumarangopi
Forum Newbie
Posts: 10
Joined: Wed Oct 18, 2006 7:43 am

Re: French text in PHP

Post by kumarangopi »

Code: Select all

 
<?
    if($_REQUEST[propositionid])
    {
        $propositionid=$_REQUEST[propositionid];
    }else{
        $propositionid=0;   
    }
#################Update Group Product Detail ############################## 
     update_group_tbl($propositionid);
##########################################################################  
    if($_REQUEST[hdn]==1)
    {
        $SQL=mysql_query("delete from msol_proposition_product where prop_product_id='".$_REQUEST[prop_product_id]."'") or die(mysql_error());
        $SQL=mysql_query("delete from msol_proposition_group_product where prop_product_id='".$_REQUEST[prop_product_id]."'") or die(mysql_error());        
        echo '<form action="home.php?PageURL=CreateProposotion_2&propositionid='.$propositionid.'&success=1" method="post"  name="frmJoin" id="frmJoin"></form>';
        echo '<script language="JavaScript" type="text/javascript"> document.frmJoin.submit(); </script>' ;         
    }
    if($_REQUEST[Next_Step])
    {
        $prop_product_id=$_REQUEST[prop_product_id];
        for($i=0;$i<count($prop_product_id);$i++)
        {
            $id=$prop_product_id[$i];
            $prop_event_pre_title=$_REQUEST["prop_event_pre_title_".$id];
            $prop_event_comment=$_REQUEST["prop_event_comment_".$id];           
            $SQL=mysql_query("update msol_proposition_product set prop_event_pre_title='".mysql_escape_string($prop_event_pre_title)."', prop_event_comment ='".mysql_escape_string($prop_event_comment)."' where prop_product_id='".$id."'") or die(mysql_error());
        }
        if($_REQUEST[Next_Step]=="Save"){
            echo '<form action="home.php?PageURL=CreateProposotion_2&propositionid='.$propositionid.'" method="post"  name="frmJoin" id="frmJoin"></form>';
            echo '<script language="JavaScript" type="text/javascript"> document.frmJoin.submit(); </script>' ;     
        }else{
            echo '<form action="home.php?PageURL=CreateProposotion_3&propositionid='.$propositionid.'&act=edit" method="post"  name="frmJoin" id="frmJoin"></form>';
            echo '<script language="JavaScript" type="text/javascript"> document.frmJoin.submit(); </script>' ;     
        }
    }
    $proposition_detail=get_proposition_detail($propositionid);
    $prop_prod_list=get_proposition_product_list($propositionid);
 
?> 
 
 <link href="../images/class.css" rel="stylesheet" type="text/css">
 
 <script language="JavaScript" type="text/JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
 
//-->
 </script>
<br>
<table width="95%"  border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#D7CDBC">
  <tr align="center" class="tablebgrow">
    <td width="20%"><a href="home.php?PageURL=CreateProposotion_1&propositionid=<?=$propositionid?>" class="leftlinks" style="text-decoration:none; font-weight: bold;">Step 1</a></td>
    <td width="20%" class="tablebgHeadingrow">Step 2 </td>
    <td width="20%"><a href="home.php?PageURL=CreateProposotion_3&propositionid=<?=$propositionid?>&act=edit"  class="leftlinks" style="text-decoration:none; font-weight: bold;">Step 3</a> </td>
    <td width="20%"><a href="home.php?PageURL=CreateProposotion_4&propositionid=<?=$propositionid?>"  class="leftlinks" style="text-decoration:none; font-weight: bold;">Step 4 </a></td>
    <td width="20%"><a href="home.php?PageURL=CreateProposotion_5&propositionid=<?=$propositionid?>"  class="leftlinks" style="text-decoration:none; font-weight: bold;">Step 5 </a></td>
  </tr>
  <tr align="center" class="tablebgrow">
    <td bgcolor="#D50000"> </td>
    <td height="1" bgcolor="#D50000"  > </td>
    <td  > </td>
    <td  > </td>
    <td  > </td>
  </tr>  
</table>
 <form action="home.php?PageURL=CreateProposotion_2&propositionid=<?=$propositionid?>" method="post" enctype="multipart/form-data" name="member" class="formback" id="member" >
  <table width="95%"  border="0" align="center" cellpadding="3" cellspacing="0">
    <tr>
      <td colspan="2" class="headR">&nbsp;Create Proposition Step 2 </td>
    </tr>
   </table>
<table width="95%"  border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#D7CDBC">    
    <tr>
      <td width="0" height="0" align="right" class="text12"> Client:</td>
      <td width="0" height="0" class="leftlinks" ><?=$proposition_detail->member_name?> </td>
      <td width="0" height="0" align="right" ><span class="text12">Company:</span></td>
      <td width="0" height="0" align="left" ><span class="leftlinks">
        <?=$proposition_detail->member_company?>
      </span></td>
      <td width="0" height="0" align="right" ><span class="text12">Phone (L):</span></td>
      <td width="0" height="0" align="left" ><span class="leftlinks">
        <?=$proposition_detail->member_phone_land?>
      </span></td>
      <td width="0" height="0" align="right" ><span class="text12">Mobile (M):</span></td>
      <td width="0" align="left" ><span class="leftlinks">
        <?=$proposition_detail->member_phone_mobile?>
      </span></td>
      <td width="0" height="0" align="right" > 
      <input name="Submit2" type="button" class="button1" onClick="MM_openBrWindow('product_list.php?propositionid=<?=$propositionid?>','amitkumarsingh','scrollbars=yes,resizable=yes,height=600,width=900')" value="Add A Product"></td>
    </tr>
   </table>
<? if($_REQUEST[success]==1){?>
<table width="400"  border="0" align="center" cellpadding="0" cellspacing="0"  >
  <tr>
    <td align="center"  > <p class="success">Product Successfully Deleted</p></td>
  </tr>
</table>
 
 
<? }?>
   <? if(mysql_num_rows($prop_prod_list)>0){
        $i=1;
        while($rows=mysql_fetch_object($prop_prod_list)){
        if($i==1){
            $i=1;
            $bgcolor="#D7CDBC";
        }else{
            $i=1;       
            $bgcolor="#EBEBEB";     
        }
   ?>
                    <table width="95%"  border="0" align="center" cellpadding="3" cellspacing="1" class="headR" >
 
                      <tr bgcolor="<?=$bgcolor?>">
                        <td width="150" align="center"   > 
                        <? if(file_exists($image_url.$rows->prop_img_url) && $rows->prop_img_url){ ?>
                         <img src="phpThumb.php?w=150&h=150&src=<?=$image_url.$rows->prop_img_url?>" border="0" class="framed2"> 
                         <? }?>
                        </td>
                        <td width="0" ><table width="100%"  border="0" cellspacing="1" cellpadding="3">
                          <tr>
                            <td align="left" class="text"><strong>Event Pre Name : </strong> <input name="prop_event_pre_title_<?=$rows->prop_product_id?>" type="text" class="textbox" value="<?=$rows->prop_event_pre_title?>" size="50" maxlength="255"></td>
                          </tr>
                          <tr>
                            <td class="leftlinks"><?=stripslashes($rows->prop_product_title)?> </td>
                          </tr>
                           <tr>
                            <td class="text"><div align="justify"><?=stripslashes($rows->prop_product_detail)?></div></td>
                          </tr>
                          <tr>
                            <td class="text"><textarea name="prop_event_comment_<?=$rows->prop_product_id?>" rows="3" class="textarea" style="width:100% "><?=$rows->prop_event_comment?></textarea></td>
                          </tr>
                        </table></td>
                        <td width="0" align="center" ><a href="home.php?PageURL=CreateProposotion_2&propositionid=<?=$propositionid?>&prop_product_id=<?=$rows->prop_product_id?>&hdn=1" class="leftlinks" onClick="return confirm('Are you sure want to delete this product?')"><img src="../images/del.gif" width="12" height="12"><br>
                        Delete</a>
                        <input name="prop_product_id[]" type="hidden" id="<?=$rows->prop_product_id?>" value="<?=$rows->prop_product_id?>"></td>
                      </tr>
                    </table>
        <? 
            }
        } ?>
                    <table width="95%"  border="0" align="center" cellpadding="3" cellspacing="0">                                      
    <tr align="center">
      <td colspan="2" class="headR">
<input name="Submit3" type="button" class="button1" value="Back Step" onClick="location.href='home.php?PageURL=CreateProposotion_1&propositionid=<?=$propositionid?>'" style="width:130px">
<input name="Preview_Proposition" type="button" class="button1" onClick="MM_openBrWindow('proposition_preview.php?propositionid=<?=$propositionid?>','amitsingh','scrollbars=yes,resizable=yes,height=600,width=900')" value="Preview Proposition"  style="width:130px"> 
<input name="Next_Step" type="submit" class="button1" id="Next_Step" style="width:130px" value="Save"> 
<input name="Next_Step" type="submit" class="button1" id="Next_Step" value="Next Step" style="width:130px">
</td>
    </tr>
  </table>
 
 
 
</form>
  
 
 
 
 
 
 
 
 
 
 
 
line:128:<?=stripslashes($rows->prop_product_title)?> ---> title ->>not working properly

line:131: <?=stripslashes($rows->prop_product_detail)?> ---> description ->> working properly.

-------------
Kindly help
User avatar
jackpf
DevNet Resident
Posts: 2119
Joined: Sun Feb 15, 2009 7:22 pm
Location: Ipswich, UK

Re: French text in PHP

Post by jackpf »

Why are you running stripslashes() on your data from the database?
Post Reply