Nieuw lid |
|
Hoi,
Zoals je aan het topic titel kan zien, zit ik met die "error"... Het is niet echt een error, maar wel me probleem. Ik heb de volgende Codes:
Config.inc.php
<?php
session_start( );
## Instellingen voor webmail! ##
$config['pop3_server'] = "mail.wmtools.be";
$config['smtp_server'] = "mail.wmtools.be";
$config['pop3_poort'] = 110;
$config['smtp_poort'] = 25;
$txt['error'] = 'Er kon geen verbinding worden vastgesteld met de pop3 server!';
$txt['error2'] = 'Fout wachtwoord en / of gebruikersnaam!';
$mailserver = @fsockopen( $config['pop3_server'], $config['pop3_poort'], &$errno, &$errstr, 30 );
@mysql_connect( "localhost", "", "" );
@mysql_select_db( "wmtools_" );
if( isset( $_SESSION['webmail_pop3_pass'] ) == false OR isset( $_SESSION['webmail_pop3_user'] ) == false && eregi( "inloggen.php", $_SERVER['REQUEST_URI'] ) == false ) {
//header( "Location: inloggen.php" );
}
/* POP3 Server Connect */
function verbinding_maken( ) {
global $config, $txt, $mailserver;
if( $mailserver == false ) {
return $txt['error'];
}
else{
$buffer = fgets( $mailserver, 512 );
$buffer = "USER " . $_SESSION['webmail_pop3_user'] . "\r\n";
fputs( $mailserver, $buffer );
$buffer = fgets( $mailserver, 512 );
if( strpos( $buffer, "err" ) !== false ) {
include "disconnect_pop3.php";
return false;
}
else{
$buffer = "PASS " . $_SESSION['webmail_pop3_pass'] . "\r\n";
fputs( $mailserver, $buffer );
$buffer = fgets( $mailserver, 512 );
if( strpos( $buffer, "err" ) !== false ) {
include "disconnect_pop3.php";
echo false;
}
}
return true;
}
}
?>
<?php ## Instellingen voor webmail! ## $config['pop3_server'] = "mail.wmtools.be"; $config['smtp_server'] = "mail.wmtools.be"; $config['pop3_poort'] = 110; $config['smtp_poort'] = 25; $txt['error'] = 'Er kon geen verbinding worden vastgesteld met de pop3 server!'; $txt['error2'] = 'Fout wachtwoord en / of gebruikersnaam!'; $mailserver = @fsockopen( $config['pop3_server'], $config['pop3_poort'], &$errno, &$errstr, 30 ); if( isset( $_SESSION['webmail_pop3_pass'] ) == false OR isset( $_SESSION['webmail_pop3_user'] ) == false && eregi( "inloggen.php", $_SERVER['REQUEST_URI'] ) == false ) { //header( "Location: inloggen.php" ); } /* POP3 Server Connect */ function verbinding_maken( ) { global $config, $txt, $mailserver; if( $mailserver == false ) { return $txt['error']; } else{ $buffer = fgets( $mailserver, 512 ); $buffer = "USER " . $_SESSION['webmail_pop3_user'] . "\r\n"; fputs( $mailserver, $buffer ); $buffer = fgets( $mailserver, 512 ); if( strpos( $buffer, "err" ) !== false ) { include "disconnect_pop3.php"; return false; } else{ $buffer = "PASS " . $_SESSION['webmail_pop3_pass'] . "\r\n"; fputs( $mailserver, $buffer ); $buffer = fgets( $mailserver, 512 ); if( strpos( $buffer, "err" ) !== false ) { include "disconnect_pop3.php"; } } return true; } } ?>
Inbox.php
<?php
include "_BeStAnDeN_/config.inc.php";
if( verbinding_maken( ) == false ) {
header( "Location: inloggen.php" );
}
else{
$buffer = "STAT\r\n";
fputs( $mailserver, $buffer);
$buffer = fgets( $mailserver, 512 );
$mailsum = substr( $buffer, 4, 2 );
$mailmem = substr( $buffer, 6, strlen( $buffer ) - 6 );
?>
<table border="0" width="30%" cellspacing="0" cellpadding="0">
<tr>
<td width="20%"><b>Aantal e-mails:</b></td>
<td width="10%"><?=$mailsum; ?></td>
</tr>
<tr>
<td width="20%"><b>Mailbox groote:</b></td>
<td width="10%"><?=$mailmem; ?></td>
</tr>
</table>
<?php
if( $mailsum == 0 ) {
?>
<center>U heeft momenteel <b>geen</b> e-mail berichten in uw inbox staan!</center>
<?php
}
else{
... Alles weergeven ...
... Is te lange code om weer te geven ...
}
}
?>
<?php include "_BeStAnDeN_/config.inc.php"; if( verbinding_maken( ) == false ) { header( "Location: inloggen.php" ); } else{ $buffer = "STAT\r\n"; fputs( $mailserver, $buffer); $buffer = fgets( $mailserver, 512 ); $mailsum = substr( $buffer, 4, 2 ); ?> <table border="0" width="30%" cellspacing="0" cellpadding="0"> <tr> <td width="20%"><b>Aantal e-mails:</b></td> <td width="10%"><?=$mailsum; ?></td> </tr> <tr> <td width="20%"><b>Mailbox groote:</b></td> <td width="10%"><?=$mailmem; ?></td> </tr> </table> <?php if( $mailsum == 0 ) { ?> <center>U heeft momenteel <b>geen</b> e-mail berichten in uw inbox staan!</center> <?php } else{ ... Alles weergeven ... ... Is te lange code om weer te geven ... } } ?>
Wat eruit komt:
Aantal e-mails: I
Mailbox groote: ncorrect state
Het gaat zoals je mss wel kunt zien, om een zelf gemaakte webmail. Althans word gemaakt:p
Ik connect via pop3 en verzend via smtp. De connectie is goed, tenminste geeft inloggen.php aan, anders zou ik niet verder kunnen en de sessions niet gezet kunnen worden. Wat is de fout?
Ziet iemand die?
|