Post by Dexx on Nov 6, 2005 18:23:08 GMT
*You need a host that supports PHP to use this. Im sure it could be done with just javascript too. But i dont know how
What will this script do?
First it displayes a "Loading..." message. And there after it will check if the saybox server is available or not. If it is it will display the SayBox it self. But if isn't will will display a "SayBox unavailable..." message. And it will resume connect again after 30 seconds
The Code
<?PHP
ob_start();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?PHP
if(isset($_GET['error'])){
?>
<b>ERROR</b><br />
Couldn't connect to the SayBox server.<br /><br />
<i>Will refresh in 30 seconds.</i>
<?PHP
header('Refresh: 30; URL=saybox.php');
die;
}
?>
<div id="loading"><b>Loading SayBox...</b></div>
<div id="whole" style="display: none">
<script language="javascript" src="http://saybox.co.uk/output.php?user=USERNAME"></script>
<script language="javascript">
document.getElementById('loading').style.display = 'none';
document.getElementById('whole').style.display = '';
try{
var xsw = document.sayboxform.saybox_mesg.innerHTML;
}
catch(ex){
window.location = '?error'
}
</script>
</div>
How do i use it?
Create a new file, name it to whatever you want, but I took saybox.php. Now place the code above.
But edit:
URL=saybox.php - to what you name the page
USERNAME - your username on saybox
and saybox.co.uk to saybox2.co.uk if you're on server2
Now it just to link it to your site by using a frame
<iframe src="saybox.php" style="width: 150px; height: 350px; border: 0px" frameborder="0" scrolling="no"></iframe>
Working Example
kaffekokare.se/sb_working.php
None Working Example (wrong URL in the saybox code)
kaffekokare.se/sb_NotWorking.php
Tested and working in IE, FF and Opera.
What will this script do?
First it displayes a "Loading..." message. And there after it will check if the saybox server is available or not. If it is it will display the SayBox it self. But if isn't will will display a "SayBox unavailable..." message. And it will resume connect again after 30 seconds
The Code
<?PHP
ob_start();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?PHP
if(isset($_GET['error'])){
?>
<b>ERROR</b><br />
Couldn't connect to the SayBox server.<br /><br />
<i>Will refresh in 30 seconds.</i>
<?PHP
header('Refresh: 30; URL=saybox.php');
die;
}
?>
<div id="loading"><b>Loading SayBox...</b></div>
<div id="whole" style="display: none">
<script language="javascript" src="http://saybox.co.uk/output.php?user=USERNAME"></script>
<script language="javascript">
document.getElementById('loading').style.display = 'none';
document.getElementById('whole').style.display = '';
try{
var xsw = document.sayboxform.saybox_mesg.innerHTML;
}
catch(ex){
window.location = '?error'
}
</script>
</div>
How do i use it?
Create a new file, name it to whatever you want, but I took saybox.php. Now place the code above.
But edit:
URL=saybox.php - to what you name the page
USERNAME - your username on saybox
and saybox.co.uk to saybox2.co.uk if you're on server2
Now it just to link it to your site by using a frame
<iframe src="saybox.php" style="width: 150px; height: 350px; border: 0px" frameborder="0" scrolling="no"></iframe>
Working Example
kaffekokare.se/sb_working.php
None Working Example (wrong URL in the saybox code)
kaffekokare.se/sb_NotWorking.php
Tested and working in IE, FF and Opera.