Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old script won't work with new doctype
Old 03-15-2008, 01:10 AM Old script won't work with new doctype
Average Talker

Posts: 25
Name: John Grafflin
Trades: 0
Been using this script for a couple of years now, and it works just fine. But when I copied it over to a new website and changed the variables to fit the new database, it won't work. The script author no longer offers support, instead suggesting users come here for help.

The old script is on a website using the following doctype:

<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN"
"<U><FONT color=#0000f0 size=1>

The new page uses:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" >


The major difference in the two pages (other than the doctype) is, the first was written using the old table formatting style, while the new page uses CSS.

Here is the code:

<div class="colmask fullpage">
<div class="col1">

<!-- Start Content -->

<table>
<tr>
<th>Host Name</th>
<th>Established</th>
<th>Price</th>
<th>Disk Space</th>
<th>Bandwidth</th>
<th>Economy Plan Available</th>
<th>Allows Mailing Lists</th>
<th>Server Platform</th>
<th>SSL Included</th>
<th>eCommerce Ready</th>
<th>Affiliate Program</th>
</tr>

<?php
include("dbinfo.inc.php");
$query="SELECT * FROM webhosts ORDER BY progname ASC";
$result=mysql_query($query)or die(mysql_error());
$num=mysql_numrows($result);
mysql_close();
$i=0;while($i< $num){
$hostname=mysql_result($result,$i,"hostname");
$url=mysql_result($result,$i,"url");
$established=mysql_result($result,$i,"established");
$price=mysql_result($result,$i,"price");
$diskspace=mysql_result($result,$i,"diskspace");
$bandwidth=mysql_result($result,$i,"bandwidth");
$econplan=mysql_result($result,$i,"econplan");
$maillists=mysql_result($result,$i,"maillists");
$platform=mysql_result($result,$i,"platform");
$ssl=mysql_result($result,$i,"ssl");
$ecommerce=mysql_result($result,$i,"ecommerce");
$affiliate=mysql_result($result,$i,"affiliate");?>
<tr>
<td><a href="<?phpecho $url;?>"><?phpecho $hostname;?></a></td>
<td><?phpecho $established;?></td>
<td><?phpecho $diskspace;?></td>
<td><?phpecho $bandwidth;?></td>
<td><?phpecho $econplan;?></td>
<td><?phpecho $maillists;?></td>
<td><?phpecho $platform;?></td>
<td><?phpecho $ssl;?></td>
<td><?phpecho $ecommerce;?></td>
<td><?phpecho $affiliate;?></td>
</tr>
<?php
$i++;}?>
</table>

<!-- End Content -->

</div>
</div>
jwgrafflin is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-15-2008, 10:48 PM Re: Old script won't work with new doctype
Arenlor's Avatar
Ultra Talker

Posts: 462
Name: Jerod Lycett
Location: /home/arenlor
Trades: 0
What do you mean it won't work? Also don't use: <?xml version="1.0" encoding="utf-8"?> as it screws up on IE.
__________________
PHP Code:
<?php echo "Hello World"?>
HTML Code:
<html><head><title>Hello World</title></head><body><p>Hello World</p></body></html>
Arenlor is offline
Reply With Quote
View Public Profile Visit Arenlor's homepage!
 
Old 03-16-2008, 12:33 AM Re: Old script won't work with new doctype
Average Talker

Posts: 25
Name: John Grafflin
Trades: 0
UTF 8 works just fine for me on IE, but it sure screws up on FireFox and Opera.

Either I missed something in transposing the script, or it just won't work the way it is written. See for yourself at http://www.webhosting-depot.com/compare-hosts.html (NO, this is not a commercial link. It's a page under construction).
jwgrafflin is offline
Reply With Quote
View Public Profile
 
Old 03-16-2008, 01:58 AM Re: Old script won't work with new doctype
Arenlor's Avatar
Ultra Talker

Posts: 462
Name: Jerod Lycett
Location: /home/arenlor
Trades: 0
Rename the page to a .php not .html page.
You don't need (nor should you have) the XML declaration at all. Start with the DOCTYPE declaration and go from there.
__________________
PHP Code:
<?php echo "Hello World"?>
HTML Code:
<html><head><title>Hello World</title></head><body><p>Hello World</p></body></html>
Arenlor is offline
Reply With Quote
View Public Profile Visit Arenlor's homepage!
 
Old 03-16-2008, 02:22 AM Re: Old script won't work with new doctype
Average Talker

Posts: 25
Name: John Grafflin
Trades: 0
Just as I suspected, I missed several things, the main one being I forgot to change the page to .php. Once that was done, the error messages took care of the rest. And, just as you said, one of those errors was the XML line at the top. It's been removed so all that's left is a little CSS fine tuning.

Guess the old cliche holds true, I couldn't see the forest for the trees.

Thanks!
jwgrafflin is offline
Reply With Quote
View Public Profile
 
Old 03-16-2008, 03:21 AM Re: Old script won't work with new doctype
Average Talker

Posts: 25
Name: John Grafflin
Trades: 0
One more thing. Can you help with alternating row background colors?
jwgrafflin is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Old script won't work with new doctype
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.28169 seconds with 12 queries