Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Try this code, and demo is <a href="http://phpfiddle.org/main/code/udz-2vr" rel="nofollow">here</a> Please just use the idea not the exact copy.</p> <pre><code>&lt;?php error_reporting(E_ALL ^ E_NOTICE); //debugging if(@$_POST['submit'] == 'Submit'){ echo '&lt;pre&gt;'; print_r($_POST); echo '&lt;/pre&gt;'; echo "&lt;br&gt;\n"; echo 'Number of posts = count($_POST["posts"])='.count(@$_POST['posts'])."&lt;br&gt;\n"; //finding number of posts that are set and not empty $count = 0; foreach($_POST['posts'] as $v1){ //$v is an array foreach($v1 as $v1k=&gt; $v1v){ if(strlen($v1v) &gt; 0){ ++$count; $inputs[$v1k] = $v1v; } } } echo 'Count of non-empty posts = $count = '.$count."&lt;br&gt;\n"; echo '&lt;pre&gt;'; print_r($inputs); echo '&lt;/pre&gt;'; } ?&gt; &lt;form name="scraped" action="" method="post"&gt; &lt;input type="hidden" name="OSscraper_hidden" value="N"&gt; &lt;?php $articles =array('test'); $inpCnt = 0; foreach($articles as $item) { ?&gt; &lt;input type="text" name="posts[][title_&lt;?php echo $inpCnt; ?&gt;]"&gt; &lt;input type="text" name="posts[][name_&lt;?php echo $inpCnt; ?&gt;]"&gt; &lt;input type="text" name="posts[][url_&lt;?php echo $inpCnt; ?&gt;]"&gt; &lt;input type="text" name="posts[][img_&lt;?php echo $inpCnt; ?&gt;]"&gt; &lt;input type="text" name="posts[][pet_&lt;?php echo $inpCnt; ?&gt;]"&gt; &lt;input type="text" name="posts[][color_&lt;?php echo $inpCnt; ?&gt;]"&gt; &lt;input type="text" name="posts[][value_&lt;?php echo $inpCnt; ?&gt;]"&gt; &lt;input type="text" name="posts[][height_&lt;?php echo $inpCnt; ?&gt;]"&gt; &lt;input type="text" name="posts[][weight_&lt;?php echo $inpCnt; ?&gt;]"&gt; &lt;input type="text" name="posts[][hair_&lt;?php echo $inpCnt; ?&gt;]"&gt; &lt;input type="text" name="posts[][eyes_&lt;?php echo $inpCnt; ?&gt;]"&gt; &lt;input type="text" name="posts[][race_&lt;?php echo $inpCnt; ?&gt;]"&gt; &lt;input type="text" name="posts[][phone_&lt;?php echo $inpCnt; ?&gt;]"&gt; &lt;input type="text" name="posts[][address_&lt;?php echo $inpCnt; ?&gt;]"&gt; &lt;input type="text" name="posts[][zip_&lt;?php echo $inpCnt; ?&gt;]"&gt; &lt;?php $inpCnt++; } ?&gt; &lt;input type="submit" value="Submit" name="submit"&gt; &lt;/form&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.
    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