GithubHelp home page GithubHelp logo

php2html's Introduction

php2html

Write HTML using only php

About the project

One advantage of the dynamic pages and client server languages, is the ability to create multiple contents using the same code. In combination with databases, the possibilities for creating content, grow and can facilitate or complicate the existence of a programmer. The main idea of this project, is precisely to facilitate the generation of these contents when the origin of these come from different sources.

This project was done in my spare time. Not intended to replace the good programming practices, and serve as a example for stable development. The project is the result of a question "what if...?"

Features

The PHP2HTML class, integrates engine access to MySQL, SQL Server and Oracle. Allowing the automation of building several web pages, using the same code. It allows to integrate in a same page from different sources. For example, the menu can be in a text file, get the main page from a MySQL database and other items are stored at Oracle database

  • Import CSS/JS/Text/Php Files
  • Use the same methods to access different RDBMS
  • Common methods to build most used tags
  • Object-oriented
  • Automate events

Requirements

  • PHP 5.2 or higher
  • MySQL 4.1 or higher
  • Oracle 9 or higher
  • Microsoft SQL Server 2000 or higher

The use of Oracle is not limited to full versions. XE versions are supported.
To use the mysqli extension, you must have installed mysql 4.1 or higher.

Example

  include_once 'html.class.php';
  $p = new PHP2HTML();
  $p->CSS('css/styles.css');
  $p->Body('<div>Hello World</div>');
  $p->Comment("Begin of imported file");
  $p->HTML('contents/table.html');
  $p->Comment("End of imported file");
  $p->Body($p->Link(PAGEF, "http://www.google.com","Google","_blank"'));
  $p->HTMLbr();
  $p->Body(
          $p->Btn(
            "button", "Click Me", "myClass", "myID", "myName",
            actions::onClick(
              'alert("Hello"); return false;'
            )
          )
);
$p->Create();

Database connections example

    $p->setConnType("mysql");
    $p->setConnection($dbHost, $db_User, $db_Pass, $db_Database);

    //Running a SELECT statement
    $p->Cnn->Query('Select code, name from myTable');

    //The result of the query can be accessed via Cnn->rs method
    If(!$p->Cnn->rs==false){
      //The numRows() method returns the number of rows for a SELECT query 
      $NumRows = $p->Cnn->numRows();
      echo "The statement return $NumRows records";
    }

    //Running a Delete statement
    $p->Cnn->Query('delete from myTable where code = 101');

    if($p->Cnn->rs){
      //Returns the number of affected rows on success
      $NumRecords = $p->Cnn->affectedRows();
     echo "The statement affect $NumRecords rows";
    }

Contact

Constructive critics, comments and suggestions are welcome.

[email protected]

Homepage

http://www.php2html.comyr.com

php2html's People

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.