Jump to content

Recommended Posts

[code]while($row = mysql_fetch_array( $result )){
    echo '<a href="model.php?m='.$row['model'].'"><br>';
}[/code]
model.php
[code]<?php
    $model = $_GET['m'];
    $result = mysql_query("SELECT * FROM `table` WHERE (`model`='$model')");
    echo("Model: $model");
    echo("<br>Price: " . mysql_result($result, 0, "price"));
?>[/code]
Very simple example...
Link to comment
https://forums.phpfreaks.com/topic/11354-links-with-template/#findComment-42576
Share on other sites

[!--quoteo(post=380767:date=Jun 6 2006, 02:41 PM:name=Randy)--][div class=\'quotetop\']QUOTE(Randy @ Jun 6 2006, 02:41 PM) [snapback]380767[/snapback][/div][div class=\'quotemain\'][!--quotec--]
[code]while($row = mysql_fetch_array( $result )){
    echo '<a href="model.php?m='.$row['model'].'"><br>';
}[/code]
model.php
[code]<?php
    $model = $_GET['m'];
    $result = mysql_query("SELECT * FROM `table` WHERE (`model`='$model')");
    echo("Model: $model");
    echo("<br>Price: " . mysql_result($result, 0, "price"));
?>[/code]
Very simple example...
[/quote]

hey thanks. Do you know where I can find some tutorials on that area?
Link to comment
https://forums.phpfreaks.com/topic/11354-links-with-template/#findComment-42577
Share on other sites

that worked but now i have the problem of doing it within a template. My index.php looks like this
<?php

include("template/header.tpl.html");


include("template/menu.tpl.html");

if (empty($_GET['page'])) {
$page = 'home.php';
} else {
$page = $_GET['page'];
}

if (false == is_file($page)) {
$page = 'file_not_found.php';
}

include($page);

include("template/footer.tpl.html");
?>

this works for all my links if i put in <a href="index.php?page=test.php">

but when i try to access my model i have
<a href="index.php?page=model.php?m='.$row['model'].'">
and it comes up as page not found with this in the address bar
index.php?page=model.php?m=T4R23
if i remove the m=T4R23 it goes into the page but with errors. So i know that the link is good. Any help would be great on how to make this work
Link to comment
https://forums.phpfreaks.com/topic/11354-links-with-template/#findComment-42638
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.