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