web stats analysis

Archive for August 9th, 2013

How to create cookie in php?

How to create Cookie in php?

What is the use of Cookie in php?

How to use Cookie in php?

Description about Cookie is bellow:

Cookie is a small file.Cookie is used to identify a user.
At a same time computer send requests a page with a browser, it will send the cookie too. With php,
you can both create and retrieve cookie values.

How to create Cookie?

The setcookie() function is used to set a cookie.
Note:The setcookie() function must appear BEFORE the <html> tag.

Syntex of Setcookie.


setcookie(name, value, expire, path, domain);

Bellow example:

I will create a cookie named “Name” and assign the value “Peter” to it.
I also specify that the cookie should expire after one hour:


<?php
setcookie("Name", "Peter", time()+3600);
?>
<html>
.....

Bellow example2:

We can also set the expiration time in cookie in Other way.


<?php
$expire=time()+60*60*24*30;
setcookie("Name", "Peter", $expire);
?>
<html>
.....

Above example expiration time is set to a month (60 sec * 60 min * 24 hours * 30 days).

How to Retrieve a Cookie Value?

The PHP $_COOKIE variable is used to retrieve a cookie value. :
below example,we retrieve the value of the cookie named “name” and display it:

<?php
// Print a cookie
echo $_COOKIE["Name"];

// A way to view all cookies
print_r($_COOKIE);
?>

following example we use the isset() function to find if a cookie has been set:


<html>
<body>

<?php
if (isset($_COOKIE["Name"]))
echo "Welcome " . $_COOKIE["Name"] . "!<br>";
else
echo "Hello Friend!<br>";
?>

</body>
</html>

How to Delete cookie?

If you want to delete cookie you should assure that the expiration date is in the past.


<?php
// set the expiration date to one hour ago
setcookie("Name", "", time()-3600);
?>

How to Make an Installation program for C# applications and include .NET Framework installer into the setup?

Make an Installation program for C# applications and
include .NET Framework installer into the setup.

Visual Studio Setup project can automatically include .NET framework
setup in your installation package

Here I will give you Solution:

Step:1-First,Right click on solution explorer
Step:2-Now,Go to Add – New Project
Step:3-Go to Other Project Types and select Visual Studio Installer.
Step:4-Select in right side window Setup Wizard Setup and Deployment
Step:5-Create setup project using Setup Wizard.
Step:6-Select project type,like Create a setup for a Windows application.
Step:7-Select output,like Primary output from WindowsFormsApplication1
Step:8-Than finish.
Step:9-Open setup project properties into Setup1 propery pages.
Step:10- Select to include .NET framework.,like Microsoft .NET Freamwork Client Profile(x86 and x64)
Step:11-Than select ,like Download Prerequisites from the same location as my application.
Step:12-Build the setup project.
Step:13-Than Checkout output.

Your Setup folder is cretaed. like DotNetFX40Client.

What is cookie in asp.net?

How to create Cookie in asp.net?

What is the use of Cookie?

How to use Cookie in asp.net?

Description about Cookie is bellow:

Cookie is a small file.Cookie is used to identify a user.
Ata time same computer send requests a page with a browser, it will send the cookie too. With ASP,
you can both create and retrieve cookie values.

How to create Cookie?

We can create Cookie using with “Response.Cookies” command.
Note:- The Response.Cookies command must appear BEFORE the <html> tag.

Below example, we will create a cookie named “Name”
and assign the value “Peter”


<%
Response.Cookies("Name")="Peter"
%>

We can also make a properties to a cookie,
like setting a date when the cookie should expire:



<%
Response.Cookies("Name")="Peter"
Response.Cookies("Name").Expires=#May 10,2012#
%>

How to Retrieve a Cookie Value?

We can retrieve a cookie value using “Request.Cookies” command.
Below example, we retrieve the value of the cookie named “firstname” and display it on a page:



<%
fname=Request.Cookies("Name")
response.write("Firstname=" & fname)
%>

Output:Firstname=Peter

Cookie with Keys

When the cookie contains a collection of multiple values, we say that the cookie has Keys
In the example below, we will create a cookie collection named “user”.
The “user” cookie has Keys that contains information about a user:

<%
Response.Cookies("user")("firstname")="John"
Response.Cookies("user")("lastname")="Smith"
Response.Cookies("user")("country")="Norway"
Response.Cookies("user")("age")="25"
%>

Read all Cookies

Follow the below code:



<%
Response.Cookies("Name")="peter"
Response.Cookies("user")("firstname")="Peter"
Response.Cookies("user")("lastname")="Alex"
Response.Cookies("user")("country")="India"
Response.Cookies("user")("age")="30"
%>

If you want to read all the cookies sent to a user.

Note:-That the code below checks if a cookie has Keys with the HasKeys property

Follow the below code:



<!DOCTYPE html>
<html>
<body>

