Showing the Browser and IP Address

Here is a simple page that prints out the browser string and the IP address of the HTTP request. Create a file with the following content in your web directory, name it something like example.php3, and load it in your browser:
<html><head><title>PHP Example</title></head>
<body>
   You are using 
    <?php echo $_SERVER['HTTP_USER_AGENT'] ?>
   <br />
   and coming from 
    <?php echo $_SERVER['REMOTE_ADDR'] ?>
</body></html>
You should see something like the following in your browser window:
You are using Mozilla/5.0 (X11; U; Linux i686; en-US; 
rv:1.1b) Gecko/20020722
and coming from 127.0.0.1

1.13.2 Intelligent Form Handling

Here is a slightly more complex example. We are going to create an HTML form that asks the user to enter a name and select one or more interests from a selection box. We could do this in two files, where we separate the actual form from the data handling code, but instead, this example shows how it can be done in a single file:
<html><head><title>Form Example</title></head>
<body>
<h1>Form Example</h1>
<?
function show_form($first="", $last="", 
                   $interest="") {
 $options = array("Sports", "Business", "Travel", 
                  "Shopping", "Computers");
 if(!is_array($interest)) $interest = array( );
 ?>
 <form action="form.php" method="POST">
 First Name:
 <input type="text" name="first" 
        value="<?echo $first?>">
 <br />
 Last Name:
 <input type="text" name="last" 
        value="<?echo $last?>">
 <br />
 Interests:
 <select multiple name="interest[ ]">
 <?php
  foreach($options as $option) {
   echo "<option";
   if(in_array($option, $interest)) {
    echo " selected ";
   }
   echo "> $option</option>\n";
  }
 ?>
 </select><br />
 <input type=submit>
 </form>
<?php } // end of show_form( ) function

if($_SERVER['REQUEST_METHOD']!='POST') {
 show_form( );
} else {
 if(empty($_POST['first']) || 
    empty($_POST['last'])  ||
    empty($_POST['interest'])) {
  echo "<p>You did not fill in all the fields,";
  echo "please try again</p>\n";
  show_form($_POST['first'],$_POST['last'], 
            $_POST['interest']);
 }
 else {
  echo "<p>Thank you, $_POST[first] $_POST[last], you ";
  echo 'selected '. 
       join(' and ', $_POST['interest']);
  echo " as your interests.</p>\n";
 }
}
?>
</body></html>
There are a few things to study carefully in this example. First, we have isolated the display of the actual form to a PHP function called show_form(). This function is intelligent, in that it can take the default value for each of the form elements as an optional argument. If the user does not fill in all the form elements, we use this feature to redisplay the form with whatever values the user has already entered. This means the user only has to fill the fields he missed, which is much better than asking the user to hit the Back button or forcing him to reenter all the fields.

The Small Business Beginners Guide

Promotion Methods
Search engines are not the only way to get visitors to your site and a common
sense approach will go a long way to helping you get people to your site.
Use your domain name and Web address in ALL your company’s promotional
materials. This includes business cards, brochures, newspaper ads, classified
ads, flyers, etc. If you have a real store, make sure your Web address is
printed on everything that leaves with your customers including register
receipts, shopping bags, and product packaging.
Have a placard printed with your Web address close to every register where
every customer can see it. You can even have small business cards printed
with your store name and Web address. Place these on the sales counter so
customers can take them.
Make sure your Web address appears in EVERY display ad in local
publications. Even include it in your radio commercials. Some communities
have a local cable channel that advertises local businesses. If you use this
media, get your Web address there too.
Look to the Web for more promotional ideas. Again, many sites give out free
information and guides that will give you ideas on promoting your e-business
both online and offline.
One fact is certain; promoting your Web site is going to be an ongoing
commitment. And, the more you dedicate yourself to continually promoting
your site, the more rewards you will reap.

Internet Search Engines

