Results 1 to 5 of 5
  1. #1

    PHP/CSS/XHTML W3C Site Request

    I am not requesting any solicited services. I am asking for recoomendations from WHT users.

    A few years ago I purchased a psd design that I have since modifyed and coded to my liking. I have added much to it and have it mostly built, however I am no web designer. The site's backend is php/mysql. Only light php though; just enough to build retain session data to chache content, phrases and templates. The frontend is css/xhtml and light javascript in a mostly tabeless design.

    The majority of the site is built; now I just need WHMCS, vBulletin & cPanel integration. I am looking for a company that will optimize my backend code to ensure there are no security or loadtime issues. I would also want them to fix all non w3c compliant pages to ensure proper display in all major browsers. Templating for WHMCS, vBulletin and cPanel isn't a neccessity, but would be nice. Can anyone reccomend a company that would do this (roughly 20 pages split amongst 30-40 dynamic php files) for somewhere in the low thousands?

  2. #2
    Join Date
    May 2004
    Location
    Pflugerville, TX
    Posts
    11,222
    Is the PHP built into your site actually touching a database? Because if it's not, and if it's not sending POST data anywhere, the chances that you have security issues are very slim. It's good that you're being cautious, but you'll probably be pleased to know this, in general.

    Are there particular browsers in which you're having difficulty with how your site displays? In some cases, there's a code trick or two you can employ to tighten up the look in browsers that are causing problems for you, without needing to tear down and rebuild (like triggering HasLayout for IE7+, or using -moz filters for Firefox).

    If you share a link, maybe you can get the insight you need to make everything work for you as expected?
    Studio1337___̴ı̴̴̡̡̡ ̡͌l̡̡̡ ̡͌l̡*̡̡ ̴̡ı̴̴̡ ̡̡͡|̲̲̲͡͡͡ ̲▫̲͡ ̲̲̲͡͡π̲̲͡͡ ̲̲͡▫̲̲͡͡ ̲|̡̡̡ ̡ ̴̡ı̴̡̡ ̡͌l̡̡̡̡.__Web Design

  3. #3
    Good to see you're still hanging around these parts. Surprised I still remember your username as an active WHTer back in the early 2000's.

    Most of the errors are slight differences. I have coded the page to work fine in mozilla and see only minor error when viewing in IE, such as whitespace, margin offests, borders, and button/div styling. Most of which is probably tweekable as you've stated. I am just sick of doing it, but I'll continue to work on it.

    In regards to the php: I'm not sure what you mean by "touching", but if it's what you think then there is only minor "touching". The myself user that is used to fetch the db data for php session info is only given read permissions to the db. Here is the code:
    global.php (called on every page):
    PHP Code:
    require_once('config.php');
    require_once(
    'classes.php');
    require_once(
    'functions.php');

    init_core(); 
    Config:
    PHP Code:
    $config['server'] = array();
    $config['links'] = array()
    $config['meta'] = array()
    // These arrays store my db settings, hyperlinks and meta tags. 
    Classes:
    PHP Code:
    class Site {
        var 
    $db;
        var 
    $cache;
        var 
    $session;
        function 
    Site () {
            
    $this->db = &new Database($this);
            
    $this->cache = &new Cache($this);
            
    $this->session = &new Session($this);
        }
    }

    class 
    Database {
        var 
    $connection null;
        var 
    $database null;
        function 
    connect($username$password$database$server 'localhost'$port 3306$persistent false) {
            
    $this->connection = empty($persistent) ? mysql_connect("$server:$port"$username$password) : mysql_pconnect("$server:$port"$username$password);
            if (!
    $this->connectionshow_error('servercon'''$username$password$database$server$port);
            
    $this->database mysql_select_db($database$this->connection);
            if (!
    $this->databaseshow_error('dbcon'''$username$password$database$server$port);
            
    $_SESSION['database'] = true;
        }
        function 
    query($sql$connection) {
            
    $result mysql_query($sql);
            if (!
    $resultshow_error('query'$sql$username$password$database$server$port);
            return 
    $result;
            @
    mysql_free_result($result);
        }
        function 
    insert($sql) {
            
    $this->query($sql$this->connection);
        }
        function 
    update($sql) {
            
    $this->query($sql$this->connection);
        }
        function 
    delete($sql) {
            
    $this->query($sql$this->connection);
        }
        function 
    fetch_array($sql$type MYSQL_ASSOC) {
            
    $result $this->query($sql$this->connection);
            while(
    $row mysql_fetch_array($result$type)) {
                
    is_array($array) ? array_push($array$row) : $array = array($row);
            }
            return 
    $array;
            @
    mysql_free_result($array);
        }
    }
    class 
    Cache extends Database {
        function 
    meta($content) {
            if (
    is_array($content)) foreach ($content as $var => $val$_SESSION['meta'][$var] = $val;
            unset(
    $content);
            return 
    $_SESSION['meta'];
        }
        function 
    links($content) {
            if (
    is_array($content)) foreach ($content as $var => $val$_SESSION['links'][$var] = $val;
            unset(
    $content);
            return 
    $_SESSION['links'];
        }
        function 
    phrases($phrasegroups) {
            if (!
    is_array($_SESSION['phrases'])) $_SESSION['phrases'] = array();
            foreach (
    $phrasegroups as $group$phrasegroup = isset($phrasegroup) ? $phrasegroup.", '".$group."'" "'".$group."'";
            
    $phrases $this->fetch_array("SELECT name, value FROM phrases WHERE location IN (".$phrasegroup.")");
            if (
    is_array($phrases)) foreach ($phrases as $phrase$_SESSION['phrases'][THIS_SCRIPT][$phrase[name]] = $phrase['value'];
            unset(
    $phrases);
            return 
    $_SESSION['phrases'][THIS_SCRIPT];
        }
        function 
    templates($templategroups) {
            if (!
    is_array($_SESSION['templates'])) $_SESSION['templates'] = array();
            foreach (
    $templategroups as $group$templategroup = isset($templategroup) ? $templategroup.", '".$group."'" "'".$group."'";
            
    $templates $this->fetch_array("SELECT name, value FROM templates WHERE location = IN (".$templategroup.")");
            if (
    is_array($templates)) foreach ($templates as $template$_SESSION['templates'][THIS_SCRIPT][$template[name]] = $template['value'];
            unset(
    $templates);
            return 
    $_SESSION['templates'][THIS_SCRIPT];
        }
    }
    class 
    Session extends Cache {
        function 
    build() {
            
    //session_cache_expire(1);
            //session_cache_limiter('public');
            
    session_start();
            if (!isset(
    $_SESSION['timestamp'])) $_SESSION['timestamp'] = $_SERVER['REQUEST_TIME'];
            if (
    $_REQUEST['session'] == 'destroy' || $_SERVER['REQUEST_TIME'] - $_SESSION['timestamp'] > 3600$this->destroy();
        }
        function 
    destroy() {
            
    session_unset();
            
    $_SESSION = array();
            
    session_destroy();
            
    header("Location: http://".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']);
        }
    }

    $site = new Site(); 
    Functions:
    PHP Code:
    function init_core() {
        global 
    $site$config$phrasegroups$templategroups;
        
    $site->db->connect($config['server']['username'], $config['server']['password'], $config['server']['db'], $config['server']['addr'], $config['server']['port']);
        
    $site->session->build();
        
    $site->folder build_folders();
        
    $site->url = isset($_SESSION['links']) ? $_SESSION['links'] : $site->cache->links($config['links']);
        
    $site->meta = isset($_SESSION['meta']) ? $_SESSION['meta'] : $site->cache->meta($config['meta']);
        
    $site->phrase = isset($_SESSION['phrases'][THIS_SCRIPT]) ? $_SESSION['phrases'][THIS_SCRIPT] : $site->cache->phrases($phrasegroups);
        
    $site->template = isset($_SESSION['templates'][THIS_SCRIPT]) ? $_SESSION['templates'][THIS_SCRIPT] : $site->cache->templates($templategroups);
    }
    function 
    print_template($template) {
        global 
    $site$meta;
        include(
    $template '.php');
    }
    function 
    show_error($error_type$sql$username$password$database$server$port) {
        switch (
    $error_type) {
            case 
    'servercon':
                die(
    'Unable to establish connection with ' $server ' utilizing port ' $port ': ' mysql_error());
            break;
            case 
    'dbcon':
                die(
    'Connection with server established, but unable to connect with ' $database ': ' mysql_error());
            break;
            case 
    'query':
                die(
    'Connected with the database was established, but unable to run query (' $sql '): ' mysql_error());
            break;
            default:
                die(
    'MySQL has returned an error: ' mysql_error());
        }
        return 
    $array;
        unset(
    $array);
    }
    function 
    build_folders() {
        
    $dir['deep'] = number_format(substr_count($_SERVER['SCRIPT_FILENAME'], '/') - substr_count($_SERVER['DOCUMENT_ROOT'] . '/''/'));
        if (
    $dir['deep'] == 1) {define('CD''../');} elseif ($dir['deep'] == 2) {define('CD''../../');} else {define('CD''');}
        
    $array = array(
            
    'images' => CD.'images/',
            
    'includes' => CD.'includes/'
        
    );
        
    $array array_merge($array, array(
            
    'styles' => $array['includes'].'styles/'
            
    )
        );
        
    $array['images'] = array(
            
    'home' => $array['images'],
            
    'header' => $array['images'].'header/',
            
    'footer' => $array['images'].'footer/',
            
    'icons' => $array['images'].'icons/',
            
    'buttons' => $array['images'].'buttons/',
            
    'column' => $array['images'].'column/'
        
    );
        return 
    $array;
        unset(
    $dir$array);


  4. #4
    Join Date
    May 2004
    Location
    Pflugerville, TX
    Posts
    11,222
    Good to see you're still hanging around these parts. Surprised I still remember your username as an active WHTer back in the early 2000's.
    We keep pretty busy nowadays, and sometimes we're so busy I don't get a moment to spare for any communities, social media, etc. It's a good problem to have, but a problem nonetheless. Either way, I get a few minutes to breath now

    If the user that's connecting to the database only has read permissions, and there are no ways for people to send POST data to it (which would have to be the case), then the chances of having a security hole are extremely remote.

    see only minor error when viewing in IE, such as whitespace, margin offests, borders, and button/div styling
    it sounds to me like you're fighting browser defaults. Have you considered using universal resets at the beginning of your CSS document? Something like this might help you with consistency tremendously:

    * { list-style:none ; margin:0 ; outline:none ; padding:0 }
    a img { border:none }

    Then you style these elements into place as you work your way down. It makes a HUGE difference!
    Studio1337___̴ı̴̴̡̡̡ ̡͌l̡̡̡ ̡͌l̡*̡̡ ̴̡ı̴̴̡ ̡̡͡|̲̲̲͡͡͡ ̲▫̲͡ ̲̲̲͡͡π̲̲͡͡ ̲̲͡▫̲̲͡͡ ̲|̡̡̡ ̡ ̴̡ı̴̡̡ ̡͌l̡̡̡̡.__Web Design

  5. #5
    Your css seems very helpful. I am using something along the lines of html {margin: 0px; padding: 0px;} Wat exactly does the html css actually set?

  6. Newsletters

    Subscribe Now & Get The WHT Quick Start Guide!

Similar Threads

  1. Psd 2 Xhtml/Css - Only $15 - W3C Valid - 48 Hour Turnaround
    By Finer - Tommy in forum Design Offers
    Replies: 1
    Last Post: 05-04-2009, 05:30 PM
  2. Replies: 0
    Last Post: 02-26-2008, 04:24 PM
  3. W3C XHTML, CSS Coding Needed
    By WHN Daniel in forum Design Offers
    Replies: 2
    Last Post: 02-14-2007, 03:51 PM
  4. Best Hosting Teplates For Sale /xhtml/css/W3C
    By Asterisk Techs in forum Design Offers
    Replies: 4
    Last Post: 01-01-2007, 04:52 PM
  5. Replies: 11
    Last Post: 03-18-2006, 04:07 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •