Skip to content

Commit

Permalink
infinite load fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
cws13003 committed Nov 29, 2017
1 parent 593d80e commit ab67490
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 6 deletions.
14 changes: 14 additions & 0 deletions www/application/controllers/Form.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

class Form extends CI_Controller {
public function index(){
$this->load->helper(array('form', 'url'));

$this->load->library('form_validation');

if ($this->form_validation->run() == FALSE)
$this->load->view('register');
else
$this->load->view('register_success')
}
}
2 changes: 1 addition & 1 deletion www/application/views/pages/home.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php echo "Tweets!"; ?>
<?php echo "This is the homepage with a list of all tweets."; ?>
2 changes: 1 addition & 1 deletion www/application/views/pages/login.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php echo "Login!"; ?>
<?php echo "This is the login page for existing users.";?>
2 changes: 1 addition & 1 deletion www/application/views/pages/profile.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php echo "Profile!"; ?>
<?php echo "This is the profile view where you can read your tweets and write a new one."; ?>
23 changes: 23 additions & 0 deletions www/application/views/pages/register.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php
$this->load->library('form_validation');
echo validation_errors();
echo form_open('form'); ?>

<h5>Name</h5>
<input type="text" name="name" value="" size="50" />

<h5>Email Address</h5>
<input type="text" name="email" value="" size="50" />

<h5>Username</h5>
<input type="text" name="username" value="" size="50" />

<h5>Password</h5>
<input type="text" name="password" value="" size="50" />

<h5>Password Confirm</h5>
<input type="text" name="passconf" value="" size="50" />

<div><input type="submit" value="Submit" /></div>

</form>
3 changes: 3 additions & 0 deletions www/application/views/pages/register_success.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<h3>Your form was successfully submitted!</h3>

<p><?php echo anchor('form', 'Try it again!'); ?></p>
4 changes: 2 additions & 2 deletions www/application/views/templates/footer.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<em>&copy; 2017</em>
<script type="text/javascript" src="<?php echo base_url("assets/js/jQuery-1.10.2.js"); ?>"></script>
<script type="text/javascript" src="<?php echo base_url("assets/js/bootstrap.js"); ?>"></script>
<script type="text/javascript" src="assets/js/jQuery-1.10.2.js"></script>
<script type="text/javascript" src="assets/js/bootstrap.js"></script>
</body>
</html>
2 changes: 1 addition & 1 deletion www/application/views/templates/header.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<html>
<head>
<title>Twitter</title>
<link rel="stylesheet" href="<?php echo base_url("assets/css/bootstrap.css"); ?>" />
<link rel="stylesheet" href="assets/css/bootstrap.css"/>
</head>
<body>

Expand Down

0 comments on commit ab67490

Please sign in to comment.