Welcome Guest, Not a member yet? Register   Sign In
  Email verf.
Posted by: El Forum - 06-25-2007, 10:28 AM - No Replies

[eluser]Lol![/eluser]
Hello!
I have the code:

Code:
<?
echo form_open('cliente/cadastro');

echo form_hidden('id_cliente', $cliente['id_cliente']);

$page_redirect = isset($page_redirect) ? $page_redirect : 'login_ok';
echo form_hidden('redirect', $page_redirect);
?>
<table align='center'>
  <tr>
    <td>* Nome:</td>
    <td>&lt;?=form_input('nome', $cliente['nome']);?&gt;</td>
  </tr>
  <tr>
    <td>Nascimento:</td>
    <td>&lt;?=form_input('nascimento',$cliente['nascimento']);?&gt;</td>
  </tr>
  <tr>
    <td>Endereço:</td>
    <td>&lt;?=form_input('endereco', $cliente['endereco']);?&gt;</td>
  </tr>
  <tr>
    <td>Complemento:</td>
    <td>&lt;?=form_input('complemento',$cliente['complemento']);?&gt;</td>
  </tr>
  <tr>
    <td>Bairro:</td>
    <td>&lt;?=form_input('bairro', $cliente['bairro']);?&gt;</td>
  </tr>
  <tr>
    <td>CEP:</td>
    <td>&lt;?=form_input('cep', $cliente['cep']);?&gt;</td>
  </tr>
  <tr>
    <td>Cidade:</td>
    <td>&lt;?=form_input('cidade', $cliente['cidade']);?&gt;</td>
  </tr>
  <tr>
    <td>Estado:</td>
    <td>&lt;?=form_input('estado', $cliente['estado']);?&gt;</td>
  </tr>
  <tr>
    <td>* DDD:</td>
    <td>&lt;?=form_input('ddd_tel', $cliente['ddd_tel']);?&gt;</td>
  </tr>
  <tr>
    <td>* Telefone:</td><td>&lt;?=form_input('telefone', $cliente['telefone']);?&gt;</td>
  </tr>
  <tr>
    <td>DDD:</td>
    <td>&lt;?=form_input('ddd_cel', $cliente['ddd_cel']);?&gt;</td>
  </tr>
  <tr>
    <td>Celular:</td>
    <td>&lt;?=form_input('celular', $cliente['celular']);?&gt;</td>
  </tr>
  <tr>
    <td>* Email:</td>
    <td>&lt;?=form_input('email', $cliente['email']);?&gt;</td>
  </tr>
  <tr>
    <td>CPF/CNPJ:</td>
    <td>&lt;?=form_input('cpf_cnpj', $cliente['cpf_cnpj']);?&gt;</td>
  </tr>
  <tr>
    <td>RG/Insc.Est.:</td>
    <td>&lt;?=form_input('rg_inscest', $cliente['rg_inscest']);?&gt;</td>
  </tr>
  <tr>
    <td>* Senha:</td>
    <td>&lt;?=form_password('senha', $cliente['senha']);?&gt;</td>
  </tr>
  <tr>
    <td align='center'>&lt;?=form_submit('', 'Salvar');?&gt;</td><td>Os campos com * são obrigatórios</td>
  </tr>
</table>

&lt;?
echo form_close()
?&gt;

How I call an email verification at the "* Email" form?


See ya!


  Character Encoding
Posted by: El Forum - 06-25-2007, 09:20 AM - No Replies

[eluser]pmonty[/eluser]
I am not sure if this is a PHP question or a CI question.

I am building an app that has MSSQL as the backend. I am pulling a uniqueid field from a table to use as a value in a cookie

The value in my table is this:

Quote:D38A0490-4F74-4B72-A954-D13E29F1C27F

The value displayed in the page I am using to test the value is this (with UTF-8 encoding):

Quote:ŠÓtOrK©TÑ>)ñÂ

The value in the cookie as passed to the browser with the helper function set_cookie() is:

Quote:&#x90;&#x04;&#x8A;&#xD3;tOrK&#xA9;T&#xD1;&#x3E;&#x29;&#xF1;&#xC2;&#x7F;

I would like to be able to test the cookie on subsequent page loads for permissions and so forth. Apart from using session id's is there something in CI that I can use to make the table value show in my page and "Set" in my cookie consistent with the value displayed in my backend or is this a browser issue that I will need to play with?

