Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 674977
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:46:00+00:00 2026-05-14T00:46:00+00:00

I need something simple; I have page where a user clicks an author to

  • 0

I need something simple; I have page where a user clicks an author to see the books associated with that author. On my page displaying the list of books for the author, I want a simple HTML title saying: ‘The books for: AUTHORNAME’

I can get the page to display author ID but not the name. When the user clicks the link in the previous page of the author, it looks likes this:

<a href="viewauthorbooks.php?author_id=<?php echo $row['author_id']?>"><?php echo $row['authorname']?></a>

And then on the ‘viewauthorbooks.php?author_id=23’ I have declared this at the start:

$author_id = $_GET[‘author_id’];
$authorname = $_GET[‘authorname’];

And finally, ‘The books for: AUTHORNAME, where it says AUTHORNAME, I have this:

echo $authorname

(With PHP tags, buts its not letting me put them in!) And this doesnt show anything, however if I change it to author_id, it displays the correct author ID that has been clicked, but its not exactly user friendly!! Can anyone help me out!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T00:46:01+00:00Added an answer on May 14, 2026 at 12:46 am

    You could pull the author_id from the query string as you did using $_GET but beware you will need to validate what is coming through by the query. I hope you can see that without validation how bad of a security hole this is.

    I am at work at the moment, but this is a quick example that should give you what you need without sanitizing your query.

    $id = intval($_GET['author_id']); 
    // of course, perform more validation checks
    // just don't assume its safe.
    $sql = "SELECT authorname FROM authors_tb WHERE author_id=" . $id;
    $result = mysql_query($sql);
    while($row = mysql_fetch_array($result)) {
       echo "The books for: " . $row['authorname'];
     }
    

    The reason why your approach wasn’t working was because you utilize the $_GET URL parameter passing for author_name where you weren’t supplying the parameters in the URL, just the author_id.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple form that I don't want accidentally submitted multiple times. I
I'm making a simple facebook canvas app (page tab) with PHP, that posts something
OK, this sounds simple and or like something that should have probably been done
I have a web app which displays a list of emails that need to
I am creating a very simple to-do list application. Each user should have an
I need something simple like date , but in seconds since 1970 instead of
I need something like this http://jonraasch.com/blog/a-simple-jquery-slideshow but w/o the absolute positioning. Is it possible?
I'm using CodeIgniter and need an easy to implement captcha. Something simple, nothing too
I guess this is a simple question. I need to do something like this:
I'm trying to write a simple app that lets a user grant my code

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.