Get engaged in the biggest community of Pakistan
Let people know about you worldwide
Outline
'اردو لغت تاریخی اصول پر' کا موبائل اور آن لائن ورژن لانچ کر دیا گیا ہے۔
یہ عظیم لغت 22 جلدوں پر مشتمل ہے اور اس میں دو لاکھ 64 ہزار الفاظ شامل ہیں۔ اس لغت کی وسعت اور ہمہ گیری... see more کا اندازہ اس بات سے لگایا جا سکتا ہے کہ اس میں صرف ایک لفظ 'دل' اور اس کے متعلقات 112 صفحات پر محیط ہیں۔
یہ ڈکشنری اردو لغت بورڈ کی کاوش ہے۔ اس خصوصی ادارے کا قیام بابائے اردو مولوی عبدالحق کی کاوشوں سے 1958 میں ہوا تھا اور اس کا ماڈل اوکسفرڈ انگلش ڈکشنری کی طرز پر تیار کیا گیا تھا جس کے تحت اردو کی ایک ایسی جامع لغت تیار کی جانی تھی جو 'محض لفظوں اور معنوں کا انبار نہیں بلکہ ہمارے تاریخی ، تہذیبی سفر کو آئینہ بھی کرتی ہے۔'
لغت تیار کرنے کی یہ مہم 52 برس کے بعد 2007 میں اس وقت اختتام پذیر ہوئی جب اس کی 22ویں اور آخری جلد شائع ہوئی۔
تاہم اس کے بعد سے بڑے سائز کی ایک ایک ہزار صفحوں پر مشتمل اس لغت کی 22 جلدوں سے استفادہ کرنا ہر کسی کے بس کی بات نہیں تھی۔ اسی دوران چند جلدیں آؤٹ آف پرنٹ بھی ہو گئیں چنانچہ یہ بھاری بھرکم لغت عام آدمی کی دسترس سے مزید دور ہو گئی۔
اردو ڈکشنری بورڈ کے سربراہ عقیل عباس جعفری کہتے ہیں کہ 'اب آن لائن ورژن اور ایپ تیار ہونے سے یہ ضخیم دستاویز ہر کسی کی پہنچ میں آ گئی ہے۔'
انھوں نے بی بی سی کو بتایا کہ لغت کو ڈیجیٹائز کرنے کا کام اس سال فروری میں شروع کیا گیا تھا اور صرف چار مہینوں کی ڈیڈ لائن کے اندر اندر 20 ہزار سے زائد صفحات پر مشتمل یہ لغت عوام کے لیے پیش کر دی گئی ہے۔
سرکاری محکموں کی عمومی کارکردگی دیکھتے ہوئے یہ کام خاصا حیرت انگیز لگتا ہے۔ تاہم ایسا لگتا ہے کہ جلدی کے باعث کچھ اغلاط بھی در آئی ہیں۔ مثال کے طور پر لفظ 'سہولت' کے تحت دشواری کی بجائے دشوری لکھا ہوا ہے۔
اسی طرح سوشل میڈیا پر دوسرے دوستوں نے بھی ٹائٹپنگ کی کئی اغلاط کی جانب توجہ دلائی ہے۔ عقیل عباس جعفری نے اس بارے میں کہا کہ لغت کی پروف ریڈنگ کا کام ابھی جاری ہے اور اس ضمن میں ہم نے لوگوں سے بھی درخواست کی ہے کہ وہ اغلاط کی نشاندہی کریں تاکہ انھیں جلد سے جلد دور کیا جا سکے۔
ہم نے لغت کے بارے میں فیڈ بیک لینے کے لیے جن لوگوں سے بات کی ان کی اکثریت نے کہا کہ لغت بہت سست رفتار ہے اور ایک لفظ ڈھونڈتے بعض اوقات بہت دیر لگ جاتی ہے۔
اس کے علاوہ لغت صرف فونیٹک کی بورڈ کو سپورٹ کرتی ہے، جس کی وجہ سے ان لوگوں کو مشکلات پیش آتی ہیں جو دوسرے کی بورڈز کے عادی ہیں۔
ماہرِ زبان اور لغات کے مدون رفاقت راضی نے بی بی سی کو بتایا کہ تمام تر خامیوں اور محدودات کے باوجود یہ حیرت انگیز کام ہے جس کا تمام تر سہرہ اس کے مدیر اعلیٰ کو جاتا ہے جنھوں نے اس قدر قلیل مدت یہ لغت آن لائن کر کے سب کو ششدر کر دیا ہے۔'
انھوں نے کہا کہ 'یہ کام رکنا نہیں چاہیے اور اس امر کی ضرورت ہے کہ لغت میں زبان میں شامل ہونے والے نئے الفاظ بھی شامل کیے جانے چاہییں، تاہم اس مقصد کے لیے خاصی ادارتی چھان پھٹک کی ضرورت ہے۔'
ڈیجیٹل لغت میں ایک اور خامی ہے کہ فی الحال یہ صرف اینڈروئڈ پر دستیاب ہے۔ عقیل عباس جعفری نے کہا کہ 'ہم نے ایپ بنا کر ایپل ایپ سٹور اور اینڈروئڈ پلے سٹور پر ایک ساتھ بھیجی تھیں لیکن ایپل کمپنی کے طریقۂ کار کے مطابق وہ ہر ایپ کا تفصیلی جائزہ لے کر اسے جاری کرتے ہیں جس کی وجہ سے اس میں دیر لگ رہی ہے۔ اس لیے اس آئی فون کی ایپ میں جو تاخیر ہو رہی ہے وہ ہماری جانب سے نہیں بلکہ ایپل کی طرف سے ہے۔'
عقیل عباس جعفری کہتے ہیں کہ اردو ڈکشنری بورڈ اس وقت کئی اور منصوبوں پر بھی کام کر رہا ہے۔ ان میں سرِ فہرست اردو کی پہلی صوتی لغت کی تیاری ہے۔ اس انوکھی لغت میں نہ صرف الفاظ کا تلفظ بلکہ ان کے معانی بھی سنے جا سکیں گے۔
اس کے علاوہ اردو لغت بورڈ دو جلدوں پر مبنی مختصر لغت بھی تیار کر رہا ہے، جب کہ ایک اور منصوبے کے تحت اردو لغت کی تیاری کی کام آنے والی سینکڑوں کتابوں کو بھی آن لائن کیا جائے گا۔
  • 2
A PHP script can be used with a HTML form to allow users to upload files to the server. Initially files are uploaded into a temporary directory and then relocated to a target destination by a PHP script.
Information in the phpinfo.php page describes the temporary directory that is used for file uploads... see more as upload_tmp_dir and the maximum permitted size of files that can be uploaded is stated as upload_max_filesize. These parameters are set into PHP configuration file php.ini
The process of uploading a file follows these steps −

The user opens the page containing a HTML form featuring a text files, a browse button and a submit button.


The user clicks the browse button and selects a file to upload from the local PC.


The full path to the selected file appears in the text filed then the user clicks the submit button.


The selected file is sent to the temporary directory on the server.


The PHP script that was specified as the form handler in the form's action attribute checks that the file has arrived and then copies the file into an intended directory.


The PHP script confirms the success to the user.

As usual when writing files it is necessary for both temporary and final locations to have permissions set that enable file writing. If either is set to be read-only then process will fail.
An uploaded file could be a text file or image file or any document.
Creating an upload form
The following HTM code below creates an uploader form. This form is having method attribute set to post and enctype attribute is set to multipart/form-data
<?php
if(isset($_FILES['image'])){
$errors= array();
$file_name = $_FILES['image']['name'];
$file_size =$_FILES['image']['size'];
$file_tmp =$_FILES['image']['tmp_name'];
$file_type=$_FILES['image']['type'];
$file_ext=strtolower(end(explode('.',$_FILES['image']['name'])));

$expensions= array("jpeg","jpg","png");

if(in_array($file_ext,$expensions)=== false){
$errors[]="extension not allowed, please choose a JPEG or PNG file.";
}

if($file_size > 2097152){
$errors[]='File size must be excately 2 MB';
}

if(empty($errors)==true){
move_uploaded_file($file_tmp,"images/".$file_name);
echo "Success";
}else{
print_r($errors);
}
}
?>
<html>
<body>

<form action="" method="POST" enctype="multipart/form-data">
<input type="file" name="image" />
<input type="submit"/>
</form>

</body>
</html>
 
Creating an upload script
There is one global PHP variable called $_FILES. This variable is an associate double dimension array and keeps all the information related to uploaded file. So if the value assigned to the input's name attribute in uploading form was file, then PHP would create following five variables −

$_FILES['file']['tmp_name'] − the uploaded file in the temporary directory on the web server.


$_FILES['file']['name'] − the actual name of the uploaded file.


$_FILES['file']['size'] − the size in bytes of the uploaded file.


$_FILES['file']['type'] − the MIME type of the uploaded file.


$_FILES['file']['error'] − the error code associated with this file upload.

Example
Below example should allow upload images and gives back result as uploaded file information.
<?php
if(isset($_FILES['image'])){
$errors= array();
$file_name = $_FILES['image']['name'];
$file_size = $_FILES['image']['size'];
$file_tmp = $_FILES['image']['tmp_name'];
$file_type = $_FILES['image']['type'];
$file_ext=strtolower(end(explode('.',$_FILES['image']['name'])));

$expensions= array("jpeg","jpg","png");

if(in_array($file_ext,$expensions)=== false){
$errors[]="extension not allowed, please choose a JPEG or PNG file.";
}

if($file_size > 2097152) {
$errors[]='File size must be excately 2 MB';
}

if(empty($errors)==true) {
move_uploaded_file($file_tmp,"images/".$file_name);
echo "Success";
}else{
print_r($errors);
}
}
?>
<html>
<body>

<form action = "" method = "POST" enctype = "multipart/form-data">
<input type = "file" name = "image" />
<input type = "submit"/>

<ul>
<li>Sent file: <?php echo $_FILES['image']['name']; ?>
<li>File size: <?php echo $_FILES['image']['size']; ?>
<li>File type: <?php echo $_FILES['image']['type'] ?>
</ul>

</form>

</body>
</html>
It will produce the following result −
  • 4
he if, elseif ...else and switch statements are used to take decision based on the different condition.
You can use conditional statements in your code to make your decisions. PHP supports following three decision making statements −

if...else statement − use this statement if you want to execute... see more a set of code when a condition is true and another if the condition is not true


elseif statement − is used with the if...else statement to execute a set of code if one of the several condition is true


switch statement − is used if you want to select one of many blocks of code to be executed, use the Switch statement. The switch statement is used to avoid long blocks of if..elseif..else code.

The If...Else Statement
If you want to execute some code if a condition is true and another code if a condition is false, use the if....else statement.
Syntax
if (condition)
code to be executed if condition is true;
else
code to be executed if condition is false;

