Username:
Password:
Remember me:
Register

Back to forum: Web Programming (HTML, JS, CSS, PHP, MySQL)


Search forums via Google


0 Users appreciate this thread.

MySQL error
 >  >>
Started by TheAlexRider
(2014-10-22 13:27:14)
TheAlexRider (2014-10-22 13:27:14)
Okay, so today I loaded mysql into my website. I got a blank page...


My connect file:

Spoiler: show
<?php
mysql_connect("sql112.freezoy.com","frzoy_15447585","#####";
mysql_select_db(frzoy_15447585_users)or die("Failed to load"
?>


My header(load)
Spoiler: show
<!doctype html>
<?php include("./inc/connect.inc.php"
?>
<html>
<head>
<title>CreedBook</title>
<link rel="stylesheet" type="text/css" href="./css/style.css" />
</head>
<body>
<div class="headerMenu">
<div id="wrapper">
<div class= "logo">
<img src="./img/logo.png" />
</div>
<div class="search_box">

<FORM action="search.php" method "GET" id="search">
<input type="text" name="q" size="60" placeholder="Click to earch!"

</FORM>
</div>
<div id="menu">
<a href="#" />Home</a>
<a href="#" />About</a>
<a href="#" />Sign Up</a>
<a href="#" />Log in</a>
</div>
</div>
</div>


This post has been edited one or more times, the last time was:
2014-10-22 13:40:49

CoolApps (2014-10-22 18:12:45)
Try:
include("../inc/connect.inc.php"
May have to do the same for the CSS linking.
Newer account: NodePoint
TheAlexRider (2014-10-22 20:30:32)
Im trying, I think its an error in css, I fixed it but now ALL pages are blank.(creedbook.freezoy.com/css/style.css
CoolApps (2014-10-23 15:11:30)
Update the second code to this:


<?php require_once($_SERVER['DOCUMENT_ROOT'].'/inc/connect.inc.php';
?>
<!DOCTYPE html>
<html>
<head>
<title>CreedBook</title>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="/css/style.css">
</head>
<body>
<div class="headerMenu">
<div id="wrapper">
<div class= "logo">
<img src="/img/logo.png" alt="Logo">
</div>
<div class="search_box">
<form action="search.php" method="get" id="search">
<input type="text" name="q" size="60" placeholder="Click to Search!">
</form>
</div>
<div id="menu">
<a href="#">Home</a>
<a href="#">About</a>
<a href="#">Sign Up</a>
<a href="#">Log in</a>
</div>
</div>
</div>
</body>
</html>


I have fully validated your HTML to be HTML5 compilable.
Along with that, I have fixed a few typos and removed some useless things. HTML and CSS don't need the dots to back out a directory; they already go to the root if the first character in the source URL is a forward slash.

Also, I have updated the PHP to grab the file starting from the document root and also make sure it is a requirement so if it fails to read the file then it won't load rest of the content.


Your connection file?:

<?php
mysql_connect('sql112.freezoy.com','frzoy_15447585','#####';
mysql_select_db('frzoy_15447585_users' or die('Failed to load';
?>

This post has been edited one or more times, the last time was:
2014-10-23 15:17:25

Newer account: NodePoint
TheAlexRider (2014-10-23 19:18:18)
^Will try.
CoolApps (2014-10-24 07:07:36)
I would like to point out what the actual issue was.

When selecting the database, you have not used any double or single quotes to indicate that what you're going to put into the function. Because you have not used any, it doesn't know if it is a string, function or whatever so therefore, an error was thrown. I'm not sure if Freezoy has disabled the error_log or not.

I would add the following function to your code to display the errors, make sure it is the VERY first thing on top:
error_reporting(E_ALL);
Newer account: NodePoint
TheAlexRider (2014-10-24 13:17:18)
^The database code yeah?

TheAlexRider (2014-10-24 13:23:52)
Just the CSS isnt showing now...
CoolApps (2014-10-24 15:30:40)
Put the error function on top of your main file before the include, that way you can see the errors.

If you could post a link to the site then I can try to figure out why it isn't working.
Newer account: NodePoint
TheAlexRider (2014-10-24 20:22:43)
http://creedbook.freezoy.com
CoolApps (2014-10-25 19:09:05)
I have not properly looked at this in an actual file but it should fix a few things.
Because the code I'm going to paste is long, I would like to point out the issues found first.
I have found a unclosed part of the code which can be causing an issue. Devices with smaller screens seem to not to be loading some important CSS because the media parts of the code applies code if it is that or possibly larger (I'm talking about the screen size).
Please use the fixed HTML that I've posted for things to work properly.
I'm really busy with a few things so I'm unable to fix some other issues at the monent such as the button not matching the same size as the text fields.

Here we go...



body {
margin: 0px;
padding: 0px;
font-family: Arial, Helvetica, Sans-serif;
font-size: 12px;
background-color: #eff5f9;
}
.headerMenu {
background-image: url(../img/header_bar.png);
height: 56px;
border-bottom: 0px;
padding-left: auto;
padding-right: auto;
width: 100%;
}
#wrapper {
background-image: url(../img/header_bar.png);
margin-left: auto;
margin-right: auto;
width: 1000px;
padding-top: 0px;
}
.logo {
background-image: url(../img/header_bar.png);
width: 125px;


}
.logo img {
background-image: url(../img/header_bar.png);
width: 158px;
height: 38px;
padding-top: 5px;
}
.search_box {
background-image: url(../img/header_bar.png);
position: absolute;
top: 14px;
margin-left: 135px;
padding-top: 5px;
padding-bottom: 5px;

}
#search input[type="text"] {
background-color: #368dcf;
outline:none;
border: 0 none;
font: bold 12px Arial,Helvetica,Sans-serif;
width: 350px;
padding: 9px 15px 9px 35px;
margin: 0px;
text-shadow: 0 2px 2px rgba(0, 0, 0, 3.3);
-webkit-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1) inset;
-webkit-transition: all 0.7s ease 0s;
-moz-transition: all 0.7s ease 0s;
-o-transition: all 0.7s ease 0s;
transition: all 0.7 ease 0s;
border-color: #368dcf;
padding-top: 5px;
padding-bottom: 5px;
}
#search input[type="text"]:focus {
background-color: #368fcb;
color: #6a6f75;
width: 350px;
-webkit-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1) 0 1px 0 rgba(0, 0, 0, 0.9) inset;
-moz-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1) 0 1px 0 rgba(0, 0, 0, 0.9) inset;
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1) 0 1px 0 rgba(0, 0, 0, 0.9) inset;
text-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
}

#menu {
background-image: url(../img/header_bar.png);
position: absolute;
top:0px;
right: 0px;
height: 37px;
padding-top: 19px;
margin-right: 4%;

}
#menu {
background-image: url(../img/header_bar.png);
position: absolute;
top:0px;
right: 0px;
height: 37px;
padding-top: 19px;
margin-right: 6%;
}


#menu a {
color: #FFFFFF;
text-decoration: none;
font-size: 14px;
background-image: url(../img/header_bar.png);
background-repeat: repeat;
padding-top: 19px;
padding-bottom: 33px;
padding-left: 10px;
padding-right: 10px;
padding-bottom: 10px;
}
#menu a hover{
color: #FFFFFF;
background-image: url(../img/hover_bar.png);
}
#menu {
background-image: url(../img/header_bar.png);
position: absolute;
top:0px;
right: 0px;
height: 37px;
padding-top: 19px;
margin-right: 25%;
bottom: 0px;
}

