PHP interesse |
|
Ik wil dat bezoekers automatisch kunnen inloggen op mijn demo site.
Hiervoor moet het paswoord en de gebruikersnaam als zijn ingevult en de bezoeker dient alleen op login te drukken. Hoe moet ik dit doen?
Ik heb momenteel:
<?php
$heading = array();
$contents = array();
if (tep_db_num_rows($admins_check_query) > 0) {
$heading[] = array('text' => '<b>' . HEADING_TITLE . '</b>');
$contents = array('form' => tep_draw_form('login', FILENAME_LOGIN, 'action=process'));
$contents[] = array('text' => TEXT_USERNAME . '<br />' . tep_draw_input_field('username'));
$contents[] = array('text' => '<br />' . TEXT_PASSWORD . '<br />' . tep_draw_password_field('password'));
$contents[] = array('align' => 'left', 'text' => '<br /><input type="submit" value="' . BUTTON_LOGIN . '" />');
} else {
$heading[] = array('text' => '<b>' . HEADING_TITLE . '</b>');
$contents = array('form' => tep_draw_form('login', FILENAME_LOGIN, 'action=create'));
$contents[] = array('text' => TEXT_CREATE_FIRST_ADMINISTRATOR);
$contents[] = array('text' => '<br />' . TEXT_USERNAME . '<br />' . tep_draw_input_field('username'));
$contents[] = array('text' => '<br />' . TEXT_PASSWORD . '<br />' . tep_draw_password_field('password'));
$contents[] = array('align' => 'center', 'text' => '<br /><input type="submit" value="' . BUTTON_CREATE_ADMINISTRATOR . '" />');
}
$box = new box;
echo $box->infoBox($heading, $contents);
?>
<?php if (tep_db_num_rows($admins_check_query) > 0) { $heading[] = array('text' => '<b>' . HEADING_TITLE . '</b>'); $contents = array('form' => tep_draw_form ('login', FILENAME_LOGIN , 'action=process')); $contents[] = array('text' => TEXT_USERNAME . '<br />' . tep_draw_input_field ('username')); $contents[] = array('text' => '<br />' . TEXT_PASSWORD . '<br />' . tep_draw_password_field ('password')); $contents[] = array('align' => 'left', 'text' => '<br /><input type="submit" value="' . BUTTON_LOGIN . '" />'); } else { $heading[] = array('text' => '<b>' . HEADING_TITLE . '</b>'); $contents = array('form' => tep_draw_form ('login', FILENAME_LOGIN , 'action=create')); $contents[] = array('text' => TEXT_CREATE_FIRST_ADMINISTRATOR ); $contents[] = array('text' => '<br />' . TEXT_USERNAME . '<br />' . tep_draw_input_field ('username')); $contents[] = array('text' => '<br />' . TEXT_PASSWORD . '<br />' . tep_draw_password_field ('password')); $contents[] = array('align' => 'center', 'text' => '<br /><input type="submit" value="' . BUTTON_CREATE_ADMINISTRATOR . '" />'); } $box = new box; echo $box->infoBox($heading, $contents); ?>
|