prosoxi.com | Archive | PHP

Change PHP variables using .htaccess

If you need to change the way your PHP is working you can do that using .htaccess.
Please, note that not all PHP options can be changed using .htaccess.
A list of options that can be changed using .htaccess file can be found at:

Continue Reading

Posted in PHP0 Comments

php documentor

Welcome to the home of phpDocumentor. phpDocumentor, sometimes referred to as phpdoc or phpdocu, is the current standard auto-documentation tool for the php language. Similar to Javadoc, and written in php, phpDocumentor can be used from the command line or a web interface to create professional documentation from php source code. phpDocumentor has support for linking between documentation, incorporating user level documents like tutorials and creation of highlighted source code with cross referencing to php general documentation. A complete list of features is available.

Continue Reading

Posted in PHP0 Comments

phpdocx

PHPDOCX is offered as a free PHP library that allows you to create dynamically basic Microsoft Office Word documents (.docx) or as an enhanced Pro version that includes extra functionality and allows for more sophisticated formatting.

Continue Reading

Posted in PHP0 Comments

php Include File in a Variable

Simply using include() or require() to output the contents of a ‘include’ file on another web page may work perfectly 90% of the time. However, there will be times where you may want to save it into a variable instead – especially if you are using PHP template classes to generate your web pages. Anyone trying to add a simple thing as a banner on popular forum scripts like phpBB and vBulletin will know what I mean.


Anyway, I will try to show you how you can do that using PHP’s ob_start(), ob_get_contents() and ob_end_clean(). Let’s look at our little include banner / ad file first.

Our sample include file – ad_table.php

This fictitious file we create will output one table with 3 rows of text ads. The entire sample file’s code may look something like this:

php:



<?php 

//  Filename: AD_TABLE.PHP
//  ======================
echo "<table>\n";
for( $i=0;$i<3;$i++ )
{
  echo "  <tr>\n";
  echo '    <td>'.get_ads('Text',$i+1)."</td>\n";
  echo "  </tr>\n";
}
echo '</table>';

//  ===================
//  FUNCTION: GET_ADS()
//  ===================
function get_ads($keyword,$number)
{
  echo $keyword.' No.'.$number;
}
?>

When we view the source / HTML of this particular page off a browser, it may look something like this:

code:

<table>
  <tr>
    <td>Text No.1</td>
  </tr>
  <tr>
    <td>Text No.2</td>
  </tr>
  <tr>
    <td>Text No.3</td>
  </tr>
</table>

Using our ‘include’ variable in a web page

Now that we’ve seen our ‘include’ file and what it will output, we can then use our ad_table.php in any other web page (most likely in our template-script-driven web pages that is) simply by adding these lines of code:

php:



<?php
//  Filename: INDEX.PHP
//  ==========================================

//  all the usual page and template code here
//  and where we want out 'include' variable to
//  appear, we add these lines

ob_start(); # start buffer
include_once( '/home/user/public_html/ad_table.php' );
# we pass the output to a variable
$html = ob_get_contents();
ob_end_clean(); # end buffer
# and here's our variable filled up with the html
echo $html;

//  we can then continue on with our web page and template
//  script or even add another 'include' variable!

ob_start();
require_once( '/home/user/public_html/ad_table2.php' );
$html2 = ob_get_contents();
ob_end_clean();
echo $html2;

?>

Source

http://www.desilva.biz/php/ob_start.html

Posted in PHP0 Comments

TCPDF is a FLOSS PHP class for generating PDF documents.

Started in 2002, TCPDF is now one of the world’s most active Open Source projects, used daily by millions of users and included in thousands of CMSand Web applications.
Check the examples

Continue Reading

Posted in PHP0 Comments

PHP Mod_Rewrite

I commented out the RewriteRule in my .htaccess file and created a new WP_Rewrite rule in my WP theme’s functions.php file. This effectively accomplishes the same thing, but ensures that WordPress is aware of the ‘extra’ querystring variables (so they’re not lost or ignored).

Continue Reading

Posted in .htaccess, HTML - XHTML, PHP0 Comments

parse RSS/Atom feeds with PHP

XML stands for EXtensible Markup Language and it is a simplified subset of Standard Generalized Markup Language (SGML). Its primary purpose is to facilitate the sharing of data across different information systems, particularly systems connected via the Internet.

Continue Reading

Posted in PHP0 Comments

How can I execute PHP code on my existing myfile.html page?

When a web page is accessed, the server checks the extension to know how to handle the page. Generally speaking if it sees a .htm or .html file, it sends it right to the browser because it doesn’t have anything to process on the server. If it sees a .php extension (or .shtml, or .asp, etc), it knows that it needs to execute the appropriate code before passing it along to the browser.

Continue Reading

Posted in .htaccess, HTML - XHTML, PHP0 Comments

TimThumb – PHP Image Resizer

TimThumb is a simple, flexible, PHP script that resizes images. You give it a bunch of parameters, and it spits out a thumbnail image that you can display on your site.

Continue Reading

Posted in PHP0 Comments

Highlight PHP and JavaScript Code with PHP

PHP has a cool function that automatically highlights PHP code called highlight_string();Theoretically this could be used to roll your own code highlighting on a site, rather than rely on JavaScript or some kind of external service to do it. In this article I’ll show you the basics of how it works, then extended it with a few tricks. Since JavaScript is so similar to PHP in syntax, we can trick the function into highlighting JavaScript code as well. Then finally how we can bust out some smarts to auto-tab the code.

Continue Reading

Posted in PHP0 Comments

Domain Finder

Domain Finder Tool by Truste.gr

read more for domains

Advertisers

Wedstar all about wedding - gamos - γαμος
Κατασκευή ιστοσελίδων
Domain Names | Hosting

Adds