ParseProGo is a desktop-application for creating and editing PHP-files with integrated preview. It works on all Intel-based Apple-Computers and requires, of course, PHP - whether the Macintosh built-in or, more recommendable, a web-server. ParseProGo was written and is distributed by www.mentalmove.com. (A little smaller) versions for other Operating Systems can be found here.


 Appendix A 

 Example  for using the [html -> php] - function

Copy the following code into the left window. Save it (inside your workspace) as - let's say - html_convert.php (you can choose any other filename, too).

<?php

//
// created by mentalmove
//

?>

<html><head></head>
<body style="background: #FDFDDD">

<script type="text/javascript">
document.write("<center>\"It's all right\", she said</center><br><br>");
</script>

<div style="float: right; background: #DDDDFD;">
<i>Money makes the world spin round</i>
</div>

<pre>
        $
   $   $
  $      $
      $   $
   
   &Delta;        &Delta;
  &Phi; &Phi;      &Phi; &Phi;
  &lfloor;&rfloor;        &perp;
  /|\      /|\
 / | \    / | \
  / \      / \
_/   \_  _/   \_
</pre>


<div style=" position: absolute; left: 8%; top: 333px;">
<script type="text/javascript">
document.write("<tt><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$<br>&nbsp;&nbsp;&nbsp;$&nbsp;&nbsp;&nbsp;$<br>&nbsp;&nbsp;$&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$&nbsp;&nbsp;&nbsp;$<br>&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&Delta;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&Delta;<br>&nbsp;&nbsp;&Phi;&nbsp;&Phi;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&Phi;&nbsp;&Phi;<br>&nbsp;&nbsp;&nbsp;&perp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lfloor;&rfloor;<br>&nbsp;&nbsp;/|\\&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/|\\<br>&nbsp;/&nbsp;|&nbsp;\\&nbsp;&nbsp;&nbsp;&nbsp;/&nbsp;|&nbsp;\\<br>&nbsp;&nbsp;/&nbsp;\\&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/&nbsp;\\<br>_/&nbsp;&nbsp;&nbsp;\\_&nbsp;&nbsp;_/&nbsp;&nbsp;&nbsp;\\_<br></tt>");
</script>
</div>

</body>
</html>
Click preview intern or preview extern to see the result (better use preview extern, or this text will be gone). Don't think too much about the sense of this document - it's just an example. If you use preview extern, check the source code, too. You should see something like this:
"It's all right", she said


Money makes the world spin round
        $
   $   $
  $      $
      $   $
   
   Δ        Δ
  Φ Φ      Φ Φ
  ⌊⌋        ⊥
  /|\      /|\
 / | \    / | \
  / \      / \
_/   \_  _/   \_
Now select everything from <html> to </html>. Your document should look this way (or similar):
<?php

//
// created by mentalmove
//

?>

<html><head></head>				 
<body style="background: #FDFDDD">		 
						 
<script type="text/javascript">			 
document.write("<center>\"It's all right\", she said</center><br><br>");
</script>					 
						 
<div style="float: right; background: #DDDDFD;"> 
<i>Money makes the world spin round</i>		 
</div>						 
						 
<pre>						 
        $					 
   $   $					 
  $      $					 
      $   $					 
						 
   &Delta;        		&Delta;		 
  &Phi; &Phi;      &Phi; &Phi;			 
  &lfloor;&rfloor;        &perp;		 
  /|\      /|\					 
 / | \    / | \					 
  / \      / \					 
_/   \_  _/   \_				 
</pre>						 
						 
						 
<div style=" position: absolute; left: 8%; top: 333px;">
<script type="text/javascript">				 
document.write("<tt><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$<br>&nbsp;&nbsp;&nbsp;$&nbsp;&nbsp;&nbsp;$<br>&nbsp;&nbsp;$&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$&nbsp;&nbsp;&nbsp;$<br>&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&Delta;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&Delta;<br>&nbsp;&nbsp;&Phi;&nbsp;&Phi;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&Phi;&nbsp;&Phi;<br>&nbsp;&nbsp;&nbsp;&perp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lfloor;&rfloor;<br>&nbsp;&nbsp;/|\\&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/|\\<br>&nbsp;/&nbsp;|&nbsp;\\&nbsp;&nbsp;&nbsp;&nbsp;/&nbsp;|&nbsp;\\<br>&nbsp;&nbsp;/&nbsp;\\&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/&nbsp;\\<br>_/&nbsp;&nbsp;&nbsp;\\_&nbsp;&nbsp;_/&nbsp;&nbsp;&nbsp;\\_<br></tt>");
</script>					 
</div>						 
						 
