WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDESPHP CLASSESCODE SEARCHARTICLES SEARCHPHP FORUMSPHP MANUALPHP FUNCTIONS LISTWEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Join us on FaceBook
Submit a code Example / Snippet Submit Your Code
Poker Tournaments Poker Tournaments
Poker Guide for Developers Poker Guide for Developers
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Resources
Web Development Content
Internet Security Software
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
פרייסז - הכח לקנות עובר לידיים שלך
Texas Holdem Poker Evangelists

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : PHP Tester - Lets you test php code from a browser (modification).
Categories : PHP, HTML and PHP, Testing Click here to Update Your Picture
Dave Silvia
Date : Jan 19th 2006
Grade : 3 of 5 (graded 7 times)
Viewed : 47077
File : 4294.php
Images : No Images for this code example.
Search : More code by Dave Silvia
Action : Grade This Code Example
Tools : My Examples List

Submit your own code examples  Submit your own code examples 
 

original http://www.weberdev.com/get_example-3096.html by Erwin Poelman

Attached file is a modification of original code by Erwin Poelman from 2001.
I have updated it and made some minor improvements.

<?php
/* Original code by Erwin Poelman found on
   http://www.weberdev.com/get_example-3096.html

   This is a little more up to date and formatted for readability.
   Some things in PHP have changed since Erwin Poelman first posted this
   and a couple of things had to be added to resolve variables that are
   no longer automagically (yes, I spelled it right!;) set.  Also added
   a test for <?...?> enclosure.  Changed the hard coded file name (originally
   'generate.php') in the src attributes to server resolution through the
   'PHP_SELF' value.
   
   Otherwise, its a pretty neat and tidy little browser PHP interpretter, just
   as Erwin Poelman originally wrote it!;)
*/
if(isset($_REQUEST['dispArea']))$dispArea=$_REQUEST['dispArea'];
if(isset(
$_REQUEST['theCode']))$theCode=$_REQUEST['theCode'];
if(!isset(
$dispArea))
{
    echo
"<frameset cols='60%,40%'>\r\n";
    echo     
"<frame name='theCode' src='".$_SERVER['PHP_SELF']."?dispArea=left'>\r\n";
    echo     
"<frame name='theExec' src='".$_SERVER['PHP_SELF']."?dispArea=right'>\r\n";
    echo
"</frameset>\r\n";
}
else
{
    if(!
strcmp($dispArea,"left"))
    {
        echo
"<body bgcolor='#D0DEED'>\r\n";
        echo
"<font face='Arial,Verdana,Helvetica' color='FF0000' size='3'>PHP Tester</font>\r\n";
        echo     
"<form method='post' action='".$_SERVER['PHP_SELF']."?dispArea=right' target='theExec'>\r\n";
        echo     
"<table>\r\n";
        echo         
"<tr><td align='center'>\r\n";
        echo             
"<input type='submit' value='Execute'>\r\n";
        echo         
"</td></tr>\r\n";
        echo         
"<tr><td>\r\n";
        echo             
"<text area name='theCode' cols='65' rows='25' wrap='virtual'>\r\n";
        echo                 
$theCode."\r\n";
        echo             
"</text area>\r\n";
        echo         
"</td></tr>\r\n";
        echo     
"</table>\r\n";
        echo     
"</form>\r\n";
    }
    else if(!
strcmp($dispArea,"right"))
    {
        echo
"<body bgcolor='#FFFFFF'>\r\n";
        if(empty(
$theCode))
        {
            echo
"Ready to parse...";
        }
        else
        {
           
$theCode=ltrim(rtrim(stripSlashes($theCode)));
            if(!
strncmp($theCode,"<?",2)) //if it's full php, remove the tags
           
{
                if(!
strncmp($theCode,"<?php",5))
                {
                   
$theCode=substr($theCode,5);
                }
                else
                {
                   
$theCode=substr($theCode,2);
                }
               
$theCode=substr($theCode,0,strlen($theCode)-2);
               
$theCode=ltrim(rtrim(stripSlashes($theCode)));
            }
            eval(
$theCode);
        }
    }
    echo
"</body>";
}
?>



PHP3: Formmail. Just a cgi formmail, but than in PHP. It is easy to use!
Categories : HTML and PHP, Email, PHP, Perl, HTML and PHP
Calendar using Date function
Categories : HTML and PHP, PHP, Date Time, Calendar
Save time debugging PHP3 under UNIX/Linux using linked .phps files
Categories : HTML and PHP, Debugging, PHP
PageRank Display
Categories : Search Engines, HTML and PHP, PHP
Kewl Date Example
Categories : PHP, HTML and PHP, Date Time, CSS, Beginner Guides
mySQL/PHP/search with multientry form and table output with colored rows
Categories : PHP, Beginner Guides, MySQL, HTML and PHP, Databases
Print out array key => value in colored HTML
Categories : PHP, Arrays, HTML and PHP
XTemplate, a template class for PHP
Categories : PHP Classes, HTML and PHP, PHP
Upload Script, Upload File Script, Input Type="File"
Categories : PHP, HTML and PHP, HTTP
This script shows you the 7th latest php items from the mailing list archive on zend.com
Categories : HTML, HTML and PHP, HTTP, PHP
AITSH Statistics
Categories : Complete Programs, Databases, HTML and PHP, Sessions, PHP
Creating thumbnails from MySQL Blobs online
Categories : PHP, MySQL, Graphics, HTML and PHP, Databases
Customizable encoding and decoding strings with security.
Categories : PHP, Strings, HTML and PHP
PHP based HTML rabbing Tools
Categories : PHP, HTML and PHP, Tag Extractors, Regexps, Beginner Guides
Constantly refresh your PHP/HTML page data.
Categories : PHP, HTML and PHP, Sybase
 Abdoulaye Siby wrote :1377
Very neat!