Html hidden variables are very useful in php.
Html hidden controls are used to store values or id's . If we add a
form with this hidden control, values stored in that control can be
passed in post method
server and Client side scripting . Improve website using php, javascript, and jquery Support php
Html hidden variables are very useful in php.
Html hidden controls are used to store values or id's . If we add a
form with this hidden control, values stored in that control can be
passed in post method
Here is the code to validate email address
<?php
if (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$",$email)){
echo "Invalid email";
}else{
echo "Valid Email";}
?>
Sigma grid is Written in pure javascript, Sigma Grid is an Ajax data grid for displaying and inline editing data in a scrollable and sortable table. With MVC architecture, plenty of attributes and powerful script API, this grid control brings developer more flexibilities and less workload.
For more details visit :sigmawidgets
You can make a div or li tag clickable using javascript
Here is a simple method to Pass variables from one page to another
Here is the code in first page
<a href="page2.php?nam=sree">click here</a>
Simple code for downloading files
Place this code in a php file and make links to it. That links will be act as download link for the file .
<?php
$filename="left.txt";
$type=filetype($filename);
header("Content-type: $type");
header("Content-Disposition: attachment;filename=$filename");
header("Content-Transfer-Encoding: binary");
header('Pragma: no-cache');
header('Expires: 0');
// Send the file contents.
set_time_limit(0);
//readfile($file);
?>
Here is a simple way to pass your array in post method. In first page we are creating a form.In that form creating hidden controls with arrray value as shown below. In second part (display.php) we can extract values from request variable.
Here is the code
/////////////////////////////////////////////////// echo '<form name="form" method="post" action="display.php">'; $i=0; foreach($arr as $key => $value) { $i++; echo '<input type="hidden" name="val['.$i.']" value="'.$value.'"/>'; } echo '</form>'; ////////////////Copde in display.php page //////////////// foreach($_REQUEST['val'] as $key => $value) { echo $value; } ////////////////////////////////////// If you found some good method to pass array Share with us as comments
with regards SREEHARI
Jquery is a collection of javascript classes .It is very easier than javascript.If you are new to client side scripting you can prefer jquery.
What are the advantages of using Jquery?
Jquery is simple to use.It avoids difficulties in using java script .
You can find simple examples of jquery from
www.w3schools.com
For more details, visit http://jquery.com
Using following code we can display all get variable passing from a page
<?php
foreach($_GET as $k=>$v)
echo $v;
?>
Same way we can also display all post varibles with their keys
<?php
foreach($_POST as $k=>$v)
echo $v;
?>
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near
You can easily find error by identifying remaining part of error .The error in your mysql query is in the first character of the remaining error .
For example error in the following message must be near word "long"
Eg:- "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'long,buy,credit,bankrupt,discharged,forclosure,lforclosure,home_loan,payment,mpa' at line 1"
Parse error: syntax error, unexpected T_DNUMBER, expecting ',' or ';'
This error occur when a number comes when expecting a string .
For example the following code produces error because a string is concatenated with integer.
<?php
echo "example".1;
?>
2. Parse error: syntax error, unexpected T_ECHO, expecting ',' or ';'
This error occurs when a semicolon missing
For example following code produces this error because of missing a semicolon in second line
<php
echo $s
?>
Errors are very helpful to programmers .When you identifies cause of error next time that error will not be a challenge for you.
Here i am providing some common errors
1.Parse error: syntax error, unexpected T_ECHO
This error is due to some unidentified symbol or character in code
For example following code produces the above error because of "character x" in code
<?php
x
echo "error example";
?>
What is php myadmin?
Phpmyadmin is to control mysql databases for php.It gives a good interface to do operations in databases and tables .Phpmyadmin will be installed with xamp or wamp.You can connect to phpmyadmin from xamp/wamp controlpanel.
All hosting services provides a phpmyadmin interface for uploading and manage your mysql database
Php is only a server side scripting.For client side scripting we can use javascript
If you are new in php go to www.w3schools.com/ simple working examples
How you can start php?
Download and Install Xamp or wamp server in your windows machine to start learning php.
Xamp and wamp are software packages ,it installs apache ,php mysql in your system and provides running environment for php.
You can place your website folder in htdocs(in xamp) or in www(root folder in wamp).
We can also create php by manualy configuring php,mysql and apache. Also we can use iis instead of apache.