php and web forms
December 31, 2007 // No Comments
web forms are one of the most common elements of a webpage and the most general method to input data from the user. PHP allows you to easily handle the data input by the user. All the elements of the form are automatically available to the PHP scripts. Consider the HTML page
<form action="dataHandler.php" method="post"> <p>first name: <input type="text" name="fname" /></p> <p>last name: <input type="text" name="lname" /></p> <p><input type="submit" /></p> </form>
the above code plainly defines a simple html form with two text input elements. When the user fills the data in the text field and click on the submit button, the dataHandler.php is called which is of the following type
Hello <?php echo htmlspecialchars($_POST[’fname’]);?> Your last name is <?php echo htmlspecialchars($_POST[’lname’]);?>
in the HTML form, the method specified was POST, therefore the data was stored in the variable $_POST. Another option is to use the method GET. When GET method is used with a form, the data from the form is stored in the variable $_GET.
Another variable available is $_REQUEST which contains the merged information from the GET, POST and COOKIE data.
Embedding silverlight objects
December 31, 2007 // 2 Comments
Microsoft is offering free 4GB web space to host silverlight applications. If you have complete control over your site, you may not need to sign up with microsoft live.com, however, if you want to embed silverlight streaming into sites where you donot have complete control for exmaple, your blog, then the microsoft’s offer the thing for you.
Silverlight streaming enables one to host the entire silverlight application. so basically you develop the super-cool application and want somewhere to host it, the xaml files etc. silverlight streaming is the solution for you.
After logging on to silverlight.live.com, the first you need to do is to create a silverlight application. The required link can be found on the left sidebar. The most important step in hosting your silverlight application here is the creation of manifest.xml file. It will look something like this:
<SilverlightApp> <source>myApp.xaml</source> <width>600</width> <height>90</height> <jsOrder><js>Silverlight.js</js> <js>MyApp.xaml.js</js> <js>Default.html.js</js></jsOrder> </SilverlightApp>
once you have that, you need to zip all your files into a single file which are required to be uploaded the silverlight website. When the upload is complete, all you have to do is to follow the silverlight embed process. Finally, you are provided with the code to be pasted in your html file in order to embed the silverlight control.
Hello world!
December 30, 2007 // 1 Comment
This is the creation of a new world, a world where the only the things that I care about exist.