Example
The following example will output "Have a nice weekend!" if the current day is Friday, Otherwise, it will output "Have a nice day!":
<html>
<body>

<?php
$d = date("D");

if ($d == "Fri")
echo "Have a nice weekend!";

else
echo "Have a nice day!";
?>

</body>
</html>
It will produce the following result −
Have a nice day!

The ElseIf Statement
If you want to execute some code if one of the several conditions are true use the elseif statement
Syntax
if (condition)
code to be executed if condition is true;
elseif (condition)
code to be executed if condition is true;
else
code to be executed if condition is false;

Example
The following example will output "Have a nice weekend!" if the current day is Friday, and "Have a nice Sunday!" if the current day is Sunday. Otherwise, it will output "Have a nice day!" −
<html>
<body>

<?php
$d = date("D");

if ($d == "Fri")
echo "Have a nice weekend!";

elseif ($d == "Sun")
echo "Have a nice Sunday!";

else
echo "Have a nice day!";
?>

</body>
</html>
It will produce the following result −
Have a nice day!

The Switch Statement
If you want to select one of many blocks of code to be executed, use the Switch statement.
The switch statement is used to avoid long blocks of if..elseif..else code.
Syntax
switch (expression){
case label1:
code to be executed if expression = label1;
break;

case label2:
code to be executed if expression = label2;
break;
default:

code to be executed
if expression is different
from both label1 and label2;
}

Example
The switch statement works in an unusual way. First it evaluates given expression then seeks a lable to match the resulting value. If a matching value is found then the code associated with the matching label will be executed or if none of the lable matches then statement will execute any specified default code.
<html>
<body>

<?php
$d = date("D");

switch ($d){
case "Mon":
echo "Today is Monday";
break;

case "Tue":
echo "Today is Tuesday";
break;

case "Wed":
echo "Today is Wednesday";
break;

case "Thu":
echo "Today is Thursday";
break;

case "Fri":
echo "Today is Friday";
break;

case "Sat":
echo "Today is Saturday";
break;

case "Sun":
echo "Today is Sunday";
break;

default:
echo "Wonder which day is this ?";
}
?>

</body>
</html>
It will produce the following result −
Today is Monday
  • 4
PHP must be configured correctly in the php.ini file with the details of how your system sends email. Open php.ini file available in /etc/ directory and find the section headed [mail function].
Windows users should ensure that two directives are supplied. The first is called SMTP that defines your email... see more server address. The second is called sendmail_from which defines your own email address.
The configuration for Windows should look something like this −
[mail function]
; For Win32 only.
SMTP = smtp.secureserver.net

; For win32 only
sendmail_from = webmaster@tutorialspoint.com

Linux users simply need to let PHP know the location of their sendmail application. The path and any desired switches should be specified to the sendmail_path directive.
The configuration for Linux should look something like this −
[mail function]
; For Win32 only.
SMTP =

; For win32 only
sendmail_from =

; For Unix only
sendmail_path = /usr/sbin/sendmail -t -i

Now you are ready to go −
Sending plain text email
PHP makes use of mail() function to send an email. This function requires three mandatory arguments that specify the recipient's email address, the subject of the the message and the actual message additionally there are other two optional parameters.
mail( to, subject, message, headers, parameters );
Here is the description for each parameters.
Sr.No
Parameter & Description
1

to
Required. Specifies the receiver / receivers of the email

2

subject
Required. Specifies the subject of the email. This parameter cannot contain any newline characters

3

message
Required. Defines the message to be sent. Each line should be separated with a LF (\n). Lines should not exceed 70 characters

4

headers
Optional. Specifies additional headers, like From, Cc, and Bcc. The additional headers should be separated with a CRLF (\r\n)

5

parameters
Optional. Specifies an additional parameter to the send mail program

As soon as the mail function is called PHP will attempt to send the email then it will return true if successful or false if it is failed.
Multiple recipients can be specified as the first argument to the mail() function in a comma separated list.
Sending HTML email
When you send a text message using PHP then all the content will be treated as simple text. Even if you will include HTML tags in a text message, it will be displayed as simple text and HTML tags will not be formatted according to HTML syntax. But PHP provides option to send an HTML message as actual HTML message.
While sending an email message you can specify a Mime version, content type and character set to send an HTML email.
Example
Following example will send an HTML email message to xyz@somedomain.com copying it to afgh@somedomain.com. You can code this program in such a way that it should receive all content from the user and then it should send an email.
<html>

<head>
<title>Sending HTML email using PHP</title>
</head>

<body>

<?php
$to = "xyz@somedomain.com";
$subject = "This is subject";

$message = "<b>This is HTML message.</b>";
$message .= "<h1>This is headline.</h1>";

$header = "From:abc@somedomain.com \r\n";
$header .= "Cc:afgh@somedomain.com \r\n";
$header .= "MIME-Version: 1.0\r\n";
$header .= "Content-type: text/html\r\n";

$retval = mail ($to,$subject,$message,$header);

if( $retval == true ) {
echo "Message sent successfully...";
}else {
echo "Message could not be sent...";
}
?>

</body>
</html>
Sending attachments with email
To send an email with mixed content requires to set Content-type header to multipart/mixed. Then text and attachment sections can be specified within boundaries.
A boundary is started with two hyphens followed by a unique number which can not appear in the message part of the email. A PHP function md5() is used to create a 32 digit hexadecimal number to create unique number. A final boundary denoting the email's final section must also end with two hyphens.
<?php
// request variables // important
$from = $_REQUEST["from"];
$emaila = $_REQUEST["emaila"];
$filea = $_REQUEST["filea"];

if ($filea) {
function mail_attachment ($from , $to, $subject, $message, $attachment){
$fileatt = $attachment; // Path to the file
$fileatt_type = "application/octet-stream"; // File Type

$start = strrpos($attachment, '/') == -1 ?
strrpos($attachment, '//') : strrpos($attachment, '/')+1;

$fileatt_name = substr($attachment, $start,
strlen($attachment)); // Filename that will be used for the
file as the attachment

$email_from = $from; // Who the email is from
$subject = "New Attachment Message";

$email_subject = $subject; // The Subject of the email
$email_txt = $message; // Message that the email has in it
$email_to = $to; // Who the email is to

$headers = "From: ".$email_from;
$file = fopen($fileatt,'rb');
$data = fread($file,filesize($fileatt));
fclose($file);

$msg_txt="\n\n You have recieved a new attachment message from $from";
$semi_rand = md5(time());
$mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";
$headers .= "\nMIME-Version: 1.0\n" . "Content-Type: multipart/mixed;\n" . "
boundary=\"{$mime_boundary}\"";

$email_txt .= $msg_txt;

$email_message .= "This is a multi-part message in MIME format.\n\n" .
"--{$mime_boundary}\n" . "Content-Type:text/html;
charset = \"iso-8859-1\"\n" . "Content-Transfer-Encoding: 7bit\n\n" .
$email_txt . "\n\n";

$data = chunk_split(base64_encode($data));

$email_message .= "--{$mime_boundary}\n" . "Content-Type: {$fileatt_type};\n" .
" name = \"{$fileatt_name}\"\n" . //"Content-Disposition: attachment;\n" .
//" filename = \"{$fileatt_name}\"\n" . "Content-Transfer-Encoding:
base64\n\n" . $data . "\n\n" . "--{$mime_boundary}--\n";

$ok = mail($email_to, $email_subject, $email_message, $headers);

if($ok) {
echo "File Sent Successfully.";
unlink($attachment); // delete a file after attachment sent.
}else {
die("Sorry but the email could not be sent. Please go back and try again!");
}
}
move_uploaded_file($_FILES["filea"]["tmp_name"],
'temp/'.basename($_FILES['filea']['name']));

mail_attachment("$from", "youremailaddress@gmail.com",
"subject", "message", ("temp/".$_FILES["filea"]["name"]));
}
?>

<html>
<head>

<script language = "javascript" type = "text/javascript">
function CheckData45() {
with(document.filepost) {
if(filea.value ! = "") {
document.getElementById('one').innerText =
"Attaching File ... Please Wait";
}
}
}
</script>

</head>
<body>

<table width = "100%" height = "100%" border = "0"
cellpadding = "0" cellspacing = "0">
<tr>
<td align = "center">
<form name = "filepost" method = "post"
action = "file.php" enctype = "multipart/form-data" id = "file">

<table width = "300" border = "0" cellspacing = "0"
cellpadding = "0">

<tr valign = "bottom">
<td height = "20">Your Name:</td>
</tr>

<tr>
<td><input name = "from" type = "text"
id = "from" size = "30"></td>
</tr>

<tr valign = "bottom">
<td height = "20">Your Email Address:</td>
</tr>

<tr>
<td class = "frmtxt2"><input name = "emaila"
type = "text" id = "emaila" size = "30"></td>
</tr>

<tr>
<td height = "20" valign = "bottom">Attach File:</td>
</tr>

<tr valign = "bottom">
<td valign = "bottom"><input name = "filea"
type = "file" id = "filea" size = "16"></td>
</tr>

<tr>
<td height = "40" valign = "middle"><input
name = "Reset2" type = "reset" id = "Reset2" value = "Reset">
<input name = "Submit2" type = "submit"
value = "Submit" onClick = "return CheckData45()"></td>
</tr>
</table>

</form>

<center>
<table width = "400">

<tr>
<td id = "one">
</td>
</tr>

</table>
</center>

</td>
</tr>
</table>

</body>
</html>
  • 4
Dates are so much part of everyday life that it becomes easy to work with them without thinking. PHP also provides powerful tools for date arithmetic that make manipulating dates easy.
Getting the Time Stamp with time()
PHP's time() function gives you all the information that you need about the current... see more date and time. It requires no arguments but returns an integer.
The integer returned by time() represents the number of seconds elapsed since midnight GMT on January 1, 1970. This moment is known as the UNIX epoch, and the number of seconds that have elapsed since then is referred to as a time stamp.
<?php
print time();
?>
This will produce the following result −
1480930103

This is something difficult to understand. But PHP offers excellent tools to convert a time stamp into a form that humans are comfortable with.
Converting a Time Stamp with getdate()
The function getdate() optionally accepts a time stamp and returns an associative array containing information about the date. If you omit the time stamp, it works with the current time stamp as returned by time().
Following table lists the elements contained in the array returned by getdate().
Sr.No
Key & Description
Example
1

seconds
Seconds past the minutes (0-59)

20
2

minutes
Minutes past the hour (0 - 59)

29
3

hours
Hours of the day (0 - 23)

22
4

mday
Day of the month (1 - 31)

11
5

wday
Day of the week (0 - 6)

4
6

mon
Month of the year (1 - 12)

7
7

year
Year (4 digits)

1997
8

yday
Day of year ( 0 - 365 )

19
9

weekday
Day of the week

Thursday
10

month
Month of the year

