基本上,我正在尝试在php中创建一个函数,它将为我提供最新的列(消息),其中没有超过40个字符的单词.我能够获得最新的消息,但我不知道如何只获取没有大于40个字符的单词的最新消息.请参考$ callrecent变量.
<?php
function recentpost($postnum) {
$callrecent = "SELECT message FROM messages WHERE message (HAS NO WORD GREATER THAN 40 CHARACTERS) ORDER BY msg_id DESC LIMIT $postnum,1";
$callrecent_run = mysql_fetch_assoc(mysql_query($callrecent));
$message = stripslashes($callrecent_run['message']);
return $message;
}
?>
Run Code Online (Sandbox Code Playgroud) 我已经有一个工作的OOP网站.大部分的php都是从html中分离出来的.我想知道是否有人有关于如何将该网站应用到Yii框架的任何提示.
编辑
该网站使用jquery,html,css,php,javascript.它还包含我购买代码峡谷的很多库和类.像地理定位库,phpthumb(图像缩略图),喜欢和不喜欢系统.如何将这些库导入Yii?
基本上,我有一个CodeIgniter站点,通过此URL注册用户:http:
//website.com/user/register/1
不幸的是,当您在URL中传递额外的参数时,请执行以下操作:http: //website.com/user/register/1/extraargs/extraargs
这是我的代码:
<?php
class User extends CI_Controller
{
public function register($step = NULL)
{
if (($step!=NULL)&&($step == 1 || $step == 2 || $step == 3)) {
if ($step == 1){
$this->load->view('registration_step1');
}
} else {
show_404();
}
}
}
?>
Run Code Online (Sandbox Code Playgroud)
它没有显示404.它只是忽略了额外的参数.我想要它,以便额外的参数不会影响URL.如果有额外的URL参数,我想显示404.你怎么做到这一点?此外,额外的URL细分可以影响安全性吗?谢谢.