Location: PHPKode > scripts > DNP script > admin/new-domain.php
<?PHP
/*
    This file is part of DNP Script, an open source domain portfolio manager.
    Copyright (C) 2011  Robert Picard

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License as
    published by the Free Software Foundation, either version 3 of the
    License, or (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Affero General Public License for more details.

    You should have received a copy of the GNU Affero General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

	// Make sure the user is logged in as the admin
	session_start();
	
	if(!$_SESSION['admin']){
		header('Location: index.php');
		die;
	}
?>

<script>
	function checkDisplay() {
		if (document.forms["add-domain-form"]["display"].checked) {
			document.getElementById("if-display").innerHTML = "<p>Tags:</p><p class=\"description\">Tag your domain with a few comma separated terms.</p><input type=\"text\" name=\"tags\" /><br /><p>Website:</p><p class=\"description\">Is there a website built on this domain?</p><input type=\"checkbox\" name=\"website\" /><br />";
		}
		else {
			document.getElementById("if-display").innerHTML = "";
		}
	}
	
	function checkForSale() {
		if (document.forms["add-domain-form"]["forsale"].checked) {
			document.getElementById("form-price").innerHTML = "<p>Price:</p><p class=\"description\">How much are you looking to sell this domain for?</p><input type=\"text\" name=\"price\" /><br />";
		}
		else {
			document.getElementById("form-price").innerHTML = "";
		}
	}
</script>

<div id="form-message"></div>

<div id="domain-form">
	<form name="add-domain-form" action="action.php" method="post">
		<p>Domain:</p>
		<p class="description">Enter your domain.</p>
		<input type="text" name="domain" required/><br />
		
		<p>Registrar:</p>
		<p class="description">Where is this domain registered?</p>
		<input type="text" name="registrar" required/><br />
		
		<p>Expiry:</p>
		<p class="description">When will the domain expire? <em>YYYY-MM-DD</em></p>
		<input type="date" name="expiry" required/><br />
		
		<p>Price:</p>
		<p class="description">How much are you looking to sell this domain for? Leave this blank if it's not for sale.</p>
		<input type="text" name="price"/><br />
		<br />		
		<input type="submit" name="new-domain"/>
		
	</form>
</div>
Return current item: DNP script