如何使用codeigniter创建主页?
该页面应包含一些链接,如登录,注册等.
我跟着啧啧创建了一个登录界面.但它只为此目的制作了codeigniter.这是我正在谈论的网站:
http://tutsmore.com/programming/php/10-minutes-with-codeigniter-creating-login-form/
所以基本上我尝试的是,使用codeigniter来做更多的事情,而不仅仅是一个登录表单.
我尝试routes.php我设置这些设置:
$route['default_controller'] = "mainpage";
$route['login'] = "login";
Run Code Online (Sandbox Code Playgroud)
我的mainpage.php文件:
class Mainpage extends Controller
{
function Welcome()
{
parent::Controller();
}
function index()
{
$this->load->view('mainpage.html');
}
}
Run Code Online (Sandbox Code Playgroud)
Mainpage.html:
<HTML>
<HEAD>
<TITLE></TITLE>
<style>
a.1{text-decoration:none}
a.2{text-decoration:underline}
</style>
</HEAD>
<BODY>
<a class="2" href="login.php">login</a>
</BODY>
</HTML>
Run Code Online (Sandbox Code Playgroud)
Login.php看起来与我在此帖子中提供链接的网站中的内容完全相同:
Class Login extends Controller
{
function Login()
{
parent::Controller();
}
function Index()
{
$this->load->view('login_form');
}
function verify()
{
if($this->input->post('username'))
{ //checks whether the form has been submited
$this->load->library('form_validation');//Loads the form_validation library class
$rules = array( …
Run Code Online (Sandbox Code Playgroud) 我需要使用堆栈数据结构来保存字符串.但是这个堆栈将从多个线程访问.所以我的问题是,如何使用ConcurrentStack从多个线程添加数据?
我正在学习本教程,并尝试在userprofile表中添加一些新列.我试图创建一个新表.
public class UsersContext : DbContext
{
public UsersContext()
: base("DefaultConnection")
{
}
public DbSet<UserProfile> UserProfiles { get; set; }
public DbSet<TestTabel> TestTabel { get; set; }
}
[Table("UserProfile")]
public class UserProfile
{
[Key]
[DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
public int UserId { get; set; }
public string UserName { get; set; }
public string Mobile { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
}
[Table("TestTabel")]
public class TestTabel
{
[Key]
[DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] …
Run Code Online (Sandbox Code Playgroud) 如何使用内存流创建文件并写入文件?我需要使用memorystream来防止其他线程尝试访问该文件.
我试图保存到文件的数据是html.
如何才能做到这一点?
如何写入linq查询中的文件?或者调用写入文件的自定义函数?我正在比较图片的相似性.并希望检查已在日志文件中相互比较的文件.因为有些图片标记为相似但不是.
提前致谢!
[编辑]
linq查询只是:
IEnumerable<PicInfo> t = from f in lista
from q in listb
where (((64 - BitCount(f.visualCharHash ^ q.visualCharHash)) * 100.0) / 64.0 == 100)
Run Code Online (Sandbox Code Playgroud)
这里没有写文件的文字.简单地说,因为我不知道如何这样做.和谷歌没有找到任何显示如何做到这一点的结果.
但它确实显示'写linq查询'
没有结果'在linq查询中写入文件'.
[/编辑]
我有一个启用并配置为使用我的数据库和一些额外的表/字段的ASP.NET-MVC
应用程序.Migration
SimpleMemberShipProvider
我的问题是,我的数据库初始化在哪里?因为我还在开发它,我可以删除数据库/表和数据并重新创建它.
我已将它放在configuration.cs文件中,但我不确定这是否是数据库初始化程序的位置.
namespace CFContext.Migrations
{
using System;
using System.Data.Entity;
using System.Data.Entity.Migrations;
using System.Linq;
using WebMatrix.WebData;
using System.Web.Security;
using System.Collections.Generic;
internal sealed class Configuration : DbMigrationsConfiguration<DataContext>
{
public Configuration()
{
Database.SetInitializer(new DropCreateDatabaseAlways<DataContext>());
//Database.SetInitializer(new DropCreateDatabaseIfModelChanges<DataContext>());
AutomaticMigrationsEnabled = true;
AutomaticMigrationDataLossAllowed = true;
}
protected override void Seed(DataContext context)
{
// This method will be called after migrating to the latest version.
// You can use the DbSet<T>.AddOrUpdate() helper extension method
// to avoid creating duplicate seed data. E.g. …
Run Code Online (Sandbox Code Playgroud) 如何使用codeigniter验证电子邮件地址?我刚刚阅读了手册,我找不到这个.
通过电子邮件验证,我的意思是您在社区论坛上注册时看到的完全相同的验证.
提前致谢!
我想知道为什么你仍然会使用ASP而不是Silverlight,因为有了silverlight,你可以做很多事情.你不必使用css,jquery,js,html等.
同样使用silverlight,您可以通过ria服务调用数据库.
我只能想到一个原因,即不是每个人都安装了这个插件.但那仅仅是时间问题.
只是好奇你们怎么想这个主题.
如何首先使用代码将EF 5.0与成员资格提供程序集成?
我有自己的数据库架构,我想用它来注册用户等.
membership-provider code-first asp.net-mvc-4 entity-framework-5 simplemembership
我在运行时收到此错误消息
LINQ to Entities 无法识别方法 'Int64 Max(Int64, Int64)' 方法,并且此方法无法转换为存储表达式。
当我尝试这样做时:
return _dbContext.Appointment.Where(x => Math.Max(x.Appointment.StartTime.Ticks, startTime.Ticks) <= Math.Min(x.Appointment.EndTime.Ticks, endTime.Ticks));
Run Code Online (Sandbox Code Playgroud)
此查询背后的想法是“如果最晚的开始时间早于最早的结束时间,那么您在日期和时间上会有一些重叠/接触”。
有没有办法让这条线工作?我已经检查过是否EntityFunctions
有“东西”,但事实并非如此。
c# ×5
codeigniter ×2
php ×2
asp.net ×1
code-first ×1
compare ×1
database ×1
image ×1
linq ×1
memorystream ×1
silverlight ×1
stack ×1