Tuesday, May 31, 2011

Static Username

I am attempting to create a login.ctp page that takes the username and
password from global environment variables and automatically performs
a login. I can't seem to figure out how to make an input form accept
"static text" rather than creating an input box.

<h2>Login</h2>
<?php
$user = getenv('user');
$pass = getenv('pass');
echo $form->create('User', array('url' =>
array('controller' => 'users', 'action' =>'login')));
echo $form->input('User.username', array($user));
echo $form->input('User.password', array($pass));
echo $form->end('Login');
?>

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

No comments: