Severed cable disrupts net access

Internet and phone communications between Europe, the Middle East, and Asia have been seriously disrupted after submarine cables were severed.
It is thought the FLAG FEA, SMW4, and SMW3 lines, near the Alexandria cable station in Egypt, have all been cut.
A fault was also reported on the GO submarine cable 130km off Sicily.
Experts warned that [...]

How to cleaning up SENDMAIL spool

Cleaning the Mail Spool
There could be a lot of “trash” qf or df files left behind following a bout of misbehaving sendmails. If the size of either file is 0, you should be able to trash them safely.
cd /var/spool/mqueue-fixme
to get into your queue directory, and

IE ignores custom error pages

if you use php to create custom error pages (such as header(’HTTP/1.1 500 Internal Server Error’);) Internet Explorer ignores you custom page unless it is at least 512 (or sometimes 1024 bytes)
IE ignores custom error pages that are less than 512 (or from what i’ve read 1024) bytes.
just place this before any [...]

How to show image file that’s not accessible to public ?

You can use below script to show the image file for public access, but public don’t have direct access to the file itself. Because its located outside of the public folder.
<?php
/* Read local file from /home/bar */
$localfile = file_get_contents(”/home/userX/foo.jpg”);
echo $localfile;
?>

How to know ID number that inserted by the mysql insert query ?

Use below scripts :
mysql_insert_id() example
<?php
$link = mysql_connect(’localhost’, ‘mysql_user’, ‘mysql_password’);
if (!$link) {
die(’Could not connect: ’ . mysql_error());
}
mysql_select_db(’mydb’);
mysql_query(”INSERT INTO mytable (product) values (’kossu’)”);
printf(”Last inserted record has id %d\n”, mysql_insert_id());
?>

How to fetch data(s) using mysql_fetch_assoc ?

mysql_fetch_assoc — Fetch a result row as an associative array

<?php
$conn
= mysql_connect(”localhost”, “mysql_user”, “mysql_password”);
if (!
$conn) {
echo “Unable to connect to DB: ” . mysql_error();
exit;
}
if (!
mysql_select_db(”mydbname”)) {
echo “Unable to select mydbname: ” . mysql_error();
exit;
}
$sql = “SELECT id as userid, fullname, userstatus
FROM   sometable
WHERE  userstatus = 1″;
$result = mysql_query($sql);
if (!
$result) {
echo “Could not successfully run query ($sql) from DB: ” . mysql_error();
exit;
}
if (
mysql_num_rows($result) == 0) {
echo “No rows found, nothing to print so am exiting”;
exit;
}
// While a row of data exists, put that row in $row as an associative array
// Note: If you’re expecting just one row, no need to use a loop
// Note: If you put extract($row); inside the following loop, you’ll
//       then create $userid, $fullname, and $userstatus

while ($row = mysql_fetch_assoc($result)) {
echo $row["userid"];
echo $row["fullname"];
echo $row["userstatus"];
}
mysql_free_result($result);
?>

Serious security flaw found in IE

Internet Explorer is used by the vast majority of the world’s computer user

Users of Microsoft’s Internet Explorer are being urged by experts to switch to a rival until a serious security flaw has been fixed.
The flaw in Microsoft’s Internet Explorer could allow criminals to take control of people’s computers and steal their passwords, internet [...]

Let’s Install JSON for PHP 5

Originally by Scott Hebert
* his article has been edited to fit in my case.
JSON (JavaScript Object Notation) LogoI recently started messing around with building my own Facebook application. I figured the best way to start learning was to download the demo application and get it working on the Slaptijack web server. I quickly ran into [...]