Click to See Complete Forum and Search --> : build simple Page viewer?


LostNspace
07-19-2009, 12:07 AM
I would like to have a little web app to help me surf my favorite website, I can picture how it should work but have no experiance doing such things, and my alzheimers makes it hard to learn new things. Hopefully someone could help?

There is a website I frequent which has severa thousand pages, sequentially numbered such as http://www.website.com/page.php?id=1, http://www.website.com/page.php?id=2, http://www.website.com/page.php?id=4078 etc.

I would like to have a html page (not hosted just on my pc). that opens
http://www.website.com/page.php?id=1 inside my page. with links to move to the next or previous url #

As a huge huge bonus, a timed slide show of the urls would be nice.

I am not sure if this is the rigt forum to find the help I need, if anyone has any suggestions or help it would be most appreciated.

Thank you for your time.

sicle
07-19-2009, 06:57 PM
This should do it:

<html>
<head>
<title>Page Viewer</title>
<script type="text/javascript">
//first page to be shown
var page=1;
//the first page (mostly 0 if using php & mysql)
var firstpage=0;
//the last page
var lastpage=999;
//the timeinterval to let the pages change automaticly in seconds
var secs=15;

secs=secs*1000;

function changePage(str)
{
if(str == 'prev')
{
if(page == firstpage)
{
page=lastpage;
}
else
{
page=page-1;
}
document.getElementById('page').src='http://www.website.com/page.php?id='+ page;
}
else if(str == 'next')
{
if(page == lastpage)
{
page=firstpage;
}
else
{
page=page+1;
}
document.getElementById('page').src='http://www.website.com/page.php?id='+ page;
}
}
function init()
{
setInterval("changePage('next');",secs);
}
</script>
</head>

<body onLoad="javascript:init();">
<div>
<center>
<a href="javascript:changePage('prev');" style="color:#000000;">&lt;&lt;</a> &bull; <a href="javascript:changePage('next');" style="color:#000000;">&gt;&gt;</a>
<br>
<iframe id="page" src="http://www.website.com/page.php?id=0" width="1024" height="768"></iframe>
</center>
</div>
</body>
</html>

Change the variables in the beginning to your likings and you are set to go ^^

LostNspace
07-19-2009, 10:41 PM
Wow thank you!

That works perfectly and saves me a lot of carpal clicking.

I really appreciate this!