Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Using an external file

0 views
Skip to first unread message

richard

unread,
Nov 4, 2009, 11:08:20 PM11/4/09
to
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?

rf

unread,
Nov 4, 2009, 11:38:29 PM11/4/09
to

"richard" <mem...@newsguy.com> wrote in message
news:rly8vsoqcpva$.1d5foa92phncn$.dlg@40tude.net...

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?


Curtis Dyer

unread,
Nov 5, 2009, 11:56:38 PM11/5/09
to
On 04 Nov 2009, "rf" <r...@z.invalid> wrote:

> "richard" <mem...@newsguy.com> wrote in message
> news:rly8vsoqcpva$.1d5foa92phncn$.dlg@40tude.net...
>> 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.

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

>> What would be some viable ways of doing this?
>
> 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.

<snip>

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

@OP:
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
IDs.

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

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

Danny Wilkerson

unread,
Nov 6, 2009, 6:36:39 AM11/6/09
to
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.

0 new messages