You’ve probably used a search engine to look for information in your own
journeys into the online world. If you have, you understand how valuable they
are to users looking for sites on the Web. Without them, we’d all be forever
lost in a sea of information.
Search engines try to organize the Web into orderly subjects so us humans can
find what we’re looking for. They fall into two main categories – true search
engines and indexes.

The true search engine uses the Web page contents to categorize and index the
page. They do this by periodically releasing a software program called a
spider or bot out to the Internet to gather data about Web pages. The spider
returns this data to a computer that organizes the data and indexes the page.
True search engines are machine driven. There is little or no human
intervention involved in the whole process. And, it’s all automatic.
Indexes are another story. They are built and controlled by people. A good
example of a human-driven Web index is Yahoo!. Web sites must be
submitted to Yahoo! for review. Only after someone looks at the site and
determines what category it belongs in is the site added to the index.
Yahoo is the most used Web index, so it’s critical that you get listed – and get
listed in the right place.
Getting your site listed in an index, especially Yahoo!, can take months to
accomplish. And, the site owner has little to say about how his/her site is
listed. The person doing the reviewing and indexing has the final say.
Getting your site changed after it is included in the index is next to
impossible. So, make sure you do this right the first time. Have a list of
keywords, your site title, and other information well thought-out and saying
exactly what you want it to say.

Internet Marketing for Smart People

There are some basic business rules you should follow:

• Your pages must load FAST. Most Web surfers will give you about 30
seconds before they click off. Keep your graphic files small.
• Be consistent. This means use the same colors, same backgrounds,
same typefaces, etc. throughout your entire site. If your menu is on the
left on your home page, then keep it on the left for all your pages.
• Don’t mix too many typefaces - stick to a maximum of 2 and, use
standard typefaces.
• Keep the animations to a minimum – to many can be very distracting.
• Don’t use music on a business site.
• Don’t try to be cute or kewl. This is serious business.
• Go easy on the high-tech. Just because you can do something doesn’t
mean you should.
• If you’re selling something, don’t mask it. Let your visitors know your
intentions right from the start.
• Make sure your customers can easily find your company name,
address, and telephone numbers easily. Don’t hide this information.
Begin by deciding what you want your site to accomplish and round-up all the
tools and materials you’ll need to build your site. In particular:
• Have all your content materials – stuff like images, text, and other
media you plan to use.
• Have at least the two popular Web browsers installed on your
computer - Netscape Navigator and Internet Explorer. You’ll want to
test your completed pages on both. (Your pages will appear differently
on each one.)
• Know your target audience and what you expect to offer them.
• Get an idea of the structure and scope of your site.
There are many sites on the Web that give you all the basic instruction you’ll
ever need to create Web pages. Try searching Yahoo! or your favorite search
engine for information about Web site building for beginners.

Facebook tests paid messages to strangers

Most important messages go straight to your inbox on Facebook. But there's a second class of messages, including potential spam and notes from people not in your network, that the site's algorithms deem "less relevant."
These unlucky missives are dropped in the little-known "Other" folder, where they will often spend the remainder of their digital existence unseen, unread and unloved.

"Several commentators and researchers have noted that imposing a financial cost on the sender may be the most effective way to discourage unwanted messages and facilitate delivery of messages that are relevant and useful," says the post.
The "inbox delivery test" will be available only to select people using Facebook in the U.S. for now. Companies won't have access to the feature at this time, and people are limited to one paid outgoing message a week to minimize abuse.

Php Mysql Image upload

<?php  

// 1. Gem modtagne formulardata i variabler:  
$navn = $_POST['navn'];  
$alder = $_POST['alder'];  
$postnr = $_POST['postnr'];  
$mail = $_POST['mail'];  
$billede = $_FILES['profilbillede'];  
$password = $_POST['password'];  



// 2. Forbind til databasen:  
$databaselink = mysqli_connect("localhost","mmddk3e12m8b18", "****", "mmddk3e12m8b18") or die     ("Fejl: Kan ikke etablere forbindelse til database");



