Welcome Guest, Not a member yet? Register   Sign In
[solved] POST datas not found
#5

Controller: 

PHP Code:
public function addserver(){
 
       // Varibles
 
       $game $this->input->post('game');
 
       $country $this->input->post('country');
 
       $ip $this->input->post('ip');
 
       $port $this->input->post('port');
 
       $qport $this->input->post('query_port');
 
       $captcha $this->input->post('captcha');
 
       $captchaSession $this->session->userdata('code');
 
       // Our error
 
       $error "";
 
       // Let's check
 
       if($game == 0){
 
           $error "Select a game !";
 
       } elseif($country == 0){
 
           $error "Select a country !";
 
       } elseif(ctype_space($ip)){
 
           $error "You must write a DNS / IP Address !";
 
       } elseif(ctype_space($port) || ctype_space($qport)){
 
           $error "You must write Port / Query Port !";
 
       } elseif(strlen($captcha) != strlen($captchaSession)){
 
           $error "Your Captcha is invalid !";
 
       } else {
 
           $v 1;
 
           for($i=0;$i<=5;$i++){    
                if
($captcha[$i]!= $captchaSession[$i]){    
                    $v
=0;
 
                   break;
 
               }
 
           }
 
           if($v == 0){
 
               $error "Your Captcha is invalid !";
 
           } else {
 
               $error "Success";
 
           }
 
       }
 
       $this->session->set_flashdata('addMessage'$error);
 
       redirect(base_url());
 
   

Form:

Code:
<form role="form" action="addserver" method="POST">
                                    <tr>
                                        <td colspan="2"><i class='fa fa-gamepad lblue'></i> Game Type
                                            <select name="game" class="form-control" id="game" required/>
                                                <option value="0" selected="true" disabled> Select a game</option>
                                                <?php echo $this->settings->getGames();?>
                                            </select>
                                        </td>
                                        <td>
                                            <i class='fa fa-globe red'></i> Country
                                            <select name="country" class="form-control" required/>
                                                <option value="RO">Romania</option>
                                            </select>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td><i class='fa fa-location-arrow pink'></i> IP / DNS Address<input type="text" class="form-control input-lg" name="ip" placeholder="e.g: csgo.domain.com / 125.23.51.29" autocomplete="off" required/></td>
                                        <td><i class='fa fa-location-arrow green'></i> Port<input type="text" class="form-control input-lg numOnly" id="port" name="port" maxlength="5" autocomplete="off" placeholder="27015" required/></td>
                                        <td><i class='fa fa-location-arrow green'></i> Query Port<input type="text" class="form-control input-lg numOnly" id="query_port" name="query_port" maxlength="5" autocomplete="off" placeholder="27015" required/></td>
                                    </tr>
                                    <tr>
                                        <td><center><?php echo img(array('src'=>base_url('captcha'),'id'=>'captcha','border'=>'0'));?><br /><a onclick="loadimgs()"><font color="green"><i class='fa fa-refresh'></i></font> Refresh</a></center></td>
                                        <td><input class="form-control input-lg numOnly" name="captcha" type="text" maxlength="6" placeholder="Captcha" autocomplete="off" required /></td>
                                        <td><center><div class="checkbox"><label><input type="checkbox" value="1" required>I accept <u><a href="#">Terms & Conditions</a></u> of this website !</label></div></center></td>
                                    </tr>
                                    <tr>
                                        <td><center><button type="reset" class="btn btn-warning btn-block btn-sm"><i class='fa fa-trash'></i> Reset</button></center></td>
                                        <td colspan="2"><center><button class="btn btn-success btn-sm btn-block" type="submit" name="query"><i class='fa fa-check'></i> Add this server !</button></td>
                                    </tr>
                                </form>
Reply


Messages In This Thread
[solved] POST datas not found - by gaska96 - 04-30-2016, 04:27 AM
RE: POST datas not found - by InsiteFX - 04-30-2016, 10:23 AM
RE: POST datas not found - by gaska96 - 05-01-2016, 01:08 AM
RE: POST datas not found - by InsiteFX - 05-01-2016, 03:52 AM
RE: POST datas not found - by gaska96 - 05-01-2016, 04:00 AM
RE: POST datas not found - by Wouter60 - 05-01-2016, 06:30 AM
RE: POST datas not found - by gaska96 - 05-01-2016, 02:13 PM
RE: POST datas not found - by Wouter60 - 05-01-2016, 02:18 PM
RE: POST datas not found - by gaska96 - 05-02-2016, 01:30 AM



Theme © iAndrew 2016 - Forum software by © MyBB