PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
duranike
Forum Newbie
Posts: 17 Joined: Tue Nov 04, 2003 8:40 pm
Post
by duranike » Sat Nov 08, 2003 5:29 pm
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]
SBukoski
Forum Contributor
Posts: 128 Joined: Wed May 21, 2003 10:39 pm
Location: Worcester, MA
Post
by SBukoski » Sat Nov 08, 2003 5:44 pm
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.
duranike
Forum Newbie
Posts: 17 Joined: Tue Nov 04, 2003 8:40 pm
Post
by duranike » Sat Nov 08, 2003 5:51 pm
sorry. yeah the image exists. any help anyone?
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>
</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.");
?>
qads
DevNet Resident
Posts: 1199 Joined: Tue Apr 23, 2002 10:02 am
Location: Brisbane
Post
by qads » Sat Nov 08, 2003 9:07 pm
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.