We already learned about variables, but there are some Readymade or predefined keywords in PHP that can be used without you having to create them first. Predefined or Superglobals variables are used to provide information from and about the web server, the web browser, and the user. There are several types of Super Global Variables:- $_GET – Is used to pass data through URL. Example: http://websjyoti.com?id=2 $_POST – Is used to pass data to server by hiding from URL. $_REQUEST – Is the combination of $_GET, $_POST, and $_COOKIE. $_SESSION – is used to maintain session and data from Local machine to Server. $_COOKIE – Is used to save/get user data on same machine in browser cookies. $_SERVER – Is an associative array which is used to know server information i.e. IP address, Host name, query string, file name etc. $_FILES – Is used to handle uploaded files operations in PHP. i.e. file size, type, name etc. Example – $_SERVER Superglobals: <?php echo”Current IP Address is: “.$_SERVER[‘REMOTE_ADDR’]; echo “You are at page: “.$_SERVER[‘PHP_SELF’]; ?> Functions: Functions in PHP behave similarly to functions in C. When we define the functions, we must specify what values the function can expect to receive. So let’s create a function. We need to give the function a name and tell it what variables to expect. We also need to define the function before we call it. <?php function sum($f1, $f2) { $f3=$f1+$f2 return $f3; } echo sum(10,8); ?> Output: 18 So First, we created our function. Notice how we defined two new variables, called $f1 and $f2. When we call the function, each variable is assigned a value based on the order in which it appears. Then we simply added the two numbers together and returned the result. “Return” here simply means to send the result back.
Arrays in PHP
An array is a data structure that stores similar type of values in a common variable. Arrays are also called homogeneous data type. For example if you want to store 50 numbers then instead of defining variables it is easy to define an array with size of 50. In PHP, the array() function is used to create an array Arrays can store numbers, strings and any object but their index will be represented by numbers. By default array index starts from zero. $x=array(“laxmi”,”hirdesh”,”rahim”,”ashu”,”amit”); // To count number of elements stored in array x echo count($x); // To populate value from any specific index or position //echo $x[1]; // output – Hirdesh // To print all elements in array x – using for-each loop echo ” <br>Names are :”; foreach ($x as $val) { echo $val . ” “; } echo “<br> using for loop <br>”; 50 for($i=0; $i<count($x); $i++) { echo $x[$i] . “<br>”; } Sorting Arrays: PHP provides many easy ways to sort array values in predefined orders- arsort: Sorts the array in descending value order and maintains the key/value relationship asort: Sorts the array in ascending value order and maintains the key/value relationship rsort: Sorts the array in descending value order sort: Sorts the array in ascending value order // Examples – Sorting of arrays $x=array(“laxmi”,”hirdesh”,”rahim”,”ashu”,”amit”, “mohit”); // rsort for DESC and simply sort for ASC sort($x); foreach ($x as $val) { echo $val . ” “; }
PHP – Date / Time Functions
When working in any programming language, dealing with dates and time is a simple task. That is, until time zones have to be supported. PHP’s time () function gives you all the information that you need about the current date and time. It requires no arguments but returns an numeric value. If you will call to time() function which will return a set of numeric values which is difficult to understand. So to make it easy we can have time format along with the date() function. <?php $today = date(“d/m/Y”); echo “Today is “.$today; ?> We can use different time format with separator like d-m-Y, d.m.Y and so on. Display Current Date and Time: We can use the following characters to format the time string: <?php echo date(“h:i:s”) . “<br>”; echo date(“F d, Y h:i:s A”) . “<br>”; echo date(“h:i a”); ?> Here h-hour in 12-hour format, H – hour in in 24-hour format, i – minutes, s – seconds, a -am, pm(Lowercase) and A – Represent AM, PM (Uppercase) So it is easy to get the current year by putting the following line- <?php echo date(“Y”);?>?> The PHP time(): The time() function is used to get the current time as a Unix timestamp Example: <?php $cDate = 1394003958; echo(date(“F d, Y h:i:s”, $cDate)); ?> Example: To print date like 10 July 2015 <?php $date1 = date_create(―2016-05-10”); echo date_format($date1, ‘j-F-Y’); ?> Output: 10 May 2016
PHP Ajax Tutorial
The Ajax provides two way to developers to build rich application, server centric and client centric. The extenders use a block of JavaScript code to add new enhanced capabilities to ASP.net. JQUERY is the library of JavaScript. It is lightweight, supported by all the browser, active developer community, and extensible plug-in to develop the website. Using jqurey we can do DOM manipulation, apply CSS to the element, CURD operation on the element, and apply CSS runtime AJAX allows web pages to be updated asynchronously by exchanging small amounts of data with the server behind the scenes. Ajax uses the JavaScript DOM, the XMLHttpRequest object, XML, and CSS to download and display just the content that needs to change. Ajax allows content on Web pages to update immediately when a user performs an action, unlike an HTTP request, during which users must wait for a whole new page to load. For example, a weather forecasting site could display local conditions on one side of the page without delay after a user types in a zip code. XML and Ajax Creating a DOM Document with JavaScript Accessing Element Nodes Creating an AddChild() Function Receiving XML Responses Passing XML to the Server Ajax Applications Login Form Quick Lookup Form Preloaded Data City State List Navigable Tables Show data suggestions on keyup Show pre-loaded Images We at Webs Jyoti provide PHP AJAX & JQUERY training program according to current Market Demand. Our Specialist developers explores new ideas and experience with current marketing. We have delivered 350 + websites and projects successfully. take a look at our Project Portfolio
Variables in PHP
Variables – PHP Variables are used to store data and can be called by using the variable name and the data that it holds will be outputted instead. For example, I want to save the message “Hello Hirdesh” in memory and then first display hello Hirdesh and afterward Welcome to PHP World, I will write the following simple programme // Example of concatenate string. <?php $text = “Hello Hirdesh”; echo $text.”Welcome to PHP World”; ?> Please Note that dot (.) operator is used to concatenate or combine string in php Naming Conventions Variable name start with the dollar sign Must contain only letters, numbers, and the underscore sign Cannot start with a numeric value Variable name are case sensitive To minimize confusion and errors, it’s best to stick to one naming scheme. The two most common styles are Use all lowercase, separating words with underscores: $first_name, $emp_code, etc. Use primarily lowercase, separating words with capital letters: $textName, $fName, etc. Assigning Values Variables can be assigned using the assignment operator (=). Some examples are below- $status = false; $empCode = 231; $average = 86.67; $name = “Jyoti”; $con = mysqli_connect(‘localhost’, root’, ”, ‘mydb’); $key = NULL; Object variables are assigned using the assignment operator with the new keyword: $ob = new myClass(); Example – calculate sum of 2 numbers using variables <?php // program to calculate sum of two numbers $num1 =20; $num2=30; $sum=$num1+$num2; echo “Sum is ”.$sum; ?> Example – define function <?php define(“tutorial”,”Programing Logic and Technique”); echo constant(“tutorial”); ?> Output : Programming Logic and Technique To Buy complete book kindly download – php mysql for advanced learning from amazon, flipkart, google playstore and many more channels.
WordPress Training
We offer an training in WordPress – World’s leading open source CMS (Content Management System). WordPress is very flexible tool to build small to large size web portals. Content – Introduction to WordPress- How to make a website or a blog,Downloading and Installing wordpress on XAMPP SERVER – Installing and managing themes, Editing the appearance of themes, theme settings, adjusting different elements of installed themes like slideshow, post, pages – Adding new post, inserting images, videos to the posts,Adding custom fields. Adding Tags to the pages – Adding New pages , Editing pages, publishing the pages on the websites, static homepages. – Uploading pictures, videos, images, embedding videos from Youtube to your website. – Adding, Editing widgets to the theme. – Adding social media widget, social media tabs,social media mashup, social media icons – Introduction to plugins , Installing plugins , Editing plugins. – Import Export wordrpess files, Using press this functionality – Following a Theme Documentation – Working with Premium Theme and Documentation
Convocation Program
25th convocation program is going to held on Dec 20, 2016. All the passed students of graduate and post graduate students are highly encourage and request to apply for coming convocation. It’s all about proofing yourself to become a graduate students. Grab the opportunity this time, don’t miss it.
Educational Tour
Educational tour for biology students of bachelor 6th semester is going to held on coming 20th of November to 25th of November. Every students are invited. Please fill the form and registered your name here. If you missed the registration, we are sorry to carry you on tour. Register it as soon as possible.
Welcome Program
Our university organize student welcome program on every year. This program will help to introduce the students with each other and can share their ideas, feelings and many more. This program is going to held on coming next Sunday. Every students, staff, faculties and parents are welcome.
PHP Mysql Topics
Training Specification We strongly believe in Open Handed & Real Time Training and will go for practical sessions mostly. Students should devote minimum 3-4 hours/Session. Students and Trainers Ratio will be 3:1 respectively. Students will be offered to mention the links of websites in their Cvs on which they worked during training. Students are committed to work on live projects as a part of their course curriculum. Placement is Guranteed on logical skills, performance in live projects and willingness to learn. Course Details Major Activities : Developing Dashboard and Admin Area Setting up Pagination Concept Developing Classified Listing Portal Handling Dynamic Images & Video Configuring Payment Gateways API Embedding Google Map API Adding Ajax to make search faster – Like google suggestions ;ist Advanced / Refine Search Bulk Mails and Notifications SMS Integration Verification Codes & Approval Listings, Reviews Posting INSTALLING AND CONFIGURING PHP HTML, CSS & JAVASCRIPT PHP INPUT / OUTPUT- FORM MECHANISM PHP- LANGUAGE BASICS FLOW CONTROL, LOOP STATEMENTS ARRAYS & STRINGS, PHP FUNCTIONS SANITIZE AND FILTERS PHP MAIL FUNCTION- Activate and Verify Account Mails, Subscription mails MYSQL- BASICS DML, DDL STATEMENTS MYSQL JOINS PROCEDURES & TRIGGERS PHP SECURITY & EXCEPTIONS HANDLING STATE MANAGEMENT – SESSION, COOKIES ADVANCED PHP MODULE PHP- AJAX APIs – PAYMENT GATEWAYS, CHARTS, SMS INTEGRATIONS LIVE PROJECTS MVC OBJECT ORIENTED PROGRAMMING CMS STUDY WordPress OpenCart Magento Course Duration 3 Months Class Duration : 3 Hrs Contact Phone: 8802000175, 0124-4087397 Branch 1 : 240P Sector 5, Sheetla Mata Road, Near Petrol Pump, Gurgaon, HR Branch 2 : S Square Tower, Old Delhi Road, Near Bus Stand, Opp Raj Cinema, Gurgaon, HR