<?xml version="1.0" encoding="ISO-8859-1"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>PHPBuilder.com - Coding</title>
		<link>http://board.phpbuilder.com/</link>
		<description>Help with PHP coding</description>
		<language>en</language>
		<lastBuildDate>Sat, 25 May 2013 06:33:40 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>60</ttl>
		<image>
			<url>http://board.phpbuilder.com/images/misc/rss.png</url>
			<title>PHPBuilder.com - Coding</title>
			<link>http://board.phpbuilder.com/</link>
		</image>
		<item>
			<title>Displaying number of records in continuous manner in php paging</title>
			<link>http://board.phpbuilder.com/showthread.php?10389787-Displaying-number-of-records-in-continuous-manner-in-php-paging&amp;goto=newpost</link>
			<pubDate>Fri, 24 May 2013 07:24:21 GMT</pubDate>
			<description><![CDATA[I have a page which displays number of records on each page. I am displaying 5 records on each page and then next 5 on the next page and so on. Paging is working fine but the problem is on first page I'm displaying number serial wise next to each record i.e. from 1 to 5. Then on next page it should display numbers from 6 to 10 and on next page 11 to 15 and so on. But on every page numbers start from 1 to 5. My code is below. I have tried different strategies but nothing worked. Please check code and tell me where to make changes so that it works properly. Thanks a ton in advance.


PHP:
---------
<div class="grid_12"> 
    <div class="box first round fullpage mh500 grid"> 
        <h2><?php echo $resource->_pageHead; ?></h2> 
        <?php  $resource->displayMessage(); ?> 
        <?php    
            if($resource->_recordCount > 0) 
            { 
        ?> 
            <div class="block"> 
                <table class="listing" > 
                    <thead> 
                        <tr> 
                            <th width="50" class="bdr-left">Sr. No.</th> 
                            <th width="60">Name</th> 
                            <th width="60">Email</th> 
                            <th width="60">Address</th> 
                            <th width="60">City</th> 
                            <th width="60">State</th> 
                            <th width="60">Phone Number</th> 
                            <th width="60">Country</th> 
                            <th width="60">Comment</th> 
                            <th width="60">Inquiry Date</th> 
                            <th width="60" class="bdr-right">Action</th> 
                        </tr> 
                    </thead> 
                    <tbody> 
                    <?php 
                        $i = 1; 
                        $_SESSION['number'] = $i; 
                        $perpage = 5; 
                        $q = mysql_query("SELECT * FROM $resource->_table"); 
                        $total_record = mysql_num_rows($q); 
                        $pages = ceil($total_record/$perpage); 
                        $page = (isset($_GET['page']))?$_GET['page']:1; 
                        $start = ($page-1) * $perpage; 
                        $result = mysql_query("SELECT * FROM $resource->_table LIMIT $start, $perpage"); 
                        while($res = mysql_fetch_array($result)) 
                        { 
                    ?>       
                            <tr class="odd gradeX"> 
                                <td><?php echo $i; ?></td> 
                                <td><?php echo $res['name']; ?></td> 
                                <td><?php echo $res['email'];?></td> 
                                <td><?php echo $res['address'];?></td> 
                                <td><?php echo $res['city'];?></td> 
                                <td><?php echo $res['state'];?></td> 
                                <td><?php echo $res['p_code']."-".$res['p_num'];?></td> 
                                <td><?php echo $res['country'];?></td> 
                                <td><?php echo substr($res['comments'], 0, 100);echo "...";?></td> 
                                <td><?php echo $res['inquiry_date'];?></td> 
                                <td align="center"> 
                                    <a href="<?php echo $_SERVER['PHP_SELF'].'?action=delete&id='.$res['id'];?>" onclick="return confirm('Do you want to delete this record?');"> 
                                        <img src="img/cross.png" alt="Delete" title="Delete"/> 
                                    </a> 
                                </td> 
                            </tr> 
                    <?php 
                            $i++; 
                        } 
            } 
                    ?> 
                    </tbody> 
                </table> 
            </div> 
            <div id="paging" style="padding-left:500px;"> 
                <?php 
                    $prev=$page-1; 
                    $next=$page+1; 
                    if($prev > 0) 
                    { 
                        echo "<a href='?page=$prev'>Prev</a>"; 
                    } 
                    echo "&nbsp;&nbsp;"; 
                    if($pages >= 1 AND $page <= $pages) 
                    { 
                        for($x=1;$x<=$pages;$x++) 
                        { 
                            echo "&nbsp;&nbsp;"; 
                            echo ($x==$page) ?"<a href=?page=$x style=\"font-weight:normal;\">$x</a>":'<a href="?page='.$x.'" >'.$x.'</a>'; 
                        } 
                        echo "&nbsp&nbsp"; 
                        if($page<$pages) 
                        { 
                            echo "<a href='?page=$next'>Next</a>"; 
                        } 
                    } 
                ?> 
            </div> 
    </div> 
    <div class="clear"></div> 
</div>
---------
]]></description>
			<content:encoded><![CDATA[<div>I have a page which displays number of records on each page. I am displaying 5 records on each page and then next 5 on the next page and so on. Paging is working fine but the problem is on first page I'm displaying number serial wise next to each record i.e. from 1 to 5. Then on next page it should display numbers from 6 to 10 and on next page 11 to 15 and so on. But on every page numbers start from 1 to 5. My code is below. I have tried different strategies but nothing worked. Please check code and tell me where to make changes so that it works properly. Thanks a ton in advance.<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">PHP Code:</div>
	<hr /><code class="bbcode_code"><code><span style="color: #000000">
&lt;div&nbsp;class="grid_12"&gt;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&lt;div&nbsp;class="box&nbsp;first&nbsp;round&nbsp;fullpage&nbsp;mh500&nbsp;grid"&gt;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;h2&gt;<span style="color: #0000BB">&lt;?php&nbsp;</span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">$resource</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">_pageHead</span><span style="color: #007700">;&nbsp;</span><span style="color: #0000BB">?&gt;</span>&lt;/h2&gt;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000BB">&lt;?php&nbsp;&nbsp;$resource</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">displayMessage</span><span style="color: #007700">();&nbsp;</span><span style="color: #0000BB">?&gt;</span>&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000BB">&lt;?php&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">if(</span><span style="color: #0000BB">$resource</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">_recordCount&nbsp;</span><span style="color: #007700">&gt;&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">)&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">?&gt;</span>&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;div&nbsp;class="block"&gt;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;table&nbsp;class="listing"&nbsp;&gt;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;thead&gt;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;th&nbsp;width="50"&nbsp;class="bdr-left"&gt;Sr.&nbsp;No.&lt;/th&gt;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;th&nbsp;width="60"&gt;Name&lt;/th&gt;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;th&nbsp;width="60"&gt;Email&lt;/th&gt;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;th&nbsp;width="60"&gt;Address&lt;/th&gt;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;th&nbsp;width="60"&gt;City&lt;/th&gt;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;th&nbsp;width="60"&gt;State&lt;/th&gt;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;th&nbsp;width="60"&gt;Phone&nbsp;Number&lt;/th&gt;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;th&nbsp;width="60"&gt;Country&lt;/th&gt;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;th&nbsp;width="60"&gt;Comment&lt;/th&gt;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;th&nbsp;width="60"&gt;Inquiry&nbsp;Date&lt;/th&gt;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;th&nbsp;width="60"&nbsp;class="bdr-right"&gt;Action&lt;/th&gt;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/tr&gt;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/thead&gt;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;tbody&gt;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000BB">&lt;?php&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$i&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">1</span><span style="color: #007700">;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$_SESSION</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'number'</span><span style="color: #007700">&#93;&nbsp;=&nbsp;</span><span style="color: #0000BB">$i</span><span style="color: #007700">;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$perpage&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">5</span><span style="color: #007700">;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$q&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">mysql_query</span><span style="color: #007700">(</span><span style="color: #DD0000">"SELECT&nbsp;*&nbsp;FROM&nbsp;</span><span style="color: #0000BB">$resource</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">_table</span><span style="color: #DD0000">"</span><span style="color: #007700">);&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$total_record&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">mysql_num_rows</span><span style="color: #007700">(</span><span style="color: #0000BB">$q</span><span style="color: #007700">);&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$pages&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">ceil</span><span style="color: #007700">(</span><span style="color: #0000BB">$total_record</span><span style="color: #007700">/</span><span style="color: #0000BB">$perpage</span><span style="color: #007700">);&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$page&nbsp;</span><span style="color: #007700">=&nbsp;(isset(</span><span style="color: #0000BB">$_GET</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'page'</span><span style="color: #007700">&#93;))?</span><span style="color: #0000BB">$_GET</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'page'</span><span style="color: #007700">&#93;:</span><span style="color: #0000BB">1</span><span style="color: #007700">;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$start&nbsp;</span><span style="color: #007700">=&nbsp;(</span><span style="color: #0000BB">$page</span><span style="color: #007700">-</span><span style="color: #0000BB">1</span><span style="color: #007700">)&nbsp;*&nbsp;</span><span style="color: #0000BB">$perpage</span><span style="color: #007700">;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$result&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">mysql_query</span><span style="color: #007700">(</span><span style="color: #DD0000">"SELECT&nbsp;*&nbsp;FROM&nbsp;</span><span style="color: #0000BB">$resource</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">_table</span><span style="color: #DD0000">&nbsp;LIMIT&nbsp;</span><span style="color: #0000BB">$start</span><span style="color: #DD0000">,&nbsp;</span><span style="color: #0000BB">$perpage</span><span style="color: #DD0000">"</span><span style="color: #007700">);&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;while(</span><span style="color: #0000BB">$res&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">mysql_fetch_array</span><span style="color: #007700">(</span><span style="color: #0000BB">$result</span><span style="color: #007700">))&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">?&gt;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&nbsp;class="odd&nbsp;gradeX"&gt;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;<span style="color: #0000BB">&lt;?php&nbsp;</span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">$i</span><span style="color: #007700">;&nbsp;</span><span style="color: #0000BB">?&gt;</span>&lt;/td&gt;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;<span style="color: #0000BB">&lt;?php&nbsp;</span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">$res</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'name'</span><span style="color: #007700">&#93;;&nbsp;</span><span style="color: #0000BB">?&gt;</span>&lt;/td&gt;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;<span style="color: #0000BB">&lt;?php&nbsp;</span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">$res</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'email'</span><span style="color: #007700">&#93;;</span><span style="color: #0000BB">?&gt;</span>&lt;/td&gt;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;<span style="color: #0000BB">&lt;?php&nbsp;</span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">$res</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'address'</span><span style="color: #007700">&#93;;</span><span style="color: #0000BB">?&gt;</span>&lt;/td&gt;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;<span style="color: #0000BB">&lt;?php&nbsp;</span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">$res</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'city'</span><span style="color: #007700">&#93;;</span><span style="color: #0000BB">?&gt;</span>&lt;/td&gt;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;<span style="color: #0000BB">&lt;?php&nbsp;</span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">$res</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'state'</span><span style="color: #007700">&#93;;</span><span style="color: #0000BB">?&gt;</span>&lt;/td&gt;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;<span style="color: #0000BB">&lt;?php&nbsp;</span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">$res</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'p_code'</span><span style="color: #007700">&#93;.</span><span style="color: #DD0000">"-"</span><span style="color: #007700">.</span><span style="color: #0000BB">$res</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'p_num'</span><span style="color: #007700">&#93;;</span><span style="color: #0000BB">?&gt;</span>&lt;/td&gt;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;<span style="color: #0000BB">&lt;?php&nbsp;</span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">$res</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'country'</span><span style="color: #007700">&#93;;</span><span style="color: #0000BB">?&gt;</span>&lt;/td&gt;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;<span style="color: #0000BB">&lt;?php&nbsp;</span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">substr</span><span style="color: #007700">(</span><span style="color: #0000BB">$res</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'comments'</span><span style="color: #007700">&#93;,&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">100</span><span style="color: #007700">);echo&nbsp;</span><span style="color: #DD0000">"..."</span><span style="color: #007700">;</span><span style="color: #0000BB">?&gt;</span>&lt;/td&gt;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;<span style="color: #0000BB">&lt;?php&nbsp;</span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">$res</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'inquiry_date'</span><span style="color: #007700">&#93;;</span><span style="color: #0000BB">?&gt;</span>&lt;/td&gt;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&nbsp;align="center"&gt;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;a&nbsp;href="<span style="color: #0000BB">&lt;?php&nbsp;</span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">$_SERVER</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'PHP_SELF'</span><span style="color: #007700">&#93;.</span><span style="color: #DD0000">'?action=delete&amp;id='</span><span style="color: #007700">.</span><span style="color: #0000BB">$res</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'id'</span><span style="color: #007700">&#93;;</span><span style="color: #0000BB">?&gt;</span>"&nbsp;onclick="return&nbsp;confirm('Do&nbsp;you&nbsp;want&nbsp;to&nbsp;delete&nbsp;this&nbsp;record?');"&gt;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;img&nbsp;src="img/cross.png"&nbsp;alt="Delete"&nbsp;title="Delete"/&gt;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/a&gt;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/td&gt;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/tr&gt;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000BB">&lt;?php&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$i</span><span style="color: #007700">++;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">?&gt;</span>&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/tbody&gt;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/table&gt;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/div&gt;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;div&nbsp;id="paging"&nbsp;style="padding-left:500px;"&gt;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000BB">&lt;?php&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$prev</span><span style="color: #007700">=</span><span style="color: #0000BB">$page</span><span style="color: #007700">-</span><span style="color: #0000BB">1</span><span style="color: #007700">;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$next</span><span style="color: #007700">=</span><span style="color: #0000BB">$page</span><span style="color: #007700">+</span><span style="color: #0000BB">1</span><span style="color: #007700">;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$prev&nbsp;</span><span style="color: #007700">&gt;&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">)&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"&lt;a&nbsp;href='?page=</span><span style="color: #0000BB">$prev</span><span style="color: #DD0000">'&gt;Prev&lt;/a&gt;"</span><span style="color: #007700">;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"&amp;nbsp;&amp;nbsp;"</span><span style="color: #007700">;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$pages&nbsp;</span><span style="color: #007700">&gt;=&nbsp;</span><span style="color: #0000BB">1&nbsp;</span><span style="color: #007700">AND&nbsp;</span><span style="color: #0000BB">$page&nbsp;</span><span style="color: #007700">&lt;=&nbsp;</span><span style="color: #0000BB">$pages</span><span style="color: #007700">)&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for(</span><span style="color: #0000BB">$x</span><span style="color: #007700">=</span><span style="color: #0000BB">1</span><span style="color: #007700">;</span><span style="color: #0000BB">$x</span><span style="color: #007700">&lt;=</span><span style="color: #0000BB">$pages</span><span style="color: #007700">;</span><span style="color: #0000BB">$x</span><span style="color: #007700">++)&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"&amp;nbsp;&amp;nbsp;"</span><span style="color: #007700">;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;(</span><span style="color: #0000BB">$x</span><span style="color: #007700">==</span><span style="color: #0000BB">$page</span><span style="color: #007700">)&nbsp;?</span><span style="color: #DD0000">"&lt;a&nbsp;href=?page=</span><span style="color: #0000BB">$x</span><span style="color: #DD0000">&nbsp;style=\"font-weight:normal;\"&gt;</span><span style="color: #0000BB">$x</span><span style="color: #DD0000">&lt;/a&gt;"</span><span style="color: #007700">:</span><span style="color: #DD0000">'&lt;a&nbsp;href="?page='</span><span style="color: #007700">.</span><span style="color: #0000BB">$x</span><span style="color: #007700">.</span><span style="color: #DD0000">'"&nbsp;&gt;'</span><span style="color: #007700">.</span><span style="color: #0000BB">$x</span><span style="color: #007700">.</span><span style="color: #DD0000">'&lt;/a&gt;'</span><span style="color: #007700">;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"&amp;nbsp&amp;nbsp"</span><span style="color: #007700">;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$page</span><span style="color: #007700">&lt;</span><span style="color: #0000BB">$pages</span><span style="color: #007700">)&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"&lt;a&nbsp;href='?page=</span><span style="color: #0000BB">$next</span><span style="color: #DD0000">'&gt;Next&lt;/a&gt;"</span><span style="color: #007700">;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">?&gt;</span>&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/div&gt;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&lt;/div&gt;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&lt;div&nbsp;class="clear"&gt;&lt;/div&gt;&nbsp;<br />&lt;/div&gt;</span>
</code></code><hr />
</div> </div>

 ]]></content:encoded>
			<category domain="http://board.phpbuilder.com/forumdisplay.php?10-Coding">Coding</category>
			<dc:creator>phpcodingfreak</dc:creator>
			<guid isPermaLink="true">http://board.phpbuilder.com/showthread.php?10389787-Displaying-number-of-records-in-continuous-manner-in-php-paging</guid>
		</item>
		<item>
			<title>Good algorithm for reading tokens from a string</title>
			<link>http://board.phpbuilder.com/showthread.php?10389783-Good-algorithm-for-reading-tokens-from-a-string&amp;goto=newpost</link>
			<pubDate>Fri, 24 May 2013 01:26:33 GMT</pubDate>
			<description><![CDATA[Hi all,

i'm writing a custom code to export a CSV file of products in a database. Here is the idea:
1) A textfield in the web page. It will contain user's choices.
2) A list of allowed tags
3) Unknown separators 

Assuming that my database contains only a product(Chair),if user writes :

           tag_stock|tag_productname|tag_category

the CSV file will contain :

2|Chair|Furniture 

Obiviously, it should be done for every product in my database.
For example, a full CSV file should contain:

2|Chair|Furniture|10|Hammer|Tools|10|Sickle|Tools|... and so on

User defined order must be respected.

The algorithm i thought is something like this

$ops = array("product","chair","furniture") //contains the order of the tags read from the string

foreach(product of my catalog) {
     for(i = 0 ; i< ops.lenght ; i++) 
               Read ops[i]
               Execute function contained in ops[i]
} 

So here are my questions
1) How can i read multiple tokens sequencely from a string?
2) Is there a way to invoke a function by reading the name from a variable? 

Thank you very much. Hints or advices are well accepted :D]]></description>
			<content:encoded><![CDATA[<div>Hi all,<br />
<br />
i'm writing a custom code to export a CSV file of products in a database. Here is the idea:<br />
1) A textfield in the web page. It will contain user's choices.<br />
2) A list of allowed tags<br />
3) Unknown separators <br />
<br />
Assuming that my database contains only a product(Chair),if user writes :<br />
<br />
           tag_stock|tag_productname|tag_category<br />
<br />
the CSV file will contain :<br />
<br />
2|Chair|Furniture <br />
<br />
Obiviously, it should be done for every product in my database.<br />
For example, a full CSV file should contain:<br />
<br />
2|Chair|Furniture|10|Hammer|Tools|10|Sickle|Tools|... and so on<br />
<br />
User defined order must be respected.<br />
<br />
The algorithm i thought is something like this<br />
<br />
$ops = array(&quot;product&quot;,&quot;chair&quot;,&quot;furniture&quot;) //contains the order of the tags read from the string<br />
<br />
foreach(product of my catalog) {<br />
     for(i = 0 ; i&lt; ops.lenght ; i++) <br />
               Read ops[i]<br />
               Execute function contained in ops[i]<br />
} <br />
<br />
So here are my questions<br />
1) How can i read multiple tokens sequencely from a string?<br />
2) Is there a way to invoke a function by reading the name from a variable? <br />
<br />
Thank you very much. Hints or advices are well accepted :D</div>

 ]]></content:encoded>
			<category domain="http://board.phpbuilder.com/forumdisplay.php?10-Coding">Coding</category>
			<dc:creator>metalmario</dc:creator>
			<guid isPermaLink="true">http://board.phpbuilder.com/showthread.php?10389783-Good-algorithm-for-reading-tokens-from-a-string</guid>
		</item>
		<item>
			<title>simplexml_load_file has begun throwing Max Exec Time error</title>
			<link>http://board.phpbuilder.com/showthread.php?10389767-simplexml_load_file-has-begun-throwing-Max-Exec-Time-error&amp;goto=newpost</link>
			<pubDate>Wed, 22 May 2013 12:05:47 GMT</pubDate>
			<description><![CDATA[Hi there everyone,

I've got a membermap in which the guys input their address and Google converts it to lat and long and the pin is set.  Recently, the geolocation portion of the map has broken.  No matter what address is input, the return is:


---Quote---
Fatal error: Maximum execution time of 30 seconds exceeded in /home/husaberg/public_html/includes/functions.php on line 67
---End Quote---
Here's the function:


Code:
---------
function geocode($address)
{
  $address = urlencode($address);
  $url = "http://maps.googleapis.com/maps/api/geocode/xml?address=$address&sensor=false";
 
  $coords = array('lat' => 0, 'lng' => 0);
  $delay = 0;
 
  $geocode_pending = true;
 
  // load file from url
  while($geocode_pending)
  {
	try
	{
	  $xml = simplexml_load_file($url);  // This is line 67.
	}
	catch(Exception $e)
	{
	  // return an empty array for a file request exception
	  return array();
	}
   
	//get response status
	$status = $xml->Response->Status->code;
   
	if (strcmp($status, '200') == 0)
	{
	  $geocode_pending = false;
	 
	  // get coordinates node from xml response
	  $coordsNode = explode(',', $xml->Response->Placemark->Point->coordinates);
	  $coords['lat'] = $coordsNode[1];
	  $coords['lng'] = $coordsNode[0];
	}
   
	// handle timeout responses and delay re-execution of geocoding
	else if (strcmp($status, 620) == 0)
	{
	  $delay += 100000;
	}
   
	usleep($delay);
  }
  return $coords;  
}
---------
I've tried to troubleshoot and although haven't figured out the problem, I've gotten the output on the steps leading up to line 67.  Everything seems to be working correctly up to line 67.  The URL being passed is:

http://maps.googleapis.com/maps/api/geocode/xml?address=new+york%2C+new+york&sensor=false

and if you visit the page, you can see that it is returning an xml document.  I just don't know why line 67 ( $xml = simplexml_load_file($url); ) just began resulting in error.

While trying to troubleshoot my issue, I saw that this result could also be passed via json as well, but I'm not savvy enough to convert the function to use it, or even to know if that would resolve my issue.

Any thoughts on my issue or a potential workaround would be greatly appreciated!]]></description>
			<content:encoded><![CDATA[<div>Hi there everyone,<br />
<br />
I've got a membermap in which the guys input their address and Google converts it to lat and long and the pin is set.  Recently, the geolocation portion of the map has broken.  No matter what address is input, the return is:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Quote:</div>
	<div class="bbcode_quote printable">
		<hr />
		
			Fatal error: Maximum execution time of 30 seconds exceeded in /home/husaberg/public_html/includes/functions.php on line 67
			
		<hr />
	</div>
</div> Here's the function:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">function geocode($address)<br />
{<br />
&nbsp; $address = urlencode($address);<br />
&nbsp; $url = &quot;http://maps.googleapis.com/maps/api/geocode/xml?address=$address&amp;sensor=false&quot;;<br />
&nbsp;<br />
&nbsp; $coords = array('lat' =&gt; 0, 'lng' =&gt; 0);<br />
&nbsp; $delay = 0;<br />
&nbsp;<br />
&nbsp; $geocode_pending = true;<br />
&nbsp;<br />
&nbsp; // load file from url<br />
&nbsp; while($geocode_pending)<br />
&nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; try<br />
&nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $xml = simplexml_load_file($url);&nbsp; // This is line 67.<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; catch(Exception $e)<br />
&nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // return an empty array for a file request exception<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return array();<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp;  <br />
&nbsp; &nbsp; &nbsp; &nbsp; //get response status<br />
&nbsp; &nbsp; &nbsp; &nbsp; $status = $xml-&gt;Response-&gt;Status-&gt;code;<br />
&nbsp;  <br />
&nbsp; &nbsp; &nbsp; &nbsp; if (strcmp($status, '200') == 0)<br />
&nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $geocode_pending = false;<br />
&nbsp; &nbsp; &nbsp; &nbsp;  <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // get coordinates node from xml response<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $coordsNode = explode(',', $xml-&gt;Response-&gt;Placemark-&gt;Point-&gt;coordinates);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $coords['lat'] = $coordsNode[1];<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $coords['lng'] = $coordsNode[0];<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp;  <br />
&nbsp; &nbsp; &nbsp; &nbsp; // handle timeout responses and delay re-execution of geocoding<br />
&nbsp; &nbsp; &nbsp; &nbsp; else if (strcmp($status, 620) == 0)<br />
&nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $delay += 100000;<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp;  <br />
&nbsp; &nbsp; &nbsp; &nbsp; usleep($delay);<br />
&nbsp; }<br />
&nbsp; return $coords;&nbsp; <br />
}</code><hr />
</div> I've tried to troubleshoot and although haven't figured out the problem, I've gotten the output on the steps leading up to line 67.  Everything seems to be working correctly up to line 67.  The URL being passed is:<br />
<br />
<a rel="nofollow" href="http://maps.googleapis.com/maps/api/geocode/xml?address=new+york%2C+new+york&amp;sensor=false" target="_blank">http://maps.googleapis.com/maps/api/...k&amp;sensor=false</a><br />
<br />
and if you visit the page, you can see that it is returning an xml document.  I just don't know why line 67 ( $xml = simplexml_load_file($url); ) just began resulting in error.<br />
<br />
While trying to troubleshoot my issue, I saw that this result could also be passed via json as well, but I'm not savvy enough to convert the function to use it, or even to know if that would resolve my issue.<br />
<br />
Any thoughts on my issue or a potential workaround would be greatly appreciated!</div>

 ]]></content:encoded>
			<category domain="http://board.phpbuilder.com/forumdisplay.php?10-Coding">Coding</category>
			<dc:creator>schwim</dc:creator>
			<guid isPermaLink="true">http://board.phpbuilder.com/showthread.php?10389767-simplexml_load_file-has-begun-throwing-Max-Exec-Time-error</guid>
		</item>
		<item>
			<title>modifying shoutbox to add an archive</title>
			<link>http://board.phpbuilder.com/showthread.php?10389765-modifying-shoutbox-to-add-an-archive&amp;goto=newpost</link>
			<pubDate>Wed, 22 May 2013 07:32:06 GMT</pubDate>
			<description><![CDATA[I have installed a wonderful php/jquery shoutbox, but it lacks an archive function. So i am trying to modify the script to add each message to the database once it is posted.

I edited the addMessage function and added a database query:


Code:
---------
	function addMessage($user, $msg, $color) {
		$user = $this->checkUsername($user); if($user===false) { return $this->jsonEncode(array('error'=>'You cannot use that name!')); }
		if(strlen(utf8_decode($user)) > 100) { return $this->jsonEncode(array('error'=>'Your name is too long!')); } $msg = utf8_encode(addslashes(strip_tags($msg)));
		if(strlen($msg) > 500) { return $this->jsonEncode(array('error'=>'Your message is too long! Limit 500 characters.')); }
		if((empty($user)) || ($user=='Your Name')) { return $this->jsonEncode(array('error'=>'Please enter your name!')); }
		if((empty($msg)) || ($user=='Message')) { return $this->jsonEncode(array('error'=>'Please enter a message!')); }
		if($this->isBanned($_SERVER['REMOTE_ADDR'])===true) { return $this->jsonEncode(array('error'=>'You are banned from this ShoutBox.')); }
		if((empty($_SESSION['ShoutCloud-User'])) || (!isset($_SESSION['ShoutCloud-User'])) || ($_SESSION['ShoutCloud-User']!==$user)) { $_SESSION['ShoutCloud-User'] = $user; }
		if((empty($_SESSION['ShoutCloud_Tag_Color'])) || ($_SESSION['ShoutCloud_Tag_Color']!==$color)) { $_SESSION['ShoutCloud_Tag_Color'] = $color; }
		$allMsgs = unserialize(file_get_contents($this->msgsFile)); if(empty($_SESSION['ShoutCloud-User-Flood'])) { $_SESSION['ShoutCloud-User-Flood'] = 0; }
		if($_SESSION['ShoutCloud-User-Flood'] > time()) { return $this->jsonEncode(array('error'=>'Please do not spam the messages! Wait 5 seconds in between posts.')); } $_SESSION['ShoutCloud-User-Flood'] = time() + 5;
		$allMsgs[] = array('time' => time(), 'user' => $user, 'msg' => $msg, 'color' => $color, 'ip' => $_SERVER['REMOTE_ADDR']); $totalMsgs = count($allMsgs);
		if($totalMsgs > 100) { $difference = ($totalMsgs - 100); $i=1; $allMsgs = array_reverse($allMsgs, true); while($i <= $difference) { $remove = array_pop($allMsgs); $i++; } $allMsgs = array_reverse($allMsgs, true);
		} else { $difference = 0; } $msgFile = fopen($this->msgsFile, 'w');
		if(fwrite($msgFile, serialize($allMsgs))) {
				$dbtime = time();
				$dbhost = 'localhost';
				$dbname = 'pirate_piratepunk';
				$dbuser = 'pirate_pirate';
				$dbpasswd = '******';
				mysql_connect($dbhost, $dbuser, $dbpasswd) or die(mysql_error());
				mysql_select_db($dbname) or die(mysql_error());
				$query = "INSERT INTO 1tchat (shout, user, time) VALUES ('$msg', '$user','$dbtime')";
		fclose($msgFile); return $this->jsonEncode(array('status' => 'posted'));
		} else { fclose($msgFile);
		return $this->jsonEncode(array('error'=>'Your message could not be posted at this time.')); }

	}
---------
But nothing is being added to the database. What did i do wrong ?


Full php script:
http://www.pirate-punk.net/tchat/shoutcloud.txt

java_script:
http://www.pirate-punk.net/tchat/shoutcloud/ShoutCloud.js

Live shoutbox:
www.pirate-punk.net/tchat/tchat.php?forumuser=test]]></description>
			<content:encoded><![CDATA[<div>I have installed a wonderful php/jquery shoutbox, but it lacks an archive function. So i am trying to modify the script to add each message to the database once it is posted.<br />
<br />
I edited the addMessage function and added a database query:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">&nbsp; &nbsp; &nbsp; &nbsp; function addMessage($user, $msg, $color) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $user = $this-&gt;checkUsername($user); if($user===false) { return $this-&gt;jsonEncode(array('error'=&gt;'You cannot use that name!')); }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(strlen(utf8_decode($user)) &gt; 100) { return $this-&gt;jsonEncode(array('error'=&gt;'Your name is too long!')); } $msg = utf8_encode(addslashes(strip_tags($msg)));<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(strlen($msg) &gt; 500) { return $this-&gt;jsonEncode(array('error'=&gt;'Your message is too long! Limit 500 characters.')); }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if((empty($user)) || ($user=='Your Name')) { return $this-&gt;jsonEncode(array('error'=&gt;'Please enter your name!')); }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if((empty($msg)) || ($user=='Message')) { return $this-&gt;jsonEncode(array('error'=&gt;'Please enter a message!')); }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if($this-&gt;isBanned($_SERVER['REMOTE_ADDR'])===true) { return $this-&gt;jsonEncode(array('error'=&gt;'You are banned from this ShoutBox.')); }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if((empty($_SESSION['ShoutCloud-User'])) || (!isset($_SESSION['ShoutCloud-User'])) || ($_SESSION['ShoutCloud-User']!==$user)) { $_SESSION['ShoutCloud-User'] = $user; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if((empty($_SESSION['ShoutCloud_Tag_Color'])) || ($_SESSION['ShoutCloud_Tag_Color']!==$color)) { $_SESSION['ShoutCloud_Tag_Color'] = $color; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $allMsgs = unserialize(file_get_contents($this-&gt;msgsFile)); if(empty($_SESSION['ShoutCloud-User-Flood'])) { $_SESSION['ShoutCloud-User-Flood'] = 0; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if($_SESSION['ShoutCloud-User-Flood'] &gt; time()) { return $this-&gt;jsonEncode(array('error'=&gt;'Please do not spam the messages! Wait 5 seconds in between posts.')); } $_SESSION['ShoutCloud-User-Flood'] = time() + 5;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $allMsgs[] = array('time' =&gt; time(), 'user' =&gt; $user, 'msg' =&gt; $msg, 'color' =&gt; $color, 'ip' =&gt; $_SERVER['REMOTE_ADDR']); $totalMsgs = count($allMsgs);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if($totalMsgs &gt; 100) { $difference = ($totalMsgs - 100); $i=1; $allMsgs = array_reverse($allMsgs, true); while($i &lt;= $difference) { $remove = array_pop($allMsgs); $i++; } $allMsgs = array_reverse($allMsgs, true);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } else { $difference = 0; } $msgFile = fopen($this-&gt;msgsFile, 'w');<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(fwrite($msgFile, serialize($allMsgs))) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $dbtime = time();<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $dbhost = 'localhost';<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $dbname = 'pirate_piratepunk';<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $dbuser = 'pirate_pirate';<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $dbpasswd = '******';<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mysql_connect($dbhost, $dbuser, $dbpasswd) or die(mysql_error());<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mysql_select_db($dbname) or die(mysql_error());<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $query = &quot;INSERT INTO 1tchat (shout, user, time) VALUES ('$msg', '$user','$dbtime')&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fclose($msgFile); return $this-&gt;jsonEncode(array('status' =&gt; 'posted'));<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } else { fclose($msgFile);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return $this-&gt;jsonEncode(array('error'=&gt;'Your message could not be posted at this time.')); }<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; }</code><hr />
</div> But nothing is being added to the database. What did i do wrong ?<br />
<br />
<br />
Full php script:<br />
<a rel="nofollow" href="http://www.pirate-punk.net/tchat/shoutcloud.txt" target="_blank">http://www.pirate-punk.net/tchat/shoutcloud.txt</a><br />
<br />
Javascript<b></b>:<br />
<a rel="nofollow" href="http://www.pirate-punk.net/tchat/shoutcloud/ShoutCloud.js" target="_blank">http://www.pirate-punk.net/tchat/sho.../ShoutCloud.js</a><br />
<br />
Live shoutbox:<br />
<a rel="nofollow" href="http://www.pirate-punk.net/tchat/tchat.php?forumuser=test" target="_blank">http://www.pirate-punk.net/tchat/tch...forumuser=test</a></div>

 ]]></content:encoded>
			<category domain="http://board.phpbuilder.com/forumdisplay.php?10-Coding">Coding</category>
			<dc:creator>anarchoi</dc:creator>
			<guid isPermaLink="true">http://board.phpbuilder.com/showthread.php?10389765-modifying-shoutbox-to-add-an-archive</guid>
		</item>
		<item>
			<title>Help! PHP and mySQL</title>
			<link>http://board.phpbuilder.com/showthread.php?10389761-Help!-PHP-and-mySQL&amp;goto=newpost</link>
			<pubDate>Tue, 21 May 2013 22:39:47 GMT</pubDate>
			<description><![CDATA[I have a simple form here: 


HTML:
---------
<form method="post" enctype="multipart/form-data" action="php/uploadFile.php">

						<input type="hidden" name="MAX_FILE_SIZE" value="2000000">
						Select File From Your Computer:<br />
						<input name="userfile" type="file" id="userfile"><br />
						Declare Product Type: <br />
						<input name="product" type="text" id="product"><br /><br /><br />
						<input name="upload" type="submit" class="box" id="upload" value=" Upload ">

					</form>
---------
Here is the uploadfile.php:


PHP:
---------
<?php
$uploadDir = '../img/products/';

if(isset($_POST['upload']))
{
$fileName = $_FILES['userfile']['name'];
$tmpName = $_FILES['userfile']['tmp_name'];
$fileSize = $_FILES['userfile']['size'];
$fileType = $_FILES['userfile']['type'];
$protype = $_POST['product']['product'];
$filePath = $uploadDir . $fileName;
$result = move_uploaded_file($tmpName, $filePath);
}

if (!$result) {
echo "Error uploading file";
exit;
}

// Create connection
$con = mysql_connect("localhost","root","open4you");
	   mysql_select_db("products");

// Check connection
if (mysqli_connect_errno($con))
  {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
  }

if(!get_magic_quotes_gpc())
{
$fileName = addslashes($fileName);
$filePath = addslashes($filePath);
}

$query = "INSERT INTO productimages (name, size, type, path, product ) ".
"VALUES ('$fileName', '$fileSize', '$fileType', '$filePath', '$protype')";

mysql_query($query) or die('Error, query failed : ' . mysql_error());

mysql_close($con);


echo "<br>Your Files Were Uploaded<br>";

}
?>
---------
When running this code, everything works and writes to the database and file location. However, the products field does not write and I receive an error that states: 
Undefined index: product in C:\wamp\www\2CO960\php\uploadFile.php on line 10
Any Ideas?

Any help would be greatly rewarded, with praise!]]></description>
			<content:encoded><![CDATA[<div>I have a simple form here: <br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">HTML Code:</div>
	<hr /><code class="bbcode_code"><span style="color:#FF8000">&lt;form method=<span style="color:#0000FF">&quot;post&quot;</span> enctype=<span style="color:#0000FF">&quot;multipart/form-data&quot;</span> action=<span style="color:#0000FF">&quot;php/uploadFile.php&quot;</span>&gt;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF8000">&lt;input type=<span style="color:#0000FF">&quot;hidden&quot;</span> name=<span style="color:#0000FF">&quot;MAX_FILE_SIZE&quot;</span> value=<span style="color:#0000FF">&quot;2000000&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Select File From Your Computer:<span style="color:#000080">&lt;br /&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF8000">&lt;input name=<span style="color:#0000FF">&quot;userfile&quot;</span> type=<span style="color:#0000FF">&quot;file&quot;</span> id=<span style="color:#0000FF">&quot;userfile&quot;</span>&gt;</span><span style="color:#000080">&lt;br /&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Declare Product Type: <span style="color:#000080">&lt;br /&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF8000">&lt;input name=<span style="color:#0000FF">&quot;product&quot;</span> type=<span style="color:#0000FF">&quot;text&quot;</span> id=<span style="color:#0000FF">&quot;product&quot;</span>&gt;</span><span style="color:#000080">&lt;br /&gt;</span><span style="color:#000080">&lt;br /&gt;</span><span style="color:#000080">&lt;br /&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF8000">&lt;input name=<span style="color:#0000FF">&quot;upload&quot;</span> type=<span style="color:#0000FF">&quot;submit&quot;</span> class=<span style="color:#0000FF">&quot;box&quot;</span> id=<span style="color:#0000FF">&quot;upload&quot;</span> value=<span style="color:#0000FF">&quot; Upload &quot;</span>&gt;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF8000">&lt;/form&gt;</span></code><hr />
</div> Here is the uploadfile.php:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">PHP Code:</div>
	<hr /><code class="bbcode_code"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$uploadDir&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">'../img/products/'</span><span style="color: #007700">;<br /><br />if(isset(</span><span style="color: #0000BB">$_POST</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'upload'</span><span style="color: #007700">&#93;))<br />{<br /></span><span style="color: #0000BB">$fileName&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$_FILES</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'userfile'</span><span style="color: #007700">&#93;&#91;</span><span style="color: #DD0000">'name'</span><span style="color: #007700">&#93;;<br /></span><span style="color: #0000BB">$tmpName&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$_FILES</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'userfile'</span><span style="color: #007700">&#93;&#91;</span><span style="color: #DD0000">'tmp_name'</span><span style="color: #007700">&#93;;<br /></span><span style="color: #0000BB">$fileSize&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$_FILES</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'userfile'</span><span style="color: #007700">&#93;&#91;</span><span style="color: #DD0000">'size'</span><span style="color: #007700">&#93;;<br /></span><span style="color: #0000BB">$fileType&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$_FILES</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'userfile'</span><span style="color: #007700">&#93;&#91;</span><span style="color: #DD0000">'type'</span><span style="color: #007700">&#93;;<br /></span><span style="color: #0000BB">$protype&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$_POST</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'product'</span><span style="color: #007700">&#93;&#91;</span><span style="color: #DD0000">'product'</span><span style="color: #007700">&#93;;<br /></span><span style="color: #0000BB">$filePath&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$uploadDir&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">$fileName</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$result&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">move_uploaded_file</span><span style="color: #007700">(</span><span style="color: #0000BB">$tmpName</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$filePath</span><span style="color: #007700">);<br />}<br /><br />if&nbsp;(!</span><span style="color: #0000BB">$result</span><span style="color: #007700">)&nbsp;{<br />echo&nbsp;</span><span style="color: #DD0000">"Error&nbsp;uploading&nbsp;file"</span><span style="color: #007700">;<br />exit;<br />}<br /><br /></span><span style="color: #FF8000">//&nbsp;Create&nbsp;connection<br /></span><span style="color: #0000BB">$con&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">mysql_connect</span><span style="color: #007700">(</span><span style="color: #DD0000">"localhost"</span><span style="color: #007700">,</span><span style="color: #DD0000">"root"</span><span style="color: #007700">,</span><span style="color: #DD0000">"open4you"</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">mysql_select_db</span><span style="color: #007700">(</span><span style="color: #DD0000">"products"</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//&nbsp;Check&nbsp;connection<br /></span><span style="color: #007700">if&nbsp;(</span><span style="color: #0000BB">mysqli_connect_errno</span><span style="color: #007700">(</span><span style="color: #0000BB">$con</span><span style="color: #007700">))<br />&nbsp;&nbsp;{<br />&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"Failed&nbsp;to&nbsp;connect&nbsp;to&nbsp;MySQL:&nbsp;"&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">mysqli_connect_error</span><span style="color: #007700">();<br />&nbsp;&nbsp;}<br /><br />if(!</span><span style="color: #0000BB">get_magic_quotes_gpc</span><span style="color: #007700">())<br />{<br /></span><span style="color: #0000BB">$fileName&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">addslashes</span><span style="color: #007700">(</span><span style="color: #0000BB">$fileName</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$filePath&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">addslashes</span><span style="color: #007700">(</span><span style="color: #0000BB">$filePath</span><span style="color: #007700">);<br />}<br /><br /></span><span style="color: #0000BB">$query&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"INSERT&nbsp;INTO&nbsp;productimages&nbsp;(name,&nbsp;size,&nbsp;type,&nbsp;path,&nbsp;product&nbsp;)&nbsp;"</span><span style="color: #007700">.<br /></span><span style="color: #DD0000">"VALUES&nbsp;('</span><span style="color: #0000BB">$fileName</span><span style="color: #DD0000">',&nbsp;'</span><span style="color: #0000BB">$fileSize</span><span style="color: #DD0000">',&nbsp;'</span><span style="color: #0000BB">$fileType</span><span style="color: #DD0000">',&nbsp;'</span><span style="color: #0000BB">$filePath</span><span style="color: #DD0000">',&nbsp;'</span><span style="color: #0000BB">$protype</span><span style="color: #DD0000">')"</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">mysql_query</span><span style="color: #007700">(</span><span style="color: #0000BB">$query</span><span style="color: #007700">)&nbsp;or&nbsp;die(</span><span style="color: #DD0000">'Error,&nbsp;query&nbsp;failed&nbsp;:&nbsp;'&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">mysql_error</span><span style="color: #007700">());<br /><br /></span><span style="color: #0000BB">mysql_close</span><span style="color: #007700">(</span><span style="color: #0000BB">$con</span><span style="color: #007700">);<br /><br /><br />echo&nbsp;</span><span style="color: #DD0000">"&lt;br&gt;Your&nbsp;Files&nbsp;Were&nbsp;Uploaded&lt;br&gt;"</span><span style="color: #007700">;<br /><br />}<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></code><hr />
</div> When running this code, everything works and writes to the database and file location. However, the products field does not write and I receive an error that states: <br />
Undefined index: product in C:\wamp\www\2CO960\php\uploadFile.php on line 10<br />
Any Ideas?<br />
<br />
Any help would be greatly rewarded, with praise!</div>

 ]]></content:encoded>
			<category domain="http://board.phpbuilder.com/forumdisplay.php?10-Coding">Coding</category>
			<dc:creator>jcoder93</dc:creator>
			<guid isPermaLink="true">http://board.phpbuilder.com/showthread.php?10389761-Help!-PHP-and-mySQL</guid>
		</item>
		<item>
			<title><![CDATA[Replace all new lines with <br> and double new lines with <p>?]]></title>
			<link>http://board.phpbuilder.com/showthread.php?10389743-Replace-all-new-lines-with-lt-br-gt-and-double-new-lines-with-lt-p-gt&amp;goto=newpost</link>
			<pubDate>Mon, 20 May 2013 09:37:30 GMT</pubDate>
			<description><![CDATA[Is it possible to replace any double new lines \n with a paragraph tag... while at the same time as replacing and single new lines \n with just a <br>

?

thanks!]]></description>
			<content:encoded><![CDATA[<div>Is it possible to replace any double new lines \n with a paragraph tag... while at the same time as replacing and single new lines \n with just a &lt;br&gt;<br />
<br />
?<br />
<br />
thanks!</div>

 ]]></content:encoded>
			<category domain="http://board.phpbuilder.com/forumdisplay.php?10-Coding">Coding</category>
			<dc:creator>listenmirndt</dc:creator>
			<guid isPermaLink="true">http://board.phpbuilder.com/showthread.php?10389743-Replace-all-new-lines-with-lt-br-gt-and-double-new-lines-with-lt-p-gt</guid>
		</item>
		<item>
			<title><![CDATA[Facebook php api feed/ post 'from' parameter?]]></title>
			<link>http://board.phpbuilder.com/showthread.php?10389735-Facebook-php-api-feed-post-from-parameter&amp;goto=newpost</link>
			<pubDate>Sun, 19 May 2013 11:22:11 GMT</pubDate>
			<description><![CDATA[Hey y'all - I've been looking all over the internet and can't find anyone talking about this, so I may just be crazy, but it appears to be happening. As of last week I had a php script working that would post to a Facebook page (business account) wall on behalf of another user (personal account) via our company app. I was using the 'from' parameter (an array with the Facebook user id and name of the submitter) and it was working perfectly. Suddenly, it seems as though Facebook is not recognizing the 'from' array parameter and the posts are going on to the page wall from the business account.

The script worked as expected on Wednesday of last week, didn't work of Friday and I'm pretty sure nothing changed in the script. Anyone else finding the same or similar behavior or know of a development roadmap announcement that I missed that could explain the difference in behavior? Even knowing that existing scripts are still working as expected would be much appreciated.]]></description>
			<content:encoded><![CDATA[<div>Hey y'all - I've been looking all over the internet and can't find anyone talking about this, so I may just be crazy, but it appears to be happening. As of last week I had a php script working that would post to a Facebook page (business account) wall on behalf of another user (personal account) via our company app. I was using the 'from' parameter (an array with the Facebook user id and name of the submitter) and it was working perfectly. Suddenly, it seems as though Facebook is not recognizing the 'from' array parameter and the posts are going on to the page wall from the business account.<br />
<br />
The script worked as expected on Wednesday of last week, didn't work of Friday and I'm pretty sure nothing changed in the script. Anyone else finding the same or similar behavior or know of a development roadmap announcement that I missed that could explain the difference in behavior? Even knowing that existing scripts are still working as expected would be much appreciated.</div>

 ]]></content:encoded>
			<category domain="http://board.phpbuilder.com/forumdisplay.php?10-Coding">Coding</category>
			<dc:creator>maxxd</dc:creator>
			<guid isPermaLink="true">http://board.phpbuilder.com/showthread.php?10389735-Facebook-php-api-feed-post-from-parameter</guid>
		</item>
		<item>
			<title>Time limitation Function in PHP</title>
			<link>http://board.phpbuilder.com/showthread.php?10389733-Time-limitation-Function-in-PHP&amp;goto=newpost</link>
			<pubDate>Sun, 19 May 2013 07:00:54 GMT</pubDate>
			<description>Hi everyone
i am working with Time limitation in php and i am new with time function
i want that i can limit someone action for sometime.
Mean if user login first time he has to post(or some other action) within 24 hours otherwise his account will block.
and when he post his time start again from beginning mean again he got 24 hours for next action.

and i also want to limit just one post in 24 hours ...


Please guide me if someone has work with time or know about this</description>
			<content:encoded><![CDATA[<div>Hi everyone<br />
i am working with Time limitation in php and i am new with time function<br />
i want that i can limit someone action for sometime.<br />
Mean if user login first time he has to post(or some other action) within 24 hours otherwise his account will block.<br />
and when he post his time start again from beginning mean again he got 24 hours for next action.<br />
<br />
and i also want to limit just one post in 24 hours ...<br />
<br />
<br />
Please guide me if someone has work with time or know about this</div>

 ]]></content:encoded>
			<category domain="http://board.phpbuilder.com/forumdisplay.php?10-Coding">Coding</category>
			<dc:creator>realcoder</dc:creator>
			<guid isPermaLink="true">http://board.phpbuilder.com/showthread.php?10389733-Time-limitation-Function-in-PHP</guid>
		</item>
		<item>
			<title>suggestions for control of cluster nodes by a master node?</title>
			<link>http://board.phpbuilder.com/showthread.php?10389729-suggestions-for-control-of-cluster-nodes-by-a-master-node&amp;goto=newpost</link>
			<pubDate>Thu, 16 May 2013 23:46:02 GMT</pubDate>
			<description><![CDATA[I'm working on a project wherein we need to auto-scale our computing resources in response to a daily batch of tasks.  Basically, the tasks arrive at midnight when a PHP script runs on a web server and inserts a bunch of records in a database table on a shared mysql server.  When these job records have been inserted, I would then like to run another script which interacts with the Rackspace cloud to launch a bunch of virtual server instances to process these jobs. 

My main question is *Can anyone recommend an effective tool or technique for a master PHP script running on my primary web server to monitor and control these newly allocated virtual servers?*

Having thought about this some, I can see that a few types of operations will be necessary:
* once a virtual (slave) server has been launched, hand that slave a unique identifier that it will use to lock records in the job database and then fire up a script on the slave to work on the jobs
* monitor the slaves as they work to keep an eye on load averages, memory usage, job completion rates, and other data related to slave health and performance.
* when the jobs have been completed, de-allocate the slave servers so we save money.

I expect I could do a roll-your-own approach to this but can't help but wonder if some helpful tool already exists that would make this easier.]]></description>
			<content:encoded><![CDATA[<div>I'm working on a project wherein we need to auto-scale our computing resources in response to a daily batch of tasks.  Basically, the tasks arrive at midnight when a PHP script runs on a web server and inserts a bunch of records in a database table on a shared mysql server.  When these job records have been inserted, I would then like to run another script which interacts with the Rackspace cloud to launch a bunch of virtual server instances to process these jobs. <br />
<br />
My main question is <b>Can anyone recommend an effective tool or technique for a master PHP script running on my primary web server to monitor and control these newly allocated virtual servers?</b><br />
<br />
Having thought about this some, I can see that a few types of operations will be necessary:<br />
* once a virtual (slave) server has been launched, hand that slave a unique identifier that it will use to lock records in the job database and then fire up a script on the slave to work on the jobs<br />
* monitor the slaves as they work to keep an eye on load averages, memory usage, job completion rates, and other data related to slave health and performance.<br />
* when the jobs have been completed, de-allocate the slave servers so we save money.<br />
<br />
I expect I could do a roll-your-own approach to this but can't help but wonder if some helpful tool already exists that would make this easier.</div>

 ]]></content:encoded>
			<category domain="http://board.phpbuilder.com/forumdisplay.php?10-Coding">Coding</category>
			<dc:creator>sneakyimp</dc:creator>
			<guid isPermaLink="true">http://board.phpbuilder.com/showthread.php?10389729-suggestions-for-control-of-cluster-nodes-by-a-master-node</guid>
		</item>
		<item>
			<title>Handling Paypal Buttons While Updating a Database</title>
			<link>http://board.phpbuilder.com/showthread.php?10389725-Handling-Paypal-Buttons-While-Updating-a-Database&amp;goto=newpost</link>
			<pubDate>Thu, 16 May 2013 15:24:13 GMT</pubDate>
			<description><![CDATA[I am testing ideas for a new section of my company's website.  We're doing online magazine subscriptions and I'm trying to find the easiest way to make online renewals automatic.

I have index.html which contains a Paypal button:

Code:
---------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<form action="handler.php" method="post" target="_top">
  <input type="hidden" name="cmd" value="_s-xclick">
  <input type="hidden" name="hosted_button_id" value="5DEAKV4T96HFS">
  <table>
    <tr>
      <td><input type="hidden" name="on0" value="Subscribe or Renew">
        Subscribe or Renew</td>
    </tr>
    <tr>
      <td><select name="os0">
          <option value="New Online Subscription">New Online Subscription $10.00 USD</option>
          <option value="Renewal">Renewal $5.00 USD</option>
        </select></td>
    </tr>
  </table>
  <input type="hidden" name="currency_code" value="USD">
  <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
  <img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
</body>
</html>
---------
Notice that I have changed the form action to "handler.php".  handler.php queries a database to update the customer's subscription expiration date.  So that the customer's subscription will expire one year from the date of renewal.  I know that my code doesn't exactly do this, but it still works for my purpose.  Once again, I'm just testing and playing around.  Here is handler.php:


PHP:
---------
$dbhost = "-------";
$dbname = "-------";
$dbuser = "-------";
$dbpass = "-------";

//Connect to server and select databse.
$con = mysql_connect("$dbhost", "$dbuser", "$dbpass");
if (!con){
	die(mysql_error($con));
}

// Select the database.
mysql_select_db("$dbname", $con);

// Query
$sqlone = "SELECT * FROM test WHERE id='1'";
$result = mysql_query ("$sqlone") or die ('Error: '.mysql_error ());
$result = mysql_fetch_array($result);

$date = $result["date"];
$currentyear = substr("$date",0,4);
$currentmonthday = substr("$date",4,9);
$renewedyear = $currentyear + 1;
$reneweddate = "$renewedyear"."$currentmonthday";

// Update the database
$sqltwo = "UPDATE test SET date='$reneweddate' WHERE id = '1'";
mysql_query ("$sqltwo") or die ('Error: '.mysql_error ());
---------
So, once the paypal button has been clicked, everything goes to handler.php, the database updates correctly, and all of the paypal variables go floating off into space never again to serve any purpose.  How can I restructure this so that my database gets updated and the paypal shopping cart still works?  I thought about passing all the paypal variables to handler.php, but from there how would I pass those variables along to the shopping cart?  Any ideas?  Any suggestions would be greatly appreciated.  Thanks.]]></description>
			<content:encoded><![CDATA[<div>I am testing ideas for a new section of my company's website.  We're doing online magazine subscriptions and I'm trying to find the easiest way to make online renewals automatic.<br />
<br />
I have index.html which contains a Paypal button:<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;<br />
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;<br />
&lt;head&gt;<br />
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;<br />
&lt;title&gt;Untitled Document&lt;/title&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
&lt;form <font color="#FF0000">action=&quot;handler.php&quot;</font> method=&quot;post&quot; target=&quot;_top&quot;&gt;<br />
&nbsp; &lt;input type=&quot;hidden&quot; name=&quot;cmd&quot; value=&quot;_s-xclick&quot;&gt;<br />
&nbsp; &lt;input type=&quot;hidden&quot; name=&quot;hosted_button_id&quot; value=&quot;5DEAKV4T96HFS&quot;&gt;<br />
&nbsp; &lt;table&gt;<br />
&nbsp; &nbsp; &lt;tr&gt;<br />
&nbsp; &nbsp; &nbsp; &lt;td&gt;&lt;input type=&quot;hidden&quot; name=&quot;on0&quot; value=&quot;Subscribe or Renew&quot;&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; Subscribe or Renew&lt;/td&gt;<br />
&nbsp; &nbsp; &lt;/tr&gt;<br />
&nbsp; &nbsp; &lt;tr&gt;<br />
&nbsp; &nbsp; &nbsp; &lt;td&gt;&lt;select name=&quot;os0&quot;&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;option value=&quot;New Online Subscription&quot;&gt;New Online Subscription $10.00 USD&lt;/option&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;option value=&quot;Renewal&quot;&gt;Renewal $5.00 USD&lt;/option&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;/select&gt;&lt;/td&gt;<br />
&nbsp; &nbsp; &lt;/tr&gt;<br />
&nbsp; &lt;/table&gt;<br />
&nbsp; &lt;input type=&quot;hidden&quot; name=&quot;currency_code&quot; value=&quot;USD&quot;&gt;<br />
&nbsp; &lt;input type=&quot;image&quot; src=&quot;https://www.paypalobjects.com/en_US/i/btn/btn_buynowCC_LG.gif&quot; border=&quot;0&quot; name=&quot;submit&quot; alt=&quot;PayPal - The safer, easier way to pay online!&quot;&gt;<br />
&nbsp; &lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;https://www.paypalobjects.com/en_US/i/scr/pixel.gif&quot; width=&quot;1&quot; height=&quot;1&quot;&gt;<br />
&lt;/form&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</code><hr />
</div> Notice that I have changed the form action to &quot;handler.php&quot;.  handler.php queries a database to update the customer's subscription expiration date.  So that the customer's subscription will expire one year from the date of renewal.  I know that my code doesn't exactly do this, but it still works for my purpose.  Once again, I'm just testing and playing around.  Here is handler.php:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">PHP Code:</div>
	<hr /><code class="bbcode_code"><code><span style="color: #000000">
<span style="color: #0000BB">$dbhost&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"-------"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$dbname&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"-------"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$dbuser&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"-------"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$dbpass&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"-------"</span><span style="color: #007700">;<br /><br /></span><span style="color: #FF8000">//Connect&nbsp;to&nbsp;server&nbsp;and&nbsp;select&nbsp;databse.<br /></span><span style="color: #0000BB">$con&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">mysql_connect</span><span style="color: #007700">(</span><span style="color: #DD0000">"</span><span style="color: #0000BB">$dbhost</span><span style="color: #DD0000">"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"</span><span style="color: #0000BB">$dbuser</span><span style="color: #DD0000">"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"</span><span style="color: #0000BB">$dbpass</span><span style="color: #DD0000">"</span><span style="color: #007700">);<br />if&nbsp;(!</span><span style="color: #0000BB">con</span><span style="color: #007700">){<br />&nbsp;&nbsp;&nbsp;&nbsp;die(</span><span style="color: #0000BB">mysql_error</span><span style="color: #007700">(</span><span style="color: #0000BB">$con</span><span style="color: #007700">));<br />}<br /><br /></span><span style="color: #FF8000">//&nbsp;Select&nbsp;the&nbsp;database.<br /></span><span style="color: #0000BB">mysql_select_db</span><span style="color: #007700">(</span><span style="color: #DD0000">"</span><span style="color: #0000BB">$dbname</span><span style="color: #DD0000">"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$con</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//&nbsp;Query<br /></span><span style="color: #0000BB">$sqlone&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"SELECT&nbsp;*&nbsp;FROM&nbsp;test&nbsp;WHERE&nbsp;id='1'"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$result&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">mysql_query&nbsp;</span><span style="color: #007700">(</span><span style="color: #DD0000">"</span><span style="color: #0000BB">$sqlone</span><span style="color: #DD0000">"</span><span style="color: #007700">)&nbsp;or&nbsp;die&nbsp;(</span><span style="color: #DD0000">'Error:&nbsp;'</span><span style="color: #007700">.</span><span style="color: #0000BB">mysql_error&nbsp;</span><span style="color: #007700">());<br /></span><span style="color: #0000BB">$result&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">mysql_fetch_array</span><span style="color: #007700">(</span><span style="color: #0000BB">$result</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$date&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$result</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">"date"</span><span style="color: #007700">&#93;;<br /></span><span style="color: #0000BB">$currentyear&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">substr</span><span style="color: #007700">(</span><span style="color: #DD0000">"</span><span style="color: #0000BB">$date</span><span style="color: #DD0000">"</span><span style="color: #007700">,</span><span style="color: #0000BB">0</span><span style="color: #007700">,</span><span style="color: #0000BB">4</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$currentmonthday&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">substr</span><span style="color: #007700">(</span><span style="color: #DD0000">"</span><span style="color: #0000BB">$date</span><span style="color: #DD0000">"</span><span style="color: #007700">,</span><span style="color: #0000BB">4</span><span style="color: #007700">,</span><span style="color: #0000BB">9</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$renewedyear&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$currentyear&nbsp;</span><span style="color: #007700">+&nbsp;</span><span style="color: #0000BB">1</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$reneweddate&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"</span><span style="color: #0000BB">$renewedyear</span><span style="color: #DD0000">"</span><span style="color: #007700">.</span><span style="color: #DD0000">"</span><span style="color: #0000BB">$currentmonthday</span><span style="color: #DD0000">"</span><span style="color: #007700">;<br /><br /></span><span style="color: #FF8000">//&nbsp;Update&nbsp;the&nbsp;database<br /></span><span style="color: #0000BB">$sqltwo&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"UPDATE&nbsp;test&nbsp;SET&nbsp;date='</span><span style="color: #0000BB">$reneweddate</span><span style="color: #DD0000">'&nbsp;WHERE&nbsp;id&nbsp;=&nbsp;'1'"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">mysql_query&nbsp;</span><span style="color: #007700">(</span><span style="color: #DD0000">"</span><span style="color: #0000BB">$sqltwo</span><span style="color: #DD0000">"</span><span style="color: #007700">)&nbsp;or&nbsp;die&nbsp;(</span><span style="color: #DD0000">'Error:&nbsp;'</span><span style="color: #007700">.</span><span style="color: #0000BB">mysql_error&nbsp;</span><span style="color: #007700">());&nbsp;<br /></span><span style="color: #0000BB"></span>
</span>
</code></code><hr />
</div> So, once the paypal button has been clicked, everything goes to handler.php, the database updates correctly, and all of the paypal variables go floating off into space never again to serve any purpose.  How can I restructure this so that my database gets updated and the paypal shopping cart still works?  I thought about passing all the paypal variables to handler.php, but from there how would I pass those variables along to the shopping cart?  Any ideas?  Any suggestions would be greatly appreciated.  Thanks.</div>

 ]]></content:encoded>
			<category domain="http://board.phpbuilder.com/forumdisplay.php?10-Coding">Coding</category>
			<dc:creator>sgrd267</dc:creator>
			<guid isPermaLink="true">http://board.phpbuilder.com/showthread.php?10389725-Handling-Paypal-Buttons-While-Updating-a-Database</guid>
		</item>
		<item>
			<title>Possible to add text to an image... and save the image, not just overlay?</title>
			<link>http://board.phpbuilder.com/showthread.php?10389723-Possible-to-add-text-to-an-image...-and-save-the-image-not-just-overlay&amp;goto=newpost</link>
			<pubDate>Thu, 16 May 2013 06:23:53 GMT</pubDate>
			<description><![CDATA[I am trying to write permanent text on an image, I've found a GD way to overlay text, but it doesn't actually write the text to the actual photo file, which is what I am hoping to be able to do... is this possible?]]></description>
			<content:encoded><![CDATA[<div>I am trying to write permanent text on an image, I've found a GD way to overlay text, but it doesn't actually write the text to the actual photo file, which is what I am hoping to be able to do... is this possible?</div>

 ]]></content:encoded>
			<category domain="http://board.phpbuilder.com/forumdisplay.php?10-Coding">Coding</category>
			<dc:creator>listenmirndt</dc:creator>
			<guid isPermaLink="true">http://board.phpbuilder.com/showthread.php?10389723-Possible-to-add-text-to-an-image...-and-save-the-image-not-just-overlay</guid>
		</item>
		<item>
			<title>Trying to write a comment system, please give thoughts.</title>
			<link>http://board.phpbuilder.com/showthread.php?10389721-Trying-to-write-a-comment-system-please-give-thoughts.&amp;goto=newpost</link>
			<pubDate>Thu, 16 May 2013 03:21:52 GMT</pubDate>
			<description><![CDATA[Alright, I have ventured out and attempted to write this code 100% myself. The problem is everything was working just fine until I tried to implement a reply system.  This code would probably make a real PHP developer disgusted, I know there is probably an easier/more logical way to do this but from my knowledge this is the only way I know how to go about doing this. 

What is your feedback? 





PHP:
---------
<?php 
//Get Comments From Database
$comments = mysql_query("SELECT id,user,comment,avatar FROM comments WHERE commentpage='$youtubeid' ") or die(mysql_error());

if (!$comments) {  //Retrieve Comments
		exit;
	}else{

	while ($commentrow = mysql_fetch_row($comments)){
	$comment_id = $commentrow['0']; //Get Comment ID
	$comment_user = $commentrow['1']; //Get Comment Author
	$comment_message= $commentrow['2']; //Get Comment Message
	$comment_avatar = $commentrow['3']; //Get Comment Avatar
	
	
$replies = mysql_query("SELECT user,comment,avatar FROM comments WHERE reply='$comment_id' ") or die(mysql_error());
if (!$replies) {  //Retrieve Reply Comments
		exit;
	}else{

	while ($commentreplyrow = mysql_fetch_row($replies)){
	$comment_replyuser = $commentreplyrow ['0']; //Get Reply Comment Author
	$comment_replymessage= $commentreplyrow ['1']; //Get Reply Comment Message
	$comment_replyavatar = $commentreplyrow ['2']; //Get Reply Comment Avatar
	

	
         echo $comment_user.'<br>'; //This is just for testing. I will make this look pretty after I get further in development.
	 echo $comment_message .'<br><br>';

          echo $comment_replyuser.'<br>';
	 echo $comment_replymessage.'<br>';
	
	}
	}
	}
	}
?>
---------
]]></description>
			<content:encoded><![CDATA[<div>Alright, I have ventured out and attempted to write this code 100% myself. The problem is everything was working just fine until I tried to implement a reply system.  This code would probably make a real PHP developer disgusted, I know there is probably an easier/more logical way to do this but from my knowledge this is the only way I know how to go about doing this. <br />
<br />
What is your feedback? <br />
<br />
<br />
<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">PHP Code:</div>
	<hr /><code class="bbcode_code"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php&nbsp;<br /></span><span style="color: #FF8000">//Get&nbsp;Comments&nbsp;From&nbsp;Database<br /></span><span style="color: #0000BB">$comments&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">mysql_query</span><span style="color: #007700">(</span><span style="color: #DD0000">"SELECT&nbsp;id,user,comment,avatar&nbsp;FROM&nbsp;comments&nbsp;WHERE&nbsp;commentpage='</span><span style="color: #0000BB">$youtubeid</span><span style="color: #DD0000">'&nbsp;"</span><span style="color: #007700">)&nbsp;or&nbsp;die(</span><span style="color: #0000BB">mysql_error</span><span style="color: #007700">());<br /><br />if&nbsp;(!</span><span style="color: #0000BB">$comments</span><span style="color: #007700">)&nbsp;{&nbsp;&nbsp;</span><span style="color: #FF8000">//Retrieve&nbsp;Comments<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">exit;<br />&nbsp;&nbsp;&nbsp;&nbsp;}else{<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;while&nbsp;(</span><span style="color: #0000BB">$commentrow&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">mysql_fetch_row</span><span style="color: #007700">(</span><span style="color: #0000BB">$comments</span><span style="color: #007700">)){<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$comment_id&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$commentrow</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'0'</span><span style="color: #007700">&#93;;&nbsp;</span><span style="color: #FF8000">//Get&nbsp;Comment&nbsp;ID<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$comment_user&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$commentrow</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'1'</span><span style="color: #007700">&#93;;&nbsp;</span><span style="color: #FF8000">//Get&nbsp;Comment&nbsp;Author<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$comment_message</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$commentrow</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'2'</span><span style="color: #007700">&#93;;&nbsp;</span><span style="color: #FF8000">//Get&nbsp;Comment&nbsp;Message<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$comment_avatar&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$commentrow</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'3'</span><span style="color: #007700">&#93;;&nbsp;</span><span style="color: #FF8000">//Get&nbsp;Comment&nbsp;Avatar<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;<br /></span><span style="color: #0000BB">$replies&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">mysql_query</span><span style="color: #007700">(</span><span style="color: #DD0000">"SELECT&nbsp;user,comment,avatar&nbsp;FROM&nbsp;comments&nbsp;WHERE&nbsp;reply='</span><span style="color: #0000BB">$comment_id</span><span style="color: #DD0000">'&nbsp;"</span><span style="color: #007700">)&nbsp;or&nbsp;die(</span><span style="color: #0000BB">mysql_error</span><span style="color: #007700">());<br />if&nbsp;(!</span><span style="color: #0000BB">$replies</span><span style="color: #007700">)&nbsp;{&nbsp;&nbsp;</span><span style="color: #FF8000">//Retrieve&nbsp;Reply&nbsp;Comments<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">exit;<br />&nbsp;&nbsp;&nbsp;&nbsp;}else{<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;while&nbsp;(</span><span style="color: #0000BB">$commentreplyrow&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">mysql_fetch_row</span><span style="color: #007700">(</span><span style="color: #0000BB">$replies</span><span style="color: #007700">)){<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$comment_replyuser&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$commentreplyrow&nbsp;</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'0'</span><span style="color: #007700">&#93;;&nbsp;</span><span style="color: #FF8000">//Get&nbsp;Reply&nbsp;Comment&nbsp;Author<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$comment_replymessage</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$commentreplyrow&nbsp;</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'1'</span><span style="color: #007700">&#93;;&nbsp;</span><span style="color: #FF8000">//Get&nbsp;Reply&nbsp;Comment&nbsp;Message<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$comment_replyavatar&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$commentreplyrow&nbsp;</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'2'</span><span style="color: #007700">&#93;;&nbsp;</span><span style="color: #FF8000">//Get&nbsp;Reply&nbsp;Comment&nbsp;Avatar<br />&nbsp;&nbsp;&nbsp;&nbsp;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">$comment_user</span><span style="color: #007700">.</span><span style="color: #DD0000">'&lt;br&gt;'</span><span style="color: #007700">;&nbsp;</span><span style="color: #FF8000">//This&nbsp;is&nbsp;just&nbsp;for&nbsp;testing.&nbsp;I&nbsp;will&nbsp;make&nbsp;this&nbsp;look&nbsp;pretty&nbsp;after&nbsp;I&nbsp;get&nbsp;further&nbsp;in&nbsp;development.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">$comment_message&nbsp;</span><span style="color: #007700">.</span><span style="color: #DD0000">'&lt;br&gt;&lt;br&gt;'</span><span style="color: #007700">;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #0000BB">$comment_replyuser</span><span style="color: #007700">.</span><span style="color: #DD0000">'&lt;br&gt;'</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #0000BB">$comment_replymessage</span><span style="color: #007700">.</span><span style="color: #DD0000">'&lt;br&gt;'</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></code><hr />
</div> </div>

 ]]></content:encoded>
			<category domain="http://board.phpbuilder.com/forumdisplay.php?10-Coding">Coding</category>
			<dc:creator>JustCoding</dc:creator>
			<guid isPermaLink="true">http://board.phpbuilder.com/showthread.php?10389721-Trying-to-write-a-comment-system-please-give-thoughts.</guid>
		</item>
		<item>
			<title>Formatting text file</title>
			<link>http://board.phpbuilder.com/showthread.php?10389713-Formatting-text-file&amp;goto=newpost</link>
			<pubDate>Wed, 15 May 2013 08:41:17 GMT</pubDate>
			<description>Hi!
i have some data exactly as below:

Code:
---------
country 
town
monument

france
paris
eiffel

usa
newyork
manatthan
...
---------
I need to format as below:

Code:
---------
country town monument
france paris eiffel
usa newyork manatthan
---------
How can I obtain this result?

Thanks!</description>
			<content:encoded><![CDATA[<div>Hi!<br />
i have some data exactly as below:<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">country <br />
town<br />
monument<br />
<br />
france<br />
paris<br />
eiffel<br />
<br />
usa<br />
newyork<br />
manatthan<br />
...</code><hr />
</div> I need to format as below:<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">country town monument<br />
france paris eiffel<br />
usa newyork manatthan</code><hr />
</div> How can I obtain this result?<br />
<br />
Thanks!</div>

 ]]></content:encoded>
			<category domain="http://board.phpbuilder.com/forumdisplay.php?10-Coding">Coding</category>
			<dc:creator>joane1</dc:creator>
			<guid isPermaLink="true">http://board.phpbuilder.com/showthread.php?10389713-Formatting-text-file</guid>
		</item>
		<item>
			<title><![CDATA["Interprocess" communication and serialized data ...]]></title>
			<link>http://board.phpbuilder.com/showthread.php?10389707-quot-Interprocess-quot-communication-and-serialized-data-...&amp;goto=newpost</link>
			<pubDate>Tue, 14 May 2013 20:45:48 GMT</pubDate>
			<description><![CDATA[I'm working on another stage of a large project at work.

After munging some data objects, one process needs to "queue it up" for another to be run at a later time.

Currently I'm thinking to serialize the data and pop it in a table with a couple additional tagging fields.

Something like:


Code:
---------
+------------+-------------+------+-----+---------+----------------+
| Field      | Type        | Null | Key | Default | Extra          |
+------------+-------------+------+-----+---------+----------------+
| id         | int(11)     | NO   | PRI | NULL    | auto_increment |
| clientid   | int(11)     | NO   | MUL | NULL    |                |
| ordernum   | varchar(64) | NO   |     | NULL    |                |
| t_package  | mediumblob  | NO   |     | NULL    |                |
+------------+-------------+------+-----+---------+----------------+
---------
Is there any reason I shouldn't do it this way?  Some other system?  I really want to keep the object in its previous state, but can't hand it off to the next process immediately.

Thanks in advance,]]></description>
			<content:encoded><![CDATA[<div>I'm working on another stage of a large project at work.<br />
<br />
After munging some data objects, one process needs to &quot;queue it up&quot; for another to be run at a later time.<br />
<br />
Currently I'm thinking to serialize the data and pop it in a table with a couple additional tagging fields.<br />
<br />
Something like:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">+------------+-------------+------+-----+---------+----------------+<br />
| Field&nbsp; &nbsp; &nbsp; | Type&nbsp; &nbsp; &nbsp; &nbsp; | Null | Key | Default | Extra&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |<br />
+------------+-------------+------+-----+---------+----------------+<br />
| id&nbsp; &nbsp; &nbsp; &nbsp;  | int(11)&nbsp; &nbsp;  | NO&nbsp;  | PRI | NULL&nbsp; &nbsp; | auto_increment |<br />
| clientid&nbsp;  | int(11)&nbsp; &nbsp;  | NO&nbsp;  | MUL | NULL&nbsp; &nbsp; |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |<br />
| ordernum&nbsp;  | varchar(64) | NO&nbsp;  |&nbsp; &nbsp;  | NULL&nbsp; &nbsp; |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |<br />
| t_package&nbsp; | mediumblob&nbsp; | NO&nbsp;  |&nbsp; &nbsp;  | NULL&nbsp; &nbsp; |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |<br />
+------------+-------------+------+-----+---------+----------------+</code><hr />
</div> Is there any reason I shouldn't do it this way?  Some other system?  I really want to keep the object in its previous state, but can't hand it off to the next process immediately.<br />
<br />
Thanks in advance,</div>

 ]]></content:encoded>
			<category domain="http://board.phpbuilder.com/forumdisplay.php?10-Coding">Coding</category>
			<dc:creator>dalecosp</dc:creator>
			<guid isPermaLink="true">http://board.phpbuilder.com/showthread.php?10389707-quot-Interprocess-quot-communication-and-serialized-data-...</guid>
		</item>
		<item>
			<title>Parse error: syntax error, unexpected T_STRING</title>
			<link>http://board.phpbuilder.com/showthread.php?10389695-Parse-error-syntax-error-unexpected-T_STRING&amp;goto=newpost</link>
			<pubDate>Mon, 13 May 2013 04:35:13 GMT</pubDate>
			<description><![CDATA[I have this code which I want to show the records of a table and it's giving me a "Parse error: syntax error, unexpected T_STRING", it's saying the error is on this line;

echo "<tr><th align=left>Student Name</th><th align=left>Address</th><th align=left>Phone Number</th><th align=left>Reg-Number</th></tr>\n";
 but I cant see it. what is the problem.

PHP:
---------
<?php
$db = mysql_connect("localhost", "root");
mysql_select_db("membership",$db);
$query = "SELECT  * FROM members;
$result = mysql_query($query) or die(mysql_error());
if ($mycolumn = mysql_fetch_array($result)) {
echo "<table border=1 align=center cellspacing=0\n";
echo "<tr><th align=left>Student Name</th><th align=left>Address</th><th align=left>Phone Number</th><th align=left>Reg-Number</th></tr>\n";
do {
printf("<tr><td>%s %s %s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>\n",  $mycolumn["title"], $mycolumn["firstname"], $mycolumn["lastname"], $mycolumn["address"],
$mycolumn["phonenumber"], $mycolumn["regnumber"]);
} while ($mycolumn = mysql_fetch_array($result));
//echo "<BR>";
echo "<h3>REGISTERED MEMBERS</h3>";
echo "<BR>";
echo "</table>\n";
} else {
echo "Sorry, no records were found!";
}
?>
---------
]]></description>
			<content:encoded><![CDATA[<div>I have this code which I want to show the records of a table and it's giving me a &quot;Parse error: syntax error, unexpected T_STRING&quot;, it's saying the error is on this line;<br />
<br />
echo &quot;&lt;tr&gt;&lt;th align=left&gt;Student Name&lt;/th&gt;&lt;th align=left&gt;Address&lt;/th&gt;&lt;th align=left&gt;Phone Number&lt;/th&gt;&lt;th align=left&gt;Reg-Number&lt;/th&gt;&lt;/tr&gt;\n&quot;;<br />
 but I cant see it. what is the problem.<br />
<div class="bbcode_container">
	<div class="bbcode_description">PHP Code:</div>
	<hr /><code class="bbcode_code"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$db&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">mysql_connect</span><span style="color: #007700">(</span><span style="color: #DD0000">"localhost"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"root"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">mysql_select_db</span><span style="color: #007700">(</span><span style="color: #DD0000">"membership"</span><span style="color: #007700">,</span><span style="color: #0000BB">$db</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$query&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"SELECT&nbsp;&nbsp;*&nbsp;FROM&nbsp;members;<br /></span><span style="color: #0000BB">$result</span><span style="color: #DD0000">&nbsp;=&nbsp;mysql_query(</span><span style="color: #0000BB">$query</span><span style="color: #DD0000">)&nbsp;or&nbsp;die(mysql_error());<br />if&nbsp;(</span><span style="color: #0000BB">$mycolumn</span><span style="color: #DD0000">&nbsp;=&nbsp;mysql_fetch_array(</span><span style="color: #0000BB">$result</span><span style="color: #DD0000">))&nbsp;{<br />echo&nbsp;"</span><span style="color: #007700">&lt;</span><span style="color: #0000BB">table&nbsp;border</span><span style="color: #007700">=</span><span style="color: #0000BB">1&nbsp;align</span><span style="color: #007700">=</span><span style="color: #0000BB">center&nbsp;cellspacing</span><span style="color: #007700">=</span><span style="color: #0000BB">0</span><span style="color: #007700">\</span><span style="color: #0000BB">n</span><span style="color: #DD0000">";<br />echo&nbsp;"</span><span style="color: #007700">&lt;</span><span style="color: #0000BB">tr</span><span style="color: #007700">&gt;&lt;</span><span style="color: #0000BB">th&nbsp;align</span><span style="color: #007700">=</span><span style="color: #0000BB">left</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">Student&nbsp;Name</span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">th</span><span style="color: #007700">&gt;&lt;</span><span style="color: #0000BB">th&nbsp;align</span><span style="color: #007700">=</span><span style="color: #0000BB">left</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">Address</span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">th</span><span style="color: #007700">&gt;&lt;</span><span style="color: #0000BB">th&nbsp;align</span><span style="color: #007700">=</span><span style="color: #0000BB">left</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">Phone&nbsp;Number</span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">th</span><span style="color: #007700">&gt;&lt;</span><span style="color: #0000BB">th&nbsp;align</span><span style="color: #007700">=</span><span style="color: #0000BB">left</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">Reg</span><span style="color: #007700">-</span><span style="color: #0000BB">Number</span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">th</span><span style="color: #007700">&gt;&lt;/</span><span style="color: #0000BB">tr</span><span style="color: #007700">&gt;\</span><span style="color: #0000BB">n</span><span style="color: #DD0000">";<br />do&nbsp;{<br />printf("</span><span style="color: #007700">&lt;</span><span style="color: #0000BB">tr</span><span style="color: #007700">&gt;&lt;</span><span style="color: #0000BB">td</span><span style="color: #007700">&gt;%</span><span style="color: #0000BB">s&nbsp;</span><span style="color: #007700">%</span><span style="color: #0000BB">s&nbsp;</span><span style="color: #007700">%</span><span style="color: #0000BB">s</span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">td</span><span style="color: #007700">&gt;&lt;</span><span style="color: #0000BB">td</span><span style="color: #007700">&gt;%</span><span style="color: #0000BB">s</span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">td</span><span style="color: #007700">&gt;&lt;</span><span style="color: #0000BB">td</span><span style="color: #007700">&gt;%</span><span style="color: #0000BB">s</span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">td</span><span style="color: #007700">&gt;&lt;</span><span style="color: #0000BB">td</span><span style="color: #007700">&gt;%</span><span style="color: #0000BB">s</span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">td</span><span style="color: #007700">&gt;&lt;</span><span style="color: #0000BB">td</span><span style="color: #007700">&gt;%</span><span style="color: #0000BB">s</span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">td</span><span style="color: #007700">&gt;&lt;</span><span style="color: #0000BB">td</span><span style="color: #007700">&gt;%</span><span style="color: #0000BB">s</span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">td</span><span style="color: #007700">&gt;&lt;/</span><span style="color: #0000BB">tr</span><span style="color: #007700">&gt;\</span><span style="color: #0000BB">n</span><span style="color: #DD0000">",&nbsp;&nbsp;</span><span style="color: #0000BB">$mycolumn</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">"</span><span style="color: #0000BB">title</span><span style="color: #DD0000">"</span><span style="color: #007700">&#93;</span><span style="color: #DD0000">,&nbsp;</span><span style="color: #0000BB">$mycolumn</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">"</span><span style="color: #0000BB">firstname</span><span style="color: #DD0000">"</span><span style="color: #007700">&#93;</span><span style="color: #DD0000">,&nbsp;</span><span style="color: #0000BB">$mycolumn</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">"</span><span style="color: #0000BB">lastname</span><span style="color: #DD0000">"</span><span style="color: #007700">&#93;</span><span style="color: #DD0000">,&nbsp;</span><span style="color: #0000BB">$mycolumn</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">"</span><span style="color: #0000BB">address</span><span style="color: #DD0000">"</span><span style="color: #007700">&#93;</span><span style="color: #DD0000">,<br /></span><span style="color: #0000BB">$mycolumn</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">"</span><span style="color: #0000BB">phonenumber</span><span style="color: #DD0000">"</span><span style="color: #007700">&#93;</span><span style="color: #DD0000">,&nbsp;</span><span style="color: #0000BB">$mycolumn</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">"</span><span style="color: #0000BB">regnumber</span><span style="color: #DD0000">"</span><span style="color: #007700">&#93;</span><span style="color: #DD0000">);<br />}&nbsp;while&nbsp;(</span><span style="color: #0000BB">$mycolumn</span><span style="color: #DD0000">&nbsp;=&nbsp;mysql_fetch_array(</span><span style="color: #0000BB">$result</span><span style="color: #DD0000">));<br />//echo&nbsp;"</span><span style="color: #007700">&lt;</span><span style="color: #0000BB">BR</span><span style="color: #007700">&gt;</span><span style="color: #DD0000">";<br />echo&nbsp;"</span><span style="color: #007700">&lt;</span><span style="color: #0000BB">h3</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">REGISTERED&nbsp;MEMBERS</span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">h3</span><span style="color: #007700">&gt;</span><span style="color: #DD0000">";<br />echo&nbsp;"</span><span style="color: #007700">&lt;</span><span style="color: #0000BB">BR</span><span style="color: #007700">&gt;</span><span style="color: #DD0000">";<br />echo&nbsp;"</span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">table</span><span style="color: #007700">&gt;\</span><span style="color: #0000BB">n</span><span style="color: #DD0000">";<br />}&nbsp;else&nbsp;{<br />echo&nbsp;"</span><span style="color: #0000BB">Sorry</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">no&nbsp;records&nbsp;were&nbsp;found</span><span style="color: #007700">!</span><span style="color: #DD0000">";<br />}<br />?&gt;</span>
</span>
</code></code><hr />
</div> </div>

 ]]></content:encoded>
			<category domain="http://board.phpbuilder.com/forumdisplay.php?10-Coding">Coding</category>
			<dc:creator>cimanyenje</dc:creator>
			<guid isPermaLink="true">http://board.phpbuilder.com/showthread.php?10389695-Parse-error-syntax-error-unexpected-T_STRING</guid>
		</item>
	</channel>
</rss>
