Contact.php
Geplaatst: 25 feb 2003, 19:21
Hoe hebben jullie http://www.phpbb-nl.com/contact.php gemaakt?
Want het lukt mij niet omdat met header en footer te maken.
Want het lukt mij niet omdat met header en footer te maken.
Code: Selecteer alles
<?php
/***************************************************************************
* contact.php
* -------------------
* Copyright: .::Neo::. neo@phpbb-nl.com
***************************************************************************/
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_FAQ);
init_userprefs($userdata);
//
// End session management
//
//
// Load the appropriate faq file
//
{
$lang_file = 'lang_faq';
$l_title = Contact;
}
include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/' . $lang_file . '.' . $phpEx);
//
// Lets build a page ...
//
$page_title = $l_title;
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
$template->set_filenames(array(
'body' => 'contact.tpl')
);
make_jumpbox('viewforum.'.$phpEx, $forum_id);
$template->assign_vars(array(
'L_FAQ_TITLE' => $l_title,
'L_BACK_TO_TOP' => $lang['Back_to_top'])
);
for($i = 0; $i < count($faq_block); $i++)
{
if( count($faq_block[$i]) )
{
$template->assign_block_vars('faq_block', array(
'BLOCK_TITLE' => $faq_block_titles[$i])
);
$template->assign_block_vars('faq_block_link', array(
'BLOCK_TITLE' => $faq_block_titles[$i])
);
for($j = 0; $j < count($faq_block[$i]); $j++)
{
$row_color = ( !($j % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
$row_class = ( !($j % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
$template->assign_block_vars('faq_block.faq_row', array(
'ROW_COLOR' => '#' . $row_color,
'ROW_CLASS' => $row_class,
'FAQ_QUESTION' => $faq_block[$i][$j]['question'],
'FAQ_ANSWER' => $faq_block[$i][$j]['answer'],
'U_FAQ_ID' => $faq_block[$i][$j]['id'])
);
$template->assign_block_vars('faq_block_link.faq_row_link', array(
'ROW_COLOR' => '#' . $row_color,
'ROW_CLASS' => $row_class,
'FAQ_LINK' => $faq_block[$i][$j]['question'],
'U_FAQ_LINK' => '#' . $faq_block[$i][$j]['id'])
);
}
}
}
$template->pparse('body');
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
?>
Code: Selecteer alles
<?php
$script_file_name = "contact1.php";
$toaddress = "neo@phpbb-nl.com"; //Naar ontvanger
$subject = "phpBB-NL Contact Form"; //Onderwerp
$fromaddress = "bugs@phpbb-nl.com"; //Gestuurd door
$success_message = "<br><br><center><b>Uw bericht is verstuurt!<br>Klik links boven om terug te gaan naar het Forum!</b></center>";
// Verder Nix wijzigen!
?>
<?php
function form(){
?>
<center>
<form action="<?php echo $script_file_name; ?>" method="post">
<table>
<tr>
<td> Gebruikersnaam: </td>
<td>
<input type="text" name="fullname">
</td>
</tr>
<tr>
<td> Soort Bericht: </td>
<td>
<select name="sendto">
<option value="bug">Bugs</option>
<option value="suggestie">Suggestie</option>
<option value="anders">Anders...</option>
</select>
</td>
</tr>
<tr>
<td> E-Mail Adres: </td>
<td>
<input type="text" name="email">
</td>
</tr>
<tr>
<td>
Website URL:
</td>
<td>
<input type="text" name="website">
</td>
</tr>
<tr>
<td valign="top"> Bericht: </td>
<td>
<textarea cols="40" rows="8" name="comment" align="left">
</textarea>
</td>
</tr>
<tr>
<td colspan="2" align="right">
<input type="hidden" name="op" value="check_form">
<input type="submit" name="submit" value=" Versturen ">&&<input type="reset" name="reset">
</td>
</tr>
</table>
</form>
</center>
<?php
}
?>
// Controleren of er wat open is gelaten?!
<?php
function check_form($fullname, $sendto, $email, $website, $comment) {
if(trim($fullname) == ""){
echo "<br><center><b>Iets vergeten?!<b></center>";
exit;
}
if(trim($email) == ""){
echo "<br><center><b>Iets vergeten?!<b></center>";
exit;
}
if(trim($comment) == ""){
echo "<br><center><b>Iets vergeten?!<b></center>";
exit;
}
send_form($fullname, $sendto, $email, $website, $comment);
}
?>
// Email versturen
<?php
function send_form($fullname, $sendto, $email, $website, $comment) {
global $toaddress, $subject, $fromaddress, $success_message;
$mailcontent = "Username: $fullname\n\n"
."Soort Bericht: $sendto\n\n"
."E-Mail: $email\n\n"
."Website: $website\n\n"
."Bericht: $comment\n\n";
mail($toaddress, $subject, $mailcontent, $fromaddress);
echo $success_message;
}
?>
<?php
switch($op) {
case "check_form" :
check_form($fullname, $sendto, $email, $website, $comment);
break;
default:
form();
break;
}
?>
<br>
<center> Copyright & 2002 phpBB-NL </center>
Code: Selecteer alles
<style type="text/css">
A:link{text-decoration: none}
A:visited{text-decoration: none}
A:hover{text-decoration: underline
text-decoration: overline}
body {
background-color: #E5E5E5;
scrollbar-face-color: #DEE3E7;
scrollbar-highlight-color: #FFFFFF;
scrollbar-shadow-color: #DEE3E7;
scrollbar-3dlight-color: #D1D7DC;
scrollbar-arrow-color: #006699;
scrollbar-track-color: #EFEFEF;
scrollbar-darkshadow-color: #98AAB1;
}</style>
<table width="100%" cellspacing="2" cellpadding="2" border="0" align="center">
<tr>
<td align="left" class="nav"><a href="index.php" class="nav">{L_INDEX}</a></td>
</tr>
</table>
<table width="100%" border="0" class="bodyline">
<tr>
<td class="CatHead">
<div align="center"><b>Contact</b></div>
</td>
</tr>
<tr>
<td class="row1">
<div align="center"><Iframe height="400" width="100%" src="contact1.php"></iframe></div>
</td>
</tr>
</table>
<p><br />
</p>
<table width="100%" cellspacing="2" border="0" align="center">
<tr>
<td align="right" valign="middle" nowrap><span class="gensmall">{S_TIMEZONE}</span><br /><br />{JUMPBOX}</td>
</tr>
</table>
mogen "wij" dat gewoon gebruiken?.::Neo::. schreef:Contact Pagina bestaat uit 3 delen.
Deel 1 (contact.php)Deel 2 (contact1.php)Code: Selecteer alles
bla
Deel 3 (contact.tpl)(Verander ff de scrollbar kleuren!)Code: Selecteer alles
bla
Code: Selecteer alles
bla
Ja tuurlijk, maar wel de copyright laten staan.Admiral Rob schreef:mogen "wij" dat gewoon gebruiken?.::Neo::. schreef:Contact Pagina bestaat uit 3 delen.
Deel 1 (contact.php)Deel 2 (contact1.php)Code: Selecteer alles
bla
Deel 3 (contact.tpl)(Verander ff de scrollbar kleuren!)Code: Selecteer alles
bla
Code: Selecteer alles
bla