<?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>Webmaster-Talk.com - PHP Forum</title>
		<link>http://www.webmaster-talk.com/</link>
		<description>PHP coding, i.e. Hypertext Preprocessor, discussions and help.</description>
		<language>en</language>
		<lastBuildDate>Sat, 21 Nov 2009 18:19:21 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>60</ttl>
		<image>
			<url>http://img.webmaster-talk.com/bluesky/vb_img/misc/rss.jpg</url>
			<title>Webmaster-Talk.com - PHP Forum</title>
			<link>http://www.webmaster-talk.com/</link>
		</image>
		<item>
			<title>Using Advanced DHTML Popup / Form In pop up / submit action</title>
			<link>http://www.webmaster-talk.com/php-forum/192083-using-advanced-dhtml-popup-form-pop.html</link>
			<pubDate>Fri, 20 Nov 2009 22:00:47 GMT</pubDate>
			<description>Advanced DHTML Popup 
 
http://www.dpopup.com/dhtml-popup-examples.html 
 
I am using there pop up script to display a form , very similar to what...</description>
			<content:encoded><![CDATA[<div>Advanced DHTML Popup<br />
<br />
<a href="http://www.dpopup.com/dhtml-popup-examples.html" target="_blank">http://www.dpopup.com/dhtml-popup-examples.html</a><br />
<br />
I am using there pop up script to display a form , very similar to what they have on the page above where it pops up on the bottom.<br />
<br />
When I submit the form I want it to post the data to the DB but also stay on that same window and say thank you , blah blah you can now close this window.<br />
<br />
But its not going that, How can I do it how they have it on their thing ? where when you hit submit it loads on that same pop up window.<br />
<br />
PS. I also tried to close on submit but that does not work<br />
<br />
Thanks for the help <br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">HTML Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left"><span style="color:#FF8000">&lt;form method=<span style="color:#0000FF">&quot;post&quot;</span> action=<span style="color:#0000FF">&quot;register2.php&quot;</span> onsubmit=<span style="color:#0000FF">&quot;top.close();&quot;</span>&gt;</span><br />
&nbsp; Name<span style="color:#000080">&lt;br/&gt;</span><span style="color:#FF8000">&lt;input type=<span style="color:#0000FF">&quot;text&quot;</span> name=<span style="color:#0000FF">&quot;name&quot;</span> maxlength=<span style="color:#0000FF">&quot;20&quot;</span> /&gt;</span><span style="color:#000080">&lt;br/&gt;</span><br />
&nbsp; Email<span style="color:#000080">&lt;br/&gt;</span><span style="color:#FF8000">&lt;input type=<span style="color:#0000FF">&quot;text&quot;</span> name=<span style="color:#0000FF">&quot;email&quot;</span> /&gt;</span><span style="color:#000080">&lt;br/&gt;</span><br />
&nbsp; <span style="color:#FF8000">&lt;input name=<span style="color:#0000FF">&quot;submit&quot;</span> input type=<span style="color:#0000FF">&quot;submit&quot;</span> value=<span style="color:#0000FF">&quot;Submit Me&quot;</span> /&gt;</span><br />
<span style="color:#FF8000">&lt;/form&gt;</span></code><hr />
</div><br />
My PHP<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
	<div class="alt2">
		<hr />
		<code style="white-space:nowrap">
		<div dir="ltr" style="text-align:left;">
			<!-- php buffer start --><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?PHP&nbsp;&nbsp;&nbsp;<br /></span><span style="color: #FF8000">//&nbsp;register2.php&nbsp;&nbsp;<br /></span><span style="color: #007700">include(</span><span style="color: #DD0000">"dbconnect.php"</span><span style="color: #007700">);&nbsp;&nbsp;<br /></span><span style="color: #0000BB">$errors&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">""</span><span style="color: #007700">;&nbsp;&nbsp;<br />if&nbsp;(!isset(</span><span style="color: #0000BB">$_POST</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'name'</span><span style="color: #007700">&#93;))&nbsp;&nbsp;<br /></span><span style="color: #0000BB">$errors&nbsp;</span><span style="color: #007700">.=&nbsp;</span><span style="color: #DD0000">"Please&nbsp;provide&nbsp;your&nbsp;name.&nbsp;&lt;br/&gt;"</span><span style="color: #007700">;&nbsp;&nbsp;<br />if&nbsp;(!isset(</span><span style="color: #0000BB">$_POST</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'email'</span><span style="color: #007700">&#93;))&nbsp;&nbsp;<br /></span><span style="color: #0000BB">$errors&nbsp;</span><span style="color: #007700">.=&nbsp;</span><span style="color: #DD0000">"Please&nbsp;provide&nbsp;an&nbsp;email&nbsp;address.&nbsp;&lt;br/&gt;"</span><span style="color: #007700">;&nbsp;&nbsp;<br />if&nbsp;(</span><span style="color: #0000BB">$errors&nbsp;</span><span style="color: #007700">==&nbsp;</span><span style="color: #DD0000">""</span><span style="color: #007700">)&nbsp;{&nbsp;&nbsp;<br /></span><span style="color: #0000BB">mysql_query</span><span style="color: #007700">(</span><span style="color: #DD0000">"INSERT&nbsp;INTO&nbsp;user_list&nbsp;VALUES(&nbsp;&nbsp;<br />'',&nbsp;&nbsp;<br />'"</span><span style="color: #007700">.</span><span style="color: #0000BB">addslashes</span><span style="color: #007700">(</span><span style="color: #0000BB">$_POST</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'name'</span><span style="color: #007700">&#93;).</span><span style="color: #DD0000">"',&nbsp;&nbsp;<br />'"</span><span style="color: #007700">.</span><span style="color: #0000BB">addslashes</span><span style="color: #007700">(</span><span style="color: #0000BB">$_POST</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'email'</span><span style="color: #007700">&#93;).</span><span style="color: #DD0000">"',&nbsp;&nbsp;<br />'"</span><span style="color: #007700">.</span><span style="color: #0000BB">time</span><span style="color: #007700">().</span><span style="color: #DD0000">"'&nbsp;&nbsp;<br />)"</span><span style="color: #007700">)&nbsp;or&nbsp;die(</span><span style="color: #0000BB">mysql_error</span><span style="color: #007700">());&nbsp;&nbsp;<br />echo&nbsp;</span><span style="color: #DD0000">"Registration&nbsp;Successful!"</span><span style="color: #007700">;&nbsp;&nbsp;<br />}&nbsp;else&nbsp;{&nbsp;&nbsp;<br />echo&nbsp;</span><span style="color: #0000BB">$errors</span><span style="color: #007700">.</span><span style="color: #DD0000">"Please&nbsp;go&nbsp;back&nbsp;and&nbsp;try&nbsp;again."</span><span style="color: #007700">;&nbsp;&nbsp;<br />}&nbsp;&nbsp;<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code><!-- php buffer end -->
		</div>
		</code>
		<hr />
	</div>
</div></div>

]]></content:encoded>
			<category domain="http://www.webmaster-talk.com/php-forum/">PHP Forum</category>
			<dc:creator>csads</dc:creator>
			<guid isPermaLink="true">http://www.webmaster-talk.com/php-forum/192083-using-advanced-dhtml-popup-form-pop.html</guid>
		</item>
		<item>
			<title>a little help please</title>
			<link>http://www.webmaster-talk.com/php-forum/192056-a-little-help-please.html</link>
			<pubDate>Fri, 20 Nov 2009 11:44:59 GMT</pubDate>
			<description>i have a wordpress mu script installed and i have global admin bar ... but i want to add some commands after login form ( mynconnect.com ) 
