|
|
#1 | |||
|
Member
اجنبی
|
PHP Made Easy by Dr. Perl
اقتباس:
Most of us spend a few hours on internet to check/send emails, view/post something to a discussion board (like this one), to search for some solutions using search engines, do some orkut or facebook. But a few of us will ever realize that what has made these sites so powerful, intelligent and self-maintaining? Very simple answer to this question is: Web Application Development Technologies. Don't get afraid of this heavy words term - it's all about the techniques and how you use 'em. Another simple answer would be the, PHP, ASP (Active Server Pages), JSP(Java Server Pages), CFM (Cold Fusion Markup Language) or PERL (Practical Extraction and Reporting Language). These are most renowned web scripting languages and are widely used to develop (or simply program) a website to register users, allow them to post topics, view topics, chat with friends and etc etc. In this series (EasyPHP) I will introduce you to the PHP, what it can do and how you can benefit from PHP? You can use PHP to: - Print current date and time on your website. - Print greetings to your visitors based on time, like Good Morning, Good Noon and etc. - Ask comments about your article. - Offer subscription to your weekly news letter. - Register visitors to enjoy member services. - Enable your website to accept online payments, via Credit Cards, PayPal and etc. - Keep track of daily visits on your website. - Collect statistical data from daily visits, to find out that how long a user stayed on your website and which pages were browsed mostly and likewise. - Administer your website remotely, so that you won't need to create page locally and then to upload - called CMS (Content Management System) - and a very long list to go... First things first - I mean before you get more excited, let's prepare an environment where you can practice PHP and can create your website. All you have to do is to download Apache, MySQL and PHP - just install and configure - and you are good to go!!! Sounds crazy? Don't worry this isn't a big deal, just a matter of few clicks. Simply download XAMPP from SourceForge.net: XAMPP: Downloading ... . This is a windows based installer which will install and configure everything for you. During installation it will ask you a few questions, just proceed with clicks - But take care of only one thing that you need to select option for Apache and MySQL to run as a service - when asked. Once you have installed xampp, look for the "htdocs" folder under the installation of your xampp location. This is the folder where you will place all of your PHP files. The better idea is to create separate folders for each project (or website). اقتباس:
The most popular and common first-code, a developer/programmer tries is "A Hello World" example. Fire up your note pad and write following code in a new file. کوڈ:
<? echo "Hello World"; ?> http://localhost/helloWorld.php This should load your helloWorld.php and should say: اقتباس:
![]() Now let's have a closer look into our first PHP code (usually called script). کوڈ:
<? ... ?> Anyway, the PHP code is enclosed between <? and ?> php tags. Alternatively you can write these tags as following also: کوڈ:
<?PHP ... ?> کوڈ:
<?php ... ?> کوڈ:
<? echo "Hello World"; ?> Add some more stuff کوڈ:
<? /* My first program in PHP. Written by Dr. Perl */ // Print the message. echo "Hello World"; ?> Do some variables کوڈ:
<? /* A simple calculator. Adds two values and prints the result. */ // Define some values $a = 10; $b = 10; // Addition $c = $a + $b; // Print out the result echo $c; ?> Alternatively, you can write above code as: کوڈ:
<? /* A simple calculator. Adds two values and prints the result. */ // Define some values $a = 10; $b = 10; // Print out the result echo ($a + $b); ?> Summing Up So far you have got a basic introduction to PHP, Setting up quick environment and writing basic script. Do some practices, below is a list of few useful links which you should keep in your favorites list and may need anytime for quick references. www.zend.com - The PHP Company, find manual, tutorials and etc. www.php.net - Home of PHP, find manual, and php downloads www.mysql.com - MySQL official website www.welive.ws - Get free space for your own website, PHP supported Dr. Perl drperl@hotmail.com |
|||
|
|
|
| وقاص بن حسن کا شکریہ ادا کیا گیا | عبدالقدوس (28-01-09) |
| کمائي نے وقاص بن حسن کو اس مراسلے کے لئے دیئے | |||
| تاریخ | رکن | عطیہ کرنے کی وجہ | رقم |
| 28-01-09 | محمدخلیل | for php tut. | 50 |
|
|
#2 |
|
Senior Member
![]() |
بہت شکریہ آپ کا۔۔
لیکن اگر اردو میں لکھیں تو کیا ہی بات ہے |
|
|
|
![]() |
| Tags |
| apache, cold, comments, common, data, database, download, emails, english, enjoy, environment, favorites, find, firefox, folder, folders, note pad, paypal, php, search, system, Waqas Hasan, web developer, web development, website, welive, world |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| موضوع کے اختیارات | |
| ظاہری انداز | Rate This Thread |
|
|