My Fortune from the cookie!!

Give assistance, not advise, in a crisis.


So far, this fortune has appeared once in a real cookie!

Fortune last appeared on: 3-15-2014

Lotte Six numbers: -

Daily Numbers: -

sno: 10

Where?

from a Chinese Fortune cookie

Fortune cookie is eaten at the end of a meal in Chinese Restaurants, mainly in USA. Turns out, "Fortune cookie" is really not Chinese in origin. An enterprising individual started doing this in the United States and that practice caught on in rest of the country. Fortune cookies have been summarized as being “introduced by the Japanese, popularized by the Chinese, but ultimately ... consumed by Americans.”

You can read more about it at Wikipedia Read more »

What exactly are you eating?

It’s typically made using All-purpose-flour, sugar, vanilla and sesame-seed-oil. Of course, each company making these might use a different recipe thought these form the basic ingredients.

Nutritionally, it has about 30 calories, 7g of carbohydrates of which 3g to 4g is sugar and 0.2g of fat. Not a source of anything nutritionally significant.

information source ».

Why?

A demonstration/'proof of concept' of what can be accomplished using PHP and data stored in a text file.

This page HTML 5 compliant

I really like Chinese food. And almost every Chinese restaurant I ate at, gave out a fortune cookie (or two) at the end of the meal. For whatever reason, I never threw away the fortune (message) that came with it. Over the years, I've accumulated several of these fortunes (only paper though, I ate the cookie part of it). This is an attempt to compile those in a page and display one at random.

How?

Code is actually quite simple. And all fortunes are stored in a file; one fortune per line.

<?php
/* Opening the file with all the text */
$lines = file("data.txt");
/* random function to get a random-line-number. A number between 1 and number-of-lines will be produced. */
$lineno = rand(1,count($lines));
/* get the fortune-text based on the random-line-number from above */
$fortune = $lines[$lineno];
/* displaying the fortune */
echo $fortune
?>

The rest of the page is in plain html.
A Simple PHP tutorial: on php.net »

Did you know

The company that makes the most fortune cookies in the world is in Brooklyn! New York. About 4.5 million a day Wonton Food Inc »

Submit your fortune

Submit your fortune to be stored in the database submit here ».

Please note that the content will be moderated before its published to the website.

Credits

Developer: Shivaram Challa

html 5 website template from: http://html5boilerplate.com/.

hand writing font: Architects Daughter

How its made?


Ads by Google