Advertisement

06.22.2007 at 01:36PM PDT, ID: 22652274
[x]
Attachment Details

Convert coldfusion statement to php.

Asked by lhaluska in ColdFusion Studio, PHP for Windows

Tags: coldfusion, php, convert

I wanted to convert this coldfusion code to php code how would I do that. The code is below.

<cffile action="read" file="c:/Inetpub/wwwroot/rsvp/admin/NetIDDump.csv" variable="netID"/>
<cfset CR = "#Chr(13)##Chr(10)#">
<cfset netID = Replace("#netID#", "#CR#", ",", "ALL")>
<cfset rowNum = 1>
<cfset navNum = 1>
<cfset output = "<html>
<head>
<title>NetID IPs</title>
<meta http-equiv=""Content-Type"" content=""text/html; charset=iso-8859-1"">
</head>


<body>
<div align=""center""><h1>IP Page</h1></div>
<h2>This file was last updated #DateFormat(now(),"mm/dd/yyyy")#</h2><br>
<table align=""center"" width=""650"">
<tr>
      <td colspan=""2"" align=""center"">
            <cfinclude template=""../admin/A_Z_Local_Target_Nav.cfm"">
      </td>
</tr>
<tr>
      <th align=""left"">Full Domain Name</th>
      <th align=""left"">IP</th>
</tr>">
<cfset lastChar = "">
<cfset IP = "">
<cfloop index="item" list="#netID#" delimiters=",">
<cfif rowNum MOD 2 IS NOT 0>
      <cfif navNum MOD 25 IS 0>
            <cfset output = "#output#
            <tr>
                  <td colspan=""2"" align=""center"">
                        <cfinclude template=""../admin/A_Z_Local_Target_Nav.cfm"">
                  </td>
            </tr>">
      </cfif>
      <cfset IP = #item#>
      <cfset navNum = #navNum# + 1>
      <!--- <cfoutput>Nav = #navNum#&nbsp;</cfoutput>
      <cfoutput>IP = #item#&nbsp;</cfoutput> --->
<cfelse>
      <cfset full_domain_name = #item#>
      <!--- <cfoutput>name = #item#&nbsp;</cfoutput>  --->
      <cfoutput>
      <cfset firstChar = Left("#item#",1)>
      <cfset output = "#output#<tr>">
      <cfif firstChar IS NOT lastChar>
            <cfset output = "#output#
            <td><a id=""#firstChar#"">#full_domain_name#</a></td>">
      <cfelse>
            <cfset output = "#output#
            <td>#full_domain_name#</td>">
      </cfif>
            <cfset output = "#output#
            <td>#IP#</td></tr>">
      </cfoutput>
      <cfset lastChar = #firstChar#>
</cfif>
<!--- <cfoutput>rowNum = #rowNum#<br></cfoutput> --->
<cfset rowNum = #rowNum# + 1>
</cfloop>
<cfset output = "#output#
</table>
</body>
</html>">

<cffile action="write" file="c:/Inetpub/wwwroot/rsvp/etc/LabIPs.cfm" output="#output#">
<cflocation url="LabIPs.cfm">Start Free Trial
 
Loading Advertisement...
 
[+][-]07.03.2007 at 01:50PM PDT, ID: 19414676

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: ColdFusion Studio, PHP for Windows
Tags: coldfusion, php, convert
Sign Up Now!
Solution Provided By: SBennett
Participating Experts: 1
Solution Grade: C
 
 
 
Loading Advertisement...
20080716-EE-VQP-32