TS4 - PHP and Mapping - Assistance Requested

Post anything about TopStyle here. NOTE: TopStyle has been discontinued.

Moderator: TopStyle Support

Post Reply
Rank 0 - Newcomer
Rank 0 - Newcomer
Posts: 4
Joined: Sat Jan 02, 2010 7:37 pm

TS4 - PHP and Mapping - Assistance Requested

Post by jft » Sat May 01, 2010 11:25 pm

Top Style is a very nice product - I have been enjoying using it for testing & developing.
Yesterday I tried to set it up to execute PHP commands embedded within the HTML code, but unfortunately I could not get the mapping feature to work. Could anyone give me further guidance please?
The environment & testing done are detailed below.
- Win2K SP4
- Internet Explorer 6.0.2800.1106
- Firefox 3.6.3
- TopStyle
- Apache 1.3.39
- PHP 5.2.5
- Apache is configured with 9 VirtualHosts (on ports 8000-8008) & these have been working successfully for several years now
- WebRoot: C:\http\webServers\8002_yii\8002\wwwRoot
- TopStyleWorkDirectory: D:\SandBox\ProtectaCar
- TS4 Mapping - MapFrom: C:\http\webServers\8002_yii\8002\wwwRoot\
- TS4 Mapping - MapTo: http://localhost:8002/
- TS4 Mapping - 'Use mappings when previewing' option: Checked
- FileName: mappingTest.php
- Contents:

Code: Select all

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  <meta http-equiv="content-type" content="text/html;charset=utf-8">
  <title>Testing Mapping</title>
<p>Line1: Hello World 0123!</p>
<?php echo("Line2: Hi Universe 9876!"); ?>
<p>Line3:Bibi World!</p>
- The file mappingTest.php above was copied to both directories ( WebRoot: C:\http\webServers\8002_yii\8002\wwwRoot and TopStyleWorkDirectory: D:\SandBox\ProtectaCar)
- The TopStyleWorkDirectory file was then run from within TopStyle using the internal browser (IE6) and again from within TopStyle using the two external browsers above (IE & Firefox)
- The WebRoot file was then run directly from the address bar of each of IE & Firefox
- The tests above were then repeated using the IP address ( in place of "localhost:8002" in both TopStyle's mapping & when running the two browsers directly from their address bars.

In all cases TopStyle output the first and third lines only (not the second) and when the file
was run directly from the address bar of each of the browsers all three
lines were output.

Thanks in advance,
John (jft@worrigee.net)

User avatar
TopStyle Support
Rank VI - Professional
Rank VI - Professional
Posts: 507
Joined: Sat Jun 13, 2009 12:38 pm

Re: TS4 - PHP and Mapping - Assistance Requested

Post by TopStyle Support » Mon May 03, 2010 1:58 am

Are you sure the document in your web root is identical to the one in your working directory?

When you map something from a certain directory to a certain URL, my advice is edit from that actual directory (not some other working directory).

Thanks, Stefan.

Post Reply