Jump to content

[SOLVED] unknown problem


desithugg

Recommended Posts

<?
$which_comic = $_GET['comic'];
if($which_comic == "")
{
$which_comic = "ashchu";
}
$which_page = $_GET['page'];
if($which_page == "" OR $which_page <= "0")
{
$which_page = "1";
}
if($which_comic == "ashchu")
{
$comic_title = "Ashchu";
$comic_by = "Coshi Dragonite";
$page['1'] = "http://tn3-2.deviantart.com/fs12/300W/i/2006/261/8/e/Ashchu_comics_1_by_Coshi_Dragonite.jpg";
$page['2'] = "http://tn3-2.deviantart.com/300W/fs7.deviantart.com/i/2005/259/d/8/AshChu_comics_2_by_Coshi_Dragonite.jpg";
$page['3'] = "http://tn3-1.deviantart.com/fs12/300W/i/2006/261/3/8/Ashchu_Comics_3_by_Coshi_Dragonite.jpg";
$page['4'] = "http://tn3-1.deviantart.com/fs7/300W/i/2005/263/c/4/Ashchu_Comics_4_by_Coshi_Dragonite.jpg";
$page['5'] = "http://tn3-1.deviantart.com/fs7/300W/i/2005/271/5/c/AshChu_Comics_5_by_Coshi_Dragonite.jpg";
$page['6'] = "http://tn3-2.deviantart.com/fs12/300W/i/2006/261/c/5/AshChu_Comics_6_by_Coshi_Dragonite.jpg";
$page['7'] = "http://tn3-1.deviantart.com/fs12/300W/i/2006/261/f/b/Ashchu_Comics_7_by_Coshi_Dragonite.jpg";
$page['8'] = "http://tn3-2.deviantart.com/fs12/300W/i/2006/261/d/e/Ashchu_Comics_8_by_Coshi_Dragonite.jpg";
$page['9'] = "http://tn3-2.deviantart.com/fs12/300W/i/2006/261/8/6/Ashchu_comics_9_by_Coshi_Dragonite.jpg";
$page['10'] = "http://tn3-2.deviantart.com/fs12/300W/i/2006/261/4/a/Ashchu_Comics_10_by_Coshi_Dragonite.jpg";
$page['11'] = "http://tn3-1.deviantart.com/fs12/300W/i/2006/261/c/5/Ashchu_Comics_11_by_Coshi_Dragonite.jpg";
$page['12'] = "http://tn3-2.deviantart.com/fs12/300W/i/2006/261/e/d/Ashchu_Comics_12_by_Coshi_Dragonite.jpg";
$page['13'] = "http://tn3-2.deviantart.com/fs12/300W/i/2006/261/0/6/Ashchu_Comics_13_by_Coshi_Dragonite.jpg";
$page['14'] = "http://tn3-1.deviantart.com/fs12/300W/i/2006/261/7/2/Ashchu_Comics_14_by_Coshi_Dragonite.jpg";
$page['15'] = "http://tn3-1.deviantart.com/fs12/300W/i/2006/261/7/a/Ashchu_comics_15_by_Coshi_Dragonite.jpg";
$page['16'] = "http://tn3-2.deviantart.com/fs9/300W/i/2006/071/d/1/Ashchu_comics_16_by_Coshi_Dragonite.jpg";
$page['17'] = "http://tn3-1.deviantart.com/fs12/300W/i/2006/261/0/5/Ashchu_Comics_17_by_Coshi_Dragonite.jpg";
$page['18'] = "http://tn3-2.deviantart.com/fs12/300W/i/2006/261/3/3/Ashchu_Comics_18_by_Coshi_Dragonite.jpg";
$page['19'] = "http://tn3-2.deviantart.com/fs12/300W/i/2006/262/1/3/Ashchu_Comics_19_by_Coshi_Dragonite.jpg";
$page['20'] = "http://tn3-2.deviantart.com/fs12/300W/i/2006/262/0/6/Ashchu_Comics_20_by_Coshi_Dragonite.jpg";
$page['21'] = "http://tn3-1.deviantart.com/fs12/300W/i/2006/262/e/4/Ashchu_Comics_21_by_Coshi_Dragonite.jpg";
$page['22'] = "http://tn3-1.deviantart.com/fs12/300W/i/2006/262/a/2/Ashchu_comics_22_by_Coshi_Dragonite.jpg";
$page['23'] = "http://tn3-1.deviantart.com/fs12/300W/i/2006/262/f/3/Ashchu_Comics_23_by_Coshi_Dragonite.jpg";
$page['24'] = "http://tn3-1.deviantart.com/fs11/300W/i/2006/203/9/1/Ashchu_Comics_24_by_Coshi_Dragonite.jpg";
$page['25'] = "http://tn3-1.deviantart.com/fs11/300W/i/2006/225/b/d/Ashchu_comics_25_by_Coshi_Dragonite.jpg";
}
$total_pages = count($page);
if($which_page > $total_pages)
{
$which_page = $total_pages;
}
$show_page = $page['$which_page'];
if($show_page == "")
{
$show_page = $page['1'];
}
echo "<h1>$comic_title</h1><br>";
echo "<b>Comic made by $comic_by</b><br><b>Page:$which_page/$total_pages</b><br>";
echo"<a href='?action=comics&comic=$which_comic&page=".($which_page-1)."'>Prvious Page</a> | <a href='?action=comics&comic=$which_comic&page=".($which_page+1)."'>Next Page</a><br>";
echo "<img src='$show_page'>";
?>

Okay the problem is that it keeps showing the first page even when I go to next page.

the problem is here

$show_page = $page['$which_page'];

is there any better way to do that?

Link to comment
https://forums.phpfreaks.com/topic/40917-solved-unknown-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.