Paul

Addendum: I believe the encoding is happening within the PHP query process. Retrieving the value and then re-querying the table using the uniqueid as PHP presents it gives me a database error "converting character string to uniqueidentifier." I am going to look for some info on this but if anyone has firsthand knowledge of the issue and can point me to a work around, I would be appreciative.

Addendum 2: Work around is using this in the SELECT statement CAST(myuniqueidentifier_field as VARCHAR(36)) as CGUID. This gives me all the right cookie, html encoding and all the other stuff and works in subsequent queries using the value as the search parameter.


  Use one model within another
Posted by: El Forum - 06-25-2007, 09:13 AM - No Replies

[eluser]Peter Ivanov[/eluser]
Hello is it possible to
use the functions from one model within a function in another model


  Bug in Email class caused issue when used with qmail due to crlf - [SOLVED]
Posted by: El Forum - 06-25-2007, 06:06 AM - No Replies

[eluser]yongkhun[/eluser]
I have faced lots of issues with the email class in CodeIgniter. When I tried to send email using SMTP, it gives me error as follow:

Code:
-----------------------------------------
220 qmail-relay-norm-0.netfirms.com ESMTP

hello: 250-qmail-relay-norm-0.netfirms.com
250-AUTH LOGIN CRAM-MD5 PLAIN
250-AUTH=LOGIN CRAM-MD5 PLAIN
250-PIPELINING
250 8BITMIME
from: 250 ok
to: 250 ok
data: 354 go ahead
451 See http://pobox.com/~djb/docs/smtplf.html.
The following SMTP error was encountered: 451 See http://pobox.com/~djb/docs/smtplf.html.
Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method.

User-Agent: Silkron
Date: Mon, 25 Jun 2007 19:59:22 +0800
From: "Fonod"
Return-Path:
To: [email protected]
Subject: Fonod: Testing email
Reply-To: "[email protected]"
X-Sender: [email protected]
X-Mailer: Silkron
X-Priority: 3 (Normal)
Message-ID: <[email protected]>
Mime-Version: 1.0


Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

testing
---------------------------------------


  basic doubts in codeigniter
Posted by: El Forum - 06-25-2007, 04:47 AM - No Replies

[eluser]maddy_ssn[/eluser]
hi 2 everyone.i am new 2 codeigniter so please guide me to open codeigniter i can't get the index.php page.anyone explain how 2 implement and run the codeigniter.

Maddy


  I password protected the codeigniter directory
Posted by: El Forum - 06-25-2007, 03:22 AM - No Replies

[eluser]adam2484[/eluser]
and now my site won't work. the homepage medicineapplications.co.uk works fine but any links off it won't work.

Can anybody help please?

thanks


  Long query?
Posted by: El Forum - 06-25-2007, 02:10 AM - No Replies

[eluser]thachp[/eluser]

Code:
SELECT xxx.id as postid,
        xxx.title as title,
        xxx.description as description,
        xxx.recepient_id as recepient,
        xxx.vote as vote,
        yyy.id as userid,
        yyy.sml_picture as smallpix,
        yyy.username as username,
        zzz.name as category,
        aaa.name as relationship,
        yyy2.username as rec_name,
        yyy2.sml_picture as rec_img,
        xxx.date as date
        FROM xxx
        LEFT JOIN yyy
        ON yyy.id = xxx.user
        LEFT JOIN zzz
        ON zzz.id = xxx.channel
        LEFT join aaa
        ON aaa.id = xxx.relationship
        LEFT join yyy as yyy2
        ON xxx.recepient_id = yyy2.id
        WHERE xxx.active = 1
        ORDER BY xxx.date desc

You think my sql is too long? is it okay to have query this long for CI?


  login system, how to go from controller to view to model
Posted by: El Forum - 06-24-2007, 11:22 PM - No Replies

[eluser]jvittetoe[/eluser]
i am trying to figure out the basic pipeline for a simple login process. users come to the home page, which loads the home controller and home view. the home view contains a simple form for logging in. when they submit, i load the login controller which loads the login model which queries the useraccounts table in my database. if the user exists the login model will load the users dashboard view, if the user doesnt exist or bad info, the login model will load the home view again. is this the proper pipeline? let me post my files.

home view