January
11

0
Timestamp

948370048
Now you have complete control over date and time. You can format this date and time in whatever format you wan.
Example
Try out following example
<?php
$date_array = getdate();

foreach ( $date_array as $key => $val ){
print "$key = $val<br />";
}

$formated_date = "Today's date: ";
$formated_date .= $date_array['mday'] . "/";
$formated_date .= $date_array['mon'] . "/";
$formated_date .= $date_array['year'];

print $formated_date;
?>
This will produce following result −
seconds = 10
minutes = 29
hours = 9
mday = 5
wday = 1
mon = 12
year = 2016
yday = 339
weekday = Monday
month = December
0 = 1480930150
Today's date: 5/12/2016

Converting a Time Stamp with date()
The date() function returns a formatted string representing a date. You can exercise an enormous amount of control over the format that date() returns with a string argument that you must pass to it.
date(format,timestamp)

The date() optionally accepts a time stamp if omitted then current date and time will be used. Any other data you include in the format string passed to date() will be included in the return value.
Following table lists the codes that a format string can contain −
Sr.No
Format & Description
Example
1

a
'am' or 'pm' lowercase

pm
2

A
'AM' or 'PM' uppercase

PM
3

d
Day of month, a number with leading zeroes

20
4

D
Day of week (three letters)

Thu
5

F
Month name

January
6

h
Hour (12-hour format - leading zeroes)

12
7

H
Hour (24-hour format - leading zeroes)

22
8

g
Hour (12-hour format - no leading zeroes)

12
9

G
Hour (24-hour format - no leading zeroes)

22
10

i
Minutes ( 0 - 59 )

23
11

j
Day of the month (no leading zeroes

20
12

l (Lower 'L')
Day of the week

Thursday
13

L
Leap year ('1' for yes, '0' for no)

1
14

m
Month of year (number - leading zeroes)

1
15

M
Month of year (three letters)

Jan
16

r
The RFC 2822 formatted date

Thu, 21 Dec 2000 16:01:07 +0200
17

n
Month of year (number - no leading zeroes)

2
18

s
Seconds of hour

20
19

U
Time stamp

948372444
20

y
Year (two digits)

06
21

Y
Year (four digits)

2006
22

z
Day of year (0 - 365)

206
23

Z
Offset in seconds from GMT

+5
Example
Try out following example
<?php
print date("m/d/y G.i:s<br>", time());
print "Today is ";
print date("j of F Y, \a\t g.i a", time());
?>
This will produce following result −
12/05/16 9.29:47Today is 5 2016f December 2016, at 9.29 am

Hope you have good understanding on how to format date and time according to your requirement. For your reference a complete list of all the date and time functions is given in PHP Date & Time Functions.
  • 4
This session demonstrates how PHP can provide dynamic content according to browser type, randomly generated numbers or User Input. It also demonstrated how the client browser can be redirected.
Identifying Browser & Platform
PHP creates some useful environment variables that can be seen in the... see more phpinfo.php page that was used to setup the PHP environment.
One of the environment variables set by PHP is HTTP_USER_AGENT which identifies the user's browser and operating system.
PHP provides a function getenv() to access the value of all the environment variables. The information contained in the HTTP_USER_AGENT environment variable can be used to create dynamic content appropriate to the browser.
Following example demonstrates how you can identify a client browser and operating system.
NOTE − The function preg_match()is discussed in PHP Regular expressionsession.
<html>
<body>

<?php
function getBrowser() {
$u_agent = $_SERVER['HTTP_USER_AGENT'];
$bname = 'Unknown';
$platform = 'Unknown';
$version = "";

//First get the platform?
if (preg_match('/linux/i', $u_agent)) {
$platform = 'linux';
}elseif (preg_match('/macintosh|mac os x/i', $u_agent)) {
$platform = 'mac';
}elseif (preg_match('/windows|win32/i', $u_agent)) {
$platform = 'windows';
}

// Next get the name of the useragent yes seperately and for good reason
if(preg_match('/MSIE/i',$u_agent) && !preg_match('/Opera/i',$u_agent)) {
$bname = 'Internet Explorer';
$ub = "MSIE";
} elseif(preg_match('/Firefox/i',$u_agent)) {
$bname = 'Mozilla Firefox';
$ub = "Firefox";
} elseif(preg_match('/Chrome/i',$u_agent)) {
$bname = 'Google Chrome';
$ub = "Chrome";
}elseif(preg_match('/Safari/i',$u_agent)) {
$bname = 'Apple Safari';
$ub = "Safari";
}elseif(preg_match('/Opera/i',$u_agent)) {
$bname = 'Opera';
$ub = "Opera";
}elseif(preg_match('/Netscape/i',$u_agent)) {
$bname = 'Netscape';
$ub = "Netscape";
}

// finally get the correct version number
$known = array('Version', $ub, 'other');
$pattern = '#(?<browser>' . join('|', $known) . ')[/ ]+(?<version>[0-9.|a-zA-Z.]*)#';

if (!preg_match_all($pattern, $u_agent, $matches)) {
// we have no matching number just continue
}

// see how many we have
$i = count($matches['browser']);

if ($i != 1) {
//we will have two since we are not using 'other' argument yet

//see if version is before or after the name
if (strripos($u_agent,"Version") < strripos($u_agent,$ub)){
$version= $matches['version'][0];
}else {
$version= $matches['version'][1];
}
}else {
$version= $matches['version'][0];
}

// check if we have a number
if ($version == null || $version == "") {$version = "?";}
return array(
'userAgent' => $u_agent,
'name' => $bname,
'version' => $version,
'platform' => $platform,
'pattern' => $pattern
);
}

// now try it
$ua = getBrowser();
$yourbrowser = "Your browser: " . $ua['name'] . " " . $ua['version'] .
" on " .$ua['platform'] . " reports: <br >" . $ua['userAgent'];

print_r($yourbrowser);
?>

</body>
</html>
This is producing following result on my machine. This result may be different for your computer depending on what you are using.
It will produce the following result −
Your browser: Google Chrome 54.0.2840.99 on windows reports:
Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko)
Chrome/54.0.2840.99 Safari/537.36

Display Images Randomly
The PHP rand() function is used to generate a random number.i This function can generate numbers with-in a given range. The random number generator should be seeded to prevent a regular pattern of numbers being generated. This is achieved using the srand() function that specifies the seed number as its argument.
Following example demonstrates how you can display different image each time out of four images −
<html>
<body>

<?php
srand( microtime() * 1000000 );
$num = rand( 1, 4 );

switch( $num ) {
case 1: $image_file = "/php/images/logo.png";
break;

case 2: $image_file = "/php/images/php.jpg";
break;

case 3: $image_file = "/php/images/logo.png";
break;

case 4: $image_file = "/php/images/php.jpg";
break;
}
echo "Random Image : <img src=$image_file />";
?>

</body>
</html>
Using HTML Forms
The most important thing to notice when dealing with HTML forms and PHP is that any form element in an HTML page will automatically be available to your PHP scripts.
Try out following example by putting the source code in test.php script.
<?php
if( $_POST["name"] || $_POST["age"] ) {
if (preg_match("/[^A-Za-z'-]/",$_POST['name'] )) {
die ("invalid name and name should be alpha");
}

echo "Welcome ". $_POST['name']. "<br />";
echo "You are ". $_POST['age']. " years old.";

exit();
}
?>
<html>
<body>

<form action = "<?php $_PHP_SELF ?>" method = "POST">
Name: <input type = "text" name = "name" />
Age: <input type = "text" name = "age" />
<input type = "submit" />
</form>

</body>
</html>
  • 4
Error handling is the process of catching errors raised by your program and then taking appropriate action. If you would handle errors properly then it may lead to many unforeseen consequences.
Its very simple in PHP to handle an errors.
Using die() function
While writing your PHP program you should... see more check all possible error condition before going ahead and take appropriate action when required.
Try following example without having /tmp/test.xt file and with this file.
<?php
if(!file_exists("/tmp/test.txt")) {
die("File not found");
}else {
$file = fopen("/tmp/test.txt","r");
print "Opend file sucessfully";
}
// Test of the code here.
?>
This way you can write an efficient code. Using above technique you can stop your program whenever it errors out and display more meaningful and user friendly message.
Defining Custom Error Handling Function
You can write your own function to handling any error. PHP provides you a framework to define error handling function.
This function must be able to handle a minimum of two parameters (error level and error message) but can accept up to five parameters (optionally: file, line-number, and the error context) −
Syntax
error_function(error_level,error_message, error_file,error_line,error_context);

 
Sr.No
Parameter & Description
1

error_level
Required - Specifies the error report level for the user-defined error. Must be a value number.

2

error_message
Required - Specifies the error message for the user-defined error

3

error_file
Optional - Specifies the file name in which the error occurred

4

error_line
Optional - Specifies the line number in which the error occurred

5

error_context
Optional - Specifies an array containing every variable and their values in use when the error occurred

Possible Error levels
These error report levels are the different types of error the user-defined error handler can be used for. These values cab used in combination using | operator
Sr.No
Constant & Description
Value
1

.E_ERROR
Fatal run-time errors. Execution of the script is halted

1
2

E_WARNING
Non-fatal run-time errors. Execution of the script is not halted

2
3

E_PARSE
Compile-time parse errors. Parse errors should only be generated by the parser.

4
4

E_NOTICE
Run-time notices. The script found something that might be an error, but could also happen when running a script normally

8
5

E_CORE_ERROR
Fatal errors that occur during PHP's initial start-up.

16
6

E_CORE_WARNING
Non-fatal run-time errors. This occurs during PHP's initial start-up.

32
7

E_USER_ERROR
Fatal user-generated error. This is like an E_ERROR set by the programmer using the PHP function trigger_error()

256
8

E_USER_WARNING
Non-fatal user-generated warning. This is like an E_WARNING set by the programmer using the PHP function trigger_error()

512
9

E_USER_NOTICE
User-generated notice. This is like an E_NOTICE set by the programmer using the PHP function trigger_error()

1024
10

E_STRICT
Run-time notices. Enable to have PHP suggest changes to your code which will ensure the best interoperability and forward compatibility of your code.

2048
11

E_RECOVERABLE_ERROR
Catchable fatal error. This is like an E_ERROR but can be caught by a user defined handle (see also set_error_handler())

4096
12

E_ALL
All errors and warnings, except level E_STRICT (E_STRICT will be part of E_ALL as of PHP 6.0)

8191
All the above error level can be set using following PHP built-in library function where level cab be any of the value defined in above table.
int error_reporting ( [int $level] )

Following is the way you can create one error handling function −
<?php
function handleError($errno, $errstr,$error_file,$error_line) {
echo "<b>Error:</b> [$errno] $errstr - $error_file:$error_line";
echo "<br />";
echo "Terminating PHP Script";

die();
}
?>
Once you define your custom error handler you need to set it using PHP built-in library set_error_handler function. Now lets examine our example by calling a function which does not exist.
<?php
error_reporting( E_ERROR );

