Jump to content

link to another page


franknu

Recommended Posts

ok, i have more info in my database  i was just wondering when people click on the name of the business that match the criteria  i want to take them to another page, if they want to know more about that business, for now i have a parser error i can't find the poblem and the second i am not that sure if i am doing the right thing any help please

[code=php:0]

<?php

$host = "localhost";
$username = "localhost";
$password = "abc123";
$database = "contacts";

$Categories = addslashes ($_POST['Categories']);
$make = addslashes ($_POST['make']);
$type = addslashes ($_POST['type']);



if(!$Categories ||!$make||!$type)



{
  echo "You have not enter all fields";
  exit;
  }


$db = mysql_connect($host, $username, $password);
mysql_select_db($database);

if(isset($_GET['Categories']))
  {
    $Categories = addslashes($_GET['Categories']);
    }
    else

    {
    echo("No Categories found.");
 
}


  $query = "SELECT * FROM `business_info` WHERE `Categories` LIKE '%".$Categories."%'";
  $result = mysql_query($query) or die (mysql_error());
  $num_result = mysql_num_rows($result);


if($num_result <= 0)
  {
    echo("No Results found.");
    exit;
}

  echo "<p>Number of business found: ".$num_result."</p>";
while($row = mysql_fetch_array($result))
    {
echo "<table>";
echo "<tr>";

echo "<td>";

<img src='$Picture1' width='203' height='152'>

echo "</td>";
echo "</tr>" ;
echo "<tr>";
echo "<td>";

echo "<hr>" ;

<a href=" <?=$row ["includefiles/bizwebpage2.php"]?>"> <?= $row['BusinessName']?> </a>
    <?
echo"</strong>";
echo "<br>";
    echo ($row["Slogan"]);
    echo "</strong><br>Address ";
    echo (stripslashes($row["Business_Address"]));
    echo "<br>State ";
    echo (stripslashes($row["make"]));
    echo "<br>City ";
    echo (stripslashes($row["type"]));
    echo "<br>Tel ";
    echo (stripslashes($row["Tel"]));
    echo "</p>";
echo "</td>";
echo "<td>";



echo "script here";


echo "</td>";

echo "</tr>";
echo "</table>";
}

?>
[/code]

this is my display

Parse error: parse error in c:\program files\easyphp1-8\home\townsfinder\business_display.php on line 165
Link to comment
https://forums.phpfreaks.com/topic/26922-link-to-another-page/
Share on other sites

here is my new code

much better i think

ok my problem is that it is asking me to define Picture1 and  bizwebpage2.php and also it is not show the picture on the database or the frame it just dessapear also when i click on the link it is taking to a total diffrent link that the one i am asking to take me.. thank you

here is my part of my error display

Notice: Undefined index: includefiles/bizwebpage2.php in c:\program files\easyphp1-8\home\townsfinder\business_display.php on line 95




[code=php:0]
  <?php

$host = "localhost";
$username = "localhost";
$password = "abc123";
$database = "contacts";

$Categories = addslashes ($_POST['Categories']);
$make = addslashes ($_POST['make']);
$type = addslashes ($_POST['type']);




if(!$Categories ||!$make||!$type)



{
  echo "You have not enter all fields";
  exit;
  }
$db = mysql_connect($host, $username, $password) or die(mysql_error());
mysql_select_db($database) or die(mysql_error());


$bizwebpage2 = (isset($_FILES['bizwebpage2']) ? $_FILES['bizwebpage2']:'');
$Picture1 =  (isset($_FILES['Picture1']) ? $_FILES['Picture1']:'');

if(isset($_GET['Categories']))
  {
    $Categories = addslashes($_GET['Categories']);
    }
    else

    {
    echo("No Categories found.");
 
}


  $query = "SELECT * FROM `business_info` WHERE `Categories` LIKE '%".$Categories."%'";
  $result = mysql_query($query) or die (mysql_error());
  $num_result = mysql_num_rows($result);
 
  echo "<table>";


if($num_result <= 0)
  {
    echo("No Results found.");
    exit;
}
//include login row
  echo "<tr>";
  echo "<td>";
echo"login";
  echo "</td>";
  echo "</tr>";
  //inlude topsearch
  echo "<tr>";
  echo "<td>";
