CI框架中的小疑点

WBOY
Release: 2016-06-13 12:07:55
Original
837 people have browsed it

CI框架中的小问题
视图文件如下

<br /><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><br /><html xmlns="http://www.w3.org/1999/xhtml"><br /><head><br /><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><br /><title>无标题文档</title><br /></head><br /><br /><body style="text-align:center"><br /><br /><!--替换表单--><br /><form action="../hao/updata" method="POST" name="updata"><br /><input type="submit" name="updata" value = "替换"/><br /></from><br><br /><br /><br /><br /><!--删除表单--><br /><form action="../hao/delete" method="POST" name="delete">	   <br /><input type="submit" name="delete" value = "删除"/><br /></form><br /><br /></body><br /></html><br />
Copy after login

控制器如下:
<br /><?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');<br />class Hao extends CI_Controller {<br /><br />    public function __construct()<br />    {<br />	    parent::__construct();<br />	}<br /><br />	function delete()<br />	{<br />		$this->load->view('kk');<br />		echo $_POST['delete'];<br />	}<br /><br />	function updata()<br />	{<br />		$this->load->view('kk');<br />		echo $_POST['updata‘];<br />	}<br /><br />	function show()<br />	{<br />		$this->load->view('kk');<br />	}<br />}<br />?><br />
Copy after login

这个程序有问题,我调用了show()方法后显示出两个按钮,一个替换,一个删除,点击替换会转向updata函数,然后输出按钮名字,可是点击删除还是转向updata然后报错,但是如果删除替换按钮后剩下删除按钮后又可以成功提交。 我的删除按钮文件提交地址都对啊。求大神帮忙解决
------解决思路----------------------
说你什么好呢,明显是前台html的问题, 看你的表单, form , from都写错了
------解决思路----------------------
action写错了,应该用ci的内置的函数

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template