Jump to content

two snippets of asp code I need help converting to php


dabempire

Recommended Posts

Hello.  I have been using a line of asp code for some asp sites I market for clients.  I have some new clients using php and I was hoping someone could convert the code for me.

 

Code 1 - loading analytics differently for HTTP vs. HTTPS

 

<script src="<%If Request.ServerVariables("HTTPS") = "on" Then%>
https://ssl<%else %>http://www<%end if %>.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "xxxxxx";
urchinTracker();
</script>

 

This code will load http://www.google-analytics.com/urchin.js in the analytics for http:// url's or https://ssl.google-analytics/urchin.js for https:// urls.

 

Code 2 - loading analytics dynamically based on a variable in the url

 

<% if(request.querystring("mode") = "ordersuccess")then %>
    <!-- Yahoo Analytics -->
    <SCRIPT language="JavaScript" type="text/javascript">
    <!-- Yahoo! Search Marketing
    window.ysm_customData = new Object();
    window.ysm_customData.conversion = "transId=,currency=,amount=";
    var ysm_accountid  = "XXXXXXXXXXXXXXXXXXXXXX";
    document.write("<SCR" + "IPT language='JavaScript' type='text/javascript' " 
    + "SRC=//" + "srv1.wa.marketingsolutions.yahoo.com" + "/script/ScriptServlet" + "?aid=" + ysm_accountid 
    + "></SCR" + "IPT>");
    // -->
    </SCRIPT>
    <!-- End Yahoo Analytics -->
<% end if %>

 

This code will load analytics, or whatever other line of text I'd like to place in there, if a certain variable = whatever I identify it should equal to load.  (IE "mode" = "ordersuccess")

 

I appreciate any help.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.