Visualizzazione post con etichetta php. Mostra tutti i post
Visualizzazione post con etichetta php. 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.

martedì 27 aprile 2010

PTQ Guestbook v.0.2.1

New release of the guestbook.
In this version was added the recaptha capability. To use it you need to get a key ad the Recaptcha site. It can be disabled commenting the lines.

Download

martedì 20 aprile 2010

PTQ Guestbook v.0.2

Some improvings in this new version.
From the changelog:
-Divided parameters (config.php) and functions(lib.php) from page implementations.
-Added modification of comments in the amministration panel

Now it has 4 pages, but the code is more understandable.

Download

To see it in action, go to www.sarchittu.org/index.php?page=Web/Ricerca.php

lunedì 19 aprile 2010

PTQ Guestbook v.0.1.1

PTQ Guestbook v.0.1.1

A little guestbook with all the common features needed by a guestbook, divided into a php page containing the guestbook to implement in the desired page, and an administration page, which probably you won't customize. A stylesheet handles the aspect of the form.
If you need to customize the messages and parameters, you'll find them at the top of the page.

Download

If you want to see how it can be used, you can go to my website http://www.sarchittu.org/index.php?page=Web/Ricerca.php

EDIT: v.0.2 released http://blog.sarchittu.org/2010/04/ptq-guestbook-v02.html