dabempire Posted March 29, 2007 Share Posted March 29, 2007 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. Link to comment https://forums.phpfreaks.com/topic/44821-two-snippets-of-asp-code-i-need-help-converting-to-php/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.