【发布时间】:2013-07-20 17:09:19
【问题描述】:
我正在创建我的网站FOUND HERE
(这个页面是点击我主页底部的免费标签的结果found here)
正如您在此页面上看到的,数据库中存储了 2 个字段。 GIFFGAFF & O2。它成功地从我的数据库中的 mobi 表中读取了 promo_image、promo_title、promo_content。
但是:当您点击 GO 按钮时,系统会将您链接到存储在 promo_link 中的站点,该站点位于此优惠的同一张表中。
它不会那样做。但它会在新选项卡中加载相同的页面(由于 _blank 代码)。
我的这个页面的代码是:
<?php
include_once('include/connection.php');
include_once('include/article.php');
$article = new article();
if(isset($_GET['id'])) {
$id = $_GET['id'];
$data = $article->fetch_data($id);
if ($param){
echo '<div>' . $data["bla"] . '</div>';
}
$articles = $article->fetch_all();
?>
<html>
<head>
<title>xclo mobi</title>
<link rel="stylesheet" href="other.css" />
</head>
<body>
<?php include_once('header.php'); ?>
<div class="container">
<a href="index.php" id="logo">Category = ???</a>
<?php foreach ($articles as $article) {
if ($article['promo_cat'] === $_GET['id']) { ?>
<div class="border">
<a href="single.php?id=<?php echo $article['promo_title']; ?>" style="text-decoration: none">
<img src="<?php echo $article['promo_image']; ?>" border="0" class="img" align="left"><br />
<a href="<?php echo $data['promo_link']; ?>" target="_blank"><img alt="" title="" src="GO.png" height="50" width="50" align="right" /></a>
<br /><br /><br /><br />
<?PHP echo '<div class="title">' . $article['promo_title'] . '</div>'; ?>
<br />
<font class="content"><em><center><?php echo $article['promo_content']; ?></center></em></font>
</div><br/><br />
</a>
<?php } } } ?>
</div>
<?php include_once('footer.php'); ?>
</body>
</html>
但是:如果您单击其中一个徽标并转到 single.php 页面,然后单击该页面上的相同 go 按钮,它就可以工作。
我的工作 single.php 页面的代码是这样的。
<?php
include_once('include/connection.php');
include_once('include/article.php');
$article = new article;
if(isset($_GET['id'])) {
$id = $_GET['id'];
$data = $article->fetch_data($id);
?>
<html>
<head>
<title>Xclo Mobi</title>
<link rel="stylesheet" href="other.css" />
</head>
<body>
<?php include_once('header.php'); ?>
<div class="container">
<a href="index.php" id="logo">Title Page</a><br /><br />
<div align="center">
<img src="<?php echo $data['promo_image']; ?>" class="img"><br />
<font class="title"><?php echo $data['promo_title']; ?></font>
<p>
<center><?php echo $data['promo_content']; ?></center>
<a href="<?php echo $data['promo_link']; ?>" target="_blank"><img alt="" title="" src="GO.png" height="50" width="50" align="right" /></a>
<br /><br />
<b><u>More From This Brand</b></u>
<br /><br />
<a href="index.php">← Home</a>
</div>
<?php include_once('footer.php'); ?>
</body>
</html>
<?php
} else {
header('location: index.php');
exit();
}
?>
谁能告诉我为什么 list.php 页面不能正常工作?谢谢。
kevstarlive
【问题讨论】:
-
伊泰女孩。你没有提到这一点。 snd 这是一篇完全独立的文章。
标签: php mysql content-management-system href