function handleError($errno, $errstr,$error_file,$error_line) {
echo "<b>Error:</b> [$errno] $errstr - $error_file:$error_line";
echo "<br />";
echo "Terminating PHP Script";

die();
}

//set error handler
set_error_handler("handleError");

//trigger error
myFunction();
?>
Exceptions Handling
PHP 5 has an exception model similar to that of other programming languages. Exceptions are important and provides a better control over error handling.
Lets explain there new keyword related to exceptions.

Try − A function using an exception should be in a "try" block. If the exception does not trigger, the code will continue as normal. However if the exception triggers, an exception is "thrown".


Throw − This is how you trigger an exception. Each "throw" must have at least one "catch".


Catch − A "catch" block retrieves an exception and creates an object containing the exception information.

When an exception is thrown, code following the statement will not be executed, and PHP will attempt to find the first matching catch block. If an exception is not caught, a PHP Fatal Error will be issued with an "Uncaught Exception ...

An exception can be thrown, and caught ("catched") within PHP. Code may be surrounded in a try block.


Each try must have at least one corresponding catch block. Multiple catch blocks can be used to catch different classes of exceptions.


Exceptions can be thrown (or re-thrown) within a catch block.

Example
Following is the piece of code, copy and paste this code into a file and verify the result.
<?php
try {
$error = 'Always throw this error';
throw new Exception($error);

// Code following an exception is not executed.
echo 'Never executed';
}catch (Exception $e) {
echo 'Caught exception: ', $e->getMessage(), "\n";
}

// Continue execution
echo 'Hello World';
?>
In the above example $e->getMessage function is used to get error message. There are following functions which can be used from Exception class.

getMessage() − message of exception


getCode() − code of exception


getFile() − source filename


getLine() − source line


getTrace() − n array of the backtrace()


getTraceAsString() − formated string of trace

Creating Custom Exception Handler
You can define your own custom exception handler. Use following function to set a user-defined exception handler function.
string set_exception_handler ( callback $exception_handler )

Here exception_handler is the name of the function to be called when an uncaught exception occurs. This function must be defined before calling set_exception_handler().
Example
<?php
function exception_handler($exception) {
echo "Uncaught exception: " , $exception->getMessage(), "\n";
}

set_exception_handler('exception_handler');
throw new Exception('Uncaught Exception');

echo "Not Executed\n";
?>
  • 4
Cookies are text files stored on the client computer and they are kept of use tracking purpose. PHP transparently supports HTTP cookies.
There are three steps involved in identifying returning users −

Server script sends a set of cookies to the browser. For example name, age, or identification number... see more etc.


Browser stores this information on local machine for future use.


When next time browser sends any request to web server then it sends those cookies information to the server and server uses that information to identify the user.

This chapter will teach you how to set cookies, how to access them and how to delete them.
The Anatomy of a Cookie
Cookies are usually set in an HTTP header (although JavaScript can also set a cookie directly on a browser). A PHP script that sets a cookie might send headers that look something like this −
HTTP/1.1 200 OK
Date: Fri, 04 Feb 2000 21:03:38 GMT
Server: Apache/1.3.9 (UNIX) PHP/4.0b3
Set-Cookie: name=xyz; expires=Friday, 04-Feb-07 22:03:38 GMT;
path=/; domain=tutorialspoint.com
Connection: close
Content-Type: text/html

As you can see, the Set-Cookie header contains a name value pair, a GMT date, a path and a domain. The name and value will be URL encoded. The expires field is an instruction to the browser to "forget" the cookie after the given time and date.
If the browser is configured to store cookies, it will then keep this information until the expiry date. If the user points the browser at any page that matches the path and domain of the cookie, it will resend the cookie to the server.The browser's headers might look something like this −
GET / HTTP/1.0
Connection: Keep-Alive
User-Agent: Mozilla/4.6 (X11; I; Linux 2.2.6-15apmac ppc)
Host: zink.demon.co.uk:1126
Accept: image/gif, */*
Accept-Encoding: gzip
Accept-Language: en
Accept-Charset: iso-8859-1,*,utf-8
Cookie: name=xyz

A PHP script will then have access to the cookie in the environmental variables $_COOKIE or $HTTP_COOKIE_VARS[] which holds all cookie names and values. Above cookie can be accessed using $HTTP_COOKIE_VARS["name"].
Setting Cookies with PHP
PHP provided setcookie() function to set a cookie. This function requires upto six arguments and should be called before <html> tag. For each cookie this function has to be called separately.
setcookie(name, value, expire, path, domain, security);

Here is the detail of all the arguments −

Name − This sets the name of the cookie and is stored in an environment variable called HTTP_COOKIE_VARS. This variable is used while accessing cookies.


Value − This sets the value of the named variable and is the content that you actually want to store.


Expiry − This specify a future time in seconds since 00:00:00 GMT on 1st Jan 1970. After this time cookie will become inaccessible. If this parameter is not set then cookie will automatically expire when the Web Browser is closed.


Path − This specifies the directories for which the cookie is valid. A single forward slash character permits the cookie to be valid for all directories.


Domain − This can be used to specify the domain name in very large domains and must contain at least two periods to be valid. All cookies are only valid for the host and domain which created them.


Security − This can be set to 1 to specify that the cookie should only be sent by secure transmission using HTTPS otherwise set to 0 which mean cookie can be sent by regular HTTP.

Following example will create two cookies name and age these cookies will be expired after one hour.
<?php
setcookie("name", "John Watkin", time()+3600, "/","", 0);
setcookie("age", "36", time()+3600, "/", "", 0);
?>
<html>

<head>
<title>Setting Cookies with PHP</title>
</head>

<body>
<?php echo "Set Cookies"?>
</body>

</html>
Accessing Cookies with PHP
PHP provides many ways to access cookies. Simplest way is to use either $_COOKIE or $HTTP_COOKIE_VARS variables. Following example will access all the cookies set in above example.
<html>

<head>
<title>Accessing Cookies with PHP</title>
</head>

<body>

<?php
echo $_COOKIE["name"]. "<br />";

/* is equivalent to */
echo $HTTP_COOKIE_VARS["name"]. "<br />";

echo $_COOKIE["age"] . "<br />";

/* is equivalent to */
echo $HTTP_COOKIE_VARS["age"] . "<br />";
?>

</body>
</html>
You can use isset() function to check if a cookie is set or not.
<html>

<head>
<title>Accessing Cookies with PHP</title>
</head>

<body>

<?php
if( isset($_COOKIE["name"]))
echo "Welcome " . $_COOKIE["name"] . "<br />";

else
echo "Sorry... Not recognized" . "<br />";
?>

</body>
</html>
Deleting Cookie with PHP
Officially, to delete a cookie you should call setcookie() with the name argument only but this does not always work well, however, and should not be relied on.
It is safest to set the cookie with a date that has already expired −
<?php
setcookie( "name", "", time()- 60, "/","", 0);
setcookie( "age", "", time()- 60, "/","", 0);
?>
<html>

<head>
<title>Deleting Cookies with PHP</title>
</head>

<body>
<?php echo "Deleted Cookies" ?>
</body>

</html>
  • 4
ayPal is a payment processing system, We can integrate PayPal with websites by using with php.
PayPal integration file system
PayPal integration file system included 4 files as shown below.

constants.php − This file has included API user name, password and signature.


CallerService.php −... see more This file has included PayPal Services, which is used to call PayPal services.


confirmation.php − This file has included a form with minimum fields required to make payment process and it will return payment success or failure.


PayPal_entry.php − This page has used to send the user the data to PayPal. It acts as an adapter between PayPal and user form.

The user has to download a PayPal SDK file from here and exact a zip file. The zip file contains four php files, We don't need to change any file except constants.php
The constants.php file contains code as shown below −
<?php
define('API_USERNAME', 'YOUR USER NAME HERE');
define('API_PASSWORD', 'YOUR PASSWORD HERE');
define('API_SIGNATURE', 'YOUR API SIGNATURE HERE');
define('API_ENDPOINT', 'https://api-3t.paypal.com/nvp');
define('USE_PROXY',FALSE);
define('PROXY_HOST', '127.0.0.1');
define('PROXY_PORT', '808');
define('PAYPAL_URL', 'https://www.PayPal.com/webscr&cmd=_express-checkout&token=');
define('VERSION', '53.0');
?>
The user will declare User Name, password and signature in above syntax which are placed in constants.php. This is an experimental example so the last amount will be added to sandbox's account.
  • 4
Required field will check whether the field is filled or not in the proper way. Most of cases we will use the * symbol for required field.
What is Validation ?
Validation means check the input submitted by the user. There are two types of validation are available in PHP. They are as follows −

Client-Side... see more Validation − Validation is performed on the client machine web browsers.


Server Side Validation − After submitted by data, The data has sent to a server and perform validation checks in server machine.

Some of Validation rules for field
Field
Validation Rules
Name
Should required letters and white-spaces
Email
Should required @ and .
Website
Should required a valid URL
Radio
Must be selectable at least once
Check Box
Must be checkable at least once
Drop Down menu
Must be selectable at least once
Valid URL
Below code shows validation of URL
$website = input($_POST["site"]);

if (!preg_match("/\b(?:(?:https?|ftp):\/\/|www\.)[-a-z0-9+&@#\/%?=~_|!:,.;]*[-a-z0-9+&@#\/%=~_|]/i",$website)) {
$websiteErr = "Invalid URL";
}
Above syntax will verify whether a given URL is valid or not. It should allow some keywords as https, ftp, www, a-z, 0-9,..etc..
Valid Email
Below code shows validation of Email address
$email = input($_POST["email"]);

if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
$emailErr = "Invalid format and please re-enter valid email";
}
Above syntax will verify whether given Email address is well-formed or not.if it is not, it will show an error message.
Example
Example below shows the form with required field validation
<html>

<head>
<style>
.error {color: #FF0000;}
</style>
</head>

<body>
<?php
// define variables and set to empty values
$nameErr = $emailErr = $genderErr = $websiteErr = "";
$name = $email = $gender = $comment = $website = "";

if ($_SERVER["REQUEST_METHOD"] == "POST") {
if (empty($_POST["name"])) {
$nameErr = "Name is required";
}else {
$name = test_input($_POST["name"]);
}

if (empty($_POST["email"])) {
$emailErr = "Email is required";
}else {
$email = test_input($_POST["email"]);

// check if e-mail address is well-formed
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
$emailErr = "Invalid email format";
}
}

if (empty($_POST["website"])) {
$website = "";
}
else {
$website = test_input($_POST["website"]);
}

if (empty($_POST["comment"])) {
$comment = "";
}else {
$comment = test_input($_POST["comment"]);
}

if (empty($_POST["gender"])) {
$genderErr = "Gender is required";
}else {
$gender = test_input($_POST["gender"]);
}
}

