You might want to look at "echo"ing your HTML inside your php code.  Seems
more simple to me.

So, what you have here would look like:

<?php
$dbhost = "127.0.0.1";
> $dbuser = "username";
> $dbpass = "password";
> $db = "databssename";
> $LoginDB=@mysql_connect($dbhost, $dbuser, $dbpass);
        or die("Unable to connect to the database server at this time.");
//    the die() function provides the functionality to  // throw a message
        exit;
        echo "<html>
<head> <title>Login Page</title></head>
 <style type=text/css>body { color: white; background: black; }</style>
 <p align="Center"><img src=Banner.png width=666 height=103 alt=D&D
 Resource page border=0></p> <br><br><br><br><form name=Login method=Post
 action=<?echo $PHP_SELF?>> <p align=Center>Login: <input type=text
 name=User Name> Password: <input type=password name=Password><input
 type=submit name=Submit value=Submit</p></form><
 /html>";

?>



----- Original Message -----
From: "Viraj Kalinga Abayarathna" <[EMAIL PROTECTED]>
To: "Shiloh Madsen" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, June 18, 2002 8:03 PM
Subject: RE: [PHP-INST] Windows Install troubles.


> Hi,
> You have done some errornous escapings from
> php in your script. I did some fewer modifications and
> now script is working. Compare the ?>'s <?'s in my script
> and yours. You will get the point.
> remove my comments and save it as filename.php (not
> html)
>
> regards
> Viraj
> www.CeyNet.net
>
>
> //start escape
> <? //start escape here
> $dbhost = "127.0.0.1";
> $dbuser = "username";
> $dbpass = "password";
> $db = "databssename";
> $LoginDB=@mysql_connect($dbhost, $dbuser, $dbpass);
> if (! $LoginDB) {
> ?>//end escape here for the first if block
> //start the html content
> <p>Unable to connect to the database server at this time.</p>
> //end the html content
> //start escape for the else part of the script
> <?exit();
> } else {?>
> //end escape for the else part
> //start html content for the else part
> <html>
> <head> <title>Login Page</title></head>
> <style type="text/css">body { color: white; background: black; }</style>
> <p align="Center"><img src="Banner.png" width="666" height="103" alt="D&D
> Resource
> page" border="0">"</p> <br><br><br><br><form name="Login" method="Post"
> action="<?echo $PHP_SELF?>"> <p align="Center">Login: <input type="text"
> name="User Name"> Password: <input type="password" name="Password"><input
> type="submit" name="Submit" value="Submit"</p></form><
> /html>
> //end html content for the else part
> //start escape for closing bracket for the else part
> <? } ?>
> //end the script
>
>
> -----Original Message-----
> From: Shiloh Madsen [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, June 18, 2002 3:14 AM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: [PHP-INST] Windows Install troubles.
>
>
> Hi all. Im having difficulty getting PHP up and running with my Windows
> system. I am trying to get PHP, Apache and SQL installed and running. I
> installed apache, installed PHP, copied the required DLLs into the
> apache\modules directory, and added the lines to AddModule and
> LoadModule. After doing this, when I try to view a PHP page in my
> browser, it shows the raw code/html behind the page. Any ideas why? Im
> pasting the page in question below this so you can see it.
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
>
> <html>
> <head>
> <title>Login Page</title>
> </head>
> <?php
> $dbhost = "127.0.0.1";
> $dbuser = "root";
> $dbpass = "invictus";
> $db = "LoginInfo";
>
> $LoginDB=@mysql_connect($dbhost, $dbuser, $dbpass);
> if (! $LoginDB) {
> print "<p>Unable to connect to the database server at this time.</p>";
> exit();
> } else {
> ?>
> <style type="text/css">
> body { color: white; background: black; }
> </style>
> <p align="Center"><img src="Banner.png" width="666" height="103" alt="D&D
> Resource Page" border="0">"</p>
> <br><br><br><br>
> <form name="Login" method="Post" action="<?echo $PHP_SELF?>">
> <p align="Center">
> Login: <input type="text" name="User Name">
> Password: <input type="password" name="Password">
> <input type="submit" name="Submit" value="Submit"
> </p>
>
> </form>
>
> <?php
> {
> ?>
>
> </html>
>
>
>
>
> --
> PHP Install Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>
> --
> PHP Install Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to