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 6750387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:48:04+00:00 2026-05-26T12:48:04+00:00

I am trying to make a website that reads from a csv file and

  • 0

I am trying to make a website that reads from a csv file and render the data on the screen in a printable format (it is for printing tickets). The page creates 2 tickets per row and loops threw until it runs out of data. It all works perfectly and looks just the way i want it but, when i print it the 3rd row down has one of the rows of text move up onto the line above it.

My question is how can i make it print the way it is seen on the screen and why would it screw up only the 3rd row when all rows are made with the same code.

Thanks
EDIT:

while (!feof($file_handle)){`
$csvText = fgetcsv($file_handle, 1024);
    $username = $csvText[1];
    $password = $csvText[2];
    $profile = $csvText[3];
    $daysValid = $csvText[4];
    $expiry = $csvText[5];

if($pos == 0)
{
if($count == 5){
echo "<p><br /></p>";

$count = 0;
}else{
$count++;
}
echo "<div class='itemRow'>";
echo "<div class='left'>";
$pos = 1;
?>
<h4 class="centre">Internet Access Voucher</h4>
<img class="image" src="./icon.jpg" />
<div class="info">
<table>
    <tr>
        <td>
            Username
        </td>
    </tr>
    <tr>
        <td>
            Password
        </td>
    </tr>
    <tr>
        <td>
            Profile
        </td>
    </tr>
    <tr>
        <td>
            Valid for
        </td>
    </tr>
    <tr>
        <td>
            Expiry date
        </td>
    </tr>
</table>
</div>
<div class="uniqueInfo">
<table>
    <tr>
        <td>
            <?php echo $username;?>
        </td>
    </tr>
    <tr>
        <td>
            <?php echo $password;?>
        </td>
    </tr>
    <tr>
        <td>
            <?php echo $profile;?>
        </td>
    </tr>
    <tr>
        <td>
            <?php echo $daysValid;?>
        </td>
    </tr>
    <tr>
        <td>
            <?php echo $expiry;?>
        </td>
    </tr>
</table>
</div>
<p class="centre"><br />Please remember to disconnect to stop each session.</p>
</div>
<br />

<?php
} else {
?>
<div class="right">
<h4 class="centre">Internet Access Voucher</h4>
<img class="imageRight" src="./icon.jpg" />
<div class="infoRight">
<table>
    <tr>
        <td>
            Username
        </td>
    </tr>
    <tr>
        <td>
            Password
        </td>
    </tr>
    <tr>
        <td>
            Profile
        </td>
    </tr>
    <tr>
        <td>
            Valid for
        </td>
    </tr>
    <tr>
        <td>
            Expiry date
        </td>
    </tr>
</table>
</div>
<div class="uniqueInfoRight">
<table>
    <tr>
        <td>
            <?php echo $username;?>
        </td>
    </tr>
    <tr>
        <td>
            <?php echo $password;?>
        </td>
    </tr>
    <tr>
        <td>
            <?php echo $profile;?>
        </td>
    </tr>
    <tr>
        <td>
            <?php echo $daysValid;?>
        </td>
    </tr>
    <tr>
        <td>
            <?php echo $expiry;?>
        </td>
    </tr>
</table>
</div>
<p class="centre"><br />Please remember to disconnect to stop each session.</p>
</div>

</div>

<?php
$pos = 0; 
}
}
?>

CSS

.centre
{
text-align:center;
}

.itemRow
{
position:relative;
top:0px;
}

.left
{
width:500px;
position:relative;
font-family:Comic Sans, Comic sans MS, cursive;
/*border-style:solid;
border-width:1px;*/
}

.right
{
width:500px;
position:absolute;
left:600px;
top:-20px;
font-family:Comic Sans, Comic sans MS, cursive;
/*(border-style:solid;
border-width:1px;*/
}

.image
{
position:absolute;
top:70px;
}

.info
{
position:relative;
left:63px;
}

.uniqueInfo
{
position:absolute;
left:250px;
top:42px;
}

.infoRight
{
position:relative;
left:63px;
top:0px;
}

.uniqueInfoRight
{
position:absolute;
left:250px;
top:65px;
}

.imageRight
{
position:absolute;
top:90px;
}
  • 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-05-26T12:48:05+00:00Added an answer on May 26, 2026 at 12:48 pm

    I suspect this might be the problem:

    if($count == 5){
        echo "<p><br /></p>";
    

    You have 2 per row, and increment $count after every ticket. So, $count = 5 would be after the fourth ticket, or when the third row starts. A sample HTML page would give me a better idea of what’s going on exactly, but I’d suggest doing something like

    <br style="clear: both;" />
    

    between the rows to split them cleanly. So before ticket 3 and 5 ($count = 3 and $count = 5).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to make a generic PL/SQL procedure to export data in specific XML format,
Trying to make a custom :confirm message for a rails form that returns data
I am trying to read data from excel file in asp.net. I have added
I am trying to make a website that can sign into other websites for
I'm trying to make a Google Maps widget for my website but all of
I'm trying to make a clean url for a blog on a dynamic website,
I am trying make long screen to vertical direction. So, I need a screen
Trying to make a make generic select control that I can dynamically add elements
i'm trying to make a live search for my mobile website, I don't want
I am trying to make an app that allows me to stream a video

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.