Visualizzazione post con etichetta script. Mostra tutti i post
Visualizzazione post con etichetta script. Mostra tutti i post

venerdì 17 settembre 2010

Simple script for viewing the same site from different URLS

This php script enables working on the same website without wondering about the location from which you view it.
For example, you have the website files in a folder of your local webserver, and when you put it online, you must access it from another host name.
Examples:
http://localhost/mywebsite/index.php
http://192.168.0.100/mywebsite/index.php (accessing your local machine from another computer on the same network)
http://www.mywebsite.org/index.php (your website on the remote webserver).

This script can be placed everywhere after it'd properly configured (the folder in which the page is must be set).


//common: folder containing this file relatively to the website root
$conflen=strlen('common');
$B=substr(__FILE__,0,strrpos(__FILE__,'/'));
$A=substr($_SERVER['DOCUMENT_ROOT'],strrpos($_SERVER['DOCUMENT_ROOT'],$_SERVER['PHP_SELF']));
$C=substr($B,strlen($A));
$posconf=strlen($C)-$conflen-1;
$D=substr($C,1,$posconf);
$host='http://'.$_SERVER['SERVER_NAME'].'/'.$D;
?>


Note: this works bot on IIS based webservers and Unix based.

Foto "antiche"

Inserita una pagina che raccoglie panorami del 1955 e del 1970 (prodotti a partire da due filmati disponibili sulla Sardinia Digital Library), commentati e confrontati con fotografie simili di adesso.

Poi alcuni cambiamenti non visibili a livello di script e qualche miglioria per aderire agli standard w3c.

mercoledì 28 aprile 2010

Index of web technologies articles

Here's the index of articles I wrote about the technologies I used in my site. Each of them describes how to use them through descriptions and code snippets.

-HTML Tidy Batch Processing
An article on optimizing your html code to pass the validator test iterating a little utility.
-LightBox & LightNav
Lightbox is a nice effect for display images, Lightnav is an extension of Lightbox for bigger images.
-Usage of Jquery Reel for 360° panoramas
Display your cylindrical panorama using only a bit of javascript.
-Personalized maps using Google Maps API: usage, markers, routes
Walkthrough to build a simple map and personalize it.
-PTQ Guestbook v.0.2.1
My guestbook application: simple, easy and customizable.
-PTQ JS Clock v.0.1
My javascript clock, easy to use and display