How to call dynamic webpages in a index.php?
-
I tried a some tutorials that showed if you click on a link ex: index.php it in its URL it becomes index.php?page=sample.php using the include() I try doing it but doesn't work,I checked everything and all is correct. im using PHP5.3 ERROR: Notice: Undefined index: tutorials in C:\wamp\www\quick_login\index.php on line 21 CODE: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Untitled Document</title> </head> <body> <table width="422" height="220" border="1" cellpadding="0" cellspacing="2"> <tr> <th width="87" scope="col">Header</th> </tr> <tr> <td> <a href="index.php">Home</a><br> <a href="index.php?page=tutorials">Tutorial… </td> <td width="323"> <?php $page = $_GET['page']; if($page){ include('inc/' .$page.'.php'); } else{ echo "<b>Start Home</b>"; } ?> </td> </tr> </table> </body> </html> Does anyone know how to make it work?
-
Answer:
If you own the php file, it's easy: <?php include "file.php"; // do work... ?> If you don't own the file, then you can't include the original file since requesting the file makes the server run it through their compiler first.
Tech? at Yahoo! Answers Visit the source
Related Q & A:
- How to call a popup from a link inside another popup?Best solution by stackoverflow.com
- How to call .aspx page from a web web service(service.svc?Best solution by Stack Overflow
- How to call Javascript function in PHP?Best solution by Stack Overflow
- How to call a function asynchronously in PHP?Best solution by Stack Overflow
- How to create dynamic php pages?Best solution by Stack Overflow
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.