News Feed
Jobs Feed
Sections




News Archive
feed this:

Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

SitePoint PHP Blog:
How to Dynamically Localize TinyMCE
December 02, 2013 @ 10:37:41

The SitePoint PHP blog has a post from Roland Clemenceau about localizing the TinyMCE editor, a web-based Javascript HTML WYSIWYG editor. It's dropped in to make textareas rich-text editing components of your page quickly and easily.

This tutorial assumes you have built a PHP multilingual site/framework and you, or whoever the admin is, would like TinyMCE to automatically switch to the current language of your site. [...] Although TinyMCE is a great wysiwyg editor that provides localized files for almost every known language, it still does not come with an automatic language-switching feature. It's very easy to roll your own solution to this problem, though, so that's what we're going to do now.

He shows how to use extra language files in coordination with a "language" setting. This setting (usually something like "en" or "es") can then be set as a configuration option when the TinyMCE instance is added to the page.

0 comments voice your opinion now!
localize tinymce editor wysiwyg tutorial html

Link: http://www.sitepoint.com/dynamically-localize-tinymce/

SitePoint PHP Blog:
Coding a Lorem Ipsum Alternative
August 26, 2013 @ 10:54:02

On the SitePoint PHP blog David Francis has written up an example showing how to create a "lorem ipsum" alternative in PHP. The "lorem ipsum" functionality generates text to put into layouts or prototypes of pages. It's named this way because the first two words are traditionally "lorem ipsum."

Lorem Ipsum generators are well known and are useful for generating text copy during website development. [...] t's good that we have a wide selection of text generators, but how exactly are these generators made? Can we use PHP and MySQL to build our own? That's exactly what we'll tackle in this article. We won't develop a fully working website; what we will cover are the essentials for building a site such as Fillerati.

