Erweiterung der Login-Seite
Verfasst: 21.06.2006 09:48
Wie füge ich auf der Login-Seite eine Dropdownliste hinzu, sodass man je nach Auswahl beim Login-Klick auf eine andere Seite weitergeleitet wird?
Yo
Yo
phpBB.de - Die deutsche phpBB-Community
https://www.phpbb.de/community/
Code: Alles auswählen
<select name="redirect">
<option value="index.php">Index</option>
<option value="viewforum.php?f=1">Forum 1</option>
</select>
Ansonsten redirectet er immer auf index.phpif (!empty($HTTP_POST_VARS['redirect']) || !empty($HTTP_GET_VARS['redirect']))
{
$url = (!empty($HTTP_POST_VARS['redirect'])) ? htmlspecialchars($HTTP_POST_VARS['redirect']) : htmlspecialchars($HTTP_GET_VARS['redirect']);
$url = str_replace('&', '&', $url);
redirect(append_sid($url, true));
}
else
{
redirect(append_sid("index.$phpEx", true));
}
Nein!YoOoOoOo hat geschrieben:Ich denke, man müsste hier was ändern
...
Code: Alles auswählen
#---[ FIND ]---
<!-- BEGIN switch_allow_autologin -->
#---[ BEFORE ADD ]---
<tr>
<td width="45%" align="right"><span class="gen">Zielforum:</span></td>
<td>
<select name="zielurl">
<option value="">Foren-Übersicht</option>
<option value="viewforum.php?f=1">Forum 1</option>
<option value="viewforum.php?f=2">Forum 2</option>
</select>
</td>
</tr>
Code: Alles auswählen
#---[ FIND ]---
<input type="submit" class="mainoption" name="login" value="{L_LOGIN}" />
</span> </td>
</tr>
#---[ ADD AFTER ]---
<tr>
<td class="row1" align="center" valign="middle" height="28"><span class="gensmall">Zielforum:
<select name="zielurl">
<option value="">Foren-Übersicht</option>
<option value="viewforum.php?f=1">Forum 1</option>
<option value="viewforum.php?f=2">Forum 2</option>
</select>
</span> </td>
</tr>
Code: Alles auswählen
#---[ FIND ]---
if( $session_id )
{
$url = ( !empty($HTTP_POST_VARS['redirect']) ) ? str_replace('&', '&', htmlspecialchars($HTTP_POST_VARS['redirect'])) : "index.$phpEx";
redirect(append_sid($url, true));
}
#---[ REPLACE WITH ]---
if( $session_id )
{
$url = ( !empty($HTTP_POST_VARS['redirect']) ) ? str_replace('&', '&', htmlspecialchars($HTTP_POST_VARS['redirect'])) : (( !empty($HTTP_POST_VARS['zielurl']) ) ? str_replace('&', '&', htmlspecialchars($HTTP_POST_VARS['zielurl'])) : "index.$phpEx");
redirect(append_sid($url, true));
}
Code: Alles auswählen
<td>
<select name="zielurl">
<option value="groupcp.php">test gruppen</option>
</select></td>
Code: Alles auswählen
if( $session_id )
{
$url = ( !empty($HTTP_POST_VARS['redirect']) ) ? str_replace('&', '&', htmlspecialchars($HTTP_POST_VARS['redirect'])) : (( !empty($HTTP_POST_VARS['zielurl']) ) ? str_replace('&', '&', htmlspecialchars($HTTP_POST_VARS['zielurl'])) : "index.$phpEx");
redirect(append_sid($url, true));
}
Externe URLs geben eine Fehlermeldung, da die redirect-Funktion vor die angegebene Datei den Domain+Pfad deines Forum setzt. Gibst du anstelle einer Datei eine Url an, dann wird daraus: http:/ /www .deinedomain.tld/phpbb2/http://www.zieldomain.tld/zieldatei.htmlYoOoOoOo hat geschrieben:Aso, jetzt weiss ich, woran es lag. Ich hab eine externe URL verwendet![]()
Wie ist es möglich, dass ich auch externe URLs verwenden kann?