|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now! |
|
#1
|
|||
|
|||
|
Hi, I've implemented the multi-page article script to display pages from a course directory, however I ma having a real problem working out how to include the full article on my index page.
Here's the code on the index page to switch includes: <? switch ($page) { case "fullarticle": include('??what goes here????'); break; etc. ?> I get the article summaries (showarticles.php) to include on the page ok: <? include('course_dir/showarticles.php'); ?> but I cannot get the code right so that clicking on the "Read More" link will then include the full article on the index page. What do I need to do to make the following line of code include the full article as an include file??? <a href="ccs/course_dir/fullarticle.php?articleId=<?php echo $row["articleId"]; ?>">Read More...</a> Any help would be appreciated. I've spent the last three days tinkering to get it to work, so far without success. Thanks. |
|
#2
|
|||
|
|||
|
Are you saving your articles on a database? If you are, you shouldn't need the include function.
With de DB model you could do something like this: if ($_GET['showFull']) { print $row['articleContent']; //shows all } else { print substr($row['articleContent'],0,500); // to get the first 500 characters print "<BR>"; print "<a href=\"article.php?articleId=" . $row["articleId"] . "&showFull=1\">Read More...</a>"; } And this: <a href="articles.php?articleId=1&showFull=1">My Article</a> will return the whole article. I don't know, may be I am wrong with the example, so try to send me something more about what you are doing. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > Programming Tools > PHP Includes |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|