Troy 35 Posting Whiz

This is a simple to use, self-contained website slideshow utility. Do you have a monitor or TV setup in your lobby where you'd like to present web content automatically? With this HTML/Javascript page, simply edit an array of pages or "slides". You define a title, duration, and URL for each slide. The pages fade out and fade in between slides. You can change the fade out color as desired.

SiteShow features a small menu that automatically appears (fades in) if you mouseover the page. The menu allows you to pause or play or directly access a specific slide.

Simply copy the code below into a new HTML page and load it in your browser to see how it works. Then change the slide URL's to whatever pages you want to load. Slides can be your own web pages, pictures, or any other web page.

Tip: Press F11 to put your browser in full-screen mode. Also, in IE, right-click the menu bar at top and select Auto-hide.

Using SiteShow in fullscreen mode can generate a very nice display for your lobby TV or a computer in a public area. Perhaps you want to create a slideshow of your company's products using your existing company website pages.

More details at http://www.troywolf.com/articles/client/siteshow/

Troy 35 Posting Whiz

class_session.php is a session management and password protection class. It can be used to perform 2 major functions:

1. Create and maintain session state between page hits. The class does this using simple session cache files into which the session is stored as a serialized array. This is similar to how PHP's built-in sessions store session data. One big advantage of this class is that you have full control over the session timeout.

2. Password protect PHP pages by requiring authentication. Simply pass in "true" when creating a new session object to use this functionality. You'll also need to create your own login.php script. A sample login.php is packaged with this class.

Most current information and documentation and downloads found at
http://www.troywolf.com/articles/php/class_session.

There are two complete PHP files listed below. First is the class file, class_session.php. The second is example.php to show you how to use the class.

Troy Wolf operates ShinySolutions Webhosting, and is the author of SnippetEdit--a PHP application providing browser-based website editing that even non-technical people can use. "Website editing as easy as it gets." Troy has been a professional Internet and database application developer for over 10 years. He has many years' experience with ASP, VBScript, PHP, Javascript, DHTML, CSS, SQL, and XML on Windows and Linux platforms.

LastMitch commented: Thanks for sharing! +12
Troy 35 Posting Whiz

Building a stateful web application is possible, but not feasible for most application scenarios. As for why a person may want such a thing? LOTS of reasons. An obvious example is a browser-based chat application. You want all members of the chat to see all messages entered as close to real-time as possible.

The most common and easy to implement solution is to build an "AJAX" solution. If you don't know what AJAX is, search here in the forums or just Google it. In short, it is a way for javascript running in the browser to make separate HTTP/HTTPS requests to your web server. It can do this "in the background" (asynchronously) while the user continues to use the browser application.

So while not truly stateful, you can build a web app that appears to be stateful by having an AJAX request check frequently for server-side changes and then update the client browser accordingly. This could mean that the AJAX request actually retrieves the new information and dynamically changes the page contents or it could mean you fire a page refresh.

Depending on the number of simultaneous users you need to support and the power of your server hardware and bandwith, you can set your AJAX request to fire every 5 seconds or whatever makes sense for your app. You may be able to get away with 3 seconds, but 1 or 2 is simply asking a lot of a browser/webserver relationship. If you code it correctly, …

nav33n commented: nice explanation.. Cheers ! +1
Troy 35 Posting Whiz

Glad to help the csgal.

Campkev is correct. Here is how I do it.

<html>
<head>
<title>My Web Page</title>
<script type="text/javascript">
function LoadTrigger()
{
  alert('This will fire after the page has finished loading.');
}
window.onload = LoadTrigger;
</script>
</head>
<body>
  <p>
	 My Web Page is great!
  </p>
</body>
</html>
Troy 35 Posting Whiz

Yes, mod_rewrite is what you want if you are using Apache.

If anybody has any proof, I'd like to see it, but the official word from Google and others is that data-driven content (.ASP, .PHP, .JSP, etc.) is not a problem for their spiders. The only problem for spiders associated with data-driven pages is speed. A spider obviously "browses" your site a lot faster than a human. It may request a dozen pages in a single second. Spiders are not as patient as most humans, either. If your page takes 5 seconds to return--whether static or data-driven, the spider may consider the link bad and move on.

My point is that jumping through hoops to make your data-driven pages LOOK like static pages doesn't help your pages load any faster--which is the real issue with search engines--at least Google anyway.

Google has a Facts & Fiction page here that explains they can index dynamic pages.
http://www.google.com/webmasters/facts.html

At least for google, querystrings are not an issue either, although they do recommend you keep your querystrings short with only a few parameters.

Another "secret" is that if the only way to get to your pages is via a search on your site, then a spider will never find them. You do need every page that you want indexed somehow linked from another page. For example, if your site sells fruit, and the only way for me to reach your fruit_detail.php?fruit=apple page is by searching your …

tgreer commented: Informative, with links to back it up. Excellent! +1