function test_input($data) {
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
}
?>

<h2>Absolute classes registration</h2>

<p><span class = "error">* required field.</span></p>

<form method = "post" action = ">?php
echo htmlspecialchars($_SERVER["PHP_SELF"]);?>">
<table>
<tr>
<td>Name:</td>
<td><input type = "text" name = "name">
<span class = "error">* <?php echo $nameErr;?></span>
</td>
</tr>

<tr>
<td>E-mail: </td>
<td><input type = "text" name = "email">
<span class = "error">* <?php echo $emailErr;?></span>
</td>
</tr>

<tr>
<td>Time:</td>
<td> <input type = "text" name = "website">
<span class = "error"><?php echo $websiteErr;?></span>
</td>
</tr>

<tr>
<td>Classes:</td>
<td> <textarea name = "comment" rows = "5" cols = "40"></textarea></td>
</tr>

<tr>
<td>Gender:</td>
<td>
<input type = "radio" name = "gender" value = "female">Female
<input type = "radio" name = "gender" value = "male">Male
<span class = "error">* <?php echo $genderErr;?></span>
</td>
</tr>

<td>
<input type = "submit" name = "submit" value = "Submit">
</td>

</table>

</form>

<?php
echo "<h2>Your given values are as:</h2>";
echo $name;
echo "<br>";

echo $email;
echo "<br>";

echo $website;
echo "<br>";

echo $comment;
echo "<br>";

echo $gender;
?>

</body>
</html>
It will produce the following result −
  • 4
This tutorial demonstrates how to create a login page with MySQL Data base. Before enter into the code part, You would need special privileges to create or to delete a MySQL database. So assuming you have access to root user, you can create any database using mysql mysqladmin binary.
Config.php
Config.php... see more file is having information about MySQL Data base configuration.
<?php
define('DB_SERVER', 'localhost:3036');
define('DB_USERNAME', 'root');
define('DB_PASSWORD', 'rootpassword');
define('DB_DATABASE', 'database');
$db = mysqli_connect(DB_SERVER,DB_USERNAME,DB_PASSWORD,DB_DATABASE);
?>
Login.php
Login PHP is having information about php script and HTML script to do login.
<?php
include("config.php");
session_start();

if($_SERVER["REQUEST_METHOD"] == "POST") {
// username and password sent from form

$myusername = mysqli_real_escape_string($db,$_POST['username']);
$mypassword = mysqli_real_escape_string($db,$_POST['password']);

$sql = "SELECT id FROM admin WHERE username = '$myusername' and passcode = '$mypassword'";
$result = mysqli_query($db,$sql);
$row = mysqli_fetch_array($result,MYSQLI_ASSOC);
$active = $row['active'];

$count = mysqli_num_rows($result);

// If result matched $myusername and $mypassword, table row must be 1 row

if($count == 1) {
session_register("myusername");
$_SESSION['login_user'] = $myusername;

header("location: welcome.php");
}else {
$error = "Your Login Name or Password is invalid";
}
}
?>
<html>

<head>
<title>Login Page</title>

<style type = "text/css">
body {
font-family:Arial, Helvetica, sans-serif;
font-size:14px;
}

label {
font-weight:bold;
width:100px;
font-size:14px;
}

.box {
border:#666666 solid 1px;
}
</style>

</head>

<body bgcolor = "#FFFFFF">

<div align = "center">
<div style = "width:300px; border: solid 1px #333333; " align = "left">
<div style = "background-color:#333333; color:#FFFFFF; padding:3px;"><b>Login</b></div>

<div style = "margin:30px">

<form action = "" method = "post">
<label>UserName :</label><input type = "text" name = "username" class = "box"/><br /><br />
<label>Password :</label><input type = "password" name = "password" class = "box" /><br/><br />
<input type = "submit" value = " Submit "/><br />
</form>

<div style = "font-size:11px; color:#cc0000; margin-top:10px"><?php echo $error; ?></div>

</div>

</div>

</div>

</body>
</html>
welcome.php
After successful login, it will display welcome page.
<?php
include('session.php');
?>
<html">

<head>
<title>Welcome </title>
</head>

<body>
<h1>Welcome <?php echo $login_session; ?></h1>
<h2><a href = "logout.php">Sign Out</a></h2>
</body>

</html>
Logout page
Logout page is having information about how to logout from login session.
<?php
session_start();

if(session_destroy()) {
header("Location: login.php");
}
?>
session.php
Session.php will verify the session, if there is no session it will redirect to login page.
<?php
include('config.php');
session_start();

$user_check = $_SESSION['login_user'];

$ses_sql = mysqli_query($db,"select username from admin where username = '$user_check' ");

$row = mysqli_fetch_array($ses_sql,MYSQLI_ASSOC);

$login_session = $row['username'];

if(!isset($_SESSION['login_user'])){
header("location:login.php");
}
?>
  • 4
Ajax is used to communicate with web pages and web servers. Below example demonstrate a search field using with Ajax.
<html>
<head>

<style>
span {
color: green;
}
</style>

<script>
function showHint(str)... see more {
if (str.length == 0) {
document.getElementById("txtHint").innerHTML = "";
return;
}else {
var xmlhttp = new XMLHttpRequest();

xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
document.getElementById("txtHint").innerHTML = xmlhttp.responseText;
}
}
xmlhttp.open("GET", "php_ajax.php?q=" + str, true);
xmlhttp.send();
}
}
</script>

</head>
<body>

<p><b>Search your favourite tutorials:</b></p>

<form>
<input type = "text" onkeyup = "showHint(this.value)">
</form>

<p>Entered Course name: <span id="txtHint"></span></p>

</body>
</html>

Above code opens a file, name called as php_ajax.php by using with GET method, so we need to create a file, name called as php_ajax.php in the same directory and out put will be attached with txtHint.
php_ajax.php
It contained array of course names and it returns the value to web browser.
<?php
// Array with names
$a[] = "Android";
$a[] = "B programming language";
$a[] = "C programming language";
$a[] = "D programming language";
$a[] = "euphoria";
$a[] = "F#";
$a[] = "GWT";
$a[] = "HTML5";
$a[] = "ibatis";
$a[] = "Java";
$a[] = "K programming language";
$a[] = "Lisp";
$a[] = "Microsoft technologies";
$a[] = "Networking";
$a[] = "Open Source";
$a[] = "Prototype";
$a[] = "QC";
$a[] = "Restful web services";
$a[] = "Scrum";
$a[] = "Testing";
$a[] = "UML";
$a[] = "VB Script";
$a[] = "Web Technologies";
$a[] = "Xerox Technology";
$a[] = "YQL";
$a[] = "ZOPL";

$q = $_REQUEST["q"];
$hint = "";

if ($q !== "") {
$q = strtolower($q);
$len = strlen($q);

foreach($a as $name) {

if (stristr($q, substr($name, 0, $len))) {
if ($hint === "") {
$hint = $name;
}else {
$hint .= ", $name";
}
}
}
}
echo $hint === "" ? "Please enter a valid course name" : $hint;
?>

It will produce the following result −
  • 5
Stepping out of your ‘Comfort Zone’ is the real challenge. Little did I know what this sentence meant until I myself stepped out of my comfort zone and took challenges in my life.
So I was a super happy BBA grad, like every other girl in my university, ready to take the next big step in life.Thanks... see more to Allah, I got my first job before my convocation and started to plan my life ahead.
It was a decent job in Sales department, with good package and a car for commuting within Karachi as traveling and maintaining clientele was part of my job description.
With uncountable perks, best work environment, healthy opportunities and ample growth, I took the job. However, what came next, turned my life upside down.
My reporting branch was situated at Korangi Industrial Area, near Jinnah Medical and Pakistan Steel Mills.My day at work started from 9am, where I’d drive to work daily and return around 7ish pm.
I did not have the slightest clue that the experience I was going to gain from this organization or in this specific role, will change me a person. And so my way of thinking regarding a lot of little things including my perception changed.I had always been a pampered child of my family. Too protected, too polished. Not going to far flung areas of Karachi because of the usual ‘halaat kharab hein’ or ‘garmi bohot hai’ or ‘Tyre puncture hogaya tou?’ etc.
So as soon as my rotation ended, I was asked to report to Branch 1 at Korangi, which by the way I’d be referring to as ‘my happy place’ throughout this article.
First day, I was on my way to ‘my happy place’, with closer on full volume and shades in place. As I reached Brooks chowrangi, I realized I had something on my face. Something huge. Maybe near my eyes. Maybe on my forehead. The first thing I did after reaching my office was rush to the restroom and check if my “no makeup look” was on point. And the hell it was! I was confused, blank and totally lost.
If my makeup was fine, if my forehead did not have any huge black spot, then what was it? Why were some eyes glued to me throughout my journey? Why were they following me as I drove past each one of them? Looking as if they were trying to tell me something. Say something. Or maybe give a signal?
I pushed these thoughts away and chose to continue working. Little did I know the horror show is yet to start!
Next day, worse.
The eyes pierced through me. The abysmal bus conductor standing near Imtiaz’s bus stop, or a bike rider on Shawn Chowrangi’s signal, had their skin piercing sharp looks and their bee-like huge eyes stuck on me as I passed by them. Chills running down my spine, I did what I did best, imagined my Mehran as a Ferrari and drove as fast as I could, to reach my happy place.
Same like the previous day, I rushed to the restroom, hoping to find SOMETHING on my face just to justify those stares. But no, nothing..
As soon as I was turning around to continue with my daily routine, my eyes fell on my shiny gold pendant that I wore everyday to work. Suddenly my father’s reminder popped up in my head.
He had given me heads up a few days back and had asked me to avoid using my phone when I enter Korangi area and to avoid wearing or carrying anything super valuable as mugging was a very common practice in this locality.
And this is it! I got it! Mystery solved!
So all those desperate looks were after my little gold pendant! Wow. Ta-daa! Problem solved.
Well, I was stupid enough to think that leaving my pendant on my dressing table before coming to work, would leave all the evil stares somewhere far away from me too.
And yet again, they followed me. Each stare, with a tiny sharp smile, at times a short quick wink was all that I witnessed every morning. I felt exposed, and that’s it! Mom’s voice rushed in my mind “Sarpey dupatta le lia karo, drive kartey huye”
Oh yes Sana, how can you be so stupid! One piece of cloth on your head, and you’re good to go.  Nobody will stop you, nobody will wink smile or even look at you. Problem solved, right? WRONG!
Dupatta didn’t work. Well, if covering myself didn’t work, maybe covering the car would work?
Next day, Sana’s covered – check, car covered with shades on each window – check, no necklace or gold pendant – check and lastly, EYES LOOKING AT YOU AND MOUTH GIVING YOU SMILES WITH GUTKA COMING OUT OF THE WHITE-TURNED-BLACK TEETH? CHECK!
And that’s when I sat back and realized. Its not us, girls. It’s the society.
Not everyone is the same, agreed. But we cannot deny how easy it is for a man in Karachi to look at you without blinking his eyes and smile/wink or even bite his lips alongside. However, all a girl can do is look down, elsewhere or just pretend she didn’t meet any eyes whatsoever.
It was hard for me to adjust with this environment. Environment which, neither me nor my family or my company could change. Because this? This runs in their blood.
I thought of asking the usual “tumharey ghar me maa behen nahi hein kia?” to the culprits, but is it worth it? Its not. This mentality can only be changed through education, because with education comes respect.
So whoever is out there, driving on the roads getting all the worlds attention,  from a hawker in kameez shalwaar, or a paanwala passing a wink, or a bus driver not letting you over take and smiling from his rear view mirror, well trust me, that’s ALL they can do.
And you? You can learn to be indifferent about it and make a little prayer for these people who have taken “deikh magar pyaar sey” too literally that yes someday, they will change and we girls, will get our share of respect.Let the games begin.
  • 4