</body>						 
</html>
While the text is still selected, choose  HTML  ->  html -> php . (Maybe you will be asked if you want to save, but that's unimportant because you saved before, didn't you? The reason for the question is that in complicated situations you probably might find it useful to have a copy. In 'real life' you maybe want to make an backup, or put the respective region into a sticky.)

Your document will now look like this:
<?php

//
// created by mentalmove
//

?>

<?php
echo "<html><head></head>
<body style=\"background: #FDFDDD\">

<script type=\"text/javascript\">
document.write(\"<center>\\\"It's all right\\\", she said</center><br><br>\");
</script>

<div style=\"float: right; background: #DDDDFD;\">
<i>Money makes the world spin round</i>
</div>

<pre>
        \$
   \$   \$
  \$      \$
      \$   \$
   
   &Delta;        &Delta;
  &Phi; &Phi;      &Phi; &Phi;
  &lfloor;&rfloor;        &perp;
  /|\\      /|\\
 / | \\    / | \\
  / \\      / \\
_/   \\_  _/   \\_
</pre>


<div style=\" position: absolute; left: 8%; top: 333px;\">
<script type=\"text/javascript\">
document.write(\"<tt><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\$<br>&nbsp;&nbsp;&nbsp;\$&nbsp;&nbsp;&nbsp;\$<br>&nbsp;&nbsp;\$&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\$<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\$&nbsp;&nbsp;&nbsp;\$<br>&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&Delta;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&Delta;<br>&nbsp;&nbsp;&Phi;&nbsp;&Phi;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&Phi;&nbsp;&Phi;<br>&nbsp;&nbsp;&nbsp;&perp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lfloor;&rfloor;<br>&nbsp;&nbsp;/|\\\\&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/|\\\\<br>&nbsp;/&nbsp;|&nbsp;\\\\&nbsp;&nbsp;&nbsp;&nbsp;/&nbsp;|&nbsp;\\\\<br>&nbsp;&nbsp;/&nbsp;\\\\&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/&nbsp;\\\\<br>_/&nbsp;&nbsp;&nbsp;\\\\_&nbsp;&nbsp;_/&nbsp;&nbsp;&nbsp;\\\\_<br></tt>\");
</script>
</div>

</body>
</html>";
?>
Before we look at the differences, save html_convert.php and click preview extern. Check the (html-) source code, too. What a nasty function! Nothing, absolutely nothing has changed! Now let's examine the php-code: When you look carefully, you will notice that ParseProGo has added <?php echo " at the start of the selection, and ";?> at the end. That's almost the whole trick - these two lines tell the server that everything inside the lines shall be given back as html. Shall that be all? Am I saying the truth? Well, let's try it. Return to the basic version, and add <?php echo " before <html>, and ";?> after </html>. Your document should look like this:
<?php

//
// created by mentalmove
//

?>

<?php echo "<html><head></head>
<body style="background: #FDFDDD">

<script type="text/javascript">
document.write("<center>\"It's all right\", she said</center><br><br>");
</script>

<div style="float: right; background: #DDDDFD;">
<i>Money makes the world spin round</i>
</div>

<pre>
        $
   $   $
  $      $
      $   $
   
   &Delta;        &Delta;
  &Phi; &Phi;      &Phi; &Phi;
  &lfloor;&rfloor;        &perp;
  /|\      /|\
 / | \    / | \
  / \      / \
_/   \_  _/   \_
</pre>


<div style=" position: absolute; left: 8%; top: 333px;">
<script type="text/javascript">
document.write("<tt><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$<br>&nbsp;&nbsp;&nbsp;$&nbsp;&nbsp;&nbsp;$<br>&nbsp;&nbsp;$&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$&nbsp;&nbsp;&nbsp;$<br>&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&Delta;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&Delta;<br>&nbsp;&nbsp;&Phi;&nbsp;&Phi;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&Phi;&nbsp;&Phi;<br>&nbsp;&nbsp;&nbsp;&perp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lfloor;&rfloor;<br>&nbsp;&nbsp;/|\\&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/|\\<br>&nbsp;/&nbsp;|&nbsp;\\&nbsp;&nbsp;&nbsp;&nbsp;/&nbsp;|&nbsp;\\<br>&nbsp;&nbsp;/&nbsp;\\&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/&nbsp;\\<br>_/&nbsp;&nbsp;&nbsp;\\_&nbsp;&nbsp;_/&nbsp;&nbsp;&nbsp;\\_<br></tt>");
</script>
</div>

</body>
</html>";?>
Save it, and click preview extern. The result will be similar to

 Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in ~/html_convert.php on line 10

It seems that, however, ParseProGo did something useful when converting to php. If you take a closer look at the basic and the converted version, you probably will notice that quotations, backslashes, and Dollar-Signs have one ore more additional backslashes as a partner. This is necessary because PHP wants to interprete these signs if they aren't escaped (ParseProGo detects already escaped signs you might have written in html/javascript).

Fine. Now you know that the  html -> php  - function of ParseProGo is able to convert html to php without violating PHP-rules, but what shall be the advantage of this?!?


Let's try to add something to our document. At first, we have to repeat the first two steps, that is: 1) Copy the code of fig1 into the left window and save it as html_convert.php in your workspace. 2) Select everything from <html> to </html> (fig2), and click  HTML  ->  html -> php  (the result should be similar to fig3).

3) Delete the lines
//
// created by mentalmove
//
(you will know by now who the author was), and insert the line
$value = TRUE;
instead. What shall that mean? I really don't know - but your PHP-server, which isn't that curious like me or you, is content with this, it just knows 'There is a new variable called $value which holds some information, and whatever this information shall be, it seems to be true'.

4) Before (not instead of!)
echo "<html><head></head>
add a new line
if ($value)
This tells the server: 'If $value is true, do the following'.

