Ik heb een stukken code uit het installatie systeem van WordPress gehaald en geprobeerd om het te implanteren in mijn eigen CMS. Ik krijg het echter niet werkend, ik ben niet de beste in PHP dat jullie dat alvast weten ;)
Deze code gebruik ik:
<?php error_reporting(0);
if (isset($_GET['step']))
$step = $_GET['step'];
else
$step = 0;
function display_header() {
header( 'Content-Type: text/html; charset=utf-8' );
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Craft CMS | Installation</title>
<link rel="stylesheet" type="text/css" href="./cc-install/css/stylesheet.css" />
</head>
<body>
<!--Begin Topheader-->
<div id="topheader">
<div id="logo"><img src="./cc-install/images/transparent.png" border="0" /></div>
</div>
<!--End Topheader-->
<?php
}//End Display header function
switch($step) {
case 0:
display_header();
?>
<!--Begin - Terms of Service Text-->
<h1>Terms of Service</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non magna vel lectus eleifend tincidunt et vitae dolor. Pellentesque et
rhoncus nulla. Ut vel nulla accumsan lectus rutrum congue. Phasellus aliquet euismod imperdiet. Sed non tincidunt nulla. Proin sed massa
erat. Nulla semper, est vel placerat imperdiet, mauris tellus mollis tellus, id lacinia libero metus non eros. Phasellus nec ipsum mattis
risus malesuada pharetra. Aliquam vitae mauris turpis. Donec elementum, est et venenatis dapibus, purus magna lacinia odio, sed lacinia
sem enim a dolor. Donec venenatis tristique quam nec convallis. Praesent in nunc quis mi luctus molestie. Integer non odio sed est facilisis
posuere posuere ut mi.</p>
<!--End - Terms of Service Text-->
<p class="step"><a href="setup-config.php?step=1<?php if ( isset( $_GET['noapi'] ) ) echo '&noapi'; ?>" class="button">Let’s go!</a></p>
<?php
break;
case 1:
display_header();
?>
<form method="post" action="installation-config.php?step=2">
<p>Below you should enter your database connection details. If you're not sure about these, contact your host. </p>
<table class="form-table">
<tr>
<th scope="row"><label for="dbname">Database Name</label></th>
<td><input name="dbname" id="dbname" type="text" size="25" value="wordpress" /></td>
<td>The name of the database you want to run WP in. </td>
</tr>
<tr>
<th scope="row"><label for="uname">User Name</label></th>
<td><input name="uname" id="uname" type="text" size="25" value="username" /></td>
<td>Your MySQL username</td>
</tr>
<tr>
<th scope="row"><label for="pwd">Password</label></th>
<td><input name="pwd" id="pwd" type="text" size="25" value="password" /></td>
<td>...and your MySQL password.</td>
</tr>
<tr>
<th scope="row"><label for="dbhost">Database Host</label></th>
<td><input name="dbhost" id="dbhost" type="text" size="25" value="localhost" /></td>
<td>You should be able to get this info from your web host, if <code>localhost</code> does not work.</td>
</tr>
<tr>
<th scope="row"><label for="prefix">Table Prefix</label></th>
<td><input name="prefix" id="prefix" type="text" value="wp_" size="25" /></td>
<td>If you want to run multiple WordPress installations in a single database, change this.</td>
</tr>
</table>
<?php if ( isset( $_GET['noapi'] ) ) { ?><input name="noapi" type="hidden" value="true" /><?php } ?>
<p class="step"><input name="submit" type="submit" value="Submit" class="button" /></p>
</form>
</body>
</html>
1.578 views