<?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>Code Forums</title>
		<link>http://codenewbie.com/forums/</link>
		<description>Code Forums, PHP, Java, C, C++, C#, Python, Perl, VB,  ASP.NET, .NET, HTML, Javascript, Forum, Tutorial, Example, Script, Method, Function, Web, Programming, Linux, Security</description>
		<language>en</language>
		<lastBuildDate>Tue, 07 Sep 2010 01:15:03 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>60</ttl>
		<image>
			<url>http://codenewbie.com/forums/images/misc/rss.png</url>
			<title>Code Forums</title>
			<link>http://codenewbie.com/forums/</link>
		</image>
		<item>
			<title>Javascript help</title>
			<link>http://codenewbie.com/forums/threads/6119-Javascript-help?goto=newpost</link>
			<pubDate>Sun, 05 Sep 2010 22:23:37 GMT</pubDate>
			<description><![CDATA[Sorry new to javascript, i am created this script but i dont understand where i have gone wrong please help 
 
 
Code: 
--------- 
<html>  
 <head>  
  <title>Untitled Document</title>  
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">  
  <link...]]></description>
			<content:encoded><![CDATA[<div>Sorry new to javascript, i am created this script but i dont understand where i have gone wrong please help<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">&lt;html&gt; <br />
&nbsp;&lt;head&gt; <br />
&nbsp; &lt;title&gt;Untitled Document&lt;/title&gt; <br />
&nbsp; &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;&gt; <br />
&nbsp; &lt;link href=&quot;template/stylesheet.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;&gt; <br />
&nbsp; &lt;script language=&quot;javascript&quot; type=&quot;text/javascript&quot;&gt; <br />
&nbsp; function info()<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; document.getElementById('POP_UP_INFO_MINI').style.diplay = 'Block';<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &lt;/script&gt; <br />
&nbsp;&lt;/head&gt; <br />
&nbsp;&lt;body&gt; <br />
&nbsp;<br />
&nbsp; &lt;div id=&quot;POP_UP_INFO_MINI&quot;&gt; <br />
&nbsp;  &lt;div id=&quot;POP_UP_INFO_MINI_INNER&quot;&gt; <br />
&nbsp;  &lt;/div&gt; <br />
&nbsp; &lt;/div&gt; <br />
&nbsp; &lt;a href=&quot;javascript<b></b>:info()&quot; onMouseOver=&quot;info()&quot;&gt;Test&lt;/a&gt; <br />
&nbsp;&lt;/body&gt; <br />
&lt;/html&gt;</code><hr />
</div> </div>

 ]]></content:encoded>
			<category domain="http://codenewbie.com/forums/forums/23-HTML-XML-Javascript-AJAX">HTML, XML, Javascript, AJAX</category>
			<dc:creator>jnich104</dc:creator>
			<guid isPermaLink="true">http://codenewbie.com/forums/threads/6119-Javascript-help</guid>
		</item>
		<item>
			<title>Query results to Excel</title>
			<link>http://codenewbie.com/forums/threads/6117-Query-results-to-Excel?goto=newpost</link>
			<pubDate>Thu, 02 Sep 2010 16:35:26 GMT</pubDate>
			<description>Hi All, 
 
Can anybody let me know the step by step process to write the query results which is generated by a java program to an excel file. 
 
