This might sound a bit noobish but I am having trouble creating a increment/decrement button. So basically, I created a website that uses Tumblr feed to view photos that I've tagged. For example, if I pass a variable called "nav" that equals california, it will show all of my photos from california by using this code.
Code:
<?php
$location = $_GET['nav'];
echo "<script src='http://myblog.tumblr.com/tagged/" . $_REQUEST["nav"] . "/js' type='text/javascript'></script>";
?>
But the problem I am having is that it only shows the first 10 photos and in order for me to view the next page I have to add this into the code.
Code:
<?php
$location = $_GET['nav'];
echo "<script src='http://myblog.tumblr.com/tagged/" . $_REQUEST["nav"] . "/page/2/js' type='text/javascript'></script>";
?>
And so on...
I want to be able to add a button to change the variable after "page/". And another thing is, the first page cannot read "page/1", because when I do it doesn't show anything. So the first page has to be the first script, and then after they press a "next" button, it has to go to the second code. I've gotten this so far:
Code:
<?php
$location = $_REQUEST['nav'];
$page = $_POST['page'];
if (isset($_POST['next']))
{
$page++;
}
else if (isset($_POST['previous']))
{
$page--;
}
if ($page <= 1)
{
echo "<script src='http://myblog.tumblr.com/tagged/" . $_REQUEST["job"] . "/js' type='text/javascript'></script>";
}
else
{
echo "<script src='http://myblog.tumblr.com/tagged/" . $_REQUEST["job"] . "page/" . $page . "/js' type='text/javascript'></script>";
}
?>
<form method="POST">
<input type="hidden" name="navigation" value="location" />
<input type="submit" name="previous" value="previous">
<input type="submit" name="next" value="next">
<input type="hidden" name="navigation" value="<?php echo $location; ?>" />
</form>
But nothing seems to work /: