Jump to content

PHP and links - help


SuperTini

Recommended Posts

Hi,

 

I am working on a website with php and mysql. On the front page of the website I only show a summaray (or the first 5 lines) of each article that is posted. Under these five lines I want to have a link that says something line "...click here to read the whole article".

 

All the articles that are posted are stored in a database. My question is now how do I use php to link to a "whole article"?

 

My table looks something like thist:

 

id  |    title            | message              |  author

________________________________________

1    |  something  | text blablablabla  |  paul

________________________________________

2    |  hello          | what a text            |  christine

________________________________________

 

 

thanks for helping:)

Link to comment
https://forums.phpfreaks.com/topic/132825-php-and-links-help/
Share on other sites

if that's where you have your query result article id stored, then yes.  And then on the next page, you can access that id from $_GET['innleggID'] and run a query based off that.

 

edit:

 

well I think you have your quotes wrong..

 

<a href="showarticle.php?innleggID=' .$result->ID. ' ">read more</a>

 

should be something like

 

echo "<a href='showarticle.php?innleggID=" .$result->ID. "'>read more</a>";

Link to comment
https://forums.phpfreaks.com/topic/132825-php-and-links-help/#findComment-690780
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.