URL Variable issue

  HighTower 20:27 10 Jun 04
Locked

I've made the simplest of php pages called "test.php" using DWMX. The page talks to a mySQL database. This page contains a recordset/query for the database and displays the title of an article (which is a field called TITLE in the mySQL database).

I've included a repeat region so that the title of each article in the whole database is displayed rather than just the first entry. I've also added a hyperlink to this title so that it carries over a url variable to a page called "output.php".

Output.php displays the results of all fields of a single record from the database dependent on the url variable that it received from "test.php".

Except it doesn't! I get a blank page.

It works perfectly on my testing server on my network, but as soon as I upload it to a third party webhost it stops working. I know that my connection to the database on the webhost works because the first page displays information from it. Also, my url variable appears to be correct as when I hover my mouse over the link I can see output.php?ID=6, output.php?ID=7, etc appear. When I click a link and output.php appears the url also contains this ID info, but no record.

The php code in the page "output.php" contains:

$colname_rs_dbase = "1";
if (isset($_GET['ID'])) {
$colname_rs_dbase = (get_magic_quotes_gpc()) ? $_GET['ID'] : addslashes($_GET['ID']);

This looks OK as I can see that it looks for the variable ['ID'], which is what is sent from the first page.

Most baffling is if the connection to the database is OK, and it works great on my testing server, what could be causing this fairly simple code to not work? I'm still working through books on php and mysql at the moment so have been using dreamweaver for shortcuts.

If anyone has any ideas of where I should start looking to solve this I would be grateful.

This thread is now locked and can not be replied to.

How to get Windows 10 for free | How to install Windows 10: There is still a way to avoid paying…

1995-2015: How technology has changed the world in 20 years

Alex Chinneck’s giant ice cube Christmas tree at Kings Cross

Apple rumours & predictions 2017: The iPhone 8, new iPads, and everything else you should expect fr7…