dongyoulou4829 2013-10-02 13:57
浏览 11

too long

i have done code to insert data in mysql in hindi.. my code is working offline but not working online.. when i insert data then it becomes blank in database.. i have set utf-8 in my code.. and in data base i set utf8 general_ci .

here is my code..

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Untitled Document</title>
</head>
<?php
include('connection.php');
?>
<?php
$ques=ucfirst($_REQUEST['question']);
$opta=ucfirst($_REQUEST['optiona']);
$optb=ucfirst($_REQUEST['optionb']);
$optc=ucfirst($_REQUEST['optionc']);
$optd=ucfirst($_REQUEST['optiond']);
$ans=ucfirst($_REQUEST['answer']);

?>

<body>
<div align="right"><a href="../main.php">Go Back To Logout</a></div>
<center><div style="background-image:url(images/background.jpg); width:1300px; height:680px;">

<form action="#" method="post">
<div style="width:700px; height:700px;">
<div>&nbsp;</div>

<div><font size="+3" style="color:#000099;"><strong>Insert Your Reasoning Question From Here :</strong></font></div>
<div>&nbsp;</div><div>&nbsp;</div><div>&nbsp;</div><div>&nbsp;</div><div>&nbsp;</div><div>&nbsp;</div><div>&nbsp;</div><div>&nbsp;</div>

   <?php
mysql_query("SET NAMES utf8");
if($_REQUEST['queinsert'])
{
$sql4="insert into reasoning values(NULL,'$ques','$opta','$optb','$optc','$optd','$ans')";
   mysql_query($sql4);
   echo "Question Successfully Inserted";
}

 ?>
   <div>&nbsp;</div>
<div style="width:400px;">Question : <input type="text" name="question" style="width:300px;" /></div>
<br />
<div style="width:400px;">Option a : <input type="text" name="optiona" style="width:300px;"  /></div>
<br />
<div style="width:400px;">option b : <input type="text" name="optionb" style="width:300px;"  /></div>
<br />
<div style="width:400px;">option c : <input type="text" name="optionc" style="width:300px;"  /></div>
<br />
<div style="width:400px;">option d : <input type="text" name="optiond" style="width:300px;"  /></div>
<br />
<div style="width:400px;">answer : <input type="text" name="answer" style="width:300px;"  /></div>
<br />
<div style="width:400px;"><input type="submit" value="Insert" name="queinsert" /></div>


</div>
</form>
</div></center>
</body>
</html>
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 有了解d3和topogram.js库的吗?有偿请教
    • ¥100 任意维数的K均值聚类
    • ¥15 stamps做sbas-insar,时序沉降图怎么画
    • ¥15 unity第一人称射击小游戏,有demo,在原脚本的基础上进行修改以达到要求
    • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
    • ¥15 关于#Java#的问题,如何解决?
    • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
    • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
    • ¥15 cmd cl 0x000007b
    • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line