Thanks in advance.:)</description>
			<content:encoded><![CDATA[<div>Hi All,<br />
<br />
Can anybody let me know the step by step process to write the query results which is generated by a java program to an excel file.<br />
<br />
Thanks in advance.:)</div>

 ]]></content:encoded>
			<category domain="http://codenewbie.com/forums/forums/28-Java">Java</category>
			<dc:creator>@script</dc:creator>
			<guid isPermaLink="true">http://codenewbie.com/forums/threads/6117-Query-results-to-Excel</guid>
		</item>
		<item>
			<title>How to fetch the exact height attribute of html divs in IE?</title>
			<link>http://codenewbie.com/forums/threads/6115-How-to-fetch-the-exact-height-attribute-of-html-divs-in-IE?goto=newpost</link>
			<pubDate>Tue, 31 Aug 2010 12:54:47 GMT</pubDate>
			<description><![CDATA[I want to get the dynamic heights of some html divs. I am not programmatically applying height to them (so I don't know their values). If I fetch the height in mozilla I am able to fetch the exact value in px but in case of IE it gives "auto". How do I get their exact values? Please help]]></description>
			<content:encoded><![CDATA[<div>I want to get the dynamic heights of some html divs. I am not programmatically applying height to them (so I don't know their values). If I fetch the height in mozilla I am able to fetch the exact value in px but in case of IE it gives &quot;auto&quot;. How do I get their exact values? Please help</div>

 ]]></content:encoded>
			<category domain="http://codenewbie.com/forums/forums/23-HTML-XML-Javascript-AJAX">HTML, XML, Javascript, AJAX</category>
			<dc:creator>brightbill</dc:creator>
			<guid isPermaLink="true">http://codenewbie.com/forums/threads/6115-How-to-fetch-the-exact-height-attribute-of-html-divs-in-IE</guid>
		</item>
		<item>
			<title>Javascript Display help please</title>
			<link>http://codenewbie.com/forums/threads/6114-Javascript-Display-help-please?goto=newpost</link>
			<pubDate>Tue, 31 Aug 2010 12:25:41 GMT</pubDate>
			<description>I am trying to create a navigation system which when the bar is open and you click it, it will disappear, if it is closed then it appears. 
 
This is my code 
 
Javascript 
 
Code: 
--------- 
function nav(a) 
	{</description>
			<content:encoded><![CDATA[<div>I am trying to create a navigation system which when the bar is open and you click it, it will disappear, if it is closed then it appears.<br />
<br />
This is my code<br />
<br />
<i>Javascript</i><br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">function nav(a)<br />
&nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(document.getElementById(a).style.display == 'block')<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; &nbsp; &nbsp; &nbsp; &nbsp; document.getElementById(a).style.display == 'none';<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; &nbsp; &nbsp; &nbsp; &nbsp; else<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; &nbsp; &nbsp; &nbsp; &nbsp; document.getElementById(a).style.display == 'block';<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; }</code><hr />
</div> <i>Html</i><br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">&nbsp; &nbsp; &nbsp; &nbsp;  &lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot;&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  &lt;tr&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  &lt;td id=&quot;nav&quot; width=&quot;200&quot;&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  &lt;div class=&quot;nav&quot;&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;a href=&quot;javascript<b></b>:nav('nav_1')&quot;&gt;Navigation&lt;/a&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  &lt;/div&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  &lt;div id=&quot;nav_1&quot; class=&quot;nav_under&quot;&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;a href=&quot;#&quot;&gt;Navigation&lt;/a&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  &lt;/div&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  &lt;div class=&quot;nav&quot;&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;a href=&quot;javascript<b></b>:nav_2()&quot;&gt;Navigation&lt;/a&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  &lt;/div&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  &lt;div id=&quot;nav_2&quot; class=&quot;nav_under&quot;&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;a href=&quot;#&quot;&gt;Navigation&lt;/a&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  &lt;/div&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  &lt;/td&gt;</code><hr />
</div> the javascript is attacted to the page, and nothing happens when i click a button.<br />
<br />
Please help</div>

 ]]></content:encoded>
			<category domain="http://codenewbie.com/forums/forums/23-HTML-XML-Javascript-AJAX">HTML, XML, Javascript, AJAX</category>
			<dc:creator>jnich104</dc:creator>
			<guid isPermaLink="true">http://codenewbie.com/forums/threads/6114-Javascript-Display-help-please</guid>
		</item>
		<item>
			<title>JQuery - Help Noobie</title>
			<link>http://codenewbie.com/forums/threads/6113-JQuery-Help-Noobie?goto=newpost</link>
			<pubDate>Sun, 29 Aug 2010 22:59:34 GMT</pubDate>
			<description>I am new to jquery, and i would like to know how to create something, where a div will close and another will side open kinda thing. like an animation thing please help.</description>
			<content:encoded><![CDATA[<div>I am new to jquery, and i would like to know how to create something, where a div will close and another will side open kinda thing. like an animation thing please help.</div>

 ]]></content:encoded>
			<category domain="http://codenewbie.com/forums/forums/23-HTML-XML-Javascript-AJAX">HTML, XML, Javascript, AJAX</category>
			<dc:creator>jnich104</dc:creator>
			<guid isPermaLink="true">http://codenewbie.com/forums/threads/6113-JQuery-Help-Noobie</guid>
		</item>
		<item>
			<title>Simple Utility</title>
			<link>http://codenewbie.com/forums/threads/6112-Simple-Utility?goto=newpost</link>
			<pubDate>Fri, 27 Aug 2010 19:44:36 GMT</pubDate>
			<description>Hello, 
 
I am working to make a very very basic utility and am having trouble doing one action in the program. To explain what I am doing, I am making a utility to just simply open up programs that are located in the same folder as my executable. 
 
In short I want to make a simple GUI program to...</description>
			<content:encoded><![CDATA[<div>Hello,<br />
<br />
I am working to make a very very basic utility and am having trouble doing one action in the program. To explain what I am doing, I am making a utility to just simply open up programs that are located in the same folder as my executable.<br />
<br />
In short I want to make a simple GUI program to open some install files for the game Oblivion. This utility is going to work as an executable on a cd to run the DLC  (downloaded content) install files.<br />
<br />
I am working with VB 2010 Express.<br />
<br />
Here is where I am having the trouble:<br />
<br />
I understand that I can execute a file using the shell() command, however I don't want to provide a path as it could be located anywhere, the gui program that is. However instead I want it to search for the files its going to execute in the folder I place the exe into and then run them by clicking on the appropriate buttons.<br />
<br />
I realize that this is extremely simple for most vb programmers, however, I am not very well versed in VB and my experience is in web programming, java, php, xhtml, etc..<br />
<br />
If anyone cares to help please post a reply.</div>

 ]]></content:encoded>
			<category domain="http://codenewbie.com/forums/forums/54-MS-Technologies-(-ASP-VB-C-.NET-)">MS Technologies ( ASP, VB, C#, .NET  )</category>
			<dc:creator>dsipos</dc:creator>
			<guid isPermaLink="true">http://codenewbie.com/forums/threads/6112-Simple-Utility</guid>
		</item>
		<item>
			<title>String Lengths</title>
			<link>http://codenewbie.com/forums/threads/6105-String-Lengths?goto=newpost</link>
			<pubDate>Tue, 24 Aug 2010 21:50:12 GMT</pubDate>
			<description>Working with lengths of strings can come in handy very often. If you need to find how long a string is you can, or if you need to break a string down into parts, you can. 
 
1. Open a new project 
2. Add one textbox and Four buttons (excessive but I am breaking each thing down) 
3. Name buttons...</description>
			<content:encoded><![CDATA[<div>Working with lengths of strings can come in handy very often. If you need to find how long a string is you can, or if you need to break a string down into parts, you can.<br />
<br />
1. Open a new project<br />
2. Add one textbox and Four buttons (excessive but I am breaking each thing down)<br />
3. Name buttons (text AND name)<br />
button1 = btnCountChars<br />
button2 = btnFirstThree<br />
button3 = btnSecondThree<br />
button4 = btnLastThree<br />
4. Double click your first button and add this<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">Dim strLengthDemo As String = TextBox1.Text<br />
MessageBox.Show(strlengthdemo.Length.ToString &amp; &quot; characters&quot;)</code><hr />
</div> -This code will show the length of strLengthDemo. You add the ToString part because integers could be added to the textbox.<br />
5. Double click your second button and add this<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">Dim strLengthDemo As String = TextBox1.Text<br />
MessageBox.Show(strLengthDemo.Substring(0, 3))</code><hr />
</div> -This is giving visual basic a starting point and how many characters to grab.<br />
-This will get the first three characters in your textbox<br />
6. Double click your third button and add this<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">Dim strLengthDemo As String = TextBox1.Text<br />
MessageBox.Show(strLengthDemo.Substring(3, 3))</code><hr />
</div> -This will start after the third character and grab 3 more and display them within a messagebox<br />
7. Double click your fourth button and add this<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">Dim strLengthDemo As String = TextBox1.Text<br />
MessageBox.Show(strLengthDemo.Substring(strLengthDemo.Length&#8212;3))</code><hr />
</div> -This tells visual basic to get the last three characters of your string.<br />
8. Run your program (F5) and type in a 9 letter word. Or just 9 letters. Click each button to see how it works!<br />
<br />
I will keep thinking of more beginner tuts soon enough. So keep waiting for them if you think I am helping.</div>

 ]]></content:encoded>
			<category domain="http://codenewbie.com/forums/forums/54-MS-Technologies-(-ASP-VB-C-.NET-)">MS Technologies ( ASP, VB, C#, .NET  )</category>
			<dc:creator>vbboard</dc:creator>
			<guid isPermaLink="true">http://codenewbie.com/forums/threads/6105-String-Lengths</guid>
		</item>
		<item>
			<title>Hello User Program</title>
			<link>http://codenewbie.com/forums/threads/6104-Hello-User-Program?goto=newpost</link>
			<pubDate>Tue, 24 Aug 2010 21:49:08 GMT</pubDate>
			<description><![CDATA[Most people are used to the basic one button click "Hello World" tutorial. But today I am going to show you the little bit more advanced version called "Hello User" 
 
First open up Visual Basic, I use the 2010 Express version which you can download at http://www.microsoft.com/express/downloads/ 
...]]></description>
			<content:encoded><![CDATA[<div>Most people are used to the basic one button click &quot;Hello World&quot; tutorial. But today I am going to show you the little bit more advanced version called &quot;Hello User&quot;<br />
<br />
First open up Visual Basic, I use the 2010 Express version which you can download at <a href="http://www.microsoft.com/express/downloads/" target="_blank">http://www.microsoft.com/express/downloads/</a><br />
<br />
Go to File &gt; New Project &gt; Windows Forms Application and at the bottom name it &quot;Hello User&quot;<br />
<br />
You should now have a blank &quot;Form1&quot; application. Click the grey area and in the bottom right corner you should see the properties box. Scroll to the text property and change it to what ever you want, probably &quot;Hello User&quot;. Press enter and you will see the name of your form has changed, that is what the text property does.<br />
<br />
Now, add a label control to your form from the toolbox.<br />
Note: If you can't see the toolbox click Ctrl+Alt+X<br />
Click the label and change the text property to &quot;Enter your name&quot;<br />
<br />
Add a textbox control and move it under the label. This is where the user will enter their name into. Change the &quot;Name&quot; property to txtName.<br />
Note: The name property is used to reference to the control in your code.<br />
<br />
Add two button controls<br />
1. Change the text property to &quot;Ok&quot; and the name property to &quot;btnOk&quot;<br />
2.Change the text property to &quot;Exit&quot; and the name property to &quot;btnExit&quot;<br />
<br />
Double click the Ok button and add the bolded code.<br />
 <div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">Private Sub btnOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK.Click<br />
<b>&nbsp; &nbsp; &nbsp; &nbsp; 'displays a message box greeting to the user<br />
&nbsp; &nbsp; &nbsp; &nbsp; MessageBox.Show(&quot;Hello, &quot; &amp; txtName.Text &amp; &quot;! Welcome to VB 2010&quot;)</b><br />
&nbsp; &nbsp; End Sub</code><hr />
</div> Messagebox.show = Pops up a message box with whatever is in the parenthesis.<br />
(&quot;Hello, &quot; &amp; txtName.Text &amp; &quot;! Welcome to VB 2010&quot;) = Will show as exactly what it says. txtName.text will get the text from your textbox control.<br />
Ampersands(&amp;) = connect what is in between the quotation marks and your code. There must be a blank space preceding it.<br />
<br />
Return to your Design editor and double click the exit button<br />
Once again, add the bolded code<br />
<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click<br />
&nbsp; &nbsp; &nbsp; &nbsp; <b>Me.Close()</b><br />
&nbsp; &nbsp; End Sub</code><hr />
</div> Me = tells the program it will act upon itself<br />
close = obviously close<br />
<br />
Now go to File &gt; Save All and browse to the folder you want to save it to. Then hit &quot;F5&quot; or the green button that says start debugging to start your program. Type a name and hit &quot;ok&quot; and tada, you get a lovely greeting to visual basic 2010. Now hit exit and it closes. If you want to get an exe file for your program go to Debug &gt; Build. This will build it into the same place you saved it. It will be found in Bin &gt; Release &gt; Program.exe<br />
<br />
Enjoy Everyone,<br />
Zer[o]</div>

 ]]></content:encoded>
			<category domain="http://codenewbie.com/forums/forums/54-MS-Technologies-(-ASP-VB-C-.NET-)">MS Technologies ( ASP, VB, C#, .NET  )</category>
			<dc:creator>vbboard</dc:creator>
			<guid isPermaLink="true">http://codenewbie.com/forums/threads/6104-Hello-User-Program</guid>
		</item>
		<item>
			<title>Coding Practice</title>
			<link>http://codenewbie.com/forums/threads/6103-Coding-Practice?goto=newpost</link>
			<pubDate>Tue, 24 Aug 2010 21:47:39 GMT</pubDate>
			<description>This is information for the very beginner. These are random things that are good habits for new coders to pick up. None of these practices are mandatory but will help you and other people read your sources. 
-If you have more good coding practices tell me and I will add them to this post! 
 
1....</description>
			<content:encoded><![CDATA[<div>This is information for the very beginner. These are random things that are good habits for new coders to pick up. None of these practices are mandatory but will help you and other people read your sources.<br />
-If you have more good coding practices tell me and I will add them to this post!<br />
<br />
1. Using a Name Prefix: When naming each of your controls it is always a good coding practice to give them a prefix and then name them according to what they do<br />
(or a lot of the time their 'text' name). The prefix is always all lowercase letters. This helps you remember exactly what you are coding when you use your control.<br />
<br />
<br />
Common Controls and Prefixes:<br />
-Button = btn<br />
-ComboBox = cbo<br />
-CheckBox = chk<br />
-Label = lbl<br />
-ListBox = lst<br />
-RadioButton = rdb<br />
-PictureBox = pic<br />
-TextBox = txt<br />
<br />
Examples (if you don't get the idea):<br />
-btnExit<br />
-cboEmailProvider<br />
-chkPasswordShow<br />
-lblStatus<br />
-lstFriends<br />
ect<br />
<br />
2. Using White Space and Grouping: Coders use white space to make their code easier to read and also organize it. Also, group things that have to do with eachother.<br />
<br />
Bad:<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">dim string1 as string = textbox1.text<br />
dim string2 as string = textbox2.text<br />
dim int1 as integer = numericupdown1.value<br />
if string1.contains(&quot;blah&quot;) then<br />
messagebox.show(&quot;blah&quot;)<br />
else <br />
end if<br />
if int1=12 then<br />
messagebox.show(&quot;int1 = 12&quot;)<br />
else<br />
end if<br />
if string2.contains(&quot;flubble&quot;) then<br />
messagebox.show(&quot;flubble&quot;)<br />
else<br />
end if</code><hr />
</div> Good: <br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">dim string1 as string = textbox1.text<br />
<br />
if string1.contains(&quot;blah&quot;) then<br />
messagebox.show(&quot;blah&quot;)<br />
else <br />
end if<br />
<br />
dim string2 as string = textbox2.text<br />
<br />
if string2.contains(&quot;flubble&quot;) then<br />
messagebox.show(&quot;flubble&quot;)<br />
else<br />
end if<br />
<br />
dim int1 as integer = numericupdown1.value<br />
<br />
if int1=12 then<br />
messagebox.show(&quot;int1 = 12&quot;)<br />
else<br />
end if</code><hr />
</div> 3. Comment things that may be confusing. Put a single quotation mark to start a comment (') and it will comment everything on the same line out. Use this for adding notes to your projects!<br />
<br />
Commented Code (these are self explanatory but always useful with complex code):<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">'Define String1 as a string to find the length of later<br />
dim string1 as string = textbox1.text<br />
<br />
'Find the last 3 characters of string1 and show them in a messagebox to the user<br />
MessageBox.Show(string1.Substring(string1.Length&#8212;3)</code><hr />
</div> </div>

 ]]></content:encoded>
			<category domain="http://codenewbie.com/forums/forums/54-MS-Technologies-(-ASP-VB-C-.NET-)">MS Technologies ( ASP, VB, C#, .NET  )</category>
			<dc:creator>vbboard</dc:creator>
			<guid isPermaLink="true">http://codenewbie.com/forums/threads/6103-Coding-Practice</guid>
		</item>
		<item>
			<title>Browse Folder Dialog</title>
			<link>http://codenewbie.com/forums/threads/6102-Browse-Folder-Dialog?goto=newpost</link>
			<pubDate>Tue, 24 Aug 2010 21:43:57 GMT</pubDate>
			<description>Alright guys so I am going to show you how to create a browsefolderdialog. All this does it popup to the user and let them choose a folder. 
 
For this you need: 
1 Button 
1 Textbox 
 
Double click your button and add in the code: 
 
 
Code:</description>
			<content:encoded><![CDATA[<div>Alright guys so I am going to show you how to create a browsefolderdialog. All this does it popup to the user and let them choose a folder.<br />
<br />
For this you need:<br />
1 Button<br />
1 Textbox<br />
<br />
Double click your button and add in the code:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click<br />
&nbsp; &nbsp; &nbsp; &nbsp; Dim BrowseFolder As New FolderBrowserDialog<br />
&nbsp; &nbsp; &nbsp; &nbsp; BrowseFolder.ShowDialog()<br />
&nbsp; &nbsp; &nbsp; &nbsp; TextBox1.Text = BrowseFolder.SelectedPath<br />
&nbsp; &nbsp; End Sub</code><hr />
</div> <br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">Dim BrowseFolder As New FolderBrowserDialog</code><hr />
</div> This defines BrowseFolder as your FolderBrowserDialog<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">BrowseFolder.ShowDialog()</code><hr />
</div> This makes your FolderBrowserDialog pop-up to the user and lets them select their path<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">TextBox1.Text = BrowseFolder.SelectedPath</code><hr />
</div> This sets your textbox1.text to what ever folder is selected.<br />
<br />
After that you can do whatever you want with your selected folder.</div>

 ]]></content:encoded>
			<category domain="http://codenewbie.com/forums/forums/54-MS-Technologies-(-ASP-VB-C-.NET-)">MS Technologies ( ASP, VB, C#, .NET  )</category>
			<dc:creator>vbboard</dc:creator>
			<guid isPermaLink="true">http://codenewbie.com/forums/threads/6102-Browse-Folder-Dialog</guid>
		</item>
		<item>
			<title>Concatenation</title>
			<link>http://codenewbie.com/forums/threads/6101-Concatenation?goto=newpost</link>
			<pubDate>Tue, 24 Aug 2010 21:42:48 GMT</pubDate>
			<description>Concatenation is pretty much the addition of strings. This is frequently used in many programs and also a very simple concept. 
 
Here is an example: 
1. Open a new project 
2. Add one button and two textboxes 
3. Double click your button and add this code: 
  
Code: 
--------- 
 Dim strOne As...</description>
			<content:encoded><![CDATA[<div>Concatenation is pretty much the addition of strings. This is frequently used in many programs and also a very simple concept.<br />
<br />
Here is an example:<br />
1. Open a new project<br />
2. Add one button and two textboxes<br />
3. Double click your button and add this code:<br />
 <div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code"> Dim strOne As String<br />
&nbsp; &nbsp; &nbsp; &nbsp; Dim strTwo As String<br />
&nbsp; &nbsp; &nbsp; &nbsp; strOne = TextBox1.Text<br />
&nbsp; &nbsp; &nbsp; &nbsp; strTwo = TextBox2.Text<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; MessageBox.Show(strOne &amp; &quot; &quot; &amp; strTwo)</code><hr />
</div> Explanation:<br />
-If you didn't know dim is the same thing as &quot;define&quot; it defines your variables. We defined two different strings here (strOne and strTwo).<br />
-We then set each string equal to a textbox. It is set to textbox1/2.TEXT because you are setting it equal to what was entered into the textbox.<br />
-After defining variables we use messagebox.show (pretty much a pop up which you can add extra functions but I will not use those) and we are making it show strOne, a space, and strTwo.<br />
-Notice we use the ampersand (&amp;). This is what you use to connect any variable with anything in quotes. We connect what ever strOne is equal to, a space (between quotes is the space), and what ever strTwo is equal to.<br />
-Run your application (F5) and enter &quot;Hello&quot; in the first textbox and &quot;Bob&quot; in the second. click your button and a messagebox should pop up saying &quot;Hello Bob&quot;<br />
<br />
<br />
Mess around with random uses like this until you get the hang of it. Then keep moving forward in your Visual Basic Career :P</div>

 ]]></content:encoded>
			<category domain="http://codenewbie.com/forums/forums/54-MS-Technologies-(-ASP-VB-C-.NET-)">MS Technologies ( ASP, VB, C#, .NET  )</category>
			<dc:creator>vbboard</dc:creator>
			<guid isPermaLink="true">http://codenewbie.com/forums/threads/6101-Concatenation</guid>
		</item>
		<item>
			<title><![CDATA[MySQL & PHP (Messaging Service)]]></title>
			<link>http://codenewbie.com/forums/threads/6093-MySQL-amp-PHP-(Messaging-Service)?goto=newpost</link>
			<pubDate>Sun, 15 Aug 2010 12:46:09 GMT</pubDate>
			<description><![CDATA[PHP 
 
Code: 
--------- 
mysql_select_db($MySQL_Name, $con); 
	$mes = mysql_query("SELECT * FROM messages WHERE to='".$_SESSION[$prifix.'id']."'"); 
 
	while($res = mysql_fetch_array($mes)) 
	  { 
		 $result2 = mysql_query("SELECT * FROM accounts WHERE id = '".$res['from']."'");]]></description>
			<content:encoded><![CDATA[<div>PHP<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">mysql_select_db($MySQL_Name, $con);<br />
&nbsp; &nbsp; &nbsp; &nbsp; $mes = mysql_query(&quot;SELECT * FROM messages WHERE to='&quot;.$_SESSION[$prifix.'id'].&quot;'&quot;);<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; while($res = mysql_fetch_array($mes))<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $result2 = mysql_query(&quot;SELECT * FROM accounts WHERE id = '&quot;.$res['from'].&quot;'&quot;);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; while($row2 = mysql_fetch_array($result2))<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo '&lt;tr&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td width=&quot;80%&quot;&gt;'.$res['subject'].'&lt;/td&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td width=&quot;20%&quot;&gt;&amp;nbsp;&lt;/td&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/tr&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;'.$$res['message'].'&lt;/td&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;From : '.$row2['fullname'].'&lt;/td&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/tr&gt;';<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</code><hr />
</div> MySQL<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">&nbsp; &nbsp; &nbsp; &nbsp; id&nbsp; &nbsp; &nbsp; &nbsp; to&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; from&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; subject&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  message<br />
&nbsp; &nbsp; &nbsp; &nbsp; 1&nbsp; &nbsp; &nbsp; &nbsp; 1&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 2&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Test Message&nbsp; &nbsp; &nbsp; &nbsp; 1.2.3.4.5.6.7.8.9</code><hr />
</div> I am trying to create a messaging service, and i can't find whats wrong i have done the debugging i know and i checked it, re-written it 3 times, but i keep getting this error<br />
<br />
error : <br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\Web Server\www\Testing\Messaging\main.php on line 32</code><hr />
</div> That error is on the line which says<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">while($res = mysql_fetch_array($mes))</code><hr />
</div> I can't find whats wrong please help, i have two users in the accounts database, and 1 message in the messages database.</div>

 ]]></content:encoded>
			<category domain="http://codenewbie.com/forums/forums/15-PHP">PHP</category>
			<dc:creator>jnich104</dc:creator>
			<guid isPermaLink="true">http://codenewbie.com/forums/threads/6093-MySQL-amp-PHP-(Messaging-Service)</guid>
		</item>
		<item>
			<title>CSS and id</title>
			<link>http://codenewbie.com/forums/threads/6091-CSS-and-id?goto=newpost</link>
			<pubDate>Fri, 13 Aug 2010 03:55:46 GMT</pubDate>
			<description><![CDATA[Been a long time since I have been here.  
 
I am working on an CSS assignment and one of the rules is that we cannot use the "#" symbol. So far this has not been a problem as I have been able to just use classes and regular selectors (h2, etc). But I have come to these sections: 
 
 
Code:...]]></description>
			<content:encoded><![CDATA[<div>Been a long time since I have been here. <br />
<br />
I am working on an CSS assignment and one of the rules is that we cannot use the &quot;#&quot; symbol. So far this has not been a problem as I have been able to just use classes and regular selectors (h2, etc). But I have come to these sections:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">&lt;ol id=&quot;i9&quot;&gt;<br />
&nbsp; &lt;li id=&quot;i10&quot;&gt;universal selector, &lt;span id=&quot;i11&quot; class=&quot;example&quot;&gt;*&lt;/span&gt;&lt;/li&gt;</code><hr />
</div> and:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">&lt;ol id=&quot;i24&quot;&gt;<br />
&nbsp; &lt;li id=&quot;i25&quot;&gt;font<br />
&nbsp; &lt;ul id=&quot;i26&quot;&gt;<br />
&nbsp; &nbsp; &lt;li id=&quot;i27&quot;&gt;&lt;span id=&quot;i28&quot; class=&quot;property&quot;&gt;font-style&lt;/span&gt; &lt;span id=&quot;i29&quot; class=&quot;meta&quot;&gt;=&lt;/span&gt; &lt;span id=&quot;i30&quot; class=&quot;value&quot;&gt;italic&lt;/span&gt; &lt;span id=&quot;i31&quot; class=&quot;meta&quot;&gt;|&lt;/span&gt; &lt;span id=&quot;i32&quot; class=&quot;value&quot;&gt;oblique&lt;/span&gt;&lt;/li&gt;<br />
&nbsp; &nbsp; &lt;li id=&quot;i33&quot;&gt;&lt;span id=&quot;i34&quot; class=&quot;property&quot;&gt;font-size&lt;/span&gt; &lt;span id=&quot;i35&quot; class=&quot;meta&quot;&gt;=&lt;/span&gt; &lt;span id=&quot;i36&quot; class=&quot;value&quot;&gt;small&lt;/span&gt; &lt;span id=&quot;i37&quot; class=&quot;meta&quot;&gt;|&lt;/span&gt; &lt;span id=&quot;i38&quot; class=&quot;value&quot;&gt;large&lt;/span&gt;&lt;/li&gt;<br />
&nbsp; &nbsp; &lt;li id=&quot;i39&quot;&gt;&lt;span id=&quot;i40&quot; class=&quot;property&quot;&gt;font-variant&lt;/span&gt; &lt;span id=&quot;i41&quot; class=&quot;meta&quot;&gt;=&lt;/span&gt; &lt;span id=&quot;i42&quot; class=&quot;value&quot;&gt;small-caps&lt;/span&gt;&lt;/li&gt;<br />
&nbsp; &lt;/ul&gt;&lt;/li&gt;</code><hr />
</div> and I have to put a dashed 1px border around id i10 and i25. I just have not been able to figure out how to do it in the CSS without using the #.</div>

 ]]></content:encoded>
			<category domain="http://codenewbie.com/forums/forums/23-HTML-XML-Javascript-AJAX">HTML, XML, Javascript, AJAX</category>
			<dc:creator>sarah31</dc:creator>
			<guid isPermaLink="true">http://codenewbie.com/forums/threads/6091-CSS-and-id</guid>
		</item>
		<item>
			<title>Javascript and Php and MySQL</title>
			<link>http://codenewbie.com/forums/threads/6088-Javascript-and-Php-and-MySQL?goto=newpost</link>
			<pubDate>Mon, 09 Aug 2010 20:25:38 GMT</pubDate>
			<description><![CDATA[I am trying to create a way for javascript to get a result from PHP & MySQL from a database and show it on  the showing page. 
 
Index.php 
 
Code: 
--------- 
<html> 
<body> 
 
<script language="javascript" type="text/javascript">]]></description>
			<content:encoded><![CDATA[<div>I am trying to create a way for javascript to get a result from PHP &amp; MySQL from a database and show it on  the showing page.<br />
<br />
Index.php<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">&lt;html&gt;<br />
&lt;body&gt;<br />
<br />
&lt;script language=&quot;javascript&quot; type=&quot;text/javascript&quot;&gt;<br />
&lt;!-- <br />
//Browser Support Code<br />
function ajaxFunction(){<br />
&nbsp; &nbsp; &nbsp; &nbsp; var ajaxRequest;&nbsp; // The variable that makes Ajax possible!<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; try{<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Opera 8.0+, Firefox, Safari<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ajaxRequest = new XMLHttpRequest();<br />
&nbsp; &nbsp; &nbsp; &nbsp; } catch (e){<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Internet Explorer Browsers<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; try{<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ajaxRequest = new ActiveXObject(&quot;Msxml2.XMLHTTP&quot;);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } catch (e) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; try{<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ajaxRequest = new ActiveXObject(&quot;Microsoft.XMLHTTP&quot;);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } catch (e){<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Something went wrong<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; alert(&quot;Your browser broke!&quot;);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return false;<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; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; // Create a function that will receive data sent from the server<br />
&nbsp; &nbsp; &nbsp; &nbsp; ajaxRequest.onreadystatechange = function(){<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(ajaxRequest.readyState == 4){<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; document.myForm.time.value = ajaxRequest.responseText;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; var age = document.getElementById('age').value;<br />
&nbsp; &nbsp; &nbsp; &nbsp; var wpm = document.getElementById('wpm').value;<br />
&nbsp; &nbsp; &nbsp; &nbsp; var sex = document.getElementById('sex').value;<br />
&nbsp; &nbsp; &nbsp; &nbsp; var queryString = &quot;?age=&quot; + age + &quot;&amp;wpm=&quot; + wpm + &quot;&amp;sex=&quot; + sex;<br />
&nbsp; &nbsp; &nbsp; &nbsp; ajaxRequest.open(&quot;GET&quot;, &quot;ajax-example.php&quot; + queryString, true);<br />
&nbsp; &nbsp; &nbsp; &nbsp; ajaxRequest.send(null); <br />
}<br />
<br />
//--&gt;<br />
&lt;/script&gt;<br />
<br />
<br />
<br />
&lt;form name='myForm'&gt;<br />
Max Age: &lt;input type='text' id='age' /&gt; &lt;br /&gt;<br />
Max W<br />
PM: &lt;input type='text' id='wpm' /&gt;<br />
&lt;br /&gt;<br />
Sex: &lt;select id='sex'&gt;<br />
&lt;option value=&quot;m&quot;&gt;m&lt;/option&gt;<br />
&lt;option value=&quot;f&quot;&gt;f&lt;/option&gt;<br />
&lt;/select&gt;<br />
&lt;input type='button' onclick='ajaxFunction()' value='Query MySQL' /&gt;<br />
&lt;/form&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</code><hr />
</div> ajax-example.php<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">&lt;?php<br />
$dbhost = &quot;localhost&quot;;<br />
$dbuser = &quot;&lt;!-- Not Being Shown ---&gt;&quot;;<br />
$dbpass = &quot;&lt;!-- Not Being Shown ---&gt;&quot;;<br />
$dbname = &quot;&lt;!-- Not Being Shown ---&gt;&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; //Connect to MySQL Server<br />
mysql_connect($dbhost, $dbuser, $dbpass);<br />
&nbsp; &nbsp; &nbsp; &nbsp; //Select Database<br />
mysql_select_db($dbname) or die(mysql_error());<br />
&nbsp; &nbsp; &nbsp; &nbsp; // Retrieve data from Query String<br />
$age = $_GET['age'];<br />
$sex = $_GET['sex'];<br />
$wpm = $_GET['wpm'];<br />
&nbsp; &nbsp; &nbsp; &nbsp; // Escape User Input to help prevent SQL Injection<br />
$age = mysql_real_escape_string($age);<br />
$sex = mysql_real_escape_string($sex);<br />
$wpm = mysql_real_escape_string($wpm);<br />
&nbsp; &nbsp; &nbsp; &nbsp; //build query<br />
$query = &quot;SELECT * FROM ajax_example WHERE ae_sex = '$sex'&quot;;<br />
if(is_numeric($age))<br />
&nbsp; &nbsp; &nbsp; &nbsp; $query .= &quot; AND ae_age &lt;= $age&quot;;<br />
if(is_numeric($wpm))<br />
&nbsp; &nbsp; &nbsp; &nbsp; $query .= &quot; AND ae_wpm &lt;= $wpm&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; //Execute query<br />
$qry_result = mysql_query($query) or die(mysql_error());<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; //Build Result String<br />
$display_string = &quot;&lt;table&gt;&quot;;<br />
$display_string .= &quot;&lt;tr&gt;&quot;;<br />
$display_string .= &quot;&lt;th&gt;Name&lt;/th&gt;&quot;;<br />
$display_string .= &quot;&lt;th&gt;Age&lt;/th&gt;&quot;;<br />
$display_string .= &quot;&lt;th&gt;Sex&lt;/th&gt;&quot;;<br />
$display_string .= &quot;&lt;th&gt;WPM&lt;/th&gt;&quot;;<br />
$display_string .= &quot;&lt;/tr&gt;&quot;;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; // Insert a new row in the table for each person returned<br />
while($row = mysql_fetch_array($qry_result)){<br />
&nbsp; &nbsp; &nbsp; &nbsp; $display_string .= &quot;&lt;tr&gt;&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; $display_string .= &quot;&lt;td&gt;$row[ae_name]&lt;/td&gt;&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; $display_string .= &quot;&lt;td&gt;$row[ae_age]&lt;/td&gt;&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; $display_string .= &quot;&lt;td&gt;$row[ae_sex]&lt;/td&gt;&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; $display_string .= &quot;&lt;td&gt;$row[ae_wpm]&lt;/td&gt;&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; $display_string .= &quot;&lt;/tr&gt;&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
}<br />
echo &quot;Query: &quot; . $query . &quot;&lt;br /&gt;&quot;;<br />
$display_string .= &quot;&lt;/table&gt;&quot;;<br />
echo $display_string;<br />
?&gt;</code><hr />
</div> When i get this code finished i will be using it to create a instant chat room online, Please help</div>

 ]]></content:encoded>
			<category domain="http://codenewbie.com/forums/forums/15-PHP">PHP</category>
			<dc:creator>jnich104</dc:creator>
			<guid isPermaLink="true">http://codenewbie.com/forums/threads/6088-Javascript-and-Php-and-MySQL</guid>
		</item>
	</channel>
</rss>
