Advertise Here

TechnicalTiger

- Another Blogger Blog's

Today I am facing the problem of get the value from the variable that declared inside the function. But I need to get that value from outside of the function.

For that we need th declare the variable globally is the best way of doing program.

In Java script it is simple technique to globally declare the variable.

How can you declare the variable globally?

Is we need to put global infront of that.No…

See the following program…..


Function1()
{
Var myname;//declared globally

Function2()
{
Var myaddress;//with in the function

Myname//access in this function
}
Function3()
{
Myname;
}

}

When accessing the global variable don’t put var within the function…

Read and use it.Leave the comments for improvements…
Read More
Comments: (0)
Sometimes you may be seen the URL doesn’t have the extensions like .php, .html, .asp or anything else.
Because they are aware of SEO and the security .Before going to the URL rewrite we see the small introduction of SEO.
What is SEO?

1. SEO stands for Search Engine Optimization.
2. If you don’t know about SEO what do you first do?
3. Go for the Google or other search engines then type SEO and press enter. It provides the millions and millions of WebPages
4. But you read only the first few pages or first page alone.
5. So the website owners work hard to publish their pages in the first few pages.
6. What are the advantages for them?
7. They got advertising through the page rank. So they earn the lot.
8. For this purpose we go for the url rewriting.

URL rewriting in PHP

For this you need to run in the linux server.


Step 1:Create the file using notepad or wordpad with extension “.htaccess”.It must be accurate.
Step 2:save in the root directory.
Step 3:create the PHP file

< !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
< xmlns="http://www.w3.org/1999/xhtml">
<>
< equiv="Content-Type" content="text/html; charset=utf-8">
<> Trial< /title >
< ?php $_GET; ? >
< /head >

<>

<><>
< href="Ajaxhelper"><><>
< href="PHP"> I am going to test < /a ><><>
< href="Ajax"><><>
< href="Java1234"> Watch < /a ><><>
< href="pg123"> The< /a ><><>
< href="1234"> URL < /a >
< /body >
< /html >


Then Create the .htaccess file

Options +FollowSymlinks
RewriteEngine On
# Prevent Directory Listing
Options -Indexes
RewriteRule ^([a-z0-9A-Z]+)/?$ index.php?a=$1 [QSA]


How it runs?
• RewriteRule - Tells Apache that this like refers to a single RewriteRule.
• RewriteEngine On- # Turn on the rewriting engine
• # - Command Line
• Options +FollowSymlinks – It is an optional
QSA (append query string from request to substituted URL)

Don’t forget to put $_GET on the PHP file.If you don’t put it it wont be run. Please try it and leave comments…








Read More
Today I am going to tell you how to get the dropdown value when the user clicks on it. It sometimes very much useful to get the value and stored it on database.

For example you may use the time zone or anything.At that time it provides more helpful to you.

Even this is going to be small thing it helps a lot.

Here the HTML code is displayed…

< !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=utf-8" / >
< title > Untitled Document< /title >
< script type="text/javascript" src="jquery/jquery.js" > < /script >
< script type="text/javascript" src="jquery/getdropdownvalue.js" > < /script >
< /head >

< body >
< select name="getdropdown" id="getdropdown" >
< option value="1" > Trial 1< /option >
< option value="2" > Trial 2< /option >
< option value="2" > Trial 3< /option >
< option value="2" > Trial 4< /option >
< option value="2" > Trial 5< /option >
< option value="2" > Trial 6< /option >
< /select >
< /body >
< /html >


The Jquery will be coded below as…



$(document).ready(function(){

$("#getdropdown").change(function() {
var trial=$("#getdropdown option:selected").text();
alert(trial);
});

});


Here getdropdown is the ID of dropdown box

You can put val() instead of text() you get the dropdown value
Read More
Today I need a coding for hide table column in a table. Here I am going to present for www.scribd.com users.

The coding shows below…


HTML coding..

<!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=utf-8" />
< title>Untitled Document</title>
< script type="text/javascript" src="jquery/jquery.js"></script>
< script type="text/javascript" src="jquery/hidetable.js"></script>

</head>

< body>
< table>
< tr>
< td>
< input type="radio" id="radiobtn" name="radiobtn" value="1"/ > Show Table column<br/>
< input type="radio" id="radiobtn" name="radiobtn" value="2"/ > Show Table column<br/>
< input type="radio" id="radiobtn" name="radiobtn" value="3"/ > Hide Table Column<br/>
</td>
< td id="hidecolumn">
< input type="checkbox" name="checkme" id="checkme"/> Check me
< input type="text" name="entertext" id="entertext"/> I am Text box
</td>
< tr>
</table>
</body>
</html>



Before going to run the code please note I include the jquery.js. This is the file you can get from http://jquery.com/ .before the jquery/jquery.js here jqurey is the folder name you can write as username/jquery.js or else what you wish..

Then in next I include another javascript file named jqueryvalid.js.Here you need to write the jqueryvalid.js in the jquery folder.

jqueryvalid.js ……


$(document).ready(function(){
$("input:radio[name='radiobtn']").click(function() {
var isDisabled = $(this).is(":checked") && $(this).val() == "3";
if(isDisabled==true)
{
$("#hidecolumn").hide();

}
else
{
$("#hidecolumn").show();

}
});

});



Use this and leave the comment.
Read More
Text box allow only the numbers

Today I need a coding for text box only allow the numbers. I got the script from the net. Here I am going to present for www.scribd.com users.

The coding shows below…


HTML coding..

<!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=utf-8" />
< title>Untitled Document</title>
< script type="text/javascript" src="jquery/jquery.js"></script>
< script type="text/javascript" src="jquery/jqueryvalid.js"></script>
</head>
< body>
< input type="text" name="quantity" id="quantity" />
</body>
</html>

Before going to run the code please note I include the jquery.js. This is the file you can get from http://jquery.com/ .before the jquery/jquery.js here jqurey is the folder name you can write as username/jquery.js or else what you wish..

Then in next I include another javascript file named jqueryvalid.js.Here you need to write the jqueryvalid.js in the jquery folder.

jqueryvalid.js ……

$(document).ready(function(){

$("#quantity").keypress(function (e){
if( e.which!=8 && e.which!=0 && (e.which<48 || e.which>57))
{
//display error message
$("#errmsg").html("Digits Only").show().fadeOut("slow");
return false;
}

});

});


Whenever the key pressed within the textbox it is checked ASCII character for whwther is it number or alphabet. If alphabet it wont be allowed to enter.

It is very much useful for validation…
Read More