[ create a new paste ] login | about

Link: http://codepad.org/bAHqvQr5    [ raw code | output | fork ]

PHP, pasted on Dec 14:
<?php
//include_once "library/seslogin.php";
include_once "library/connection.php";
include_once "library/library.php";

$name	=$_POST['name'];
$today	=date("Ymd");

$query1 = "SELECT max(id) as maxid FROM id_unik WHERE id LIKE '$today%'";
$hasil = mysql_query($query1);
$data = mysql_fetch_array($hasil);
$maxid = $data['maxid'];

$nourut = (int) substr($maxid, 8, 4);
$nourut++;

$newid = $today .sprintf('%04s', $nourut);

?>
<link href="styles/style.css" rel="stylesheet" type="text/css">
<link href="styles/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<link href="plugins/tigra_calendar/tcal.css" rel="stylesheet" type="text/css" />
<div style="padding: 0 15px">
	<div class="table-responsive">
		<table class="table-bordered">
		<form>
			<tr>
				<td>Name</td>
				<td>:</td>
				<td><input type="text" name="name" id="name" placeholder="Input Your Name Here"></td>
			</tr>
			<tr>
				<td>Code</td>
				<td>:</td>
				<td><input type="text" name="code" id="code" value="<?php echo $newid; ?>"></td>
			</tr>
			<tr>
				<td colspan="3" align="center"><input type="submit" name="submit" value="Save"></td>
			</tr>
		</form>
		</table>
	</div>
</div>


Output:
1
2
3
4
5
6
7
8
9
10

Warning: include_once(library/connection.php): failed to open stream: No such file or directory on line 3

Warning: include_once(): Failed opening 'library/connection.php' for inclusion (include_path='.:/usr/lib/php') on line 3

Warning: include_once(library/library.php): failed to open stream: No such file or directory on line 4

Warning: include_once(): Failed opening 'library/library.php' for inclusion (include_path='.:/usr/lib/php') on line 4

Fatal error: Call to undefined function mysql_query() on line 10


Create a new paste based on this one


Comments: