Hova kell tenni az ismétlődő hátteret? (PHP)
HTML-ben írom az oldalamat, de letöltöttem jó-pár PHP üzenőfalat és ez működött a legjobban. Hova tegyem benne az ismétlődő hátteret? Csak az kéne bele. Kód:
<html>
<head>
<title>Üzenőfal!</title>
<style type="text/css">
<!--
.message {
color: #000000;
font-family: Verdana;
font-size: 10px;}
.username {
color: #FF9900
font-family: Verdana;
font-size: 10px;
font-weight: bold}
.date {
color: #707070;
font-family: Verdana;
font-size: 9px;}
.forms {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10 px;
color: #6CA05A;
text-decoration: none;
background-color: #CCCCCC;
border-color: #6CA05A;
border-style: solid;
border: 1px}
.submit {
background-color: #CCCCCC;
border-color: #6CA05A;
color: #2A343C;
font-family: Verdana;
font-size: 10px;
border-style: solid;
border 1 px;}
-->
</style>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" style="padding: 2px">
<?php
// If submitted
if( $_POST [ 'submit' ]) {
// Verify if the fields were filled.
if(! $_POST [ 'username' ]) {
echo 'HIBA a felhasználóneveddel!' ;
die;
}
if(! $_POST [ 'email' ]) {
echo 'HIBA az e-mail címeddel!' ;
die;
}
if(! $_POST [ 'message' ]) {
echo 'HIBA az üzeneteddel!' ;
die;
}
// Date format
$date = date ( "d/m/y" ); // http://www.php.net/date
// Assign variables of the forms
$username = $_POST [ 'username' ];
$email = $_POST [ 'email' ];
$message = $_POST [ 'message' ];
$ip = $_SERVER [ 'REMOTE_ADDR' ];
// Connect to the database
include( 'connect.php' );
// Insert the info in the shoutbox table.
$query = "INSERT INTO shoutbox (username, email, message, date, ip)
VALUES ('$username','$email','$message','$date','$ip')" ;
mysql_query ( $query );
// close connection
// Show message to let them return to the shoutbox
?>
<div align="center">Hozzászólás elküldve!<br>
<a href="shoutbox.php">Vissza!</a>
<?php
// If NOT submitted
} else {
// connect to the database
include( 'connect.php' );
$query = "SELECT * FROM shoutbox ORDER BY id DESC LIMIT 10" ;
$result = mysql_query ( $query );
// Create a table
?>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<?
// Run a While loop for the rows
while( $c = mysql_fetch_array ( $result ))
{
?>
<tr>
<td><a href="mailto: <? echo $c['email']; ?> ">
<? echo $c [ username ] ?> </a> says:
<div align="justify"> <? echo $c['message']; ?> </div>
</td>
</tr>
<tr><td>on <? echo $c['date']; ?>
<hr noshade="noshade" size="1" style="border-style: dashed" color="#000000" /></td></tr>
<? } ?>
</table>
<form method="post" action="shoutbox.php">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>Felhasználónév :</td>
<td><input type="text" name="username" class="forms"></td>
</tr>
<tr>
<td>Email :</td>
<td><input type="text" name="email" class="forms"></td>
</tr>
<tr>
<td>Üzenet :</td>
<td><input type="text" name="message" class="forms"></td>
</tr>
<tr>
<td colspan="2"><input type="submit" name="submit" value="Mehet" class="subtmit"></td>
</tr>
</table>
</form>
<?
}
mysql_close ();
?>
</body>
</html>
:D:D:D
Én sokkal jobbat írtam neked.
Amúgy ide:
<body style="padding: 2px; background: url(hatter.jpg);">
Köszönöm szépen! Átírtam. Ezen kívül még a nevek színét állítottam át és a Vissza gombot feketére. [link]
Itt lehet megnézni.
Kapcsolódó kérdések:
Minden jog fenntartva © 2025, 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!