Education, much like everything else in the field of human knowledge, is rooted to philosophy. The curriculum texts, teaching pedagogies and school structures all reflect a particular philosophical premise.
Be it the idealist school or the existentialist one, the pragmatist theorists or those who seek... see more to use education for social change in the critical paradigm, education is about ‘wide-awakeness’. Today in education, a crucial issue facing us is the need to find ways of educating young persons to sensitivity, potency, social consciousness and a healthy citizenship ethos.
In my journey so far as a teacher, I have been particularly impressed with three schools of philosophy: the idealist, pragmatist, and critical schools of education.
 
The idealist school believes that reality already exists in the way that it is experienced. Education is important not only for personal advantage, but it should be pursued for benefitting the whole of humanity. It is the teachers who become the models of truth in this perspective. Here learning is, in the last analysis, the realisation of good and truth. For idealists, the human spirit is the link between physical reality and the idealist design. Education, therefore, must ‘convert original nature into spiritual nature’.
Idealists posit that the knowledge acquired through creativity and analysis is more important than sensory knowledge. Therefore, education should lead to a harmony being established between the self and the universal self.
Here, I would like to cite the school established by Rabindranath Tagore, one of my favourite Indian authors, in Bengal. Tagore worked endlessly to evoke among his students a sense of complete harmony with the universe, where education was both a source of moral elevation and freedom of spirit.
Pakistani students need this exposure to education more than ever today. In the rat race for grades, internship opportunities and Model United Nations invitations, they have lost out on the meaning of education, its intrinsic goodness and the ability to morally uplift a person.
The second school that made an impact on me was the pragmatist school, since idealism is always to be conditioned by a pinch of pragmatism. Pragmatist educators are moderators of learning. Here, as John Dewey, the architect behind America’s educational reforms emphasised,

“Knowledge is neither certain, nor is it immutable.”

Rather, pragmatists base their teachings on their surroundings, and wish to teach children ‘how’ to think rather than ‘what’ to think.
The pragmatist school is centred on students and encourages them to embark on discovery journeys of their own. Consequently, scientific inquiry becomes important and is prized for the ends it can achieve. For pragmatists, education has an end and nothing is important for its own sake.
Many schools in Pakistan are living examples of this philosophy. Tests in these schools are designed to measure thinking and application of ideas. They have field trips as a vital part of student co-curricular activities and these are taken to be adding valuable exposure to a student’s experience of the world.
Towards the very last, I would like to talk about the critical school.
The philosophical work of Paulo Freire put me in a very different plain of thought where I began to take my teaching profession and holistic education in a completely different light. Since critical theorists engage in deconstruction, I started to engage in the deconstruction of my whole educational experience so far, both as a teacher and a student.
This reflection then formed the basis of an educational design, where the social context of oppression comes to play a defining role. History becomes fused with the present and the two combine to paint a picture of the totality of future, where every act of oppression and the counter act to fight it lead to a dialectical unfolding of events.
Now I believe that teachers can then never be insulated from political activism. Rather, they should be made responsible for sowing the seeds of discontent in the hearts and minds of their students against the oppression that society unleashes on the marginalised and the insignificant.
Schools of the global South, the global marginalised, the global oppressed need this type of education to transform the society. They require teachers and students of courage who have the audacity to pine for a different future and hope for a far more equal world than the one we are in possession of at the moment.
Paulo Freire sums it up succinctly,

“It is necessary that the weakness of the powerless is transformed into a force capable of announcing justice.”

Do we have the power to transform our weakness into a potent force capable of demanding justice?
  • 4
The Bhartiya Janata Party (BJP) rose to national consciousness through the Babri Masjid agitation in the 80s and 90s. Through this movement, it laid the foundation for majoritarian politics in India. The victory of the BJP in 2014, where it got a majority in the parliament for the first time in... see more the history of independent India, is the fructification of the campaign that started in the late 80s.
The Hindu right-wing party wants to build a temple on the site of the Babri Masjid in Ayodhya. They claim it was built by the Mughal ruler Babur in the early 16th century on the place which is supposed to be the birthplace of the Hindu God, Ram.
Ayodhya and Ram are ingrained in the Hindu psyche. By dragging Ram into the political arena, the BJP managed to mobilise Hindu masses and that led to the demolition of the mosque on December 6, 1992. This happened despite the assurances given to the court by the leaders of the Hindu right-wing party. Former Prime Minister Atal Bihari Vajpayee admitted that it was a mistake.
 
Several senior leaders of the BJP were present at the site when the demolition took place. Present Prime Minister Narendra Modi was an active organiser of the campaign for the Ram temple in 1990. He travelled with senior leader Lal Krishna Advani, mobilising and inciting masses to join the campaign for Ram temple.
After 24 years, the Lucknow High Court charged Advani, Central Minister Uma Bharti and former Minister Murli Manohar Joshi with criminal conspiracy for the 1992 Babri Masjid demolition case. The court has asked the Central Bureau of Investigation (CBI), the chief investigating agency, to wrap up the case within two years.
Not many have any interest in what happens to the aging leaders of the BJP. At the same time, not many are optimistic about the court coming out with any verdict on the merit of the case or whether the temple existed at the place where the Babri Masjid was built. No one is sure whether the court will hold anyone accountable for the loss of hundreds of lives during the Ram temple campaign in the 80s and 90s.
Though the temple is not still built at Ayodhya, the BJP, however, succeeded in its political mission. The party has an overarching presence in major parts of the country. It has managed to alter the political ethos of India and created majoritarian politics, which was not imaginable till few years ago.
Those who understand politics can tell you that the BJP and its patron Rashtriya Swayamsevak Sangh’s (RSS) project is not just to replace a mosque with a temple, but to convert secular India into a Hindu nation. Their campaign is not against a temple but the whole Islamic and non-Hindu history of India.
We should not delude ourselves over whether the BJP will stop talking about the temple or divisive politics once Ram’s temple is built at the site of the mosque.
The last three years of the BJP regime are ample proof that the party’s agenda is to hinduise India and undermine social, cultural and religious diversity. The ban on beef eating shows how the party wants to thrive by polarising the society. It is formulating a stringent law for those who slaughter cows and cattle but does not react when a mob kills someone just on the mere allegation of having beef at home.
The temple agitation created a mob frenzy that claimed not only the mosque, but also many innocent lives. Nothing happened to those who committed the crime. This pattern is continued till date.
India is now in the hands of those who always stood against the idea of India as a secular and multicultural nation. It is now ruled by the party and the ideology which always thrived on polarisation, sectarianism and extremism. After independence, the nation building process involved taking everyone along and trying to forge inter-cultural and inter-religious bonding. This in turn made India a strong democratic and secular nation.
Now a new narrative has taken over. India has never been overwhelmed by such aggressive Hindu agenda as it is now witnessing. The temple agitation has radicalised the majority community in India.
The court can decide the entitlement of the disputed site, but the question here is not about the ownership of the land, it is about the question of the ownership of India. The larger issue is, can the Hindus of BJP claim to be the owners of India? No. They represent the worst of what India can imagine itself to be.
It is the idea of India which is at stake. If we fail now, we will be staring at a future which is full of social and religious conflicts.
India is at a dangerous cross road.
  • 4
Dear Murad Ali Shah,
It is well known that if you want to get anything done in your province, you have to pay the right people. In most cases, the right people are the ‘baboos’ as they are the ones who can skilfully insert whatever you want in any document knowing that the person who approves... see more it will do so without reading it.
Sometimes, if a baboo is not paid anything or not paid what he wants, he can do the opposite; he can get a tax imposed or increased on a particular commodity or service. This is what seems to have happened in the recently announced Sindh budget. Sindh now has the dubious distinction of being the only province in the country which recovers sales tax from the fledgling Information Technology (IT) services business. Even the federal government has exempted the IT sector from taxes. So what’s the aim of this harassment, do you want to kill the IT business or drive it away to the other provinces? If I were you, I would immediately transfer the baboo or whoever is responsible for this to the remotest corner of the province (where he will not be able to earn the millions he is doing now).
 
Sir, your recent budget has a deficit of Rs14 billion, which means that your expenditure for the year will be greater than your revenue by that amount. Being the finance minister of the province, you should realise that this deficit should be reduced to the minimum, if not eliminated entirely. I can, however, show you how it’s done, and how your budget can be converted to a surplus budget. I will not charge you anything for my advice. I only request that the extra money be spent to help save the starving people of Thar. And you might consider spending a few billion to clean up Karachi (which contributes 96% of Sindh’s revenue).
You can begin with restaurants. Do you know that there are hundreds of restaurants in Karachi alone whose owners don’t pay sales tax? Those that are registered with the sales tax department pay only a token amount which is a few thousand rupees to the government every year. They can get away with this robbery by bribing your sales tax collection staff heavily. To increase the revenue from such restaurants (many of which serve more than five hundred customers a day), all you have to do is to hire honest people to monitor the sales of these restaurants.
Obviously, you can’t ask your sales tax department personnel to do so, since they are already taking millions from the restaurant owners to look the other way. I suggest that you hire eunuchs who are erroneously called ‘transvestites’ to do the job. They should be persuaded to stop begging, and you can employ them to report how many customers eat daily at the restaurants in the province. This data can be compared with that submitted by the restaurant owners. You will be shocked at the large scale evasion of sales tax, if you don’t know that already. I’m sure the eunuchs will do a better job than Sindh government employees, and the amount recovered as sales tax from restaurants will increase to at least 25 times of what is collected today.
Coming to the most lucrative of them all; the property sector. Of course you must have some idea of the loot and plunder going on in the sale and purchase of property in Karachi. Your predecessor took over the Karachi Building Control Authority (KBCA) and renamed it the Sindh Building Control Authority (SBCA), so that the taxes recovered from this sector would not be spent on Karachi. Out of the 25 directors in this authority, 21 are working in Karachi.
The price of a 500-square yard plot in Karachi is Rs70 million (equivalent to Rs140, 000 per square yard). However, the value fixed by your government (known as District Collector (DC) value) is only Rs1,980 per square yard. Your government therefore receives only Rs49, 500 as tax and stamp duty instead of Rs3,500,000 (which would have been the tax, if levied on the actual price). So, every time a 500-square yard plot in Karachi changes hands, the government loses Rs3,450,500.
Since hundreds of transactions take place in Karachi every day, the Sindh government loses billions every year. My estimate is Rs500 billion at least, if not more. If the DCs don’t know the actual value of properties, they can visit web sites like zameen.com, and they will get a good idea of the quantum of taxes the property sector mafia is evading. And if the DCs refuse to levy taxes on the actual property values, you can conclude that they too are in collusion with the mafia and making millions every year.
Sir, if you do what I have suggested, you will be able to change the face of Sindh. Please, for once do the right thing, don’t be afraid of those who will be affected. Stop the loot and plunder, recover the due taxes from these two sectors and soon Sindh will become the richest province in the country.
  • 4
