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 7872973
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T02:22:35+00:00 2026-06-03T02:22:35+00:00

Please I need your help with my script. I’m puting a link to old

  • 0

Please I need your help with my script. I’m puting a link to old news articles in a sidebar and making it clickable. The page it’s coming from (header.php) has the GET id in the URL, so the page receiving it also checks for the value of the GET. It displays fine when I click the old news article in the sidebar.

The problem I’m having is that, whenever I want to view the current article on the the About.php page I get Undefined Index id

Please how can I solve this issue, so that my script works well for displaying old articles and also the current news article.

Thanks

about.php

<?php

$id = $_GET['id'];
$past = mysql_query( "SELECT * FROM about WHERE about_id = '".$id."'") or die(mysql_error()); 
$row = mysql_fetch_array($past);

echo "<h2>";
echo $row1['about_head'];
echo "</h2>";
echo "<p>";
echo $row1['about_content'];
echo "</p>";

?>

Header

<?php

$past = mysql_query("SELECT * FROM about") or die(mysql_error());                    
while($row = mysql_fetch_array($past))
    echo "<a href=\"http://127.0.0.1/church/About.php?id=$row[about_id]\"> $row[about_head].</a><br/>";

?>
  • 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-06-03T02:22:36+00:00Added an answer on June 3, 2026 at 2:22 am

    When you have this code:

          $id = $_GET['id'];
    

    you are retriving an item called “id” from the array called $_GET (which holds all GET parameters). However when this parameter “id” is not present, PHP emits a warning. To get rid of it, replace the line with:

    $id = "";
    if (isset($_GET["id"])) $id = $_GET["id"];
    

    or shortly:

    $id = isset($_GET["id"]) ? $_GET["id"] : "";
    

    which first asks whether the parameter is present, and if it’s not, gives an empty string. If you expect the $id variable to be an integer, you might instead want to use zero instead of an empty string:

    $id = isset($_GET["id"]) ? (int)$_GET["id"] : 0;
    

    this also casts the passed parameter to “int”, so you have a guarantee that it is not a string (possibly containing malicious data).

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

Sidebar

Related Questions

Please i need your help with my script. I'm trying to post comments to
Please I need your help with my script. I'm trying to insert values into
Please i need your help with my script. Whenever i include AND maintable.semester_name =
Please i need your help with how to include INDEXES in my tables, i've
please i need you help with my script.. I'm trying to echo some content
please I need your help with a Linq expression: I have nested objects with
I'm new to this ExpandableListView and I desperately need your help please. I'm using
Please your opinion on the following code. I need to calculate the diff in
Please help! I need to produce a Crystal Report with multiple data columns, but
I need some help! Please. I am trying to develop a very very simple

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.