5) Replace the last line
?>
with
else echo "Surprise!"; ?>
The meaning of this line is: 'If $value is not true, display the word Surprise!'.
Your document should look now like this:
<?php

$value = TRUE;

?>

<?php
if ($value)
echo "<html><head></head>
<body style=\"background: #FDFDDD\">

<script type=\"text/javascript\">
document.write(\"<center>\\\"It's all right\\\", she said</center><br><br>\");
</script>

<div style=\"float: right; background: #DDDDFD;\">
<i>Money makes the world spin round</i>
</div>

<pre>
        \$
   \$   \$
  \$      \$
      \$   \$
   
   &Delta;        &Delta;
  &Phi; &Phi;      &Phi; &Phi;
  &lfloor;&rfloor;        &perp;
  /|\\      /|\\
 / | \\    / | \\
  / \\      / \\
_/   \\_  _/   \\_
</pre>


<div style=\" position: absolute; left: 8%; top: 333px;\">
<script type=\"text/javascript\">
document.write(\"<tt><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\$<br>&nbsp;&nbsp;&nbsp;\$&nbsp;&nbsp;&nbsp;\$<br>&nbsp;&nbsp;\$&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\$<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\$&nbsp;&nbsp;&nbsp;\$<br>&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&Delta;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&Delta;<br>&nbsp;&nbsp;&Phi;&nbsp;&Phi;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&Phi;&nbsp;&Phi;<br>&nbsp;&nbsp;&nbsp;&perp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lfloor;&rfloor;<br>&nbsp;&nbsp;/|\\\\&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/|\\\\<br>&nbsp;/&nbsp;|&nbsp;\\\\&nbsp;&nbsp;&nbsp;&nbsp;/&nbsp;|&nbsp;\\\\<br>&nbsp;&nbsp;/&nbsp;\\\\&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/&nbsp;\\\\<br>_/&nbsp;&nbsp;&nbsp;\\\\_&nbsp;&nbsp;_/&nbsp;&nbsp;&nbsp;\\\\_<br></tt>\");
</script>
</div>

</body>
</html>";
else echo "Surprise!"; ?>


Save, and click preview extern. The result will be the same again... But now, I do hope you haven't been waiting too long, replace the word TRUE in $value = TRUE; with the word FALSE Save, and click preview extern. Check the source code, too.

I guess you understand now... In general, you can connect a command in PHP with a condition. Of course, a command cannot only depend on a variable - you can use values given by the visitors of your page, the actual time, random choices... check the examples to see some of the possibilities of PHP.


main page