Excellent Josh, im really very thankful for your help.<div>i will try and then i will write to tell how it was.</div><div>Please, sorry for my bad english!!!!<br><br><div class="gmail_quote">2010/4/21 Joshua Hevenor <span dir="ltr">&lt;<a href="mailto:jhevenor@rogers.com">jhevenor@rogers.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div style="font-family:times new roman,new york,times,serif;font-size:12pt"><div>It doesn&#39;t say anything in the PHP mapscript doc that would prevent this from working but I haven&#39;t done it this way. <br>
<br>If I was iterating through all shapes I would have a mapfile with the shapefile defined as a layer and use code like the the example the LayerObj::nextShape() documentation:<br><br><pre><span>$map = ms_newmapobj(&quot;d:/msapps/gmap-ms40/htdocs/gmap75.map&quot;);</span><br>
<span>$layer = $map-&gt;getLayerByName(&#39;road&#39;);</span><br><span>$status = $layer-&gt;open();</span><br><span>$status = $layer-&gt;whichShapes($map-&gt;extent);</span><br><span>while ($shape = $layer-&gt;nextShape())</span><br>
<span>{</span><br><span>   echo $shape-&gt;index .&quot;&lt;br&gt;\n&quot;;</span><br><span>}</span><br><span>$layer-&gt;close();</span><br><br><br><span style="font-family:bookman old style,new york,times,serif">I think the $layer-&gt;open is key to making the attributes available. </span><br style="font-family:bookman old style,new york,times,serif">
<span style="font-family:bookman old style,new york,times,serif">LayerObj::open() states that it will &quot;Open the layer fo<span style="font-family:times new roman,new york,times,serif">r use with getShape()&quot;. Someone else may be able to offer a better explanation, </span><br style="font-family:times new roman,new york,times,serif">
<span style="font-family:times new roman,new york,times,serif">but at least this approach has worked for me in the past.</span></span></pre><br><br></div><div style="font-family:times new roman,new york,times,serif;font-size:12pt">
<br><div style="font-family:times new roman,new york,times,serif;font-size:12pt"><font size="2" face="Tahoma"><div class="im"><hr size="1"><b><span style="font-weight:bold">From:</span></b> Pedro Arriondo &lt;<a href="mailto:pedroaa10@gmail.com" target="_blank">pedroaa10@gmail.com</a>&gt;<br>
</div><b><span style="font-weight:bold">To:</span></b> Joshua Hevenor &lt;<a href="mailto:jhevenor@rogers.com" target="_blank">jhevenor@rogers.com</a>&gt;; <a href="mailto:mapserver-users@lists.osgeo.org" target="_blank">mapserver-users@lists.osgeo.org</a><br>
<b><span style="font-weight:bold">Sent:</span></b> Wed, April 21, 2010 7:35:59 AM<br><b><span style="font-weight:bold">Subject:</span></b> Re: [mapserver-users] Reading shapefile&#39;s attributes<br></font><div><div></div>
<div class="h5"><br>First, thanks Josh for your answer.<div>I tell you that the the file it&#39;s good, because i use it in my job with Mapserver. </div><div>Too i can access to attributes with library dbase from PHP. (dbase_open,...dbase_get_record_with_names,...)</div>

<div>So.... i don&#39;t know how to continue....</div><div><br><br><div class="gmail_quote">2010/4/20 Joshua Hevenor <span dir="ltr">&lt;<a rel="nofollow" href="mailto:jhevenor@rogers.com" target="_blank">jhevenor@rogers.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">
<div><div style="font-family:times new roman,new york,times,serif;font-size:12pt"><div><span>You can check that the shapefile has attributes using the command line tool ogrinfo.   <a rel="nofollow" href="http://www.gdal.org/ogrinfo.html" target="_blank">http://www.gdal.org/ogrinfo.html</a></span><br>

You can check on spelling of fields, etc. It might as least get you started. <br><br>Cheers, <br>Josh<br></div><div style="font-family:times new roman,new york,times,serif;font-size:12pt"><br><div style="font-family:times new roman,new york,times,serif;font-size:12pt">

<font size="2" face="Tahoma"><hr size="1"><b><span style="font-weight:bold">From:</span></b> Pedro Arriondo &lt;<a rel="nofollow" href="mailto:pedroaa10@gmail.com" target="_blank">pedroaa10@gmail.com</a>&gt;<br><b><span style="font-weight:bold">To:</span></b> <a rel="nofollow" href="mailto:mapserver-users@lists.osgeo.org" target="_blank">mapserver-users@lists.osgeo.org</a><br>

<b><span style="font-weight:bold">Sent:</span></b> Tue, April 20, 2010 2:36:15
 PM<br><b><span style="font-weight:bold">Subject:</span></b> [mapserver-users] Reading shapefile&#39;s attributes<br></font><div><div></div><div><br>Hi friends, i writte from Argentina.<div><br></div><div>I&#39;d like read attributes from a shapefile but i get &quot;nothing&quot;, however i can read very good the geometries.</div>

<div>My code:</div><div><div><br></div>
<div>$shpFile = ms_newShapeFileObj( $_SERVER[&quot;DOCUMENT_ROOT&quot;].&quot;/zonas&quot;, -1); //my shapefile in disc</div><div>echo $shpFile-&gt;numshapes; //8 -&gt; it&#39;s right!!</div><div><br></div><div>$oShape = $shpFile-&gt;getShape(0); //get first object</div>


<div><br></div><div>//..but....:</div><div>echo $oShape-&gt;numvalues; //0, however it has 2 values: &quot;CODIGO&quot; and &quot;NOMBRE&quot;</div><div>echo $oShape-&gt;values[&quot;CODIGO&quot;]; //Here get empty (value is 4)</div>


<div><br></div><div><br></div><div><span style="font-family:arial,sans-serif;font-size:13px;border-collapse:collapse"> Thanks in advance!!!!.</span></div><div><font face="arial, sans-serif"><span style="border-collapse:collapse"><br>


</span></font></div><div><font face="arial, sans-serif"><span style="border-collapse:collapse">Pedro.</span></font></div><div><br></div></div>
</div></div></div></div>
</div></div></blockquote></div><br></div>
</div></div></div></div>
</div></div></blockquote></div><br></div>