Hi,
I am a php programmer.I have 1 year exp in php.Currently i am working Java.But i Want to continue work with as a part time PHP Programmer.Kindly contact me for any project based on core php.
Thanks
Nitin Kumar
S/W Eng.
Archive for October 2012
jquery function for changing values of text boxes and dropdowns in rows if the checkbox of the row is checked
I have some rows with checkbox first, then a input field and a dropdown. I need to change the value of dropdowns and text boxes whose checkboxes are checked when click on a button. As there is no direct relationship between the checkbox, textbox and drop down, at first it seems to be difficult.
But in jquery it is so simple.
function btn_apply_all(){
$("input[name='product_checkbox[]']").each(function(key) {
if(this.checked){
$("select[name='option_price[]']").each( function (key1){
if(key1==key){
$(this).val($("#cbo_bulk").val());
}
});
$("input[name='txt_opt_price[]']").each( function (key1){
if(key1==key){
$(this).val($("#txt_bulk_price").val());
}
});
}
});
}
File Access Optimization
When you need to including file, please recheck file content that will be use. If file is not contains PHP codes, use readfile() function to increase performance.
Because files that including with readfile() does not parsing by PHP. It will be different with construction language include() and require(), and files will be evaluated before.
Consequence from using readfile() is increase attack risk. This risk will be happen when accessing file from URL.
Solution for the attack risk is by using File Handling.
ListGetAt
ListGetAt is a really cool ColdFusion function. Is great for grabbing values from a comma separated list (or any other delimited list)! I use this function a lot instead of the explode function. They essentially do the same, but using this function removes 1 step. Instead of first exploding the then getting the value for your array key. For the seasoned PHP coder and everyone else, the position will always start at 1 NOT 0. Also, the default delimiter is a ','(comma).
The Function:
function ListGetAt($list,$position,$delimiter=",")
{
$bit = explode($delimiter,$list);
return $bit[($position-1)];
}
Usage:
Using the ListGetAt function is quite easy!
<?php
$list = "apples,oranges,grapes";
echo ListGetAt($list,1);
?>
The resulting out put would be: apples
<?php
$list = "apples+oranges+grapes";
echo ListGetAt($list,2,"+");
?>
The resulting out put would be: oranges
PHP beginners pdf tutorials free download
Free PHP pdf tutorial:
ZAMPP installation.pdf
Vertrigo server installation.pdf
What is PHP.pdf
PHP variable.pdf
PHP comments.pdf
PHP operators index.pdf
PHP arithmetic operator.pdf
PHP assignment operator.pdf
PHP comparison operator.pdf
PHP increment and decrement operators.pdf
PHP control statement.pdf
PHP swithc statement.pdf
PHP do-while loop.pdf
PHP while loop.pdf
PHP for loop.pdf
PHP include once statement.pdf
PHP include statement.pdf
PHP form.pdf
At first download our PHP pdf tutorial and save it in your computer or notebook. It is an offline version and also a free tutorial so you can use our PHP pdf tutorial free. Share this tutorial with your friends and family.
Assignment1-Set
About me
Hello World PHP
Now that you have installed XAMPP on your windows 7 pc and you have set Apache to run as a service to work around an issue with running Apache on windows 7, you're now ready to write the standard Hello World application in PHP! To do this, you will need to create the PHP file in your htdocs directory. This directory is in the xampp directory. If you installed XAMPP according to the instructions for windows 7, it should be C:\xampp\htdocs. You can think of this as the inetpub\wwwroot directory in ASP.NET. This is where all of your web site files will go when you're developing locally. Now create a new folder called "helloworld" inside the htdocs directory. Once you have created this folder, create a new file using notepad++ or any editor of your choice. Enter the following text into this file:
<?php
echo 'hello world!';
?>
Once you have entered this text, save the file to your C:\xampp\htdocs\helloworld directory that you created as "index.php". Then start apache, if it isn't already started. Next, open up your browser and navigate to http://localhost/helloworld. You should then see a web page with the "hello world!" text displayed. Congratulations! You have just created your first PHP page.
delete a file in php
if(isset($_POST['fname']))
{
if(!empty($_POST['fname']))
{
$name=$_POST['fname'].'.txt';
if(@!unlink($name))
{
echo 'there is no file to delete';
}
else
echo 'file successfully deleted';
}
}
?>
<form action="file-delete.php" method="POST">
file name : <input type="text" name="fname">
.txt
<input type="submit" value="submit">
</form>
output :
note :
1) enter the file name for delete that text file
Basic Database Loop to display records
<?
//You can use the following script to take data from database and list, for each round it will print the tr and also each round column color will be change with the class2 and class 3.
//I am sorry I can now write more about this, this is I am just posting for my reference, if you like you can use this. If you want to know more about this please post a comment, I will try my best to help you (If I am free).
?>
<table border="0" width="100%" cellpadding="5" style="border-collapse: collapse">
<tr>
<td class="class1" align="left" valign="top"><b>Staff Number</b></td>
<td class="class1" align="left" valign="top"><b>First Name</b></td>
<td class="class1" align="left" valign="top"><b>Last Name</b></td>
<td class="class1" align="left" valign="top"><b>Email Address</b></td>
<td class="class1" align="left" valign="top"><b>Date Of Birth</b></td>
</tr>
<?
$sql = "SELECT * FROM tablename ORDER BY fldFirstName ASC";
$result = mysql_query($sql, $db);
$rows = mysql_num_rows($result);
if(mysql_num_rows($result)) {
$howmany = 0;
for ($i = 0; $i < $rows; $i++) {
$data = mysql_fetch_object($result);
$howmany = $howmany + 1;
$MYXXX = $howmany % 2;
switch ($MYXXX) {
case 1:
$MYbgcolor = "class=\"class2\"";
break;
case 0:
$MYbgcolor = "class=\"class3\"";
break;
}
?>
<tr <?=$MYbgcolor?>>
<td align="left" valign="top"><?=$data->EmployeeNo?></td>
<td align="left" valign="top"><?=$data->FirstName?></td>
<td align="left" valign="top"><?=$data->LastName?></td>
<td align="left" valign="top"><?=$data->Email?></td>
<td align="left" valign="top"><?=$data->DateOfBirth?></td>
</tr>
<?
}
}
?>
</table>
PHP Membership Script
Php Web Designers Developers Website Programmers Articles on Free Press Release.com
Hello Friends ! !
Kindly Find Following Links for Php Website Design Website Development Articles on free-press-release.com
Php Web Development India Article on free-press-release.com
Php Web Designers Developers Programmers Article on free-press-release.com
Php Website Development Company India Pdf on free-press-release.com
These are very useful and most rated Php Web Development India Articles on free-press-release.com provides information on various Php Web Development India Services to the User and Clients.
Thanks & Regards
www.WeTheDevelopers.com
PHP ORACLE TUTORIAL
How to connect oracle database with PHP? it's easy:
Requirement:
A. Webserver, Apache is the most popular webserver.
B. PHP5.
C. Oracle Client (Optional)
1. Or the most simple way is by download webserver package it will include all requirement except oracle client you can find a lot of this kind of package for the example phpTriad and so on but im using easyPHP coz it's much easiest to configuration than other webserver package.
2. And then install the easyPHP, after installation completed run easy php by executing .exe file, easyPHP icon will appear on right below of windows toollbars.
3. Right click the icon go to configuration and click PHP extensions and we need oci and oracle module as basic requirement for PHP to understand the Oracle functionality, check the PHP_oci8 and PHP_oracle or you can edit manually from php.ini by remove ";"
;extension=php_oci8.dll
;extension=php_openssl.dll
;extension=php_oracle.dll
after:
extension=php_oci8.dll
;extension=php_openssl.dll
extension=php_oracle.dll
and then restart the apache and php
4. Ok next steep is for PHP script:
Herewith the connection script to oracle database:
$db = "(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.17.24.31)(PORT = 1521))(CONNECT_DATA = (SERVICE_NAME = cbsms)))";and below is very simple search engine PHP-Oracle and then then display the result:
$conn = OCILogon("VIEWONLYSMS","smg",$db)
or die( "Could not connect to Oracle database!")
or die(ocierror());
?>
1. Search Form: