Note that there are some explanatory texts on larger screens.

plurals
  1. POSearch and Export button on single form in php
    primarykey
    data
    text
    <p>I have a form with 2 buttons.I want it to redirect my results on a page called data_results based on the post action from the checkbox selection results.When I click on export it uses that action. My problem is that its doesnt redirect or take the values.</p> <pre><code>&lt;form name="search" action="" method="POST" enctype="multipart/form-data"&gt; &lt;input name="txtsearch" type="text" /&gt; &lt;select name="searchby" size="1"&gt; &lt;option&gt;Search by&lt;/option&gt; &lt;option value="rule"&gt;Rule Number&lt;/option&gt; &lt;option value="pattern_num"&gt;Pattern Number&lt;/option&gt; &lt;/select&gt; &lt;input type="submit" name="btnsearch" value="Search" /&gt;&amp;nbsp;&amp;nbsp;&lt;input type="submit" name="btnexport" value="Export" / &lt;P&gt;&lt;/P&gt; &lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt; &lt;tr&gt; &lt;td width="60"&gt;&lt;span class="content"&gt;&lt;strong&gt;ID&lt;/strong&gt;&lt;/span&gt;&lt;/td&gt; &lt;td width="120" align="center"&gt;&lt;strong&gt;&lt;span class="content"&gt;STAMP&lt;/span&gt;&lt;/strong&gt;&lt;/td&gt; &lt;td width="83" align="center"&gt;&lt;span class="content"&gt;&lt;strong&gt;RULE&lt;/strong&gt;&lt;/span&gt;&lt;/td&gt; &lt;td width="139"&gt;&lt;span class="content"&gt;&lt;strong&gt;TEST&lt;/strong&gt; &lt;strong&gt;STRING&lt;/strong&gt;&lt;/span&gt;&lt;/td&gt; &lt;td width="90" style="overflow:auto"&gt;&lt;span class="content"&gt;&lt;strong&gt;TEST&lt;/strong&gt; &lt;strong&gt;RESULT&lt;/strong&gt;&lt;/span&gt;&lt;/td&gt; &lt;td width="100%"&gt;&lt;span class="content"&gt;&lt;strong&gt;TYPE&lt;/strong&gt;&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;?php global $database; $sql="SELECT * FROM tbl ORDER BY id DESC"; $result_set = $database-&gt;query($sql); while ($row=$database-&gt;fetch_array($result_set)){ ?&gt; &lt;tr&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td width="60" valign="top"&gt;&lt;span class="content"&gt;&lt;?php echo $row['id']; ?&gt;&lt;/span&gt;&lt;/td&gt; &lt;td valign="top" width="120" align="right"&gt;&lt;span class="content"&gt;&lt;?php echo $row['stamp']; ?&gt;&lt;/span&gt;&lt;/td&gt; &lt;td valign="top" width="139" style="overflow:auto;"&gt;&lt;span class="content"&gt;&lt;?php echo $row['test_string']; ?&gt;&lt;/span&gt;&lt;/td&gt; &lt;td valign="top" width="90"&gt;&lt;span class="content"&gt;&lt;?php echo $row['test_result']; ?&gt;&lt;/span&gt;&lt;/td&gt; &lt;td valign="top" width="100%"&gt;&lt;span class="content"&gt;&lt;?php echo $row['type']; ?&gt;&lt;/span&gt;&lt;/td&gt; &lt;td valign="top" width="50"&gt;&lt;span class="content"&gt;&lt;input name="check_list[]" type="checkbox" id="check_list[]" value="&lt;?php echo $row['id']; ?&gt;" /&gt;&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;&lt;?php } ?&gt;&lt;/form&gt; &lt;/table&gt; &lt;?php if(!empty($_POST['check_list'])) { foreach($_POST['check_list'] as $check) { $sql="SELECT * FROM tblrules WHERE id={$check}"; $result_set = $database-&gt;query($sql); while ($row=$database-&gt;fetch_array($result_set)){ echo "filter {"."&lt;br&gt;"; echo "\t\t\t\t"."test {"."&lt;br&gt;"; echo "\t\t\t\t"."type=&gt;".$row['type']."&lt;br&gt;"; echo "\t\t\t\t"."add_tag =&gt; sort_order"."&lt;br&gt;"; echo "\t"."}"."&lt;br&gt;"; echo "\t"."}"."&lt;br&gt;"; } } } ?&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload