logo-dw

Go Back   Dreamweaver Club Forums > Hand Coders Forum > PHP
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 09-14-2012, 10:36 PM   #1
kanstnara
 
Join Date: Sep 2012
Posts: 2
Default My functions won't activate, stays black, using Cs4

Hello, I'm taking up coding again after many years and are following a tut, so I'm learning it all again...

Trying to do a html5 index (not sure that I've done that succefully thought as Dw Cs4 didn't offer that option when starting the site, so tried to change the DTD to match), and are having problems with some of the functions. In the tutorial the function, ex. $pg, or $dbc, turn turcouse while mine stay black, as if their not active or accepted. Why is that and what changes can I make?


index.txt

setup.txt
kanstnara is offline   Reply With Quote
Old 09-15-2012, 02:41 AM   #2
edbr
edbr's Avatar
 
Join Date: Aug 2005
Location: Bali
Posts: 11,164
Default

please just post code using CODE tags, not many will download files from a first time poster
__________________
If you're happy and you know it shake your meds!
different style links examples

Flight / Hotel search
Free script download
Bali Villas
edbr is offline   Reply With Quote
Old 09-15-2012, 08:35 AM   #3
kanstnara
 
Join Date: Sep 2012
Posts: 2
Default same as topic but with the code

this is the index.php, and when I upload on local server, running xampp, I get this in return within the content div:

Warning
: mysqli_query() expects parameter 1 to be mysqli, boolean given in
C:\xampp\htdocs\sites\tdcd\index.php
on line
55

Warning
: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, null given in
C:\xampp\htdocs\sites\tdcd\index.php
on line
57


When I post the code here, the variables ($pg, $q, $r, $page[title] etc.) turn up blue, but for me, on my Dw Cs4 the remain black.

What to do?

PHP Code:
<?php error_reporting (E_ALL E_NOTICE); ?>

<?php
// Setup document:
include('config/setup.php');

    if (
$_GET['page'] == '') {
                
        
$pg 'home';
            
    } else {
        
        
$pg $_GET['page'];
                
    }
?>


<!-- 
<!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">
-->

<!DOCTYPE HTML>
<head>
<meta charset="utf-8" />
<html lang="en">
<title>The Digital Craft Dynamic</title>


<link rel="stylesheet" href="css/styles.css" />


</head>

<body>


    <div class="header temp_block">
        <?php include('template/header.php'); ?>
        
    </div>
    
    <div class="main_nav temp_block">
        <?php include('template/main_nav.php'); ?>
    </div>
        
    <div class="temp_block content">
        <?php //include('content/'.$pg.'.php');
        
        // the database connection, our query; 
        
        
$q "SELECT * FROM pages WHERE name = '$pg' AND status = 1 LIMIT 1";
        
$r mysqli_query(@mysqli_connect('localhost''dev_maah''tdcd_dbase'), $q);
        
        
$page mysqli_fetch_assoc($r);
        echo 
'<h1>'.$page[title].'</h1>';
        echo 
'<div class=content_body>'.$page['body'].'</div>';
        
        
        
?>
        
    </div>
        
    <div class="footer temp_block">
        <?php include('template/footer.php'); ?>
    </div>
    
    
</body>
</html>
kanstnara is offline   Reply With Quote
Old 09-17-2012, 01:44 AM   #4
edbr
edbr's Avatar
 
Join Date: Aug 2005
Location: Bali
Posts: 11,164
Default

t is this line
Warning
: mysqli_query() expects parameter 1 to be mysqli, boolean given in
C:\xampp\htdocs\sites\tdcd\index.php
on line
55
__________________
If you're happy and you know it shake your meds!
different style links examples

Flight / Hotel search
Free script download
Bali Villas
edbr is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:39 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com