He suggests using something from Project Gutenberg (a collection of public domain books and other written works) with the HTML markup already included. His personal choice is On the origin of the Species. He uses a simple PHP script to extract the content from the downloaded document to find useable paragraphs (don't want ones that are too long or short). He then takes that same data and populates a few database tables with it and includes the script to extract them and place them in the page. This could easily be adapted into a view helper for your favorite templating language or framework.

0 comments voice your opinion now!
loremipsum alternative projectgutenburg tutorial html extract

Link: http://www.sitepoint.com/coding-a-lorem-ipsum-alternative/

PHPMaster.com:
Convert HTML to PDF with Dompdf
August 15, 2013 @ 10:39:16

On PHPMaster.com there's a new tutorial from Shameer C showing you how to use Dompdf to convert HTML to PDFs. The handy library makes it (relatively) simple to automatically generate the documents without the need to know the internal PDF file structure.

PDF is a standard format originally created by Adobe for representing text and images in a fixed-layout document. It's not uncommon for a web application to support downloading data, such as invoices or reports, in PDF format, so in this article we'll go through how we can easily generate PDF documents using PHP.

He starts off with the installation (via Composer) and the creation of a simple "Hello World" document, showing how to "stream" it into a PDF file. He also includes some more advanced usage - loading an external HTML, drawing lines, changing fonts, adding page numbers and additional text to the page.

0 comments voice your opinion now!
html pdf convert tutorial dompdf adobe

Link: http://phpmaster.com/convert-html-to-pdf-with-dompdf

Rob Allen:
Sending an HTML with text alternative email with ZendMail
November 02, 2012 @ 10:26:20

Rob Allen has a quick tutorial posted to his site today showing you how to send an email with the ZendMail component of the Zend Framework 2 that contains HTML but provides a plain text backup in the same message.

Sending a multi-part email with ZendMail is easy enough, but if you want to send an HTML email with a text alternative, you need to remember to set the content-type in the headers to multipart/alternative. As this is the second time I had to work this out, I'm noting it here for the next time I forget!

The rest of the post is the code you'll need to send a simple email with a text and HTML body sections, configure the headers (to, from, etc) and the "multipart/alternative" header to make the HTML or plain text switching work correctly.

0 comments voice your opinion now!
zendframework2 mail tutorial send alternative html plaintext


James Morris' Blog:
Parsing HTML with DOMDocument and DOMXPathQuery
June 27, 2012 @ 10:19:35

In the latest post to his blog James Morris looks at using XPath's query() function to locate pieces of data in your XML.

The other day I needed to do some html scraping to trim out some repeated data stuck inside nested divs and produce a simplified array of said data. My first port of call was SimpleXML which I have used many times. However this time, the son of a bitch just wouldn't work with me and kept on throwing up parsing errors. I lost my patience with it and decided to give DomDocument and DOMXpath a go which I'd heard of but never used.

He includes a code (and XML document) example showing how to extract out some content from an HTML structure - grabbing each of the images from inside a div and associating them with their description content.

0 comments voice your opinion now!
dom domdocument domxpath xpath tutorial html


NetTuts.com:
So You Want to Accept Credit Cards Online?
June 14, 2012 @ 09:30:25

On NetTuts.com they're posted a new tutorial about using the Stripe service to accept credit cards on your site. Thanks to some handy libraries they provide, integration is a relatively simple process.

Until recently, accepting credit cards on a website was expensive and complicated. But that was before Stripe: a radically different and insanely awesome credit card processing company. Today, I'll show you how to start accepting cards in 30 minutes or less - without spending a dime.

They step you through the whole process you'll need to get the full flow set up:

  • Install an SSL Certificate (on your server)
  • Create an Account
  • Create Your Payment Form
  • Collect The Form Values
  • Request a Token
  • Create a Server-Side Script

Screenshots of the Stripe interface, HTML, Javascript and PHP code are all included - everything you need to make the simple card handling work. One of the keys to how Stripe deals with credit cards is that you provide it the card info, it gives you a token. Your app uses this to work with the card instead of storing the card information in your database (also making it more secure).

0 comments voice your opinion now!
creditcard stripe tutorial processing javascript html php library


PHPMaster.com:
Server-Side HTML Handling Using phpQuery
June 12, 2012 @ 10:58:26

PHPMaster.com has a new tutorial today showing how you can use phpQuery to work with HTML in your application. phpQuery is a server-side CSS-selector-driven based on jQuery's API.

Think about how you can change and manipulate the generated HTML using server-side PHP code. phpQuery is the ultimate solution that will come to your mind. If you haven't heard about phpQuery, you may be interested in this article since I am going to give you a brief introduction to phpQuery and explain how you can use it in real-world projects.

The tutorial shows you how to generate a simple table with alternating row colors (zebra) and column headers from an array of product information. They also talk a bit about why using something server-side like this is important (over something client-side like jQuery) - how it can make things easier by keeping the "business logic" all in one place, leaving your frontend to do what it does best.

0 comments voice your opinion now!
tutorial phpquery backend html processing


Danne Lundqvist's Blog:
Getting to grips with an existing XML structure
April 25, 2012 @ 10:44:43

Danne Lundqvist has a new post where he shares a bit of code he's written to "come to grips" with an existing XML structure.

Very often I find myself writing input filters for large XML files using PHP. Common enough task; and PHP offer a great variety of tools to do this effectively depending on the situation. Unfortunately, almost as common is the lack of documentation for the aforementioned XML files. [...] I have looked around for a simple tool but I didn't really find a tool that gave me the quick and dirty overview I wanted. A year or so ago I finally wrote a small PHP class to analyze large XML files.

He includes an example XML file, the HTML output of the parsing and a sample of how to use the class to parse and output the XML structure, complete with some CSS.

0 comments voice your opinion now!
xml structure schema parse output html csss


PHPMaster.com:
Form Validation with PHP
March 12, 2012 @ 12:17:03

On PHPMaster.com today there's a new tutorial showing how to do some form validation using some basic PHP (no external libraries or tools here). This is a beginner level tutorial to help you get familiar with the concepts behind doing validation (and

In this article you'll construct and validate a simple form using HTML and PHP. The form is created using HTML and validation and processing of the form's contents is done with PHP. The goal is to teach you some basic HTML form elements and how their data is accessible to you in your PHP scripts.

They start with the form itself, a basic setup with various kinds of fields - text, select, radio and a checkbox. Both the HTML markup and the PHP to do the validation is included. They check for things like "not empty", "must select one" and optional fields. Be sure to read the comments for some good tips on filtering the form's input too.

0 comments voice your opinion now!
validation form tutorial html beginner


Smashing Magazine:
Create A Christmas Wish List With PHP (For Beginners)
December 23, 2011 @ 10:23:51

In this new tutorial Smashing Magazine shows you how to create a mini "Christmas List" application with PHP, HTML and CSS (and a little bit of database help) to display a list of what you or your family wants this holiday.

'Tis the season to be jolly, and how much jollier could we make it than with a helpful Christmas wish list crafted for your family to ensure that you get maximum presentage this holiday? In this article, we will focus on creating a very simple system that allows you to add gift ideas to a Web page, and for your family (or whoever) to view the list.

They walk you through the setup of the basic PHP file structure, the HTML template for the list output, CSS to make it look nice and the actual PHP backend - working with a MySQL database to pull out product information and use a simple login method.

0 comments voice your opinion now!
christmas list tutorial html css database beginner



Community Events











Don't see your event here?
Let us know!


language package composer series facebook release symfony2 unittest framework dependency introduction podcast hhvm application install overview component hack security opinion

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework