Posts

How To Create Your Own Search Engine On Your Website.

1 Create a search form on your website. 2 connect to your database with config.php file 3 create new page searh.php for show search results. //                                     code for search form                                           // <?php ?> <form action="serch.php" method="GET">  <input type="text" name="query" placeholder="search Your Room According To Your Prefered location like sardarpura, basni.." />       <input type="submit" value="search" />       </form> //                                       Code for show search results on search.php page          // <...

PHP interview questions and answers for PHP developers

What is PHP? PHP is a server side scripting language commonly used for web applications. PHP has many frameworks and cms for creating websites.Even a non technical person can cretae sites using its CMS.WordPress,osCommerce are the famus CMS of php.It is also an object oriented programming language like java,C-sharp etc.It is very eazy for learning What is the use of "echo" in php? It is used to print a data in the webpage, Example: <?php echo 'Car insurance'; ?> , The following code print the text in the webpage How to include a file to a php page? We can include a file using "include() " or "require()" function with file path as its parameter. What's the difference between include and require? If the file is not found by require(), it will cause a fatal error and halt the execution of the script. If the file is not found by include(), a warning will be issued, but execution will continue. require_once(), require(), include(...

How to redirect with java script

<?php require('config.php'); SESSION_start(); print_r($_SESSION); if(empty($_SESSION['username']) ) { echo "hello"; echo "<script> window.location = 'http://gm.roomonrentjodhpur.com/admin/login.php';</script>"; } ?>

How to create admin panel login page in php

<?php session_start();  require('config.php'); //3. If the form is submitted or not. //3.1 If the form is submitted if (isset($_POST['username']) and isset($_POST['password'])){ //3.1.1 Assigning posted values to variables. $username = $_POST['username']; $password = $_POST['password']; //3.1.2 Checking the values are existing in the database or not $query = "SELECT * FROM `user` WHERE username='$username' and password='$password'"; $result = mysql_query( $query) ; $count = mysql_num_rows($result); //3.1.2 If the posted values are equal to the database values, then session will be created for the user. if ($count == 1){ $_SESSION['username'] = $username; }else{ //3.1.3 If the login credentials doesn't match, he will be shown with an error message. $fmsg = "Invalid Login Credentials."; } } //3.1.4 if the user is logged in Greets the user with message if (isset($_SESSION[...
Review Send Form from your Website. <?php if(isset($_POST['submit'])){     $to = "youremail@gmail.com"; // this is your Email address     $from = $_POST['email']; // this is the sender's Email address     $first_name = $_POST['first_name'];     $last_name = $_POST['last_name'];     $email = $_POST['email'];     $company = $_POST['company'];     $subject = "( $first_name Post New Review For BLU N White.com )  ";     $mobile =  $_POST['mobile'];     $select =  $_POST['select'];     $subject2 = "Copy of your form submission";     $message = "Dear Website Admin,\n\n  Client provides feedback for our services details are below,\n \n     CLIENT NAME : "   .    $first_name . " " ."\n\n" . " ADDRESS : " . $last_name . " "."\n\n" . "CITY : " . $email.""."\n\n" ."COMPANY NAME : ". ...
Imp Facts for development in php 1 allways use id, name in form fields 2 when create submit botton allways gave id and name( same) and veluse(show on botton) 3 form action = (page redirect after submit data), method = post and encrypt type (for any file upload ) 4 if(isset($_POST['addnewmovie']) && !empty($_POST['addnewmovie']=='add new movie')) always $_POST['use form botton id'] && addnewmovie ==' use velue of form botton' 5 When we send id for edit operation send fatch id from db
IMP How to do insert edit and delete on same page 6 When we do insert, fetch, edit on same page do insert and fatch as previous in data fetch table provide collom for edit botton <form action="future_movies.php" method="post" enctype="multipart/form-data"> <input type="submit"  id="editm" name="editm" value="Edit" placeholder="Movie Name" required=""> <input type="hidden"   id="idedit" name="idedit" value="<?php echo $data['id'];?>" placeholder="Movie Name" required=""> </form> Then After Fatch data from DB when we click on edit botton in data fatch table. <?php if(isset($_POST['newedit']) && !empty($_POST['newedit'])) { $sql1="select * from screen where id = '".$_POST['newedit']."'"; $row = mysql_query($sql1); whil...