liangdong2014的专栏

首先明确使用了哪些技术?

html+css+javascript+php+bootstrap+smarty+ajax+jquery

在使用数据库是mysql_error()是个输出错误的不错方法

当我们需要获取html元素:radio元素的值时,不能通过form.name.value调用,可以通过以下函数获取值:

function GetRadioValue(RadioName){var obj;alert("okGetRadioValue");obj=document.getElementsByName(RadioName);if(obj!=null){var i;for(i=0;i<obj.length;i++){alert(obj[i].value);if(obj[i].checked){return obj[i].value;}}}return null;}

在插入数据时,,遇到了最不想遇到的问题–中文乱码

最后经百度和csdn查得,必须使用的所有编码格式建议utf8,然后在插入数据前如下一句话

mysql_query("setnamesutf8");

即可解决问题

还遇到了利用ajax登陆完成后的转跳问题,解决方法如下:

if(status == 0)<span style="white-space:pre"></span>{<span style="white-space:pre"></span>alert("登陆成功");<span style="white-space:pre"></span>var now_url = document.URL;<span style="white-space:pre"></span>alert(now_url);<span style="white-space:pre"></span>if(now_url.indexOf("index.php")>=0)<span style="white-space:pre"></span>{<span style="white-space:pre"></span>new_url = now_url.substr(0,now_url.indexOf('?'));<span style="white-space:pre"></span>}<span style="white-space:pre"></span>else{<span style="white-space:pre"></span>new_url = now_url.substr(0,now_url.indexOf('?'))+"index.php";<span style="white-space:pre"></span>}<span style="white-space:pre"></span>alert(new_url);<span style="white-space:pre"></span>window.location.href = new_url;<span style="white-space:pre"></span>return ;<span style="white-space:pre"></span>}附上一个javascript操作字符串的详解链接:

当有用到session传递数据时,得在每一个php文件里都写上session_start();

还有用ajax+php是echo 应该写在最后面

在使用section循环是举例如下:

{section name=sec1 loop=$actiles_detail}<tr>{section name=sec11 loop=$actiles_detail[sec1]}<td>{$actiles_detail[sec1][sec11]}</td>{/section}</tr>{/section}这样就完成了一个对二维数组的遍历

smarty 声明变量是使用

{assign var="count" value="0"}

这句话后我们就可以使用{$count}变量了

真凉爽啊!青山绿水映入我的眼中,景色怡人啊!

liangdong2014的专栏

相关文章:

你感兴趣的文章:

标签云: