Jump to content

[SOLVED] HTML output does not show in browser


EdwardJ

Recommended Posts

I have the following page:

<HTML>
<HEAD>
<TITLE>Calzado Van Vien</TITLE>
</HEAD>
<BODY>
<TABLE>
<form action="new_user.php" method="post">
<tr>
<td>Nombre de usuario:</td><td><input type="text" name="username" maxlength="30"></td>
</tr>
<tr>
<td>Contraseña: </td><td><input type="password" name="password" maxlength="30"></td>
</tr>
<tr>
<td>Re-escribir contraseña: </td><td><input type="password" name="repassword" maxlength="30"></td>
</tr>
<tr>
<td>Nombre: </td><td><input type="text" name="nombre" maxlength="30"></td>
</tr>
<tr>
<td>Apellido: </td><td><input type="text" name="apellido" maxlength="30"></td>
</tr>
<tr>
<td>Correo electronico: </td><td><input type="text" name="email" maxlength="30"></td>
</tr>
<tr>
<td>Nivel de usuario: </td><td><select name="userlevel">
	<?php 
		$query = "SELECT userlevel FROM user_levels ORDER BY userlevel_id ASC";
		if (!$query) die("Error in query". mysql_error());
		$result = mysql_query($query);
		while ($row = mysql_fetch_array($result)){
			echo "<option value= \"".$row['userlevel']."\">".$row['userlevel']."</option>";
		}
		echo "</select></td>";
	?>
</tr>
<tr><td><input type="submit" name="submit" value="Aceptar"></td></tr>

</form>
</TABLE>
</BODY>
</HTML>

 

This comes after:

 

<?php require_once("includes/session.php"); ?>
<?php require_once("includes/connection.php"); ?>
<?php require_once("includes/functions.php"); ?>
<?php confirm_logged_in(); ?>
<?php
include_once("includes/form_functions.php");
        //some code
?>

 

my problem is the html does not display in the browser, no table, form or anything.

 

Thanks

I have the following page:

<?php require_once("includes/session.php"); ?>
<HTML>
<HEAD>
<TITLE>Calzado Van Vien</TITLE>
</HEAD>
<BODY>
<TABLE>
<form action="new_user.php" method="post">
   <tr>
   <td>Nombre de usuario:</td><td><input type="text" name="username" maxlength="30"></td>
   </tr>
   <tr>
   <td>Contraseña: </td><td><input type="password" name="password" maxlength="30"></td>
   </tr>
   <tr>
   <td>Re-escribir contraseña: </td><td><input type="password" name="repassword" maxlength="30"></td>
   </tr>
   <tr>
   <td>Nombre: </td><td><input type="text" name="nombre" maxlength="30"></td>
   </tr>
   <tr>
   <td>Apellido: </td><td><input type="text" name="apellido" maxlength="30"></td>
   </tr>
   <tr>
   <td>Correo electronico: </td><td><input type="text" name="email" maxlength="30"></td>
   </tr>
   <tr>
   <td>Nivel de usuario: </td><td><select name="userlevel">
      <?php 
         $query = "SELECT userlevel FROM user_levels ORDER BY userlevel_id ASC";
         if (!$query) die("Error in query". mysql_error());
         $result = mysql_query($query);
         while ($row = mysql_fetch_array($result)){
            echo "<option value= "".$row['userlevel']."">".$row['userlevel']."</option>";
         }
         echo "</select></td>";
      ?>
   </tr>
   <tr><td><input type="submit" name="submit" value="Aceptar"></td></tr>
   
</form>
</TABLE>
</BODY>
</HTML>

 

This comes after:

 

<?php require_once("includes/connection.php"); ?>
<?php require_once("includes/functions.php"); ?>
<?php confirm_logged_in(); ?>
<?php
   include_once("includes/form_functions.php");
        //some code
?>

 

my problem is the html does not display in the browser, no table, form or anything.

 

Thanks

Add this at the top of your script

<?php
// Report all PHP errors
error_reporting(E_ALL);

// Same as error_reporting(E_ALL);
ini_set('error_reporting', E_ALL);
?>

 

I got " Notice: Use of undefined constant connection - assumed 'connection' in C:\wamp\www\vanvien\includes\connection.php on line 5

 

Notice: Undefined variable: header in C:\wamp\www\vanvien\includes\functions.php on line 22"

 

here are those files:

 

session.php

<?php

session_start();

function logged_in(){
return isset($_SESSION['user_id']);
}


function confirm_logged_in(){
if(!logged_in()){
	redirect_to("index.php");
}
}

?>

 

connection.php

<?php
require("constants.php");

$connection = mysql_connect(DB_SERVER, USER, PASS);
if(!connection){
die("No es posible conectar a la base de datos." . mysql_error());
}

$selection = mysql_select_db(DB, $connection);
if(!$selection){
die("No es posible accesar a la base de datos" . mysql_error());
}

?>

 

Thank you very much

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.