Page 1 of 1

Image Into PHP

Posted: Mon Jun 16, 2008 9:09 pm
by CoolAsCarlito
I'm confused on what to put into my php so that I can include the right title belt image ontop of it's name found on the page kansasoutlawwrestling.com/champions.php

Code: Select all

 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>KOW Champions</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
 
<body bgcolor="black" text="white">
<script language=JavaScript>
<!--
 
//Disable right mouse click Script
//By Maximus (maximus@nsimail.com) w/ mods by DynamicDrive
//For full source code, visit http://www.dynamicdrive.com
 
var message="All property of KOW is trademarked and copyrighted. ";
 
///////////////////////////////////
function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}
 
function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}
 
if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}
 
document.oncontextmenu=new Function("alert(message);return false")
 
// -->
</script>
<?php
// Connects to your Database
$link = mysql_connect("?", "?", "?") or die(mysql_error());
mysql_select_db("?",$link) or die(mysql_error());
 
if (!mysql_select_db("?", $link)) {
echo 'Could not select database';
exit;
}
//Define the query
$query = 'SELECT * FROM titles';
 
if ($r = mysql_query ($query)){ // Run the query.
 
// Retrieve and print every record
while ($row = mysql_fetch_array ($r)){
print '<center><h2><font color="white"><a href="title.php?id=' . $row['id'] . '">'.$row['titlename'].'</a></font></h2></center>';
print '<center><h4><font color="white"><a href="bios.php?id=' . $row['id'] . '">'.$row['champion'].'</a></font></h4></center>';
print '<center><font color="white"><u>Contenders</u></font></center>';
print '<center><font color="white"><a href="bios.php?id=' . $row['id'] . '">'.$row['contender1'].'</a></font></center>';
print '<center><font color="white"><a href="bios.php?id=' . $row['id'] . '">'.$row['contender2'].'</a></font></center>';
print '<center><font color="white"><a href="bios.php?id=' . $row['id'] . '">'.$row['contender3'].'</a></font></center>';
}
 
} else {
die ('<p>Could not retrieve the data because <b>' . mysql_error() . '</b>. The query was $query.</p>');
} //End of query IF
?>
 
 
</body>
</html>
 

Re: Image Into PHP

Posted: Mon Jun 16, 2008 10:47 pm
by lonelywolf
what is your problem :?:

Re: Image Into PHP

Posted: Tue Jun 17, 2008 1:25 am
by hansford
oh... ye ol'e 'title belt' problem..Well, that's easy.

Code: Select all

 
If($title_belt == 'George Foreman'){
 
$title_belt = "been there done that';
}
else{
echo "do you have grill named after you?";
}
 

Re: Image Into PHP

Posted: Tue Jun 17, 2008 6:26 am
by WebbieDave
What have you tried? I fail to see an image tag anywhere in your code.

Re: Image Into PHP

Posted: Tue Jun 17, 2008 8:47 am
by Greenconure
On a side note, the "copyright protection" you have on your page will not discourage someone from copying your content; rather, it would probably discourage some people from staying on your website. There are so many ways to get around a script like that it's not really worth it. But it's up to you..

Re: Image Into PHP

Posted: Tue Jun 17, 2008 12:02 pm
by CoolAsCarlito
What I"m trying to do is for each title I'm trying to put it's respectful title belt image above it's name. I didn't know if you can have an image in a table on a database.