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 07-16-2005, 11:58 PM Code cleanup
thesawmillguy's Avatar
Skilled Talker

Posts: 57
Location: Augusta, ME
Trades: 0
Here is what I am trying to accomplish. I am setting up pages that use the .html extension. In these HTML files are PHP cade.... Most everything works flawlessly except for when it comes time to parse URL's... I end up with single quotes or no quotes in the code (i.e. when I view the source), BUT either way it comes out the links work. I just want things to be tidy and look correct as well as function correctly.. I am still very much a PHP newbie so if there is any tips/tricks to clean up the code, etc. PLEASE let me know... I am open to any ideas...

Thanks

Here are the snippets of code to form the page(s):
The following code results in http://www.ctechinfo.org/model/uvave/uwave3.html
Code:
<?php
/* File revision 7/15/05 - There is an information link at the bottom or this 

page. PLEASE keep an eye on that thread and post as necessary in that 

thread!!! --->> See http://www.ctechinfo.org/forum/viewtopic.php?t=655 For 

more information.. */
$meta_title = "UWAVE3 - Compaq OEM FIC AZ31 Motherboard";
$content1 = "Spec sheet and downloads for the Compaq UWAVE3 motherboard";
$content2 = "Compaq, UWAVE3, FIC AZ31, motherboard, spec sheet, downloads, 

information"; 
$page_name = "UWAVE3";
$image = "az31.jpg";
$size = "150";
$processors = "AMD Athlon XP 1700 (1.47 GHz)";
$bus = "Socket A - 266 MHz FSB";
$chipset = "VIA KT133a Chipset";
$RAM = "Three Total DIMM Slots<br/>Upgradable To 512MB";
$video = "AGP 4X 2.0 Slot";
$expansion = "1 AGP Slot<br/>3 PCI Slots";
$part_numbers = "244759-XXX";
$add_images = "frontpanel.jpg";
$ai_descript = "Front Panel Diagram";
$models = "<b>Compaq</b> - <i>5420US</i>";
$board = "an OEM FIC AZ31 motherboard";
$notes = "Compaq";
$f_link = "/forum/viewtopic.php?t=528";
include ('./../../includes/header2.inc');
include ('./../../includes/template1.tpl');
?>
header2.inc code:
Code:
<!doctype html public "-//W3C//DTD HTML 4.0 transitional//EN">
<html>
	<head>

		<title><?php echo($meta_title);?></title>
		<meta name="description" content="<?php echo($content1);?>" />
        <meta http-equiv="Content-Type" content="text/html; charset="iso-8859-1"/>
        <meta name="keywords" content="<?php echo($content2);?>" />
        <meta name="author" content="Toby Bibeau" /> 
        <meta name="robots" content="All" />
		<link rel="stylesheet" href="/common/compaq_style.css" type="text/css">
</head>

<body bgcolor=#000000>
<table border="0" width="100%" cellspacing="0" valign="top">
<tr>
<td width=2 bgcolor="#ffffff">
&nbsp;
</td>
<td width="550" height=150 bgcolor="#ffffff" valign=top>
	<br>
     
       <div class="#contentheader; float: center;"><b><?php echo($page_name);?></b></div>
template1.tpl code:
Code:


       <hr>



<table style="border: 1px solid black;	border-collapse: collapse; padding: 0; margin: 0; background-color: transparent; float: left;	width: 40%;	height: 20;">
       <th style="background-color: #D3D3D3; text-align: center; font-size: 12px; font color: white; padding: 0;">Image</th>

<tr><td><center><?php
$imgpath = "./../../common/noimage.jpg";
?>
<a href="<?php if ($image == false) { 
   echo ($imgpath);
 
} else if ($image == true) { 
   echo ($image); 
   } 
;?>" target="__new">
<img src="<?php if ($image == false) { 
   echo ($imgpath);
 
} else if ($image == true) { 
   echo ($image); 
   } 
;?>" border="0" height="<?php if ($size == false) {
	echo "125";
} else if ($size == true) {
	echo ($size);
}
?>">
</a>
</center>
</td>
</tr>

</table>



