Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7819575
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T07:00:21+00:00 2026-06-02T07:00:21+00:00

I’m currently using a open source solution for my invoices called MyClientBase and everything

  • 0

I’m currently using a open source solution for my invoices called MyClientBase and everything is working really well.

Normally when I generate an invoice to a client, I can either do it as a PDF or e-mail (or HTML). When generating the HTML-invoice the link to it is secure (only logged in users can view the invoice) so I’m trying to make publicly viewable invoices that generates a md5-html that we can send in the e-mails.

Right now it’s working by generating a md5-html file in the right folder and everything is great, except that the html-file is empty. I’ve set the CHMOD to 777 on the folder and tried several solutions but nothing really works. Instead it generates two invoices (duplicates) on the same page and leaves the html-file empty. So I think some skilled php/html-guy might figure this one out.

Here’s the code I’m using right now:

function generate_html() {

$invoice_id = uri_assoc('invoice_id');

$this->load->library('invoices/lib_output');

$this->load->model('invoices/mdl_invoice_history');

$this->mdl_invoice_history->save($invoice_id, $this->session->userdata('user_id'), $this->lang->line('generated_invoice_html'));

$this->lib_output->html($invoice_id, uri_assoc('invoice_template'));

 /*  ------------------ GENERATE MD5-HTML ---------------------------  */
     $file = md5('my_output_path'.$invoice_id).'.html';

     echo "<a href='my_output_path".$file."'>Link to client invoice</a>";
     $f = fopen('my_invoice_path'.$file, 'w');
     $template = $this->load->view('invoice_templates/default_template');
 fwrite($f, $template);true;    
     /*  ------------------ End generate md5 ---------------------------  */
     }

I appreciate any help I can get!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T07:00:22+00:00Added an answer on June 2, 2026 at 7:00 am

    try this, it should work, what it does is it fetches the output, and store it in a variable then this variable will be the content of that file it might need some tweaks tell me if you get any errors

    function generate_html() {
    
    $invoice_id = uri_assoc('invoice_id');
    
    $this->load->library('invoices/lib_output');
    
    $this->load->model('invoices/mdl_invoice_history');
    
    $this->mdl_invoice_history->save($invoice_id, $this->session->userdata('user_id'), $this->lang->line('generated_invoice_html'));
    
    $this->lib_output->html($invoice_id, uri_assoc('invoice_template'));
    
     /*  ------------------ GENERATE MD5-HTML ---------------------------  */
         $file = md5('my_output_path'.$invoice_id).'.html';
    
         echo "<a href='my_output_path".$file."'>Link to client invoice</a>";
         $f = fopen('my_invoice_path'.$file, 'w');
         ob_start(); // start output buffer flow
         $old_content = ob_get_contents();
         ob_clean();
         $this->load->view('invoice_templates/default_template');
         $template = ob_get_contents(); // assign buffer contents to variable
         ob_end_clean(); // end buffer and remove buffer contents
         fwrite($f, $template);true;   
         echo $old_content;
    
         /*  ------------------ End generate md5 ---------------------------  */
         }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I want use html5's new tag to play a wav file (currently only supported
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I am currently running into a problem where an element is coming back from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.