EdwardJ Posted December 2, 2008 Share Posted December 2, 2008 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 https://forums.phpfreaks.com/topic/135210-solved-html-output-does-not-show-in-browser/ Share on other sites More sharing options...
flyhoney Posted December 2, 2008 Share Posted December 2, 2008 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); ?> Link to comment https://forums.phpfreaks.com/topic/135210-solved-html-output-does-not-show-in-browser/#findComment-704227 Share on other sites More sharing options...
Andy-H Posted December 2, 2008 Share Posted December 2, 2008 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 https://forums.phpfreaks.com/topic/135210-solved-html-output-does-not-show-in-browser/#findComment-704229 Share on other sites More sharing options...
EdwardJ Posted December 2, 2008 Author Share Posted December 2, 2008 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 https://forums.phpfreaks.com/topic/135210-solved-html-output-does-not-show-in-browser/#findComment-704237 Share on other sites More sharing options...
haddydaddy Posted December 2, 2008 Share Posted December 2, 2008 connection.php change: if(!$connection){ Link to comment https://forums.phpfreaks.com/topic/135210-solved-html-output-does-not-show-in-browser/#findComment-704242 Share on other sites More sharing options...
EdwardJ Posted December 2, 2008 Author Share Posted December 2, 2008 connection.php change: if(!$connection){ What exactly should I change? sorry for insisting on obvious things, this is my first script Link to comment https://forums.phpfreaks.com/topic/135210-solved-html-output-does-not-show-in-browser/#findComment-704252 Share on other sites More sharing options...
DeanWhitehouse Posted December 2, 2008 Share Posted December 2, 2008 if(!connection){ to if(!$connection){ Link to comment https://forums.phpfreaks.com/topic/135210-solved-html-output-does-not-show-in-browser/#findComment-704258 Share on other sites More sharing options...
EdwardJ Posted December 2, 2008 Author Share Posted December 2, 2008 well i guess we newbies, make those kinds of mistakes! sorry... and thank you all for helping Link to comment https://forums.phpfreaks.com/topic/135210-solved-html-output-does-not-show-in-browser/#findComment-704263 Share on other sites More sharing options...
haddydaddy Posted December 2, 2008 Share Posted December 2, 2008 No problem Edward, We all start somewhere Link to comment https://forums.phpfreaks.com/topic/135210-solved-html-output-does-not-show-in-browser/#findComment-704300 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.