I need the PHP code to display in the proper place in a table
<?php
mysql_connect("localhost", "root", "") or die(mysql_error());
mysql_select_db("ginsoft");
/* TO CREATE DATABASE
CREATE DATABASE `ginsoft` ; */
/* T0 CREATE TABLE
CREATE TABLE `ginsoft`.`movie` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`title` VARCHAR( 100 ) NOT NULL ,
`image` LONGBLOB NOT NULL ,
`FileType` varchar(32) DEFAULT NULL,
`note` LONGTEXT NOT NULL ,
`link1` LONGTEXT NOT NULL ,
`link2` LONGTEXT NULL ,
`link3` LONGTEXT NULL ,
`link4` LONGTEXT NULL ,
`link5` LONGTEXT NULL ,
PRIMARY KEY ( `id` )
) ENGINE = MYISAM */
?>
<head>
<title>testing</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!-- ImageReady Slices (Untitled-1) -->
<table id="Table_01" width="181" height="166" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<img src="http://www.webmasterforums.com/images/corner1.gif" width="11" height="26" alt=""></td>
<td background="http://www.webmasterforums.com/images/title.gif"> Title should be printed here </td>
<td>
<img src="http://www.webmasterforums.com/images/corner2.gif" width="13" height="26" alt=""></td>
</tr>
<tr>
<td>
<img src="http://www.webmasterforums.com/images/side1.gif" width="11" height="82" alt=""></td>
<td background="http://www.webmasterforums.com/images/image.gif">The image should be printed here </td>
<td>
<img src="http://www.webmasterforums.com/images/side2.gif" width="13" height="82" alt=""></td>
</tr>
<tr>
<td>
<img src="http://www.webmasterforums.com/images/corner3.gif" width="11" height="58" alt=""></td>
<td background="http://www.webmasterforums.com/images/link.gif">The link should be printed here </td>
<td>
<img src="http://www.webmasterforums.com/images/corner4.gif" width="13" height="58" alt=""></td>
</tr>
</table>
<!-- End ImageReady Slices -->
</body>
</html>
<?
/* THE INSERT QUERY
<?php
if ($_POST['Submit']) {
if ($_POST['MAX_FILE_SIZE'] >= $_FILES['file']['size']) {
//print_r($_FILES);
mysql_connect("localhost", "root", "") or die(mysql_error());
mysql_select_db("ginsoft");
$title = $_POST['txtTitle'];
$link1 = $_POST['txtLink1'];
$link2 = $_POST['txtLink2'];
$link3 = $_POST['txtLink3'];
$link1 = $_POST['txtLink4'];
$link2 = $_POST['txtLink5'];
$photo = addslashes(fread(fopen($_FILES['file']['tmp_name'], "r"),
$_FILES['file']['size']));
$query = sprintf("INSERT INTO movie(title, image, filetype, link1, link2, link3, link4, link5)VALUES
('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s')", $title, $photo, $_FILES['file']['type'], $note, $link1, $link2, $link3, $link4, $link5);
if (mysql_query($query)) {
$messages[] = "Your post has been sent to the admin desk";
} else {
$messages[]= mysql_error();
}
} else {
$messages[]="The file is bigger than the allowed size please resize";
}
}
?>
<table>
<form action="" method="post" enctype="multipart/form-data" name="form1">
<tr><td>Title</td><td><input type="text" name="txtTitle"></td></tr>
<tr><td>Image</td><td><input type="file" name="file">
<input type="hidden" name="MAX_FILE_SIZE" value="96000"></td></tr>
<tr><td>Note</td><td><textarea name="txtNote" rows="2" cols="110"></textarea></td></tr>
<tr><td>Link</td><td>
<input type="text" name="txtLink1">
<input type="text" name="txtLink2">
<input type="text" name="txtLink3">
<input type="text" name="txtLink4">
<input type="text" name="txtLink5">
<tr><td></td><td align="right"><input type="submit" name="Submit" value="Submit" onClick="return checkme();"></td></tr>
</form></table> */
?>
In this every row should have the table with the proper images and page should be limited with 10 rows
kindly help me with this.
Your help will save my time and improve my knowledge.
thanks a lot
Last edited by vginov : 03-23-2008 at 03:23 AM.
|