Jump to content

POG1

Members
  • Posts

    71
  • Joined

  • Last visited

    Never

Posts posted by POG1

  1. What you could to stop spam and poo stories is have them be accepted or rejected before they are allowed. 65,000 is good enough for a decent short story  (not a novel).

  2. Im stuck with ezSQL. I have decided to upgrade my old version of ezSQL and i'm having some problems with connecting to the database.

     

    It needs 2 classes included which I have done. Then when i try to connect it shows about 10 error messages. Here is the code i used;

     

    require('lib/connection.php'); // classes are in here
    $db = new ezSQL_mysql;
    $db->connect('root', '', 'localhost'); // default login settings for LAMP

     

    Any suggestions as to what I can do? Or any suggestions to a better class to use?..

  3. $finish = 94438384; // timestamp of when it finishes
    $width = time() / $finish;
    if($width > 1) { $width = 1; } 
    echo
    '<div id="outer">'.
        '<div id="inner" style="width:'.$width.'%;">'.
        '</div>'.
    '</div>';

     

    CSS

    div#outer { height:10px;width:200px;background:#900;padding:0; }

    div#inner { height:10px;background:#090;margin:0;padding:0; }

  4. I have 2 separate classes, database and user class.

     

    Inside the user class I have to do a query and if i try to use the db class it produces an error, is there any way i can make this work?

     

    I have tried things but with no success.

     

    class User { 
    
    protected $id;
    public function getDetails() { 
    
    	$this->id = (int) $_SESSION['user_id'];
    	$query = 'SELECT `Username` FROM `' . DBPREFIX . 'users` WHERE `ID` = ' . $db->qstr ( $id ) ;
    
    	// do stuff?
    
    	return true;
    
    }
    
    }

     

    The error it says is "Fatal error: Call to a member function qstr()"

     

  5. echo
    '<input value="'.$_REQUEST['username'].'" name="username" />'.
    '<select name="dropdown">'.
        '<option value="1" '.(($_REQUEST['dropdown'] == '1')?'selected="selected"':FALSE).'>1</option>'.
        '<option value="2" '.(($_REQUEST['dropdown'] == '1')?'selected="selected"':FALSE).'>2</option>'.
    '</select>'.
    '<input type="radio" name="rdo" '.(($_REQUEST['rdo'] == TRUE)?'checked="checked"':FALSE).'/>';
    

  6. You will need a JavaScript function. You could probably add it to the on click event for the image and show hide the additional data :)

     

    Here is a function you could use

     

    function toggle(obj) {

    document.getElementById(obj).style.display = (el.style.display != 'none' ? 'none' : '' );

    }

  7. <img src="<?php echo $nation['nation_flag']; ?>" style="float:left;" />

    <img src="<?php echo $nation['nation_symbol']; ?>" style="float:right;" />

    <b><u><center>Government of <?php echo $nation['nation_name']; ?></center></u></b>

    <br style="clear:both" />

  8. The query would have returned an error and it then triggers the error in the loop. Try changing the lino to this:

     

    $k = mysql_query("SELECT * FROM servers ORDER BY top") or die(mysql_error());

     

    It will show what you have done wrong in the query.

  9. <?php
    $result = @mysql_query("SELECT `headlineFieldName` As a FROM `news` ORDER BY `id` DESC LIMIT 1;",$conn) or die('news selection error');
    if(@mysql_num_rows($result)) { 
    
        $newsTitle = mysql_fetch_array($result,MYSQL_ASSOC); $newsTitle =  $newsTitle['a'];
        $title = $newsTitle . ' - Latest news from This is Dunstable';
    
    } else { $newsTitle = 'No News - Latest news from This is Dunstable';
    ?>
    <?xml version="1.0" encoding="utf-8" ?>
    <?xml version="1.0" encoding="UTF-8"?><!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" xml:lang="en" lang="en">
    <head>
       <title><?=$newsTitle?></title>
       <meta name="description" content="Dunstable, Bedfordshire - Information, and local resources from This is Dunstable" />
       <meta name="keywords" content="dunstable, bedfordshire" />
       <meta name="Robots" content="index,follow" />
       <link rel="stylesheet" href="style.css" type="text/css" />
    </head>
    
    <body>
    <div id="container">
    <?php include("includes/header.shtml"); ?>
    <div id="menu-left">
    <?php include("includes/menu.shtml"); ?>
    </div>
    <div id="content">
    <h3><span class="green">this</span><span class="grey">is</span><span class="blue">news</span></h3>
    <?php include_once("news/easynews.php"); ?>
    </div>
    <div id="sidebar">
    <?php include("includes/sidebar.shtml"); ?>
    </div>
    <div style="clear:both;"></div>
    </div>
    <div id="footer"><?php include("includes/footer.shtml"); ?></div>
    
    </body>
    </html>

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