Linking PHP pages
Posted: Wed Jan 18, 2006 3:33 pm
Can i link the same php page in that page?
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
<a href="<?php echo $_SERVER['PHP_SELF']; ?>">Link</a>Code: Select all
<?php
include("page2.php");
?>Code: Select all
<?php
include("page1.php");
?>Code: Select all
<?php
$page = 1;
$include_page = 2;
if($page == 1) {
include("page" . $include_page . ".php");
$page = 2;
$include_page = 1;
} elseif($page == 2) {
include("page" . $include_page . ".php");
$page = 1;
$include_page = 2;
}
?>Code: Select all
andCode: Select all
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
I tried by using the following code snippet: Basically have to increment $id and $sid by 10 and reload the page again and call somefunction($id, $sid) with the new values.Code: Select all
if(isset($_GET('id'))==false and isset($_GET('sid'))==false)
{
$id=1;
$sid=10;
}
else
{
$id=$_GET('id');
$sid=$_GET('sid');
}
somefunction($id, $sid);
?>
<form action="/jacid/Centers.php" method="get">
Enter next start id:
<input type="int" name="id"><br>
Enter next stop id:
<input type="int" name="sid"><br>
<input type="submit" name="submit" value="NEXT SET">
</form>
<?Code: Select all
andCode: Select all
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]Code: Select all
andCode: Select all
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
somefunction($id, $sid) is there in my code. I didn't include it here.Code: Select all
function somefunction($id, $sid)
{
set_time_limit(0);
mysql_select_db("jn5001");
$address=mysql_query("select address from document WHERE address!='' and id between '$id' and '$sid'");
while($eachaddr=mysql_fetch_row($address))
{
foreach($eachaddr as $line)
{
if($line==" ")
break;
else
address($line);
}
}
}Code: Select all
andCode: Select all
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]Code: Select all
i
if(!isset($_GET['id']) && !isset($_GET['sid']) )
{
$id=1;
$sid=10;
}