4 Replies - 9727 Views - Last Post: 30 November 2010 - 02:08 PM Rate Topic: -----

#1 folayo  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 30-November 10

how to link pages in php

Posted 30 November 2010 - 05:28 AM

Hi, i need help in linking pages together in php, im new to php and i find it difficult to link my pages.in other word i want to be able to click a page and it brings me to another page
Is This A Good Question/Topic? 0
  • +

Replies To: how to link pages in php

#2 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6033
  • View blog
  • Posts: 23,414
  • Joined: 23-August 08

Re: how to link pages in php

Posted 30 November 2010 - 05:47 AM

PHP just outputs HTML. How do you do links in HTML?
Was This Post Helpful? 0
  • +
  • -

#3 creativecoding  Icon User is offline

  • Hash != Encryption
  • member icon


Reputation: 926
  • View blog
  • Posts: 3,204
  • Joined: 19-January 10

Re: how to link pages in php

Posted 30 November 2010 - 05:55 AM

echo '<a href="pageyouwishtolinkto.html">Click here to visit that page!</a>';


PHP just prints out HTML. The same way C++ prints out an application.
Was This Post Helpful? 0
  • +
  • -

#4 CTphpnwb  Icon User is online

  • D.I.C Lover
  • member icon

Reputation: 2889
  • View blog
  • Posts: 10,000
  • Joined: 08-August 08

Re: how to link pages in php

Posted 30 November 2010 - 08:15 AM

Is it possible that you are confusing linking html pages with including php files? I think you need to give us an example of your problem.
Was This Post Helpful? 0
  • +
  • -

#5 creativecoding  Icon User is offline

  • Hash != Encryption
  • member icon


Reputation: 926
  • View blog
  • Posts: 3,204
  • Joined: 19-January 10

Re: how to link pages in php

Posted 30 November 2010 - 02:08 PM

For including files, use
include("thefileyouwishtoinclude.php");


or you can use

require("thefileyouwishtoinclude.php");


if you wish the page to stop loading after the page fails to load.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1