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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T18:58:39+00:00 2026-06-17T18:58:39+00:00

I have created a web based print log that sends the form data to

  • 0

I have created a web based print log that sends the form data to a .CSV file using PHP. Everything seems to be working correctly. Although, I have found one small bug that I cannot seem to resolve (yet).

There are seven entries on the print log that submit to the .CSV file. Two of those entries are drop down lists that are being populated from two different .DAT files which are updated on a daily basis.

The issue:

After successfully submitting the form data and opening the .CSV file, I notice that the two entities that use drop down lists are formatted different than the rest of the data.

You can see what I mean by viewing the following screen shot:
http://i49.tinypic.com/2n87eko.jpg

I believe the issue is coming from the following code that pulls the “Project Number” and “Employee Name” drop down box data:

<?php
$file = 'dat_files/Employees.dat';

$handle = @fopen($file, 'r');
if ($handle) {
   while (!feof($handle)) {
       $line = fgets($handle, 4096);
       $item = explode('|', $line);
       echo '<option value="' . $item[0] . '">' . $item[0] . '</option>' . "\n";
   }
   fclose($handle);
}
?>

Any help or ideas would be greatly appreciated. Thank you.

Below is the code that is used to send the form data to the .CSV file.

    <?php

if(isset($_POST["submit"]))
{ 
    $type = $_POST["type"]; 
    $date = $_POST["date"]; 
    $job_number = $_POST["job_number"]; 
    $phase = $_POST["phase"];
    $task = $_POST["task"];
    $number_copies = $_POST["number_copies"];
    $name = $_POST["name"];


    if(empty($type)||empty($date)||empty($job_number)||empty($phase)||empty($task)||empty($number_copies)||empty($name))  
    { 
        header('Location: submit/unsuccessful.htm'); 
        die; 
    } 
    $cvsData = "\"$type\",\"$date\",\"$job_number\",\"$phase\",\"$task\",\"$number_copies\",\"$name\"".PHP_EOL; 
    $fp = fopen("log.csv", "a"); 

    if($fp) 
    { 
        fwrite($fp,$cvsData); // Write information to the file 
        fclose($fp); // Close the file 
        header('Location: submit/successful.htm');

    }
}
?>
  • 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-17T18:58:40+00:00Added an answer on June 17, 2026 at 6:58 pm

    I am guessing, but am not really sure that the code you show is the code that echos the data to the screen inside the table shown in the screenshot. if that is true then what are all the option tags about?

    if not true, then we probably need to see a bit more source code to help you.

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

Sidebar

Related Questions

i have created an mvc3 web application that uses forms based authentication. one part
Background: I have created a CRUD web app using a java based RAD tool
I have a number data-driven web based applications that serve both internal and public
I have created a simple html-based web-page consisting of a form and some text,
I have created web pages where am using pixel to position various html elements.
I have created my web socket server and client using this simple tutorial here
I have created a web page that has two bars across the top of
I'm creating quick web app that needs to send a php-created message from within
We have build several web service based on .net. Now we want to create
I have created Web-Service in asp.net with c# . Now i want to pass

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.