Code:
<h2>Login In</h2>
    <p>Fill out the form below to login to your account!</p>
    &lt;?php echo form_open('login');?&gt;
    
        <label for="username">Username</label><br />
        &lt;input  type="text" name="username" id="username" /&gt;<br />
        <label for="password">Password</label><br />
        &lt;input  type="password" name="password" id="password" /&gt;<br />
        &lt;input type="submit" value="Login" /&gt;
        
    &lt;/form&gt;

login controller
Code:
&lt;?php

    class Login extends Controller{
    
        function Login(){
        
            parent::Controller();
            $this->load->helper( array('url', 'form') );
        }
        
        function index(){
        
            $this->load->model('Login_model','', TRUE);
            $this->load->view('dashboard'); //send user to their dashboard
        }
    
    }

?&gt;

login model
Code:
&lt;?php

class Login_model extends Model{

    
    function Login_model(){
        
        parent::Model();
    }
    
    function login($username = '', $password = ''){
    
        if($user){
            $sql = $this->db->query("SELECT * FROM useraccounts WHERE usernamr = $username and password = md5($password)");
            if($sql->num_rows() > 0){
                return true;
            }
        } else {
            return false;
        }
    
    
    
        /*
        
        var $username = $_POST['username'];
        var $password = $_POST['password'];
    
        $sql = "SELECT uuid ";
        $sql .= "FROM useraccounts ";
        $sql .= "WHERE username='$username' AND password=MD5('$password') ";
        
        $result = mysql_query($sql);
        $row = mysql_fetch_assoc($result);
        $uuid = $row['uuid'];
        
        if($uuid > 0) {
            
            session_start();
            
            $_SESSION['logged_in'] = TRUE;
            
            $data['title'] = "Welcome to MyFi ~ A Personal Finance Web Application // My Home";
            $this->load->view('userHome', $data);
            echo 'workeded';
            echo $uuid;
            echo $username;
            echo $password;
        }
        else {
            $this->load->view('login_v', $data);
            echo 'brokeded';
            echo $uuid;
            echo $username;
            echo $password;
        }
        
        */
    }
    
}

?&gt;

these files are still pretty bare, i just want to amke sure im headed in the right direction and i have the basic concepts down. thanks.


  fatal error - SOLVED
Posted by: El Forum - 06-24-2007, 06:17 PM - No Replies

[eluser]jvittetoe[/eluser]
Fatal error: Call to undefined function: anchor() in /home/suited84/public_html/pr0jects/myFi/system/application/views/home_v.php on line 13

i have decided to build my app on my website instead of locally. when i try to load home page im givin this error.

home_v.php

Code:
<li>&lt;?php echo anchor('home', 'Home'); ?&gt;</li>


  An evil timesaving secret for all!
Posted by: El Forum - 06-24-2007, 04:58 PM - No Replies

[eluser]Phil Sturgeon[/eluser]
Wanna know how to save yourself 3 months of your life in code-time?

Stop writing &lt;?=base_url();?&gt; all the damn time and use /, will save you AAAAAAAAGGGGGGGGGEEEEEEEEESSSS/ Im unsure why so many people keep doing this, seems crazy to me :p

I guess many people don't know about it.

Remember:

Quote:<a href="/">Go Home!</a>

Does what it says on the tin!


Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Latest Threads
Update from 4.6.0 to 4.6....
by captain-sensible
8 hours ago
Ajax post failing with Ty...
by vitnibel
Yesterday, 08:52 PM
MVC vs MVCS vs CodeIgnite...
by FlavioSuar
Yesterday, 10:33 AM
CodeIgniter Shield 1.0.0 ...
by timesprayer
Yesterday, 05:22 AM
Website Traffic Drop Afte...
by InsiteFX
Yesterday, 04:23 AM
Magic login link not work...
by InsiteFX
Yesterday, 04:16 AM
Is codeigniter 5 upco...
by InsiteFX
Yesterday, 04:10 AM
CI4 Auto-Discovery not wo...
by InsiteFX
05-09-2025, 11:04 PM
Why PHP is still worth le...
by InsiteFX
05-09-2025, 10:55 PM
Any user guid or video o...
by msnisha
05-09-2025, 02:30 PM

Forum Statistics
» Members: 145,300
» Latest member: twitframecom4
» Forum threads: 78,386
» Forum posts: 379,436

Full Statistics

Search Forums

(Advanced Search)


Theme © iAndrew 2016 - Forum software by © MyBB