Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: need advice re php access  (Read 5805 times)

0 Members and 1 Guest are viewing this topic.

12Strings

    Topic Starter


    Rookie

    • Experience: Experienced
    • OS: Windows 7
    need advice re php access
    « on: September 27, 2013, 09:58:06 PM »
    Hi guys, help me with my little coding problem. please.
    I key in "localhost/invoice/apdue.php" and get desired
    apdue.php results below:
    Quote
    9/28/13 Accounts payable Report
    ;
       due    days       
    acct#    customer    description    date    late    charges    paid    due
    ===================================================================
    0   Caromont Medical Group.    remove, ear wax   2013-02-08   0   259.52   259.52   0.00
    0   Homesteaders Life Co.   funeral arrangment   2013-01-13   0   72.99   0.00   72.99
    0   OrthoCarolina   shoulder repair   2013-02-08   0   468.47   100.00   368.47
    0   Presbyterian Hospital      2013-02-08   0   568.57   100.00   468.47
    0   Time Warner Cable   intetrnet service   2013-02-03   0   108.54   108.54   0.00
    0   Boost Mobile   phone bill   2013-01-26   0   40.00   0.00   40.00
    0   Boost Mobile   phone bill   2013-01-17   0   50.00   0.00   50.00
    =====================================================================
    Gtotals      1568.09   568.06   999.93


    but when trying to open apdue.php via the below (invoicenav.html), that should open
    the apdue.php:,

    Code: [Select]
    <html><body bgcolor="#ccffff"><p>
    <table bgcolor=pink width="180" border=0>
    <tr>
    <td><a href="http://localhost/apdue.php">Payables Due</a><br></td>
    <tr>
    <td><a href="http://localhost/appaid.php">Payables Paid</a><br></td>
    <tr>
    <td><a href="http://localhost/ardue.php">Receivables Due</a><br></td>
    <tr>
     <td><a href="http://localhost/arpaid.php">Receivables paid</a><br></td>
    </tr></table>
    </center></body</html>

      I get the below:
    Quote
    Object not found!
    The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.
    If you think this is a server error, please contact the webmaster.
    Error 404
    localhost
    Apache/2.4.4 (Win32) OpenSSL/0.9.8y PHP/5.4.16
     
    Below is the aforementioned apdue.php:
    [/quote]
    Code: [Select]
    <?php
    error_reporting
    (0);
    mysql_connect('localhost','root','');
    mysql_select_db('oodb') or die("Unable to select database");
    $query=" SELECT * FROM oocust WHERE payrec = 'P' && pd = ' '";
    $result=mysql_query($query);
    $num=mysql_numrows($result);
    echo 
    date('m/d/y');
    echo 
    "<font size=+2><b> Accounts payable Report</font></b></b><br />";
    echo 
    "<table cellspacing=1 cellpadding=1 border=0>
    <tr>
    <th colspan=3></th>
    <th>due</th>
    <th>days</th>
    <th></th>
    <th></th>
    <tr>
    <th>acct#</th>
    <th>customer</th>
    <th>description</th>
    <th>date</th>
    <th>late</th>
    <th align=right>charges</th>
    <th align=right>paid</th>
    <th align=right>due</th>
    <tr>
    <TH colspan=9>===================================================================</TH>;
    </tr>"
    ;
    while(
    $row mysql_fetch_array($result))
    {
    $totcharges $totcharges $row['charges'];
    $totdue $totdue $row['amtdue'];
    $totpaid $totpaid $row['paidamt'];
    echo 
    "<tr>";
    echo 
    "<td>" $row['acctno'] . "</td>";
    echo 
    "<td>" $row['bname'] . "</td>";
    echo 
    "<td>" $row['descr'] . "</td>";
    echo 
    "<td>" $row['duedate'] . "</td>";
    echo 
    "<td align=right>" $row['dayslate'] . "</td>";
    echo 
    "<td align=right>" $row['charges'] . "</td>";
    echo 
    "<td align=right>" $row['paidamt'] . "</td>";
    echo 
    "<td align=right>" $row['amtdue'] . "</td>";
    }
    echo 
    "<tr>";
    echo 
    "<th colspan=9>=====================================================================</TH>";
    echo 
    "<tr>";
    echo 
    "<td>Gtotals</td>";
    echo 
    "<td colspan=4></td>";

    echo 
    "<td align=right>" sprintf("%.2f",$totcharges) .
    "</td>";
    echo 
    "<td align=right>" sprintf("%.2f",$totpaid) .
    "</td>";
    echo 
    "<td align=right>" sprintf("%.2f",$totdue) .
    "</td>";
    echo 
    "</tr>";
    echo 
    "</table>";
    mysql_close();
    ?>







    Geek-9pm


      Mastermind
    • Geek After Dark
    • Thanked: 1026
      • Gekk9pm bnlog
    • Certifications: List
    • Computer: Specs
    • Experience: Expert
    • OS: Windows 10
    Re: need advice re php access
    « Reply #1 on: September 27, 2013, 10:38:39 PM »
    Pardon my questions.
    Have you had much experience running PHP locally?
    Why is not the whole thing done in PHP?
    Did you already test this code elsewhere?
    Do you have other PHP programs that run OK?
    Which PHP do you have?



    camerongray



      Expert
    • Thanked: 306
      • Yes
      • Cameron Gray - The Random Rambings of a Computer Geek
    • Certifications: List
    • Computer: Specs
    • Experience: Expert
    • OS: Mac OS
    Re: need advice re php access
    « Reply #2 on: September 29, 2013, 09:00:55 AM »
    You're going to kick yourself over this! :P

    You said:
    Quote
    I key in "localhost/invoice/apdue.php"

    But the link in 'invoicenav.html' goes to:
    Quote
    http://localhost/apdue.php

    You're missing the '/invoice/' in the link to apdue.php :P