Jump to content

someone converted to html now wont work


funkness

Recommended Posts

What do you mean it was converted to HTML? It is a PHP file. It does output HTML though. So, what was it before it was converted when it did work?

 

FYI, there are errors in that PHP code. Whoever created that PHP file didn't doa great job.

OK, so by "someone converted this to html" you mean YOU converted it to HTML. I'm still confused, if it was working as a PHP file, why did you feel the need to change it?

 

But, the bigger issue is you can't simply convert that file to HTML. It has programming in it. You can't connect to a database, and execute logic in an HTML file. The page is meant to be dynamic. however, if you just want a single HTML "snapshot" of the page, then run the file normally as a PHP page, then save the page in your browser as HTML. But, that page will be static, i.e. it will never change based upon data in the database for example.

echo "'This is the result of hard work done by Chad Eriksen - All Rights Reserved.\n";
echo "'No reproduction without contact may be used.\n";
echo "'Contact: [email protected]\n";

 

and every line of code is like this, ha ha

I went through this fast manually, it should look something more like this.

 

 

<?php
/*
This is the result of hard work done by Chad Eriksen - All Rights Reserved.
No reproduction without contact may be used.
Contact: [email protected]
*/
?>
<!DOCTYPE html>
<html>
<head>
<title>Yankton Ag Service, Inc.</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Cache-Control" content="<?php echo date('D, d M Y', mktime(0, 0, 0, date('n'), date('n')+1, date('Y'))); ?>"/>
<meta name="description" content="Yankton Ag Service is a reputable company that sells grain, fertilizer, and chemicals."/>
<meta name="keywords" content="Yankton Ag Service, sell, grain, fertilizer, chemicals" />
<link href="/favicon.ico" rel="shortcut icon" type="image/x-icon">
<link href="style.css" rel="stylesheet" type="text/css">
</head>

<body>
<div id="divMain">
<img src="images/bg2.jpg" id="picBg2" style="z-index:2;" onClick="return false;">
<img src="images/bg1.jpg" id="picBg1" style="z-index:1;" onClick="return false;">
<img src="images/bg0.jpg" id="picBg0" style="z-index:0;" onClick="return false;">
</div>
<?php
include("header.php");
?>
<table width="98%" id="tableMain" border="0" cellpadding="0" cellspacing="2" align="center" class="border mainDiv" style="background:url(images/white_box.png); opacity:0;">
<tr>
<td colspan="2" class="border boxedIn header">Welcome</td>
</tr>
<tr>
<td width="82%" valign="top" class="boxedIn paddingMedium">
<table width="95%" border="0" cellpadding="10" cellspacing="0" align="center">
<tr>
<td class="main"><span class="header"><strong>Yankton Ag Service, Inc.</strong></span> is a locally owned, independent, crop inputs and grain merchandising service center located in Yankton, SD.  Yankton Ag Service, Inc. is a leading supplier of  quality crop input products and custom application needs for area producers.  Yankton Ag Service, Inc. maintains grain facilities and services providing area producers with competitive marketing opportunities.
</td>
</tr>
<tr>
<td align="center"><hr style="width:80%;"></td>
</tr>
<tr>
<td class="header"><br><strong>Ag News:</strong></td>
</tr>
</table>
<?php
$vardir = str_replace("index.php", "", realpath("index.php"));
$conn = new COM("ADODB.Connection") or die("Cannot start ADO.");
$conn->Open("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=".$vardir."admin/data/news.mdb");
$rs = $conn->Execute("SELECT TOP 5, * FROM news ORDER BY ID DESC");
if($rs->EOF){
echo "<table width='90%' border='0' cellpadding='10' cellspacing='0' align='center' class='border boxedIn main' style='margin-bottom:25px;'><tr><td align='center' valign='top'>No News Entries.</td></tr></table>";
}else{
while(!$rs->EOF){
?>
<table width="90%" border="0" cellpadding="4" cellspacing="0" align="center" class="border boxedIn paddingMedium" style="margin-bottom:25px;">
<tr>
<td><span style="font:bold 14px Arial;"><a name="<?php echo $rs['ID']->value; ?>"></a><?php echo  $rs['header']->value; ?></span> - <span class="textRedSmall"><?php echo  date("l, F d, Y", strtotime($rs['date_field']->value)); ?></span></td>
</tr>
<tr>
<td class="main" style="line-height:1.5; padding:0px 20px 15px 20px;"><?php echo $rs['news']->value; ?></td>
</tr>
</table>
<?php
echo $rs->MoveNext();
}
}
unset($rs);
?>
<br><br> 
</td>
<td width="20%" align="center" valign="top" class="paddingMedium">
<div style='width:240px; height:420px; background:url(http://vortex.accuweather.com/adcbin/netweather_v2/backgrounds/blue_240x420_bg.jpg) no-repeat; background-color:#346797;'>
<div id='NetweatherContainer' style='height:405px;'></div>
<div style='color:#ffffff; font:10px arial; line-height:15px;text-align:center;'>
<a style='font-size:10px; color:#ffffff;' href='http://www.accuweather.com/us/SD/YANKTON/57078/city-weather-forecast.asp?partner=accuweather&traveler=0' >Weather Forecast</a> |
<a style='color:#ffffff;' href='http://www.accuweather.com/maps-satellite.asp' >Weather Maps</a> |
<a style='color:#ffffff;' href='http://www.accuweather.com/index-radar.asp?partner=accuweather&traveler=0&zipcode=57078' >Weather Radar</a>
</div>
</div>
</td>
</tr>
</table>
<?php
include("footer.php");
?>
<br><br> 
<script type="text/javascript" src="function.js"></script>
<script src='http://netweather.accuweather.com/adcbin/netweather_v2/netweatherV2ex.asp?partner=netweather&tStyle=whteYell&logo=1&zipcode=57078&lang=eng&size=12&theme=blue&metric=0&target=_blank'></script>
</body>
</html>

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.