i manage...</description>
			<content:encoded><![CDATA[<div>i have a wordpress mu script installed and i have global admin bar ... but i want to add some commands after login form ( mynconnect.com )<br />
i manage to add but i didn`t manage to alignment them <br />
here is the code <br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">&lt;!-- Start WordPress Admin Bar --&gt;<br />
&lt;div id=&quot;wpabar&quot;&gt;<br />
&nbsp;&lt;div id=&quot;wpabar-leftside&quot;&gt;<br />
&nbsp; &lt;ul&gt;<br />
&nbsp;  &lt;!-- Begin IFBDesign Customization --&gt;<br />
&nbsp;  &lt;?php if ( !is_user_logged_in() ) { ?&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;li&gt;&lt;form style=&quot;margin:2px 0pt 0pt 10px&quot; name=&quot;loginform&quot; id=&quot;loginform&quot; action=&quot;/wp-login.php&quot; method=&quot;post&quot;&gt;<br />
&nbsp;  &lt;li&gt;&lt;input type=&quot;text&quot; id=&quot;user_login&quot; name=&quot;log&quot; tabindex=&quot;1&quot; value=&quot;Username&quot;onblur=&quot;if (this.value == '') {this.value = 'Username';}&quot; onfocus=&quot;if (this.value == 'Username') {this.value = '';}&quot; value=&quot;username here&quot;/&gt;<br />
&nbsp;  &lt;input type=&quot;password&quot; id=&quot;user_pass&quot; name=&quot;pwd&quot; tabindex=&quot;2&quot; value=&quot;Password&quot; onblur=&quot;if (this.value == '') {this.value = 'Password';}&quot; onfocus=&quot;if (this.value == 'Password') {this.value = '';}&quot;/&gt;<br />
&nbsp;  &lt;button type=&quot;submit&quot; id=&quot;wp-submit&quot; name=&quot;wp-submit&quot; value=&quot;true&quot; tabindex=&quot;4&quot;&gt;Log In&lt;/button&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;input type=&quot;checkbox&quot; id=&quot;rememberme&quot; name=&quot;rememberme&quot; value=&quot;forever&quot; tabindex=&quot;3&quot; /&gt;&lt;span style=&quot;color:#FFFFFF;&quot;&gt;Remember Me&lt;/span&gt;<br />
&nbsp;  &lt;/form&gt;<br />
&lt;a href=&quot;<a href="http://mynconnect.com/wp-signup.php&quot;&gt;Get" target="_blank">http://mynconnect.com/wp-signup.php&quot;&gt;Get</a> a Blog&lt;/a&gt;&lt;a href=&quot;<a href="http://mynconnect.com/?random&quot;&gt;Random" target="_blank">http://mynconnect.com/?random&quot;&gt;Random</a> blog&lt;/a&gt;<br />
&nbsp;  &lt;?php } else { ?&gt;<br />
&lt;?php</code><hr />
</div>can somebody help me?<br />
and i want to add and a link to home page named Main Blog</div>

]]></content:encoded>
			<category domain="http://www.webmaster-talk.com/php-forum/">PHP Forum</category>
			<dc:creator>rober7</dc:creator>
			<guid isPermaLink="true">http://www.webmaster-talk.com/php-forum/192056-a-little-help-please.html</guid>
		</item>
		<item>
			<title>Is there any way to do this in PHP (or with a combination of JS)?</title>
			<link>http://www.webmaster-talk.com/php-forum/192024-there-any-way-do-php-combination.html</link>
			<pubDate>Fri, 20 Nov 2009 03:26:40 GMT</pubDate>
			<description><![CDATA[There's a login form on page A: http://www.example.com/A.html 
 
The 'action' attribute of which is: action="/B.html" 
 
So when someone logs in with...]]></description>
			<content:encoded><![CDATA[<div>There's a login form on page A: <a href="http://www.example.com/A.html" target="_blank">http://www.example.com/A.html</a><br />
<br />
The 'action' attribute of which is: action=&quot;/B.html&quot;<br />
<br />
So when someone logs in with the form on A.html, the data will be submitted to / visitor redirected to B.html. <br />
<br />
<b>Now what I want is</b>: there's an &lt;iframe&gt;&lt;/iframe&gt; on /C.html, framing B.html, is there any way so that when someone logs in with the form on A.html, the visitor is redirected to C.html and the login details is submitted to B.html that's framed on C.html in the &lt;iframe&gt;&lt;/iframe&gt;? So after the person logs in from A.html, he arrives at C.html with the actual CP dashboard framed in an &lt;iframe&gt;.<br />
<br />
I have absolutely no clue in achieving this. Maybe the form will be submitted to C.html first and C.html submits the login details to B.html (framed in C.html) via JavaScript? How?</div>

]]></content:encoded>
			<category domain="http://www.webmaster-talk.com/php-forum/">PHP Forum</category>
			<dc:creator>yangyang</dc:creator>
			<guid isPermaLink="true">http://www.webmaster-talk.com/php-forum/192024-there-any-way-do-php-combination.html</guid>
		</item>
		<item>
			<title>Please Help with error!</title>
			<link>http://www.webmaster-talk.com/php-forum/192022-please-help-with-error.html</link>
			<pubDate>Fri, 20 Nov 2009 03:14:26 GMT</pubDate>
			<description>I am using a wordpress photo gallery plugin and I am receiving the following error when I upload a photo. 
 
Warning: getimagesize()...</description>
			<content:encoded><![CDATA[<div>I am using a wordpress photo gallery plugin and I am receiving the following error when I upload a photo.<br />
<br />
Warning: getimagesize() [function.getimagesize]: Filename cannot be empty in /home/******/public_html/alr/wp-content/plugins/wp-photo-album/wppa.php on line 651<br />
<br />
<br />
<br />
The .php file info is below.<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
	<div class="alt2">
		<hr />
		<code style="white-space:nowrap">
		<div dir="ltr" style="text-align:left;">
			<!-- php buffer start --><code><span style="color: #000000">
<span style="color: #0000BB">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;check&nbsp;if&nbsp;thumbs&nbsp;dir&nbsp;exists&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">if&nbsp;(!</span><span style="color: #0000BB">is_dir</span><span style="color: #007700">(</span><span style="color: #0000BB">$wppa_dir&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #DD0000">'/thumbs'</span><span style="color: #007700">))&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">mkdir</span><span style="color: #007700">(</span><span style="color: #0000BB">$wppa_dir&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #DD0000">'/thumbs'</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;foreach&nbsp;(</span><span style="color: #0000BB">$_FILES&nbsp;</span><span style="color: #007700">as&nbsp;</span><span style="color: #0000BB">$file</span><span style="color: #007700">)&nbsp;{<br />&#91;</span><span style="color: #0000BB">B</span><span style="color: #007700">&#93;&#91;</span><span style="color: #0000BB">COLOR</span><span style="color: #007700">=</span><span style="color: #0000BB">Red</span><span style="color: #007700">&#93;</span><span style="color: #0000BB">Line&nbsp;651</span><span style="color: #007700">&#91;/</span><span style="color: #0000BB">COLOR</span><span style="color: #007700">&#93;&#91;/</span><span style="color: #0000BB">B</span><span style="color: #007700">&#93;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(</span><span style="color: #0000BB">getimagesize</span><span style="color: #007700">(</span><span style="color: #0000BB">$file</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'tmp_name'</span><span style="color: #007700">&#93;))&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$ext&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">substr</span><span style="color: #007700">(</span><span style="color: #0000BB">strrchr</span><span style="color: #007700">(</span><span style="color: #0000BB">$file</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'name'</span><span style="color: #007700">&#93;,&nbsp;</span><span style="color: #DD0000">"."</span><span style="color: #007700">),&nbsp;</span><span style="color: #0000BB">1</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /></span><span style="color: #0000BB">$query&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"INSERT&nbsp;INTO&nbsp;"&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">PHOTO_TABLE&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #DD0000">"&nbsp;(id,&nbsp;album,&nbsp;ext,&nbsp;name,&nbsp;description)&nbsp;VALUES&nbsp;(0,&nbsp;{$_POST&#91;'wppa-album'&#93;},&nbsp;'$ext',&nbsp;'{$file&#91;'name'&#93;}',&nbsp;'')"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$wpdb</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">query</span><span style="color: #007700">(</span><span style="color: #0000BB">$query</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//echo&nbsp;$query;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$image_id&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$wpdb</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">get_var</span><span style="color: #007700">(</span><span style="color: #DD0000">"SELECT&nbsp;LAST_INSERT_ID()"</span><span style="color: #007700">);<br />&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;</span><span style="color: #0000BB">$newimage&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$wppa_dir&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #DD0000">'/'&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">$image_id&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #DD0000">'.'&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">$ext</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">copy</span><span style="color: #007700">(</span><span style="color: #0000BB">$file</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'tmp_name'</span><span style="color: #007700">&#93;,&nbsp;</span><span style="color: #0000BB">$newimage</span><span style="color: #007700">);<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(</span><span style="color: #0000BB">is_file&nbsp;</span><span style="color: #007700">(</span><span style="color: #0000BB">$newimage</span><span style="color: #007700">))&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$uploaded_a_file&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">TRUE</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(</span><span style="color: #0000BB">is_numeric</span><span style="color: #007700">(</span><span style="color: #0000BB">get_option</span><span style="color: #007700">(</span><span style="color: #DD0000">'wppa_thumbsize'</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">$thumbsize&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">get_option</span><span style="color: #007700">(</span><span style="color: #DD0000">'wppa_thumbsize'</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;else&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">$thumbsize&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">130</span><span style="color: #007700">;<br />&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;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">wppa_create_thumbnail</span><span style="color: #007700">(</span><span style="color: #0000BB">$newimage</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$thumbsize</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">''&nbsp;</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />if&nbsp;(</span><span style="color: #0000BB">$uploaded_a_file</span><span style="color: #007700">)&nbsp;{&nbsp;echo&nbsp;</span><span style="color: #DD0000">'&lt;div&nbsp;id="message"&nbsp;class="updated&nbsp;fade"&gt;&lt;p&gt;&lt;strong&gt;Photos&nbsp;Uploaded.&lt;/strong&gt;&lt;/p&gt;&lt;/div&gt;'</span><span style="color: #007700">;&nbsp;}<br /><br />}&nbsp;<br /></span><span style="color: #0000BB"></span>
</span>
</code><!-- php buffer end -->
		</div>
		</code>
		<hr />
	</div>
</div>Can someone please tell me how to fix this?</div>

]]></content:encoded>
			<category domain="http://www.webmaster-talk.com/php-forum/">PHP Forum</category>
			<dc:creator>DrVPSHosting</dc:creator>
			<guid isPermaLink="true">http://www.webmaster-talk.com/php-forum/192022-please-help-with-error.html</guid>
		</item>
		<item>
			<title>Need SESSION across folders</title>
			<link>http://www.webmaster-talk.com/php-forum/192013-need-session-across-folders.html</link>
			<pubDate>Fri, 20 Nov 2009 00:58:25 GMT</pubDate>
			<description>Hi, Noob here.  Been searching for help and guidance.  I had my web pages displaying properly when they were all in the same folder.  After I moved...</description>
			<content:encoded><![CDATA[<div>Hi, Noob here.  Been searching for help and guidance.  I had my web pages displaying properly when they were all in the same folder.  After I moved some pages into a new folder they do not display the correct information.  I believe this is related to SESSION.  I need to have the SESSION data available to files in different folders.  What is the proper way to do this?  I've check the manual and other sources, but ended up confused.  Thanks in advance.</div>

]]></content:encoded>
			<category domain="http://www.webmaster-talk.com/php-forum/">PHP Forum</category>
			<dc:creator>gdaniels</dc:creator>
			<guid isPermaLink="true">http://www.webmaster-talk.com/php-forum/192013-need-session-across-folders.html</guid>
		</item>
		<item>
			<title>Help me to create popup window for feedback button?</title>
			<link>http://www.webmaster-talk.com/php-forum/192006-help-me-create-popup-window-feedback.html</link>
			<pubDate>Thu, 19 Nov 2009 19:35:13 GMT</pubDate>
			<description>Hi friends, 
 
I could create feedback button ( on the right side fixed position ) on my blog. Its working fine too. But I would like to know how to...</description>
			<content:encoded><![CDATA[<div>Hi friends,<br />
<br />
I could create feedback button ( on the right side fixed position ) on my blog. Its working fine too. But I would like to know how to create an asynchronous script for making the form with in the blog. I mean without navigating to other page. <br />
<br />
See the current button here - I had a twitter button too. <a href="http://newgenresoft.com/seoblog" target="_blank">http://newgenreseoblog.com</a><br />
<br />
The code was just simple - url and image..<br />
.</div>

]]></content:encoded>
			<category domain="http://www.webmaster-talk.com/php-forum/">PHP Forum</category>
			<dc:creator>flek</dc:creator>
			<guid isPermaLink="true">http://www.webmaster-talk.com/php-forum/192006-help-me-create-popup-window-feedback.html</guid>
		</item>
		<item>
			<title>Problems with simple if statement/query</title>
			<link>http://www.webmaster-talk.com/php-forum/192005-problems-with-simple-if-statement-query.html</link>
			<pubDate>Thu, 19 Nov 2009 19:33:46 GMT</pubDate>
			<description>I am trying to make a listings of products, based on category. I have been fighting with this script for the past 3 hours trying to get this to work...</description>
			<content:encoded><![CDATA[<div>I am trying to make a listings of products, based on category. I have been fighting with this script for the past 3 hours trying to get this to work and for some reason it is only pulling the products that do not have a category2<br />
 <br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
	<div class="alt2">
		<hr />
		<code style="white-space:nowrap">
		<div dir="ltr" style="text-align:left;">
			<!-- php buffer start --><code><span style="color: #000000">
<span style="color: #0000BB"></span><span style="color: #007700">else&nbsp;if&nbsp;(isset(</span><span style="color: #0000BB">$_GET</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'category1'</span><span style="color: #007700">&#93;))&nbsp;{&nbsp;<br />&nbsp;<br />&nbsp;</span><span style="color: #0000BB">$resultwithcat2&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;products&nbsp;WHERE&nbsp;category1='$_GET&#91;category1&#93;'"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$dbhandle</span><span style="color: #007700">);<br />&nbsp;</span><span style="color: #0000BB">$resultnocat2&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;products&nbsp;WHERE&nbsp;category1='$_GET&#91;category1&#93;'&nbsp;AND&nbsp;category2=''"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$dbhandle</span><span style="color: #007700">);<br />&nbsp;<br />&nbsp;if&nbsp;(!empty(</span><span style="color: #0000BB">$row</span><span style="color: #007700">&#91;</span><span style="color: #0000BB">category2</span><span style="color: #007700">&#93;))&nbsp;{&nbsp;<br />&nbsp;&nbsp;while&nbsp;(</span><span style="color: #0000BB">$row&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">$resultwithcat2</span><span style="color: #007700">))&nbsp;{&nbsp;&nbsp;&nbsp;<br />&nbsp;echo&nbsp;</span><span style="color: #DD0000">"&lt;a&nbsp;href=\"products.php?category1&amp;category2="</span><span style="color: #007700">.</span><span style="color: #0000BB">$row</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'category2'</span><span style="color: #007700">&#93;.</span><span style="color: #DD0000">"\"&gt;&lt;strong&gt;"</span><span style="color: #007700">.</span><span style="color: #0000BB">$row</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'category2'</span><span style="color: #007700">&#93;.</span><span style="color: #DD0000">"&lt;/strong&gt;&lt;/a&gt;&nbsp;in&nbsp;"</span><span style="color: #007700">.</span><span style="color: #0000BB">$row</span><span style="color: #007700">&#91;</span><span style="color: #0000BB">category1</span><span style="color: #007700">&#93;.</span><span style="color: #DD0000">"&nbsp;&lt;font&nbsp;color=green&gt;WITH&lt;/font&gt;&nbsp;2nd&nbsp;category&nbsp;of&nbsp;"</span><span style="color: #007700">.</span><span style="color: #0000BB">$row</span><span style="color: #007700">&#91;</span><span style="color: #0000BB">category2</span><span style="color: #007700">&#93;.</span><span style="color: #DD0000">"&lt;br&gt;"</span><span style="color: #007700">;<br />&nbsp;&nbsp;}&nbsp;<br />&nbsp;}&nbsp;<br />&nbsp;<br />&nbsp;echo&nbsp;</span><span style="color: #DD0000">"&lt;hr&gt;"</span><span style="color: #007700">;<br />&nbsp;<br />&nbsp;if&nbsp;(empty(</span><span style="color: #0000BB">$row</span><span style="color: #007700">&#91;</span><span style="color: #0000BB">category2</span><span style="color: #007700">&#93;))&nbsp;{<br />&nbsp;&nbsp;while&nbsp;(</span><span style="color: #0000BB">$row&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">$resultnocat2</span><span style="color: #007700">))&nbsp;{&nbsp;<br />&nbsp;echo&nbsp;</span><span style="color: #DD0000">"&lt;a&nbsp;href=\"products.php?productid="</span><span style="color: #007700">.</span><span style="color: #0000BB">$row</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'productid'</span><span style="color: #007700">&#93;.</span><span style="color: #DD0000">"\"&gt;&lt;strong&gt;"</span><span style="color: #007700">.</span><span style="color: #0000BB">$row</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'productname'</span><span style="color: #007700">&#93;.</span><span style="color: #DD0000">"&lt;/strong&gt;&lt;/a&gt;&nbsp;in&nbsp;"</span><span style="color: #007700">.</span><span style="color: #0000BB">$row</span><span style="color: #007700">&#91;</span><span style="color: #0000BB">category1</span><span style="color: #007700">&#93;.</span><span style="color: #DD0000">"&nbsp;&lt;font&nbsp;color=red&gt;NO&lt;/font&gt;&nbsp;2nd&nbsp;category&nbsp;&lt;br&gt;"</span><span style="color: #007700">;<br />&nbsp;}<br />&nbsp;}&nbsp;<br />&nbsp;<br />}&nbsp;<br /></span><span style="color: #0000BB"></span>
</span>
</code><!-- php buffer end -->
		</div>
		</code>
		<hr />
	</div>
</div> <br />
Breaking this code down, I think the problem lies somewhere within here:<br />
 <br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
	<div class="alt2">
		<hr />
		<code style="white-space:nowrap">
		<div dir="ltr" style="text-align:left;">
			<!-- php buffer start --><code><span style="color: #000000">
<span style="color: #0000BB">&nbsp;<br />&nbsp;$resultwithcat2&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;products&nbsp;WHERE&nbsp;category1='$_GET&#91;category1&#93;'"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$dbhandle</span><span style="color: #007700">);<br />&nbsp;<br />&nbsp;<br />&nbsp;if&nbsp;(!empty(</span><span style="color: #0000BB">$row</span><span style="color: #007700">&#91;</span><span style="color: #0000BB">category2</span><span style="color: #007700">&#93;))&nbsp;{&nbsp;<br />&nbsp;&nbsp;while&nbsp;(</span><span style="color: #0000BB">$row&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">$resultwithcat2</span><span style="color: #007700">))&nbsp;{&nbsp;&nbsp;&nbsp;<br />&nbsp;echo&nbsp;</span><span style="color: #DD0000">"&lt;a&nbsp;href=\"products.php?category1&amp;category2="</span><span style="color: #007700">.</span><span style="color: #0000BB">$row</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'category2'</span><span style="color: #007700">&#93;.</span><span style="color: #DD0000">"\"&gt;&lt;strong&gt;"</span><span style="color: #007700">.</span><span style="color: #0000BB">$row</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'category2'</span><span style="color: #007700">&#93;.</span><span style="color: #DD0000">"&lt;/strong&gt;&lt;/a&gt;&nbsp;in&nbsp;"</span><span style="color: #007700">.</span><span style="color: #0000BB">$row</span><span style="color: #007700">&#91;</span><span style="color: #0000BB">category1</span><span style="color: #007700">&#93;.</span><span style="color: #DD0000">"&nbsp;&lt;font&nbsp;color=green&gt;WITH&lt;/font&gt;&nbsp;2nd&nbsp;category&nbsp;of&nbsp;"</span><span style="color: #007700">.</span><span style="color: #0000BB">$row</span><span style="color: #007700">&#91;</span><span style="color: #0000BB">category2</span><span style="color: #007700">&#93;.</span><span style="color: #DD0000">"&lt;br&gt;"</span><span style="color: #007700">;<br />&nbsp;&nbsp;}&nbsp;<br />&nbsp;}&nbsp;<br /></span><span style="color: #0000BB"></span>
</span>
</code><!-- php buffer end -->
		</div>
		</code>
		<hr />
	</div>
</div>Either something is wrong with my query or something is wrong with my php. I can't, for the life of me, figure out what is wrong with it. Like I said, it is pulling the results without a category2 properly. I want it to take the products with a category2 and list them at the top.<br />
 <br />
Note: The page with the problem can be found here: <a href="http://hvacdirect.us/products.php" target="_blank">http://hvacdirect.us/products.php</a><br />
Note: I have been testing in Test Category 4</div>

]]></content:encoded>
			<category domain="http://www.webmaster-talk.com/php-forum/">PHP Forum</category>
			<dc:creator>WebTraffic</dc:creator>
			<guid isPermaLink="true">http://www.webmaster-talk.com/php-forum/192005-problems-with-simple-if-statement-query.html</guid>
		</item>
		<item>
			<title>Can someone tell me what this means?</title>
			<link>http://www.webmaster-talk.com/php-forum/191948-can-someone-tell-me-what-means.html</link>
			<pubDate>Wed, 18 Nov 2009 22:43:54 GMT</pubDate>
			<description><![CDATA[Hello, 
 
While surfing to find an answer to yet another one of my problems, I've found a working solution; this: 
 
 
PHP: 
---------...]]></description>
			<content:encoded><![CDATA[<div>Hello,<br />
<br />
While surfing to find an answer to yet another one of my problems, I've found a working solution; this:<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
	<div class="alt2">
		<hr />
		<code style="white-space:nowrap">
		<div dir="ltr" style="text-align:left;">
			<!-- php buffer start --><code><span style="color: #000000">
<span style="color: #0000BB">preg_match</span><span style="color: #007700">(</span><span style="color: #DD0000">"/\&#91;\d+&#93;(.*)\&#91;\d+&#93;/"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$text</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$matches</span><span style="color: #007700">);&nbsp;<br /></span><span style="color: #0000BB"></span>
</span>
</code><!-- php buffer end -->
		</div>
		</code>
		<hr />
	</div>
</div>But I have no idea what the &quot;/\[\d+](.*)\[\d+]/&quot; is.<br />
<br />
I've tried deleting some things, but I either get an error or it doesn't work.<br />
<br />
What does it mean?  Thanks :)</div>

]]></content:encoded>
			<category domain="http://www.webmaster-talk.com/php-forum/">PHP Forum</category>
			<dc:creator>Physicsguy</dc:creator>
			<guid isPermaLink="true">http://www.webmaster-talk.com/php-forum/191948-can-someone-tell-me-what-means.html</guid>
		</item>
		<item>
			<title>Store PHP in MySQL?</title>
			<link>http://www.webmaster-talk.com/php-forum/191938-store-php-in-mysql.html</link>
			<pubDate>Wed, 18 Nov 2009 19:39:23 GMT</pubDate>
			<description>I know that you are able to put html in a database...  
  
I am trying to put php in my database so that I can pull php scripts from my database. Is...</description>
			<content:encoded><![CDATA[<div>I know that you are able to put html in a database... <br />
 <br />
I am trying to put php in my database so that I can pull php scripts from my database. Is it possible to do this?<br />
 <br />
Example... when I add &lt;font color=&quot;green&quot;&gt;This is a test&lt;/font&gt; to a table in my database, the website pulls it just fine. However, if I put echo &quot;This is a test&quot;; in my database it will not pull it.<br />
 <br />
I need to put php inside my database :(</div>

]]></content:encoded>
			<category domain="http://www.webmaster-talk.com/php-forum/">PHP Forum</category>
			<dc:creator>WebTraffic</dc:creator>
			<guid isPermaLink="true">http://www.webmaster-talk.com/php-forum/191938-store-php-in-mysql.html</guid>
		</item>
		<item>
			<title>Site Setup</title>
			<link>http://www.webmaster-talk.com/php-forum/191893-site-setup.html</link>
			<pubDate>Wed, 18 Nov 2009 06:15:12 GMT</pubDate>
			<description>Hey Guys, 
 
I am pretty new to the PHP world and am looking for some guidance in building a certain type of site. 
 
I wish to create a site for my...</description>
			<content:encoded><![CDATA[<div>Hey Guys,<br />
<br />
I am pretty new to the PHP world and am looking for some guidance in building a certain type of site.<br />
<br />
I wish to create a site for my work colleagues where they can simply slick on a button which then copies proformas, text etc from a data base or word document.<br />
<br />
Of course their would be a different button for each proforma etc.<br />
<br />
Does anyone have tips or ideas on scripts that would allow such functionality.<br />
<br />
Thanks In Advance :)</div>

]]></content:encoded>
			<category domain="http://www.webmaster-talk.com/php-forum/">PHP Forum</category>
			<dc:creator>RiverAce</dc:creator>
			<guid isPermaLink="true">http://www.webmaster-talk.com/php-forum/191893-site-setup.html</guid>
		</item>
		<item>
			<title>List Folders Only</title>
			<link>http://www.webmaster-talk.com/php-forum/191884-list-folders-only.html</link>
			<pubDate>Wed, 18 Nov 2009 01:06:14 GMT</pubDate>
			<description>I would like to only show folders, not the files. 
 
It is showing me files and folders. 
 
     PHP Code: 
                            
PHP:...</description>
			<content:encoded><![CDATA[<div>I would like to only show folders, not the files.<br />
<br />
It is showing me files and folders.<br />
<br />
     PHP Code:<br />
                           <font color="#000000">  <br />
</font><div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
	<div class="alt2">
		<hr />
		<code style="white-space:nowrap">
		<div dir="ltr" style="text-align:left;">
			<!-- php buffer start --><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php&nbsp;<br /></span><span style="color: #007700">function&nbsp;</span><span style="color: #0000BB">populateDropdown</span><span style="color: #007700">(){&nbsp;<br /></span><span style="color: #0000BB">$path&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">glob</span><span style="color: #007700">(</span><span style="color: #DD0000">"/home/bucket/public_html/*"</span><span style="color: #007700">);&nbsp;</span><span style="color: #FF8000">//the&nbsp;double&nbsp;\\&nbsp;is&nbsp;not&nbsp;a&nbsp;typo&nbsp;you&nbsp;<br />//have&nbsp;to&nbsp;escape&nbsp;it&nbsp;<br />//if&nbsp;the&nbsp;path&nbsp;cannot&nbsp;be&nbsp;found&nbsp;<br /></span><span style="color: #007700">if(!(</span><span style="color: #0000BB">$path</span><span style="color: #007700">)){&nbsp;<br />echo(</span><span style="color: #DD0000">"The&nbsp;path&nbsp;cannot&nbsp;be&nbsp;found"</span><span style="color: #007700">);&nbsp;<br />return;&nbsp;<br />}</span><span style="color: #FF8000">//if&nbsp;<br /><br />//the&nbsp;path&nbsp;is&nbsp;valid&nbsp;<br /></span><span style="color: #007700">else{&nbsp;<br />foreach(</span><span style="color: #0000BB">$path&nbsp;</span><span style="color: #007700">as&nbsp;</span><span style="color: #0000BB">$i</span><span style="color: #007700">){&nbsp;<br /><br />echo(</span><span style="color: #DD0000">"&lt;option&nbsp;value=$i&gt;$i&lt;/option&gt;"</span><span style="color: #007700">);&nbsp;<br /><br />}</span><span style="color: #FF8000">//foreach&nbsp;<br /></span><span style="color: #007700">}</span><span style="color: #FF8000">//else&nbsp;<br /></span><span style="color: #007700">}</span><span style="color: #FF8000">//populateDropdown&nbsp;<br /><br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code><!-- php buffer end -->
		</div>
		</code>
		<hr />
	</div>
</div><div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left"><div align="left"> &lt;select&gt;<br />
&lt;?php populateDropdown(); ?&gt;<br />
&lt;/select&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  </div></code><hr />
</div></div>

]]></content:encoded>
			<category domain="http://www.webmaster-talk.com/php-forum/">PHP Forum</category>
			<dc:creator>sith717</dc:creator>
			<guid isPermaLink="true">http://www.webmaster-talk.com/php-forum/191884-list-folders-only.html</guid>
		</item>
		<item>
			<title><![CDATA[Stupid If Statement.  Should work, but it doesn't...]]></title>
			<link>http://www.webmaster-talk.com/php-forum/191879-stupid-if-statement-should-work-but.html</link>
			<pubDate>Tue, 17 Nov 2009 22:24:11 GMT</pubDate>
			<description><![CDATA[Hi all, 
 
I've made an incredibly simple if statement.  All it does is check if a URL parameter is a certain value, and according to that, display...]]></description>
			<content:encoded><![CDATA[<div>Hi all,<br />
<br />
I've made an incredibly simple if statement.  All it does is check if a URL parameter is a certain value, and according to that, display certain content.<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
	<div class="alt2">
		<hr />
		<code style="white-space:nowrap">
		<div dir="ltr" style="text-align:left;">
			<!-- php buffer start --><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php&nbsp;<br />$currentURL&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"/userreview.php?reviewID=$reviewID"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$CommentingStatus&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$_GET</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">"comments"</span><span style="color: #007700">&#93;;<br /><br /><br />&nbsp;&nbsp;if&nbsp;(</span><span style="color: #0000BB">$CommentingStatus&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"on"</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"&lt;a&nbsp;href='$currentURL&amp;comments=off'&gt;Turn&nbsp;Off&nbsp;Comments&lt;/a&gt;"</span><span style="color: #007700">;&nbsp;<br />&nbsp;&nbsp;}<br />&nbsp;&nbsp;else&nbsp;if&nbsp;(</span><span style="color: #0000BB">$CommentingStatus&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"off"</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"&lt;a&nbsp;href='$currentURL&amp;comments=on'&gt;Turn&nbsp;On&nbsp;Comments&lt;/a&gt;"</span><span style="color: #007700">;&nbsp;<br />&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;else&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"Parameter&nbsp;'Comments'&nbsp;must&nbsp;be&nbsp;set&nbsp;to&nbsp;either&nbsp;'on'&nbsp;or&nbsp;'off'."</span><span style="color: #007700">;<br />&nbsp;&nbsp;}<br /><br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code><!-- php buffer end -->
		</div>
		</code>
		<hr />
	</div>
</div>I don't know why that won't work.  It always displays 'Turn Off Comments', even if comments are already off!<br />
<br />
It's supposed to:<br />
<br />
Check if 'comments' is on or off.<br />
If the comments are off, ask to turn them on.<br />
Else if the comments are on, ask to turn them off.<br />
<br />
Simple?  Apparently not...?</div>

]]></content:encoded>
			<category domain="http://www.webmaster-talk.com/php-forum/">PHP Forum</category>
			<dc:creator>Physicsguy</dc:creator>
			<guid isPermaLink="true">http://www.webmaster-talk.com/php-forum/191879-stupid-if-statement-should-work-but.html</guid>
		</item>
		<item>
			<title>How do I make this contact form secure?</title>
			<link>http://www.webmaster-talk.com/php-forum/191872-how-do-i-make-contact-form.html</link>
			<pubDate>Tue, 17 Nov 2009 19:38:58 GMT</pubDate>
			<description><![CDATA[Hi, I've heard that it is important to make a contact form secure to avoid spam attacks etc but have no clue how to do it really. Have found some...]]></description>
			<content:encoded><![CDATA[<div>Hi, I've heard that it is important to make a contact form secure to avoid spam attacks etc but have no clue how to do it really. Have found some quite old tutorials but think they may be out of date. It took me long enough to get the contact form working so I don't know where to start with making it secure. Are there any simple lines of code that I can add to make it more secure from attacks? <br />
 <br />
My code is below. Any help much appreciated.<br />
 <br />
 <br />
Code:<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">&lt;br/&gt;&lt;h3&gt;Email the site&lt;/h3&gt;&lt;p&gt;If you have any comments or questions about the site then please feel free to send me an email. &lt;/p&gt;&lt;form method=&quot;POST&quot; action=&quot;mailer.php&quot;&gt; Name: &lt;br&gt;&lt;input type=&quot;text&quot; name=&quot;name&quot; size=&quot;19&quot;&gt;&lt;br&gt; &lt;br&gt; Email:&lt;br&gt; &lt;input type=&quot;text&quot; name=&quot;email&quot; size=&quot;19&quot;&gt;&lt;br&gt; &lt;br&gt; Your Comments: &lt;br&gt; &lt;textarea rows=&quot;14&quot; name=&quot;message&quot; cols=&quot;50&quot;&gt;&lt;/textarea&gt; &lt;br&gt; &lt;br&gt; &lt;input type=&quot;submit&quot; value=&quot;Submit&quot; name=&quot;submit&quot;&gt;&lt;/form&gt;</code><hr />
</div>mailer.php:<br />
 <br />
 <br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">&lt;?php <br />
if(isset($_POST['submit'])) { <br />
$to = &quot;myemail.com&quot;; <br />
$subject = &quot;Feedback&quot;; <br />
$name_field = $_POST['name']; <br />
$email_field = $_POST['email']; <br />
$message = $_POST['message']; <br />
$body = &quot;From: $name_field\n E-Mail: $email_field\n Message:\n $message&quot;; <br />
echo &quot;Data has been submitted to $to!&quot;; mail($to, $subject, $body); <br />
} <br />
else { echo &quot;blarg!&quot;; } ?&gt;</code><hr />
</div></div>

]]></content:encoded>
			<category domain="http://www.webmaster-talk.com/php-forum/">PHP Forum</category>
			<dc:creator>gh05</dc:creator>
			<guid isPermaLink="true">http://www.webmaster-talk.com/php-forum/191872-how-do-i-make-contact-form.html</guid>
		</item>
		<item>
			<title>Incrementing a database value not working!</title>
			<link>http://www.webmaster-talk.com/php-forum/191856-incrementing-a-database-value-not-working.html</link>
			<pubDate>Tue, 17 Nov 2009 14:48:42 GMT</pubDate>
			<description>I am using a simple script to count clicks of a link... problem is that when it is supposed to increment the value of a table in the DB... it, well,...</description>
			<content:encoded><![CDATA[<div>I am using a simple script to count clicks of a link... problem is that when it is supposed to increment the value of a table in the DB... it, well, doesn't. <br />
<br />
Here is the click.php:<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">HTML Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">&nbsp; &nbsp; ...<br />
&nbsp; &nbsp; &nbsp; &nbsp; // get id and protect it<br />
&nbsp; &nbsp; &nbsp; &nbsp; $id = htmlspecialchars($_GET&#91;id&#93;);&nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; // check db<br />
&nbsp; &nbsp; &nbsp; &nbsp; $get = mysql_fetch_assoc(mysql_query(&quot;SELECT * FROM `affiliates` WHERE `id` = '$id' LIMIT 1&quot;));&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; // increment hits<br />
&nbsp; &nbsp; &nbsp; &nbsp; $insert = mysql_query(&quot;UPDATE `affiliates` SET `out` = 'out+1' WHERE `id` = '$id'&quot;);&nbsp; <br />
<br />
&nbsp; &nbsp; break;<br />
}<br />
?&gt;</code><hr />
</div>It doesn't increment 'out' at all... and if i set the value of &quot;out&quot; to something other than 0 and call it, it defaults it back to 0.<br />
<br />
What am i doing wrong? :confused:</div>

]]></content:encoded>
			<category domain="http://www.webmaster-talk.com/php-forum/">PHP Forum</category>
			<dc:creator>alexjames01</dc:creator>
			<guid isPermaLink="true">http://www.webmaster-talk.com/php-forum/191856-incrementing-a-database-value-not-working.html</guid>
		</item>
		<item>
			<title>cURL - pause transfer</title>
			<link>http://www.webmaster-talk.com/php-forum/191853-curl-pause-transfer.html</link>
			<pubDate>Tue, 17 Nov 2009 13:20:15 GMT</pubDate>
			<description><![CDATA[Hi, 
 
I have a question about downloading web page using cURL.  
I am trying to parse a web page where I found javascript  
 
<script...]]></description>
			<content:encoded><![CDATA[<div>Hi,<br />
<br />
I have a question about downloading web page using cURL. <br />
I am trying to parse a web page where I found javascript <br />
<br />
&lt;script language=javascript&gt;<br />
function updateprogress(nPercent){document.getElementById(' imgprogress').width=nPercent*3;document.getElement ById('txtprogress').innerHTML=nPercent+&quot; %&quot;;if( nPercent &lt; 100 )setTimeout( 'updateprogress('+(nPercent+1)+')', 75 );}&lt;/script&gt;<br />
<br />
&lt;script language=javascript&gt;updateprogress(1);&lt;/script&gt;<br />
<br />
When browser reads the webpage it process javascript updateprogress. <br />
This causes the transfer to be paused for some time. <br />
After that script there is a table which contains data that I want to get. <br />
<br />
When the webpafe is displayed in web browser everything is fine. <br />
But when I read it using curl (no delay in transfer) table is empty. <br />
<br />
It looks that the server is still preparing data to display and it is not ready. <br />
<br />
I have a question - is there a way to suspend curl transfer ? <br />
I already tries write callbacks - and this only pause php script not the transfer. It looks that curl is getting the data in the background and without wait in the middle the data are not ready yet. <br />
<br />
I will appriciate any sugestions. <br />
<br />
Piotr</div>

]]></content:encoded>
			<category domain="http://www.webmaster-talk.com/php-forum/">PHP Forum</category>
			<dc:creator>Piotr</dc:creator>
			<guid isPermaLink="true">http://www.webmaster-talk.com/php-forum/191853-curl-pause-transfer.html</guid>
		</item>
		<item>
			<title>Using the PHP imap() function</title>
			<link>http://www.webmaster-talk.com/php-forum/191838-using-the-php-imap-function.html</link>
			<pubDate>Tue, 17 Nov 2009 09:54:43 GMT</pubDate>
			<description><![CDATA[Ok here's what I want to do.. I want to write a script that will automatically catch all emails and auto-respond based on what is in the content of...]]></description>
			<content:encoded><![CDATA[<div>Ok here's what I want to do.. I want to write a script that will automatically catch all emails and auto-respond based on what is in the content of the email... For example I know how to create auto-responders but they send the same email everytime.. I want a script that first off checks the email account (imap()) and then responds based on the user email... eventually I would like to turn my server into a text sending server sending texts to cellphones (I can do that already) but I want it so users can send in a question from their phone and the server will answer them back correctly.<br />
<br />
Any thoughts on how to go about doing this?</div>

]]></content:encoded>
			<category domain="http://www.webmaster-talk.com/php-forum/">PHP Forum</category>
			<dc:creator>Mteigers</dc:creator>
			<guid isPermaLink="true">http://www.webmaster-talk.com/php-forum/191838-using-the-php-imap-function.html</guid>
		</item>
		<item>
			<title>Image Upload Script...</title>
			<link>http://www.webmaster-talk.com/php-forum/191818-image-upload-script.html</link>
			<pubDate>Tue, 17 Nov 2009 02:04:25 GMT</pubDate>
			<description>I am using this script to upload image to the webserver, and works fine, but how can I store the images uploaded from this script into the db? I...</description>
			<content:encoded><![CDATA[<div>I am using this script to upload image to the webserver, and works fine, but how can I store the images uploaded from this script into the db? I would like to echo the image back to the webpage from the database.<br />
<br />
Sorry for posting this as I should be able to do this by now, but I have been away from db development for quite some time, so my memory has failed me in the trying attempt. :(<br />
<br />
Thanks alot!<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
	<div class="alt2">
		<hr />
		<code style="white-space:nowrap">
		<div dir="ltr" style="text-align:left;">
			<!-- php buffer start --><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">//define&nbsp;a&nbsp;maxim&nbsp;size&nbsp;for&nbsp;the&nbsp;uploaded&nbsp;images&nbsp;in&nbsp;Kb<br />&nbsp;</span><span style="color: #0000BB">define&nbsp;</span><span style="color: #007700">(</span><span style="color: #DD0000">"MAX_SIZE"</span><span style="color: #007700">,</span><span style="color: #DD0000">"100"</span><span style="color: #007700">);&nbsp;<br /><br /></span><span style="color: #FF8000">//This&nbsp;function&nbsp;reads&nbsp;the&nbsp;extension&nbsp;of&nbsp;the&nbsp;file.&nbsp;It&nbsp;is&nbsp;used&nbsp;to&nbsp;determine&nbsp;if&nbsp;the&nbsp;file&nbsp;&nbsp;is&nbsp;an&nbsp;image&nbsp;by&nbsp;checking&nbsp;the&nbsp;extension.<br />&nbsp;</span><span style="color: #007700">function&nbsp;</span><span style="color: #0000BB">getExtension</span><span style="color: #007700">(</span><span style="color: #0000BB">$str</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$i&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">strrpos</span><span style="color: #007700">(</span><span style="color: #0000BB">$str</span><span style="color: #007700">,</span><span style="color: #DD0000">"."</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(!</span><span style="color: #0000BB">$i</span><span style="color: #007700">)&nbsp;{&nbsp;return&nbsp;</span><span style="color: #DD0000">""</span><span style="color: #007700">;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$l&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">strlen</span><span style="color: #007700">(</span><span style="color: #0000BB">$str</span><span style="color: #007700">)&nbsp;-&nbsp;</span><span style="color: #0000BB">$i</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$ext&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">substr</span><span style="color: #007700">(</span><span style="color: #0000BB">$str</span><span style="color: #007700">,</span><span style="color: #0000BB">$i</span><span style="color: #007700">+</span><span style="color: #0000BB">1</span><span style="color: #007700">,</span><span style="color: #0000BB">$l</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;</span><span style="color: #0000BB">$ext</span><span style="color: #007700">;<br />&nbsp;}<br /><br /></span><span style="color: #FF8000">//This&nbsp;variable&nbsp;is&nbsp;used&nbsp;as&nbsp;a&nbsp;flag.&nbsp;The&nbsp;value&nbsp;is&nbsp;initialized&nbsp;with&nbsp;0&nbsp;(meaning&nbsp;no&nbsp;error&nbsp;&nbsp;found)&nbsp;&nbsp;<br />//and&nbsp;it&nbsp;will&nbsp;be&nbsp;changed&nbsp;to&nbsp;1&nbsp;if&nbsp;an&nbsp;errro&nbsp;occures.&nbsp;&nbsp;<br />//If&nbsp;the&nbsp;error&nbsp;occures&nbsp;the&nbsp;file&nbsp;will&nbsp;not&nbsp;be&nbsp;uploaded.<br />&nbsp;</span><span style="color: #0000BB">$errors</span><span style="color: #007700">=</span><span style="color: #0000BB">0</span><span style="color: #007700">;<br /></span><span style="color: #FF8000">//checks&nbsp;if&nbsp;the&nbsp;form&nbsp;has&nbsp;been&nbsp;submitted<br />&nbsp;</span><span style="color: #007700">if(isset(</span><span style="color: #0000BB">$_POST</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'Submit'</span><span style="color: #007700">&#93;))&nbsp;<br />&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//reads&nbsp;the&nbsp;name&nbsp;of&nbsp;the&nbsp;file&nbsp;the&nbsp;user&nbsp;submitted&nbsp;for&nbsp;uploading<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$image</span><span style="color: #007700">=</span><span style="color: #0000BB">$_FILES</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'image'</span><span style="color: #007700">&#93;&#91;</span><span style="color: #DD0000">'name'</span><span style="color: #007700">&#93;;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//if&nbsp;it&nbsp;is&nbsp;not&nbsp;empty<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">if&nbsp;(</span><span style="color: #0000BB">$image</span><span style="color: #007700">)&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//get&nbsp;the&nbsp;original&nbsp;name&nbsp;of&nbsp;the&nbsp;file&nbsp;from&nbsp;the&nbsp;clients&nbsp;machine<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$filename&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">stripslashes</span><span style="color: #007700">(</span><span style="color: #0000BB">$_FILES</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'image'</span><span style="color: #007700">&#93;&#91;</span><span style="color: #DD0000">'name'</span><span style="color: #007700">&#93;);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//get&nbsp;the&nbsp;extension&nbsp;of&nbsp;the&nbsp;file&nbsp;in&nbsp;a&nbsp;lower&nbsp;case&nbsp;format<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$extension&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">getExtension</span><span style="color: #007700">(</span><span style="color: #0000BB">$filename</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$extension&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">strtolower</span><span style="color: #007700">(</span><span style="color: #0000BB">$extension</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//if&nbsp;it&nbsp;is&nbsp;not&nbsp;a&nbsp;known&nbsp;extension,&nbsp;we&nbsp;will&nbsp;suppose&nbsp;it&nbsp;is&nbsp;an&nbsp;error&nbsp;and&nbsp;will&nbsp;not&nbsp;&nbsp;upload&nbsp;the&nbsp;file,&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;//otherwise&nbsp;we&nbsp;will&nbsp;do&nbsp;more&nbsp;tests<br />&nbsp;</span><span style="color: #007700">if&nbsp;((</span><span style="color: #0000BB">$extension&nbsp;</span><span style="color: #007700">!=&nbsp;</span><span style="color: #DD0000">"jpg"</span><span style="color: #007700">)&nbsp;&amp;&amp;&nbsp;(</span><span style="color: #0000BB">$extension&nbsp;</span><span style="color: #007700">!=&nbsp;</span><span style="color: #DD0000">"jpeg"</span><span style="color: #007700">)&nbsp;&amp;&amp;&nbsp;(</span><span style="color: #0000BB">$extension&nbsp;</span><span style="color: #007700">!=&nbsp;</span><span style="color: #DD0000">"png"</span><span style="color: #007700">)&nbsp;&amp;&amp;&nbsp;(</span><span style="color: #0000BB">$extension&nbsp;</span><span style="color: #007700">!=&nbsp;</span><span style="color: #DD0000">"gif"</span><span style="color: #007700">))&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//print&nbsp;error&nbsp;message<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">echo&nbsp;</span><span style="color: #DD0000">'&lt;h1&gt;Unknown&nbsp;extension!&lt;/h1&gt;'</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$errors</span><span style="color: #007700">=</span><span style="color: #0000BB">1</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br /></span><span style="color: #FF8000">//get&nbsp;the&nbsp;size&nbsp;of&nbsp;the&nbsp;image&nbsp;in&nbsp;bytes<br />&nbsp;//$_FILES&#91;'image'&#93;&#91;'tmp_name'&#93;&nbsp;is&nbsp;the&nbsp;temporary&nbsp;filename&nbsp;of&nbsp;the&nbsp;file<br />&nbsp;//in&nbsp;which&nbsp;the&nbsp;uploaded&nbsp;file&nbsp;was&nbsp;stored&nbsp;on&nbsp;the&nbsp;server<br />&nbsp;</span><span style="color: #0000BB">$size</span><span style="color: #007700">=</span><span style="color: #0000BB">filesize</span><span style="color: #007700">(</span><span style="color: #0000BB">$_FILES</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'image'</span><span style="color: #007700">&#93;&#91;</span><span style="color: #DD0000">'tmp_name'</span><span style="color: #007700">&#93;);<br /><br /></span><span style="color: #FF8000">//compare&nbsp;the&nbsp;size&nbsp;with&nbsp;the&nbsp;maxim&nbsp;size&nbsp;we&nbsp;defined&nbsp;and&nbsp;print&nbsp;error&nbsp;if&nbsp;bigger<br /></span><span style="color: #007700">if&nbsp;(</span><span style="color: #0000BB">$size&nbsp;</span><span style="color: #007700">&gt;&nbsp;</span><span style="color: #0000BB">MAX_SIZE</span><span style="color: #007700">*</span><span style="color: #0000BB">1024</span><span style="color: #007700">)<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">'&lt;h1&gt;You&nbsp;have&nbsp;exceeded&nbsp;the&nbsp;size&nbsp;limit!&lt;/h1&gt;'</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$errors</span><span style="color: #007700">=</span><span style="color: #0000BB">1</span><span style="color: #007700">;<br />}<br /><br /></span><span style="color: #FF8000">//we&nbsp;will&nbsp;give&nbsp;an&nbsp;unique&nbsp;name,&nbsp;for&nbsp;example&nbsp;the&nbsp;time&nbsp;in&nbsp;unix&nbsp;time&nbsp;format<br /></span><span style="color: #0000BB">$image_name</span><span style="color: #007700">=</span><span style="color: #0000BB">time</span><span style="color: #007700">().</span><span style="color: #DD0000">'.'</span><span style="color: #007700">.</span><span style="color: #0000BB">$extension</span><span style="color: #007700">;<br /></span><span style="color: #FF8000">//the&nbsp;new&nbsp;name&nbsp;will&nbsp;be&nbsp;containing&nbsp;the&nbsp;full&nbsp;path&nbsp;where&nbsp;will&nbsp;be&nbsp;stored&nbsp;(images&nbsp;folder)<br /></span><span style="color: #0000BB">$newname</span><span style="color: #007700">=</span><span style="color: #DD0000">"http://www.webmaster-talk.com/images/"</span><span style="color: #007700">.</span><span style="color: #0000BB">$image_name</span><span style="color: #007700">;<br /></span><span style="color: #FF8000">//we&nbsp;verify&nbsp;if&nbsp;the&nbsp;image&nbsp;has&nbsp;been&nbsp;uploaded,&nbsp;and&nbsp;print&nbsp;error&nbsp;instead<br /></span><span style="color: #0000BB">$copied&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">copy</span><span style="color: #007700">(</span><span style="color: #0000BB">$_FILES</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'image'</span><span style="color: #007700">&#93;&#91;</span><span style="color: #DD0000">'tmp_name'</span><span style="color: #007700">&#93;,&nbsp;</span><span style="color: #0000BB">$newname</span><span style="color: #007700">);<br />if&nbsp;(!</span><span style="color: #0000BB">$copied</span><span style="color: #007700">)&nbsp;<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">'&lt;h1&gt;Copy&nbsp;unsuccessfull!&lt;/h1&gt;'</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$errors</span><span style="color: #007700">=</span><span style="color: #0000BB">1</span><span style="color: #007700">;<br />}}}}<br /><br /></span><span style="color: #FF8000">//If&nbsp;no&nbsp;errors&nbsp;registred,&nbsp;print&nbsp;the&nbsp;success&nbsp;message<br />&nbsp;</span><span style="color: #007700">if(isset(</span><span style="color: #0000BB">$_POST</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'Submit'</span><span style="color: #007700">&#93;)&nbsp;&amp;&amp;&nbsp;!</span><span style="color: #0000BB">$errors</span><span style="color: #007700">)&nbsp;<br />&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"&lt;h1&gt;File&nbsp;Uploaded&nbsp;Successfully!&nbsp;Try&nbsp;again!&lt;/h1&gt;"</span><span style="color: #007700">;<br />&nbsp;}<br /><br />&nbsp;</span><span style="color: #0000BB">?&gt;</span>
</span>
</code><!-- php buffer end -->
		</div>
		</code>
		<hr />
	</div>
</div><br />
And of course this to upload the files:<br />
 <br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">&lt;!--next comes the form, you must set the enctype to &quot;multipart/frm-data&quot; and use an input type &quot;file&quot; --&gt;<br />
&nbsp;&lt;form name=&quot;newad&quot; method=&quot;post&quot; enctype=&quot;multipart/form-data&quot;&nbsp; action=&quot;&quot;&gt;<br />
&nbsp;&lt;table&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp;  &lt;tr&gt;&lt;td&gt;&lt;input type=&quot;file&quot; name=&quot;image&quot;&gt;&lt;/td&gt;&lt;/tr&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp;  &lt;tr&gt;&lt;td&gt;&lt;input name=&quot;Submit&quot; type=&quot;submit&quot; value=&quot;Upload image&quot;&gt;&lt;/td&gt;&lt;/tr&gt;<br />
&nbsp;&lt;/table&gt;&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp;&lt;/form&gt;</code><hr />
</div></div>

]]></content:encoded>
			<category domain="http://www.webmaster-talk.com/php-forum/">PHP Forum</category>
			<dc:creator>Brian07002</dc:creator>
			<guid isPermaLink="true">http://www.webmaster-talk.com/php-forum/191818-image-upload-script.html</guid>
		</item>
		<item>
			<title>Convert this code into a google like pagination</title>
			<link>http://www.webmaster-talk.com/php-forum/191736-convert-code-into-google-like-pagination.html</link>
			<pubDate>Sun, 15 Nov 2009 23:50:51 GMT</pubDate>
			<description><![CDATA[I have this RSS parsing code and it paginates , but only uses 'next' and 'previous' links instead of how google does it. I want it to read like this:...]]></description>
			<content:encoded><![CDATA[<div>I have this RSS parsing code and it paginates , but only uses 'next' and 'previous' links instead of how google does it. I want it to read like this: first 1 2 3.... last<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left"><font color="#000000"><font color="#0000BB">&lt;?php<br />
</font><font color="#007700">require_once(</font><font color="#DD0000">'simplepie.inc'</font><font color="#007700">);<br />
&nbsp;<br />
</font><font color="#FF8000">// Set your own configuration options as you see fit.<br />
</font><font color="#0000BB">$feed </font><font color="#007700">= new </font><font color="#0000BB">SimplePie</font><font color="#007700">();<br />
</font><font color="#0000BB">$feed</font><font color="#007700">-&gt;</font><font color="#0000BB">set_feed_url</font><font color="#007700">(array(<br />
</font><font color="#DD0000">'http://feeds2.feedburner.com/MishsGlobalEconomicTrendAnalysis'</font><font color="#007700">,<br />
</font><font color="#DD0000">'http://feeds.feedburner.com/TheBigPicture'</font><font color="#007700">,<br />
</font><font color="#DD0000">'http://feeds2.feedburner.com/ChartsAndCoffee'</font><font color="#007700">,<br />
&nbsp; &nbsp; &nbsp; &nbsp; </font><font color="#DD0000">'http://feeds.feedburner.com/typepad/tradeblogs/the_slope_of_hope_with_ti'</font><font color="#007700">,<br />
));<br />
</font><font color="#0000BB">$success </font><font color="#007700">= </font><font color="#0000BB">$feed</font><font color="#007700">-&gt;</font><font color="#0000BB">init</font><font color="#007700">();<br />
<br />
<br />
<br />
</font><font color="#FF8000">// Make sure the page is being served with the right headers.<br />
</font><font color="#0000BB">$feed</font><font color="#007700">-&gt;</font><font color="#0000BB">handle_content_type</font><font color="#007700">();<br />
&nbsp;<br />
</font><font color="#FF8000">// Set our paging values<br />
</font><font color="#0000BB">$start </font><font color="#007700">= (isset(</font><font color="#0000BB">$_GET</font><font color="#007700">[</font><font color="#DD0000">'start'</font><font color="#007700">]) &amp;&amp; !empty(</font><font color="#0000BB">$_GET</font><font color="#007700">[</font><font color="#DD0000">'start'</font><font color="#007700">])) ? </font><font color="#0000BB">$_GET</font><font color="#007700">[</font><font color="#DD0000">'start'</font><font color="#007700">] : </font><font color="#0000BB">0</font><font color="#007700">; </font><font color="#FF8000">// Where do we start?<br />
</font><font color="#0000BB">$length </font><font color="#007700">= (isset(</font><font color="#0000BB">$_GET</font><font color="#007700">[</font><font color="#DD0000">'length'</font><font color="#007700">]) &amp;&amp; !empty(</font><font color="#0000BB">$_GET</font><font color="#007700">[</font><font color="#DD0000">'length'</font><font color="#007700">])) ? </font><font color="#0000BB">$_GET</font><font color="#007700">[</font><font color="#DD0000">'length'</font><font color="#007700">] : </font><font color="#0000BB">5</font><font color="#007700">; </font><font color="#FF8000">// How many per page?<br />
</font><font color="#0000BB">$max </font><font color="#007700">= </font><font color="#0000BB">$feed</font><font color="#007700">-&gt;</font><font color="#0000BB">get_item_quantity</font><font color="#007700">(); </font><font color="#FF8000">// Where do we end?<br />
&nbsp;<br />
// When we end our PHP block, we want to make sure our DOCTYPE is on the top line to make <br />
// sure that the browser snaps into Standards Mode.<br />
</font><font color="#0000BB">?&gt;</font></font>&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 />
&nbsp;<br />
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xml:lang=&quot;en-US&quot; lang=&quot;en-US&quot;&gt;<br />
&lt;head&gt;<br />
&lt;title&gt;SimplePie: Demo&lt;/title&gt;<br />
&nbsp;<br />
&lt;link rel=&quot;stylesheet&quot; href=&quot;styles.css&quot; type=&quot;text/css&quot; media=&quot;screen, projector&quot; /&gt;<br />
&nbsp;<br />
&lt;/head&gt;<br />
&nbsp;<br />
&lt;body&gt;<br />
&lt;div id=&quot;site&quot;&gt;<br />
&nbsp;  <font color="#000000"><font color="#0000BB">&lt;?php<br />
&nbsp;  </font><font color="#FF8000">// If we have an error, display it.<br />
</font><font color="#0000BB">&nbsp;  if (</font><font color="#0000BB">$feed</font><font color="#007700">-&gt;</font><font color="#0000BB">error</font><font color="#007700">())<br />
</font><font color="#0000BB">&nbsp;  {<br />
</font><font color="#0000BB">&nbsp;  echo </font><font color="#DD0000">'&lt;div class=&quot;sp_errors&quot;&gt;' </font><font color="#007700">. </font><font color="#DD0000">&quot;\r\n&quot;</font><font color="#007700">;<br />
</font><font color="#0000BB">&nbsp;  echo </font><font color="#DD0000">'&lt;p&gt;' </font><font color="#007700">. </font><font color="#0000BB">htmlspecialchars</font><font color="#007700">(</font><font color="#0000BB">$feed</font><font color="#007700">-&gt;</font><font color="#0000BB">error</font><font color="#007700">()) . </font><font color="#DD0000">&quot;&lt;/p&gt;\r\n&quot;</font><font color="#007700">;<br />
</font><font color="#0000BB">&nbsp;  echo </font><font color="#DD0000">'&lt;/div&gt;' </font><font color="#007700">. </font><font color="#DD0000">&quot;\r\n&quot;</font><font color="#007700">;<br />
</font><font color="#0000BB">&nbsp;  }<br />
</font><font color="#0000BB">?&gt;</font></font><br />
&nbsp;<br />
&nbsp;  <font color="#000000"><font color="#0000BB">&lt;?php </font><font color="#007700">if (</font><font color="#0000BB">$success</font><font color="#007700">): </font><font color="#0000BB">?&gt;</font></font><br />
&nbsp; &nbsp; &nbsp; <font color="#000000"><font color="#0000BB">&lt;?php<br />
&nbsp;  </font><font color="#FF8000">// get_items() will accept values from above.<br />
</font><font color="#0000BB">&nbsp;  foreach(</font><font color="#0000BB">$feed</font><font color="#007700">-&gt;</font><font color="#0000BB">get_items</font><font color="#007700">(</font><font color="#0000BB">$start</font><font color="#007700">, </font><font color="#0000BB">$length</font><font color="#007700">) as </font><font color="#0000BB">$item</font><font color="#007700">):<br />
</font><font color="#0000BB">$feed </font><font color="#007700">= </font><font color="#0000BB">$item</font><font color="#007700">-&gt;</font><font color="#0000BB">get_feed</font><font color="#007700">();<br />
</font><font color="#0000BB">?&gt;</font></font><br />
&nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp;  &lt;div class=&quot;chunk&quot;&gt;<br />
&nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;h4&gt;<font color="#000000"><font color="#0000BB">&lt;?php </font><font color="#007700">if (</font><font color="#0000BB">$item</font><font color="#007700">-&gt;</font><font color="#0000BB">get_permalink</font><font color="#007700">()) echo </font><font color="#DD0000">'&lt;a href=&quot;' </font><font color="#007700">. </font><font color="#0000BB">$item</font><font color="#007700">-&gt;</font><font color="#0000BB">get_permalink</font><font color="#007700">() . </font><font color="#DD0000">'&quot;&gt;'</font><font color="#007700">; echo </font><font color="#0000BB">$item</font><font color="#007700">-&gt;</font><font color="#0000BB">get_title</font><font color="#007700">(</font><font color="#0000BB">true</font><font color="#007700">); if (</font><font color="#0000BB">$item</font><font color="#007700">-&gt;</font><font color="#0000BB">get_permalink</font><font color="#007700">()) echo </font><font color="#DD0000">'&lt;/a&gt;'</font><font color="#007700">; </font><font color="#0000BB">?&gt;</font></font>&lt;/h4&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;p class=&quot;footnote&quot;&gt;Source: &lt;a href=&quot;<font color="#000000"><font color="#0000BB">&lt;?php </font><font color="#007700">echo </font><font color="#0000BB">$feed</font><font color="#007700">-&gt;</font><font color="#0000BB">get_permalink</font><font color="#007700">(); </font><font color="#0000BB">?&gt;</font></font>&quot;&gt;<font color="#000000"><font color="#0000BB">&lt;?php </font><font color="#007700">echo </font><font color="#0000BB">$feed</font><font color="#007700">-&gt;</font><font color="#0000BB">get_title</font><font color="#007700">(); </font><font color="#0000BB">?&gt;</font></font>&lt;/a&gt; | &lt;?putenv(&quot;TZ=US/Pacific&quot;); echo $item-&gt;get_date('j M Y | g:i a'); ?&gt;&lt;/p&gt;<br />
&nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp;  &lt;/div&gt;<br />
&nbsp;<br />
&nbsp; &nbsp; &nbsp; <font color="#000000"><font color="#0000BB">&lt;?php </font><font color="#007700">endforeach; </font><font color="#0000BB">?&gt;</font></font><br />
&nbsp;  <font color="#000000"><font color="#0000BB">&lt;?php </font><font color="#007700">endif; </font><font color="#0000BB">?&gt;</font></font><br />
&nbsp;<br />
&nbsp;  <font color="#000000"><font color="#0000BB">&lt;?php<br />
&nbsp;  </font><font color="#FF8000">// Let's do our paging controls<br />
</font><font color="#0000BB">$next </font><font color="#007700">= (int) </font><font color="#0000BB">$start </font><font color="#007700">+ (int) </font><font color="#0000BB">$length</font><font color="#007700">;<br />
</font><font color="#0000BB">$prev </font><font color="#007700">= (int) </font><font color="#0000BB">$start </font><font color="#007700">- (int) </font><font color="#0000BB">$length</font><font color="#007700">;<br />
&nbsp;<br />
</font><font color="#FF8000">// Create the NEXT link<br />
</font><font color="#0000BB">$nextlink </font><font color="#007700">= </font><font color="#DD0000">'&lt;a href=&quot;?start=' </font><font color="#007700">. </font><font color="#0000BB">$next </font><font color="#007700">. </font><font color="#DD0000">'&amp;length=' </font><font color="#007700">. </font><font color="#0000BB">$length </font><font color="#007700">. </font><font color="#DD0000">'&quot;&gt;Next &amp;raquo;&lt;/a&gt;'</font><font color="#007700">;<br />
</font><font color="#0000BB">&nbsp;  if (</font><font color="#0000BB">$next </font><font color="#007700">&gt; </font><font color="#0000BB">$max</font><font color="#007700">)<br />
</font><font color="#0000BB">&nbsp;  {<br />
</font><font color="#0000BB">$nextlink </font><font color="#007700">= </font><font color="#DD0000">'Next &amp;raquo;'</font><font color="#007700">;<br />
</font><font color="#0000BB">&nbsp;  }<br />
&nbsp;<br />
</font><font color="#FF8000">// Create the PREVIOUS link<br />
</font><font color="#0000BB">$prevlink </font><font color="#007700">= </font><font color="#DD0000">'&lt;a href=&quot;?start=' </font><font color="#007700">. </font><font color="#0000BB">$prev </font><font color="#007700">. </font><font color="#DD0000">'&amp;length=' </font><font color="#007700">. </font><font color="#0000BB">$length </font><font color="#007700">. </font><font color="#DD0000">'&quot;&gt;&amp;laquo; Previous&lt;/a&gt;'</font><font color="#007700">;<br />
</font><font color="#0000BB">&nbsp;  if (</font><font color="#0000BB">$prev </font><font color="#007700">&lt; </font><font color="#0000BB">0 </font><font color="#007700">&amp;&amp; (int) </font><font color="#0000BB">$start </font><font color="#007700">&gt; </font><font color="#0000BB">0</font><font color="#007700">)<br />
</font><font color="#0000BB">&nbsp;  {<br />
</font><font color="#0000BB">$prevlink </font><font color="#007700">= </font><font color="#DD0000">'&lt;a href=&quot;?start=0&amp;length=' </font><font color="#007700">. </font><font color="#0000BB">$length </font><font color="#007700">. </font><font color="#DD0000">'&quot;&gt;&amp;laquo; Previous&lt;/a&gt;'</font><font color="#007700">;<br />
</font><font color="#0000BB">&nbsp;  }<br />
</font><font color="#0000BB">&nbsp;  else if (</font><font color="#0000BB">$prev </font><font color="#007700">&lt; </font><font color="#0000BB">0</font><font color="#007700">)<br />
</font><font color="#0000BB">&nbsp;  {<br />
</font><font color="#0000BB">$prevlink </font><font color="#007700">= </font><font color="#DD0000">'&amp;laquo; Previous'</font><font color="#007700">;<br />
</font><font color="#0000BB">&nbsp;  }<br />
&nbsp;<br />
</font><font color="#FF8000">// Normalize the numbering for humans<br />
</font><font color="#0000BB">$begin </font><font color="#007700">= (int) </font><font color="#0000BB">$start </font><font color="#007700">+ </font><font color="#0000BB">1</font><font color="#007700">;<br />
</font><font color="#0000BB">$end </font><font color="#007700">= (</font><font color="#0000BB">$next </font><font color="#007700">&gt; </font><font color="#0000BB">$max</font><font color="#007700">) ? </font><font color="#0000BB">$max </font><font color="#007700">: </font><font color="#0000BB">$next</font><font color="#007700">;<br />
</font><font color="#0000BB">?&gt;</font></font><br />
&nbsp;<br />
&nbsp;  &lt;p&gt;Showing <font color="#000000"><font color="#0000BB">&lt;?php </font><font color="#007700">echo </font><font color="#0000BB">$begin</font><font color="#007700">; </font><font color="#0000BB">?&gt;</font></font>&amp;ndash;<font color="#000000"><font color="#0000BB">&lt;?php </font><font color="#007700">echo </font><font color="#0000BB">$end</font><font color="#007700">; </font><font color="#0000BB">?&gt;</font></font> out of <font color="#000000"><font color="#0000BB">&lt;?php </font><font color="#007700">echo </font><font color="#0000BB">$max</font><font color="#007700">; </font><font color="#0000BB">?&gt;</font></font> | <font color="#000000"><font color="#0000BB">&lt;?php </font><font color="#007700">echo </font><font color="#0000BB">$prevlink</font><font color="#007700">; </font><font color="#0000BB">?&gt;</font></font> | <font color="#000000"><font color="#0000BB">&lt;?php </font><font color="#007700">echo </font><font color="#0000BB">$nextlink</font><font color="#007700">; </font><font color="#0000BB">?&gt;</font></font> | &lt;a href=&quot;<font color="#000000"><font color="#0000BB">&lt;?php </font><font color="#007700">echo </font><font color="#DD0000">'?start=' </font><font color="#007700">. </font><font color="#0000BB">$start </font><font color="#007700">. </font><font color="#DD0000">'&amp;length=5'</font><font color="#007700">; </font><font color="#0000BB">?&gt;</font></font>&quot;&gt;5&lt;/a&gt;, &lt;a href=&quot;<font color="#000000"><font color="#0000BB">&lt;?php </font><font color="#007700">echo </font><font color="#DD0000">'?start=' </font><font color="#007700">. </font><font color="#0000BB">$start </font><font color="#007700">. </font><font color="#DD0000">'&amp;length=10'</font><font color="#007700">; </font><font color="#0000BB">?&gt;</font></font>&quot;&gt;10&lt;/a&gt;, or &lt;a href=&quot;<font color="#000000"><font color="#0000BB">&lt;?php </font><font color="#007700">echo </font><font color="#DD0000">'?start=' </font><font color="#007700">. </font><font color="#0000BB">$start </font><font color="#007700">. </font><font color="#DD0000">'&amp;length=20'</font><font color="#007700">; </font><font color="#0000BB">?&gt;</font></font>&quot;&gt;20&lt;/a&gt; at a time.&lt;/p&gt;<br />
&lt;/div&gt;<br />
&nbsp;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</code><hr />
</div></div>

]]></content:encoded>
			<category domain="http://www.webmaster-talk.com/php-forum/">PHP Forum</category>
			<dc:creator>MyMarket</dc:creator>
			<guid isPermaLink="true">http://www.webmaster-talk.com/php-forum/191736-convert-code-into-google-like-pagination.html</guid>
		</item>
		<item>
			<title>string work</title>
			<link>http://www.webmaster-talk.com/php-forum/191733-string-work.html</link>
			<pubDate>Sun, 15 Nov 2009 20:07:34 GMT</pubDate>
			<description><![CDATA[I'm trying to get information from filenames. 
It loops through everything in the directory, now I just need it to chop them up. 
 
The format:...]]></description>
			<content:encoded><![CDATA[<div>I'm trying to get information from filenames.<br />
It loops through everything in the directory, now I just need it to chop them up.<br />
<br />
The format:<br />
<b>number-name.ext</b><br />
<br />
I need $number to equal everything before the first dash, and $name to equal everything after the dash until the last period. <br />
<br />
I've been trying a bunch of functions, but I can't get it quite right.<br />
<br />
current code:<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
	<div class="alt2">
		<hr />
		<code style="white-space:nowrap">
		<div dir="ltr" style="text-align:left;">
			<!-- php buffer start --><code><span style="color: #000000">
<span style="color: #0000BB">$handle&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">opendir</span><span style="color: #007700">(</span><span style="color: #DD0000">'scans/3/'</span><span style="color: #007700">);<br />while&nbsp;(</span><span style="color: #0000BB">false&nbsp;</span><span style="color: #007700">!==&nbsp;(</span><span style="color: #0000BB">$file&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">readdir</span><span style="color: #007700">(</span><span style="color: #0000BB">$handle</span><span style="color: #007700">))){<br />&nbsp;&nbsp;</span><span style="color: #0000BB">$extplace&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">strchr</span><span style="color: #007700">(</span><span style="color: #0000BB">$file</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"."</span><span style="color: #007700">);<br />&nbsp;&nbsp;</span><span style="color: #0000BB">$number&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">substr</span><span style="color: #007700">(</span><span style="color: #0000BB">$file</span><span style="color: #007700">,</span><span style="color: #0000BB">0</span><span style="color: #007700">,</span><span style="color: #0000BB">strpos</span><span style="color: #007700">(</span><span style="color: #0000BB">$file</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"-"</span><span style="color: #007700">));<br />&nbsp;&nbsp;</span><span style="color: #0000BB">$name&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">strchr</span><span style="color: #007700">(</span><span style="color: #0000BB">$file</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"-"</span><span style="color: #007700">);<br />&nbsp;&nbsp;echo&nbsp;</span><span style="color: #0000BB">$number</span><span style="color: #007700">.</span><span style="color: #DD0000">'/'</span><span style="color: #007700">.</span><span style="color: #0000BB">$name</span><span style="color: #007700">.</span><span style="color: #DD0000">'&lt;br&nbsp;/&gt;'</span><span style="color: #007700">;<br />}&nbsp;<br /></span><span style="color: #0000BB"></span>
</span>
</code><!-- php buffer end -->
		</div>
		</code>
		<hr />
	</div>
</div>Currently it get's the number correctly, I just don't know how to do the name.<br />
<br />
echo will be something like <br />
<b>10/-name.jpg<br />
<br />
<br />
EDIT:<br />
</b>nvm, I'm pretty sure this worked<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
	<div class="alt2">
		<hr />
		<code style="white-space:nowrap">
		<div dir="ltr" style="text-align:left;">
			<!-- php buffer start --><code><span style="color: #000000">
<span style="color: #0000BB">&nbsp;&nbsp;$name&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">strchr</span><span style="color: #007700">(</span><span style="color: #0000BB">$file</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"-"</span><span style="color: #007700">);<br />&nbsp;&nbsp;</span><span style="color: #0000BB">$name&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">substr</span><span style="color: #007700">(</span><span style="color: #0000BB">$name</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">1</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">strlen</span><span style="color: #007700">(</span><span style="color: #0000BB">$name</span><span style="color: #007700">)-</span><span style="color: #0000BB">5</span><span style="color: #007700">);&nbsp;<br /></span><span style="color: #0000BB"></span>
</span>
</code><!-- php buffer end -->
		</div>
		</code>
		<hr />
	</div>
</div></div>

]]></content:encoded>
			<category domain="http://www.webmaster-talk.com/php-forum/">PHP Forum</category>
			<dc:creator>Skeddles</dc:creator>
			<guid isPermaLink="true">http://www.webmaster-talk.com/php-forum/191733-string-work.html</guid>
		</item>
		<item>
			<title><![CDATA["dynamic" links]]></title>
			<link>http://www.webmaster-talk.com/php-forum/191696-dynamic-links.html</link>
			<pubDate>Sun, 15 Nov 2009 01:43:01 GMT</pubDate>
			<description><![CDATA[I would like, on my school site: http://hulk.osd.wednet.edu/~martzkc/ , to have the "Member Links" to only appear when logged in (still making...]]></description>
			<content:encoded><![CDATA[<div>I would like, on my school site: <a href="http://hulk.osd.wednet.edu/~martzkc/" target="_blank">http://hulk.osd.wednet.edu/~martzkc/</a> , to have the &quot;Member Links&quot; to only appear when logged in (still making login/reg PHP file), and then, when NOT logged in, you don't see it, you see: &quot;Log In!&quot;.<br />
<br />
EX:<br />
(LOGIN!):confused:<br />
VVVVVV | [Then when logged in, change to:]:confused:<br />
(Member Links):confused:<br />
<br />
You know what I mean?</div>

]]></content:encoded>
			<category domain="http://www.webmaster-talk.com/php-forum/">PHP Forum</category>
			<dc:creator>kcmartz</dc:creator>
			<guid isPermaLink="true">http://www.webmaster-talk.com/php-forum/191696-dynamic-links.html</guid>
		</item>
		<item>
			<title>How to calculate X days moving average.</title>
			<link>http://www.webmaster-talk.com/php-forum/191695-how-calculate-x-days-moving-average.html</link>
			<pubDate>Sun, 15 Nov 2009 01:26:27 GMT</pubDate>
			<description>Anybody knows How to easily calculate X days moving average for a 365days data.  any source available?</description>
			<content:encoded><![CDATA[<div>Anybody knows How to easily calculate X days moving average for a 365days data.  any source available?</div>

]]></content:encoded>
			<category domain="http://www.webmaster-talk.com/php-forum/">PHP Forum</category>
			<dc:creator>rcajht</dc:creator>
			<guid isPermaLink="true">http://www.webmaster-talk.com/php-forum/191695-how-calculate-x-days-moving-average.html</guid>
		</item>
		<item>
			<title>Help to sort folders alphabetically</title>
			<link>http://www.webmaster-talk.com/php-forum/191671-help-to-sort-folders-alphabetically.html</link>
			<pubDate>Sat, 14 Nov 2009 16:10:10 GMT</pubDate>
			<description><![CDATA[hi, 
in this code "Virtual Directories" and "Files" are sort alphabetically, but i don't know how to sort "Non Virtual Directories"  ??? 
Thanks for...]]></description>
			<content:encoded><![CDATA[<div>hi,<br />
in this code &quot;Virtual Directories&quot; and &quot;Files&quot; are sort alphabetically, but i don't know how to sort &quot;Non Virtual Directories&quot;  ???<br />
Thanks for your help and sorry for my bad english !<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">&nbsp; &nbsp; &nbsp; &nbsp; // For Virtual Directories<br />
&nbsp; &nbsp; &nbsp; &nbsp; if($path == '' || $path == '/'){<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $query = sprintf('select * from %spermissions inner join %sbins on %spermissions.binid=%sbins.id where userid=&quot;%s&quot; and %sbins.name =&quot;%s&quot; order by display',<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; $GLOBALS['tablePrefix'],<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; $GLOBALS['tablePrefix'],<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; $GLOBALS['tablePrefix'],<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; $GLOBALS['tablePrefix'],<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; $_SESSION['userid'],<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; $GLOBALS['tablePrefix'],<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; $_SESSION['user']);<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; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $result = mysql_query($query,$database) or die( error('Get Folder query failed') );<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; while($bins = mysql_fetch_assoc($result)) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $listing[] = array(&nbsp; displayname =&gt; $bins['display'],<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; scheme =&gt; $bins['scheme'],<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; type =&gt; &quot;directory&quot;,<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; name =&gt; $bins['name'],<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; path =&gt; '/'. $bins['name'],<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; virtual =&gt; &quot;true&quot; );<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; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $query = sprintf('select * from %spermissions inner join %sbins on %spermissions.binid=%sbins.id where userid=&quot;%s&quot; and %sbins.name !=&quot;%s&quot; order by display',<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; $GLOBALS['tablePrefix'],<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; $GLOBALS['tablePrefix'],<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; $GLOBALS['tablePrefix'],<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; $GLOBALS['tablePrefix'],<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; $_SESSION['userid'],<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; $GLOBALS['tablePrefix'],<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; $_SESSION['user']);<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; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $result = mysql_query($query, $database) or die( error('Get Folder query failed') );<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $vdcount = mysql_num_rows($result);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; switch(true) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case ($vdcount &gt;= 1):<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $virtual = &quot;closed&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case ($vdcount == 1):<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $virtual = &quot;true&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; default :<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $virtual = &quot;false&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if($vdcount &gt; 0)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; while($bins = mysql_fetch_assoc($result)){<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $listing[] = array(&nbsp; displayname =&gt; $bins['display'],<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; &nbsp; &nbsp; &nbsp; &nbsp; scheme =&gt; $bins['scheme'],<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; &nbsp; &nbsp; &nbsp; &nbsp; type =&gt; &quot;directory&quot;,<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; &nbsp; &nbsp; &nbsp; &nbsp; name =&gt; $bins['name'],<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; &nbsp; &nbsp; &nbsp; &nbsp; path =&gt; '/'. $bins['name'],<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; &nbsp; &nbsp; &nbsp; &nbsp; virtual =&gt; $virtual );<br />
&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; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo $json-&gt;encode($listing);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; exit;<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; // Non Virtual Directories<br />
&nbsp; &nbsp; &nbsp; &nbsp; if( getUserAuth('view', $path) ){<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; logAction('list',$path);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $fullpath = getUserPath($path).$path;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; databaseSync($fullpath,$path);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Directories<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (is_dir($fullpath)) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($dh = opendir($fullpath)) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  while (($file = readdir($dh)) !== false) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  if(substr($file,0,1) != '.' &amp;&amp; is_dir($fullpath . '/' . $file)) {<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; $listing[] = array( <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; type =&gt; &quot;directory&quot;, <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; name =&gt; $file, <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; path =&gt; $path .'/'. $file );<br />
&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;  closedir($dh);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else error(&quot;directory doesnt exist $fullpath&quot;);<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Files<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $query = sprintf('select *,date_format(`date`,&quot;%s&quot;) as `dateformatted` from %sfilesystem where path=&quot;%s&quot; and status=&quot;%s&quot; order by `filename',<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; $dateFormat,<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; $GLOBALS['tablePrefix'],<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; $fullpath,<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; &quot;found&quot; );<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; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $result = mysql_query($query,$database) or die( error('Get Folder query failed') );<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; while($files = mysql_fetch_assoc($result)) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $listing[] = array(&nbsp; &nbsp; &nbsp; &nbsp; type =&gt; &quot;file&quot;,<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; name =&gt; $files['filename'],<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; date =&gt; $files['dateformatted'],<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; id =&gt; $files['id'] );<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; else error(&quot;Access Denied $path&quot;);<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; echo $json-&gt;encode($listing);<br />
&nbsp; &nbsp; &nbsp; &nbsp; exit;<br />
}</code><hr />
</div></div>


	<br />
	<div style="padding:6px">

	

	

	
		<fieldset class="fieldset">
			<legend>Attached Images</legend>
			<table cellpadding="0" cellspacing="3" border="0">
			<tr>
	<td><img class="inlineimg" src="http://img.webmaster-talk.com/bluesky/vb_img/attach/jpg.gif" alt="File Type: jpg" width="16" height="16" border="0" style="vertical-align:baseline" /></td>
	<td><a href="http://www.webmaster-talk.com/attachments/php-forum/4213d1258215128-help-to-sort-folders-alphabetically-sort.jpg" target="_blank">sort.jpg</a> (14.1 KB)</td>
</tr>
			</table>
			</fieldset>
	

	

	</div>
]]></content:encoded>
			<category domain="http://www.webmaster-talk.com/php-forum/">PHP Forum</category>
			<dc:creator>100tral</dc:creator>
			<guid isPermaLink="true">http://www.webmaster-talk.com/php-forum/191671-help-to-sort-folders-alphabetically.html</guid>
		</item>
		<item>
			<title><![CDATA[Add Another PHP...  "URL Thing" To The Current One?]]></title>
			<link>http://www.webmaster-talk.com/php-forum/191618-add-another-php-url-thing-current.html</link>
			<pubDate>Fri, 13 Nov 2009 20:40:26 GMT</pubDate>
			<description><![CDATA[I don't know what they're called, but here's an example: 
 
http://www.example.com/page.php?*whatever=something*...]]></description>
			<content:encoded><![CDATA[<div>I don't know what they're called, but here's an example:<br />
<br />
<a href="http://www.example.com/page.php?whatever=something" target="_blank">http://www.example.com/page.php?<b>whatever=something</b></a><br />
<br />
The bold stuff.  Now I have a script that is on a page with the URL as:<br />
<br />
<a href="http://www.pgreviews.com/userreview.php?reviewID=2" target="_blank">http://www.pgreviews.com/userreview.php?reviewID=2</a><br />
<br />
(don't go there, it's not fully functionable yet ;))<br />
<br />
And on that page, I have a script that sets ?comments to &quot;on&quot;.<br />
So the whole URL should be:<br />
<br />
<br />
<a href="http://www.pgreviews.com/userreview.php?reviewID=2&amp;comments=on" target="_blank">http://www.pgreviews.com/userreview....=2&amp;comments=on</a><br />
<br />
Right?<br />
<br />
It doesn't work for me.<br />
<br />
It just takes me back to userreview.php?comments=on.<br />
<br />
How can I get it so that it adds it to the one already there, keeping reviewID as whatever it is?<br />
<br />
Thanks!  :)</div>

]]></content:encoded>
			<category domain="http://www.webmaster-talk.com/php-forum/">PHP Forum</category>
			<dc:creator>Physicsguy</dc:creator>
			<guid isPermaLink="true">http://www.webmaster-talk.com/php-forum/191618-add-another-php-url-thing-current.html</guid>
		</item>
		<item>
			<title>need HELP</title>
			<link>http://www.webmaster-talk.com/php-forum/191611-need-help.html</link>
			<pubDate>Fri, 13 Nov 2009 17:21:20 GMT</pubDate>
			<description><![CDATA[can anyone teach me how to do loop for the script below.. thanks in advance.. 
  
 
Code: 
--------- 
<?php 
require_once('config.php'); 
  
...]]></description>
			<content:encoded><![CDATA[<div>can anyone teach me how to do loop for the script below.. thanks in advance..<br />
 <br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">&lt;?php<br />
require_once('config.php');<br />
&nbsp;<br />
&nbsp;$aid1=$_POST['Question-1'];<br />
&nbsp;$aid2=$_POST['Question-2'];<br />
&nbsp;$aid3=$_POST['Question-3'];<br />
&nbsp;$aid4=$_POST['Question-4'];<br />
&nbsp;$aid5=$_POST['Question-5'];<br />
&nbsp;$aid6=$_POST['Question-6'];<br />
&nbsp;$aid7=$_POST['Question-7'];<br />
&nbsp;$aid8=$_POST['Question-8'];<br />
&nbsp;$aid9=$_POST['Question-9'];<br />
&nbsp;$aid10=$_POST['Question-10'];<br />
&nbsp;<br />
&nbsp;$qid1=$_POST['qid1'];<br />
&nbsp;$qid2=$_POST['qid2'];<br />
&nbsp;$qid3=$_POST['qid3'];<br />
&nbsp;$qid4=$_POST['qid4'];<br />
&nbsp;$qid5=$_POST['qid5'];<br />
&nbsp;$qid6=$_POST['qid6'];<br />
&nbsp;$qid7=$_POST['qid7'];<br />
&nbsp;$qid8=$_POST['qid8'];<br />
&nbsp;$qid9=$_POST['qid9'];<br />
&nbsp;$qid10=$_POST['qid10'];<br />
&nbsp;<br />
&nbsp;<br />
&nbsp; &nbsp; // update vote counter<br />
&nbsp;$query = &quot;UPDATE answers SET acount = acount + 1 WHERE aid = '$aid1' AND qid = '$qid1'&quot;;<br />
&nbsp; &nbsp; $result = mysql_query($query) or die(&quot;ERROR: $query. &quot;.mysql_error());<br />
&nbsp;<br />
&nbsp;$query = &quot;UPDATE answers SET acount = acount + 1 WHERE aid = '$aid2' AND qid = '$qid2'&quot;;<br />
&nbsp; &nbsp; $result = mysql_query($query) or die(&quot;ERROR: $query. &quot;.mysql_error());<br />
&nbsp;<br />
&nbsp;$query = &quot;UPDATE answers SET acount = acount + 1 WHERE aid = '$aid3' AND qid = '$qid3'&quot;;<br />
&nbsp; &nbsp; $result = mysql_query($query) or die(&quot;ERROR: $query. &quot;.mysql_error());<br />
&nbsp;<br />
&nbsp;$query = &quot;UPDATE answers SET acount = acount + 1 WHERE aid = '$aid4' AND qid = '$qid4'&quot;;<br />
&nbsp; &nbsp; $result = mysql_query($query) or die(&quot;ERROR: $query. &quot;.mysql_error());<br />
&nbsp;<br />
&nbsp;$query = &quot;UPDATE answers SET acount = acount + 1 WHERE aid = '$aid5' AND qid = '$qid5'&quot;;<br />
&nbsp; &nbsp; $result = mysql_query($query) or die(&quot;ERROR: $query. &quot;.mysql_error());<br />
&nbsp;<br />
&nbsp;$query = &quot;UPDATE answers SET acount = acount + 1 WHERE aid = '$aid6' AND qid = '$qid6'&quot;;<br />
&nbsp; &nbsp; $result = mysql_query($query) or die(&quot;ERROR: $query. &quot;.mysql_error());<br />
&nbsp;<br />
&nbsp;$query = &quot;UPDATE answers SET acount = acount + 1 WHERE aid = '$aid7' AND qid = '$qid7'&quot;;<br />
&nbsp; &nbsp; $result = mysql_query($query) or die(&quot;ERROR: $query. &quot;.mysql_error());<br />
&nbsp;<br />
&nbsp;$query = &quot;UPDATE answers SET acount = acount + 1 WHERE aid = '$aid8' AND qid = '$qid8'&quot;;<br />
&nbsp; &nbsp; $result = mysql_query($query) or die(&quot;ERROR: $query. &quot;.mysql_error());<br />
&nbsp;<br />
&nbsp;$query = &quot;UPDATE answers SET acount = acount + 1 WHERE aid = '$aid9' AND qid = '$qid9'&quot;;<br />
&nbsp; &nbsp; $result = mysql_query($query) or die(&quot;ERROR: $query. &quot;.mysql_error());<br />
&nbsp;<br />
&nbsp;$query = &quot;UPDATE answers SET acount = acount + 1 WHERE aid = '$aid10' AND qid = '$qid10'&quot;;<br />
&nbsp; &nbsp; $result = mysql_query($query) or die(&quot;ERROR: $query. &quot;.mysql_error());<br />
&nbsp;<br />
&nbsp; &nbsp; // close connection<br />
&nbsp; &nbsp; mysql_close();<br />
?&gt;</code><hr />
</div></div>

]]></content:encoded>
			<category domain="http://www.webmaster-talk.com/php-forum/">PHP Forum</category>
			<dc:creator>wayz1229</dc:creator>
			<guid isPermaLink="true">http://www.webmaster-talk.com/php-forum/191611-need-help.html</guid>
		</item>
		<item>
			<title>Is it possible to auto-direct users to a page depending on their geographic location?</title>
			<link>http://www.webmaster-talk.com/php-forum/191601-possible-auto-direct-users-page-depending.html</link>
			<pubDate>Fri, 13 Nov 2009 14:53:49 GMT</pubDate>
			<description>Hey guys, I’m taking care of a website for a  company that has locations in two general locations (The Philadelphia/NJ area and the DC/VA/MD area) I...</description>
			<content:encoded><![CDATA[<div>Hey guys, I’m taking care of a website for a  company that has locations in two general locations (The Philadelphia/NJ area and the DC/VA/MD area) I would like it so when the user clicks “Sales &amp; Events” they are directed to the sales &amp; events at the location they are closest to (Either the Philly/NJ or the DC,VA,MD area) Is there any way to effectively do this or will I need to create some type of gateway page so they can choose their location? I’m sorry if this is not in the right part of the Forum but if this is possible, I don’t know what type of scripting would be used… Thanks for any and all help!<br />
<br />
<br />
Jon</div>

]]></content:encoded>
			<category domain="http://www.webmaster-talk.com/php-forum/">PHP Forum</category>
			<dc:creator>jpf566</dc:creator>
			<guid isPermaLink="true">http://www.webmaster-talk.com/php-forum/191601-possible-auto-direct-users-page-depending.html</guid>
		</item>
		<item>
			<title>Select based on radius help</title>
			<link>http://www.webmaster-talk.com/php-forum/191554-select-based-on-radius-help.html</link>
			<pubDate>Fri, 13 Nov 2009 00:50:12 GMT</pubDate>
			<description>Please help.  I am trying to select records from a MySQL database table based on a radius.  Users enter an address and a radius in a form and are...</description>
			<content:encoded><![CDATA[<div>Please help.  I am trying to select records from a MySQL database table based on a radius.  Users enter an address and a radius in a form and are received in $_POST.  I can successfully determine the latitude and longitude of the submitted address.  The variables are $lat1 and $long1, and the radius is $radius.   The database table has columns named &quot;lat&quot; and &quot;long&quot; for the latitude and longitude of each record.  I can calculate the distance between to sets of latitudes and longitudes successfully using the code below.   <br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
	<div class="alt2">
		<hr />
		<code style="white-space:nowrap">
		<div dir="ltr" style="text-align:left;">
			<!-- php buffer start --><code><span style="color: #000000">
<span style="color: #0000BB">$distance&nbsp;</span><span style="color: #007700">=&nbsp;(</span><span style="color: #0000BB">3958</span><span style="color: #007700">*</span><span style="color: #0000BB">3.1415926</span><span style="color: #007700">*</span><span style="color: #0000BB">sqrt</span><span style="color: #007700">((</span><span style="color: #DD0000">'$lat1'</span><span style="color: #007700">-</span><span style="color: #0000BB">lat</span><span style="color: #007700">)*(</span><span style="color: #DD0000">'$lat1'</span><span style="color: #007700">-</span><span style="color: #0000BB">lat</span><span style="color: #007700">)&nbsp;+&nbsp;</span><span style="color: #0000BB">cos</span><span style="color: #007700">(</span><span style="color: #DD0000">'$lat1'</span><span style="color: #007700">/</span><span style="color: #0000BB">57.29578</span><span style="color: #007700">)*</span><span style="color: #0000BB">cos</span><span style="color: #007700">(</span><span style="color: #0000BB">lat</span><span style="color: #007700">/</span><span style="color: #0000BB">57.29578</span><span style="color: #007700">)*(</span><span style="color: #DD0000">'$long1'</span><span style="color: #007700">-</span><span style="color: #0000BB">long</span><span style="color: #007700">)*(</span><span style="color: #DD0000">'$long1'</span><span style="color: #007700">-</span><span style="color: #0000BB">long</span><span style="color: #007700">))/</span><span style="color: #0000BB">180</span><span style="color: #007700">)&nbsp;<br /></span><span style="color: #0000BB"></span>
</span>
</code><!-- php buffer end -->
		</div>
		</code>
		<hr />
	</div>
</div>My existing code below works:<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
	<div class="alt2">
		<hr />
		<code style="white-space:nowrap">
		<div dir="ltr" style="text-align:left;">
			<!-- php buffer start --><code><span style="color: #000000">
<span style="color: #0000BB">$resultsrchdate&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"SELECT&nbsp;date&nbsp;FROM&nbsp;wamuexp&nbsp;where&nbsp;date&nbsp;&gt;=&nbsp;'$date1'&nbsp;&amp;&amp;&nbsp;date&nbsp;&lt;=&nbsp;'$date2'&nbsp;&amp;&amp;&nbsp;state&nbsp;=&nbsp;'$selectstate'&nbsp;"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$sql_resultsdate&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">mysql_query</span><span style="color: #007700">(</span><span style="color: #0000BB">$resultsrchdate</span><span style="color: #007700">,</span><span style="color: #0000BB">$dbc</span><span style="color: #007700">);&nbsp;<br /></span><span style="color: #0000BB"></span>
</span>
</code><!-- php buffer end -->
		</div>
		</code>
		<hr />
	</div>
</div>What I need to do is somehow incorporate the formula for calculating distance into the SELECT statement of my existing code, or a loop might be needed, so only records that are less than or equal to the radius are returned.  Thanks in advance.</div>

]]></content:encoded>
			<category domain="http://www.webmaster-talk.com/php-forum/">PHP Forum</category>
			<dc:creator>gdaniels</dc:creator>
			<guid isPermaLink="true">http://www.webmaster-talk.com/php-forum/191554-select-based-on-radius-help.html</guid>
		</item>
		<item>
			<title>307 Redirects</title>
			<link>http://www.webmaster-talk.com/php-forum/191552-307-redirects.html</link>
			<pubDate>Thu, 12 Nov 2009 23:36:11 GMT</pubDate>
			<description><![CDATA[You've all heard of 301 and 302 redirects, but have you ever heard of a 307?  I hadn't until today: Cross Domain Post Redirects...]]></description>
			<content:encoded><![CDATA[<div>You've all heard of 301 and 302 redirects, but have you ever heard of a 307?  I hadn't until today: <a href="http://ilia.ws/archives/152-Cross-Domain-POST-Redirection.html" target="_blank">Cross Domain Post Redirects</a>.<br />
<br />
I stumbled on this today when reading headers and session security, though it is only indirectly related to security.</div>

]]></content:encoded>
			<category domain="http://www.webmaster-talk.com/php-forum/">PHP Forum</category>
			<dc:creator>wayfarer07</dc:creator>
			<guid isPermaLink="true">http://www.webmaster-talk.com/php-forum/191552-307-redirects.html</guid>
		</item>
		<item>
			<title>code to display only certain things from mysql</title>
			<link>http://www.webmaster-talk.com/php-forum/191539-code-display-only-certain-things-mysql.html</link>
			<pubDate>Thu, 12 Nov 2009 18:32:48 GMT</pubDate>
			<description><![CDATA[Hey everyone, 
 
I'm new to the forum (as well as php), and I'm looking for a bit of help on a blog-like solution I'm trying to build up. On my front...]]></description>
			<content:encoded><![CDATA[<div>Hey everyone,<br />
<br />
I'm new to the forum (as well as php), and I'm looking for a bit of help on a blog-like solution I'm trying to build up. On my front page I have three columns (technology, music, and movies) and I would like to have the php pull the content out of the mysql database and display it on my website.. Which I've been able to successfully do. <br />
<br />
However I have a field in my mysql database called disclude_categories which is numeric and what I would like to have is when it is set to 1 it doesn't show up on my front page. I thought that maybe I could include it on my while loop, but can't seem to get it to work.<br />
<br />
Here's the code that I have so far:<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">mysql_connect($host,$user,$pass) or die(&quot;ERROR:&quot;.mysql_error());<br />
mysql_select_db($database) or die(&quot;ERROR DB:&quot;.mysql_error());<br />
$query = &quot;select * from blog WHERE categories='Technology' ORDER BY date DESC&quot;;<br />
$result = mysql_query($query) or die(mysql_error());<br />
while ($row = mysql_fetch_assoc($result)) {&nbsp; &nbsp; &nbsp; &nbsp;  <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo $row['content'];&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; }</code><hr />
</div></div>

]]></content:encoded>
			<category domain="http://www.webmaster-talk.com/php-forum/">PHP Forum</category>
			<dc:creator>bswinnerton</dc:creator>
			<guid isPermaLink="true">http://www.webmaster-talk.com/php-forum/191539-code-display-only-certain-things-mysql.html</guid>
		</item>
		<item>
			<title>Need advice for building a script...</title>
			<link>http://www.webmaster-talk.com/php-forum/191530-need-advice-for-building-a-script.html</link>
			<pubDate>Thu, 12 Nov 2009 15:13:54 GMT</pubDate>
			<description><![CDATA[Alright, I have a client who needs a website that allows users to get a unique URL where they can "login" (it would be better if they didnt have to...]]></description>
			<content:encoded><![CDATA[<div>Alright, I have a client who needs a website that allows users to get a unique URL where they can &quot;login&quot; (it would be better if they didnt have to actually login and just be &quot;logged in&quot; by going to the URL) and see certain stats. The stats will be who they have referred to sign up. They want to be able to allow the user to track everyone they signed up.<br />
<br />
Pretty much like an affiliate program but without any money involved (it's for a cause).<br />
<br />
They also want to do some other things like integrate googlemaps and so on.<br />
<br />
My question is, is there a script out there or a tutorial out there to help me get a jump start on this? I'm not advanced in php and this thing doesn't have to be too extensive. I just need the above functionality.</div>

]]></content:encoded>
			<category domain="http://www.webmaster-talk.com/php-forum/">PHP Forum</category>
			<dc:creator>alexjames01</dc:creator>
			<guid isPermaLink="true">http://www.webmaster-talk.com/php-forum/191530-need-advice-for-building-a-script.html</guid>
		</item>
		<item>
			<title>What script to make</title>
			<link>http://www.webmaster-talk.com/php-forum/191483-what-script-to-make.html</link>
			<pubDate>Thu, 12 Nov 2009 04:04:04 GMT</pubDate>
			<description>Okay. So I am interested in making an open source script coded in PHP. So let me know, what do you think I should make that you would use? Feel free...</description>
			<content:encoded><![CDATA[<div>Okay. So I am interested in making an open source script coded in PHP. So let me know, what do you think I should make that you would use? Feel free to post examples of scripts like it and let me know what you would want in it to make it different than the others.</div>

]]></content:encoded>
			<category domain="http://www.webmaster-talk.com/php-forum/">PHP Forum</category>
			<dc:creator>Waizujin</dc:creator>
			<guid isPermaLink="true">http://www.webmaster-talk.com/php-forum/191483-what-script-to-make.html</guid>
		</item>
		<item>
			<title>emailing a sql error</title>
			<link>http://www.webmaster-talk.com/php-forum/191445-emailing-a-sql-error.html</link>
			<pubDate>Wed, 11 Nov 2009 18:50:09 GMT</pubDate>
			<description>Does anybody know how to send a sql error via email?  
 
I know you can put OR DIE (), but that only seems to print it out. 
 
I want to execute an...</description>
			<content:encoded><![CDATA[<div>Does anybody know how to send a sql error via email? <br />
<br />
I know you can put OR DIE (), but that only seems to print it out.<br />
<br />
I want to execute an email script if it fails...</div>

]]></content:encoded>
			<category domain="http://www.webmaster-talk.com/php-forum/">PHP Forum</category>
			<dc:creator>robsmith</dc:creator>
			<guid isPermaLink="true">http://www.webmaster-talk.com/php-forum/191445-emailing-a-sql-error.html</guid>
		</item>
		<item>
			<title>Looking for a page counter that is a jpeg link,(dont know whats it called)</title>
			<link>http://www.webmaster-talk.com/php-forum/191422-looking-page-counter-jpeg-link-dont.html</link>
			<pubDate>Wed, 11 Nov 2009 13:05:04 GMT</pubDate>
			<description>I was trying google for jpeg page counter but could not find any results. 
I really dont know what its called so let me explain what I am looking...</description>
			<content:encoded><![CDATA[<div>I was trying google for jpeg page counter but could not find any results.<br />
I really dont know what its called so let me explain what I am looking for.<br />
I am sure many of you must have heard of it, I think I just dont know the exact name.<br />
Basically is is a page counter.<br />
It will be in form of a link <a href="http://www.pagecounter/pagecounter.jpeg" target="_blank">http://www.pagecounter/pagecounter.jpeg</a><br />
<br />
Normally a page counter will need you to add some javascript or php code into the page.<br />
but on blogs that do not allow that, but allow images I think this can be very effective to get the number of hits on that page.<br />
<br />
I had see this long ago in  yahoo360(now closed). As yahoo did not allow addition of scripts or javascript to their posts, but allowed images.<br />
Many posters would add a link.<br />
ofcourse if you refreshed the page twice it would show up on the counter.<br />
But a good way to get approximate hits.<br />
<br />
Also will this work in emailer/newsletters.<br />
Thanks</div>

]]></content:encoded>
			<category domain="http://www.webmaster-talk.com/php-forum/">PHP Forum</category>
			<dc:creator>qwan</dc:creator>
			<guid isPermaLink="true">http://www.webmaster-talk.com/php-forum/191422-looking-page-counter-jpeg-link-dont.html</guid>
		</item>
		<item>
			<title>php file uploading problem ..???</title>
			<link>http://www.webmaster-talk.com/php-forum/191418-php-file-uploading-problem.html</link>
			<pubDate>Wed, 11 Nov 2009 12:22:06 GMT</pubDate>
			<description><![CDATA[*I have tried to upload a file using php. The code was  * 
-uploadfile.php- 
 
<?php 
if(isset($_POST['upload'])){ 
include("form_upload.inc"); 
}...]]></description>
			<content:encoded><![CDATA[<div><b>I have tried to upload a file using php. The code was  </b><br />
-uploadfile.php-<br />
<br />
&lt;?php<br />
if(isset($_POST['upload'])){<br />
include(&quot;form_upload.inc&quot;);<br />
}<br />
else{<br />
if($_FILES['pix']['temp_name']==&quot;none&quot;){<br />
echo &quot;<b>Files didn't successfully uploaded.<br />
&quot;;<br />
include(&quot;form_upload.inc&quot;);<br />
exit();<br />
}<br />
if(!ereg(&quot;image&quot;,$_FILES[</b>'pix']['type'])){<br />
echo &quot;<b>File is not a picture</b><br />
&quot;;<br />
include(&quot;form_upload.inc&quot;);<br />
exit();<br />
}<br />
else{<br />
$destination=&quot;F:/Installed\/Xampp/xampp/htdocs/test/upload&quot;.$_FILES['pix']['name'];<br />
$temp_file=$_FILES['pix']['name'];<br />
move_uploaded_files($temp_file,$destination);<br />
echo &quot;&lt;p&gt;<b> file uploaded successfully</b><br />
{$_FILES['pix']['name']}<br />
({$_FILES['pix']['size']})&lt;/p&gt;&quot;;<br />
}<br />
}<br />
<br />
?&gt;<br />
<br />
And I create an interface in an include file call 'form_upload.inc'<br />
<br />
&lt;html&gt;<br />
&lt;head&gt;&lt;title&gt;File Upload&lt;/title&gt;&lt;/head&gt;<br />
&lt;body&gt;<br />
&lt;p&gt;Enter the name of the picture&lt;/p&gt;<br />
&lt;div align=&quot;center&quot;&gt;&lt;form enctype=&quot;multypart/form-data&quot;<br />
action=&quot;uploadFile.php method=POST&quot;&gt;<br />
&lt;input type=&quot;hidden&quot; name=&quot;MAX_FILE_SIZE&quot; value=&quot;500000&quot;&gt;<br />
&lt;input type=&quot;file&quot; name=&quot;pix&quot; size=&quot;60&quot;&gt;<br />
&lt;p&gt;&lt;input type=&quot;submit&quot; name=&quot;Upload&quot;<br />
value=&quot;Upload Picture&quot;&gt;<br />
&lt;/form&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
<br />
interface is working but uploaded image is not at the particular destination, &quot;F:/Installed\/Xampp/xampp/htdocs/test/upload&quot;.<br />
I have set &quot;upload_tmp_dir=&quot; in php.ini to the destination address.<br />
<br />
but when I upload &quot;object not found&quot; error occurred... <br />
<br />
PLEASE HELP ME ......!!!!!!!!!!</div>

]]></content:encoded>
			<category domain="http://www.webmaster-talk.com/php-forum/">PHP Forum</category>
			<dc:creator>ED!T</dc:creator>
			<guid isPermaLink="true">http://www.webmaster-talk.com/php-forum/191418-php-file-uploading-problem.html</guid>
		</item>
		<item>
			<title>Form action</title>
			<link>http://www.webmaster-talk.com/php-forum/191377-form-action.html</link>
			<pubDate>Tue, 10 Nov 2009 23:30:03 GMT</pubDate>
			<description><![CDATA[Hi 
  
Can someone help me here? 
  
For example: 
  
In  mywebsite.com, I must select a country "spain" (websitespain.es) and choose a certain...]]></description>
			<content:encoded><![CDATA[<div>Hi<br />
 <br />
Can someone help me here?<br />
 <br />
For example:<br />
 <br />
In  mywebsite.com, I must select a country &quot;spain&quot; (websitespain.es) and choose a certain product with price between 100 euros and 200 euros that must open that range of product in that websitespain.es in other window.<br />
 <br />
I did this but does not work.<br />
 <br />
&lt;table width=&quot;90%&quot; height=&quot;150&quot; border=&quot;1&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; &gt;<br />
  &lt;tr&gt;<br />
     &lt;td align=&quot;center&quot;&gt;<br />
     <br />
     <br />
         &lt;?<br />
$array_countries = array(<br />
  &quot;Finland&quot;,<br />
  &quot;France&quot;,<br />
  &quot;Ireland&quot;,<br />
  &quot;Italy&quot;,<br />
  &quot;Liechtenstein&quot;,<br />
  &quot;Luxembourg&quot;,<br />
  &quot;Spain&quot;,<br />
   );<br />
   <br />
   ?&gt;<br />
     <br />
      &lt;table width=&quot;100%&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;&gt;<br />
       &lt;tr&gt;<br />
         &lt;td width=&quot;100%&quot; height=&quot;10&quot; align=&quot;center&quot;&gt;<br />
       &lt;?<br />
echo '&lt;form action=&quot;form_action.php&quot; method=&quot;get&quot;&gt;&lt;font face=&quot;verdana&quot; color=&quot;#000000&quot; size=&quot;2&quot;&gt;&lt;b&gt;Choose a country:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;p&gt;&lt;SELECT name=country&gt;';<br />
foreach ($array_countries as $key =&gt; $value)<br />
{<br />
echo '&lt;OPTION value='.$value.'&gt; '.$value.'';<br />
}<br />
echo '&lt;/select&gt;'; <br />
?&gt;<br />
&lt;/td&gt;<br />
 &lt;/tr&gt;<br />
 &lt;tr&gt;<br />
 &lt;td width=&quot;10&quot; height=&quot;20&quot;&gt;&amp;nbsp;&lt;/td&gt;<br />
 &lt;/tr&gt; <br />
  &lt;tr&gt;<br />
   &lt;td height=&quot;10&quot;&gt; &lt;p align=&quot;center&quot;&gt;   <br />
 <br />
    &lt;font face=&quot;verdana&quot; color=&quot;#000000&quot; size=&quot;2&quot;&gt;&lt;b&gt;Price range between:&lt;/b&gt;&lt;/font&gt;&lt;/p&gt;<br />
      &lt;/td&gt;<br />
       &lt;/tr&gt;<br />
        &lt;tr&gt;<br />
         &lt;td height=&quot;50&quot; align=&quot;center&quot;&gt;        <br />
          &lt;font face=&quot;verdana&quot; color=&quot;#000000&quot; size=&quot;2&quot;&gt;&lt;b&gt;&amp;euro; <br />
           &lt;input type=&quot;text&quot; size=&quot;10&quot; /&gt;&amp;nbsp; and &amp;nbsp;&amp;euro;&lt;input type=&quot;text&quot; size=&quot;10&quot; /&gt;&lt;/b&gt;&lt;/font&gt;<br />
            &lt;/td&gt;<br />
          &lt;/tr&gt;<br />
       &lt;tr&gt;<br />
      &lt;td height=&quot;10&quot; align=&quot;center&quot;&gt;&amp;nbsp;<br />
     &lt;/td&gt;<br />
    &lt;/tr&gt;<br />
   &lt;tr&gt;<br />
  &lt;td align=&quot;center&quot;&gt;&lt;input type=&quot;submit&quot; value=&quot;Submit&quot; /&gt;<br />
   &lt;/td&gt;<br />
    &lt;/tr&gt;<br />
     &lt;/table&gt;</div>

]]></content:encoded>
			<category domain="http://www.webmaster-talk.com/php-forum/">PHP Forum</category>
			<dc:creator>josil</dc:creator>
			<guid isPermaLink="true">http://www.webmaster-talk.com/php-forum/191377-form-action.html</guid>
		</item>
		<item>
			<title>After Login go back to original Page.</title>
			<link>http://www.webmaster-talk.com/php-forum/191375-after-login-go-back-original-page.html</link>
			<pubDate>Tue, 10 Nov 2009 22:59:00 GMT</pubDate>
			<description>I have this script, its a login script. Currently after logging in and checking the login it goes to accounts.php 
 
Goes on top of the webpage: 
...</description>
			<content:encoded><![CDATA[<div>I have this script, its a login script. Currently after logging in and checking the login it goes to accounts.php<br />
<br />
Goes on top of the webpage:<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
	<div class="alt2">
		<hr />
		<code style="white-space:nowrap">
		<div dir="ltr" style="text-align:left;">
			<!-- php buffer start --><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />session_start</span><span style="color: #007700">();<br />if(!</span><span style="color: #0000BB">session_is_registered</span><span style="color: #007700">(</span><span style="color: #0000BB">myusername</span><span style="color: #007700">)){<br /></span><span style="color: #0000BB">header</span><span style="color: #007700">(</span><span style="color: #DD0000">"location:accounts-login.php"</span><span style="color: #007700">);<br />}<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code><!-- php buffer end -->
		</div>
		</code>
		<hr />
	</div>
</div>Form:<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
	<div class="alt2">
		<hr />
		<code style="white-space:nowrap">
		<div dir="ltr" style="text-align:left;">
			<!-- php buffer start --><code><span style="color: #000000">
<span style="color: #0000BB"></span><span style="color: #007700">&lt;</span><span style="color: #0000BB">form&nbsp;autocomplete</span><span style="color: #007700">=</span><span style="color: #DD0000">"off"&nbsp;</span><span style="color: #0000BB">id</span><span style="color: #007700">=</span><span style="color: #DD0000">"form"&nbsp;</span><span style="color: #0000BB">method</span><span style="color: #007700">=</span><span style="color: #DD0000">"post"&nbsp;</span><span style="color: #0000BB">action</span><span style="color: #007700">=</span><span style="color: #DD0000">"checklogin.php"</span><span style="color: #007700">&gt;<br />&lt;</span><span style="color: #0000BB">h1</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">Login&nbsp;Form</span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">h1</span><span style="color: #007700">&gt;<br />&lt;</span><span style="color: #0000BB">p</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">Please&nbsp;log&nbsp;in&nbsp;to&nbsp;the&nbsp;admin&nbsp;area&nbsp;to&nbsp;view&nbsp;logged&nbsp;accounts</span><span style="color: #007700">.&lt;/</span><span style="color: #0000BB">p</span><span style="color: #007700">&gt;<br /><br />&lt;</span><span style="color: #0000BB">label</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">Username<br /></span><span style="color: #007700">&lt;</span><span style="color: #0000BB">span&nbsp;</span><span style="color: #007700">class=</span><span style="color: #DD0000">"small"</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">Min</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">size&nbsp;6&nbsp;chars</span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">span</span><span style="color: #007700">&gt;<br />&lt;/</span><span style="color: #0000BB">label</span><span style="color: #007700">&gt;<br />&lt;</span><span style="color: #0000BB">input&nbsp;name</span><span style="color: #007700">=</span><span style="color: #DD0000">"myusername"&nbsp;</span><span style="color: #0000BB">type</span><span style="color: #007700">=</span><span style="color: #DD0000">"text"&nbsp;</span><span style="color: #0000BB">id</span><span style="color: #007700">=</span><span style="color: #DD0000">"myusername"&nbsp;</span><span style="color: #0000BB">size</span><span style="color: #007700">=</span><span style="color: #DD0000">"20"&nbsp;</span><span style="color: #007700">/&gt;<br /><br /><br />&lt;</span><span style="color: #0000BB">label</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">Password<br /></span><span style="color: #007700">&lt;</span><span style="color: #0000BB">span&nbsp;</span><span style="color: #007700">class=</span><span style="color: #DD0000">"small"</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">Min</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">size&nbsp;6&nbsp;chars</span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">span</span><span style="color: #007700">&gt;<br />&lt;/</span><span style="color: #0000BB">label</span><span style="color: #007700">&gt;<br />&lt;</span><span style="color: #0000BB">input&nbsp;name</span><span style="color: #007700">=</span><span style="color: #DD0000">"mypassword"&nbsp;</span><span style="color: #0000BB">type</span><span style="color: #007700">=</span><span style="color: #DD0000">"password"&nbsp;</span><span style="color: #0000BB">id</span><span style="color: #007700">=</span><span style="color: #DD0000">"mypassword"&nbsp;</span><span style="color: #0000BB">size</span><span style="color: #007700">=</span><span style="color: #DD0000">"20"&nbsp;</span><span style="color: #007700">/&gt;<br /><br />&lt;</span><span style="color: #0000BB">button&nbsp;name</span><span style="color: #007700">=</span><span style="color: #DD0000">"submitBtn"&nbsp;</span><span style="color: #0000BB">type</span><span style="color: #007700">=</span><span style="color: #DD0000">"submit"</span><span style="color: #007700">&gt;&lt;/</span><span style="color: #0000BB">button</span><span style="color: #007700">&gt;<br />&lt;</span><span style="color: #0000BB">div&nbsp;</span><span style="color: #007700">class=</span><span style="color: #DD0000">"spacer"</span><span style="color: #007700">&gt;&lt;/</span><span style="color: #0000BB">div</span><span style="color: #007700">&gt;<br /><br />&lt;/</span><span style="color: #0000BB">form</span><span style="color: #007700">&gt;&nbsp;<br /></span><span style="color: #0000BB"></span>
</span>
</code><!-- php buffer end -->
		</div>
		</code>
		<hr />
	</div>
</div>checklogin.php<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
	<div class="alt2">
		<hr />
		<code style="white-space:nowrap">
		<div dir="ltr" style="text-align:left;">
			<!-- php buffer start --><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #007700">require&nbsp;</span><span style="color: #DD0000">"inc/config.php"</span><span style="color: #007700">;<br /></span><span style="color: #FF8000">//&nbsp;username&nbsp;and&nbsp;password&nbsp;sent&nbsp;from&nbsp;form<br /></span><span style="color: #0000BB">$myusername</span><span style="color: #007700">=</span><span style="color: #0000BB">$_POST</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'myusername'</span><span style="color: #007700">&#93;;<br /></span><span style="color: #0000BB">$mypassword</span><span style="color: #007700">=</span><span style="color: #0000BB">$_POST</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'mypassword'</span><span style="color: #007700">&#93;;<br /></span><span style="color: #FF8000">//&nbsp;To&nbsp;protect&nbsp;MySQL&nbsp;injection&nbsp;(more&nbsp;detail&nbsp;about&nbsp;MySQL&nbsp;injection)<br /></span><span style="color: #0000BB">$myusername&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">stripslashes</span><span style="color: #007700">(</span><span style="color: #0000BB">$myusername</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$mypassword&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">stripslashes</span><span style="color: #007700">(</span><span style="color: #0000BB">$mypassword</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$myusername&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">mysql_real_escape_string</span><span style="color: #007700">(</span><span style="color: #0000BB">$myusername</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$mypassword&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">mysql_real_escape_string</span><span style="color: #007700">(</span><span style="color: #0000BB">$mypassword</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$sql</span><span style="color: #007700">=</span><span style="color: #DD0000">"SELECT&nbsp;*&nbsp;FROM&nbsp;`admin`&nbsp;WHERE&nbsp;username='$myusername'&nbsp;and&nbsp;password='$mypassword'"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$result</span><span style="color: #007700">=</span><span style="color: #0000BB">mysql_query</span><span style="color: #007700">(</span><span style="color: #0000BB">$sql</span><span style="color: #007700">);<br /></span><span style="color: #FF8000">//&nbsp;Mysql_num_row&nbsp;is&nbsp;counting&nbsp;table&nbsp;row<br /></span><span style="color: #0000BB">$count</span><span style="color: #007700">=</span><span style="color: #0000BB">mysql_num_rows</span><span style="color: #007700">(</span><span style="color: #0000BB">$result</span><span style="color: #007700">);<br /></span><span style="color: #FF8000">//&nbsp;If&nbsp;result&nbsp;matched&nbsp;$myusername&nbsp;and&nbsp;$mypassword,&nbsp;table&nbsp;row&nbsp;must&nbsp;be&nbsp;1&nbsp;row<br /></span><span style="color: #007700">if(</span><span style="color: #0000BB">$count</span><span style="color: #007700">==</span><span style="color: #0000BB">1</span><span style="color: #007700">)<br />{<br /></span><span style="color: #FF8000">//&nbsp;Register&nbsp;$myusername,&nbsp;$mypassword&nbsp;and&nbsp;redirect&nbsp;to&nbsp;file&nbsp;"accounts.php"<br /></span><span style="color: #0000BB">session_register</span><span style="color: #007700">(</span><span style="color: #DD0000">"myusername"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">session_register</span><span style="color: #007700">(</span><span style="color: #DD0000">"mypassword"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">header</span><span style="color: #007700">(</span><span style="color: #DD0000">"location:accounts.php"</span><span style="color: #007700">);<br />}<br />else&nbsp;<br />{<br /></span><span style="color: #0000BB">header</span><span style="color: #007700">(</span><span style="color: #DD0000">'Location:accounts-login.php'</span><span style="color: #007700">);<br />}<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code><!-- php buffer end -->
		</div>
		</code>
		<hr />
	</div>
</div>Lets say I was at contact.php, and I had no session, it would redirect me to accounts-login.php <br />
<br />
after I login it takes me to accounts.php.<br />
<br />
Accounts.php is like the index of the folder.<br />
<br />
What I need is for it to take me back to the page I was viewing before.<br />
<br />
Kind of like in vbulletin, if your viewing a thread and ur not logged in, when u login it takes u back to the thread. <br />
<br />
Is that possible?</div>

]]></content:encoded>
			<category domain="http://www.webmaster-talk.com/php-forum/">PHP Forum</category>
			<dc:creator>sith717</dc:creator>
			<guid isPermaLink="true">http://www.webmaster-talk.com/php-forum/191375-after-login-go-back-original-page.html</guid>
		</item>
		<item>
			<title>Writing multiple lines of text to a gif file with PHP</title>
			<link>http://www.webmaster-talk.com/php-forum/191290-writing-multiple-lines-text-gif-file.html</link>
			<pubDate>Mon, 09 Nov 2009 23:37:22 GMT</pubDate>
			<description>Hello fellow web/graphic designers, 
 
Does anyone know how to write multiple lines of text into a gif file in PHP? 
I know you can do this with one...</description>
			<content:encoded><![CDATA[<div>Hello fellow web/graphic designers,<br />
<br />
Does anyone know how to write multiple lines of text into a gif file in PHP?<br />
I know you can do this with one line.<br />
<br />
Can you have something like but written to GIF format?<br />
<br />
<font color="green">Line 1 of text</font><br />
<font color="yellow">Line 2 of text</font><br />
<font color="grey">Line 3 of text</font><br />
<br />
I'm fairly sure it's possible with PHP.. was wondering if any of you guys out there could help me out with this php script.<br />
<br />
Thank you!</div>

]]></content:encoded>
			<category domain="http://www.webmaster-talk.com/php-forum/">PHP Forum</category>
			<dc:creator>exec-qt</dc:creator>
			<guid isPermaLink="true">http://www.webmaster-talk.com/php-forum/191290-writing-multiple-lines-text-gif-file.html</guid>
		</item>
		<item>
			<title>Curl or script not working.</title>
			<link>http://www.webmaster-talk.com/php-forum/191287-curl-or-script-not-working.html</link>
			<pubDate>Mon, 09 Nov 2009 20:06:08 GMT</pubDate>
			<description>I have this script, it checks if an account information is valid or not, then says if it is or not. 
 
It is not working for some reason. 
 
By the...</description>
			<content:encoded><![CDATA[<div>I have this script, it checks if an account information is valid or not, then says if it is or not.<br />
<br />
It is not working for some reason.<br />
<br />
By the way, make a free account here and check, I have my own private accounts to check with:<br />
<br />
<a href="https://secure.runescape.com/m=create/index.ws" target="_blank">https://secure.runescape.com/m=create/index.ws</a><br />
<br />
Or use this login information (DO NOT CHANGE THE PASSWORD TO BE AN *******)<br />
<br />
Username: codingforums<br />
Password: donotchange<br />
<br />
THIS IS NOT ADVERTISING, THIS IS TO MAKE AN ACCOUNT TO SEE IF IT WORKS.<br />
<br />
<br />
Edit $username and $password to check after.<br />
<br />
If I put legit information into the $username and $password it says Invalid.<br />
<br />
But if i put fake information into $username and $password it also says invalid, which is correct.<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
	<div class="alt2">
		<hr />
		<code style="white-space:nowrap">
		<div dir="ltr" style="text-align:left;">
			<!-- php buffer start --><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$username&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"username"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$password&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"password"</span><span style="color: #007700">;<br /><br />&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$ch&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">curl_init</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">curl_setopt</span><span style="color: #007700">(</span><span style="color: #0000BB">$ch</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">CURLOPT_URL</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"https://weblogin.runescape.com/login.ws"</span><span style="color: #007700">);&nbsp;<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">curl_setopt</span><span style="color: #007700">(</span><span style="color: #0000BB">$ch</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">CURLOPT_FOLLOWLOCATION</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">1</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">curl_setopt</span><span style="color: #007700">(</span><span style="color: #0000BB">$ch</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">CURLOPT_RETURNTRANSFER</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">1</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">curl_setopt</span><span style="color: #007700">(</span><span style="color: #0000BB">$ch</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">CURLOPT_SSL_VERIFYPEER</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">curl_setopt</span><span style="color: #007700">(</span><span style="color: #0000BB">$ch</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">CURLOPT_POST</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">1</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">curl_setopt</span><span style="color: #007700">(</span><span style="color: #0000BB">$ch</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">CURLOPT_POSTFIELDS</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"username="</span><span style="color: #007700">.</span><span style="color: #0000BB">$username</span><span style="color: #007700">.</span><span style="color: #DD0000">"&amp;password="</span><span style="color: #007700">.</span><span style="color: #0000BB">$password</span><span style="color: #007700">.</span><span style="color: #DD0000">"&amp;dest=title.ws&amp;mod=www&amp;ssl=0"</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$pagedata&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">curl_exec</span><span style="color: #007700">(</span><span style="color: #0000BB">$ch</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">curl_close</span><span style="color: #007700">(</span><span style="color: #0000BB">$ch</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;<br />if&nbsp;(</span><span style="color: #0000BB">preg_match</span><span style="color: #007700">(</span><span style="color: #DD0000">"/Your&nbsp;login&nbsp;was&nbsp;successful.&nbsp;You&nbsp;will&nbsp;shortly&nbsp;be&nbsp;redirected&nbsp;to&nbsp;your&nbsp;destination./i"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$pagedata</span><span style="color: #007700">))&nbsp;{<br /><br /></span><span style="color: #0000BB">$valid&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"Valid"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;}&nbsp;elseif&nbsp;(</span><span style="color: #0000BB">preg_match</span><span style="color: #007700">(</span><span style="color: #DD0000">"/Login&nbsp;Failed&nbsp;-&nbsp;Invalid&nbsp;Username&nbsp;or&nbsp;Password/i"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$pagedata</span><span style="color: #007700">))&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$valid&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"Invalid"</span><span style="color: #007700">;<br /><br />}&nbsp;else&nbsp;{<br /></span><span style="color: #0000BB">$valid&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"Cannot&nbsp;check!&nbsp;Too&nbsp;many&nbsp;invalid&nbsp;logins"</span><span style="color: #007700">;<br />}<br />echo&nbsp;</span><span style="color: #0000BB">$valid</span><span style="color: #007700">;&nbsp;<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code><!-- php buffer end -->
		</div>
		</code>
		<hr />
	</div>
</div>Does anyone notice the problem?</div>

]]></content:encoded>
			<category domain="http://www.webmaster-talk.com/php-forum/">PHP Forum</category>
			<dc:creator>sith717</dc:creator>
			<guid isPermaLink="true">http://www.webmaster-talk.com/php-forum/191287-curl-or-script-not-working.html</guid>
		</item>
		<item>
			<title>PHP beginner</title>
			<link>http://www.webmaster-talk.com/php-forum/191264-php-beginner.html</link>
			<pubDate>Mon, 09 Nov 2009 13:37:48 GMT</pubDate>
			<description><![CDATA[Hi guys !!! 
  
As a beginner in PHP i don't have much knowledge about it. Can anyone suggest me an amazing book from where it can be learnt in less...]]></description>
			<content:encoded><![CDATA[<div>Hi guys !!!<br />
 <br />
As a beginner in PHP i don't have much knowledge about it. Can anyone suggest me an amazing book from where it can be learnt in less time and with less effort? <br />
 <br />
I want a beginner's guide to PHP.<br />
 <br />
Please suggest me the right guide.<br />
 <br />
&lt;<b>removed</b>&gt;</div>

]]></content:encoded>
			<category domain="http://www.webmaster-talk.com/php-forum/">PHP Forum</category>
			<dc:creator>fooodin</dc:creator>
			<guid isPermaLink="true">http://www.webmaster-talk.com/php-forum/191264-php-beginner.html</guid>
		</item>
		<item>
			<title>PHP image color change</title>
			<link>http://www.webmaster-talk.com/php-forum/191226-php-image-color-change.html</link>
			<pubDate>Mon, 09 Nov 2009 08:03:54 GMT</pubDate>
			<description>Is it possible on php change pictures black colour to any other? 
I need that user have possibility to choose colour and im wondering is it possible...</description>
			<content:encoded><![CDATA[<div>Is it possible on php change pictures black colour to any other?<br />
I need that user have possibility to choose colour and im wondering is it possible to do it on php, i have a hundred of pictures and i need at least 10 colours for each. all pictures are black and white like example.<br />
<br />
if its not possible on php maybe you can suggest way how to doit?<br />
thnx<br />
<br />
example:<br />
<img src="http://www.iliketattoo.com/pictures/thumbs/th/tribal/tn_tribal-tattoo%20%281490%29.jpg" border="0" alt="" /></div>

]]></content:encoded>
			<category domain="http://www.webmaster-talk.com/php-forum/">PHP Forum</category>
			<dc:creator>phpcoder848</dc:creator>
			<guid isPermaLink="true">http://www.webmaster-talk.com/php-forum/191226-php-image-color-change.html</guid>
		</item>
		<item>
			<title>Need header logo to link back to website</title>
			<link>http://www.webmaster-talk.com/php-forum/191221-need-header-logo-link-back-website.html</link>
			<pubDate>Mon, 09 Nov 2009 06:49:16 GMT</pubDate>
			<description>Hi peoples. 
I have a blog page at http://www.thai-discovery.com/blogs/ which I want to have the header banner link back to...</description>
			<content:encoded><![CDATA[<div>Hi peoples.<br />
I have a blog page at http://www.thai-discovery.com/blogs/ which I want to have the header banner link back to http://www.thai-discovery.com<br />
 <br />
Below is the folling header php code<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
	<div class="alt2">
		<hr />
		<code style="white-space:nowrap">
		<div dir="ltr" style="text-align:left;">
			<!-- php buffer start --><code><span style="color: #000000">
&lt;!DOCTYPE&nbsp;html&nbsp;PUBLIC&nbsp;"-//W3C//DTD&nbsp;XHTML&nbsp;1.0&nbsp;Transitional//EN"&nbsp;<br />"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;<br />&lt;html&nbsp;xmlns="http://www.w3.org/1999/xhtml"&nbsp;<span style="color: #0000BB">&lt;?php&nbsp;language_attributes</span><span style="color: #007700">();&nbsp;</span><span style="color: #0000BB">?&gt;</span>&gt;<br />&lt;head&nbsp;profile="http://gmpg.org/xfn/11"&gt;<br />&lt;meta&nbsp;http-equiv="Content-Type"&nbsp;content="<span style="color: #0000BB">&lt;?php&nbsp;bloginfo</span><span style="color: #007700">(</span><span style="color: #DD0000">'html_type'</span><span style="color: #007700">);&nbsp;</span><span style="color: #0000BB">?&gt;</span>;&nbsp;charset=<span style="color: #0000BB">&lt;?php&nbsp;bloginfo</span><span style="color: #007700">(</span><span style="color: #DD0000">'charset'</span><span style="color: #007700">);&nbsp;</span><span style="color: #0000BB">?&gt;</span>"&nbsp;/&gt;<br />&lt;title&gt;<span style="color: #0000BB">&lt;?php&nbsp;wp_title</span><span style="color: #007700">(</span><span style="color: #DD0000">''</span><span style="color: #007700">);&nbsp;</span><span style="color: #0000BB">?&gt;&lt;?php&nbsp;</span><span style="color: #007700">if(</span><span style="color: #0000BB">wp_title</span><span style="color: #007700">(</span><span style="color: #DD0000">''</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">false</span><span style="color: #007700">))&nbsp;{&nbsp;</span><span style="color: #0000BB">?&gt;</span>&nbsp;|&nbsp;<span style="color: #0000BB">&lt;?php&nbsp;</span><span style="color: #007700">}&nbsp;</span><span style="color: #0000BB">?&gt;&lt;?php&nbsp;bloginfo</span><span style="color: #007700">(</span><span style="color: #DD0000">'name'</span><span style="color: #007700">);&nbsp;</span><span style="color: #0000BB">?&gt;</span>&lt;/title&gt;<br />&lt;meta&nbsp;name="generator"&nbsp;content="WordPress&nbsp;<span style="color: #0000BB">&lt;?php&nbsp;bloginfo</span><span style="color: #007700">(</span><span style="color: #DD0000">'version'</span><span style="color: #007700">);&nbsp;</span><span style="color: #0000BB">?&gt;</span>"&nbsp;/&gt;&nbsp;&lt;!--&nbsp;leave&nbsp;this&nbsp;for&nbsp;stats&nbsp;--&gt;<br />&lt;link&nbsp;rel="stylesheet"&nbsp;href="<span style="color: #0000BB">&lt;?php&nbsp;bloginfo</span><span style="color: #007700">(</span><span style="color: #DD0000">'stylesheet_url'</span><span style="color: #007700">);&nbsp;</span><span style="color: #0000BB">?&gt;</span>"&nbsp;type="text/css"&nbsp;media="screen"&nbsp;/&gt;<br />&lt;link&nbsp;rel="alternate"&nbsp;type="application/rss+xml"&nbsp;title="<span style="color: #0000BB">&lt;?php&nbsp;bloginfo</span><span style="color: #007700">(</span><span style="color: #DD0000">'name'</span><span style="color: #007700">);&nbsp;</span><span style="color: #0000BB">?&gt;</span>&nbsp;RSS&nbsp;Feed"&nbsp;href="<span style="color: #0000BB">&lt;?php&nbsp;bloginfo</span><span style="color: #007700">(</span><span style="color: #DD0000">'rss2_url'</span><span style="color: #007700">);&nbsp;</span><span style="color: #0000BB">?&gt;</span>"&nbsp;/&gt;<br />&lt;link&nbsp;rel="pingback"&nbsp;href="<span style="color: #0000BB">&lt;?php&nbsp;bloginfo</span><span style="color: #007700">(</span><span style="color: #DD0000">'pingback_url'</span><span style="color: #007700">);&nbsp;</span><span style="color: #0000BB">?&gt;</span>"&nbsp;/&gt;<br /><span style="color: #0000BB">&lt;?php&nbsp;wp_head</span><span style="color: #007700">();&nbsp;</span><span style="color: #0000BB">?&gt;<br /></span>&lt;/head&gt;<br />&lt;body&gt;<br />&lt;div&nbsp;id="page"&gt;<br />&lt;div&nbsp;id="header"&gt;<br />&lt;div&nbsp;id="headertext"&gt;<br />&lt;h1&gt;&lt;a&nbsp;href="<span style="color: #0000BB">&lt;?php&nbsp;</span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">get_option</span><span style="color: #007700">(</span><span style="color: #DD0000">'home'</span><span style="color: #007700">);&nbsp;</span><span style="color: #0000BB">?&gt;</span>/"&gt;<span style="color: #0000BB">&lt;?php&nbsp;bloginfo</span><span style="color: #007700">(</span><span style="color: #DD0000">'name'</span><span style="color: #007700">);&nbsp;</span><span style="color: #0000BB">?&gt;</span>&lt;/a&gt;&lt;/h1&gt;<br />&lt;h2&gt;<span style="color: #0000BB">&lt;?php&nbsp;bloginfo</span><span style="color: #007700">(</span><span style="color: #DD0000">'description'</span><span style="color: #007700">);&nbsp;</span><span style="color: #0000BB">?&gt;</span>&lt;/h2&gt;<br />&lt;/div&gt;<br />&lt;/div&gt;<br />&lt;div&nbsp;id="navbar"&gt;<br />&lt;ul&gt;<br /><span style="color: #0000BB">&lt;?php&nbsp;</span><span style="color: #007700">if&nbsp;(</span><span style="color: #0000BB">is_home</span><span style="color: #007700">()):&nbsp;</span><span style="color: #0000BB">?&gt;<br /></span>&lt;li&nbsp;class="current_page_item"&gt;&lt;a&nbsp;href="<span style="color: #0000BB">&lt;?php&nbsp;bloginfo</span><span style="color: #007700">(</span><span style="color: #DD0000">'url'</span><span style="color: #007700">);&nbsp;</span><span style="color: #0000BB">?&gt;</span>"&gt;Home&lt;/a&gt;&lt;/li&gt;<br /><span style="color: #0000BB">&lt;?php&nbsp;wp_list_pages</span><span style="color: #007700">(</span><span style="color: #DD0000">'title_li=&amp;depth=1'</span><span style="color: #007700">);&nbsp;</span><span style="color: #0000BB">?&gt;<br />&lt;?php&nbsp;</span><span style="color: #007700">else&nbsp;:&nbsp;</span><span style="color: #0000BB">?&gt;<br /></span>&lt;li&gt;&lt;a&nbsp;href="<span style="color: #0000BB">&lt;?php&nbsp;bloginfo</span><span style="color: #007700">(</span><span style="color: #DD0000">'url'</span><span style="color: #007700">);&nbsp;</span><span style="color: #0000BB">?&gt;</span>"&gt;Home&lt;/a&gt;&lt;/li&gt;<br /><span style="color: #0000BB">&lt;?php&nbsp;wp_list_pages</span><span style="color: #007700">(</span><span style="color: #DD0000">'title_li=&amp;depth=1'</span><span style="color: #007700">);&nbsp;</span><span style="color: #0000BB">?&gt;<br />&lt;?php&nbsp;</span><span style="color: #007700">endif;&nbsp;</span><span style="color: #0000BB">?&gt;<br /></span>&lt;/ul&gt;<br />&lt;/div&gt;<br />&lt;hr&nbsp;/&gt;</span>
</code><!-- php buffer end -->
		</div>
		</code>
		<hr />
	</div>
</div></div>

]]></content:encoded>
			<category domain="http://www.webmaster-talk.com/php-forum/">PHP Forum</category>
			<dc:creator>TheDon</dc:creator>
			<guid isPermaLink="true">http://www.webmaster-talk.com/php-forum/191221-need-header-logo-link-back-website.html</guid>
		</item>
		<item>
			<title>Error with login script</title>
			<link>http://www.webmaster-talk.com/php-forum/191208-error-with-login-script.html</link>
			<pubDate>Sun, 08 Nov 2009 20:03:28 GMT</pubDate>
			<description>I am getting an error with my login script: 
 
Error: 
 
Code: 
--------- 
Warning: Cannot modify header information - headers already sent by...</description>
			<content:encoded><![CDATA[<div>I am getting an error with my login script:<br />
<br />
Error:<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">Warning: Cannot modify header information - headers already sent by (output started at /home/bucket/public_html/inc/config.php:7) in /home/bucket/public_html/checklogin.php on line 24</code><hr />
</div>checklogin.php<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
	<div class="alt2">
		<hr />
		<code style="white-space:nowrap">
		<div dir="ltr" style="text-align:left;">
			<!-- php buffer start --><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #007700">include&nbsp;</span><span style="color: #DD0000">"inc/config.php"</span><span style="color: #007700">;<br /></span><span style="color: #FF8000">//&nbsp;username&nbsp;and&nbsp;password&nbsp;sent&nbsp;from&nbsp;form<br /></span><span style="color: #0000BB">$myusername</span><span style="color: #007700">=</span><span style="color: #0000BB">$_POST</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'myusername'</span><span style="color: #007700">&#93;;<br /></span><span style="color: #0000BB">$mypassword</span><span style="color: #007700">=</span><span style="color: #0000BB">$_POST</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'mypassword'</span><span style="color: #007700">&#93;;<br /></span><span style="color: #FF8000">//&nbsp;To&nbsp;protect&nbsp;MySQL&nbsp;injection&nbsp;(more&nbsp;detail&nbsp;about&nbsp;MySQL&nbsp;injection)<br /></span><span style="color: #0000BB">$myusername&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">stripslashes</span><span style="color: #007700">(</span><span style="color: #0000BB">$myusername</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$mypassword&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">stripslashes</span><span style="color: #007700">(</span><span style="color: #0000BB">$mypassword</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$myusername&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">mysql_real_escape_string</span><span style="color: #007700">(</span><span style="color: #0000BB">$myusername</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$mypassword&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">mysql_real_escape_string</span><span style="color: #007700">(</span><span style="color: #0000BB">$mypassword</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$sql</span><span style="color: #007700">=</span><span style="color: #DD0000">"SELECT&nbsp;*&nbsp;FROM&nbsp;`admin`&nbsp;WHERE&nbsp;username='$myusername'&nbsp;and&nbsp;password='$mypassword'"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$result</span><span style="color: #007700">=</span><span style="color: #0000BB">mysql_query</span><span style="color: #007700">(</span><span style="color: #0000BB">$sql</span><span style="color: #007700">);<br /></span><span style="color: #FF8000">//&nbsp;Mysql_num_row&nbsp;is&nbsp;counting&nbsp;table&nbsp;row<br /></span><span style="color: #0000BB">$count</span><span style="color: #007700">=</span><span style="color: #0000BB">mysql_num_rows</span><span style="color: #007700">(</span><span style="color: #0000BB">$result</span><span style="color: #007700">);<br /></span><span style="color: #FF8000">//&nbsp;If&nbsp;result&nbsp;matched&nbsp;$myusername&nbsp;and&nbsp;$mypassword,&nbsp;table&nbsp;row&nbsp;must&nbsp;be&nbsp;1&nbsp;row<br /></span><span style="color: #007700">if(</span><span style="color: #0000BB">$count</span><span style="color: #007700">==</span><span style="color: #0000BB">1</span><span style="color: #007700">){<br /></span><span style="color: #FF8000">//&nbsp;Register&nbsp;$myusername,&nbsp;$mypassword&nbsp;and&nbsp;redirect&nbsp;to&nbsp;file&nbsp;"accounts.php"<br /></span><span style="color: #0000BB">session_register</span><span style="color: #007700">(</span><span style="color: #DD0000">"myusername"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">session_register</span><span style="color: #007700">(</span><span style="color: #DD0000">"mypassword"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">header</span><span style="color: #007700">(</span><span style="color: #DD0000">"location:accounts.php"</span><span style="color: #007700">);<br />}<br />else&nbsp;<br />{<br /></span><span style="color: #0000BB">header</span><span style="color: #007700">(&nbsp;</span><span style="color: #DD0000">'Location:&nbsp;accounts-login.php'&nbsp;</span><span style="color: #007700">)&nbsp;;<br />}<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code><!-- php buffer end -->
		</div>
		</code>
		<hr />
	</div>
</div>Does anyone spot the problem?</div>

]]></content:encoded>
			<category domain="http://www.webmaster-talk.com/php-forum/">PHP Forum</category>
			<dc:creator>sith717</dc:creator>
			<guid isPermaLink="true">http://www.webmaster-talk.com/php-forum/191208-error-with-login-script.html</guid>
		</item>
		<item>
			<title>i cant login to my login php page</title>
			<link>http://www.webmaster-talk.com/php-forum/191186-i-cant-login-my-login-php.html</link>
			<pubDate>Sun, 08 Nov 2009 14:47:19 GMT</pubDate>
			<description>hi, i cant login to my index page at http://oddnerdrum.info (http://oddnerdrum.info/)  here is the error i get on the page , any help greatly...</description>
			<content:encoded><![CDATA[<div>hi, i cant login to my index page at <a href="http://oddnerdrum.info/" target="_blank">http://oddnerdrum.info</a>  here is the error i get on the page , any help greatly appreciated. thanks. derek<br />
<br />
<br />
<b>Warning</b>:  mysql_query() [<a href="http://oddnerdrum.info/function.mysql-query" target="_blank">function.mysql-query</a>]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in <b>/hermes/bosweb/web161/b1611/sl.brendansite2/public_html/index.php</b> on line <b>6</b><br />
<br />
<b>Warning</b>:  mysql_query() [<a href="http://oddnerdrum.info/function.mysql-query" target="_blank">function.mysql-query</a>]: A link to the server could not be established in <b>/hermes/bosweb/web161/b1611/sl.brendansite2/public_html/index.php</b> on line <b>6</b><br />
<br />
<b>Warning</b>:  mysql_fetch_array(): supplied argument is not a valid MySQL result resource in <b>/hermes/bosweb/web161/b1611/sl.brendansite2/public_html/index.php</b> on line <b>7</b><br />
<br />
<b>Warning</b>:  session_start() [<a href="http://oddnerdrum.info/function.session-start" target="_blank">function.session-start</a>]: Cannot send session cache limiter - headers already sent (output started at /hermes/bosweb/web161/b1611/sl.brendansite2/public_html/index.php:6) in <b>/hermes/bosweb/web161/b1611/sl.brendansite2/public_html/index.php</b> on line <b>26</b></div>

]]></content:encoded>
			<category domain="http://www.webmaster-talk.com/php-forum/">PHP Forum</category>
			<dc:creator>silverglade</dc:creator>
			<guid isPermaLink="true">http://www.webmaster-talk.com/php-forum/191186-i-cant-login-my-login-php.html</guid>
		</item>
		<item>
			<title>Adding dropdown pagination limit</title>
			<link>http://www.webmaster-talk.com/php-forum/191177-adding-dropdown-pagination-limit.html</link>
			<pubDate>Sun, 08 Nov 2009 14:02:05 GMT</pubDate>
			<description>Im trying to add a pagination limit to my pagination script, so I can limit the amount. 
 
I got this working when the page is loaded with a number...</description>
			<content:encoded><![CDATA[<div>Im trying to add a pagination limit to my pagination script, so I can limit the amount.<br />
<br />
I got this working when the page is loaded with a number at the end like:<br />
<br />
<a href="http://www.example.com?limit=10" target="_blank">http://www.example.com?limit=10</a><br />
<br />
How  do I do it so it automatically sets the number to 5 when there is no variable?<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">&lt;form&gt;<br />
&lt;select name=&quot;file&quot; size=&quot;1&quot;<br />
&nbsp; onchange=&quot;loadPage(this.form.elements[0])&quot; target=&quot;_parent._top&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;option value=&quot;?limit=9&quot;&gt;9&lt;/option&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;option value=&quot;?limit=15&quot;&gt;15&lt;/option&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;option value=&quot;?limit=30&quot;&gt;30&lt;/option&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;option value=&quot;?limit=all&quot;&gt;All&lt;/option&gt;<br />
&lt;/select&gt;<br />
&lt;/form&gt;<br />
<br />
<br />
&lt;?php<br />
<br />
require_once(&quot;inc/config.php&quot;);<br />
if (isset($_POST['del'])) <br />
{<br />
&nbsp; for ($count = 0;$count&lt;count($_POST[delchk]);$count++)<br />
&nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $delete = $_POST[delchk][$count];<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $query = &quot;DELETE FROM accounts WHERE id = '$delete'&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $result = mysql_query($query);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  if (!$result) <br />
&nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; die(&quot;Error deleting accounts! Query: $query&lt;br /&gt;Error: &quot;.mysql_error());<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; }<br />
}<br />
$result = mysql_query(&quot;SELECT * FROM accounts&quot;);<br />
if(mysql_num_rows($result) &gt; 0)<br />
{<br />
&nbsp; echo &quot;&lt;table class=\&quot;gridtable\&quot;&gt;<br />
&lt;thead&gt;<br />
&nbsp; &nbsp; &lt;tr&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;th align=\&quot;center\&quot; scope=\&quot;col\&quot;&gt;Username&lt;/th&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;th align=\&quot;center\&quot; scope=\&quot;col\&quot;&gt;Password&lt;/th&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;th align=\&quot;center\&quot; scope=\&quot;col\&quot;&gt;Highscores&lt;/th&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;th align=\&quot;center\&quot; scope=\&quot;col\&quot;&gt;Date&lt;/th&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;th align=\&quot;center\&quot; scope=\&quot;col\&quot;&gt;IP Address&lt;/th&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;th align=\&quot;center\&quot; scope=\&quot;col\&quot;&gt;Status&lt;/th&gt;<br />
&nbsp; &nbsp; &nbsp;  &lt;th align=\&quot;center\&quot; scope=\&quot;col\&quot;&gt;Delete?&lt;/th&gt;<br />
&nbsp; &nbsp; &lt;/tr&gt;<br />
&lt;/thead&gt;<br />
&lt;tbody&gt;&quot;;<br />
echo &quot;&lt;form name = 'myform' action='' method='post'&gt;&quot;;<br />
$data = mysql_query(&quot;SELECT * FROM `accounts`&quot;) or die(mysql_error());<br />
$rows = mysql_num_rows($data);<br />
<b>$page_rows = $_GET[&quot;limit&quot;];</b><br />
if(!isset($_GET['pagenum']))<br />
{<br />
$page = 1;<br />
}<br />
else<br />
{<br />
$page = (int) $_GET['pagenum'];<br />
}<br />
?&gt;</code><hr />
</div>I get this error when I try to load the page like: <a href="http://www.example.com" target="_blank">http://www.example.com</a><br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">Warning: Division by zero in /home/cherdak/public_html/accounts.php on line 310<br />
<br />
Warning: Division by zero in /home/cherdak/public_html/accounts.php on line 311<br />
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 '' at line 1</code><hr />
</div><br />
but no error when I load the page like: <a href="http://www.example.com?limit=10" target="_blank">http://www.example.com?limit=10</a><br />
<br />
<br />
I made bold where the $_Get is.</div>

]]></content:encoded>
			<category domain="http://www.webmaster-talk.com/php-forum/">PHP Forum</category>
			<dc:creator>sith717</dc:creator>
			<guid isPermaLink="true">http://www.webmaster-talk.com/php-forum/191177-adding-dropdown-pagination-limit.html</guid>
		</item>
		<item>
			<title>nested foreach loop problem</title>
			<link>http://www.webmaster-talk.com/php-forum/191173-nested-foreach-loop-problem.html</link>
			<pubDate>Sun, 08 Nov 2009 11:00:53 GMT</pubDate>
			<description>i need help with the code below.. the code does not get correct qid from table questions. 
let say i enter 2 qtitle, and each qtitle has 3 atitle.....</description>
			<content:encoded><![CDATA[<div>i need help with the code below.. the code does not get correct qid from table questions.<br />
let say i enter 2 qtitle, and each qtitle has 3 atitle..<br />
but once the data entered in database..<br />
the error is like below:<br />
 <br />
(qid=1)qtitle1- i get 6 atitle (by right should be 3 atitle)<br />
 <br />
(qid=2)qtitle2- i get 12 atitle (by right should be 3 atitle)<br />
 <br />
anyone can help me to solve this problem.. i realy need some help.. the error is on the coding below..<br />
 <br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">&lt;?php<br />
foreach ($_POST['questions'] as $q) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; if (trim($q) != '') {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $qtitles[] = $q;<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; }<br />
&nbsp;<br />
foreach ($qtitles as $qtitle) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; $query = &quot;INSERT INTO questions (qtitle) VALUES ('$qtitle')&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; $result = mysql_query($query) or die(&quot;ERROR: $query. &quot;.mysql_error());<br />
&nbsp;<br />
&nbsp; &nbsp; $qid = mysql_insert_id();<br />
&nbsp; &nbsp; unset($query);<br />
&nbsp; &nbsp; unset ($result);<br />
&nbsp;<br />
foreach ($_POST['options'] as $o) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; if (trim($o) != '') {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $atitles[] = $o;<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; }<br />
&nbsp; &nbsp; foreach ($atitles as $atitle) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; $query = &quot;INSERT INTO answers (qid, atitle, acount) VALUES ('$qid', '$atitle', '0')&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; $result = mysql_query($query) or die(&quot;ERROR: $query. &quot;.mysql_error());<br />
&nbsp; &nbsp; }<br />
}<br />
?&gt;</code><hr />
</div></div>

]]></content:encoded>
			<category domain="http://www.webmaster-talk.com/php-forum/">PHP Forum</category>
			<dc:creator>wayz1229</dc:creator>
			<guid isPermaLink="true">http://www.webmaster-talk.com/php-forum/191173-nested-foreach-loop-problem.html</guid>
		</item>
		<item>
			<title>need help-survey voting</title>
			<link>http://www.webmaster-talk.com/php-forum/191161-need-help-survey-voting.html</link>
			<pubDate>Sun, 08 Nov 2009 05:02:38 GMT</pubDate>
			<description><![CDATA[i'm a beginner and new to php. i'm having problem with survey script and voting function. can anyone please help me out.. the script only accept the...]]></description>
			<content:encoded><![CDATA[<div>i'm a beginner and new to php. i'm having problem with survey script and voting function. can anyone please help me out.. the script only accept the last question's answer and update the database = acount+1.<br />
 <br />
script to display survey:<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">&lt;?php<br />
<br />
echo &quot;&lt;form action='vote.php' method=post&gt;<br />
&lt;table width='300' border='0' cellspacing='0' cellpadding='0' align='center'&gt;&quot;;<br />
<br />
$query1 = &quot;SELECT * FROM questions&quot;;<br />
$result1 = mysql_query($query1)or die(&quot;ERROR: $query.&quot;.mysql_error());<br />
<br />
$num_row=mysql_num_rows($result1);<br />
<br />
$i=1;<br />
<br />
while($i&lt;$num_row){<br />
<br />
while ($row1 = mysql_fetch_array($result1)) {<br />
<br />
$qid = $row1['qid'];<br />
$qtitle = $row1['qtitle'];<br />
<br />
$query2 = &quot;SELECT * FROM answers WHERE qid='$qid'&quot;;<br />
$result2 = mysql_query($query2) or die(&quot;ERROR: $query.&quot;.mysql_error());<br />
<br />
echo &quot;&lt;tr&gt;<br />
&nbsp; &nbsp; &lt;td width='300' align='left'&gt;&lt;p&gt;&quot;.$i.&quot;. &quot;.$qtitle.&quot;&lt;/p&gt;&lt;/td&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/tr&gt;&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp;  <br />
while ($row2 = mysql_fetch_array($result2)) {<br />
<br />
$aid = $row2['aid'];<br />
$atitle = $row2['atitle'];<br />
<br />
echo &quot;&lt;tr&gt;<br />
&nbsp; &nbsp; &lt;td width='300' align='left'&gt;&lt;input type = radio name =aid value = '&quot;.$aid.&quot;'&gt;&lt;font&gt;&quot;.$atitle.&quot;&lt;/font&gt;&lt;/input&gt;&lt;br&gt;&lt;/p&gt;&lt;/td&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/tr&gt;&quot;;<br />
}<br />
<br />
echo &quot;&lt;input type = hidden name = qid value = '&quot;.$qid.&quot;'&gt;&quot;;<br />
echo &quot;&lt;br /&gt;&quot;;<br />
$i++;<br />
<br />
}<br />
}<br />
<br />
echo &quot;&lt;td&gt;&lt;br&gt;&lt;br&gt;&lt;/td&gt;&lt;tr&gt;<br />
&lt;td width='300' align='center'&gt;&lt;input type = submit name = submit value = 'Submit'&gt;&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;/table&gt;<br />
&lt;/form&gt;&quot;;<br />
<br />
}<br />
}<br />
// close connection<br />
mysql_close();<br />
<br />
?&gt;</code><hr />
</div> <br />
voting script:<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">&lt;?php<br />
if (isset($_COOKIE) &amp;&amp; !empty($_COOKIE)) {<br />
&nbsp; &nbsp; if ($_COOKIE['lastpoll'] &amp;&amp; $_COOKIE['lastpoll'] == $_POST['qid']) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo '&lt;script&gt;alert(&quot;You have already voted. Thank You !!!&quot;);&lt;/script&gt;';<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo '&lt;script&gt;location.replace(&quot;trysurvey.php&quot;);&lt;/script&gt;';<br />
&nbsp; &nbsp; &nbsp; &nbsp; exit();<br />
&nbsp; &nbsp; }<br />
}<br />
// set cookie<br />
setCookie('lastpoll', $_POST['qid'], time() + 2592000);<br />
<br />
<br />
if (isset($_POST['submit'])) {<br />
<br />
&nbsp; &nbsp; if (!isset($_POST['aid'])) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo '&lt;script&gt;alert(&quot;Please select one of the available choices.&quot;);&lt;/script&gt;';<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo '&lt;script&gt;history.back(1);&lt;/script&gt;';<br />
&nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; else{<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; require_once('config.php');<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; $aid=$_POST['aid'];<br />
&nbsp; &nbsp; &nbsp; &nbsp; $qid=$_POST['qid'];<br />
&nbsp;  <br />
&nbsp; &nbsp; // update vote counter<br />
&nbsp; &nbsp; $query = &quot;UPDATE answers SET acount = acount + 1 WHERE aid = '$aid' AND qid = '$qid'&quot;;<br />
&nbsp; &nbsp; $result = mysql_query($query) or die(&quot;ERROR: $query. &quot;.mysql_error());<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; // close connection<br />
&nbsp; &nbsp; mysql_close();<br />
<br />
<br />
&nbsp; &nbsp; // print success message&nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; echo '&lt;script&gt;alert(&quot;Your have successfully voted.&quot;);&lt;/script&gt;';<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo '&lt;script&gt;location.replace(&quot;trysurvey.php&quot;);&lt;/script&gt;';<br />
}<br />
else {<br />
&nbsp; &nbsp; echo '&lt;script&gt;alert(&quot;Unable to submit your Vote. Please try again !!!&quot;);&lt;/script&gt;';<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo '&lt;script&gt;history.back(1);&lt;/script&gt;';<br />
}<br />
<br />
?&gt;</code><hr />
</div>please help... thanks in advance</div>

]]></content:encoded>
			<category domain="http://www.webmaster-talk.com/php-forum/">PHP Forum</category>
			<dc:creator>wayz1229</dc:creator>
			<guid isPermaLink="true">http://www.webmaster-talk.com/php-forum/191161-need-help-survey-voting.html</guid>
		</item>
		<item>
			<title>How to use Session in php??</title>
			<link>http://www.webmaster-talk.com/php-forum/191157-how-to-use-session-in-php.html</link>
			<pubDate>Sun, 08 Nov 2009 03:16:11 GMT</pubDate>
			<description><![CDATA[hai...please help me how to use session in php..I was create a page for register.In the register's page have NAMA and NOMBOR_ID..Now,i want to create...]]></description>
			<content:encoded><![CDATA[<div>hai...please help me how to use session in php..I was create a page for register.In the register's page have NAMA and NOMBOR_ID..Now,i want to create the vote's page and in the vote's page have NOMBOR_ID,CALON and JURUSAN.I want to use the NOMBOR_ID has been register in the register's page only can vote...please help me how to do????</div>

]]></content:encoded>
			<category domain="http://www.webmaster-talk.com/php-forum/">PHP Forum</category>
			<dc:creator>syaza</dc:creator>
			<guid isPermaLink="true">http://www.webmaster-talk.com/php-forum/191157-how-to-use-session-in-php.html</guid>
		</item>
		<item>
			<title><![CDATA[PHP mail() won't send to Gmail]]></title>
			<link>http://www.webmaster-talk.com/php-forum/191155-php-mail-wont-send-to-gmail.html</link>
			<pubDate>Sun, 08 Nov 2009 01:25:25 GMT</pubDate>
			<description>Has anyone else ever had this problem? I have a form that uses mail() to send form info to an email. It sends mail just fine to any email account I...</description>
			<content:encoded><![CDATA[<div>Has anyone else ever had this problem?<font color="black"> I have a form that uses mail() to send form info to </font>an email. It sends mail just fine to any email account I try except for my email domain that uses Google Apps. Does Gmail have something against HTML formatting from a php generated email?</div>

]]></content:encoded>
			<category domain="http://www.webmaster-talk.com/php-forum/">PHP Forum</category>
			<dc:creator>werm82</dc:creator>
			<guid isPermaLink="true">http://www.webmaster-talk.com/php-forum/191155-php-mail-wont-send-to-gmail.html</guid>
		</item>
		<item>
			<title>Having trouble with SIMPLE PHP Contact form... HELP!</title>
			<link>http://www.webmaster-talk.com/php-forum/191154-having-trouble-simple-php-contact-form.html</link>
			<pubDate>Sun, 08 Nov 2009 01:14:40 GMT</pubDate>
			<description><![CDATA[Okay, so I am helping a non-profit company with their website. As of right now I've got a simple .php file sending the email to the owner. No...]]></description>
			<content:encoded><![CDATA[<div>Okay, so I am helping a non-profit company with their website. As of right now I've got a simple .php file sending the email to the owner. No database.<br />
<br />
Right now I am in the testing phase.<br />
<br />
Well, I get the success page when I fill it out and hit submit. But no E-mail.<br />
<br />
I uploaded it to a different server and it worked GREAT... but in all of my fields it is chopping off one character.<br />
<br />
1). What can I change to get the non-profit server to allow me to use the simple .php script to send an Email? Never had an issue with this script before, and like I said, it WORKS on a different server.<br />
<br />
2). What would cause a php script to chop the last character off when it sends? Ex: Instead of &quot;Test&quot; I got &quot;Tes&quot;.<br />
<br />
Here's the PHP script:<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
	<div class="alt2">
		<hr />
		<code style="white-space:nowrap">
		<div dir="ltr" style="text-align:left;">
			<!-- php buffer start --><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">//&nbsp;Receiving&nbsp;variables<br /></span><span style="color: #007700">@</span><span style="color: #0000BB">$pfw_ip</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$_SERVER</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'REMOTE_ADDR'</span><span style="color: #007700">&#93;;<br />@</span><span style="color: #0000BB">$Send_product_literature&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">addslashes</span><span style="color: #007700">(</span><span style="color: #0000BB">$_POST</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'Send_product_literature?'</span><span style="color: #007700">&#93;);<br />@</span><span style="color: #0000BB">$Send_company_literature&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">addslashes</span><span style="color: #007700">(</span><span style="color: #0000BB">$_POST</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'Send_company_literature?'</span><span style="color: #007700">&#93;);<br />@</span><span style="color: #0000BB">$Have_a_salesperson_contact_me&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">addslashes</span><span style="color: #007700">(</span><span style="color: #0000BB">$_POST</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'Have_a_salesperson_contact_me?'</span><span style="color: #007700">&#93;);<br />@</span><span style="color: #0000BB">$Name&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">addslashes</span><span style="color: #007700">(</span><span style="color: #0000BB">$_POST</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'Name'</span><span style="color: #007700">&#93;);<br />@</span><span style="color: #0000BB">$Title&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">addslashes</span><span style="color: #007700">(</span><span style="color: #0000BB">$_POST</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'Title'</span><span style="color: #007700">&#93;);<br />@</span><span style="color: #0000BB">$Company&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">addslashes</span><span style="color: #007700">(</span><span style="color: #0000BB">$_POST</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'Company'</span><span style="color: #007700">&#93;);<br />@</span><span style="color: #0000BB">$Address&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">addslashes</span><span style="color: #007700">(</span><span style="color: #0000BB">$_POST</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'Address'</span><span style="color: #007700">&#93;);<br />@</span><span style="color: #0000BB">$Phone&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">addslashes</span><span style="color: #007700">(</span><span style="color: #0000BB">$_POST</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'Phone'</span><span style="color: #007700">&#93;);<br />@</span><span style="color: #0000BB">$Email&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">addslashes</span><span style="color: #007700">(</span><span style="color: #0000BB">$_POST</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'Email'</span><span style="color: #007700">&#93;);<br /><br /></span><span style="color: #FF8000">//&nbsp;Validation<br />//Sending&nbsp;Email&nbsp;to&nbsp;form&nbsp;owner<br /></span><span style="color: #0000BB">$pfw_header&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"From:&nbsp;$Email\n"<br />&nbsp;&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #DD0000">"Reply-To:&nbsp;$Email\n"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$pfw_subject&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"Online&nbsp;Information&nbsp;Request&nbsp;Form"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$pfw_email_to&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"myemail@gmail.com"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$pfw_message&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"Visitor's&nbsp;IP:&nbsp;$pfw_ip\n"<br /></span><span style="color: #007700">.&nbsp;</span><span style="color: #DD0000">"Send_product_literature:&nbsp;$Send_product_literature\n"<br /></span><span style="color: #007700">.&nbsp;</span><span style="color: #DD0000">"Send_company_literature:&nbsp;$Send_company_literature\n"<br /></span><span style="color: #007700">.&nbsp;</span><span style="color: #DD0000">"Have_a_salesperson_contact_me:&nbsp;$Have_a_salesperson_contact_me\n"<br /></span><span style="color: #007700">.&nbsp;</span><span style="color: #DD0000">"Name:&nbsp;$Name\n"<br /></span><span style="color: #007700">.&nbsp;</span><span style="color: #DD0000">"Title:&nbsp;$Title\n"<br /></span><span style="color: #007700">.&nbsp;</span><span style="color: #DD0000">"Company:&nbsp;$Company\n"<br /></span><span style="color: #007700">.&nbsp;</span><span style="color: #DD0000">"Address:&nbsp;$Address\n"<br /></span><span style="color: #007700">.&nbsp;</span><span style="color: #DD0000">"Phone:&nbsp;$Phone\n"<br /></span><span style="color: #007700">.&nbsp;</span><span style="color: #DD0000">"Email:&nbsp;$Email\n"</span><span style="color: #007700">;<br />@</span><span style="color: #0000BB">mail</span><span style="color: #007700">(</span><span style="color: #0000BB">$pfw_email_to</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$pfw_subject&nbsp;</span><span style="color: #007700">,</span><span style="color: #0000BB">$pfw_message&nbsp;</span><span style="color: #007700">,</span><span style="color: #0000BB">$pfw_header&nbsp;</span><span style="color: #007700">)&nbsp;;<br /><br /></span><span style="color: #0000BB">header</span><span style="color: #007700">(</span><span style="color: #DD0000">"Location:&nbsp;../success.php"</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code><!-- php buffer end -->
		</div>
		</code>
		<hr />
	</div>
</div>Oh, and yeah, I'm kind of a newbie here. I do some non-profit work for schools and what not to help them along with what I can do to save them money.</div>

]]></content:encoded>
			<category domain="http://www.webmaster-talk.com/php-forum/">PHP Forum</category>
			<dc:creator>redline5th</dc:creator>
			<guid isPermaLink="true">http://www.webmaster-talk.com/php-forum/191154-having-trouble-simple-php-contact-form.html</guid>
		</item>
		<item>
			<title>Community - specific</title>
			<link>http://www.webmaster-talk.com/php-forum/191152-community-specific.html</link>
			<pubDate>Sun, 08 Nov 2009 00:02:44 GMT</pubDate>
			<description><![CDATA[Hello :) 
 
I'm looking after a social script, where the users can create a blog, where the admins can create a blog, webtv, write articels .... 
 
I...]]></description>
			<content:encoded><![CDATA[<div>Hello :)<br />
<br />
I'm looking after a social script, where the users can create a blog, where the admins can create a blog, webtv, write articels ....<br />
<br />
I have tryed joomla and Boonex's dolphin, but that didn't worked out. I would like to get a script with most of these things, but if thats a problem. Then I will code the rest by myself.<br />
<br />
Thanks :)</div>

]]></content:encoded>
			<category domain="http://www.webmaster-talk.com/php-forum/">PHP Forum</category>
			<dc:creator>MultiWeb</dc:creator>
			<guid isPermaLink="true">http://www.webmaster-talk.com/php-forum/191152-community-specific.html</guid>
		</item>
		<item>
			<title>Update for every id</title>
			<link>http://www.webmaster-talk.com/php-forum/191140-update-for-every-id.html</link>
			<pubDate>Sat, 07 Nov 2009 18:57:07 GMT</pubDate>
			<description>I currently got this code, it updates the database when a form is submitted. It currently updates the row id 3 with this code: 
 
 
PHP: 
---------...</description>
			<content:encoded><![CDATA[<div>I currently got this code, it updates the database when a form is submitted. It currently updates the row id 3 with this code:<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
	<div class="alt2">
		<hr />
		<code style="white-space:nowrap">
		<div dir="ltr" style="text-align:left;">
			<!-- php buffer start --><code><span style="color: #000000">
<span style="color: #0000BB">$id&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">3</span><span style="color: #007700">;&nbsp;<br /></span><span style="color: #0000BB"></span>
</span>
</code><!-- php buffer end -->
		</div>
		</code>
		<hr />
	</div>
</div>and<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
	<div class="alt2">
		<hr />
		<code style="white-space:nowrap">
		<div dir="ltr" style="text-align:left;">
			<!-- php buffer start --><code><span style="color: #000000">
<span style="color: #0000BB">&nbsp;&nbsp;&nbsp;WHERE&nbsp;</span><span style="color: #007700">`</span><span style="color: #0000BB">id</span><span style="color: #007700">`&nbsp;=&nbsp;</span><span style="color: #DD0000">'".$id."'&nbsp;<br /></span><span style="color: #0000BB"></span>
</span>
</code><!-- php buffer end -->
		</div>
		</code>
		<hr />
	</div>
</div>How do I do it so it automatically picks every single row that's there?<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
	<div class="alt2">
		<hr />
		<code style="white-space:nowrap">
		<div dir="ltr" style="text-align:left;">
			<!-- php buffer start --><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #007700">if&nbsp;(isset&nbsp;(</span><span style="color: #0000BB">$_POST</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'submit'</span><span style="color: #007700">&#93;))&nbsp;</span><span style="color: #FF8000">//&nbsp;if&nbsp;the&nbsp;form&nbsp;was&nbsp;submitted,&nbsp;display&nbsp;their&nbsp;name<br /></span><span style="color: #007700">{<br />require_once&nbsp;(</span><span style="color: #DD0000">'inc/config.php'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$title&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">mysql_real_escape_string&nbsp;</span><span style="color: #007700">(</span><span style="color: #0000BB">$_POST</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'title'</span><span style="color: #007700">&#93;);<br /></span><span style="color: #0000BB">$url&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">mysql_real_escape_string&nbsp;</span><span style="color: #007700">(</span><span style="color: #0000BB">$_POST</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'url'</span><span style="color: #007700">&#93;);<br /><br /></span><span style="color: #0000BB">$mainnewstitle&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">mysql_real_escape_string&nbsp;</span><span style="color: #007700">(</span><span style="color: #0000BB">$_POST</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'mainnewstitle'</span><span style="color: #007700">&#93;);<br /></span><span style="color: #0000BB">$mainnewsdate&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">mysql_real_escape_string&nbsp;</span><span style="color: #007700">(</span><span style="color: #0000BB">$_POST</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'mainnewsdate'</span><span style="color: #007700">&#93;);<br /></span><span style="color: #0000BB">$mainnewsimage&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">mysql_real_escape_string&nbsp;</span><span style="color: #007700">(</span><span style="color: #0000BB">$_POST</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'mainnewsimage'</span><span style="color: #007700">&#93;);<br /></span><span style="color: #0000BB">$mainnewsmessage&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">mysql_real_escape_string&nbsp;</span><span style="color: #007700">(</span><span style="color: #0000BB">$_POST</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'mainnewsmessage'</span><span style="color: #007700">&#93;);<br /></span><span style="color: #0000BB">$mainnewslink&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">mysql_real_escape_string&nbsp;</span><span style="color: #007700">(</span><span style="color: #0000BB">$_POST</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'mainnewslink'</span><span style="color: #007700">&#93;);<br /><br /></span><span style="color: #0000BB">$firstnewstitle&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">mysql_real_escape_string&nbsp;</span><span style="color: #007700">(</span><span style="color: #0000BB">$_POST</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'firstnewstitle'</span><span style="color: #007700">&#93;);<br /></span><span style="color: #0000BB">$firstnewsdate&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">mysql_real_escape_string&nbsp;</span><span style="color: #007700">(</span><span style="color: #0000BB">$_POST</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'firstnewsdate'</span><span style="color: #007700">&#93;);<br /></span><span style="color: #0000BB">$firstnewsmessage&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">mysql_real_escape_string&nbsp;</span><span style="color: #007700">(</span><span style="color: #0000BB">$_POST</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'firstnewsmessage'</span><span style="color: #007700">&#93;);<br /><br /></span><span style="color: #0000BB">$secondnewstitle&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">mysql_real_escape_string&nbsp;</span><span style="color: #007700">(</span><span style="color: #0000BB">$_POST</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'secondnewstitle'</span><span style="color: #007700">&#93;);<br /></span><span style="color: #0000BB">$secondnewsdate&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">mysql_real_escape_string&nbsp;</span><span style="color: #007700">(</span><span style="color: #0000BB">$_POST</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'secondnewsdate'</span><span style="color: #007700">&#93;);<br /></span><span style="color: #0000BB">$secondnewsmessage&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">mysql_real_escape_string&nbsp;</span><span style="color: #007700">(</span><span style="color: #0000BB">$_POST</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'secondnewsmessage'</span><span style="color: #007700">&#93;);<br /><br /></span><span style="color: #0000BB">$thirdnewstitle&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">mysql_real_escape_string&nbsp;</span><span style="color: #007700">(</span><span style="color: #0000BB">$_POST</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'thirdnewstitle'</span><span style="color: #007700">&#93;);<br /></span><span style="color: #0000BB">$thirdnewsdate&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">mysql_real_escape_string&nbsp;</span><span style="color: #007700">(</span><span style="color: #0000BB">$_POST</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'thirdnewsdate'</span><span style="color: #007700">&#93;);<br /></span><span style="color: #0000BB">$thirdnewsmessage&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">mysql_real_escape_string&nbsp;</span><span style="color: #007700">(</span><span style="color: #0000BB">$_POST</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'thirdnewsmessage'</span><span style="color: #007700">&#93;);<br /><br /></span><span style="color: #0000BB">$id&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">3</span><span style="color: #007700">;&nbsp;&nbsp;<br /></span><span style="color: #0000BB">$sql&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">"<br />&nbsp;&nbsp;&nbsp;UPDATE&nbsp;`news`&nbsp;SET&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`title`&nbsp;=&nbsp;'"</span><span style="color: #007700">.</span><span style="color: #0000BB">$title</span><span style="color: #007700">.</span><span style="color: #DD0000">"',&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`url`&nbsp;=&nbsp;'"</span><span style="color: #007700">.</span><span style="color: #0000BB">$url</span><span style="color: #007700">.</span><span style="color: #DD0000">"',<br />&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`mainnewstitle`&nbsp;=&nbsp;'"</span><span style="color: #007700">.</span><span style="color: #0000BB">$mainnewstitle</span><span style="color: #007700">.</span><span style="color: #DD0000">"',<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`mainnewsdate`&nbsp;=&nbsp;'"</span><span style="color: #007700">.</span><span style="color: #0000BB">$mainnewsdate</span><span style="color: #007700">.</span><span style="color: #DD0000">"',<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`mainnewsimage`&nbsp;=&nbsp;'"</span><span style="color: #007700">.</span><span style="color: #0000BB">$mainnewsimage</span><span style="color: #007700">.</span><span style="color: #DD0000">"',<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`mainnewsmessage`&nbsp;=&nbsp;'"</span><span style="color: #007700">.</span><span style="color: #0000BB">$mainnewsmessage</span><span style="color: #007700">.</span><span style="color: #DD0000">"',<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`mainnewslink`&nbsp;=&nbsp;'"</span><span style="color: #007700">.</span><span style="color: #0000BB">$mainnewslink</span><span style="color: #007700">.</span><span style="color: #DD0000">"',<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`firstnewstitle`&nbsp;=&nbsp;'"</span><span style="color: #007700">.</span><span style="color: #0000BB">$firstnewstitle</span><span style="color: #007700">.</span><span style="color: #DD0000">"',<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`firstnewsmessage`&nbsp;=&nbsp;'"</span><span style="color: #007700">.</span><span style="color: #0000BB">$firstnewsmessage</span><span style="color: #007700">.</span><span style="color: #DD0000">"',&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`firstnewsdate`&nbsp;=&nbsp;'"</span><span style="color: #007700">.</span><span style="color: #0000BB">$firstnewsdate</span><span style="color: #007700">.</span><span style="color: #DD0000">"',<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`secondnewstitle`&nbsp;=&nbsp;'"</span><span style="color: #007700">.</span><span style="color: #0000BB">$secondnewstitle</span><span style="color: #007700">.</span><span style="color: #DD0000">"',<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`secondnewsmessage`&nbsp;=&nbsp;'"</span><span style="color: #007700">.</span><span style="color: #0000BB">$secondnewsmessage</span><span style="color: #007700">.</span><span style="color: #DD0000">"',&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`secondnewsdate`&nbsp;=&nbsp;'"</span><span style="color: #007700">.</span><span style="color: #0000BB">$secondnewsdate</span><span style="color: #007700">.</span><span style="color: #DD0000">"',&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`thirdnewstitle`&nbsp;=&nbsp;'"</span><span style="color: #007700">.</span><span style="color: #0000BB">$thirdnewstitle</span><span style="color: #007700">.</span><span style="color: #DD0000">"',<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`thirdnewsmessage`&nbsp;=&nbsp;'"</span><span style="color: #007700">.</span><span style="color: #0000BB">$thirdnewsmessage</span><span style="color: #007700">.</span><span style="color: #DD0000">"',<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`thirdnewsdate`&nbsp;=&nbsp;'"</span><span style="color: #007700">.</span><span style="color: #0000BB">$thirdnewsdate</span><span style="color: #007700">.</span><span style="color: #DD0000">"'&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;WHERE&nbsp;`id`&nbsp;=&nbsp;'"</span><span style="color: #007700">.</span><span style="color: #0000BB">$id</span><span style="color: #007700">.</span><span style="color: #DD0000">"'<br />"</span><span style="color: #007700">)<br />OR&nbsp;die&nbsp;(</span><span style="color: #0000BB">mysql_error</span><span style="color: #007700">());<br />echo&nbsp;</span><span style="color: #DD0000">"Your&nbsp;website&nbsp;news&nbsp;have&nbsp;been&nbsp;updated.&nbsp;&lt;hr&gt;"</span><span style="color: #007700">;<br />}<br /><br />require_once&nbsp;(</span><span style="color: #DD0000">'inc/config.php'</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;FROM&nbsp;`news`"</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</span><span style="color: #007700">(</span><span style="color: #0000BB">$query</span><span style="color: #007700">)&nbsp;or&nbsp;die(</span><span style="color: #0000BB">mysql_error</span><span style="color: #007700">());<br />while&nbsp;(</span><span style="color: #0000BB">$row&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">mysql_fetch_array&nbsp;</span><span style="color: #007700">(</span><span style="color: #0000BB">$result</span><span style="color: #007700">))<br />{<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code><!-- php buffer end -->
		</div>
		</code>
		<hr />
	</div>
</div></div>

]]></content:encoded>
			<category domain="http://www.webmaster-talk.com/php-forum/">PHP Forum</category>
			<dc:creator>sith717</dc:creator>
			<guid isPermaLink="true">http://www.webmaster-talk.com/php-forum/191140-update-for-every-id.html</guid>
		</item>
	</channel>
</rss>