h2 {
font-family: Arial, Helvetica, Sans-serif;
font-size: 18px;
padding: 8px;
color: #0084C6;
}

input[type="text"] {
background-color: #FFFFFF;
border: 1px solid #E2E2E2;
font-size: 15px;
padding: 5px;
width: 300px;
margin-bottom: 3px;
margin-top: 3px;
}

input[type="password"] {
background-color: #FFFFFF;
border: 1px solid #E2E2E2;
font-size: 15px;
padding: 5px;
width: 300px;
margin-bottom: 3px;
margin-top: 3px;
}

input[type="submit"] {
background-color: #FFFFFF;
border: 1px solid #E2E2E2;
font-size: 15px;
padding: 5px;
width: 300px;
margin-bottom: 3px;
margin-top: 3px;
display: inline-block;
}

input[type="text"]:hover {
border: 1px solid #006FC4;
}

input[type="password"]:hover {
border: 1px solid #006FC4;
}

This post has been edited one or more times, the last time was:
2014-10-26 07:55:27

Newer account: NodePoint
TheAlexRider (2014-10-27 20:57:58)
Everything but the header bar...
CoolApps (2014-10-28 11:27:24)
I see there are background image links, are those supposed to be used as headers?
From the looks of it, the header DIV is containing the content. Try removing '..' From the background links.
Newer account: NodePoint
TheAlexRider (2014-10-28 17:30:29)
Nope
CoolApps (2014-10-28 22:00:35)
Does it all work as it should? I've forgot to put the title tags in the head section so you may consider doing that.
Newer account: NodePoint
 >  >>

Log in to submit a comment

This topic's ID: 77075

Back to forum: Web Programming (HTML, JS, CSS, PHP, MySQL)




Total registered users: 8321
New registered users today: 7
Newest registered user: ElegantVulpes

©  Copyright 2026 3DSPlaza. All Rights Reserved