我有一些关于HTML5 ContentEditable和PHP的问题,如果你能提供我想要做的事情的例子,我会很高兴,所以我可以得到一个想法.
我有一个网站,我想编辑,但只有"管理员"登录 - 我可以做登录的事情,但我不知道如何编码HTML5 ContentEditable到它,以便它不会加载"管理员"尚未登录.
如何保存HTML5 ContentEditable中更改的内容?
能帮我解决一下为什么我的代码不会显示setmessage:
$this->form_validation->set_message('Sorry %s is not correct.');
验证很高兴地表明它们是必需的:
home.php - >控制器
<?php
ob_start();
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Home extends CI_Controller {
function __construct(){
parent::__construct();
}
function index(){
$this->login();
}
public function login()
{
//Loads The Page Template
$this->template->set('title','Admin Login');
//Validation Check
$this->form_validation->set_rules('username','Username','required|trim|max_length[50]|xss_clean');
$this->form_validation->set_rules('password','Password','required|trim|max_length[200]|xss_clean|callback_checkUsernamePassword');
if($this->form_validation->run() == FALSE){
$this->template->load('template','admin/admin_login');
}else{
extract($_POST); // Gets data from form and creates vars
$user_id = $this->login_model->check_login($username,$password);
if(! $user_id || $password){ // != If username or password are not correct
$this->session->set_flashdata('login_error',TRUE); //does …Run Code Online (Sandbox Code Playgroud) 我试图清空表格,但我想知道我的功能是否正确?
模型:
public function removeQuote()
{
$this->db->empty_table('companyDetails,hostingDetails,layoutDetails');
}
Run Code Online (Sandbox Code Playgroud)
控制器:
public function submit()
{
$data['companyContact'] = $this->quote->getCompanyDetails()->companyContact;
$this->load->view('submit',$data);
$this->quote->removeQuote();
}
Run Code Online (Sandbox Code Playgroud)
错误:
Table '_quote.companyDetails,hostingDetails,layoutDetails' doesn't exist
DELETE FROM `companyDetails,hostingDetails,layoutDetails`
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用jquery表单验证器实现客户端验证,但我已按照指南进行了搜索,并在谷歌搜索我的问题的答案,可能存在冲突,prototype.js 我已将行添加var JQuery = jQuery.noConflict();到我的jquery-1.5.1.min.js文件底部.
萤火虫还在说
$("#contact") is null
$("#contact").validationEngine();
我将所需的javascript和jQuery代码加载到我的主页面中,template.php file然后调用一个view被叫联系人.
联系页面视图:
<section id="content" class="contact-us">
<h1>Contact</h1>
<div id ="formLayout" class="contactForm">
<section id = "validation"></section>
<form action=contact" method="post" accept-charset="utf-8" id="contact" name="contact">
<fieldset>
<label><label for="name">Name:</label><span class="small">Required Field - Text</span></label>
<input type="text" name="name" value="" id="name" class="validate[required[custom[onlyLetterSp]]]" />
<div id="error"></div>
<label><label for="email">Email:</label><span class="small">Required Field - yourname@example.com</span></label>
<input type="text" name="email" value="" id="email" class="validate[required[custom[onlyLetterSp]]]" />
<div id="error"></div>
<label><label for="phone">Phone:</label><span class="small">Required Field - 021214589</span></label> …Run Code Online (Sandbox Code Playgroud) 我怎样才能使这部分代码有效?我对flash嵌入没有多少经验.
<noscript>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="999" height="241" title="">
<param name="movie" value="images/banner.swf" />
<param name="quality" value="high" />
<param name="BGCOLOR" value="#EFE8DE" />
<param name="wmode" value="opaque" />
<embed src="images/banner.swf" width="999" height="241" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" wmode="opaque"</embed></object>
</noscript>
Run Code Online (Sandbox Code Playgroud) 我有以下CSS菜单,float:left;我怎么能成为这个中心.我在哪里添加margin:0 auto?
CSS:
/* === 7. Navigation === */
#nav{
width:100%;
margin:30px auto;
}
.ie7 #nav{
padding:10px 0 0 30px;
}
#nav ul li{
margin:0 auto;
}
#nav li{
float:left;
text-align:center;
list-style:none;
font-weight:bold;
}
#nav li a{
margin-right:30px;
text-decoration:none;
color:#5d5e5d;
}
#nav li a:hover{
text-decoration:underline;
}
#nav li a:active{
font-family:inherit;
font-size:inherit;
color:#fff;
}
Run Code Online (Sandbox Code Playgroud)
HTML:
<ul id="nav"><!--Navigation-->
<li id="homenav"><a href="#home">Home</a></li>
<li id="portfolionav"><a href="#portfolio">Portfolio</a></li>
<li id="contactnav"><a href="#contact">Contact</a></li>
</ul>
Run Code Online (Sandbox Code Playgroud) 我有一个表单,将数据提交到一个名为ng-submit="newBirthday()this 的函数中,将数据推 $scope.bdayname, $scope.bdaydate;送到一个名为的数组中bdaes
我的问题是,在我看到的所有教程中,数组都有预定义的数据,是否有一种方法可以是一个空数组,在提交数据时会被数据填充?
app.js:
var app = angular.module('birthdayToDo', []);
app.controller('main', function($scope){
// Start as not visible but when button is tapped it will show as true
$scope.visible = false;
// Create the array to hold the list of Birthdays
$scope.bdays = [{}];
// Create the function to push the data into the "bdays" array
$scope.newBirthday = function(){
$scope.bdays.push({name:$scope.bdayname, date:$scope.bdaydate});
$scope.bdayname = '';
$scope.bdaydate = '';
}
});
Run Code Online (Sandbox Code Playgroud)
HTML:
<body ng-app="birthdayToDo" ng-controller="main">
<div id="wrap">
<!-- …Run Code Online (Sandbox Code Playgroud) 我不确定为什么我没有得到我的data-id价值undefined
该data-id节目的int
<li>
<input style="width:100%;" placeholder="Page Title" id="post_title" onclick="urlCheck()" dataid="<?php echo($website_id);?>" name="post_title" type="text" value="<?php echo set_value('post_title', $post['post_title']); ?>" />
<?php echo form_error('post_title'); ?>
</li>
Run Code Online (Sandbox Code Playgroud)
JS:
function urlCheck() {
$(".postForm").on('click', '#post_title', function (e) {
var id = $('#post_title').attr("data-id");
console.log(id);
e.preventDefault();
});
}
Run Code Online (Sandbox Code Playgroud) 如何向我的复选框添加标签,以便将它们内联。
我想要这样的:
label input input
目前下面的代码显示的是input input label为什么?
HTML:
<div class="col-md-6 pull-right">
<div class="form-group">
<label>Gender</label> <label class=
"col-sm-2 checkbox-inline"><input id="genMale" type="checkbox"
value="genMale">Male</label> <label class=
"col-sm-2 checkbox-inline"><input id="genFemale" type=
"checkbox" value="genFemale">Female</label>
</div>
</div>
Run Code Online (Sandbox Code Playgroud) html ×4
css ×3
jquery ×3
php ×3
codeigniter ×2
javascript ×2
validation ×2
alignment ×1
angularjs ×1
button ×1
flash ×1
html5 ×1
menu ×1
mysql ×1
noscript ×1