Welcome Guest, Not a member yet? Register   Sign In
Help - Forms
#1

[eluser]neoevents[/eluser]
I just went step by step through it, and I still can't get my form to work. Whenever I hit sumbit it goes to: http://127.0.0.1/CodeIgniter/index.php/form (which is a error). Why won't it submit?

Thanks
#2

[eluser]abmcr[/eluser]
Post the code
#3

[eluser]neoevents[/eluser]
views/applyforpartnerform.php :
Code:
<html>
<head>
<title>Apply For Partner/Affiliate</title>
</head>
<body>

<?php echo $this->validation->error_string; ?>

<?php echo form_open('form'); ?>

<h5>Site URL:</h5>
&lt;input type="text" name="site" value="&lt;?php echo $this-&gt;validation->site;?&gt;" size="50" />

<h5>Applying for Partner or Affilate?</h5>
&lt;input type="text" name="which" value="&lt;?php echo $this-&gt;validation->which;?&gt;" size="50" />

<h5>Button IMG URL:</h5>
&lt;input type="text" name="img" value="&lt;?php echo $this-&gt;validation->img;?&gt;" size="50" />

<h5>Email Address:</h5>
&lt;input type="text" name="email" value="&lt;?php echo $this-&gt;validation->email;?&gt;" size="50" />

<h5>Confirm Email Address:</h5>
&lt;input type="text" name="emailcon" value="&lt;?php echo $this-&gt;validation->emailcon;?&gt;" size="50" />

<h5>Why should we pick you?</h5>
&lt;input type="text" name="why" value="&lt;?php echo $this-&gt;validation->why;?&gt;" size="50" />

<div>&lt;input type="submit" value="Submit" /&gt;</div>

&lt;/form&gt;

&lt;/body&gt;
&lt;/html&gt;

/views/formsuccess.php :
Code:
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;My Form&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;

<h3>Your form was successfully submitted!</h3>

<p>&lt;?php echo anchor('form', 'Try it again!'); ?&gt;</p>

&lt;/body&gt;
&lt;/html&gt;

controllers/form.php :
Code:
&lt;?php

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

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

        $rules['site']    = "required";
        $rules['which']    = "required";
        $rules['img']    = "required";
                $rules['email'] = "required|valid_email|matches[emailcon]";
                $rules['emailcon'] = "required|valid_email";
        $rules['why']    = "required";

        $fields['site'] = 'What is the address of your site?';
        $fields['which'] = 'Are you applying to become a partner or affilate?';
        $fields['img'] = 'Enter your affiliate or partner button here.';
        $fields['email'] = 'Put your email address here.';
        $fields['emailcon'] = 'Confirm email address here.';
        $fields['why'] = 'Explain why we should here.';

        $this->validation->set_fields($fields);
        
        $this->validation->set_rules($rules);
                
        if ($this->validation->run() == FALSE)
        {
            $this->load->view('applyforpartnerform');
        }
        else
        {
            $this->load->view('formsuccess');
        }
    }
}
?&gt;
#4

[eluser]abmcr[/eluser]
But i have try... and all work fine....the form, after the submit, go to form controller and if validation is ok the view formsuccess is loaded
#5

[eluser]neoevents[/eluser]
Than why I am getting "Firefox can't establish a connection to the server at 127.0.0.1."?
#6

[eluser]abmcr[/eluser]
[quote author="neoevents" date="1214010494"]Than why I am getting "Firefox can't establish a connection to the server at 127.0.0.1."?[/quote]but you have an apache server in your pc/MAC?




Theme © iAndrew 2016 - Forum software by © MyBB