xiizth
-
Posts
9 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by xiizth
-
-
I haven't been able to work on this is quite a while. Life gets in the way.
I have been trying to make this whole process a lot more easy for me to maintain. I have decided to have a have php read a csv file and output to an html table. It seems to be working-ish. Still some bugs to work out. I guess the issue I have is the submit function that you helped me with before is now not working because the vars that I had no longer exist.
I hope im not doing the wrong thing by opening this topic back up.
this is my code...
<html><head><title>PPFD</title><link rel="stylesheet" href="css/lightbox.css" type="text/css" media="screen" /><script src="js/prototype.js" type="text/javascript"></script><script src="js/scriptaculous.js?load=effects,builder" type="text/javascript"></script><script src="js/lightbox.js" type="text/javascript"></script><style type="text/css">#checklist{ font-family: "Trebuchet MS", Arial, Helvetica, sans-serif; width: 100%; border-collapse: collapse;}#checklist td, #checklist th{ font-size-:1em; border:1px solid #98bf21; passing:3px 7px 2px 7px} #checklist th{ font-size:1.1em; text-align:center; padding-top:5px; padding-bottom:4px; background-color:#A7C942; color:#ffffff;}#checklist tr.alt td{ color:#000000; background-color:#EAF2D3;}</style></head><body><h1 align="center">PAINTED POST FIRE DEPARTMENT</h1><h1 align="center">ENGINE AND STATION CHECK SHEET</h1><!-- Truck name --><p align="center"><strong>B67</strong></p><!-- NAME YOU WANT TO GIVE TO THE TRUCK FORM --><form id="truck_check_m67_form" name="truck_check_m67_form" method="post" action="submit.php"><?phpecho '<table id="checklist"><tr><th width="35%">ENGINE CHECKS</th><th width="24%">ACCOUNTED</th><th width="30%">COMMENT</th><th width="11%">PICTURE</th></tr>';$file_handle = fopen("b67.csv", "r");$odd = true;$colors = array('#E0E0E0', '#FFFFFF');while (!feof($file_handle) ) { $line_of_text = fgetcsv($file_handle, 1024); $odd = true; while ($line_of_text) { if ($odd) { $clr = $colors[0]; $odd = false; } else { $clr = $colors[1]; $odd = true; } echo ' <tr> <td align="center" valign="middle" bgcolor="'.$clr.'">'.$line_of_text[0].'</td><td align="center" valign="middle" bgcolor="'.$clr.'"><label><input type="radio" name="'.$line_of_text[1].'" value="YES" id="'.$line_of_text[1].'_accounted_0" />Yes</label><label><input type="radio" name="'.$line_of_text[1].'" value="NO" id="'.$line_of_text[1].'_accounted_1" />No</label></td><td align="center" valign="middle" bgcolor="'.$clr.'"><input type="text" name="'.$line_of_text[2].'_comment" id="'.$line_of_text[2].'_comment" /></td><td align="center" valign="middle" bgcolor="'.$clr.'"><a href="images/image_comming_soon.jpg" rel="lightbox"><img src="images/question_mark_icon.jpg" width="30" height="30" /></a></td> </tr>'; $line_of_text = fgetcsv($file_handle, 1024); } }fclose($file_handle); echo '</table>'; ?><p align="center"><input name="email" type="hidden" value="B67_TRUCK_CHECKLIST@PPFD.COM" size="30" /></p><p align="center"><input type="submit" name="SUBMIT" id="SUBMIT" value="Submit" /></p></form></body></html>
-
Thank you for all your help!
-
Removing the 1 from strlen seemed to fix the issue! is there a way for it to not scan the submit request? Thank you for your help. You have really made my day!
-
checking x2_spanner_wrenches_titleposition of _title: 19length: 25checking x2_spanner_wrenchesposition of _title:length: 19checking x2_spanner_wrenches_commentposition of _title:length: 27checking class_a_foam_titleposition of _title: 12length: 18checking class_a_foamposition of _title:length: 12checking class_a_foam_commentposition of _title:length: 20checking emailposition of _title:length: 5checking SUBMITposition of _title:length: 6 Here is the output with the echos in there. Thanks
-
This is the output i am getting: checking x2_spanner_wrenches_titlechecking x2_spanner_wrencheschecking x2_spanner_wrenches_commentchecking class_a_foam_titlechecking class_a_foamchecking class_a_foam_commentchecking emailchecking SUBMITYour mail was sent successfully Shouldn't it echo the title, item, and comment? Thanks
-
Thank you for the reply. I should have started off with saying that I am very new to php. So I really appreciate your help. I’ve attached one of the previous html forms with the corresponding php script. It works; I just know there is a better way of achieving the same goal without retyping all the script over again. The vehicle check list I attached has the fewest amounts of items that we check for.Thank you so much!
-
This is not ment to be a double post. Just trying to provide more information. I dont want to have to keep copy and pasting the larger block of code over and over again.Thanks $class_a_foam = $_REQUEST["class_a_foam"];$class_a_foam_comment = $_REQUEST["class_a_foam_comment"]; //CLASS A FOAM$title="CLASS A FOAM";$item=$class_a_foam;$item_comment=$class_a_foam_comment; $message=$message . '<b><font color="black" size=4>' . $title . '</font></b><br>';if ($item=="YES")$message=$message . '<b><font color="blue">' . "THE " . $title . " IS ACCOUNTED FOR AND IN GOOD WORKING ORDER" . '</font></b><br>';else$message=$message . '<b><font color="red">' . "THERE IS A PROBLEM WITH THE " . $title . "!!!" . '</font></b><br>';$message=$message . '<font color="black">' . "COMMENT: " . $item_comment . '</font><br><br>';
-
I’ve been looking all over and I cannot seem to figure out how to do this…Id like to combine all of this… $message=$message . '<b><font color="black" size=4>' . $title . '</font></b><br>';if ($item=="YES")$message=$message . '<b><font color="blue">' . "THE " . $title . " IS ACCOUNTED FOR AND IN GOOD WORKING ORDER" . '</font></b><br>';else$message=$message . '<b><font color="red">' . "THERE IS A PROBLEM WITH THE " . $title . "!!!" . '</font></b><br>';$message=$message . '<font color="black">' . "COMMENT: " . $item_comment . '</font><br><br>';I want to be able to call this block of code and have the variables inseted into it. I am creating this for my local fire department which i am a member of. Any help would be great.
Multiple Checkboxes issue
in PHP
Posted
I have a form for checking if equipment is in good working order for my local fire department. I cannot get the checkboxes to proccess correctly. What i am trying to do is...
This is just the mid section of the form... The $line_of_text var is loaded form a csv file.
This is a bit of the submit code
depending on the condition of the check box it should add to the $message var. Not sure why it is acting wacky