SunQuest
 
           Programming Tools
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingProgramming Tools

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
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  
Old June 29th, 2003, 04:58 PM
Wycthewood Wycthewood is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: UK
Posts: 2 Wycthewood User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to Wycthewood
Angry PHP Includes

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.

Reply With Quote
  #2  
Old July 11th, 2003, 06:03 AM
lucasefe lucasefe is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 3 lucasefe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question

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.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingProgramming Tools > PHP Includes


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Iron Speed




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway