Hello,
I have a php page (category.php) that loads its content from the database when a link is clicked from another page. For example a
a link that looks like this <a href = "category.php?category=cars">Cars</a> when clicked will pull all the items from the database under the cars category and display on the category.php page.
However If a user decides to manually type in the url bar say www.sales.com/category.php, No content will be displayed because the ?category=something part is missing.
Please how does one go around this.? I would like to know if there are certain ways to handle this issue.

Thanks

In your category.php page, if you don't have a value for the querystring display something else or redirect them to another page.

You simply need to have a conditional statement to check for a value before you assume there is a value present.

okay thank you. I actually checked the "categrory" variable to see whether or not it had a value, then i redirected to another page if it didn't. And it worked.

good to hear.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.