How To Get PHP Session Id Code Sample To Show Obtain Display PHPSESSID



How To Get PHP Session Id Code Sample To Show Obtain Display PHPSESSID
 (381) dminister a web business
How To Get PHP Session Id Code Sample To Show Obtain Display PHPSESSID
Post Description:
Post Tags: how, to, get, php, session, id, code, sample, to, show, obtain, display, phpsessid
This Post Has Been Viewed 1900 Times Since Wed Nov 29, 2006 11:53 am Posted By webmaster with 3 replies
How To Get PHP Session Id Code Sample To Show Obtain Display PHPSESSID
A good admin always knows what's going on in his/her site. Once way to add security and flexability dynamically in PHP is with each visitor's unique PHP Session Id.

The only requirement for this to work on your web pages is that you have PHP in your hosting. IF you don't have php, you can signup with www.webune.com for a php plan. if you have php, continue on...

The function to show a user's phpsession id is : $PHPSESSID

I wrote this short script to show you how it works:

steps: copy and paste this code into your editor or a text editor(like notepad):


     Code:
<?php
session_start();
?>
<?php
session_start();
?>
<HTML>
<TITLE>Displaying PHP SessionID by Tutorial Guide by Wallpaperama.com</TITLE>
<HEAD>
<?
if(isset($HTTP_COOKIE_VARS["users_resolution"]))
$screen_resolution = $HTTP_COOKIE_VARS["users_resolution"];
else //means cookie is not found set it using Javascript
{
?>
<script language="javascript">
<!--
writeCookie();

function writeCookie()
{
var today = new Date();
var the_date = new Date("December 31, 2010");
var the_cookie_date = the_date.toGMTString();
var the_cookie = "users_resolution="+ screen.width +"x"+ screen.height;
var the_cookie = the_cookie + ";expires=" + the_cookie_date;
document.cookie=the_cookie

location = 'resolution.php';
}
//-->
</script>
<?
}
?>
</HEAD>
<style type="text/css">
<!--
.style2 {color: #0066FF}
.style3 {
color: #009933;
font-weight: bold;
}
.style5 {color: #0066FF; font-weight: bold; }
-->
</style>
<BODY>
<strong>Displaying PHP SessionID by Tutorial Guide by Wallpaperama.com
</strong>
<h1 align="center" class="style2">Your PHPSESSID is: <?php echo"$PHPSESSID"; ?></h1>
<span class="style5">NOTE</span>: If you don't see a session id in tbe blue header above, hit <span class="style3">REFRESH</span> on your browser <br />
<br />
<div align="center">Turotial by <a href="http://www.wallpaperama.com">Wallpaperama.com</a></div>
<hr size="2" noshade>
<p>This Script was developed by <a href="http://www.wallpaperama.com">Wallpaperama.com</a> - Support us by telling your friends about wallpaperama and help contribut to the open source by adding your knowledge of PHP, Linux, Mysql and more to others, just like this script.</p>
<p>Thank You</p>
<p>Wallpaperama Team</p>
<p><a href="http://www.wallpaperama.com/forums/how-to-get-php-session-id-code-sample-to-show-obtain-display-phpsessid-t518.html">&lt;&lt; Go Back</a> </p>
<p align="center">PHP Hosting by <a href="http://www.webune.com">Webune.com</a> </p>
<p>
</BODY>
</HTML>
[ This post sponsered by www.webune.com ]
post picture

Save this file as wallpaperama-sessionid.php and uploaded to your Apache/ PHP server and open it with your browser
(example: yourdomain.com/wallpaperama-sessionid.php), then it will display your own php sessionid as a demostration.

Thanks to our friends at www.webune.com, they have provide PHP hosting to show you a demo of how this script works:

CLICK HERE TO SEE DEMO

I hope this helps. If you are starting with PHP, you're going to like PHP, it has so many great features impossible to list here.

Thanks
Wallpaperama Team

Leave Your Comments     [ dejar commentarios ]
  * Name     [nombre]

  * eMail (will not be published)     [coreo electronico]

* Enter Your Reply or Comments:    [commentarios]


Add Picture To Comments         [incluir foto]
YES NO             upload
Receive Replies on my Comments (An email will be sent to you when someone replies to your comments)

     

Comments and replies About How To Get PHP Session Id Code Sample To Show Obtain Display PHPSESSID




:: 1 :: #51666 - Reply By Anshul On Sat Apr 26, 2008 2:36 am
how to get email address from dating site
:: 2 :: #52098 - Reply By melv On Tue Apr 29, 2008 3:20 pm
i followed the instructions and no phpsessionid is shown.

also the demo link doesnt work, its a dead url.

:(
:: 3 :: #66370 - Reply By chathurika On Thu Aug 14, 2008 2:14 am
hsjgkhrgyujiwruyidjhkcjhkgjhlg,nb, .m,zl;fifodifjkgjkjkgjkgh
hjgsjg