$billednavn = billedupload($billede);  
// besked til brugeren om at der er sket en fejl    
if($billednavn == false){  
die("Der skete en fejl under upload af billedet");
}



// 3. Udform insert SQL streng med de modtagne data, og udfør SQL strengen på databasen vha     mysqli_query:  
$query = "INSERT INTO brugere (navn, alder, postnr, mail, password, profilbillede) VALUES ('$navn', '$alder', '$postnr', '$mail', '$password', '$billednavn')";  
$result = mysqli_query($databaselink, $query) or die( "Forespørgslen kunne ikke udføres: " .         mysqli_error($databaselink));  

// 4. luk databasen:  
mysqli_close($databaselink);  

function billedupload($fil){  
if($fil['type']=='image/jpeg' or $fil['type']=='image/png'){  
$tmp_navn = $fil['tmp_name'];  
$filnavn = $fil['name'];  
$target = 'images/' . time() . $filnavn;  
move_uploaded_file($tmp_navn,$target);  
return $target;  
}  
else{  
return false;  
}  
}  

?>
 
Make sure $_FILES is set? Debug it with var_dump($_FILES)and  enctype="multipart/form-data" in your <form> 

Samsung sells 500 handsets per minute

Samsung Electronics, the world leader in mobiles and memory chips, likely earned a quarterly profit of $8.1 billion, as it sold close to 500 handsets every minute and as demand picked up for the flat screens it makes for mobile devices

Yahoo! Axis

A Search Browser

By Yahoo!

Get a smarter, faster and more visual way to search and browse the web!

Yahoo! Axis is a new browser that redefines what it means to search and browse the web on your iPhone, iPad.

Requirements: Compatible with iPhone, iPod touch, and iPad. Requires iOS 5.1 or later. This app is optimized for iPhone 5.

Yahoo! Axis is a desktop web browser extension and mobile browser for iOS devices created and developed by Yahoo!

Since on iOS Axis is essentially running a skin over top of Safari -- similar to what the Atomic browser does. In Yahoo's case, though, it's a powerful skin, filled with features you won't find on Apple's browser, such as easy toggling between regular and image searches, and instant syncing of bookmarks and tabs between desktop, iPhone and iPad.

 

What is Shell Script

Normally shells are interactive. It means shell accept command from you (via keyboard) and execute them. But if you use command one by one (sequence of 'n' number of commands) , the you can store this sequence of command to text file and tell the shell to execute this text file instead of entering the commands. This is know as shell script.

The Role of the Device Driver

As a programmer, you are able to make your own choices about your driver, and
choose an acceptable trade-off between the programming time required and the flexibility
of the result. Though it may appear strange to say that a driver is “flexible,” we
like this word because it emphasizes that the role of a device driver is providing
mechanism, not policy.

The distinction between mechanism and policy is one of the best ideas behind the
Unix design. Most programming problems can indeed be split into two parts: “what
capabilities are to be provided” (the mechanism) and “how those capabilities can be
used” (the policy). If the two issues are addressed by different parts of the program,
or even by different programs altogether, the software package is much easier to
develop and to adapt to particular needs.

For example, Unix management of the graphic display is split between the X server,
which knows the hardware and offers a unified interface to user programs, and the
window and session managers, which implement a particular policy without knowing
anything about the hardware. People can use the same window manager on different
hardware, and different users can run different configurations on the same
workstation. Even completely different desktop environments, such as KDE and
GNOME, can coexist on the same system. Another example is the layered structure
of TCP/IP networking: the operating system offers the socket abstraction, which
implements no policy regarding the data to be transferred, while different servers are
in charge of the services (and their associated policies). Moreover, a server like ftpd
provides the file transfer mechanism, while users can use whatever client they prefer;
both command-line and graphic clients exist, and anyone can write a new user interface
to transfer files.