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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.