Hi all,
I have to design a form where User can fill some details. After he submits the form it should be viewed for final confirmation. If everything is fine, then there should be two options. Save as PDF and Send mail.

if save as pdf -> the submitted page should be saved as a pdf file.

else send mail -> An email should be triggered to two email(one for me and other for customer) with all the filled in details

Could anyone help me out here ??????

Thanks in advance.

I got everything correct upto form submission.

Recommended Answers

All 5 Replies

what do you have sofar (code)
and what is exacty the the part you have a problem with?

give more information

give more information

Thank you very much for your reply.

Now I designed two php pages where user can enter inputs in one page and the other page to display the filled in details.

So in the second page there should be two buttons or links. Save page as PDF | Send page by email.

So I need some scripts to do the functionality.

Please let me know what information you need.


I'm not gona do your home work for you
If you have a specific problem, post your code and the error maessage. And i might have a look.

I'm not gona do your home work for you
If you have a specific problem, post your code and the error maessage. And i might have a look.

		//Function to Remove Null values from arrays
		function is_notnull($v) {
 			return !is_null($v);
		$file = array(); //Arrays to store Table Values of Sample Information
		$sample = array();
		$lane = array();
		$library = array();
		$sampletype = array();
		$count = $_REQUEST['count']; //Count of Rows of the table 
		$date = $_REQUEST['date5']; //Date of Request
		$name = $_REQUEST['name']; //Name 
		$inst = $_REQUEST['institution'];
		$phone = $_REQUEST['phone'];
		$email = $_REQUEST['email'];
		$address = $_REQUEST['address'];
		$fax = $_REQUEST['fax'];
		$objective = $_REQUEST['objective'];
		$experiment = $_REQUEST['experiment'];
		$instrument = $_REQUEST['instrument'];
		$experimenttype = $_REQUEST['experimenttype'];
		$enrichment = $_REQUEST['enrichment'];
		$exome = $_REQUEST['exome'];
		$regionsize = $_REQUEST['regionsize'];
		$datatype = $_REQUEST['datatype'];
		$insertsize = $_REQUEST['insertsize'];
		$reference = $_REQUEST['reference'];
			$sample[] = $_REQUEST['sample'.$i];
			$file[] = $_REQUEST['file'.$i];
			$lane[] = $_REQUEST['lane'.$i];
			$library[] = $_REQUEST['library'.$i];
			$sampletype[] = $_REQUEST['sampletype'.$i];			

		$sample = array_filter($sample); // Removing null values from all the arrays
		$file = array_filter($file);
		$lane = array_filter($lane);
		$library = array_filter($library);
		$sampletype = array_filter($sampletype);
		$i = sizeof($sample); //Reducing Array Size based on the number of rows filledin 
		$rcdata = $_REQUEST['rcdata'];
		$possibility = $_REQUEST['possibility'];
		$coc = $_REQUEST['coc'];
		$dataanalysis = $_REQUEST['dataanalysis'];
		$graphs = $_REQUEST['graphs'];
		$bioanalysis = $_REQUEST['bioanalysis'];
		$comments = $_REQUEST['comments'];
		$ref = $_REQUEST['ref'];
<div align="center">
<form name="mailform" method="post" action="mail.php">
<legend>Contact Details : </legend>
<table width="80%" cellpadding="0" cellspacing="3" border="0">
<tr><td width="50%">Date of Request :</td><td><?php echo $date; ?></td></tr>
<tr><td>Name : </td><td><?php echo $name; ?></td></tr>
<tr><td>Institution :</td><td><?php echo $inst; ?></td></tr>
<tr><td>Address :</td><td><?php echo $address;  ?></td></tr>
<tr><td>Phone :</td><td><?php echo $phone; ?></td></tr>
<tr><td>E-mail :</td><td><?php echo $email; ?></td></tr>
<tr><td>Fax :</td><td><?php echo $fax;  ?></td></tr>
<legend>Experiment Details : </legend>
<table width="80%" cellpadding="0" cellspacing="3" border="0">
<tr><td width="50%">Objective of the Experiment : </td><td><?php echo $objective;?></td></tr>
<tr><td>Experiment : </td><td><?php echo $experiment;?></td></tr>
<tr><td>Instrument : </td><td><?php echo $instrument;?></td></tr>
<tr><td>Experiment Type : </td><td><?php echo $experimenttype;?></td></tr>
<?php if($experimenttype=='Targeted Resequencing & Exome Sequencing')
{ ?>
	<tr><td>Enrichment Protocol (If Exome/TargetSeq) : </td><td><?php echo $enrichment;?></td></tr>
	<tr><td>Is enrichment file available in .bed for data analysis? This is recommended and it should be provided with inputs 	files.(Applicable only for targeted-seq/exome) : </td><td><?php echo $exome;?></td></tr>
	<tr><td>Exome enrichment region size (Mb) : </td><td><?php echo $regionsize;?></td></tr>
<?php } ?>    
<tr><td>Data Type : </td><td><?php echo $datatype;?></td></tr>
<tr><td>Insert Size : </td><td><?php echo $insertsize;?></td></tr>
<tr><td>Reference Sequence Details (if any) : </td><td><?php echo $reference;?></td></tr>
<h5>Sample Information and data files provided for analysis : </h5>
echo "<table border=1 cellpadding=0 cellspacing=0>";
		echo "<th>No</th><th>Sample Name or identifier</th><th>File name(s) of sequence reads<sup>#</sup></th><th>No of lane(s) of data generated for sample</th><th>Library Type+(Single/PE/MP)</th><th>Sample Type<sup>*</sup></th>";
			echo "<tr>";
				echo "<td>".($x+1)."</td>";
				echo "<td>".$sample[$x]."</td>";
				echo "<td>".$file[$x]."</td>";
				echo "<td>".$lane[$x]."</td>";
				echo "<td>".$library[$x]."</td>";
				echo "<td>".$sampletype[$x]."</td>";
			echo "</tr>";
		echo "</table>";
<table width="80%" cellpadding="0" cellspacing="3" border="0">
<tr><td width="50%">Raw or Cleaned Data :</td><td><?php echo $rcdata;?></td></tr>
<tr><td>Possibility of contamination in sample : </td><td><?php echo $possibility;?></td></tr>
<tr><td>If chance of contamination : </td><td><?php echo $coc;?></td></tr>
<legend>Analysis Requirements : </legend>
<table width="80%" cellpadding="4" cellspacing="5" border="0">
<tr><td width="50%">List of data analysis requirements : </td><td width="50%"><?php echo $dataanalysis;?></td></tr>
<tr><td width="50%">Graphs / Charts required : </td><td width="50%"><?php echo $graphs;?></td></tr>
<?php if($bioanalysis) { ?>
<tr><td width="50%">Biological analysis requirements : </td><td width="50%"><?php echo $bioanalysis;?></td></tr> 
<?php } else {} ?>
<?php if($comments) { ?>
<tr><td width="50%">Any additional Comments : </td><td width="50%"><?php echo $comments;?></td></tr>
<?php } else {} ?>
<?php if($ref) { ?>
<tr><td width="50%">Publications / References, if any : </td><td width="50%"><?php echo $ref;?></td></tr>
<?php } else {} ?>
<p align="center">Do You want to Make Changes then Click Here to <input type="button" name="Go Back" value="Go Back" onClick="javascript:history.back();">
<input type="submit" name="Submit" value="Submit"></p></div></form>
<?php } else { ?>
<div align="center">
<form name="req" action="<?php $_SERVER['PHP_SELF']; ?>" method="post" onSubmit="return validate_form();">
<legend>Contact Details : </legend>
<table width="90%" cellpadding="0" cellspacing="3" border="0">
<tr><td>Date of Request :</td><td width="25%"><?php
	  $myCalendar = new tc_calendar("date5", true, false);
	  $myCalendar->setDate(date('d'), date('m'), date('Y'));
	  $myCalendar->setYearInterval(2000, 2015);
	  $myCalendar->dateAllow('2008-05-13', '2015-03-01');
	  $myCalendar->setDateFormat('j F Y');
	  $myCalendar->setAlignment('left', 'bottom');
	  $myCalendar->setSpecificDate(array("2011-04-01", "2011-04-04", "2011-12-25"), 0, 'year');
<tr><td width="20%">Name<sup class="req">*</sup> :</td><td width="25%"><input type="text" name="name" id="name"></td><td width="20%">Institution<sup class="req">*</sup> :</td><td width="25%"><input type="text" name="institution" id="institution"></td></tr>
<tr><td width="20%">Address :</td><td width="25%"><textarea cols="17" rows="2" name="address" id="address"></textarea></td><td width="20%">Phone<sup class="req">*</sup> :</td><td width="25%"><input type="text" name="phone" id="phone"></td></tr>
<tr><td width="20%">Fax :</td><td width="25%"><input type="text" name="fax" id="fax"></td><td width="25%">E-mail<sup class="req">*</sup> :</td><td width="25%"> <input type="text" name="email" id="email"></td></tr>
<legend>Experiment Details : </legend>
<table width="90%" cellpadding="3" cellspacing="0" border="0">
<tr><td width="50%">Objective of the Experiment<sup class="req">*</sup> : </td><td><textarea cols="40" rows="5" name="objective" id="objective"></textarea></td></tr>
<tr><td width="50%">Experiment<sup class="req">*</sup> : </td><td width="50%"><input type="text" name="experiment" id="experiment"></td></tr>
<tr><td width="50%">Instrument<sup class="req">*</sup> : </td><td width="50%"><select name="instrument" id="instrument" ><option value="">--Select--</option>
<option value="ABI SOLiD 3 or SOLiD 4">ABI SOLiD 3 or SOLiD 4</option>
<option value="ABI SOLiD 5500 or SOLiD 5500xl">ABI SOLiD 5500 or SOLiD 5500xl</option>
<option value="IonTorrent – Ion PGM Sequencer">IonTorrent – Ion PGM Sequencer</option>
<option value="Illumina - Solexa">Illumina - Solexa</option>
<option value="Illumina - GA series">Illumina - GA series</option>
<option value="Illumina - HiSeq or HiScan or MiSeq">Illumina - HiSeq or HiScan or MiSeq</option>
<option value="Roche 454">Roche 454</option>
<option value="Helicos - Heliscope">Helicos - Heliscope</option>
<option value="PacBio - RS">PacBio - RS</option></select></td></tr>
<tr><td width="50%">Experiment Type<sup class="req">*</sup> : </td><td width="50%">
<select name="experimenttype" id="experimenttype" onChange="changeRow();">
<option value="" selected>--Select--</option>
<option value="De Novo Sequencing">De Novo Sequencing</option>
<option value="Targeted Resequencing &amp; Exome Sequencing">Targeted Resequencing &amp; Exome Sequencing</option>
<option value="Whole Genome Resequencing">Whole Genome Resequencing</option>
<option value="Chromatin Immunoprecipitation Sequencing (ChIP-Seq)">Chromatin Immunoprecipitation Sequencing (ChIP-Seq)</option>
<option value="Methylation Analysis">Methylation Analysis</option>
<option value="Small RNA Analysis">Small RNA Analysis</option>
<option value="Whole Transcriptome Analysis">Whole Transcriptome Analysis</option>
<tr id="en" style="visibility:hidden;">
<td width="50%">Enrichment Protocol (If Exome/TargetSeq)<sup class="req">*</sup></td><td width="50%"><input type="text" name="enrichment" id="enrichment"></td></tr>
<tr id="inputs" style="visibility:hidden;">
<td width="50%">Is enrichment file available in .bed for data analysis? This is recommended and it should be provided with inputs files.(Applicable only for targeted-seq/exome)<sup class="req">*</sup></td><td width="50%"><select name="exome" id="exome"><option value="">--Select--</option>
<option value="yes">Yes</option><option value="no">No</option></select></td></tr>
<tr id="rs" style="visibility:hidden;">
<td width="50%">Exome enrichment region size (Mb)<sup class="req">*</sup></td><td width="50%"><input type="text" name="regionsize" id="regionsize"></td></tr><tr><td width="50%">Data Type<sup class="req">*</sup></td><td width="50%"><select name="datatype" id="datatype" onChange="changeRow2();">
<option value="">--Select--</option>
<option value="Fragment">Fragment(SE)</option>
<option value="Paired End">Paired End(PE)</option>
<option value="Mate Pair">Mate Pair(MP)</option>
<option value="Mixed Libraries">Mixed Libraries</option>
<tr id="is" style="visibility:hidden;"><td width="50%">Insert Size<sup class="req">*</sup></td><td width="50%"><input type="text" name="insertsize" id="insertsize"></td></tr>
<tr><td width="50%">Reference Sequence Details (if any)<sup class="req">*</sup></td><td width="50%"><input type="text" name="reference" id="reference"></td></tr>
<h5>Sample Information and data files provided for analysis : </h5>
<input type="hidden" name="count" value="" id="count">
<!--<td><input type="text" name="txtRow1" size="40" /></td>-->
<!--<input type="button" value="Add" onclick="addRowToTable();" />
<input type="button" value="Remove" onclick="removeRowFromTable();" /> -->
<table width="80%" border="1" id="tblSample" cellpadding="3" cellspacing="0">
<th>Sample Name or identifier</th>
<th>File name(s) of sequence reads<sup>#</sup></th>
<th>No of lane(s) of data generated for sample</th>
<th>Library Type+(Single/PE/MP)</th>
<th>Sample Type<sup>*</sup></th>
<tr><td>1</td><td><input type="text" name="sample1" id="sample1"></td>
<td><input type="text" name="file1" id="file1"></td>
<td><input type="text" name="lane1" id="lane1"></td>
<td><input type="text" name="library1" id="library1"></td>
<td><input type="text" name="sampletype1" id="sampletype1"></td></tr>
<tr><td>2</td><td><input type="text" name="sample2" id="sample2"></td>
<td><input type="text" name="file2" id="file2"></td>
<td><input type="text" name="lane2" id="lane2"></td>
<td><input type="text" name="library2" id="library2"></td>
<td><input type="text" name="sampletype2" id="sampletype2"></td></tr>
<tr><td>3</td><td><input type="text" name="sample3" id="sample3"></td>
<td><input type="text" name="file3" id="file3"></td>
<td><input type="text" name="lane3" id="lane3"></td>
<td><input type="text" name="library3" id="library3"></td>
<td><input type="text" name="sampletype3" id="sampletype3"></td></tr>
<tr><td>4</td><td><input type="text" name="sample4" id="sample4"></td>
<td><input type="text" name="file4" id="file4"></td>
<td><input type="text" name="lane4" id="lane4"></td>
<td><input type="text" name="library4" id="library4"></td>
<td><input type="text" name="sampletype4" id="sampletype4"></td></tr>
<tr><td>5</td><td><input type="text" name="sample5" id="sample5"></td>
<td><input type="text" name="file5" id="file5"></td>
<td><input type="text" name="lane5" id="lane5"></td>
<td><input type="text" name="library5" id="library5"></td>
<td><input type="text" name="sampletype5" id="sampletype5"></td></tr>
<tr><td>6</td><td><input type="text" name="sample6" id="sample6"></td>
<td><input type="text" name="file6" id="file6"></td>
<td><input type="text" name="lane6" id="lane6"></td>
<td><input type="text" name="library6" id="library6"></td>
<td><input type="text" name="sampletype6" id="sampletype6"></td></tr>
<tr><td>7</td><td><input type="text" name="sample7" id="sample7"></td>
<td><input type="text" name="file7" id="file7"></td>
<td><input type="text" name="lane7" id="lane7"></td>
<td><input type="text" name="library7" id="library7"></td>
<td><input type="text" name="sampletype7" id="sampletype7"></td></tr>
<tr><td>8</td><td><input type="text" name="sample8" id="sample8"></td>
<td><input type="text" name="file8" id="file8"></td>
<td><input type="text" name="lane8" id="lane8"></td>
<td><input type="text" name="library8" id="library8"></td>
<td><input type="text" name="sampletype8" id="sampletype8"></td></tr>
<tr><td>9</td><td><input type="text" name="sample9" id="sample9"></td>
<td><input type="text" name="file9" id="file9"></td>
<td><input type="text" name="lane9" id="lane9"></td>
<td><input type="text" name="library9" id="library9"></td>
<td><input type="text" name="sampletype9" id="sampletype9"></td></tr>
<tr><td>10</td><td><input type="text" name="sample10" id="sample10"></td>
<td><input type="text" name="file10" id="file10"></td>
<td><input type="text" name="lane10" id="lane10"></td>
<td><input type="text" name="library10" id="library10"></td>
<td><input type="text" name="sampletype10" id="sampletype10"></td></tr>
<p align="right" style="margin-right:20px;"><a href="javascript:addRowToTable();">Add Row</a> | <a href="javascript:removeRowFromTable();">Delete Row</a></p>
<p align="justify"><u>Note: Please add more number of rows in case of large number of samples</u><br />
+ Library type can be either fragment, paired-end or mate-pair<br />
* Specify the type of sample clearly (eg: tumor/normal/cell-lineA/mito)<br />
# List the name of sequence read files associated to the sample mentioned in column1.<br /> The file names/patterns should match with the files provided in the data set.</p>
<table width="90%" cellpadding="4" cellspacing="5" border="0">
<tr><td width="50%"></td><td width="50%"></td></tr>
<tr><td width="50%">Raw or Cleaned Data (adaptor removed / quality filtered / or any other)<sup class="req">*</sup></td><td width="50%"><input type="text" name="rcdata" id="rcdata"></td></tr>
<tr><td width="50%">Possibility of contamination in sample<sup class="req">*</sup></td><td width="50%"><select name="possibility" id="possibility" onChange="changeRow3();">
<option value="">--Select--</option>
<option value="Yes">Yes</option>
<option value="No">No</option></select></td></tr>
<tr id="coc2" style="visibility:hidden;"><td width="50%">If chance of contamination, specify the organism to consider for filtering reads<sup class="req">*</sup></td><td width="50%"><input type="text" name="coc" id="coc"></td></tr>
<legend>Analysis Requirements</legend>
<table width="80%" cellpadding="4" cellspacing="5" border="0">
<tr><td width="50%">List of data analysis requirements<sup class="req">*</sup></td><td width="50%"><textarea cols="40" rows="5" name="dataanalysis" id="dataanalysis"></textarea></td></tr>
<tr><td width="50%">Graphs / Charts required<sup class="req">*</sup></td><td width="50%"><textarea cols="40" rows="5" name="graphs" id="graphs"></textarea></td></tr>
<tr><td width="50%">Biological analysis requirements</td><td width="50%"><textarea cols="40" rows="5" name="bioanalysis" id="bioanalysis"></textarea></td></tr>
<tr><td width="50%">Any additional Comments</td><td width="50%"><textarea cols="40" rows="5" name="comments" id="comments"></textarea></td></tr>
<tr><td width="50%">Publications / References, if any</td><td width="50%"><textarea cols="40" rows="5" name="ref" id="ref"></textarea></td></tr>
<p align="center"><input type="submit" name="submit" value="Submit"></p>
<?php } ?>

The above is the code I have.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.