www.webdeveloper.com
Results 1 to 4 of 4

Thread: linking localhost files

Hybrid View

  1. #1
    Join Date
    Apr 2013
    Location
    gastonia NC
    Posts
    118

    linking localhost files

    Hi fellas, I have 3 working php files in my "htdocs" folder,
    and an html file.
    My
    HTML Code:
     link.html file : <table  width="180" border=0>
    <tr>
    <td><a href="file1.php" target="Main">file1</a><br></td>
    <tr>
    <td><a href="file2.php" target="Main">file2</a><br></td>
    <tr>
    <td><a href="file3.php" target="Main">file3</a><br></td>
    </tr></table>
    clicking a link does not execute the php files?

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    22,335
    Are you opening the HTML file in your browser via a "localhost" URL, or via the File menu. (The latter probably won't work.)
    "Well done....Consciousness to sarcasm in five seconds!" ~ Terry Pratchett, Night Watch

    How to Ask Questions the Smart Way (not affiliated with this site, but well worth reading)

    My Blog
    cwrBlog: simple, no-database PHP blogging framework

  3. #3
    Join Date
    Sep 2013
    Posts
    221
    I have run the above code.The link opens the new page in different tab and not reloading the same page itself. If target="Main" is removed then the same page is loaded. Save the by file1.php extension. May be this one help you out.

  4. #4
    Join Date
    Apr 2013
    Location
    gastonia NC
    Posts
    118
    Thought I'd keep this from getting verbose but here it is.
    I've had this same problem for months.
    I haven't been learning PHP for long so this slowed my prograss.
    The #1 code links to the files, #2 is one file (apdue.php) I
    want to use & #3 is the result. I first keyed in "localhost/invoice/apdue.php"
    & got the result I want (ecept this)
    Parse error: syntax error, unexpected 'm'
    (T_STRING) in C:\xampp\htdocs\invoice\apdue.php on line 8
    <html><body bgcolor="#ccffff"><p>
    <table bgcolor=red width="180" border=0>
    <tr>
    <td><b>Data entry/adjust</b></td<br>
    </tr></table>
    <table bgcolor=pink width="180" border=0>
    <tr>
    <td ><a href="rateselect.html" target="Main">Establish Tax Rate</a><br></td>
    <tr>
    <td><a href=latestordno.php" target="Main">New Order#</small></a><br></td>
    <tr>
    <td><a href="latestinvno.php" target="Main">New Invoice#/acct#</a><br></td>
    <tr>
    <td><a href="invoicebase.html" target="Main">Print invoice bases</a><br></td>
    <tr>
    <td><a href="invoiceinsert.php" target="Main">Data Input</a><br></td>
    <tr>
    <td><a href="invoice/invupdate.php" target="Main">Adjustments</a><br></td>
    </tr></table>
    <table bgcolor=red width="180" border=0>
    <tr>
    <td><b>Reports</b></td<br>
    </tr></table>
    <table bgcolor=pink width="180" border=0>
    <tr>
    <td><a href="apdue.php" target="Main">Payables Due</a><br></td>
    <tr>
    <td><a href="appaid.php" target="Main">Payables Paid</a><br></td>
    <tr>
    <td><a href="ardue.php" target="Main">Receivables Due</a><br></td>
    <tr>
    <td><a href="arpaid.php" target="Main">Receivables Paid</a><br></td>
    </tr></table>
    <table bgcolor=red width="180" border=0>
    <tr>
    <td><small><b>Billing</b></small></td<br>
    </tr></table>
    <table bgcolor=pink width="180" border=0>
    <tr>
    <td><a href="payment.php" target="Main">Payments</a><br></td>
    <tr>
    <td><a href="billing.php" target="Main">Billing</a><br></td>
    <tr>
    <td><a href="envelopes.php" target="Main">Print Envelopes</a><br></td>
    <tr>
    <!--<td><a href="checkrecon.php" target="Main">Check reconciliation</a><br></td>-->
    </tr></table><p>
    <table bgcolor=red width="180" border=0>
    <tr>
    <td><b>Point of Sale</b></td<<br>
    </tr></table>
    <table bgcolor=pink width="180" border=0>
    <tr>
    <td><a href="posinsert.php target="Main">Inventory Input</a><br></td>
    <tr>
    <td><a href="posupdate.php" target="Main">Inventory Adjustments</a><br></td>
    <tr>
    <td><a href="sale.php" target="Main">Point of Sale</a><br></td>
    <tr>
    <td><a href="posinvlist.php" target="Main">Order Sheet</a><br></td>
    <tr>
    <td><a href="genreceipt.php" target="Main">Receipt</a></td>
    </tr></table>
    </center></body</html>
    <?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' and pd = ' '
    $result=mysql_query($query);
    $num=mysql_numrows($result);
    // echo date("m/d/Y") . "<br />";
    echo "<font size=+2><b> Accounts Payable Report<br /><br />";
    echo "<table cellspacing=1 cellpadding=0 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();
    ?>

    "; echo " Accounts Payable Report

    "; echo ""; while($row = mysql_fetch_array($result)) { $totcharges = $totcharges + $row['charges']; $totdue = $totdue + $row['amtdue']; $totpaid = $totpaid + $row['paidamt']; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
    due days
    acct# customer description date late charges paid due
    ==================================================================================================== ===============
    " . $row['acctno'] . " " . $row['bname'] . " " . $row['descr'] . " " . $row['duedate'] . " " . $row['dayslate'] . " " . $row['charges'] . " " . $row['paidamt'] . " " . $row['amtdue'] . "
    ==================================================================================================== =================
    Gtotals " . sprintf("%.2f",$totcharges) . " " . sprintf("%.2f",$totpaid) . " " . sprintf("%.2f",$totdue) . "
    "; mysql_close(); ?>

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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

"

"

X vBulletin 4.2.2 Debug Information

  • Page Generation 0.13084 seconds
  • Memory Usage 3,013KB
  • Queries Executed 13 (?)
More Information
Template Usage (31):
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_global_above_footer
  • (1)ad_global_below_navbar
  • (1)ad_global_header1
  • (1)ad_global_header2
  • (1)ad_navbar_below
  • (1)bbcode_html
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (4)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (1)navbar_moderation
  • (1)navbar_noticebit
  • (1)navbar_tabs
  • (2)option
  • (4)postbit
  • (4)postbit_onlinestatus
  • (4)postbit_wrapper
  • (1)showthread_list
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available (6):
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files (27):
  • ./showthread.php
  • ./global.php
  • ./includes/class_bootstrap.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/functions_navigation.php
  • ./includes/class_friendly_url.php
  • ./includes/class_hook.php
  • ./includes/class_bootstrap_framework.php
  • ./vb/vb.php
  • ./vb/phrase.php
  • ./includes/functions_facebook.php
  • ./includes/functions_calendar.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_notice.php
  • ./includes/functions_threadedmode.php
  • ./packages/vbattach/attach.php
  • ./vb/types.php
  • ./vb/cache.php
  • ./vb/cache/db.php
  • ./vb/cache/observer/db.php
  • ./vb/cache/observer.php 

Hooks Called (71):
  • init_startup
  • friendlyurl_resolve_class
  • init_startup_session_setup_start
  • database_pre_fetch_array
  • database_post_fetch_array
  • init_startup_session_setup_complete
  • global_bootstrap_init_start
  • global_bootstrap_init_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • load_show_variables
  • load_forum_show_variables
  • global_state_check
  • global_bootstrap_complete
  • global_start
  • style_fetch
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • strip_bbcode
  • friendlyurl_clean_fragment
  • friendlyurl_geturl
  • forumjump
  • cache_templates
  • cache_templates_process
  • template_register_var
  • template_render_output
  • fetch_template_start
  • fetch_template_complete
  • parse_templates
  • fetch_musername
  • notices_check_start
  • notices_noticebit
  • process_templates_complete
  • friendlyurl_redirect_canonical
  • showthread_post_start
  • showthread_query_postids_threaded
  • showthread_threaded_construct_link
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • memberaction_dropdown
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • build_navigation_data
  • build_navigation_array
  • check_navigation_permission
  • process_navigation_links_start
  • process_navigation_links_complete
  • set_navigation_menu_element
  • build_navigation_menudata
  • build_navigation_listdata
  • build_navigation_list
  • set_navigation_tab_main
  • set_navigation_tab_fallback
  • navigation_tab_complete
  • fb_like_button
  • showthread_complete
  • page_templates