Hello all
Ill start off by saying im still fairly new to PHP, so if i sound stupid im sorry.
Its a small question really, i need to know how to link new HTML/PHP pages to my template without haveing to reload the whole page.
Bascially lets say i have a section of my template called "main" and i want the contents of my "about" page to show in this section without loading a new page. How would i go about doing this?
Hope that makes sense, any help would be great.
Linking pages to templates
Moderator: General Moderators
- Frozenlight777
- Forum Commoner
- Posts: 75
- Joined: Wed May 28, 2008 12:59 pm
Re: Linking pages to templates
I'm not quite sure what you're asking but I'm guessing you want something like an iframe?
Re: Linking pages to templates
Well i just wanted to link one of my .php pages to my template...something like
<?php echo <a href"...", target="main">...</a>; ?>
i tryed this code but dosent seem to work.
<?php echo <a href"...", target="main">...</a>; ?>
i tryed this code but dosent seem to work.
Re: Linking pages to templates
Can you post your code? and maybe some errors...
Re: Linking pages to templates
Sure
<div id="sidebar1">
<h3><img src="nav2.jpg" width="144" height="50" /></h3>
<p><a href="index.php">Home</a></p>
<?php echo <a href="Pages\register.php" target="mainContent">Sign In</a>; ?>
<p>My Profile</p>
<p>Friends</p>
<p>Top Movies</p>
<p>About</p>
<p>Contact Us</p>
</div>
this is the first link im doing so the others have not been done yet, when i use this code i get the error:
Parse error: syntax error, unexpected '<' in /mounted-storage/index.php on line 146
<div id="sidebar1">
<h3><img src="nav2.jpg" width="144" height="50" /></h3>
<p><a href="index.php">Home</a></p>
<?php echo <a href="Pages\register.php" target="mainContent">Sign In</a>; ?>
<p>My Profile</p>
<p>Friends</p>
<p>Top Movies</p>
<p>About</p>
<p>Contact Us</p>
</div>
this is the first link im doing so the others have not been done yet, when i use this code i get the error:
Parse error: syntax error, unexpected '<' in /mounted-storage/index.php on line 146
Re: Linking pages to templates
Do you read some books about PHP or manuals?
You should use quotes (' or ");
Code: Select all
<?php echo '<a href="Pages/register.php" target="mainContent">Sign In</a>'; ?>