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 4 of 4
  1. #1
    New Coder
    Join Date
    Jun 2005
    Posts
    35
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to separate pages using php?

    Hi, I tasked to generate a bill using php.

    The sample bill looks like this

    billing name :abc
    account no:12345

    summary

    9111 1111
    9222 2222

    Details

    mobile number 9111 1111

    number of outgoing calls 29
    number of sms 30
    mobile number 9111 1111

    mobile number 9222 2222

    number of outgoing calls 29
    number of sms 30

    but since the details portion is variable how to I separate the pages? thks
    Reply

  • #2
    Regular Coder
    Join Date
    Feb 2005
    Location
    West Midlands, UK
    Posts
    623
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'm not 100% sure what you're asking, but if you just want a way to store and retrieve each separate billing account's details then the easiest way is by using a database. That way to pull up the details for a certain account you just tailor your query to select that account, eg:
    PHP Code:
    $result mysql_query("SELECT * FROM $tablename WHERE $account='12345' AND name='abc' LIMIT 1"); 

  • #3
    New Coder
    Join Date
    Jun 2005
    Posts
    35
    Thanks
    0
    Thanked 0 Times in 0 Posts

    how to insert line break using php

    billing name :abc
    account no:12345

    summary

    9111 1111 $123
    9222 2222 $456
    9333333 $789

    Details

    mobile number 9111 1111

    number of outgoing calls 29
    number of sms 30

    mobile number 9222 2222

    number of outgoing calls 29
    number of sms 30
    coolroam $87
    pdid $80

    -----------------------------------Page 1
    <comment if it is already one page, then should insert line break and indicate page 1---->

    mobile 9333 3333

    number of outgoing calls 29
    number of sms 30

    details in each mobile is variable hence insertion of line break is also variable.

    So my question is how to insert line breaks when we don't know how long is the detail of each mobile going to be? Not only that the the summary is also varying initially.

    thks.

  • #4
    Regular Coder
    Join Date
    Mar 2004
    Location
    Australia
    Posts
    217
    Thanks
    0
    Thanked 1 Time in 1 Post
    you could create 2 seperate pages. 1 for the top page and 1 for the bottom. and then create an include on the first page below were you retrieve all the information.

    i.e

    page1:
    PHP Code:
    echo " <-- place detailed information for the top here --> ";
    // include second page
    include('path/to/page.php'); 
    page2:
    PHP Code:
    echo "All other information"
    i have no idea if thats what you mean... but thats what it sounds like to me


  •  

    Posting Permissions

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