Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    New Coder
    Join Date
    Nov 2005
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Can Someone please Help me convert this asp code to php

    this code i found on Microsoft Webpage ad solutions, but i have no idea how to get it to php, thanks for you help

    Code:
    <%@ Language="JScript" %>
    <%    
    	// Note that setting the Request.ContentType property to     
    	// "video/x-ms-asf" lets you create dynamic    
    	// metafiles that do not contain HTTP header data.    
    	Response.ContentType = "video/x-ms-asf";
    %>
    <%  // Set the BASE_PATH variable to point to your    
    	// server running Windows Media Services.    
    	var BASE_PATH = "mms://MyMediaServer/";    
    	//Force content to always refresh.    
    	Response.Expires = 0;    
    	//Create the opening ASX tag.    
    	Response.Write (AsxHeader());      
    	//Create an ad.     
    	Response.Write (AdEntry());     
    	//Create an XML entry for content.    
    	Response.Write (AsxEntry());    
    	//Write the ASX footer.    
    	Response.Write (AsxFooter());
    // This function returns an opening <ASX> tag.
    function AsxHeader ()
    {    
    	return "<ASX Version=\"3\">" + "\n" + "<TITLE> Demo Dynamic ASX File              
    		From Active Server Pages </TITLE>" + "\n";
    }
    // This function returns an ad based on user request.
    function AdEntry()
    {    
    	if (Request("AdPref") == 0)    
    	{        
    		return "    <ENTRY>" + "\n" + "\t" + "<REF HREF=\"" + BASE_PATH +                      
    					"AdInsertion/BackpackingAd.wmv\" />" + "\n" +                      
    					"    </ENTRY>" + "\n";    
    	}    
    	else    
    	{        
    		return "    <ENTRY>" + "\n" + "\t" + "<REF HREF=\"" + BASE_PATH +                      
    					"AdInsertion/TravelAd.wmv\" />" + "\n" +                      
    					"    </ENTRY>" + "\n";    
    	}
    }
    // This function returns an XML entry for a specific piece of content.
    // With actual code, this function does a database lookup.
    function AsxEntry ()
    {    
    	var AsxEntry, Abstract;    
    	AsxEntry = "    <ENTRY>" + "\n" + "\t" +                
    			   "<TITLE> Upcoming Movie Releases in 2004 </TITLE>" + "\n";    
    	AsxEntry += "\t" + "<REF HREF=\"" + BASE_PATH +                 
    				"Content/UpcomingReleases2004.asf \"/>" + "\n";    
    	AsxEntry += "\t" + "<ABSTRACT>" + "\n";    
    	Abstract = " Check out the latest movies to hit the big screen in 2004!";    
    	AsxEntry += Abstract + "\n";    AsxEntry += "\t" +"</ABSTRACT>" + "\n";    
    	AsxEntry += "\t" + "<COPYRIGHT> Copyright 2004,              
    	         Southridge Video -- All Rights Reserved </COPYRIGHT>" + "\n";    
    	AsxEntry += "    </ENTRY>" + "\n";    
    	return AsxEntry;
    }
    // This function returns a closing </ASX> tag.
    function AsxFooter ()
    {    
    	return "</ASX>";
    }
    %>
    Last edited by gamesport; 01-01-2006 at 07:07 PM.


 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •