我試圖創建一個使用笨3.登記表這個問題是當我嘗試在每個輸入增加價值是這樣的:Codeigniter - 爲什麼爲輸入表單創建值會使整個頁面搞砸?
value="<?php echo set_value('name'); ?>"
這是我的看法content_register.php:
<form class="usr-input" action="/users" method="post">
<div>
<label for="name">Nama Lengkap<span style="padding-left: 90px;">:</span></label>
<input id="name" name="name" size="40" type="text" value="<?php echo set_value('name'); ?>"/>
<br>
<label for="username">Username<span style="padding-left: 124px;">:</span></label>
<input id="username" name="username" size="40" type="text" value="<?php echo set_value('username'); ?>"/>
<br>
<label for="password">Password<span style="padding-left: 125px;">:</span></label>
<input id="password" name="password" size="40" type="password" value="<?php echo set_value('password'); ?>"/>
<br>
<label for="email">Email<span style="padding-left: 155px;">:</span></label>
<input id="email" name="email" size="40" type="text" value="<?php echo set_value('email'); ?>"/>
<br>
<label for="telepon">No. Telepon<span style="padding-left: 111px;">:</span></label>
<input id="telepon" name="telepon" size="40" type="text" value="<?php echo set_value('phone'); ?>"/>
<br>
<label for="sex">Jenis Kelamin<span style="padding-left: 96px;">:</span></label>
<select>
<option value="male">Laki-laki</option>
<option value="female">Perempuan</option>
</select>
<br>
<label for="alamat">Alamat<span style="padding-left: 146px;">:</span></label>
<textarea id="alamat" name="alamat" rows="5" cols="71" type="text" value="<?php echo set_value('name'); ?>"/></textarea>
<br>
<input type="checkbox" name="vehicle" value="Bike"> Saya telah membaca dan menerima<a href="register"> Syarat dan Peraturan </a>dari .</input>
</div>
</form>
之前我添加值(這樣的代碼:)
<form class="usr-input" action="/users" method="post">
<div>
<label for="name">Nama Lengkap<span style="padding-left: 90px;">:</span></label>
<input id="name" name="name" size="40" type="text" />
<br>
<label for="username">Username<span style="padding-left: 124px;">:</span></label>
<input id="username" name="username" size="40" type="text" />
<br>
<label for="password">Password<span style="padding-left: 125px;">:</span></label>
<input id="password" name="password" size="40" type="password" />
<br>
<label for="email">Email<span style="padding-left: 155px;">:</span></label>
<input id="email" name="email" size="40" type="text" />
<br>
<label for="telepon">No. Telepon<span style="padding-left: 111px;">:</span></label>
<input id="telepon" name="telepon" size="40" type="text" />
<br>
<label for="sex">Jenis Kelamin<span style="padding-left: 96px;">:</span></label>
<select>
<option value="male">Laki-laki</option>
<option value="female">Perempuan</option>
</select>
<br>
<label for="alamat">Alamat<span style="padding-left: 146px;">:</span></label>
<textarea id="alamat" name="alamat" rows="5" cols="71" type="text" /></textarea>
<br>
<input type="checkbox" name="vehicle" value="Bike"> Saya telah membaca dan menerima<a href="register"> Syarat dan Peraturan </a>dari .</input>
</div>
</form>
UPDATE 這裏的控制器:
<?php
class page extends CI_Controller {
function __construct() {
parent::__construct();
// path to simple_html_dom
}
function index() {
$this->load->view('page_header');
$this->load->view('content_front');
$this->load->view('page_footer');
}
function login() {
$this->load->view('page_header');
$this->load->view('content_login');
$this->load->view('page_footer');
}
function register() {
$this->load->view('page_header');
$this->load->view('content_register');
$this->load->view('page_footer');
}
}
?>
你能幫我什麼不對的代碼?或者我想念的任何信息? 謝謝。
PLZ共享控制器代碼。 – Sharif
'action =「/ users」'這是什麼**錯誤的網址** –
謝謝@AbdullaNilam。這實際上是問題所在。非常感謝你 – bnrfly