<?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>