<?PHP

//Get contacts

if((isset($_POST['username'])) && (isset($_POST['password']))) {
//Check to ensure that a username and password have been supplied

if($_POST['service'] == "msn") {
//The service is msn

include('msn_contact_grab.class.php');

$msn2 = new msn;

$returned_emails = $msn2->qGrab($_POST['username'], $_POST['password']);
}
elseif($_POST['service'] == "gmail") {
//The service is gmail

include('libgmailer.php');

$gmailer = new GMailer();
if ($gmailer->created) {
$gmailer->setLoginInfo($_POST['username'], $_POST['password'], 0);

//uncomment if you need it
//$gmailer->setProxy("proxy.company.com");

if ($gmailer->connect()) {
// GMailer connected to Gmail successfully.
// Do something with it.

//Get the contacts
// For "Inbox"

$gmailer->fetchBox(GM_CONTACT, "all", "");

$snapshot = $gmailer->getSnapshot(GM_CONTACT);


//Outputs an array of the contacts
$returned_emails = $snapshot->contacts;


} else {
die("Fail to connect because: ".$gmailer->lastActionStatus());
}
} else {
die("Failed to create GMailer because: ".$gmailer->lastActionStatus());
}

} 
}


?>


<HTML>
<HEAD>


</HEAD>
<BODY>

<p>
Your contacts have been retrieved from the <?php echo $_POST['service']; ?> service. Using the form below 
you are able to choose which of your contacts you wish to be contacted. Once you have made your
choices use the 'Send Emails' button to send an email to the contacts selected.
</p>

<form method="post" action="send_emails.php">
<table border="1">
<tr>
<td></td>
<td>Email</td>
<td>Name</td>
</tr>


<?PHP

//Create the form for all the emails returned from the contact list
if($_POST['service'] == "msn") {

foreach($returned_emails as $row){
echo "<tr>";
echo '<td><input type="checkbox" name="emails[]" value="'.$row['0'].'" checked="checked"/></td>';
echo '<td>'.$row['0'].'</td>';
echo '<td>'.$row['1'].'</td>';
echo "</tr>\n\n";
};
}
elseif($_POST['service'] == "gmail") {

foreach($returned_emails as $row){"echo "<tr>";
echo '<td><input type="checkbox" name="emails[]" value="'.$row['email'].'" checked="checked"/></td>';
echo '<td>'.$row['email'].'</td>';
echo '<td>'.$row['name'].'</td>';
echo "</tr>\n\n";
};
}

?>

</table>
<input type="submit" value="Send Emails" />
</form>

Dit is een gewoon een simpel php dingetje,
maar mijn vraag is,
Ik heb maar 5 plaatjes,
Hoe krijg je als je bijv error 8000 aanvraagt dat die 404 plaatje geeft,

Plaatjes die ik heb:
400
401
403
404
500

Ik heb al geprobeerd met
If ($_GET['error']== 404)
$img = ('404-error.jpg');

En dan met elseif, maar dat werkte niet

<?php
$img = $_GET['error'];
?>

<meta http-equiv="Content-Type" content="text/html;" />
<meta http-equiv="Content-Language" content="nl" />
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
<link rel="icon" href="favicon.ico" type="image/x-icon" />

<style type="text/css">
html,body,div {	font-family: verdana;	font-size: 11px; color: #666666; text-align: center; }
#main {	position: absolute;	top: 50%;	left: 50%;	height: 350px; width: 400px; margin: -175px 0px 0px -200px; }
#top { font-weight: bold; }
#pic { height: 275px; background: url(<?php echo $img ?>-error.jpg) center no-repeat; }
#bot a { text-decoration: none; color: #0099FF; }
#bot a:hover { text-decoration: underline; }
</style>

<title>Frankyy - [ Error <?php echo $error ?> ]</title>
<div id="main">
<div id="top">Frankyy</div>
<div id="pic"></div>
<div id="bot">[ <a href="http://frankyy.dyndns.org">frankyy.dyndns.org</a> ]</div>
</div>
En waarom zou je dat willen? Error 8000 bestaat volgensmij niet eens, het loopt van 300 tot 600 geloof ik, ik zoek even voor je!

EDIT:
HTTP-responses

Een HTTP-response bestaat uit een resultaat-code, headervelden en een body (de boodschap). De resultaat-code bestaat uit minimaal drie cijfers. Het eerste cijfer is het belangrijkste:

* 1xx: een informele boodschap van de webserver die nog gevolgd zal worden door andere data
* 2xx: een boodschap van de server dat de gevraagde actie succesvol is afgehandeld
* 3xx: een "redirect" naar een andere locatie, om wat voor reden ook
* 4xx: een foutboodschap die door de client (typisch een webbrowser) veroorzaakt is, zoals het verkeerd typen van een URL
* 5xx: een foutboodschap die door de webserver veroorzaakt is, zoals een fout in een CGI script
* 6xx: een proxy fout is opgetreden

De meest voorkomende resultaat codes zijn:

* 200 OK – Het gevraagde document is succesvol opgevraagd.
* 304 Not Modified – T.o.v. de versie in de cache is de pagina niet gewijzigd.
* 403 Forbidden – Het opgevraagde document mag niet bekeken worden.
* 404 Not Found – Het opgevraagde document bestaat niet.
* 405 Not Allowed - De gebruiker is niet gerechtigd het gevraagde document te bekijken.
* 500 Internal Server Error - De webserver heeft de gevraagde actie niet kunnen uitvoeren
Dat bedoel ik, Ik wil dat bijv error 8000 NIET word geshowd,

Reageren