[Last Call] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 446
  • Last Modified:

php: page not displaying anything

Hi all,

I have added some code to my page and all the text had gone:

Imusing ezmysql to connect to my database and the sites text has gone :http://runningprofiles.com/index.php

I have included my php page here<?php include('Include/Connection_to_db.php'); ?> in header.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >

<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-type" content="text/html;charset=UTF-8"/>
    <title>Running Profiles</title>
   <link href="rp.css" rel="stylesheet" type="text/css" />
	<?php include('Include/Connection_to_db.php'); ?>
<div id="header_container">
    <div id="header">
  <div id="titlehead">
Running Profiles   <div id="loginbutton" style="float:right;"> Login </div>
<div id="content">
<div id="content2">

Open in new window

but when adding the following code (which is Connect_to_mysql.php the page goes blank
ini_set('error_reporting', E_ALL);
include_once "../Mysql/ez_sql_core.php";
include_once "../Mysql/ez_sql_mysql.php";
$db = new ezSQL_mysql('username','password','table','localhost');

Open in new window

  • 4
1 Solution
John MoshayemCommented:

I think you are new to PHP.
Do you see this link? http://runningprofiles.com/Include/Connection_to_db.php
its connected to your sql but have no result.

about blank page you must debug your code by turning the error reporting on or using $echo to solve step by step...

And I should tell you about security, your website security is weak! just try the
' OR 1='1

Open in new window

in your index page as username and password, or also but single

Open in new window

in username and password field to see your security is very weak. I test only in a second,so maybe your website have a other security issues.
Ray PaseurCommented:
... when adding the following code ... the page goes blank
This is a symptom of having an error, but having too low a level of error_reporting().  Production servers that do not expect errors use this technique to avoid exposing information that clients (and hackers) should not see.

You have some choices to locate the error.  You can add these lines of code to the top of the PHP scripts that you're testing:

ini_set('log_errors', TRUE);
ini_set('display_errors', TRUE);

Open in new window

You can also set these options in the php_ini file.

One workable solution I've used when I've been forced to work on poorly designed sites that were not subject to automated testing is to leave the display off and set the error_log on.  Then when the error_log file appears in the directories, I know I've gotten something that needs attention.  I don't recommend this for general use, but it's been an expedient way to deal with older sites.
Ray PaseurCommented:
You might also want to spend a little time with this article.  In my opinion it's much easier to understand the basic technologies than it is to implement the abstraction layer, such as EZ-SQL.  You can be fairly sure that PHP and the extensions work correctly and are well-documented.  Not so sure about software that puts a donation begger into your web pages!

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

runnerjp2005Author Commented:
Hi Ray - taking in you suggestion wuld this site be a good place to start then http://codular.com/php-mysqli
Ray PaseurCommented:
That article looks pretty good to me.  There are some examples in the E-E article, too.
Ray PaseurCommented:
Thanks for the points and thanks for using E-E, ~Ray

Featured Post

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now