<%
dim x,y
for each x in Request.Cookies
response.write("<p>")
if Request.Cookies(x).HasKeys then
for each y in Request.Cookies(x)
response.write(x & ":" & y & "=" & Request.Cookies(x)(y))
response.write("<br>")
next
else
Response.Write(x & "=" & Request.Cookies(x) & "<br>")
end if
response.write "</p>"
next
%>

</body>
</html>
Output:-

firstname=Peter

user:firstname=Peter
user:lastname=Alex
user:country=India
user:age=30

How to solve The type or namespace name ‘DbContext’ could not be found (are you missing a using directive or an assembly reference?)

The type or namespace name ‘DbContext’ could not be found
(are you missing a using directive or an assembly reference?)

The type or namespace name ‘DbSet’ could not be found
(are you missing a using directive or an assembly reference?)

When this type error occured:

Follow the below solution:

• Just,you download the EntityFramework.dll reference.
• Add into your project.

I try and find the above solution:

Hope You are Satisfy for this solution:

How to solve While executing onLoad in RecordsetFind.htm, the following JavaScript error(s) occured: In file “RecordsetFind” findRs is not defined.”?

Solution of While executing onLoad in RecordsetFind.htm,
the following JavaScript error(s) occured:
In file RecordsetFind
findRs is not defined.

When you open the Dreamweaver,and If this type message pop-ups:.

While executing onLoad in RecordsetFind.htm,
the following JavaScript error(s) occured:
In file RecordsetFind
findRs is not defined.

I try and find the solution in Windows7.

Follow the below Steps:
Step:1-Close Your Dreamweaver CS4.
Step:2-Than Go to: C:\Users\\AppData\Roaming\Adobe\Dreamweaver CS4\en_US\
Step:3-Change name Configuration folder to Configuration_old
Step:4-Then Start your Dreamweaver CS4

I Hope this code is comletely helpful for you:

Hope You are Setisfy for this solution:

How to create Permanent User Login Session In ASP.NET?

How to add Permanent User Login Session In ASP.NET?

Solution of Permanent User Login Session In ASP.NET

I had to give Solution of How to Permanent User Login Session In ASP.NET.

Here I try to solved how to create a permanent user login session in ASP.NET.
Here..demo code includes an ASP.NET MVC4 project to control the user registration and login process.
If you want to use this process in any type of ASP.NET project So,you can use.

To follow By Below Code:

Forms Authentication

Before getting this article, you must be remember with forms authentication in ASP.NET.
The configuration of form authentication store in web.config file
which has the below configuration-file fragment with the assigned values.

<authentication mode="Forms">
      <forms loginUrl="~/Account/LogOn"
             protection="All"
             timeout="1"
             name=".USERLOGINCONTROLAUTH"
             path="/"
             requireSSL="false"
             slidingExpiration="true"
             defaultUrl="~/Home/Index"
             cookieless="UseDeviceProfile"
             enableCrossAppRedirects="false"/></authentication>

Description of default value:

*loginUrl:-Contain your application’s custom logon page.When the requires Secure Sockets Layer (SSL)
You should place the logon page in a that folder.

*Protection is set to All to specify privacy and integrity for the forms authentication ticket.
This causes the authentication ticket to be encrypted using the algorithm specified on the machineKey element,
and to be signed using the hashing algorithm that is also specified on the machineKey element.
*timeout is used to specify a limited forms authentication session.

It’s Default value is 30 minutes. If a persistent forms authentication cookie is issued,
the timeout attribute is also used to set the lifetime of the persistent cookie.
*name and path are set to the values defined into application’s configuration file.
*requireSSL is set to false.
*slidingExpiration is set to true,a sliding session lifetime. This means that the session timeout is temporary
reset as long as a
user stays active on the site.
*defaultUrl is set to the Default.aspx page for the application.
*cookieless is set to UseDeviceProfile to specify that the application use cookies
for all browsers that support cookies.

*enableCrossAppRedirects is set to false to indicate that forms authentication does not support
automatic processing of tickets that are passed between applications on the query string or as part of a form POST.

How to create multi language in WordPress?

How to add more than one language in wordpress?

How to define more than one language in WordPress?

If you want to add more than one language in WordPress.

So you can easily do that,By follow Below Steps:

Step:1-You have to download qTranslatefrom the WordPress Plugin.
Step:2-Save it into your /wp-content/plugins/ folder.
Step:3-Now,You can install it from the wordpress dashboard.
Step:4-Activate the installed plugin.
Step:5-Than Go to the settings page of plugin.
Step:6- You can enable or disable languages for depends upon you.

Language.

How to inactive WordPress post/page?

You can inactive your post/page in WordPress by individually.

How to individually inactive post/page in WordPress?

If you want to inactive your post/page individually,

So you can easily do that,By follow Below Steps:

Step:1-Go to Your post Which you want inactive.
Step:2-Find the Quick Edit option
Step:3-Click On this option.
Step:4-Now,find the Status option.
Step:5-See,You had already selected Published.
Step:6-Just Replace Pending review option place of Published.

Now,Your post/page have been inactive.