include:
Code: Select all
<?php
function arial_2 ($texi)
{
echo "<FONT FACE="ARIAL" SIZE="2" color="#1c651c">" . $texi . "</FONT>";
}
function showerror()
{
arial_2("Error " . mysql_errno() . " : " . mysql_error());
die();
}
function image_reduce( $to_be_reduced )
{
$temp_image = @ imagecreatefromjpeg ( $to_be_reduced );
$orig_width = imagesx( $temp_image );
$orig_height = imagesy( $temp_image );
if (($orig_width > 100 ) || ($orig_height > 120 ))
{
$ratio = (real)( $orig_height / $orig_width );
$new_height = 120; $new_width = (int)(120 / $ratio );
$new_image = imagecreate ( $new_width, $new_height ) ;
imagecopyresized ( $new_image , $temp_image , 0, 0, 0, 0, $new_width, $new_height, $orig_width, $orig_height);
header("Content-type: image/jpeg");
imagejpeg ( $new_image );
return true;
}
else return false;
}
?>Code: Select all
<?php
session_start();
include 'includes.php';
?>
<HTML>
<HEAD>
<META NAME="KEYWORDS" CONTENT="lukacsovics">
<TITLE>Test</TITLE>
</HEAD>
<BODY>
<?php
echo"<TABLE>"; //THIS IS A SPACER TABLE!
echo"<TR HEIGHT="50">";
echo"<TD WIDTH="150">";
echo"</TR></TABLE>";
echo"<TABLE BORDER="1" BORDERCOLOR="#003366" CELLSPACING="0" CELLPADDING="4">";
echo"<TR VALIGN="CENTER" HEIGHT="20"><TD ALIGN="LEFT" WIDTH="180">";
arial_2("Database selected to view : ");
echo"</TD><TD ALIGN="LEFT" WIDTH="150">"; arial_2($db_sel); echo"</TD></TR>";
echo"<TR VALIGN="CENTER"><TD VALIGN="CENTER" ALIGN="LEFT">";
arial_2("Table selected to view : ");
echo"</TD><TD ALIGN="LEFT">"; arial_2($tab_select); echo"</TD></TR>";
echo"<TR><TD ALIGN="LEFT">";
arial_2("Message : ");
echo"</TD>";
if (!($connection = mysql_connect($server,$login,$pwd)))
{
echo "<TD>";arial_2("Could not Connect!"); echo"</TD></TR>";
showerror();
}
echo"<TD ALIGN="LEFT">";
arial_2("Connection Established");
echo"</TD></TR>";
mysql_select_db($db_sel);
$query = "SELECT * FROM " . $tab_select;
$result = mysql_query( $query );
$fields = mysql_num_fields( $result );
$table = mysql_field_table ( $result , 0 );
$rows = mysql_num_rows( $result ); // get the number of rows in the table
echo"<TR VALIGN="CENTER"><TD VALIGN="CENTER" ALIGN="LEFT">";
arial_2("Number of columns : ");
echo"</TD><TD ALIGN="LEFT">"; arial_2($fields); echo"</TD></TR>";
echo"<TR><TD ALIGN="LEFT">"; arial_2("No. of records : "); echo"</TD>";
echo"<TD ALIGN="LEFT">"; arial_2($rows); echo"</TD></TR>";
echo"</TABLE>";
echo" ";
echo"<TABLE BORDER="1" BORDERCOLOR="#003366" CELLSPACING="1" CELLPADDING="4">";
echo"<TR>";
for( $i=0 ; $i< $fields ; $i++)
{ echo "<TD>";
arial_2(mysql_field_name( $result , $i ));
echo "</TD>";
}
echo"</TR>";
while ( $row = @ mysql_fetch_array ( $result ))
{
echo"<TR>";
for( $i=0 ; $i< $fields ; $i++)
{
echo"<TD>";
if ((mysql_field_type ( $result , $i ) == 'blob'))
if (!image_reduce($rowї$i])) echo"<IMG SRC="" . $rowї$i] . "">"; //no need to reduce image
else image_reduce($rowї$i]);
elseif (mysql_field_type ( $result , $i ) <> 'blob') arial_2($rowї$i]);
}
echo"</TR>";
}
echo"</TABLE>";
mysql_close($connection);
?>
</BODY>
</HTML>Code: Select all
Warning: Cannot add header information - headers already sent by (output started at c:\program files\apache group\apache\htdocs\test\view_table_3.php:11) in c:\program files\apache group\apache\htdocs\test\includes.php on line 28
ÿØÿàJFIFÿþ>CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), default quality ÿÛC $.' ",#(7),01444'9=82<.342ÿÛC 2!!22222222222222222222222222222222222222222222222222ÿÀxZ"ÿÄ ÿĵ}!