include("includefiles/topsearch.php");
  echo "</td>";
  echo "</tr>";
 
  //business found row
  echo"<tr>";
  echo"<td div align='right' bgcolor='DFDFDF'>";
  echo"<p>Number of business found: ".$num_result."</p>";
  echo"</td>";
  echo"</tr>";
 
while($row = mysql_fetch_array($result))
    {


echo "<tr>";
//picture colums
echo "<td>";
echo "<img src=\'{$Picture1}\' width=\'203\' height=\'152\'>";


//business colums

echo '<a href="' . $row['includefiles/bizwebpage2.php'] . '">' . $row['BusinessName'] . '</a>';

echo "<br>";


    echo ($row["Slogan"]);
    echo "</strong><br>Address ";
    echo (stripslashes($row["Business_Address"]));
    echo "<br>State ";
    echo (stripslashes($row["make"]));
    echo "<br>City ";
    echo (stripslashes($row["type"]));
    echo "<br>Tel ";
    echo (stripslashes($row["Tel"]));
    echo "</p>";
echo"<hr>";
echo "</td>";
//include banner colums
echo "<td>";
include("includefiles/side_business_banner.php");
echo "</td>";
echo "</tr>";

echo "</table>";
}

?>

[/code]
Link to comment
https://forums.phpfreaks.com/topic/26922-link-to-another-page/#findComment-123154
Share on other sites

Ok I am getting:Notice: Undefined index: includefiles/bizwebpage2.php in c:\program files\easyphp1-8\home\townsfinder\business_display.php on line 75

i am not getting the picture either not even the frame it seems i was able to define the picture but not
inludefiles/bizwebpage2.php please help



[code=php:0]
<?php

$host = "localhost";
$username = "localhost";
$password = "abc123";
$database = "contacts";

$Categories = addslashes ($_POST['Categories']);
$make = addslashes ($_POST['make']);
$type = addslashes ($_POST['type']);

if(!$Categories ||!$make||!$type){
  echo "You have not enter all fields";
  exit;
  }
$db = mysql_connect($host, $username, $password) or die(mysql_error());
mysql_select_db($database) or die(mysql_error());


$bizwebpage2 = (isset($_FILES['bizwebpage2']) ? $_FILES['bizwebpage2']:'');
$Picture1 =  (isset($_FILES['Picture1']) ? $_FILES['Picture1']:'');


if(isset($_GET['Categories'])){
    $Categories = addslashes($_GET['Categories']);
    }
    else {
    echo("No Categories found.");
}
$query = "SELECT * FROM `business_info` WHERE `Categories` LIKE '%".$Categories."%'";
$result = mysql_query($query) or die (mysql_error());
$num_result = mysql_num_rows($result);
  echo "<table>";
if($num_result <= 0){
    echo("No Results found.");
    exit;
}
//include login row
  echo "<tr>";
  echo "<td>";
echo"login";
  echo "</td>";
  echo "</tr>";
  //inlude topsearch
  echo "<tr>";
  echo "<td>";
include("includefiles/topsearch.php");
  echo "</td>";
  echo "</tr>";
 
  //business found row
  echo"<tr>";
  echo"<td div align='right' bgcolor='DFDFDF'>";
  echo"<p>Number of business found: ".$num_result."</p>";
  echo"</td>";
  echo"</tr>";
 
while($row = mysql_fetch_array($result)){
echo "<tr>";
//picture colums
echo "<td>";
echo "<img src=\'{$Picture1}\' width=\'203\' height=\'152\'>";


//business colums
echo '<b> <a href="'. $row['includefiles/bizwebpage2.php'].'">' . $row['BusinessName'] . ' </a></b>';
echo "<br>";
echo ($row["Slogan"]);
    echo "</strong><br>Address: ";
    echo (stripslashes($row["Business_Address"]));
    echo "<br>State: ";
    echo (stripslashes($row["make"]));
    echo "<br>City: ";
    echo (stripslashes($row["type"]));
    echo "<br>Tel: ";
    echo (stripslashes($row["Tel"]));
    echo "</p>";
echo"<hr>";
echo "</td>";
//include banner colums
echo "<td>";
include("includefiles/side_business_banner.php");
echo "</td>";
echo "</tr>";
echo "</table>";
}

?>
[/code]
Link to comment
https://forums.phpfreaks.com/topic/26922-link-to-another-page/#findComment-123188
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.