When the student body president of a Northern California high school won his campaign after posting an Islamophobic joke, I was not surprised. It is part and parcel of American high schools to reward students for racism, particularly when the school administration isn’t interested in protecting... see more vulnerable students for the sake of ‘keeping the peace’.
By overlooking racist and toxic behaviour, schools inevitably normalise racism, misogyny, and heterosexism, all of which lend to bullying and cheapen the lives of many young people at these schools. And it’s not only the oppressed or the so-called victim who is negatively affected by this situation, but the oppressor as well, who finds himself falling into behaviour patterns that terminate potential points of connection and inhibit transformative learning.
But why do students in American high schools resort to racism? Socialised behaviour and enforcing hegemony is only part of the answer. The reason teenagers peddle jokes that dehumanise their peers is because they want to appear to be ‘cool’.
 
What is American ‘cool’? It’s being hypermasculine, socially acceptable, and bold. The ‘bold’ trait both includes and celebrates controversy, which bullies the weakest and from which the perpetrators emerge unscathed. It’s a kind of boldness that reinforces and enhances social mores, of which racism still remains a crucial part. The foundation of American confidence is built on the dehumanisation and humiliation of women, LGBTQ people, and people who aren’t white. And all this starts, and perhaps even reaches its peak, in high school.
But the compulsion for American ‘cool’ is rooted in insecurity, especially when it appears among high school students. It’s the insistence for social belonging that leads young adults to embrace, celebrate, and reproduce racism within their own generation. And Muslims have always been the convenient ‘other’ against which western civilisation has constructed itself, as Palestinian-American Professor Edward Said theorised and proved in his seminal Orientalism (1978).
The condition of this construction of identity against the Muslim other has only intensified in the aftermath of the War on Terror, the constant media barrage against Muslims in the name of fighting the Islamic State (IS), and the public validation of American Islamophobia with the election of avowed racist President Donald Trump.
The student under controversy at San Ramon Valley High School – the junior student body president –won his election campaign with the aid of a video he made where he promises to fight IS. While the video was taken down within 24 hours of uploading it, it clearly struck a nerve in a diverse part of the country. The school reported that the video used stereotypes of “Middle Eastern people” based on “their dress, names, manner of praying and religious dietary restrictions”.
The participation of two reportedly Afghan students in the video as ‘terrorists’ not only exposes the backhanded character of American racism, it demonstrates the lengths to which people who are not white will go to be accepted into the American fabric of belonging. For Muslims, there is always a price to pay for social acceptance, and that is our self-respect.
Racist bullying remains a chronic problem in schools in America, though it isn’t highlighted as much as sexism, homophobia, or transphobia. The Netflix TV series 13 Reasons Why, which incidentally also takes place in Northern California, exposes the misogyny and culture of rape and sexual harassment which is rampant in American high schools, and foremost enabled by teachers who ‘look the other way’.
The same dynamic applies to Islamophobic racism. A 2015 report by the California chapter of CAIR found that 55% of Muslim students reported bullying, which is twice the number of all students facing bullying on a national basis.
The fact that teachers are complicit or even instigators of bullying is as disturbing as it is unethical and counter-intuitive to the goal of education. The 2015 incident of 14-year-old Ahmed Mohamed being arrested because his teacher called the cops on him for making a clock attests both to the complicity of teachers in racism and the perceived threat of critical thinkers and talented students, who may be Muslim and not white.
The Texas school district where Mohamed studied and was unjustly led away in handcuffs faced no accountability, just as San Ramon Valley High’s junior student body president will face no discipline for producing images of violent Muslims, and ridiculing the culture and faith of his peers.
Even amidst the media furor and the concerns of parents who have dared to take a stand, the irony of a junior student body president winning a campaign built on racism isn’t lost. After all, Trump was elected president of the US in exactly the same way.
  • 4
بلوچستان کی حکومت نے ضلع گوادر کے ساحل سے 40 کلومیٹر دور واقع جزیرے استولا کو سمندری حیات کے لیے محفوظ علاقہ قرار دے دیا ہے۔
یہ پاکستان کا پہلا ایسا علاقہ ہے جسے یہ درجہ... see more دیا گیا ہے۔
صوبائی حکومت کی جانب سے جاری کیے گئے بیان کے مطابق اس اقدام کا مقصد جزیرے اور اس کے اردگرد پائی جانے والی سمندری حیات، پرندوں اور ان کے مسکن کو انسانوں کی مداخلت اور سرگرمیوں سے پہنچنے والے نقصان سے بچانا ہے۔
حکومتی حکم نامے میں کہا گیا ہے کہ حکومت کی اجازت کے بغیر جزیرے کی زمین یا اس کے گرد سمندر کا استعمال نہیں کیا جا سکے گا کیونکہ یہ وہاں کے حیاتیاتی ماحول کے تحفظ کے لیے ضروری ہے۔
یہ جزیرہ اب عام لوگوں کی تفریح اور تعلیمی مقاصد کے لیے بھی اس وقت کھولا جائے گا جب حکومت اس کی اجازت دے گی۔
محفوظ علاقہ قرار دیے جانے کے بعد اب اس جزیرے پر ایسے کسی بھی کام کی ممانعت ہوگی جس کی وجہ سے جزیرے پر یا سمندر میں موجود حیات کی نشوونما اور افزائش نسل کے نظام میں خلل پڑے۔
ممنوعہ اقدامات

وہیل، شارکس، کچھووں اور پرندوں سمیت ایسے تمام جانداروں کا شکار یا انھیں جال میں پھنسا کر پکڑنا منع ہو گا جن کی نسلوں کو معدومی کا خطرہ لاحق ہے۔


جزیرے پر کسی بھی قسم کی عارضی یا مستقل تعمیرات کی اجازت نہیں ہوگی۔


متعلقہ حکام سے اجازت کے بغیر یہاں قیام نہیں کیا جا سکے گا۔


قانون نافذ کرنے والے اداروں کے علاوہ کسی کو بھی ہتھیار لے جانے کی اجازت نہیں ہو گی۔


حکام سے اجازت کے بغیر جزیرے پر سکوبا ڈائیونگ، زیر آب تیراکی، کلف ڈائیونگ، جیٹ سکیئنگ، کشتی رانی، سرفنگ یا ماہی گیری کی اجازت نہیں ہوگی۔


محکمہ ماہی گیری حکومت بلوچستان کے ڈائریکٹر جنرل محمد نور نے بی بی سی اردو کے محمد کاظم کو بتایا کہ اس جزیرے کی کل لمبائی ساڑھے تین کلومیٹر اور چوڑائی ڈیڑھ کلومیٹر ہے اور یہ سمندری علاقہ نہ صرف ماہی گیری کے حوالے سے بہت زیادہ زرخیز ہے بلکہ استولا کا جزیرہ سردیوں میں روس اور دنیا کے دیگر ممالک سے آنے والے پرندوں کا مسکن بھی بنتا ہے جو یہاں آ کر انڈے دیتے ہیں۔
انٹرنینشل یونین فار کنزرویشن آف نیچر(آئی یو سی این) کے مطابق استولا کا جزیرہ چھوٹی چٹانی پہاڑیوں پر مشتمل ہے اور یہ پاکستان کا سب سے بڑا جزیرہ ہے۔
ادارے کے مطابق یہاں ملنے والی کئی آبی حیات اور نباتات پاکستان کے دیگر علاقہ جات تو کیا کسی دوسرے ملک میں بھی نہیں ملتیں۔
صرف اس جزیرے پر پائے جانے والے جانداروں میں سن وائپر نامی زہریلا سانپ اہم ہے۔ اس کے علاوہ یہاں گریٹر کرسٹیڈ نامی پرندہ ہزاروں کی تعداد میں موجود ہے جبکہ دنیا کے دیگر علاقوں میں ان کی تعداد بہت کم ہو چکی ہے۔


اس جزیرے کے ساحل پر معدومی کے خطرے کا شکار سبز اور ہاکس بل کچھووں کی انڈے دینے کی جگہیں بھی ہیں۔
ڈائریکٹر جنرل فشریز محمد نور کا کہنا تھا کہ اس جزیرے کو محفوظ علاقہ قرار دینے سے جہاں پرندوں کو تحفظ ملے گا وہاں اس کا ایک اور بڑا فائدہ یہ ہوگا کہ اس سے کورل یعنی مونگے کی چٹانیں بھی محفوظ ہو جائیں گی جنھیں اس علاقے میں غوطہ خوری سے نقصان پہنچ رہا تھا۔
ان کا کہنا تھا اس علاقے میں ’کورلز کی 250 سے زائد اقسام ہیں۔ جب یہ کورلز فاسلز بنتے ہیں تو یہ نہ صرف مچھلیوں کی نسل کو بڑھانے میں مدد دیتے ہیں بلکہ چھوٹی مچھلیوں کو اپنے آپ کو بڑی مچھلیوں سے بچانے کے لیے پناہ گاہ بھی بن جاتے ہیں۔‘
ورلڈ وائیڈ فنڈ کے تکنیکی ڈائریکٹر محمد معظم نے نامہ نگار ریاض سہیل کو بتایا کہ استولا کو محفوظ علاقہ قرار دینے کا اقدام کنونشن آف میرین بائیو ڈائیورسٹی کا حصہ ہے جس کی پاکستان نے توثیق کی ہے۔
انھوں نے بتایا کہ کنونشن کے اہداف کے حوالے سے انڈونیشیا کے شہر آچے میں ایک اجلاس ہوا تھا جس میں قوموں پر یہ لازم کیا گیا تھا کہ وہ اپنی سمندری حدود کا دس فیصد آبی حیات کے تحفظ کے لیے مختص کریں گی۔
  • 4
