<?xml version="1.0" encoding="utf-8"?>
<!-- generator="FeedCreator 1.7.2" -->
<rss version="2.0">
    <channel>
        <title>Lowyat.NET: Latest topics by crliuh</title>
        <description></description>
        <link>http://forum.lowyat.net/</link>
        <lastBuildDate>Sun, 07 Jun 2026 19:31:17 +0800</lastBuildDate>
        <generator>FeedCreator 1.7.2</generator>
        <item>
            <title>(WTS) Lenovo ThinkPad T440 (Refurbish) For Sales</title>
            <link>http://forum.lowyat.net/topic/3829086</link>
            <description>&lt;b&gt;Item(s): Lenovo ThinkPad T440 (Refurbish)&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Package includes: One laptop with cable&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Price: RM3,000 (Original Price: RM5,400)&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Warranty: Remain 3 months ++&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Dealing method: COD / Shipping Within West Malaysia&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Location of seller: Klang Valley&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Contact method/details: PM me &lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Age of item:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;---&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Item(s) conditions: Fully New&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Picture: &lt;a href='http://postimg.org/image/48wmhs5fz/' target='_blank'&gt;http://postimg.org/image/48wmhs5fz/&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Reason for sale: Got many extra laptop liao&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Lenovo ThinkPad T440 (Refurbish)&lt;br /&gt;CPU		: Intel i7-4600U 2.1 GHz (up to 3.3 GHz)&lt;br /&gt;Memory	: 12GB (4GB soldered +8GB in Slot) Memory DDR3 1600 MHz&lt;br /&gt;Storage		: 1TB HDD 5400 rpm&lt;br /&gt;Display		: 14&amp;quot; HD+ (1400x900)&lt;br /&gt;Sound		: Dolby Home Theater v4&lt;br /&gt;OS		: Microsoft Win 8.1 Professional 64 bits (Upgraded)&lt;br /&gt;Battery		: Internal Battery (3-Cell) + ThinkPad® 68 Battery (3-Cell 23.5 Whr)&lt;br /&gt;Optical Drive	: No&lt;br /&gt;I/O		: miniDisplayPort with Audio, VGA, 2 x USB 3.0, SD Card Reader, RJ45&lt;br /&gt;Others		: Webcam 720HD, Fingerprint Reader, Bluetooth 4.0&lt;br /&gt;Warranty	: Remain 3 months ++&lt;br /&gt;Serial Number		: PC02DQNH&lt;br /&gt;Machine-type model	: 20B7A10CMY&lt;br /&gt;Warranty Status		: In Warranty, expires 2016-04-30&lt;br /&gt;&lt;br /&gt;Selling Price: RM3,000 (Original Price: RM5,400)&lt;br /&gt;</description>
            <author>crliuh</author>
            <category>Notebooks Garage Sales</category>
            <pubDate>Thu, 07 Jan 2016 13:00:52 +0800</pubDate>
        </item>
        <item>
            <title>which photo book better?</title>
            <link>http://forum.lowyat.net/topic/2862239</link>
            <description>wanna do a photo book for my gf  &lt;!--emo&amp;:P--&gt;&lt;img src='http://static.lowyat.net/style_emoticons/default/tongue.gif' border='0' style='vertical-align:middle' alt='tongue.gif' /&gt;&lt;!--endemo--&gt; not sure which one to choose. after researches got a few shortlisted... need you guys comments to let me decide which to go for... &lt;br /&gt;&lt;br /&gt;&lt;a href='http://www.pixajoy.com' target='_blank'&gt;Pixajoy&lt;/a&gt;&lt;br /&gt;&lt;a href='http://www.fotozzoom.com/photobook' target='_blank'&gt;fotozzoom&lt;/a&gt;&lt;br /&gt;&lt;a href='http://photobook.com.my' target='_blank'&gt;photobook malaysia&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;still got more... but so far these few get better rating among them.. &lt;br /&gt;&lt;br /&gt;Downloaded these 3 software and seriously the fastest download speed is fotozzoom... impressed &lt;!--emo&amp;:D--&gt;&lt;img src='http://static.lowyat.net/style_emoticons/default/biggrin.gif' border='0' style='vertical-align:middle' alt='biggrin.gif' /&gt;&lt;!--endemo--&gt; &lt;br /&gt;&lt;br /&gt;3 of these softwares are almost the same... not very hard to use lar.. drag drag only..  &lt;br /&gt;&lt;br /&gt;so far photobok msia has more design than the rest and some of them are quite nice  &lt;!--emo&amp;:blush:--&gt;&lt;img src='http://static.lowyat.net/style_emoticons/default/blush.gif' border='0' style='vertical-align:middle' alt='blush.gif' /&gt;&lt;!--endemo--&gt; hopefully fotozzoom and pixajoy will add more theme designs soon hoho&lt;br /&gt;&lt;br /&gt;i saw something interesting about the layflat effect.. i think that solved my problem.. i got 1 friend printed a photobook before but the object between the pages really lost @@ omg... only pixajoy and fotozzoom provide layflat photobook.. &lt;br /&gt;&lt;br /&gt;the rest of the technical stuffs need you guys expert comment  &lt;!--emo&amp;:respect:--&gt;&lt;img src='http://static.lowyat.net/style_emoticons/default/notworthy.gif' border='0' style='vertical-align:middle' alt='notworthy.gif' /&gt;&lt;!--endemo--&gt;  &lt;!--emo&amp;:respect:--&gt;&lt;img src='http://static.lowyat.net/style_emoticons/default/notworthy.gif' border='0' style='vertical-align:middle' alt='notworthy.gif' /&gt;&lt;!--endemo--&gt;  &lt;!--emo&amp;:respect:--&gt;&lt;img src='http://static.lowyat.net/style_emoticons/default/notworthy.gif' border='0' style='vertical-align:middle' alt='notworthy.gif' /&gt;&lt;!--endemo--&gt; &lt;br /&gt;&lt;br /&gt;btw.. these 3 company do have promotion now.. price reasonable lar.. haha</description>
            <author>crliuh</author>
            <category>Photography, Digital Imaging &amp;amp; Video</category>
            <pubDate>Tue, 25 Jun 2013 16:49:17 +0800</pubDate>
        </item>
        <item>
            <title>Image and text validation in a same function</title>
            <link>http://forum.lowyat.net/topic/1139987</link>
            <description>i am quite new in javascript&lt;br /&gt;&lt;br /&gt;validation with javascript is some ting vry new to me&lt;br /&gt;&lt;br /&gt;i found both text and image validation in the web and i meet the problem which cant combining both text and image validation together&lt;br /&gt;&lt;br /&gt;&lt;!--c1--&gt;&lt;div class='codetop'&gt;CODE&lt;/div&gt;&lt;div class='codemain'&gt;&lt;!--ec1--&gt;This is the code for text validation&lt;br /&gt;&lt;br /&gt;function trim&amp;#40;str&amp;#41;&lt;br /&gt;{&lt;br /&gt;	return str.replace&amp;#40;/^&amp;#092;s+|&amp;#092;s+&amp;#036;/g,&amp;#39;&amp;#39;&amp;#41;;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function validate_required&amp;#40;field,alerttxt&amp;#41;&lt;br /&gt;{&lt;br /&gt;with &amp;#40;field&amp;#41;&lt;br /&gt;  {&lt;br /&gt;  value = trim&amp;#40;value&amp;#41;;&lt;br /&gt;  if &amp;#40;value==null||value==&amp;#34;&amp;#34;&amp;#41;&lt;br /&gt;    {&lt;br /&gt;    alert&amp;#40;alerttxt&amp;#41;;return false;&lt;br /&gt;    }&lt;br /&gt;  else&lt;br /&gt;    {&lt;br /&gt;    return true;&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;function checkcatForm&amp;#40;thisform&amp;#41;&lt;br /&gt;{&lt;br /&gt;with &amp;#40;thisform&amp;#41;&lt;br /&gt; &amp;nbsp;{&lt;br /&gt; &amp;nbsp; &lt;br /&gt; &amp;nbsp;if &amp;#40;validate_required&amp;#40;mname,&amp;#34;Name must be filled out&amp;#33;&amp;#34;&amp;#41;==false&amp;#41;&lt;br /&gt; &amp;nbsp; &amp;nbsp;	{mname.focus&amp;#40;&amp;#41;;return false;}&lt;br /&gt; &amp;nbsp;	&lt;br /&gt; &amp;nbsp; var textarea = tinyMCE.get&amp;#40;&amp;#39;mdetails&amp;#39;&amp;#41;.getContent&amp;#40;&amp;#41;; &lt;br /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if &amp;#40; &amp;#40;textarea==&amp;#34;&amp;#34;&amp;#41; || &amp;#40;textarea==null&amp;#41; &amp;#41; {&lt;br /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;alert&amp;#40;&amp;#34;Post body must not be left blank&amp;#34;&amp;#41;;&lt;br /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //FRMpostText.focus&amp;#40;&amp;#41;;&lt;br /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return false; &lt;br /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}else {return;}&lt;br /&gt;	&lt;br /&gt; &amp;nbsp;}&lt;br /&gt;&lt;br /&gt; &amp;nbsp;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;!--c2--&gt;&lt;/div&gt;&lt;!--ec2--&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--c1--&gt;&lt;div class='codetop'&gt;CODE&lt;/div&gt;&lt;div class='codemain'&gt;&lt;!--ec1--&gt;this is the code for image validation&lt;br /&gt;function validate&amp;#40;&amp;#41;&lt;br /&gt;{&lt;br /&gt;var extensions = new Array&amp;#40;&amp;#34;jpg&amp;#34;,&amp;#34;jpeg&amp;#34;,&amp;#34;JPEG&amp;#34;,&amp;#34;JPG&amp;#34;&amp;#41;;&lt;br /&gt;&lt;br /&gt;var image_file = document.form.image_file.value;&lt;br /&gt;&lt;br /&gt;var image_length = document.form.image_file.value.length;&lt;br /&gt;&lt;br /&gt;var pos = image_file.lastIndexOf&amp;#40;&amp;#39;.&amp;#39;&amp;#41; + 1;&lt;br /&gt;&lt;br /&gt;var ext = image_file.substring&amp;#40;pos, image_length&amp;#41;;&lt;br /&gt;&lt;br /&gt;var final_ext = ext.toLowerCase&amp;#40;&amp;#41;;&lt;br /&gt;&lt;br /&gt;for &amp;#40;i = 0; i &amp;#60; extensions.length; i++&amp;#41;&lt;br /&gt;{&lt;br /&gt;if&amp;#40;extensions&amp;#91;i&amp;#93; == final_ext&amp;#41;&lt;br /&gt;{&lt;br /&gt;return true;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;alert&amp;#40;&amp;#34;You must upload an image file with one of the following extensions&amp;#58; &amp;#34;+ extensions.join&amp;#40;&amp;#39;, &amp;#39;&amp;#41; +&amp;#34;.&amp;#34;&amp;#41;;&lt;br /&gt;return false;&lt;br /&gt;}&lt;!--c2--&gt;&lt;/div&gt;&lt;!--ec2--&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--c1--&gt;&lt;div class='codetop'&gt;CODE&lt;/div&gt;&lt;div class='codemain'&gt;&lt;!--ec1--&gt;so now i try 2 combine 2 code into i function to validation one form tat consist of text and also image feild&lt;br /&gt;&lt;br /&gt;function checkcatForm&amp;#40;thisform&amp;#41;&lt;br /&gt;{&lt;br /&gt;with &amp;#40;thisform&amp;#41;&lt;br /&gt;  {&lt;br /&gt;   &lt;br /&gt;  if &amp;#40;validate_required&amp;#40;mname,&amp;#34;Name must be filled out&amp;#33;&amp;#34;&amp;#41;==false&amp;#41;&lt;br /&gt;    	{mname.focus&amp;#40;&amp;#41;;return false;}&lt;br /&gt;  	&lt;br /&gt;   var textarea = tinyMCE.get&amp;#40;&amp;#39;mdetails&amp;#39;&amp;#41;.getContent&amp;#40;&amp;#41;; &lt;br /&gt;            if &amp;#40; &amp;#40;textarea==&amp;#34;&amp;#34;&amp;#41; || &amp;#40;textarea==null&amp;#41; &amp;#41; {&lt;br /&gt;                    alert&amp;#40;&amp;#34;Post body must not be left blank&amp;#34;&amp;#41;;&lt;br /&gt;                   //FRMpostText.focus&amp;#40;&amp;#41;;&lt;br /&gt;                    return false; &lt;br /&gt;            }else {return;}&lt;br /&gt;&lt;br /&gt;var extensions = new Array&amp;#40;&amp;#34;jpg&amp;#34;,&amp;#34;jpeg&amp;#34;,&amp;#34;JPEG&amp;#34;,&amp;#34;JPG&amp;#34;&amp;#41;;&lt;br /&gt;&lt;br /&gt;var image_file = document.form.image_file.value;&lt;br /&gt;&lt;br /&gt;var image_length = document.form.image_file.value.length;&lt;br /&gt;&lt;br /&gt;var pos = image_file.lastIndexOf&amp;#40;&amp;#39;.&amp;#39;&amp;#41; + 1;&lt;br /&gt;&lt;br /&gt;var ext = image_file.substring&amp;#40;pos, image_length&amp;#41;;&lt;br /&gt;&lt;br /&gt;var final_ext = ext.toLowerCase&amp;#40;&amp;#41;;&lt;br /&gt;&lt;br /&gt;for &amp;#40;i = 0; i &amp;#60; extensions.length; i++&amp;#41;&lt;br /&gt;{&lt;br /&gt;if&amp;#40;extensions&amp;#91;i&amp;#93; == final_ext&amp;#41;&lt;br /&gt;{&lt;br /&gt;return true;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;alert&amp;#40;&amp;#34;You must upload an image file with one of the following extensions&amp;#58; &amp;#34;+ extensions.join&amp;#40;&amp;#39;, &amp;#39;&amp;#41; +&amp;#34;.&amp;#34;&amp;#41;;&lt;br /&gt;return false;&lt;br /&gt;}}}&lt;br /&gt;&lt;br /&gt;//form --------------&lt;br /&gt;&lt;br /&gt;&amp;#60;form action=&amp;#34;next.html&amp;#34; method=&amp;#34;post&amp;#34; enctype=&amp;#34;multipart/form-data&amp;#34; name=&amp;#34;form&amp;#34; onsubmit=&amp;#34;return checkcatForm&amp;#40;this&amp;#41;;&amp;#34;&amp;#62;&lt;br /&gt;&amp;#60;table width=&amp;#34;100%&amp;#34; border=&amp;#34;0&amp;#34; cellspacing=&amp;#34;1&amp;#34; cellpadding=&amp;#34;1&amp;#34;&amp;#62;&lt;br /&gt;  &amp;#60;tr&amp;#62;&lt;br /&gt;    &amp;#60;th scope=&amp;#34;row&amp;#34;&amp;#62;Model name&amp;#58;&amp;#60;/th&amp;#62;&lt;br /&gt;    &amp;#60;td&amp;#62;&lt;br /&gt;        &amp;#60;input type=&amp;#34;text&amp;#34; name=&amp;#34;mname&amp;#34; id=&amp;#34;mname&amp;#34; value =&amp;#34;&amp;#34;&amp;#62;    &amp;#60;/td&amp;#62;&lt;br /&gt;  &amp;#60;/tr&amp;#62;&lt;br /&gt;    &amp;#60;th scope=&amp;#34;row&amp;#34;&amp;#62;&amp;#60;p&amp;#62;Model details&amp;#58;&amp;#60;/p&amp;#62;    &amp;#60;/th&amp;#62;&lt;br /&gt;    &amp;#60;td&amp;#62;&lt;br /&gt;      &amp;#60;textarea name=&amp;#34;mdetails&amp;#34; id=&amp;#34;mdetails&amp;#34; cols=&amp;#34;45&amp;#34; rows=&amp;#34;10&amp;#34;&amp;#60;/textarea&amp;#62;&lt;br /&gt; &amp;#60;/td&amp;#62;&lt;br /&gt;  &amp;#60;/tr&amp;#62;&lt;br /&gt;  &amp;#60;tr&amp;#62;&lt;br /&gt;    &amp;#60;th scope=&amp;#34;row&amp;#34;&amp;#62;Model image&amp;#58;&amp;#60;/th&amp;#62;&lt;br /&gt;    &amp;#60;td&amp;#62;&lt;br /&gt;      &amp;#60;input type=&amp;#34;file&amp;#34; name=&amp;#34;image_file&amp;#34; id=&amp;#34;image_file&amp;#34;&amp;#62;   &amp;#60;/td&amp;#62;&lt;br /&gt;  &amp;#60;/tr&amp;#62;&lt;br /&gt;  &amp;#60;tr&amp;#62;&lt;br /&gt;    &amp;#60;th scope=&amp;#34;row&amp;#34;&amp;#62;&amp;amp;nbsp;&amp;#60;/th&amp;#62;&lt;br /&gt;    &amp;#60;td&amp;#62;&lt;br /&gt;    &amp;#60;input type=&amp;#34;submit&amp;#34; name=&amp;#34;add&amp;#34; id=&amp;#34;add&amp;#34; value=&amp;#34;&amp;#60;?php if&amp;#40;&amp;#036;edit&amp;#41; {echo &amp;#39;Edit&amp;#39;;} else { echo &amp;#39;Add&amp;#39;;} ?&amp;#62;&amp;#34;/&amp;#62;&lt;br /&gt;    &amp;#60;input name=&amp;#34;btnCancel&amp;#34; type=&amp;#34;button&amp;#34; id=&amp;#34;btnCancel&amp;#34; value=&amp;#34;Cancel&amp;#34; onClick=&amp;#34;window.history.back&amp;#40;&amp;#41;;&amp;#34;&amp;#62; &amp;#60;/td&amp;#62;&lt;br /&gt;  &amp;#60;/tr&amp;#62;&lt;br /&gt; &amp;#60;/table&amp;#62;&lt;br /&gt;&amp;#60;/form&amp;#62;&lt;br /&gt;&lt;!--c2--&gt;&lt;/div&gt;&lt;!--ec2--&gt;&lt;br /&gt;&lt;br /&gt;And the validation does&amp;#39;t work any more. i cant get any solution in my problem. &lt;br /&gt;&lt;br /&gt;any guru pls help  &lt;!--emo&amp;:help:--&gt;&lt;img src='http://static.lowyat.net/style_emoticons/default/icon_question.gif' border='0' style='vertical-align:middle' alt='icon_question.gif' /&gt;&lt;!--endemo--&gt;  &lt;!--emo&amp;:help:--&gt;&lt;img src='http://static.lowyat.net/style_emoticons/default/icon_question.gif' border='0' style='vertical-align:middle' alt='icon_question.gif' /&gt;&lt;!--endemo--&gt;  &lt;!--emo&amp;:help:--&gt;&lt;img src='http://static.lowyat.net/style_emoticons/default/icon_question.gif' border='0' style='vertical-align:middle' alt='icon_question.gif' /&gt;&lt;!--endemo--&gt;</description>
            <author>crliuh</author>
            <category>Codemasters</category>
            <pubDate>Sun, 23 Aug 2009 19:51:23 +0800</pubDate>
        </item>
        <item>
            <title>Storing stripslashes data after addslashes</title>
            <link>http://forum.lowyat.net/topic/1134943</link>
            <description>i got some question regarding the title&lt;br /&gt;&lt;br /&gt;is there any way to do tat (storing the unslashed data after addslashes the &amp;#036;post)&lt;br /&gt;&lt;br /&gt;for example&lt;br /&gt;&lt;br /&gt;&amp;#036;_post[&amp;#39;name&amp;#39;] = &amp;#39; sql&amp;quot;injection&amp;quot; &amp;#39;&lt;br /&gt;&lt;br /&gt;&amp;#036;name = addslashes(&amp;#036;_post[&amp;#39;name&amp;#39;]);&lt;br /&gt;&lt;br /&gt;&amp;#036;query = (&amp;quot;INSERT INTO table (name) values (&amp;#39;&amp;#036;name&amp;#39;)&amp;quot;);&lt;br /&gt;&lt;br /&gt;in database it will show&lt;br /&gt;&lt;br /&gt;sql&amp;#092;&amp;quot;injection&amp;#092;&amp;quot;&lt;br /&gt;&lt;br /&gt;in the field&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;so, is there any way to change make the data store with sql&amp;quot;injection&amp;quot; insteat of sql&amp;#092;&amp;quot;injection&amp;#092;&amp;quot;.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; &lt;!--emo&amp;:respect:--&gt;&lt;img src='http://static.lowyat.net/style_emoticons/default/notworthy.gif' border='0' style='vertical-align:middle' alt='notworthy.gif' /&gt;&lt;!--endemo--&gt;&lt;br /&gt;&lt;br /&gt;[addedon]August 18, 2009, 11:45 pm[/addedon]will tis work to prevent sql injection?&lt;br /&gt;&lt;br /&gt;&lt;!--QuoteBegin--&gt;&lt;div class='quotetop'&gt;QUOTE&lt;/div&gt;&lt;div class='quotemain'&gt;&lt;!--QuoteEBegin--&gt;if (&amp;#33;get_magic_quotes_gpc()) {&lt;br /&gt;	if (isset(&amp;#036;_POST)) {&lt;br /&gt;&amp;nbsp; foreach (&amp;#036;_POST as &amp;#036;key =&amp;gt; &amp;#036;value) {&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;#036;_POST[&amp;#036;key] =&amp;nbsp; trim(addslashes(&amp;#036;value));&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;	}&lt;br /&gt;	&lt;br /&gt;	if (isset(&amp;#036;_GET)) {&lt;br /&gt;&amp;nbsp; foreach (&amp;#036;_GET as &amp;#036;key =&amp;gt; &amp;#036;value) {&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;#036;_GET[&amp;#036;key] = trim(addslashes(&amp;#036;value));&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;	}	&lt;br /&gt;}&lt;!--QuoteEnd--&gt;&lt;/div&gt;&lt;!--QuoteEEnd--&gt;&lt;br /&gt;&lt;br /&gt;[addedon]August 20, 2009, 10:12 pm[/addedon]Some 1 help pls &lt;br /&gt;T.T</description>
            <author>crliuh</author>
            <category>Codemasters</category>
            <pubDate>Tue, 18 Aug 2009 23:10:30 +0800</pubDate>
        </item>
        <item>
            <title>retain checked in mutiple check box</title>
            <link>http://forum.lowyat.net/topic/1028283</link>
            <description>i have been google for tis tings for the whole nite, but i stil cant get any solution&lt;br /&gt;&lt;br /&gt;here is the code&lt;br /&gt;&lt;br /&gt;&lt;!--c1--&gt;&lt;div class='codetop'&gt;CODE&lt;/div&gt;&lt;div class='codemain'&gt;&lt;!--ec1--&gt;&lt;br /&gt;&amp;#60;form id=&amp;#34;form1&amp;#34; name=&amp;#34;form1&amp;#34; method=&amp;#34;post&amp;#34; action=&amp;#34;&amp;#34;&amp;#62;&lt;br /&gt; &amp;#60;?php &lt;br /&gt; &amp;#036;array = array&amp;#40;&amp;#39;a&amp;#39;,&amp;#39;b&amp;#39;,&amp;#39;c&amp;#39;,&amp;#39;d&amp;#39;&amp;#41;;&lt;br /&gt; &amp;#036;count = count&amp;#40;&amp;#036;array&amp;#41;;&lt;br /&gt; for&amp;#40;&amp;#036;i=0; &amp;#036;i &amp;#60; &amp;#036;count; &amp;#036;i++&amp;#41;{&lt;br /&gt; ?&amp;#62;&lt;br /&gt;&amp;#60;input type=&amp;#34;checkbox&amp;#34; name=&amp;#34;nob&amp;#91;&amp;#93;&amp;#34; value=&amp;#34;&amp;#60;?PHP echo &amp;#036;array&amp;#91;&amp;#036;i&amp;#93;;?&amp;#62;&amp;#34; /&amp;#62;&amp;#60;?php echo &amp;#036;array&amp;#91;&amp;#036;i&amp;#93;;?&amp;#62;&lt;br /&gt;&amp;#60;br/&amp;#62;&lt;br /&gt; &amp;#60;?php } ?&amp;#62;&lt;br /&gt;&amp;#60;input type=&amp;#34;submit&amp;#34; name=&amp;#34;submit&amp;#34; id=&amp;#34;submit&amp;#34; value=&amp;#34;Submit&amp;#34; /&amp;#62;&lt;br /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;#60;input type=&amp;#34;reset&amp;#34; name=&amp;#34;reset&amp;#34; id=&amp;#34;reset&amp;#34; value=&amp;#34;Reset&amp;#34; /&amp;#62;&lt;br /&gt; &amp;nbsp; &amp;nbsp; &amp;#60;/form&amp;#62;&lt;br /&gt;&lt;!--c2--&gt;&lt;/div&gt;&lt;!--ec2--&gt;&lt;br /&gt;&lt;br /&gt;becoz i am using php validation,&lt;br /&gt;so, how can i retain the checkbox  status where the user has choosen after the page submitton ?&lt;br /&gt;&lt;br /&gt;for example if user has tick the checkbox a and c, but there is an error after the page submit, and the checkbox a and c remain in status checked ?&lt;br /&gt;&lt;br /&gt;thx in advanced  &lt;!--emo&amp;:respect:--&gt;&lt;img src='http://static.lowyat.net/style_emoticons/default/notworthy.gif' border='0' style='vertical-align:middle' alt='notworthy.gif' /&gt;&lt;!--endemo--&gt; &lt;br /&gt;</description>
            <author>crliuh</author>
            <category>Codemasters</category>
            <pubDate>Tue, 12 May 2009 23:20:48 +0800</pubDate>
        </item>
        <item>
            <title>php array question</title>
            <link>http://forum.lowyat.net/topic/1000810</link>
            <description>i got some problem over here&lt;br /&gt;&lt;br /&gt;there are 2 arrays here and i would like to show only both the array value if the values in both of the string is not same.&lt;br /&gt;&lt;br /&gt;for example&lt;br /&gt;&lt;br /&gt;&amp;#036;array1 = array(&amp;quot;apple&amp;quot;, &amp;quot;orange&amp;quot;, &amp;quot;banana&amp;quot;); &lt;br /&gt;&amp;#036;array2 =array(&amp;quot;orange&amp;quot;,   &amp;quot;juice&amp;quot;,   &amp;quot;cake&amp;quot;); &lt;br /&gt;&lt;br /&gt;for (&amp;#036;i = 0; &amp;#036;i &amp;lt; count(&amp;#036;array1); ++&amp;#036;i) { &lt;br /&gt;   &lt;br /&gt;   if(&amp;#036;array1[&amp;#036;i] &amp;#33;= &amp;#036;array2[&amp;#036;i]){&lt;br /&gt;    print_r(&amp;#036;array1[&amp;#036;i]);&lt;br /&gt;   echo &amp;#39;&amp;lt;br/&amp;gt;&amp;#39;;&lt;br /&gt;   print_r(&amp;#036;array2[&amp;#036;i]);&lt;br /&gt;   echo &amp;#39;&amp;lt;br/&amp;gt;&amp;#39;;&lt;br /&gt;   }&lt;br /&gt;   &lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;the output change to tis &lt;br /&gt;&lt;br /&gt;apple&lt;br /&gt;orange&lt;br /&gt;orange&lt;br /&gt;juice&lt;br /&gt;banana&lt;br /&gt;smoothy&lt;br /&gt;&lt;br /&gt;so,  is there any array function than could detect any of the values in the array?&lt;br /&gt;&lt;br /&gt;like &amp;#036;array1 have orange, &amp;#036;array2 have orange too, but the sequence of both orange is not the same, &lt;br /&gt;&amp;#036;array1 orange is &amp;#036;array[1],&lt;br /&gt;and &lt;br /&gt;&amp;#036;array2 orange is &amp;#036;array[0]&lt;br /&gt;&lt;br /&gt;and if &amp;#036;array1 know &amp;#036;array2 have orange, so they wont show orange tis value.&lt;br /&gt;&lt;br /&gt;</description>
            <author>crliuh</author>
            <category>Codemasters</category>
            <pubDate>Thu, 16 Apr 2009 18:31:59 +0800</pubDate>
        </item>
        <item>
            <title>onclick checkbox with js</title>
            <link>http://forum.lowyat.net/topic/997068</link>
            <description>i got some problem over here about checkbox with js onclick.&lt;br /&gt;&lt;br /&gt;*i am totaly new in js.&lt;br /&gt;here&amp;#39;s the situation,&lt;br /&gt;&lt;br /&gt;i wanted to create a checkbox list which could be click by user and the checkbox value will appear in another input text box, and then if the user uncheck the checkbox the value will disappear from the input text box.&lt;br /&gt;sum tings like hotmail send email (to) button, when the email(s) is clicked, the name will appear in the (to) text box, but if uncheck the email, the email(s) which choosen will be deleted from the text box.&lt;br /&gt;&lt;br /&gt;the code&lt;br /&gt;&lt;!--c1--&gt;&lt;div class='codetop'&gt;CODE&lt;/div&gt;&lt;div class='codemain'&gt;&lt;!--ec1--&gt;&lt;br /&gt;&amp;#60;html&amp;#62;&lt;br /&gt;&amp;#60;head&amp;#62;&lt;br /&gt;&amp;#60;script type=&amp;#34;text/javascript&amp;#34;&amp;#62; &lt;br /&gt;function addname&amp;#40;checked&amp;#41; { &lt;br /&gt; &lt;br /&gt;if&amp;#40;document.form1.username.checked&amp;#41;&lt;br /&gt;var total = document.form1.username.value + &amp;#34;&amp;#092;n&amp;#34;;&lt;br /&gt;&lt;br /&gt;if&amp;#40;checked==false&amp;#41;&lt;br /&gt;document.form1.copy.value -= total;&lt;br /&gt;else if&amp;#40;checked == true&amp;#41;{&lt;br /&gt; document.form1.copy.value += total;&lt;br /&gt; }&lt;br /&gt;return false;&lt;br /&gt; &lt;br /&gt;}&lt;br /&gt;&amp;#60;/script&amp;#62;&lt;br /&gt; &lt;br /&gt;&amp;#60;/head&amp;#62;&lt;br /&gt;&amp;#60;body&amp;#62;&lt;br /&gt;&amp;#60;form name=&amp;#34;form1&amp;#34; method=&amp;#34;post&amp;#34; action=&amp;#34;sendmsg.html&amp;#34;&amp;#62;&lt;br /&gt;&amp;#60;table width=&amp;#34;auto&amp;#34; height=&amp;#34;144&amp;#34; cellpadding=&amp;#34;0&amp;#34;&amp;#62;&lt;br /&gt; &amp;nbsp;&amp;#60;tr&amp;#62;&lt;br /&gt;&amp;#60;td width=&amp;#34;313&amp;#34; valign=&amp;#34;top&amp;#34;&amp;#62;&lt;br /&gt;&amp;#60;input name=&amp;#34;copy&amp;#34; id=&amp;#34;copy&amp;#34; type=&amp;#34;text&amp;#34;&amp;#62;&lt;br /&gt;&amp;#60;br/&amp;#62;&lt;br /&gt;&amp;#60;input name=&amp;#34;username&amp;#34; type=&amp;#34;checkbox&amp;#34; value=&amp;#34;abc&amp;#34; onclick=&amp;#34;addname&amp;#40;this.checked&amp;#41;&amp;#34; &amp;#62;label1&lt;br /&gt;&lt;br /&gt;&amp;#60;/td&amp;#62;&lt;br /&gt; &amp;nbsp;&amp;#60;/tr&amp;#62;&lt;br /&gt;&lt;br /&gt; &amp;nbsp;&amp;#60;tr&amp;#62;&lt;br /&gt; &amp;nbsp; &amp;nbsp;&amp;#60;td&amp;#62;&lt;br /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;#60;input type=&amp;#34;submit&amp;#34; name=&amp;#34;button&amp;#34; id=&amp;#34;button&amp;#34; value=&amp;#34;Send&amp;#34;&amp;#62;&lt;br /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;#60;input name=&amp;#34;btnCancel&amp;#34; type=&amp;#34;button&amp;#34; id=&amp;#34;btnCancel&amp;#34; value=&amp;#34;Cancel&amp;#34; onClick=&amp;#34;window.history.back&amp;#40;&amp;#41;;&amp;#34;&amp;#62;&lt;br /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;#60;/td&amp;#62;&lt;br /&gt; &amp;nbsp;&amp;#60;/tr&amp;#62;&lt;br /&gt;&amp;#60;/table&amp;#62;&lt;br /&gt;&lt;br /&gt;&amp;#60;/form&amp;#62;&lt;br /&gt;&amp;#60;/body&amp;#62;&lt;br /&gt;&amp;#60;/html&amp;#62;&lt;!--c2--&gt;&lt;/div&gt;&lt;!--ec2--&gt;&lt;br /&gt;&lt;br /&gt;this code is get from sum  where on the internet.&lt;br /&gt;&lt;br /&gt;the output from the above code&lt;br /&gt;&lt;br /&gt;when checked, the input text box will appear the value (abc), and when i uncheck the check box, its come out with NaN in the input text box, and the second time i click on the check box, its still come out with the value(abc), and when i uncheck the value disappear, but the NaN for the 1st time uncheck its still remain.&lt;br /&gt;&lt;br /&gt;so what can i change for the js code??&lt;br /&gt;&lt;br /&gt;and what if the checkbox is in array?&lt;br /&gt;&lt;br /&gt;for example &lt;br /&gt;&amp;lt;input name=&amp;quot;username&amp;quot; type=&amp;quot;checkbox&amp;quot; value=&amp;quot;abc&amp;quot; onclick=&amp;quot;addname(this.checked)&amp;quot; &amp;gt;label1&lt;br /&gt;&amp;lt;input name=&amp;quot;username&amp;quot; type=&amp;quot;checkbox&amp;quot; value=&amp;quot;bbc&amp;quot; onclick=&amp;quot;addname(this.checked)&amp;quot; &amp;gt;label2&lt;br /&gt;&amp;lt;input name=&amp;quot;username&amp;quot; type=&amp;quot;checkbox&amp;quot; value=&amp;quot;ccb&amp;quot; onclick=&amp;quot;addname(this.checked)&amp;quot; &amp;gt;label3&lt;br /&gt;&lt;br /&gt;do i nid to add  for(i,i&amp;lt;&amp;#036;string,i++)  in the script?&lt;br /&gt;&lt;br /&gt;i try tis 1 &lt;br /&gt;&lt;!--c1--&gt;&lt;div class='codetop'&gt;CODE&lt;/div&gt;&lt;div class='codemain'&gt;&lt;!--ec1--&gt;&lt;br /&gt;&amp;#60;script type=&amp;#34;text/javascript&amp;#34;&amp;#62; &lt;br /&gt;function addname&amp;#40;checked&amp;#41; { &lt;br /&gt; &lt;br /&gt;var total=&amp;#34;&amp;#34;&lt;br /&gt;for&amp;#40;var i=0; i &amp;#60; document.form1.username.length; i++&amp;#41;{&lt;br /&gt;if&amp;#40;document.form1.username&amp;#91;i&amp;#93;.checked&amp;#41;&lt;br /&gt;total +=document.form1.username&amp;#91;i&amp;#93;.value + &amp;#34;&amp;#092;n&amp;#34;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;if&amp;#40;checked ==false&amp;#41;&lt;br /&gt;document.form1.copy.value -= total;&lt;br /&gt;else if&amp;#40;checked == true&amp;#41;{&lt;br /&gt; document.form1.copy.value += total;&lt;br /&gt; }&lt;br /&gt;return false;&lt;br /&gt; &lt;br /&gt;}&lt;br /&gt;&amp;#60;/script&amp;#62; &lt;br /&gt;&lt;!--c2--&gt;&lt;/div&gt;&lt;!--ec2--&gt;&lt;br /&gt;&lt;br /&gt;still have the same problem like above, NaN appear.&lt;br /&gt;and another problem is &lt;br /&gt;&lt;br /&gt;when i check the 1st check box 1st value appear,&lt;br /&gt;when i check the 2nd check box 1st will be repearted appear after that 2nd value.&lt;br /&gt;&lt;br /&gt;for example&lt;br /&gt;&lt;br /&gt;when i checked 1st value, and output will be [abc]&lt;br /&gt;when 2nd value checked, output will be [abc][abc][bbc]&lt;br /&gt;&lt;br /&gt;i understand y tis happened but i dono what&amp;#39;s the solution  &lt;!--emo&amp;:help:--&gt;&lt;img src='http://static.lowyat.net/style_emoticons/default/icon_question.gif' border='0' style='vertical-align:middle' alt='icon_question.gif' /&gt;&lt;!--endemo--&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;</description>
            <author>crliuh</author>
            <category>Codemasters</category>
            <pubDate>Mon, 13 Apr 2009 17:23:59 +0800</pubDate>
        </item>
        <item>
            <title>mysql table field name</title>
            <link>http://forum.lowyat.net/topic/996359</link>
            <description>i wonder y in my localhost, &lt;br /&gt;table field name &amp;quot;read&amp;quot; is causing error when update and insert for the certain table.&lt;br /&gt;&lt;br /&gt;*this table type is enum.&lt;br /&gt;&lt;br /&gt;when the table field named &amp;quot;read&amp;quot;&lt;br /&gt;&amp;#036;readed = mysql_query(&amp;quot;UPDATE mail SET read = &amp;#39;y&amp;#39; WHERE mailID = &amp;#39;&amp;#036;msgid&amp;#39;&amp;quot;)or die(&amp;#39;Error &amp;#39; . mysql_error());&lt;br /&gt;&lt;br /&gt;its come wit the error &lt;br /&gt;You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &amp;#39;read = &amp;#39;y&amp;#39; WHERE mailID = &amp;#39;6&amp;#39;&amp;#39; at line 1&lt;br /&gt;&lt;br /&gt;so when i alter the table field name to &amp;quot;baca&amp;quot;&lt;br /&gt;&amp;#036;readed = mysql_query(&amp;quot;UPDATE mail SET baca = &amp;#39;y&amp;#39; WHERE mailID = &amp;#39;&amp;#036;msgid&amp;#39;&amp;quot;)or die(&amp;#39;Error &amp;#39; . mysql_error());&lt;br /&gt;&lt;br /&gt;no error occurs.&lt;br /&gt;&lt;br /&gt;so i try to search at google c whether the name read is sensitive in table field but it seem like nth appear for this problem.&lt;br /&gt;&lt;br /&gt;so itiz my localhost mysql problem or ? itiz really a bug? or itiz read is pre defined for mysql some function like WHERE, WILDCARD or others?&lt;br /&gt;*ps: i had google, and seem like there is no &amp;quot;read&amp;quot; function for mysql.&lt;br /&gt;&lt;br /&gt;my mysql version is  5.0.45</description>
            <author>crliuh</author>
            <category>Codemasters</category>
            <pubDate>Mon, 13 Apr 2009 01:03:07 +0800</pubDate>
        </item>
        <item>
            <title>multiple image uploader problem agian ==</title>
            <link>http://forum.lowyat.net/topic/971519</link>
            <description>i have add tis post in my old topic, but the topic is not floating up at the 1st page ==&lt;br /&gt;here it&amp;#39;s&lt;br /&gt;&amp;gt;&amp;gt;http://forum.lowyat.net/topic/965225&amp;lt;&amp;lt;&lt;br /&gt;&lt;br /&gt;so i think is to be a good idea to open a new topic &lt;!--emo&amp;:clap:--&gt;&lt;img src='http://static.lowyat.net/style_emoticons/default/rclxms.gif' border='0' style='vertical-align:middle' alt='rclxms.gif' /&gt;&lt;!--endemo--&gt; &lt;br /&gt;i would like to create someting user could upload their images by either browse from their pc or paste the url from other image uploader site.&lt;br /&gt;&lt;br /&gt;so in the html part there are text input for char.&lt;br /&gt;&amp;lt;input name=&amp;quot;alimage[]&amp;quot; type=&amp;quot;text&amp;quot; size=&amp;quot;35&amp;quot; id=&amp;quot;alimage&amp;quot;/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;&amp;lt;input name=&amp;quot;alimage[]&amp;quot; type=&amp;quot;text&amp;quot; size=&amp;quot;35&amp;quot; id=&amp;quot;alimage&amp;quot;/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;&amp;lt;input name=&amp;quot;alimage[]&amp;quot; type=&amp;quot;text&amp;quot; size=&amp;quot;35&amp;quot; id=&amp;quot;alimage&amp;quot;/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;&lt;br /&gt;and aso file input for browse&lt;br /&gt;&amp;lt;input type=&amp;quot;file&amp;quot; name=&amp;quot;image[]&amp;quot; id=&amp;quot;image&amp;quot;&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;&amp;lt;input type=&amp;quot;file&amp;quot; name=&amp;quot;image[]&amp;quot; id=&amp;quot;image&amp;quot;&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;&amp;lt;input type=&amp;quot;file&amp;quot; name=&amp;quot;image[]&amp;quot; id=&amp;quot;image&amp;quot;&amp;gt;&lt;br /&gt;&lt;br /&gt;and tis part is my image validation code.&lt;br /&gt;&lt;br /&gt;&lt;!--QuoteBegin--&gt;&lt;div class='quotetop'&gt;QUOTE&lt;/div&gt;&lt;div class='quotemain'&gt;&lt;!--QuoteEBegin--&gt;&amp;#036;error = array();&lt;br /&gt;&amp;#036;MM_flag = &amp;quot;MM_insert&amp;quot;;&lt;br /&gt;if (isset(&amp;#036;_POST[&amp;#036;MM_flag])){&lt;br /&gt;//image validation part&lt;br /&gt;// These will be the types of file that will pass the validation.&lt;br /&gt;&amp;#036;allowed_filetypes = array(&amp;#39;.jpg&amp;#39;,&amp;#39;.png&amp;#39;,&amp;#39;.jpeg&amp;#39;,&amp;#39;.JPG&amp;#39;,&amp;#39;.JPEG&amp;#39;); &lt;br /&gt;&lt;br /&gt;//this validation for browse image from user pc&lt;br /&gt;&lt;br /&gt;foreach(&amp;#036;_FILES[&amp;#39;image&amp;#39;][&amp;#39;name&amp;#39;] as &amp;#036;key =&amp;gt; &amp;#036;tfilename){&lt;br /&gt;&amp;#036;ext = substr(&amp;#036;tfilename, strpos(&amp;#036;tfilename,&amp;#39;.&amp;#39;), strlen(&amp;#036;tfilename)-1); // Get the extension from the filename.&lt;br /&gt;//echo &amp;quot;&amp;#036;tfilename&amp;quot;;&lt;br /&gt;if(trim(&amp;#036;tfilename) &amp;#33;= &amp;quot;&amp;quot;){&lt;br /&gt;//if(&amp;#036;_FILES[&amp;#39;image&amp;#39;][&amp;#39;size&amp;#39;][&amp;#036;key] &amp;lt; 200) &lt;br /&gt;if ((&amp;#33;in_array(&amp;#036;ext,&amp;#036;allowed_filetypes)) || (&amp;#036;_FILES[&amp;#39;image&amp;#39;][&amp;#39;size&amp;#39;][&amp;#036;key] &amp;lt; 200) )&lt;br /&gt;{&lt;br /&gt;&amp;#036;error[&amp;#39;image&amp;#39;] = &amp;quot;Invalid file image in &amp;#036;tfilename&amp;quot;;&lt;br /&gt;}}}&lt;br /&gt;&lt;br /&gt;//and tis part for image url from image uploader site&lt;br /&gt;&lt;br /&gt;foreach(&amp;#036;_POST[&amp;#39;alimage&amp;#39;] as &amp;#036;key =&amp;gt; &amp;#036;url){&lt;br /&gt;if(trim(&amp;#036;url) &amp;#33;= &amp;quot;&amp;quot;){&lt;br /&gt;&amp;#036;handle = @fopen(&amp;quot;&amp;#036;url&amp;quot;, &amp;quot;r&amp;quot;);&lt;br /&gt;if(&amp;#33;&amp;#036;handle){&lt;br /&gt;&amp;#036;error[&amp;#39;url&amp;#39;] = &amp;quot;not a valid url&amp;quot;;&lt;br /&gt;}&lt;br /&gt;&amp;#036;ext2 = strrchr(&amp;#036;alname,&amp;#39;.&amp;#39;); &lt;br /&gt;if(&amp;#33;in_array(&amp;#036;ext2,&amp;#036;allowed_filetypes)){&lt;br /&gt;&amp;#036;error[&amp;#39;images&amp;#39;] = &amp;quot;Invalid image url&amp;quot;;&lt;br /&gt;}&lt;br /&gt;}}&lt;br /&gt;}&lt;!--QuoteEnd--&gt;&lt;/div&gt;&lt;!--QuoteEEnd--&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;and the question is how could i write some ting where either the &lt;br /&gt;&amp;lt;input name=&amp;quot;alimage[]&amp;quot; type=&amp;quot;text&amp;quot; size=&amp;quot;35&amp;quot; id=&amp;quot;alimage&amp;quot;/&amp;gt; or &amp;lt;input type=&amp;quot;file&amp;quot; name=&amp;quot;image[]&amp;quot; id=&amp;quot;image&amp;quot;&amp;gt;&lt;br /&gt;canot be empty, which mean tis two text input and file input should not be empty at the same time. &lt;br /&gt;or you could say if one of the input text field or input file field is not empty and it shall not hav any error.&lt;br /&gt;&lt;br /&gt;so what can i do on tis part?&lt;br /&gt;&lt;br /&gt;do i nid to add &amp;#036;_POST[&amp;#39;alimage&amp;#39;] and &amp;#036;_FILES[&amp;#39;image&amp;#39;][&amp;#39;name&amp;#39;] in foreach() together ? (its is not working)&lt;br /&gt;or create an array for them?&lt;br /&gt;&lt;br /&gt;i dun hav any idea on it &lt;!--emo&amp;:help:--&gt;&lt;img src='http://static.lowyat.net/style_emoticons/default/icon_question.gif' border='0' style='vertical-align:middle' alt='icon_question.gif' /&gt;&lt;!--endemo--&gt;  &lt;!--emo&amp;:help:--&gt;&lt;img src='http://static.lowyat.net/style_emoticons/default/icon_question.gif' border='0' style='vertical-align:middle' alt='icon_question.gif' /&gt;&lt;!--endemo--&gt;  &lt;!--emo&amp;:help:--&gt;&lt;img src='http://static.lowyat.net/style_emoticons/default/icon_question.gif' border='0' style='vertical-align:middle' alt='icon_question.gif' /&gt;&lt;!--endemo--&gt;</description>
            <author>crliuh</author>
            <category>Codemasters</category>
            <pubDate>Sat, 21 Mar 2009 01:34:21 +0800</pubDate>
        </item>
        <item>
            <title>new problem for multiple image uploader.</title>
            <link>http://forum.lowyat.net/topic/965225</link>
            <description>Here&amp;#39;s the situation, &lt;br /&gt;i would like to create a multiple image uploader with existing 3 file field.&lt;br /&gt;&lt;br /&gt;      &amp;lt;input type=&amp;quot;file&amp;quot; name=&amp;quot;image[]&amp;quot; id=&amp;quot;image&amp;quot;&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;      &amp;lt;input type=&amp;quot;file&amp;quot; name=&amp;quot;image[]&amp;quot; id=&amp;quot;image&amp;quot;&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;      &amp;lt;input type=&amp;quot;file&amp;quot; name=&amp;quot;image[]&amp;quot; id=&amp;quot;image&amp;quot;&amp;gt;&lt;br /&gt;&lt;br /&gt;with this script uploaded image(s) will be store in the a folder, and the image(s) will be store in mysql. &lt;br /&gt;&lt;br /&gt;so 1st i nid to validate the image(s) 1st&lt;br /&gt;&lt;br /&gt;&lt;!--c1--&gt;&lt;div class='codetop'&gt;CODE&lt;/div&gt;&lt;div class='codemain'&gt;&lt;!--ec1--&gt;&lt;br /&gt;//image validation part&lt;br /&gt;// These will be the types of file that will pass the validation.&lt;br /&gt;&amp;#036;allowed_filetypes = array&amp;#40;&amp;#39;.jpg&amp;#39;,&amp;#39;.png&amp;#39;,&amp;#39;.jpeg&amp;#39;,&amp;#39;.JPG&amp;#39;,&amp;#39;.JPEG&amp;#39;&amp;#41;; &lt;br /&gt;&lt;br /&gt;if&amp;#40;trim&amp;#40;&amp;#036;_FILES&amp;#91;&amp;#39;image&amp;#39;&amp;#93;&amp;#91;&amp;#39;name&amp;#39;&amp;#93;&amp;#41; &amp;#33;= &amp;#34;&amp;#34;&amp;#41;{&lt;br /&gt;foreach&amp;#40;&amp;#036;_FILES&amp;#91;&amp;#39;image&amp;#39;&amp;#93;&amp;#91;&amp;#39;name&amp;#39;&amp;#93; as &amp;#036;key =&amp;#62; &amp;#036;tfilename&amp;#41;{&lt;br /&gt;&amp;#036;ext = substr&amp;#40;&amp;#036;tfilename, strpos&amp;#40;&amp;#036;tfilename,&amp;#39;.&amp;#39;&amp;#41;, strlen&amp;#40;&amp;#036;tfilename&amp;#41;-1&amp;#41;; // Get the extension from the filename.&lt;br /&gt;&lt;br /&gt;if&amp;#40;trim&amp;#40;&amp;#036;tfilename&amp;#41; &amp;#33;= &amp;#34;&amp;#34;&amp;#41; ----&amp;#62; 3 file field would not be fully utilise. &amp;#40;user may oni upload 1 file&amp;#41;&lt;br /&gt;{&lt;br /&gt;//if&amp;#40;&amp;#036;_FILES&amp;#91;&amp;#39;image&amp;#39;&amp;#93;&amp;#91;&amp;#39;size&amp;#39;&amp;#93;&amp;#91;&amp;#036;key&amp;#93; &amp;#60; 200&amp;#41; &lt;br /&gt;if &amp;#40;&amp;#40;&amp;#33;in_array&amp;#40;&amp;#036;ext,&amp;#036;allowed_filetypes&amp;#41;&amp;#41; || &amp;#40;&amp;#036;_FILES&amp;#91;&amp;#39;image&amp;#39;&amp;#93;&amp;#91;&amp;#39;size&amp;#39;&amp;#93;&amp;#91;&amp;#036;key&amp;#93; &amp;#60; 200&amp;#41; &amp;#41;&lt;br /&gt;{&lt;br /&gt;&amp;#036;error&amp;#91;&amp;#39;image&amp;#39;&amp;#93; = &amp;#34;Invalid file image in &amp;#036;tfilename&amp;#34;;&lt;br /&gt;}}&lt;br /&gt;}&lt;br /&gt;&lt;!--c2--&gt;&lt;/div&gt;&lt;!--ec2--&gt;&lt;br /&gt;&lt;br /&gt;the above validation works.&lt;br /&gt;&lt;br /&gt;come&amp;#39;s to  upload these image(s)&lt;br /&gt;*i havent start to write&lt;br /&gt;but i believe that the code should some thing like tis&lt;br /&gt;&lt;br /&gt;&lt;!--c1--&gt;&lt;div class='codetop'&gt;CODE&lt;/div&gt;&lt;div class='codemain'&gt;&lt;!--ec1--&gt;&lt;br /&gt;if&amp;#40;&amp;#33;&amp;#036;error&amp;#41;{&lt;br /&gt;foreach&amp;#40;&amp;#036;_FILES&amp;#91;&amp;#39;image&amp;#39;&amp;#93;&amp;#91;&amp;#39;temp&amp;#39;&amp;#93; as &amp;#036;key =&amp;#62; &amp;#036;tfilename&amp;#41;{&lt;br /&gt;move_uploaded_file&amp;#40;&amp;#036;tfilename.&amp;#34;../images&amp;#34;&amp;#41;;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;!--c2--&gt;&lt;/div&gt;&lt;!--ec2--&gt;&lt;br /&gt;am i wrong? pls correct me.&lt;br /&gt;&lt;br /&gt;here&amp;#39;s come to my problem&lt;br /&gt;after uploading the image(s), i nid to store the name the image name in the database.&lt;br /&gt;but i found that foreach() is not working in insert database query.&lt;br /&gt;and i am absolutely no idea on how to write the code now  &lt;!--emo&amp;:stars:--&gt;&lt;img src='http://static.lowyat.net/style_emoticons/default/rclxub.gif' border='0' style='vertical-align:middle' alt='rclxub.gif' /&gt;&lt;!--endemo--&gt;&lt;br /&gt;&lt;br /&gt;[addedon]March 15, 2009, 1:24 pm[/addedon]i try like tis&lt;br /&gt;&lt;br /&gt;&lt;!--c1--&gt;&lt;div class='codetop'&gt;CODE&lt;/div&gt;&lt;div class='codemain'&gt;&lt;!--ec1--&gt;&amp;#036;inserti = &amp;#34;INSERT INTO subi&amp;#34;;&lt;br /&gt;if&amp;#40;trim&amp;#40;&amp;#036;tfilename&amp;#41; &amp;#33;= &amp;#34;&amp;#34;&amp;#41;{&lt;br /&gt;foreach&amp;#40;&amp;#036;_FILES&amp;#91;&amp;#39;image&amp;#39;&amp;#93;&amp;#91;&amp;#39;name&amp;#39;&amp;#93; as &amp;#036;key =&amp;#62; &amp;#036;tfilename&amp;#41;{&lt;br /&gt;&amp;#036;inserti .=&amp;#34;&amp;#40;itemID, name&amp;#41; VALUES &amp;#40;&amp;#39;&amp;#036;iid&amp;#39;,&amp;#39;&amp;#036;tfilename&amp;#39;&amp;#41;&amp;#34;;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&amp;#036;result = mysql_query&amp;#40;&amp;#036;inserti&amp;#41;or die&amp;#40;&amp;#39;Error &amp;#39; . mysql_error&amp;#40;&amp;#41;&amp;#41;;&lt;!--c2--&gt;&lt;/div&gt;&lt;!--ec2--&gt;&lt;br /&gt;&lt;br /&gt;but its come out wit error &lt;br /&gt;&lt;br /&gt;You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &amp;#39;(itemID, name) VALUES (&amp;#39;55&amp;#39;,&amp;#39;pg 26.jpg&amp;#39;)(itemID, name) VALUES (&amp;#39;55&amp;#39;,&amp;#39;pg 22.jpg&amp;#39;)&amp;#39; at line 1&lt;br /&gt;&lt;br /&gt;since i uploaded 3 images,&lt;br /&gt;the &amp;#036;_FILES[&amp;#39;image&amp;#39;][&amp;#39;name&amp;#39;][0] is not listed in the error  &lt;br /&gt;&lt;br /&gt; &lt;!--emo&amp;:respect:--&gt;&lt;img src='http://static.lowyat.net/style_emoticons/default/notworthy.gif' border='0' style='vertical-align:middle' alt='notworthy.gif' /&gt;&lt;!--endemo--&gt; &lt;br /&gt;&lt;br /&gt;thx in advance.</description>
            <author>crliuh</author>
            <category>Codemasters</category>
            <pubDate>Sun, 15 Mar 2009 12:43:06 +0800</pubDate>
        </item>
        <item>
            <title>SQL injection question</title>
            <link>http://forum.lowyat.net/topic/943808</link>
            <description>Could any 1 help me see whether tis script will kena SQL INJECTION anot?&lt;br /&gt;&lt;br /&gt;if(&amp;#33;&amp;#036;error){&lt;br /&gt;if ((isset(&amp;#036;_POST[&amp;quot;add&amp;quot;])) &amp;amp;&amp;amp; (&amp;#036;_POST[&amp;quot;add&amp;quot;] == &amp;quot;form1&amp;quot;)) {&lt;br /&gt;&amp;#036;catname = &amp;#036;_POST[&amp;#39;catname&amp;#39;];&lt;br /&gt;if (&amp;#33;get_magic_quotes_gpc()) {&lt;br /&gt;        &amp;#036;catname = addslashes(&amp;#036;catname);&lt;br /&gt;		}else {&lt;br /&gt;		&amp;#036;catname = mysql_real_escape_string(&amp;#036;catname);&lt;br /&gt;		}&lt;br /&gt;&amp;#036;date = date(&amp;quot;Y-m-d&amp;quot;); &lt;br /&gt;&amp;#036;insertSQL = &amp;quot;INSERT INTO addc (Cname,Cdate) VALUES (&amp;#39;&amp;#036;catname&amp;#39;,&amp;#39;&amp;#036;date&amp;#39;)&amp;quot;;&lt;br /&gt;&amp;#036;result = mysql_query(&amp;#036;insertSQL)or die(&amp;#39;Error &amp;#39; . mysql_error());&lt;br /&gt;if(isset(&amp;#036;result)){&lt;br /&gt;// the album is saved, go to the album list &lt;br /&gt;echo &amp;quot;&amp;#60;script&amp;gt;window.location.href=&amp;#39;index.php?page=lc&amp;#39;;&amp;lt;/script&amp;gt;&amp;quot;; &lt;br /&gt;}else {echo &amp;quot;Insert catergory failed&amp;#33;&amp;quot;;}&lt;br /&gt;}}&lt;br /&gt;&lt;br /&gt;I am still abit blur on prevention of SQL injection. &lt;!--emo&amp;:stars:--&gt;&lt;img src='http://static.lowyat.net/style_emoticons/default/rclxub.gif' border='0' style='vertical-align:middle' alt='rclxub.gif' /&gt;&lt;!--endemo--&gt;</description>
            <author>crliuh</author>
            <category>Codemasters</category>
            <pubDate>Sun, 22 Feb 2009 00:45:41 +0800</pubDate>
        </item>
        <item>
            <title>Rewrite mod in .htaccess</title>
            <link>http://forum.lowyat.net/topic/869197</link>
            <description>Here&amp;#39;s the original URL &lt;br /&gt;&lt;a href='http://crliuh.net63.net/kaisheng/user.php?user=gugujiao' target='_blank'&gt;http://crliuh.net63.net/kaisheng/user.php?user=gugujiao&lt;/a&gt;&lt;br /&gt;and i wish to change it into &lt;br /&gt;&lt;a href='http://crliuh.net63.net/gugujiao' target='_blank'&gt;http://crliuh.net63.net/gugujiao&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;so i rewrite it into&lt;br /&gt;&lt;br /&gt;Options +Indexes&lt;br /&gt;RewriteEngine on&lt;br /&gt;RewriteBase /&lt;br /&gt;RewriteRule ^(.*)/&amp;#036; kaisheng/user.php?user=&amp;#036;1 [L]&lt;br /&gt;&lt;br /&gt;in .htaccess&lt;br /&gt;&lt;br /&gt;and the condition appear.&lt;br /&gt;&lt;br /&gt;its work for me to type the URL like tis ---&amp;#62; &lt;a href='http://crliuh.net63.net/gugujiao/' target='_blank'&gt;http://crliuh.net63.net/gugujiao/&lt;/a&gt;&lt;br /&gt;but when i ignore the last slash ---&amp;#62; &lt;a href='http://crliuh.net63.net/gugujiao' target='_blank'&gt;http://crliuh.net63.net/gugujiao&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;its doesn&amp;#39;t works&lt;br /&gt;&lt;br /&gt;so, is there any solution for juz type this url (http://crliuh.net63.net/gugujiao) and show the page of (http://crliuh.net63.net/kaisheng/user.php?user=gugujiao) &lt;!--emo&amp;:hmm:--&gt;&lt;img src='http://static.lowyat.net/style_emoticons/default/hmm.gif' border='0' style='vertical-align:middle' alt='hmm.gif' /&gt;&lt;!--endemo--&gt;</description>
            <author>crliuh</author>
            <category>Codemasters</category>
            <pubDate>Mon, 08 Dec 2008 20:18:10 +0800</pubDate>
        </item>
        <item>
            <title>Show calculated database result (solved)</title>
            <link>http://forum.lowyat.net/topic/819397</link>
            <description>i have a table which included quantity and price of an item.&lt;br /&gt;and i assume that &lt;br /&gt;&lt;br /&gt;i have 5 data in the table&lt;br /&gt;quantity - 1, 2, 1, 1, 1&lt;br /&gt;price - 50, 50, 50, 50 ,50&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;?php if(mysql_num_rows(&amp;#036;result) &amp;gt; 0){ &lt;br /&gt;while (&amp;#036;row = mysql_fetch_assoc(&amp;#036;result)) {&lt;br /&gt;extract(&amp;#036;row) ;&lt;br /&gt;echo &amp;#036;row[&amp;#39;quantity&amp;#39;].&amp;#39;x&amp;#39;&lt;br /&gt;echo &amp;#036;row[&amp;#39;price&amp;#39;].&amp;#39;=&amp;#39;&lt;br /&gt;echo &amp;#036;row[&amp;#39;quantity&amp;#39;] * &amp;#036;row[&amp;#39;price&amp;#39;];&lt;br /&gt;}}?&amp;gt;&lt;br /&gt;&lt;br /&gt;the possible output would be&lt;br /&gt;1) 1 x 50 = 50&lt;br /&gt;2) 2 x 50 = 100&lt;br /&gt;3) 1 x 50 = 50&lt;br /&gt;4) 1 x 50 = 50&lt;br /&gt;5) 1 x 50 = 50&lt;br /&gt;&lt;br /&gt;and here&amp;#39;s the problem, i wish to find the total amount of the entire &amp;#036;row[&amp;#39;quantity&amp;#39;] * &amp;#036;row[&amp;#39;price&amp;#39;] result, which is &lt;br /&gt;50 + 100 + 50 + 50 + 50 = (300)&lt;br /&gt;and show in the last row of the listed result.&lt;br /&gt;&lt;br /&gt;is there any solution ?  &lt;!--emo&amp;:help:--&gt;&lt;img src='http://static.lowyat.net/style_emoticons/default/icon_question.gif' border='0' style='vertical-align:middle' alt='icon_question.gif' /&gt;&lt;!--endemo--&gt;</description>
            <author>crliuh</author>
            <category>Codemasters</category>
            <pubDate>Fri, 17 Oct 2008 00:08:26 +0800</pubDate>
        </item>
        <item>
            <title>Redirecting to the previous page</title>
            <link>http://forum.lowyat.net/topic/815318</link>
            <description>Here&amp;#39;s the issues, i have saw all of the tutorial which related to submit form over the google.&lt;br /&gt;and there is a problem over here, which they oni show redirect to the certain page where is fixed.&lt;br /&gt;For example: &lt;br /&gt;if(isset(&amp;#036;result)){&lt;br /&gt;header(location: xxx.php);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;So, is there any solution where i could redirect to the previous page where i came from.&lt;br /&gt;&lt;br /&gt; &lt;!--emo&amp;:stars:--&gt;&lt;img src='http://static.lowyat.net/style_emoticons/default/rclxub.gif' border='0' style='vertical-align:middle' alt='rclxub.gif' /&gt;&lt;!--endemo--&gt; &lt;br /&gt;i have struggle for a long time in google. And i get nth  &lt;!--emo&amp;:shock:--&gt;&lt;img src='http://static.lowyat.net/style_emoticons/default/shocking.gif' border='0' style='vertical-align:middle' alt='shocking.gif' /&gt;&lt;!--endemo--&gt; &lt;br /&gt;</description>
            <author>crliuh</author>
            <category>Codemasters</category>
            <pubDate>Sun, 12 Oct 2008 16:23:01 +0800</pubDate>
        </item>
        <item>
            <title>deleting uploaded file problem</title>
            <link>http://forum.lowyat.net/topic/807809</link>
            <description>Here is the condition&lt;br /&gt;I have create a system someting like photo album, which included 2 database table, one is to store the main image, and another is to store the sub images for the main image.&lt;br /&gt;So, the issue is, when i want to delete the main image of course together with its sub images and i stuck at this part.&lt;br /&gt;If the main image doesn&amp;#39;t consist any sub images, delete action successful and redirect to the header which i had type, but if the main image consist sub images, delete action still successful but it can&amp;#39;t redirect to the header i wish and show the warning &lt;br /&gt;&lt;br /&gt;Warning: unlink(../upload/album/) [function.unlink]: Permission denied in C:&amp;#092;AppServ&amp;#092;htdocs&amp;#092;testing&amp;#092;admin&amp;#092;deleteItem.php on line 35&lt;br /&gt;&lt;br /&gt;Warning: unlink(../upload/) [function.unlink]: Permission denied in C:&amp;#092;AppServ&amp;#092;htdocs&amp;#092;testing&amp;#092;admin&amp;#092;deleteItem.php on line 34&lt;br /&gt;&lt;br /&gt;Warning: Cannot modify header information - headers already sent by (output started at C:&amp;#092;AppServ&amp;#092;htdocs&amp;#092;testing&amp;#092;admin&amp;#092;deleteItem.php:35) in C:&amp;#092;AppServ&amp;#092;htdocs&amp;#092;testing&amp;#092;admin&amp;#092;deleteItem.php on line 40&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;Here is the code&lt;br /&gt;&amp;lt;?php&lt;br /&gt;&amp;#036;editFormAction = &amp;#036;_SERVER[&amp;#39;PHP_SELF&amp;#39;];&lt;br /&gt;if (isset(&amp;#036;_SERVER[&amp;#39;QUERY_STRING&amp;#39;])) {&lt;br /&gt;  &amp;#036;editFormAction .= &amp;quot;?&amp;quot; . htmlentities(&amp;#036;_SERVER[&amp;#39;QUERY_STRING&amp;#39;]);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&amp;#036;id = &amp;#036;_GET[&amp;#39;id&amp;#39;];&lt;br /&gt;	&lt;br /&gt;&amp;#036;sql  = &amp;quot;SELECT *&lt;br /&gt;            FROM itemimage&lt;br /&gt;            WHERE id = &amp;#39;&amp;#036;id&amp;#39;&amp;quot;;   &lt;b&gt;----&amp;#62; THIS IS THE MAIN IMAGE FILE  &lt;/b&gt;		 &lt;br /&gt;&amp;#036;sql2  = &amp;quot;SELECT *&lt;br /&gt;              FROM itemalbum&lt;br /&gt;              WHERE imageID = &amp;#39;&amp;#036;id&amp;#39;&amp;quot;;  &lt;b&gt;----&amp;#62; THIS IS THE SUB IMAGE FILE  &lt;/b&gt;		 &lt;br /&gt;&amp;#036;result = mysql_query(&amp;#036;sql) or die(&amp;#39;Error, get item info failed. &amp;#39; . mysql_error());&lt;br /&gt;&amp;#036;result2 = mysql_query(&amp;#036;sql2) or die(&amp;#39;Error, get item info failed. &amp;#39; . mysql_error());&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;if ((isset(&amp;#036;_POST[&amp;quot;MM_delete&amp;quot;])) &amp;amp;&amp;amp; (&amp;#036;_POST[&amp;quot;MM_delete&amp;quot;] == &amp;quot;form1&amp;quot;)) {&lt;br /&gt; &amp;#036;deleteSQL =&amp;quot;DELETE &lt;br /&gt;  	    FROM itemimage&lt;br /&gt;	    WHERE id = &amp;#39;&amp;#036;id&amp;#39;&amp;quot;;&lt;br /&gt;&lt;br /&gt;&amp;#036;deleteSQL2 =&amp;quot;DELETE &lt;br /&gt;  	     FROM itemalbum&lt;br /&gt;	    WHERE imageID = &amp;#39;&amp;#036;id&amp;#39;&amp;quot;; &lt;br /&gt;	&lt;br /&gt;while((&amp;#036;rowDelete = mysql_fetch_assoc(&amp;#036;result)) || (&amp;#036;rowDelete = mysql_fetch_assoc(&amp;#036;result2))) {			   			   &lt;br /&gt;if(mysql_num_rows(&amp;#036;result2) == 0){	&lt;br /&gt;unlink(&amp;quot;../upload/&amp;quot;.&amp;#036;rowDelete[&amp;#39;imageName&amp;#39;]);	&lt;br /&gt;mysql_query(&amp;#036;deleteSQL) or die(mysql_error());&lt;br /&gt;&lt;br /&gt;}else{&lt;br /&gt;&lt;br /&gt;unlink(&amp;quot;../upload/&amp;quot;.&amp;#036;rowDelete[&amp;#39;imageName&amp;#39;]);&lt;br /&gt;unlink(&amp;quot;../upload/album/&amp;quot;.&amp;#036;rowDelete[&amp;#39;albumName&amp;#39;]);&lt;br /&gt;mysql_query(&amp;#036;deleteSQL) or die(mysql_error());&lt;br /&gt;mysql_query(&amp;#036;deleteSQL2) or die(mysql_error());&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;header(&amp;quot;Location: listItem.php&amp;quot;);&lt;br /&gt;} &lt;br /&gt;?&amp;gt;&lt;br /&gt;&lt;br /&gt;So, i try to put the condition state that if no any record in my sql2 &lt;b&gt;&amp;quot;if(mysql_num_rows(&amp;#036;result2) == 0)&amp;quot;&lt;/b&gt; then it will straight unlink the main image and delete its record in the databse, and the 2nd condition &amp;quot;&lt;b&gt;else&lt;/b&gt;&amp;quot; i will unlink both main and the rest of the sub images and delete both data in database, and i stuck at here  &lt;!--emo&amp;:stars:--&gt;&lt;img src='http://static.lowyat.net/style_emoticons/default/rclxub.gif' border='0' style='vertical-align:middle' alt='rclxub.gif' /&gt;&lt;!--endemo--&gt; &lt;br /&gt;Could someone save me  &lt;!--emo&amp;:cry:--&gt;&lt;img src='http://static.lowyat.net/style_emoticons/default/cry.gif' border='0' style='vertical-align:middle' alt='cry.gif' /&gt;&lt;!--endemo--&gt;</description>
            <author>crliuh</author>
            <category>Codemasters</category>
            <pubDate>Sat, 04 Oct 2008 03:19:59 +0800</pubDate>
        </item>
        <item>
            <title>php paging system problem.</title>
            <link>http://forum.lowyat.net/topic/800541</link>
            <description>Here&amp;#39;s is the original code&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt;Implementing Paging with next and prev&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;meta http-equiv=&amp;quot;Content-Type&amp;quot; content=&amp;quot;text/html; charset=iso-8859-1&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;?php&lt;br /&gt;include &amp;#39;library/config.php&amp;#39;;&lt;br /&gt;include &amp;#39;library/opendb.php&amp;#39;;&lt;br /&gt;&lt;br /&gt;// how many rows to show per page&lt;br /&gt;&amp;#036;rowsPerPage = 2;&lt;br /&gt;&lt;br /&gt;// by default we show first page&lt;br /&gt;&amp;#036;pageNum = 1;&lt;br /&gt;&lt;br /&gt;// if &amp;#036;_GET[&amp;#39;page&amp;#39;] defined, use it as page number&lt;br /&gt;if(isset(&amp;#036;_GET[&amp;#39;page&amp;#39;]))&lt;br /&gt;{&lt;br /&gt;	&amp;#036;pageNum = &amp;#036;_GET[&amp;#39;page&amp;#39;];&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// counting the offset&lt;br /&gt;&amp;#036;offset = (&amp;#036;pageNum - 1) * &amp;#036;rowsPerPage;&lt;br /&gt;&lt;br /&gt;&amp;#036;query  = &amp;quot;SELECT name FROM student LIMIT &amp;#036;offset, &amp;#036;rowsPerPage&amp;quot;;&lt;br /&gt;&amp;#036;result = mysql_query(&amp;#036;query) or die(&amp;#39;Error, query failed&amp;#39;);&lt;br /&gt;&lt;br /&gt;// print the random numbers&lt;br /&gt;while(&amp;#036;row = mysql_fetch_array(&amp;#036;result))&lt;br /&gt;{&lt;br /&gt;	echo &amp;#036;row[&amp;#39;name&amp;#39;] . &amp;#39;&amp;lt;br&amp;gt;&amp;#39;;&lt;br /&gt;}&lt;br /&gt;echo &amp;#39;&amp;lt;br&amp;gt;&amp;#39;;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;// how many rows we have in database&lt;br /&gt;&amp;#036;query   = &amp;quot;SELECT COUNT(id) AS numrows FROM student&amp;quot;;&lt;br /&gt;&amp;#036;result  = mysql_query(&amp;#036;query) or die(&amp;#39;Error, query failed&amp;#39;);&lt;br /&gt;&amp;#036;row     = mysql_fetch_array(&amp;#036;result, MYSQL_ASSOC);&lt;br /&gt;&amp;#036;numrows = &amp;#036;row[&amp;#39;numrows&amp;#39;];&lt;br /&gt;&lt;br /&gt;// how many pages we have when using paging?&lt;br /&gt;// &amp;#036;maxPage = ceil(15/2) = 8 &lt;br /&gt;&amp;#036;maxPage = ceil(&amp;#036;numrows/&amp;#036;rowsPerPage); &lt;br /&gt;&lt;br /&gt;// print the link to access each page&lt;br /&gt;&amp;#036;self = &amp;#036;_SERVER[&amp;#39;PHP_SELF&amp;#39;];&lt;br /&gt;&amp;#036;nav = &amp;#39;&amp;#39;;&lt;br /&gt;for(&amp;#036;page = 1; &amp;#036;page &amp;lt;= &amp;#036;maxPage; &amp;#036;page++)&lt;br /&gt;{&lt;br /&gt;	if (&amp;#036;page == &amp;#036;pageNum)&lt;br /&gt;	{&lt;br /&gt;		&amp;#036;nav .= &amp;quot; &amp;#036;page &amp;quot;;   // no need to create a link to current page&lt;br /&gt;	}&lt;br /&gt;	else&lt;br /&gt;	{&lt;br /&gt;		&amp;#036;nav .= &amp;quot; &amp;lt;a href=&amp;#092;&amp;quot;&amp;#036;self?page=&amp;#036;page&amp;#092;&amp;quot;&amp;gt;&amp;#036;page&amp;lt;/a&amp;gt; &amp;quot;;&lt;br /&gt;	}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;// creating previous and next link&lt;br /&gt;// plus the link to go straight to&lt;br /&gt;// the first and last page&lt;br /&gt;&lt;br /&gt;if (&amp;#036;pageNum &amp;gt; 1)&lt;br /&gt;{&lt;br /&gt;	&amp;#036;page = &amp;#036;pageNum - 1;&lt;br /&gt;	&amp;#036;prev = &amp;quot; &amp;lt;a href=&amp;#092;&amp;quot;&amp;#036;self?page=&amp;#036;page&amp;#092;&amp;quot;&amp;gt;[Prev]&amp;lt;/a&amp;gt; &amp;quot;;&lt;br /&gt;&lt;br /&gt;	&amp;#036;first = &amp;quot; &amp;lt;a href=&amp;#092;&amp;quot;&amp;#036;self?page=1&amp;#092;&amp;quot;&amp;gt;[First Page]&amp;lt;/a&amp;gt; &amp;quot;;&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;	&amp;#036;prev  = &amp;#39;&amp;amp;nbsp;&amp;#39;; // we&amp;#39;re on page one, don&amp;#39;t print previous link&lt;br /&gt;	&amp;#036;first = &amp;#39;&amp;amp;nbsp;&amp;#39;; // nor the first page link&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;if (&amp;#036;pageNum &amp;lt; &amp;#036;maxPage)&lt;br /&gt;{&lt;br /&gt;	&amp;#036;page = &amp;#036;pageNum + 1;&lt;br /&gt;	&amp;#036;next = &amp;quot; &amp;lt;a href=&amp;#092;&amp;quot;&amp;#036;self?page=&amp;#036;page&amp;#092;&amp;quot;&amp;gt;[Next]&amp;lt;/a&amp;gt; &amp;quot;;&lt;br /&gt;&lt;br /&gt;	&amp;#036;last = &amp;quot; &amp;lt;a href=&amp;#092;&amp;quot;&amp;#036;self?page=&amp;#036;maxPage&amp;#092;&amp;quot;&amp;gt;[Last Page]&amp;lt;/a&amp;gt; &amp;quot;;&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;	&amp;#036;next = &amp;#39;&amp;amp;nbsp;&amp;#39;; // we&amp;#39;re on the last page, don&amp;#39;t print next link&lt;br /&gt;	&amp;#036;last = &amp;#39;&amp;amp;nbsp;&amp;#39;; // nor the last page link&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// print the navigation link&lt;br /&gt;echo &amp;#036;numrows . &amp;#036;first . &amp;#036;prev . &amp;#036;nav . &amp;#036;next . &amp;#036;last;&lt;br /&gt;&lt;br /&gt;// and close the database connection&lt;br /&gt;include &amp;#39;library/closedb.php&amp;#39;;&lt;br /&gt;?&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;br /&gt;The output of the bottom code would be like this [FIRST] [PREV] 1 2 3 4 5 6 7 8  [NEXT] [LAST] and the page number are limit on the data i have. &lt;br /&gt;It&amp;#39;s possible that i could modified the bottom code to change it to [FIRST] [PREV] 1 2 3 4 5  [NEXT] [LAST], only 5 pages could be view and the six pages would be like this [FIRST] [PREV] 6 7 8 9 10  [NEXT] [LAST], just like the google search paging system and also forum post paging system. &lt;br /&gt;&lt;br /&gt;Could any one help me in this.  &lt;!--emo&amp;:respect:--&gt;&lt;img src='http://static.lowyat.net/style_emoticons/default/notworthy.gif' border='0' style='vertical-align:middle' alt='notworthy.gif' /&gt;&lt;!--endemo--&gt;  &lt;!--emo&amp;:respect:--&gt;&lt;img src='http://static.lowyat.net/style_emoticons/default/notworthy.gif' border='0' style='vertical-align:middle' alt='notworthy.gif' /&gt;&lt;!--endemo--&gt;  &lt;!--emo&amp;:respect:--&gt;&lt;img src='http://static.lowyat.net/style_emoticons/default/notworthy.gif' border='0' style='vertical-align:middle' alt='notworthy.gif' /&gt;&lt;!--endemo--&gt; &lt;br /&gt;</description>
            <author>crliuh</author>
            <category>Codemasters</category>
            <pubDate>Wed, 24 Sep 2008 23:18:54 +0800</pubDate>
        </item>
        <item>
            <title>need help in php script</title>
            <link>http://forum.lowyat.net/topic/687275</link>
            <description>Warning: mail() [function.mail]: &amp;quot;sendmail_from&amp;quot; not set in php.ini or custom &amp;quot;From:&amp;quot; header missing in C:&amp;#092;AppServ&amp;#092;www&amp;#092;htdoc&amp;#092;contact.php on line 4----&amp;#62;wat does tis mean?&lt;br /&gt;&lt;br /&gt;in my php.ini&lt;br /&gt;[mail function]&lt;br /&gt;; For Win32 only.&lt;br /&gt;SMTP = smtp.example.com&lt;br /&gt;smtp_port = 25&lt;br /&gt;&lt;br /&gt;; For Win32 only.&lt;br /&gt;sendmail_from = (my local server mail?)&lt;br /&gt;&lt;br /&gt;itiz, i hav 2 install some kind of mail server in my pc?</description>
            <author>crliuh</author>
            <category>Codemasters</category>
            <pubDate>Fri, 02 May 2008 17:34:14 +0800</pubDate>
        </item>
    </channel>
</rss>
