Converting Muvar To Use With ASP
If you have never heard of Muvar or used it before, then I suggest that you take a look at:
http://www.jamesbrausch.org/testivar-24-hour-special/
Although that is not Muvar itself, it is part of James Braush’s suite of tools. Some of them are better than others, but Muvar is a winner.
If you have any salesletter and are not testing then you are throwing money down the toilet. Muvar enables you to do it easily and is the cheapest tool that I have seen to do this.
For me however, there was one major problem and that is that most of the programming that I do is in ASP. My whole affiliate system is in ASP and all my membership areas are in ASP. As Muvar is written in PHP, this gives me three options:
1. Create a new script in ASP which I can use to test my salespages
2. Don’t use ASP or use another piece of software
3. Adapt Muvar so that it works on my ASP salespages
Going by the saying that if it ain’t broke, then don’t fix it, I have adapted Muvar so that it now works on my ASP pages.
a. From an ASP page (index.asp), I call in the PHP page index.php which the actions the script which creates the salespage.
b. The problem is that as Muvar works with IP addresses, I also have to send the IP address of the visitor as a query string otherwise the IP address that it uses will be the IP address of the server.
Therefore the PHP page which I call is something like:
http://www.secondchancer.com/index7.php?ip2=” & request.servervariables(“REMOTE_HOST”)
or, the exact code that I use is:
Set xml = Server.CreateObject(“Microsoft.XMLHTTP”)
if request.querystring(“mode”)=”password” then
xml.Open “POST”, “http://www.secondchancer.com/index.php?mode=test”, False
else
xml.Open “POST”, “http://www.secondchancer.com/index.php?ip2=” & request.servervariables(“REMOTE_HOST”), False
end if
xml.Send
The reason that I used an if statement was so that I could take advantage of the admin function of the Muvar script by adding on the query string.
c. As you are passing through the ip address of the visitor to the script, you need to change the functions slightly. I assume that there is a better way to do this by declaring $ip2 as a global function, but with my limited knowledge of PHP I am not sure exactly how to do this.
Therefore, wherever it is calling in the ip of the visitor, that needs to be changed to $ip2 .
For example, on index.php:
if ($theMode==”test”)
{
$visitorIP=convertDotsToDashes($ip2);
if (file_exists(“data/visitor”.$visitorIP.”.txt”))
{
unlink(“data/visitor”.$visitorIP.”.txt”);
}
}
or further down in the page:
$theVer=getVarVersion($theVar,$ip2);
d. The more difficult part comes in passing $ip2 to the various functions in misc.php. The parts I changed were:
function getVarVersion($varName,$ip2)
$theWinner=getVisitorVarVersion($varName,$ip2);
setVisitorVarVersion($varName,$theWinner,$ip2);
function getVisitorVarVersion($varName,$ip2)
{
$visitorIP=convertDotsToDashes($ip2);
function setVisitorVarVersion($varName,$varVer,$ip2)
{
$visitorIP=convertDotsToDashes($ip2);
function registerSale($thePrice,$ip2)
{
$visitorIP=convertDotsToDashes($ip2);
e. The only other part that needs changing is to register the sale. In the same way, I call the thankyou.php page from an asp page.
Set xml = Server.CreateObject(“Microsoft.XMLHTTP”)
xml.Open “POST”, “http://www.domainname.com/thankyou.php?pricepaid=” & transamount & “&ip2=” & request.servervariables(“REMOTE_HOST”), False
xml.Send
and then change the thankyou.php to reflect that the ip address is being sent to it:
registerSale($pricepaid,$ip2);
and it works
The only other things that I do which you won’t be able to see here is to change all of the filenames so that curious eyes can see all of my info or mess up my results. The main files that I change are:
index.php
thankyou.php
data/
I hope that this wasn’t too confusing
) and does actually help others apart from me.
Best Wishes,
Ben Shaffer






March 21st, 2008 at 5:47 am
And you are assuming that php is installed in IIS? That is a pretty big assumption!
March 21st, 2008 at 6:16 am
Good point…I did assume it.
However, there is no reason why you can’t put the muvar on another server. However, it will effect speed…
B