My project required me to make a print button that should be able to print each personal detail in a page. I have about 1400 personal details, and that means 1400 pages to print.
I am using pagebreak at the print page.
And I am using a while statement to print all the personal details, it works fine as I expected, until page 504. So I think there's no problem with my code.
This is the example output for page 1 until 504:
On the following pages, 505 and so on, the page format keeps changing for each page and I really cannot figure out why because it works well on the previous 504 pages.
Is it actually so that it cannot be printed with a large number of pages?
Any suggestions or workarounds are very appreciated.
Thank you.
Have you tried temporarily deleting your 504th and 505th record to see if the issue to attributed to the data or your code? I see no reason why a while loop would fail in the middle of the records. You may want to post a snippet of your looping output code to allow more feedback here..
Related
I'm moreless curious about webpages that are indexed. An example is gamestop. When you are looking through their product lists they have indexed for multiple tabs like 123456 on the near the bottom of the page. I also notice this with many search engines and pages selling products. I know it sounds dumb to ask a question like this, but I've always been curious how to code a mutiple indexed page like the example listed above. I hope you fellow coders out there could provide some sample code to demonstrate this idea would be perfect. Plus, it could help me in future to see just how it is done. Please provide any info you can. Thank you :)
Actually the INDEXING you are referring is called Pagination. Whenever you have multiple items/Records and you want to show only some of them in one page and rest on the other. e.g. you have 100 records in the database and you want to show all of them but loading all at once will slow down your page. So what programmers do is, they use pagination.
What they do is , They will show first 10 records on one page. if you have 100 records in database. Then first page will show records from 1 to 10, 2nd page will show 11 to 20 and so on till the end.
use reference
http://code.tutsplus.com/tutorials/how-to-paginate-data-with-php--net-2928
or
Simple PHP Pagination script
I've got a working kendo grid with remote data from the webserver.
But the paging isn't working as expected. If the page gets loaded the first time, or I click on page 1 the server returns all the data available.
If I click on page 2 oder every other page than the first one it works fine.
The query seems to be correct as you can see in the screenshot from firebug.
So anyone got a hint for me where to look at?
Just found the problem. I was removing empty parameters on the serverside. So I was throughing away the "skip" which screwed the query up.
Alright so I've been pouring over this code for 16+ hours and I cannot find where the issue is. Before you say anything- I know I'm prone to SQL injection and I need to setup more prepared statements; once I get the code working my next step is to work on those issues. I also know I need to add the TRUE and 303 parameter to the Header call- I'm just trying to get it running at this point.
The code worked beautifully until I began working on eliminating form submission on refresh and adding redirects at the end.
The page that is having the problem is called updateorder.php and here is a Pastie link for it: http://pastie.org/9188291
I created a page called Issue.php to funnel everyone off the page and to eliminate the possibility of any of the html code outputting. That did not help.
I removed the ?> PHP closing tag from the end since all the code is PHP and eliminate any white space possibility. That didn't help either.
The page before this has several submit buttons. This page looks at what button was pushed and runs the code when it meets the conditions of the IF.
When I submit the form using the DeleteThisOrder button, it operates perfectly.
When I submit the form using the PrintOnly button, it operates perfectly.
When I submit the form using the UpdateOnly button, but $ThisStatus <>1, it runs perfectly.
Here are the problems:
If I hit the UpdateOnly button and $ThisStatus does ==1, then it remains on this page (updateorder.php) and the screen is blank.
The exact thing happens if I use the UpdateCommit button.
Something is happening when it runs this particular section of the UpdateOnly script: Sorry I don't have 10 reputation so it will not let me provide more links. Here is the Pastie number you can replace in the above Pastie link to see the code for this section: 9188298
And something happens when running this particular section of the UpdateCommit script: Sorry I don't have 10 reputation so it will not let me provide more links. Here is the Pastie number you can replace in the above Pastie link to see the code for this section: 9188306
Whatever it is doing it is causing it not to redirect. The SQL code executes and does everything it is supposed to do in the database; it's updating the order, it's updating inventory- all of that executes fine- it's just not redirecting and it stalls somewhere in the script before it redirects and leaves me with a blank screen.
I've done the advanced search on the site and looked at every thing I could find using the keywords PHP, MySQL, Redirect, with no clue as to why it's not working. I've went over this code line by line to look for white space, tried using the whole website address for the redirect, added a space between the colon and the link in the header... I've tried a lot of things. I've even tried unhealthy things like banging my head on my desk, hitting my head with my palm, and pulling my hair... no results. I really appreciate your time.
Just in case- here is the code in my required db connection file: Sorry I don't have 10 reputation so it will not let me provide more links. Here is the Pastie number you can replace in the above Pastie link to see the code for this section: 9188351
By the way... as you can probably tell I'm still learning so it may not be 'beautiful code' yet but I'm working on getting there. Thanks again for your help.
When in development add error reporting to the top of your file(s)
error_reporting(E_ALL);
ini_set('display_errors', 1);
This will signal any errors if they are found in your code.
As per the error message from your comments:
To get rid of that Cannot modify header information - headers already sent... message, place
<?php session_start(); ?><?php // rest of your code... as your first lines of code while getting rid of the other one where it's at now, followed by the rest of your code. Make sure there is nothing above that, HTML etc. including any white spaces. If you still get that error message, make sure it's saved as UTF-8 without BOM. (Consult footnotes)
For the Notice: Undefined index: UpdateOnly error message, make sure your form element is named with no typos. I.e. name="UpdateOnly" --- UpdateOnly is not the same as updateonly PHP is case-sensitive.
As for your $result->free(); you mention you don't have that function, so just remove it.
Footnotes:
BOM (aka byte order mark)
For more information on this subject, visit: https://en.wikipedia.org/wiki/Byte_order_mark
For more information on error reporting, visit: http://php.net/manual/en/function.error-reporting.php
I apologize ahead of time for the non descriptive title, as I wasn't really sure how to word this.
I've currently switched some of my Wordpress sites that have a responsive design that implement a slider over to WooSlider. Works super well, and I love it. However, there is something stopping me from switching all of my sites over. And I understand this is not a WooSlider only fault, but it's something I cannot Google and find out.
This is happening on every page view, even those without a slider.
In Google Analytics it shows domain.com/?wooslider-javascript=load&t=1352743207&ver=1.0.0 as a page view. For every single page. I obviously don't want this, but I don't know how to get rid of it.
Another example of this happening is using Gravity Forms with a referrer info plugin that shows page views, search query, browser, etc.
When the form is sent, the following is sent via email.
Page visited 1: domain.com/?wooslider-javascript=load&t=1352743207&ver=1.0.0 (http://domain.com/?wooslider-javascript=load&t=1352743207&ver=1.0.0)
Page visited 2: domain.com/about (http://domain.com/contact/about/
Page visited 3: domain.com/?wooslider-javascript=load&t=1352751787&ver=1.0.0 (http://domain.com/?wooslider-javascript=load&t=1352751787&ver=1.0.0)
Page visited 4: domain.com/contact/ (http://domain.com/contact/)
So obviously I don't want that js file to show up as a page view. How can I remedy this?
Thanks!
Google Analytics Configuration Mistake #2: Query String Variables
wooslider-javascript,t,ver
I've a php file which'll run a SQL script and fetch information about users.
Some user's information may span 2 or 3 pages while some might end in just 1.
I want to print the beginning of ever user's report in a new page. All these process has to be automated because there are some 400 users, and the client can't select page layout for every user or print them individually.
How can i achieve this? using PHP or Javascript?
Is there any library to do this?
Thanks :)
Your question was a little confusing, but now I think you're talking about doing page breaks in a print.css? If so you can use: page-break-before and page-break-after in your CSS.
So using CSS you would do something like:
div.pagecontainer { page-break-after:always; }
Where your page was contained in:
<div class="pagecontainer">page content here</div>
If you're just trying to figure out pagination. Take a look at this php solution.
You can also do completely client side pagination as mentioned in this question and this question.