Linking PHP pages
Moderator: General Moderators
Linking PHP pages
Can i link the same php page in that page?
WTF?
Are you talking about this?
Code: Select all
<a href="<?php echo $_SERVER['PHP_SELF']; ?>">Link</a>- evilmonkey
- Forum Regular
- Posts: 823
- Joined: Sun Oct 06, 2002 1:24 pm
- Location: Toronto, Canada
no..something like this:
page1.php:
page2.php:
What you suggested will just reload the same page over again.
page1.php:
Code: Select all
<?php
include("page2.php");
?>Code: Select all
<?php
include("page1.php");
?>Yes sir
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;
}
?>Centers.php
hawleyjr | Please use
This is not working. Can you suggest why.
hawleyjr | Please use
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>
<?hawleyjr | Please use
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]Centers.php
hawleyjr | Please use
hawleyjr | Please use
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;
}BTW Please use the php bbcode tags when posting code.
Thanks