Miért van az, hogy az <img scr> tagon belül csak olyan képeket jelenít meg ami nem az oldalamon van?
tessék :D
{
$id = $row['id'];
$title = $row['title'];
$body = $row['body'];
$date = $row['date'];
$author = $row['author'];
$image = $row['image'];
echo "
<center>
<table
style='text-align: left; height: 88px; width: 418px;' border='1'
cellpadding='2' cellspacing='2'>
<tbody>
<tr>
<td
style='width: 100px; text-align: center;' colspan='1'
rowspan='3'><img src='$image'/></td>
<td
style='width: 300px; text-align: center; background-color: rgb(192, 192, 192);'><b>$title</b></td>
</tr>
<tr align='center'>
<td style='width: 300px; background-color: rgb(192, 192, 192);'><font color='green'><b>
$body
</b></font></td>
</tr>
<tr align='center'>
<td style='width: 300px; background-color: rgb(192, 192, 192);'><font color='red'><b>$date - $author</b></font></td>
</tr>
</tbody>
</table>
<br>
</center>
";
}
Még egyszer: HTML kimenet!!!
nem PHP forrás kód
Itt az egész:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Slideshow with jmpress.js</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Slideshow with jmpress.js" />
<meta name="keywords" content="jmpress, slideshow, container, plugin, jquery, css3" />
<meta name="author" content="for Codrops" />
<link rel="shortcut icon" href="../favicon.ico">
<link href='http://fonts.googleapis.com/css?family=Open+Sans+Condensed:700,300,300italic' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="css/demo.css" />
<link rel="stylesheet" type="text/css" href="css/style_alt.css" />
<!--[if lt IE 9]>
<link rel="stylesheet" type="text/css" href="css/style_ie.css" />
<![endif]-->
<!-- jQuery -->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<!-- jmpress plugin -->
<script type="text/javascript" src="js/jmpress.min.js"></script>
<!-- jmslideshow plugin : extends the jmpress plugin -->
<script type="text/javascript" src="js/jquery.jmslideshow.js"></script>
<script type="text/javascript" src="js/modernizr.custom.48780.js"></script>
<noscript>
<style>
.step {
width: 100%;
position: relative;
}
.step:not(.active) {
opacity: 1;
filter: alpha(opacity=99);
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=99)";
}
.step:not(.active) a.jms-link{
opacity: 1;
margin-top: 40px;
}
</style>
</noscript>
</head>
<body>
<div style="
padding: 0 0 0 0;
margin: 0;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: -1;
">
<img src="images/bg.jpg" width="100%" height="100%"></div>
<div class="container">
<header>
<h1>Slideshow <span>with jmpress.js</span></h1>
<h2>Adding some 3D to your slideshow</h2>
<nav class="codrops-demos">
<a href="index.html">Default</a>
<a href="index2.html">Autoplay</a>
<a class="current-demo" href="index3.html">Different Layout</a>
</nav>
</header>
<section id="jms-slideshow" class="jms-slideshow">
<div class="step" data-color="color-1" data-x="2000" data-y="1000" data-z="3000" data-rotate="-20">
<div class="jms-content">
<h3>Just when I thought...</h3>
<p>From fairest creatures we desire increase, that thereby beauty's rose might never die</p>
<a class="jms-link" href="#">Read more</a>
</div>
<img src="images/1.png" />
</div>
<div class="step" data-color="color-2" data-x="1000" data-z="2000" data-rotate="20">
<div class="jms-content">
<h3>Holy cannoli!</h3>
<p>But as the riper should by time decease, his tender heir might bear his memory</p>
<a class="jms-link" href="#">Read more</a>
</div>
<img src="images/2.png" />
</div>
<div class="step" data-color="color-3" data-x="2000" data-y="1500" data-z="1000" data-rotate="20">
<div class="jms-content">
<h3>No time to waste</h3>
<p>Within thine own bud buriest thy content and, tender churl, makest waste in niggarding</p>
<a class="jms-link" href="#">Read more</a>
</div>
<img src="images/3.png" />
</div>
<div class="step" data-color="color-4" data-x="3000" data-y="2000">
<div class="jms-content">
<h3>Supercool!</h3>
<p>Making a famine where abundance lies, thyself thy foe, to thy sweet self too cruel</p>
<a class="jms-link" href="#">Read more</a>
</div>
<img src="images/4.png" />
</div>
<div class="step" data-color="color-5" data-x="4000" data-y="1500" data-z="1000" data-rotate="-20">
<div class="jms-content">
<h3>Did you know that...</h3>
<p>Thou that art now the world's fresh ornament and only herald to the gaudy spring</p>
<a class="jms-link" href="#">Read more</a>
</div>
<img src="images/5.png" />
</div>
</section>
</div>
<script type="text/javascript">
$(function() {
$( '#jms-slideshow' ).jmslideshow();
});
</script><center>
<?php
mysql_connect ("127.0.0.1","darkzonelittle","internet55") or die ("Nem sikerült kapcsolódni az adatbázishoz!");
mysql_select_db("darkzonelittle") or die("Nem sikerült kiválasztani az adatbázist!");
$getnews = mysql_query ("SELECT * FROM news") or die ("Nem sikerült kapcsolódni az adatbázishoz!");
while ($row = mysql_fetch_assoc($getnews))
{
$id = $row['id'];
$title = $row['title'];
$body = $row['body'];
$date = $row['date'];
$author = $row['author'];
$image = $row['image'];
echo "
<center>
<table
style='text-align: left; height: 88px; width: 418px;' border='1'
cellpadding='2' cellspacing='2'>
<tbody>
<tr>
<td
style='width: 100px; text-align: center;' colspan='1'
rowspan='3'><img src='$image'/></td>
<td
style='width: 300px; text-align: center; background-color: rgb(192, 192, 192);'><b>$title</b></td>
</tr>
<tr align='center'>
<td style='width: 300px; background-color: rgb(192, 192, 192);'><font color='green'><b>
$body
</b></font></td>
</tr>
<tr align='center'>
<td style='width: 300px; background-color: rgb(192, 192, 192);'><font color='red'><b>$date - $author</b></font></td>
</tr>
</tbody>
</table>
<br>
</center>
";
}
?>
</center>
</body>
</html>
<img src='$image'/...
bocsánat,de '.$image.'
tehát a képek relatív hivatkozással mutatsz rá.
azaz az adott path -tól indul ki.
ha pl. http://localhost/aloldal/feldogozo.php <<< a hivatkozéás
akkor a http://localhost/aloldal/images/1.jpg -t fogja keresni.
de ha a kép a http://localhost/images/1.jpg -n érhető el, akkor vagy teljes elérést, vagy oldalon belüli full elérést kell megadni.
pl.: <img src="/images/1.jpg">
Kapcsolódó kérdések:
Minden jog fenntartva © 2024, www.gyakorikerdesek.hu
GYIK | Szabályzat | Jogi nyilatkozat | Adatvédelem | Cookie beállítások | WebMinute Kft. | Facebook | Kapcsolat: info(kukac)gyakorikerdesek.hu
Ha kifogással szeretne élni valamely tartalommal kapcsolatban, kérjük jelezze e-mailes elérhetőségünkön!