Auto login
micasa
22/04/2008 20:25:00Ik 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:
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:
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?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);
?>
$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);
?>