Jump to content

Link page to another page


NextGenForum.net

Recommended Posts

SelectGreen.co.uk has 11 different categories, in each there is a selection of companies, i want to link the 'Company Name' to another page called viewproperty.php. This is the page that will dispplay all companies using php db tags.

 

I cant remember the link its something like viewproperty.php=ID?

 

i have done it b4 but just cant remember

Link to comment
Share on other sites

<a href="/viewproperty.php?id="><?php echo $row_property['name']; ?></a>

 

Well, that's never going to work.  The value of the id (a presumed database reference) needs to be added to it.  How that happens is a result of your code.  We don't need to see it all, but we obviously need to see some of the php code that generates that line - say 10-20 lines of code.

 

what u meen by this $this = $_GET['this']

 

That's an example of retrieving the value of a parameter passed by URL link.

Link to comment
Share on other sites

<?php require_once('Connections/sgreen.php'); ?>
<?php
$maxRows_property = 10;
$pageNum_property = 0;
if (isset($_GET['pageNum_property'])) {
  $pageNum_property = $_GET['pageNum_property'];
}
$startRow_property = $pageNum_property * $maxRows_property;

mysql_select_db($database_sgreen, $sgreen);
$query_property = "SELECT * FROM property ORDER BY id DESC";
$query_limit_property = sprintf("%s LIMIT %d, %d", $query_property, $startRow_property, $maxRows_property);
$property = mysql_query($query_limit_property, $sgreen) or die(mysql_error());
$row_property = mysql_fetch_assoc($property);

if (isset($_GET['totalRows_property'])) {
  $totalRows_property = $_GET['totalRows_property'];
} else {
  $all_property = mysql_query($query_property);
  $totalRows_property = mysql_num_rows($all_property);
}
$totalPages_property = ceil($totalRows_property/$maxRows_property)-1;
?>

 

thats the noly bit i can think u woudl need

 

all the rest is tables images etc, nohing to do with dbs

Link to comment
Share on other sites

Your question was why a URL generated didn't include the actual value of an id (or ID).  The code you posted isn't what generates that URL.

 

The code you posted assumes that other variables are passed somehow to a page that presumably displays stuff from the database regardless of id.

 

So, what's the real question?

Link to comment
Share on other sites

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.