hi friends ,
today topic is simple and need to be cleared and is good for the new php developer as this is the basic need fot creating form in php .
So without any futhure time waste just create a form containing username and password
insert the below code to the html file and named as index.php
<form action=”somepage.php” method=”post”>
<input type=”text” name=”username” />
<input type=”password” name=”password” />
<input type=”submit” value=”login” />
</form>
after sacing the above code just creat a php named as somepage.php
get the form values from the index page
like this
$username = $_post['username'];
$password = $_post['password'];
and then print them or do anything else
echo $username;
echo $password;
This is how it will work 1 thing extrea to know if u change method in the form to get
user $_get[''];
and if your are not sure what is used in form use
$_Request['']
i think it will help u in the making php forms .
thankxs
Share
hi friends ,
i have thinking of discussing of
include and include_once function to take a close look at how they are differenciated
include function actually include a file as understanding it is including 1st time everytime page loades .
and include_once loads the file once and uses that cached file next time .
So if u want to see the major difference live .
just make a loop
and include a page inside loop with both functions add a global variables at parent file and print that inside the page which is added in header file
like this one
$global = ”;
for($i=0;$i<=10;$i++)
{
include_once(’somepage.php’);
}
code for somepage.php
echo $i;
just and u will that $i will be always 0 and will not change its value .
and if u use include function it will give u different values
Hope so u find this helpfull
Share
hi friends ,
today topic is simple and i will make that simpler to learn php pagination as there have maney confusion about how to make php pagination .
for php pagination we need to follow these steps to easily complete the pagination
step 1 : just count the all records to whom apply pagination
run this query
$sql = “select * from feed_back where active=’1′ Limit $from1,$to1″;
so this query needs 2 things $from means fetch from number means from 10 and onward means $to
let say i want to fetch from 0 to 50 records so give $from 0 and $to 50 . it will fetch 0 to 50 records .
So next we have to count the all results .
Let say we have 50 results in db and want to see 10 on each page .
50 / 10 so we have 5 pages to show results . and make a for looop .
and print like this one
<?php for($j=1;$j<=$counter;$j++) { ?>
<?php if(isset($_GET['pageno'])) { $page = $_GET['pageno']; } if($page==$j) { ?>
<div style=”width:20px;height:20px;background-color:#CCCCCC;float:left;text-align:center;”><a href=”reviews.php?view=<?php echo $seeperpage; ?>&pageno=<?php echo $j; ?>”> <?php echo $j; ?> </a>
</div>
<?php }
else
{ ?>
<div style=”width:20px;height:20px;float:left;text-align:center;”><a href=”reviews.php?view=<?php echo $seeperpage; ?>&pageno=<?php echo $j; ?>”> <?php echo $j; ?> </a></div>
<?php } } ?>
So here we have results like this one
1 2 3 4 5 containing links like this one
and links likes these on the above numbers
http://localhost/london/reviews.php?view=18&pageno=1
use these formulas to manuitpulate logics
like View = 18 and pageno =1 means on page 1 and see 18 record per page
and query needs 2 things from and to . so from will have forulas like this one
from = (page-1)*viewrecordsperpage
to = page*viewrecordsperpage
so we have both things and it can easily .
thanks
hope so it will be helpfull
Share
SEO: Seek Engine Optimization, provides adjustment bearing for Google, Yahoo etc. Overt SEO: SEO based phrases acclimated over and over or SEO phrases alloyed over, beneath and through a certificate abode accent through repetition; sometimes even the a lot of austere seek engine optimizer allows a bit of back-up in adjustment to access the SEO adjustment he needs. Thus, in arrest a accountable like SEO, massive antagonism leads to even the multi-redundant hyperbole appropriate aloft or it’s variant. As connected as the biographer rewards the clairvoyant with creativity, appearance and/or abundant information; acquisitive to barter those, as it were, in barter for the reader’s accommodation of a little repetition; there may still be adequate advice demography place. Be it anytime SEO little or anytime SEO vague. The bolt is, no amount what position you gain on your webpage or article, if no one understands it, or if anybody stops account bisected way through, everybody loses. So, you try to force augment your back-up in adjustment to accretion position afterwards accident your clairvoyant absolutely in the process.
Sharehi friends ,
today i want to discuss about . how to use php header function and what things needs to be carefully managed to get better use of that function .
how it effects other things in coding and how to avoid them .
header();
this function is used to normaly for page redirection .
let say u want to redirect to zain.php ;
header(“location:zain.php”);
this is how it will be used in code just keep one thing in mind to give proper page path that the page exists to the location .
now header function problem that i have seen it simple . that let sat we have this exmaple
echo ‘zain’;
header(‘location:zain.php’);
there is some information printing on the page . so header funtion will stop working and generate some warning .
because it sees before execution that there is some information printing on the page and when it found something it just stop redirecting .
so if u have some problem in header function like this one .
just check ur code and remove if there some echo command is executing as i think there is no need for echo ona a page where redirect in functional .
Hope that it will help u in coding
Happy coding
Share
hi friends ,
i have been thinking of a case in which divs are failed to produce desire results .
Tables are again will be used to complete the desire results .
I m talking about a scenerio in which we have
2 divs .
1 is on left side , 1 on the right side let suppose both having some height and some width and float:left ;
let say u have right side border on the left div and right side contains some text if text expands the height the left border will be accordingly to the left divs height . so if u need the left border or height to be dynamically equal to the right div .
its not possible to make from divs .
u need table structure to work in here .
So use tables in this scenerio .
i will post new things accordingly to the div failures .
hope that it will help u in making css and save ur lot of time in advance .
Sharehi friends ,
as i have posted some information in my first part for u . to understand the css and html here is the second and managed version of the past version here u can have more information to play with html and css .
for making best output from this posts i am considering some situation that
1 – need my page to be center align doestnt matter which screen or resolution it is opened
2 – creating borders for div and learning why heights are not be used in div and where to used .
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″ />
<title>zainabbas.com</title>
</head>
<style type=”text/css”>
body
{
margin:0;
padding:0;
}
.wrapper
{
float:left;
width:100%;
height:auto;
}
.center_container
{
margin:auto;
width:700px;
border:1px solid #666666;
}
</style>
<body>
<div>
<div> Something here zainabbas.com </div>
</div>
</body>
</html>
Explaintation of the code
remember 1 thing for making htmls creat a body tag with no sign and give it always .
padding :0
margin :0
and then creat a div with 100% width means the size of the client screen maximum size .
and creat a inner div and give it margin:auto , with some width to make it center align . and some border to show around the div .
This is how we can create center align page in html .
Hope that it will help u in creating html and css .
Share
hi friends ,
Now i have been thinking of giving an overview for html static website structure .
this post will be good for those who are learning htmls and css .
i have defined some structure that i worked on
quite easy and simple .
Let say u have these pages in your webite
index.html -> it will be default page which will be displayed at the start of your website .
contacts.html -> u can add here some of your personal information .
Loginin.html contains some login html
Let say we have three pages for current example to make it simple and clean .
creat a folder let say ‘mysite’
put these three html files inside at the root directory inside the mysite folder .
now ur files should have some css , images and some javascript files to work with your website .
creat the following sites under mysite folder
/Images -> for putting yourall website images
/css – >to put your css files
/js -> to put your javascript files here
now linking to the main files which are names as index , contact us is simple
if u want to add image and want the path to your images folder u can give the path like this i m using example to link an image
<img src=”images/zainabbas.png” / alt=”zainabbas” />
alt is uses to display image in google search
so if u want to link your js file just give it
<script type =”texe/javascript” src=”js/somejsgile.js” /> </script>
and if u want to link your stylesheet u can use
<link rel=”stylesheer” href=”css/style.css” />
So here i have defined a quiet simple and beautifull way to orginized images / css /js files .
Hope that it will help u in creating static sites .
ShareHi friends ,
As i am a web developer i thought of writing some interesting post about the life and problems in developers life .
Let say some developer got stuck in code and situation get worst . Developer mind is always trying to get a way to resolve the problem / issue . But in this case let suppose that u cant resolve the issue . I m considering the example that developer has the abilities to resolve the issue but that time he cant .
So i have some points to discuss to get rid of the problem fast without using or wasting your time in such an example .
steps to follow
Step 1 – Try to just think of the problem that u r now at the initial point of the problem and focus on the problem offcourse u will have some new ideas in mind .
Step 2 . Try to concentrate what thing goes wrong in all the code .
Step 3 . Just leave the work and relax yourself . U can try a cup of coffee or tea and while relaxing just think over the problem again that need time difference of 20 minutes to get relaxed and hot your mind again .
Step 4 . Just google out the problem and try to see first 2 , 3 top results hope that it will help u .
Step 5 . listen to a song or some T.V show or some news or play a game.
Step 6 . Ask your colleague or some friend to help u out .
Step 7 . Leave the issue and cover up in some other time .
This is what i think during in my development experience and always resolved the issues .
Hope that it will help u .
Share
Hi friends ,
Here i have small and beautifull tutorial to how to work with html and javascript . the easy way to show up alert box on a button click .
so simple and easy
just copy and paste the follwing code and i will brief u in the end
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″ />
<title>Untitled Document</title>
</head>
<script type=”text/javascript”>
function Alert(){
alert(‘welcome to the zainlucky’);
}
</script>
<body><input type=”button” onclick=”Alert()” />
</body></html>
i will describe u everything in few steps
Step 1 : insert a button with the following code <input type=”button” name=”btn” />
Step 2 : now add event write it on button tag <input type=”button” name=”btn” onclick=”Alert()” />
Step 3 : Now creat a function / method in above script tags <script type=”text/javascript”> </script>
Step 4 : Now call alert method .
Now click the button and enjoy .
You dont need any web server to run the code just save the file and open it and click the button to so alert box .
Share