کیمبرج یونیورسٹی کے محقق اور پاکستان کے صوبہ بلوچستان سے تعلق رکھنے والے پاکستانی سائنسدان یار جان عبدالصمد کے لیے ان کے ساتھیوں کی قبل از وقت گرمجوشی نے انھیں مشکل میں... see more ڈال دیا ہے۔
انھیں سوشل میڈیا پر مبارک باد ملنے کا ایک نہ رکنے والا سلسلہ شروع ہوگیا ہے۔ ان کی خلا میں جانے کی ’جھوٹی‘ خبر اور ان کی سی وی بھی سوشل میڈیا پر وائرل ہو گئی ہے۔
پی ایچ ڈی ڈگری کے حامل یار جان عبدالصمد سے متعلق سوشل میڈیا پر یہ خبریں گردش کرنے لگیں کہ یورپی خلائی ایجنسی کے ایک پروگرام کے لیے ان کا خلائی سفر کے لیے انتخاب ہوا ہے۔ اس طرح وہ پہلے پاکستانی ہیں جو خلا میں جائیں گے۔
اگرچہ اس سے قبل نمیرہ سلیم نامی ایک خاتون خلائی سفر کے لیے اپنی تربیت کا آخری مرحلہ ایس ٹی ایس 400 سمیولیٹر کے ذریعہ مکمل کر چکی ہیں اور اس طرح وہ پہلی پاکستانی خلا نورد بن رہی ہیں۔ مردوں میں یقیناً وہ پہلے پاکستانی مرد ہوتے لیکن ایسا کچھ نہیں ہے۔
نامہ نگار فرحت جاوید کے مطابق یار جان عبدالصمد نے خلائی سفر کے لیے منتخب ہونے سے متعلق خبروں کو ٹوئٹر پر ہی اپنے ایک بیان میں غیر تصدیق شدہ، نامکمل اور قبل از وقت قرار دیا ہے۔
انھوں نے اپنی پوسٹ میں کہا کہ یہ خبر آدھی تو درست ہے تاہم اسے بہت بڑھا چڑھا کر پیش کیا گیا ہے۔
ان کا کہنا تھا 'وہ خلا کے ایک سفر کے لیے جا سکتے ہیں تاہم ابھی انھیں بعض ٹیسٹ پاس کرنے ہیں۔'
انھوں نے بی بی سی اردو کو بدھ کو بھیجے گئے ایک پیغام میں واضح کر دیا کہ وہ خلا میں نہیں جا رہے ہیں۔
'براہ مہربانی نوٹ کریں کہ ہم کیمبرج میں ایسے منصوبوں پر کام کر رہے ہیں جو خلا سے متعلق ہیں جس کی وجہ سے ہم خلا پر کام کرنے والے اداروں کے ساتھ مل کر خلا جیسے حالات پیدا کریں گے جہاں تجربات کیے جائیں گے۔ اس میں خلا میں جانے کا کوئی امکان نہیں ہے۔'
یار جان عبدالصمد نے کہا ہے کہ ان کے بعض دوستوں نے سوشل میڈیا پر ان کی 'تربیتی پروگرام میں شرکت' سے متعلق خبروں کو غلط انداز میں لیا ہے جو ان کے لیے پریشانی کا باعث بن رہی ہیں۔
یار جان بلوچ پیشے کے اعتبار سے میٹریل انجینیئر ہیں۔ اپنے ٹوئٹر کے تعارف میں وہ لکھتے ہیں کہ وہ معاشرے کی مدد اور 'درست مقاصد' کے حصول میں 'درست افراد' کی ہر قسم کی مدد کرتے ہیں۔
عبدالصمد کے تازہ واقعے نے ایک مرتبہ پھر یہ واضح کر دیا ہے کہ ہر ٹویٹ یا پوسٹ درست نہیں ہوتی اور اکثر کسی وجہ سے بات کہیں سے کہیں پہنچا دی جاتی ہے۔
عبدالصمد اب چاہتے ہیں کہ ان کے خیرخواہ اس بات سے آگاہ ہو جائیں کہ وہ خلا میں نہیں جا رہے ہیں۔
  • 4
سبھی کہتے ہیں کہ پاکستان ٹیم 'ان پرڈکٹیبل' ہے یعنی کہ ایسی ٹیم جس کی پیشن گوئی نہیں کی جا سکتی۔ مجھے نہیں معلوم کہ وہ کون تھا جس نے سب سے پہلے یہ اصطلاح استعمال کی تھی لیکن... see more میں اتنا ضرور جانتا ہوں کہ گذشتہ تقریباً ایک دہائی میں مجھے اکثر پاکستان ٹیم نے وہی دیا جو میں محسوس کر رہا تھا یعنی مایوسی۔
اگر وہ میچ جیت بھی لیتے تو بڑی مشکل سے اور جیتا ہوا میچ بھی اس قدر مشکل بنا لیتے کہ لگتا تھا کہ ہار جائیں گے۔ لیکن یہ کچھ نہیں۔ وہ سنہ 2010 کی پاکستان انگلینڈ سیریز تھی جب میں فیصلہ کیا کہ میں اب کرکٹ نہیں دیکھوں گا۔ کل میں اپنے آپ سے ہار گیا اور کرکٹ ایک مرتبہ پھر جیت گئی۔
میری کرکٹ سے لڑائی لگ بھگ سات سال رہی۔ جو انگلینڈ سے شروع ہوئی اور بالآخر انگلینڈ پر ہی ختم۔ اس میں کرکٹ کا کوئی قصور نہیں تھا بس ایک غصہ تھا اور کیوں نہ ہو۔
جب وسیم اکرم کے بعد پاکستان کی کرکٹ کے افق پر سب سے نمایاں ستارہ ایک یکدم داغدار ہو جائے تو آپ کیا سوچیں گے، جب دنیا کا سب سے زیادہ جنوئن سونگ بولنگ کرانے والا بولر اور پاکستان کی بڑی امید دیکھتے دیکھتے ایک بدنام کرکٹر کہلایا جانے لگے تو آپ کیا کریں گے اور اگر جہاز کا کپتان ہی جہاز ڈبونے لگے تو کیا آپ کا پیار اس کے لیے رہے گا۔ دوسروں کا تو میں کچھ نہیں کہہ سکتا لیکن میں اپنے پسندیدہ کھیل کے ساتھ یہ ہوتا نہیں دیکھ سکا اور میں نے اسے دیکھنا ہی چھوڑ دیا۔
لیکن کل یعنی آئی سی سی چیمپیئنز ٹرافی کے فائنل میں یہ سب کچھ کچھ الٹ ہو گیا۔ جیت ہار تو دور کی بات ہے لیکن کرکٹ شاید میری زندگی میں واپس آ گئی ہے۔
مجھے یہاں یہ کہنے میں بھی کچھ شرم نہیں کہ اس ٹورنامنٹ کے پاکستان کے کسی بھی میچ میں مجھے کوئی دلچسپی نہیں تھی اور نہ ہی اس کی کوئی جیت مجھے ماضی کی طرح متاثر کر سکی تھی۔ پہلا میچ بری طرح ہار گئے، ایک ڈک ورتھ اینڈ لوئیس نے بچا لیا، ایک میچ مشکل سے جیتے اور لوگ طرح طرح کی باتیں بھی کرنے لگے۔ ایک انگلینڈ کے خلاف ہی میچ تھا جس میں بولروں اور بہترین فیلڈنگ نے پہلے انگلینڈ کو بڑا سکور کرنے سے روکا اور بعد اچھی بیٹنگ کا مظاہرہ کیا۔
مجھے اس وقت سمجھ جانا چاہیے تھا کہ چیزیں بدل چکی ہیں۔ لیکن میرے لیے چیزیں انڈیا کے خلاف فائنل میں بدلیں۔ کیا جارحانہ بیٹنگ اور کیا سپاٹ آن بولنگ۔ کسی بھی شعبے میں پاکستان نے یہ ظاہر نہیں ہونے دیا کہ یہ وہی پاکستانی ٹیم ہے جو سات سال پہلے انگلینڈ سے رسوا ہو کر نکل تھی۔ ماضی کے ’ولن‘ محمد عامر اوول کے ہیرو بنے اور ہیرو بھی ایسے کہ بڑے بڑوں کی زبان گنگ رہ گئی۔ جس طرح چاہا گیند کی اور جس کو چاہا پریشان کیا۔
اگر ایک گیند پر بھارتی کپتان وراٹ کوہلی کا کیچ چھوٹ گیا تو کوئی بات نہیں اگلی گیند پر انھیں آؤٹ کر لیا۔ اگر ٹورنامنٹ کے سب سے خطرناک بیٹسمین شیکھر دھون کو دوسرے میچوں میں کوئی آؤٹ نہیں کر سکا تو یہ لو انھیں میچ کے آغاز میں ہی دوسرے ڈینجر مین روہت شرما کے ساتھ آؤٹ کر دیا۔
کیا کیا نہیں ہوا کل کے میچ میں۔ حسن کی فارم جاری رہی اور جنید اور شاداب کی بولنگ میں نکھار آتا رہا۔ حالات ایسے ہو گئے کہ پاکستان نے اپنے ایک ریگولر سپنر کو استعمال ہی نہیں کیا۔
لیکن اس میچ سے اگر کوئی مایوسی ہوئی تو وہ بھارتی کرکٹروں سے نہیں زیادہ تر بھارتی عوام اور سارو گنگولی کو چھوڑ کر بھارتی کرکٹ پنڈتوں سے ہوئی۔ میرے ایک پسندیدہ اداکار نے جیسے خود ہی اپنے پیر پر بلا مار دیا اور وہ بھی اتنے زور سے کہ اس کا درد ان کے پیر اور دل میں بہت عرصہ تک رہے گا۔
کل ایک اور چیز کا بھی انکشاف ہوا اور وہ یہ کہ انڈیا کا قومی کھیل ہاکی ہے۔ کیونکہ پاکستان کے میچ میں جب انڈیا ہار کی جانب گامزن تھا تو بڑے بڑے کرکٹ مداح پاکستان کی انڈیا کے ہاتھوں ہاکی میں ایک سات سے شکست کا ذکر کر رہے تھے۔
میں یہ نہیں کہوں گا کہ پاکستان کی یہ ٹیم اس کی سب سے اچھی ٹیم ہے لیکن اتنا ضرور کہوں گا کہ اس ٹیم نے کرکٹ کو پاکستان میں زندہ کر دیا ہے اور مجھے کامل یقین ہے کہ یہ بین الاقوامی کرکٹ کو پاکستان لانے میں ضرور کامیاب ہو جائے گی۔
میری زندگی میں دوبارہ آنے کے لیے پاکستان کرکٹ تمہارا شکریہ۔ ویلکم بیک پاکستان کرکٹ۔
  • 4