Using an external file

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

Let's say I have a blog and I have 10 articles on that blog.
Instead of loading the entire text for all 10 articles, I want only the
article titles to load initially. Then when the user clicks on say article
5, only that text file is called and displayed.

If possible, when article 3 is clicked on, article 5 is dumped and article
3 is readable.

What would be some viable ways of doing this?

Re: Using an external file

Quoted text here. Click to load it

Yes. A number of viable ways. All using Javascript (possily AJAX) or HTML
(possibly forms or plain links with "parameters").

This is not a PHP question. PHP runs on the server and knows absolutely
nothing about things being clicked on.

Or did you miss that last time you were told RtS?

Re: Using an external file

Quoted text here. Click to load it

Maybe just me, but I don't get your meaning here.  What do you
mean by "article 5 is dumped"?

Quoted text here. Click to load it


As far as I can tell, client-side scripting need not necessarily
be involved here.

The initial page load would simply involve querying the database
for article titles.  You could output the titles as links, the
query strings of each would likely contain the respective article

  <!-- This would be output in a loop -->
  <a href="article.php?id=<?php echo $id; ?>">
  <?php echo htmlspecialchars($title); ?>

Curtis Dyer
<? $x='<? $x=%c%s%c;printf($x,39,$x,39);?>';printf($x,39,$x,39);?>

Re: Using an external file

you could have all the pages (if super small) embeded on same page and
use css display:none; to show the relevant page. I did that once when
i was making a cheesy html game all client side. Ya could embed
iframes that also have display:none; and when you click button, css
display:block; which activates the downloading of the html and after
that, you just hide (visibility:hidden and visibility: visible to show
already loaded content thereby lowering hits on the server. Ok, so you
insist on server controled. Ya couls try a java applet of flash with a
persistant connection back to the server which sends javascript/html
to you page. It would be very seamless intergration but you would not
be able to cashe anything. Another thing you can do, if you decide to
load everything into one page then display as you go, you could have
multiple style sheets where each style sheet codes for a layout of
that page and use javascript to select different sets of styles
thereby display that page.

honestly everything i mentioned about can work, but dang it super
newbish. Everything i said is stuff done in the 90's. What you want is
a frame site with links you click that cause different pages to load
into the iframe. That also is old school and crap.

p.s. I am wasting my life responding to this.

Site Timeline