Page 1 of 1

html image in php

Posted: Sat Nov 08, 2003 5:29 pm
by duranike
why is this page being pulled up blank?


Code: Select all

<?php
//short variables
$submit = $_POST['submit'];
$username = $_POST['alias'];
$serial = $_POST['serial'];

$host = '*********';
$dbusername = '*********';
$dbpass = '*********';
$dbname = '*********';

	if (!$username || !$serial)
	{
		echo "<table border="1"> 
		<tr> 
			<td> 
				</td> 
					<td> 
			<img src="http://www.go-l.com/_images/error_fill_user_serial.gif"> 
				</A></td> 
				</tr> 
			</table> 
		"; //End ech
	}
	else
	{
		$conn = mssql_connect($host, $dbusername, $dbpass) or die('Error: MSSQL 
connection');
		mssql_select_db($dbname) or die('Error: Database Selection');
		$query = "SELECT * FROM support_101 where alias = '$username' AND serial = 
'$serial' ";
		$result = mssql_query($query) or die('Error: Query');
		$num_rows = mssql_num_rows($result);
		if ($num_rows > 0)
		{
			mssql_close($conn);
			require_once 'hollywood.php';
			header ('Location: http://www.go-l.com/support/hollywood.php');
		}
		else
		{
			echo 'Your username and/or serial number do not match our records. Please try again.';
			exit;
		}
	}
		$sql = "SELECT ALIAS FROM support_101 WHERE ALIAS='$ALIAS'";
		$sql_result = mssql_query($sql, $connection)
		or die ("Couldn't execute query.");
?>
[Admin Edit: tags added for clarity.][/b]

Posted: Sat Nov 08, 2003 5:44 pm
by SBukoski
First, it would be wise to use the code tags so it is easier for people to read your code. Also, indentation helps, at least for me.

Does the image actually exist? One of the things I always do when I see a blank page is view the source. Sometimes doing that helps me figure out what I was doing wrong.

Posted: Sat Nov 08, 2003 5:51 pm
by duranike
sorry. yeah the image exists. any help anyone?

Code: Select all

<?php
//short variables
$submit = $_POST&#1111;'submit'];
$username = $_POST&#1111;'alias'];
$serial = $_POST&#1111;'serial'];

$host = ################;
$dbusername = '################';
$dbpass = '1################';
$dbname = '################]';

	if (!$username || !$serial)
	&#123;
		echo "<table border="1"> 
		<tr> 
			<td> 
				</td> 
					<td> 
			<img src="http://www.go-l.com/_images/error_fill_user_serial.gif"> 
				</A></td> 
				</tr> 
			</table> 
		"; //End ech
	&#125;
	else
	&#123;
		$conn = mssql_connect($host, $dbusername, $dbpass) or die('Error: MSSQL 
connection');
		mssql_select_db($dbname) or die('Error: Database Selection');
		$query = "SELECT * FROM support_101 where alias = '$username' AND serial = 
'$serial' ";
		$result = mssql_query($query) or die('Error: Query');
		$num_rows = mssql_num_rows($result);
		if ($num_rows > 0)
		&#123;
			mssql_close($conn);
			require_once 'hollywood.php';
			header ('Location: http://www.go-l.com/support/hollywood.php');
		&#125;
		else
		&#123;
			echo 'Your username and/or serial number do not match our records. Please try again.';
			exit;
		&#125;
	&#125;
		$sql = "SELECT ALIAS FROM support_101 WHERE ALIAS='$ALIAS'";
		$sql_result = mssql_query($sql, $connection)
		or die ("Couldn't execute query.");
?>

Posted: Sat Nov 08, 2003 9:07 pm
by qads

Code: Select all

<?php
//short variables 
$submit = $_POST['submit']; 
$username = $_POST['alias']; 
$serial = $_POST['serial']; 

$host = ################; 
$dbusername = '################'; 
$dbpass = '1################'; 
$dbname = '################]'; 

   if (!$username || !$serial) 
   { 
      echo "<table border="1"> 
      <tr><td><img src="http://www.go-l.com/_images/error_fill_user_serial.gif"></td> 
            </tr></table>"; //End ech 
   } 
   else 
   { 
      $conn = mssql_connect($host, $dbusername, $dbpass) or die('Error: MSSQL 
connection'); 
      mssql_select_db($dbname) or die('Error: Database Selection'); 
      $query = "SELECT * FROM support_101 where alias = '$username' AND serial = 
'$serial' "; 
      $result = mssql_query($query) or die('Error: Query'); 
      $num_rows = mssql_num_rows($result); 
      if ($num_rows > 0) 
      { 
         mssql_close($conn); 
         require_once 'hollywood.php'; 
         header ('Location: http://www.go-l.com/support/hollywood.php'); 
      } 
      else 
      { 
         echo 'Your username and/or serial number do not match our records. Please try again.'; 
         exit; 
      } 
   } 
      $sql = "SELECT ALIAS FROM support_101 WHERE ALIAS='$ALIAS'"; 
      $sql_result = mssql_query($sql, $connection) 
      or die ("Couldn't execute query."); 
?>
give this a try...you have some extra tags in your html code.