#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2000
    Posts
    4
    Rep Power
    0
    Hi,

    I just tried out asp2php - a program that converts asp to php more or less successfully. There were
    a few parse errors I managed to get rid of in the converted script. But I have a line that is giving me my last parse error and I have no idea what is causing the problem. Can anybody help?

    $dwdate=$day[strftime("m/-1078009044/Y H:M:S
    0x804a0c8")]."/".strftime("m")strftime("m/-1078009044/Y H:M:S
    0x804a0c8")."/".strftime("Y")strftime("m/-1078009044/Y H:M:S 0x804a0c8");
    $Fcnt=0;
  2. #2
  3. .Net Developer
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    London
    Posts
    987
    Rep Power
    15

    <<
    $dwdate=$day[strftime("m/-1078009044/Y H:M:S
    0x804a0c8")]."/".strftime("m")strftime("m/-1078009044/Y H:M:S
    0x804a0c8")."/".strftime("Y")strftime("m/-1078009044/Y H:M:S 0x804a0c8");
    $Fcnt=0;
    >>


    i'm not sure what the above lines are doing..
    i think concatenation is missing in between..

    just give try the following..

    $dwdate=$day[strftime("m/-1078009044/Y H:M:S
    0x804a0c8")]."/".strftime("m").strftime("m/-1078009044/Y H:M:S
    0x804a0c8")."/".strftime("Y").strftime("m/-1078009044/Y H:M:S 0x804a0c8");
    $Fcnt=0;

    //i have put 2-dot's in between strftime()..

    please post that corresponding asp code also if you are facing more problems..

    ------------------
    SR -
    webshiju.com
    www.jobxyz.com-IT Career Portal
    ezipindia.com--WebStudio


    "The fear of the LORD is the beginning of knowledge..."

    [This message has been edited by Shiju Rajan (edited September 27, 2000).]
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2000
    Posts
    4
    Rep Power
    0
    Yes, that's cleared up the parse errors. Thanks! Unfortunately the converted (and slightly modified) code is far from pure PHP and won't work in its present form? What should I do with all those $CmdSimpleSelect, for example?

    <?


    $date=$day[strftime("m/-1078009044/Y H:M:S 0x804a0c8")]."/".strftime("m").strftime("m/-1078009044/Y H:M:S 0x804a0c8")."/".strftime("Y").strftime("m/-1078009044/Y H:M:S 0x804a0c8");
    $Fcnt=0;


    $DataConn=mysql_connect("localhost","root","pass");
    mysql_select_db("Classified",$DataConn);

    $MYSQL="SELECT * FROM ads where DateExpires > .$date. AND Control='NEW' ORDER BY ads.DateSent DESC";


    mysql_query($CmdSimpleSelect_CommandText);
    while(!($mysql_query==0))
    {

    $Fcnt=$Fcnt+1;
    $category= $CmdSimpleSelect["Category"];
    $headline= $CmdSimpleSelect["Headline"];
    $price= $CmdSimpleSelect["Price"];
    $datesent= $cmdSimpleSelect["DateSent"];
    $id= $CmdSimpleSelect["ID"];
    ?>
    <tr valign="middle">
    <td width="5%" height="13">
    <div align="center"><a href="viewadvert.php?AdId=<? echo $id; ?>"><img src="household.gif" width="32" height="25" border="0" alt="<? echo $category; ?>"></a></div>
    </td>
    <td width="39%" height="13"><font face="Arial, Helvetica, sans-serif" size="2" color="#CC0000"><b><? echo $headline; ?>&nbsp;</b></font></td>
    <td width="13%" height="13">
    <div align="left"><font face="Arial, Helvetica, sans-serif" size="2">$<? echo $price; ?></font></div>
    </td>
    <td width="26%" height="13">
    <div align="left"><font face="Arial, Helvetica, sans-serif" size="2"><?
    $DateOut=$Day[$DateSent]." ";
    $dateout=$dateout.$monthname.strftime("m").$DateSent.true." ";
    $dateout=$dateout.strftime("Y").$dateSent." ";
    $dateout=$dateout.$timevalue[$datesent];
    echo $DateOut;?>

    </font></div>
    </td>
    <td width="17%" height="13">
    <div align="left"><font face="Arial, Helvetica, sans-serif" size="2"><a href="viewadvert.php?AdId=<? echo $id; ?>">Ref:&nbsp;
    <? echo $id; ?></a></font></div>
    </td>
    </tr>
    <?
    mysql_fetch_array($CmdSimpleSelect_query);

    }
    mysql_query($CmdSimpleSelect_CommandText);
    $CmdSimpleSelect=null;

    mysql_close($DataConn)
    ;

    ?>

    --------------
    Original ASP
    <%

    Dim DataConn
    Dim CmdSimpleSelect
    Dim MYSQL
    Dim Fcnt
    dim dwcategory
    dim dwheadline
    dim dwprice
    dim dwdatesent
    dim dwref
    dim dwdate
    dwdate=day(now) & "/" & month(now) & "/" & year(now)
    Fcnt=0
    Set DataConn = Server.CreateObject("ADODB.Connection")
    Set CmdSimpleSelect = Server.CreateObject("ADODB.Recordset")
    DataConn.Open "DBQ=" & Server.Mappath("classified.mdb") & ";Driver={Microsoft Access Driver (*.mdb)};"
    MYSQL = "SELECT * FROM Ads where DateExpires > " & dwdate & " AND Control='NEW' ORDER BY Ads.DateSent DESC"
    'response.write(mysql)
    CmdSimpleSelect.Open MYSQL, DataConn
    While Not CmdSimpleSelect.EOF
    Fcnt=Fcnt+1
    dwcategory=CmdSimpleSelect("Category")
    dwheadline=CmdSimpleSelect("Headline")
    dwprice=CmdSimpleSelect("Price")
    dwdatesent=cmdSimpleSelect("DateSent")
    dwref=CmdSimpleSelect("ID")
    %>
    <tr valign="middle">
    <td width="5%" height="13">
    <div align="center"><a href="viewadvert.asp?AdId=<%=dwref%>"><img src="household.gif" width="32" height="25" border="0" alt="<%=dwcategory%>"></a></div>
    </td>
    <td width="39%" height="13"><font face="Arial, Helvetica, sans-serif" size="2" color="#CC0000"><b><%=dwheadline%>&nbsp;</b></font></td>
    <td width="13%" height="13">
    <div align="left"><font face="Arial, Helvetica, sans-serif" size="2">$<%=dwprice%></font></div>
    </td>
    <td width="26%" height="13">
    <div align="left"><font face="Arial, Helvetica, sans-serif" size="2"><%
    Dim dwDateOut
    dwDateOut=Day(dwDateSent) & " "
    dwdateout=dwdateout & monthname(month(dwDateSent),True) & " "
    dwdateout=dwdateout & year(dwDateSent) & " "
    dwdateout=dwdateout & timevalue(dwdatesent)
    Response.write(dwDateOut)%></font></div>
    </td>
    <td width="17%" height="13">
    <div align="left"><font face="Arial, Helvetica, sans-serif" size="2"><a href="viewadvert.asp?AdId=<%=dwref%>">Ref:&nbsp;
    <%=dwref%></a></font></div>
    </td>
    </tr>
    <%
    CmdSimpleSelect.MoveNext
    Wend
    CmdSimpleSelect.Close
    Set CmdSimpleSelect = Nothing
    DataConn.Close
    Set DataConn = Nothing
    %>

    [This message has been edited by bking (edited September 29, 2000).]

Similar Threads

  1. Converting DOC files to PDF files using PHP
    By necrophagous in forum PHP Development
    Replies: 3
    Last Post: February 6th, 2004, 12:36 PM
  2. Replies: 1
    Last Post: February 4th, 2004, 01:39 PM
  3. Converting ASP Drop-down box to horiz. links
    By mitulpatel in forum ASP Programming
    Replies: 1
    Last Post: February 3rd, 2004, 07:59 AM
  4. PHP with UnixODBC
    By coder4hire in forum PHP Development
    Replies: 2
    Last Post: January 20th, 2004, 01:14 PM
  5. Translation: PHP to ASP
    By swedee in forum ASP Programming
    Replies: 0
    Last Post: January 19th, 2004, 11:11 AM

IMN logo majestic logo threadwatch logo seochat tools logo