<table valign="top" style="border: 0px; background color: transparent; float: right; width: 58%;">
<tr><td class=submenuheading><p align="left">
	<table class="tablestuff" width="100%" border="0" cellspacing="0" cellpadding="0" valign="top">
	<tr>
	<td colspan="2"><b>Supported Processors: </b>
	</td>
	<td>
	</td>
	</tr>
	<td>
	</td>
	<td colspan="2">
	<?php 
	if ($processors == false) {
		echo "Unknown";
} else if ($processors == true) {
	echo($processors);
}
?>	
	</td>
	</tr>

	<tr>
	<td colspan="2"><b>Bus: </b>
	</td>
	<td>
	</td>
	</tr>
	<td>
	</td>
	<td colspan="2">
	<?php 
	if ($bus == false) {
		echo "Unknown";
} else if ($bus == true) {
	echo($bus);
}
?>
	</td>
	</tr>

	<tr>
	<td colspan="2"><b>Chipset: </b>
	</td>
	<td>
	</td>
	</tr>
	<td>
	</td>
	<td colspan="2">
	<?php 
	if ($chipset == false) {
		echo "Unknown";
} else if ($chipset == true) {
	echo($chipset);
}
?>
	</td>
	</tr>

	<tr>
	<td colspan="2"><b>Memory: </b>
	</td>
	<td>
	</td>
	</tr>
	<td>
	</td>
	<td colspan="2">
	<?php 
	if ($RAM == false) {
		echo "Unknown";
} else if ($RAM == true) {
	echo($RAM);
}?>
	</td>
	</tr>

	<tr>
	<td colspan="2"><b>Video: </b>
	</td>
	<td>
	</td>
	</tr>
	<td>
	</td>
	<td colspan="2">
	<?php 
	if ($video == false) {
		echo "Unknown";
} else if ($video == true) {
	echo($video);
}
?>
	</td>
	</tr>
	<tr>
	<td colspan="2"><b>Audio: </b>
	</td>
	<td>
	</td>
	</tr>
	<td>
	</td>
	<td colspan="2">
	<?php 
	if ($audio == false) {
		echo "Unknown";
} else if ($audio == true) {
	echo($audio);
}
?>
	</td>
	</tr>
	<tr>
	<td colspan="2"><b>Expansion: </b>
	</td>
	<td>
	</td>
	</tr>
	<td>
	</td>
	<td colspan="2">
	<?php 
	if ($expansion == false) {
		echo "Unknown";
} else if ($expansion == true) {
	echo($expansion);
}
?>
	</td>
	</tr>

	<tr>
	<td colspan="2"><b>Part Number(s): </b>
	</td>
	<td>
	</td>
	</tr>
	<td>
	</td>
	<td colspan="2">
	<?php 
	if ($part_numbers == false) {
		echo "Unknown";
} else if ($part_numbers == true) {
	echo($part_numbers);
}
?>
	</td>
	</tr>

	<tr>	
	<td width="10%">	
	</td>
	<td>
	</td>
	<td width="10%">	
	</td></tr></table>





</td></tr></table>



</td>


</tr>
<tr>
<td width="2" bgcolor="#ffffff">
&nbsp;
</td>
<td bgcolor="#ffffff" valign="top">
<p align="left">
<b>Additional Images:</b><br>
<?php 
if ($add_images == False) { 
   echo "None"; 
} else if ($add_images == True) { 
   echo "<a href=".htmlentities($add_images).">$ai_descript</a>"; 
} if ($add_images2 == false) {
	stop;
} else if ($add_images2 == True) {
   echo "<br/><a href=".htmlentities($add_images2).">$ai_descript2</a>"; 
} if ($add_images3 == false) {
	stop;
} else if ($add_images3 == True) {
   echo "<br/><a href='.htmlentities($add_images3).'>$ai_descript3</a>"; 
}
?>
</p>


<br>

<p align="left">
<b>Found in the following systems:</b><br>
<?php 
	if ($models == false) {
		echo "Not availible at this time.";
} else if ($models == true) {
	echo($models);
}
?>
</p>


<br>
<p align="left">
<b>Maintenance and Service Guide:</b><br>
<?php 
if ($b_docs == false) { 
   echo "None"; 
} else if ($b_docs == true) { 
   echo "<a href='".htmlentities($bdocs)."'>$bdocs_descript</a>"; 
   } 
?>
</p>


<br>
<p align="left">
<b>Retail Board:</b><br>
<?php 
if ($board ==false) {
 echo "This is board has not been identified from any retail line.";
} else if ($board == true) {
	echo "This is $board";
}
?>.<br/>
<?php 
if ($rlink == False) { 
   echo "There is no retail information availible"; 
} else if ($rlink == True) { 
   echo "<a href=".htmlentities($rlink).">$rlink</a>"; 
} if ($rlink2 == false) {
	stop;
} else if ($rlink2 == True) {
   echo "<br/><a href=".htmlentities($rlink2).">$rlink_descript2</a>"; 
}
?>
</p>


<br>

       <p align="left"><b>Notes:</b><br>         The bios program has been altered to a <?php echo($notes);?> specific version. It is not recommended to flash back to the original. If anyone does this successfully please notify us by <a href="/contact.html">email</a>. </p>
       
       <p align="left"><b> - </b>         <a href="<?php echo($f_link);?>">Discuss this page</a>. </p>

</td>
</tr>



</table>
</body>
</html>
thesawmillguy is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Reply     « Reply to Code cleanup
 

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.37068 seconds with 12 queries