Jump to content

Recommended Posts

ok, im going nuts trying to figure this out.what i want to do is have a news page on my web site. I have a mysql server running and a table called news and the table has auto_number, date, headline, news.

What i would like to do is have 1 page display the date and the headline and called news.php. When the user click on the headline, query the database and pull the correct info onto the new_page.php page. If possible, i would like to have the whole thing based on a database. Easier to maintain then seperate pages and creating new link every time. Can anyone help me please

Link to comment
https://forums.phpfreaks.com/topic/125487-php-hyperlink-problemquestion/
Share on other sites

Hi, thanks for the responce. But i dont that was what i am wanting. I know how to query the database and all that. What i did is create a php page that pull the date and the headline for example

9-23-2008 Microsoft did it again

9-23-2008 Bill did it

 

I created the page so that the Microsoft did it again and bill did it is now a hyperlink using a recordset. what i want to do is when that person click on it, it will pass the Microsoft did it again or bill did it to a page called new_page and display that news line

 

 

ah okay so just in your links, throw the article's id onto the url target like so...

 

<a href='new_page.php?id=$id'>$title</a>

 

and then on new_page.php just retrieve the id and select the content based on the id

 

$id = $_GET['id'];
$sql = "select stuff from table where id = $id";

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.