Location: PHPKode > scripts > Rockin Rounded Corners > rockin-rounded-corners/roundedcorners.php
<?php
	include('roundcorners/functions.php');
	if ($_GET['id'] != '') {
			if (strlen($_GET['id']) == 1) {
				$zero = '0';
			} else {
				$zero = '';
			}
		$html_content = '
<html>
<head>
<title>Rounded Corner Example</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style>	
	.rrc-table {
		border-collapse:collapse;
		padding:0px;
	}
	.rrc-table td {
		padding:0px;
	}
	.rrc-table .main {
		padding:5px;
		background-image:url(roundcorners/images/' . $zero . $_GET['id'] . '-c.gif);
	}
	.rrc-t {
		background-image:url(roundcorners/images/' . $zero . $_GET['id'] . '-t.gif);
		background-position:top;
		background-repeat:repeat-x;
	}
	.rrc-l {
		background-image:url(roundcorners/images/' . $zero . $_GET['id'] . '-l.gif);
		background-position:left;
		background-repeat:repeat-y;
	}
	.rrc-r {
		background-image:url(roundcorners/images/' . $zero . $_GET['id'] . '-r.gif);
		background-position:right;
		background-repeat:repeat-y;
	}
	.rrc-b {
		background-image:url(roundcorners/images/' . $zero . $_GET['id'] . '-b.gif);
		background-position:bottom;
		background-repeat:repeat-x;
	}
</style>
</head>
<body>
<h1>Rounded Corner Example</h1>
<table class="rrc-table">
	<tr>
		<td><img src="roundcorners/images/01-tl.gif" alt="" /></td>
		<td class="rrc-t"></td>
		<td><img src="roundcorners/images/01-tr.gif" alt="" /></td>
	</tr>
	<tr>
		<td class="rrc-l"></td>
		<td class="main">This is an example of the style you chose.</td>
		<td class="rrc-r"></td>
	</tr>
	<tr>
		<td><img src="roundcorners/images/01-bl.gif" alt="" /></td>
		<td class="rrc-b"></td>
		<td><img src="roundcorners/images/01-br.gif" alt="" /></td>
	</tr>
</table>
<p>Too add rounded corners to other pages on your site, just add the styles from this page to the page you would like to use the corners. Then, copy the table and just change the content of the center cell wherever you want to use the corners.</p>
</body>
</html>';

	$php_content = '
<?php
	function rrcStart($id) {
		if (strlen($id) == 1) {
			$zero = \'0\';
		} else {
			$zero = \'\';
		}
		return \'
			<table class="rrc-table">
				<tr>
					<td><img src="roundcorners/images/\' . $zero . $id . \'-tl.gif" alt="" /></td>
					<td class="rrc-t"></td>
					<td><img src="roundcorners/images/\' . $zero . $id . \'-tr.gif" alt="" /></td>
				</tr>
				<tr>
					<td class="rrc-l"></td>
					<td class="main">\';
	}
	function rrcEnd($id) {
		if (strlen($id) == 1) {
			$zero = \'0\';
		} else {
			$zero = \'\';
		}
		return \'
				</td>
				<td class="rrc-r"></td>
			</tr>
			<tr>
				<td><img src="roundcorners/images/\' . $zero . $id . \'-bl.gif" alt="" /></td>
				<td class="rrc-b"></td>
				<td><img src="roundcorners/images/\' . $zero . $id . \'-br.gif" alt="" /></td>
			</tr>
		</table>\';
	}
?>
<html>
<head>
<title>Rounded Corner Example</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style>	
	.rrc-table {
		border-collapse:collapse;
		padding:0px;
	}
	.rrc-table td {
		padding:0px;
	}
	.rrc-table .main {
		padding:5px;
		background-image:url(roundcorners/images/' . $zero . $_GET['id'] . '-c.gif);
	}
	.rrc-t {
		background-image:url(roundcorners/images/' . $zero . $_GET['id'] . '-t.gif);
		background-position:top;
		background-repeat:repeat-x;
	}
	.rrc-l {
		background-image:url(roundcorners/images/' . $zero . $_GET['id'] . '-l.gif);
		background-position:left;
		background-repeat:repeat-y;
	}
	.rrc-r {
		background-image:url(roundcorners/images/' . $zero . $_GET['id'] . '-r.gif);
		background-position:right;
		background-repeat:repeat-y;
	}
	.rrc-b {
		background-image:url(roundcorners/images/' . $zero . $_GET['id'] . '-b.gif);
		background-position:bottom;
		background-repeat:repeat-x;
	}
</style>
</head>
<body>
<h1>Rounded Corner Example</h1>
<?php echo rrcStart(' . $_GET['id'] . '); ?>
This is an example of the style you chose.
<?php echo rrcEnd(' . $_GET['id'] . '); ?>
<p>Too add rounded corners to other pages on your site, just add the styles from this page to the page you would like to use the corners. Then, add the php functions on this page to the page. Finaly, just use the functions included to start and ended rounded corner tables whenever you want to wrap them around something.</p>
</body>
</html>';
	
		$html_textarea = '<textarea rows="4" cols="30" name="html_content" onclick="this.form.html_content.select()"> ' . $html_content . '</textarea>';
		$php_textarea = '<textarea rows="4" cols="30" name="php_content" onclick="this.form.php_content.select()">' . $php_content . '</textarea>';
		$content = '
		<div class="code-div">
		<form>
			<table class="align-center wide">
				<tr>
					<td class="half-width"><strong>HTML Code:</strong><br />' . $html_textarea . '</td>
					<td class="half-width"><strong>PHP Code:</strong><br />' . $php_textarea . '</td>
				</tr>
			</table>
		</form>
		
		<div class="download-div"><a href="roundcorners/roundcorners.zip">Download Images</a></div>
		<h2>Instructions</h2>
		<ol>
			<li>First, click the "Download Images" button to download the rounded corner images. This contains all of the styles. Unzip it and put the folder in your web sites main directory.</li>
			<li>Next, click the text box under either "HTML Code" or "PHP Code" to select the code. The PHP code uses a nice little function that is easier to look at than the entire HTML table, but both are just as functional.</li>
			<li>Copy the code by clicking CTL+C.</li>
			<li>Paste the code into a blank web page, save it, upload it and visit it online to make sure it works.</li>
			<li>To use the rounded corners on other pages, just follow the instructions on that page. Basically, you will just be copying the CSS styles and the code, either HTML or PHP, into each page you use the rounded corners.</li>
			<li>To improve search engine optimization and overall ease, paste the styles into an external stylesheet, and the PHP functions into a global header of some kind. That way, if you need to change them later, you just have one file to deal with.</li>
		</ol>
		</div>
		';
		
	}
	
	function rrcStart($id) {
		if (strlen($id) == 1) {
			$zero = '0';
		} else {
			$zero = '';
		}
		return '
			<table class="rrc-table">
				<tr>
					<td><img src="roundcorners/images/' . $zero . $id . '-tl.gif" alt="" /></td>
					<td class="rrc-t"></td>
					<td><img src="roundcorners/images/' . $zero . $id . '-tr.gif" alt="" /></td>
				</tr>
				<tr>
					<td class="rrc-l"></td>
					<td class="main">';
	}
	function rrcEnd($id) {
		if (strlen($id) == 1) {
			$zero = '0';
		} else {
			$zero = '';
		}
		return '
				</td>
				<td class="rrc-r"></td>
			</tr>
			<tr>
				<td><img src="roundcorners/images/01-bl.gif" alt="" /></td>
				<td class="rrc-b"></td>
				<td><img src="roundcorners/images/01-br.gif" alt="" /></td>
			</tr>
		</table>
		';
	}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Rockin' Rounded Corners v.1.0</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="roundcorners/styles.css" rel="stylesheet" type="text/css"></link>
</head>

<body>
<h1 class="align-center">Rockin' Rounded Corners v.1.0</h1>
<div class="corners-div">
<table class="wide">
<tr>
<td class="half-width"></td>
<td>
<?php echo getCornerButtons(18); ?>
</td>
<td class="half-width"></td>
</tr>
</table>
</div>
<div class="main-div">
<?php echo $content; ?>
	<p class="align-center"><strong>Click the round corner style you would like to use.</strong></p>
<br /><br />
<p class="align-center"><a href="http://www.impliedbydesign.com">Web design</a> tools by Implied By Design LLC.</p>
</div>
</body>
</html>
Return current item: Rockin Rounded Corners