<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>PHP &#8211; Programming blog &#8211; website programming blog, blog on website programming .net, java , php and mor</title>
	<atom:link href="https://www.searchenginegenie.com/programming-blog/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.searchenginegenie.com/programming-blog</link>
	<description></description>
	<lastBuildDate>Thu, 27 Apr 2023 10:12:01 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.5.5</generator>
	<item>
		<title>Build a MySQL Database Using PHP</title>
		<link>https://www.searchenginegenie.com/programming-blog/build-a-mysql-database-using-php%ef%bf%bc/</link>
					<comments>https://www.searchenginegenie.com/programming-blog/build-a-mysql-database-using-php%ef%bf%bc/#respond</comments>
		
		<dc:creator><![CDATA[Camilla]]></dc:creator>
		<pubDate>Thu, 27 Apr 2023 10:10:01 +0000</pubDate>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<guid isPermaLink="false">https://www.searchenginegenie.com/programming-blog/?p=877</guid>

					<description><![CDATA[1. Create a MySQL database: CREATE DATABASE mydatabase; 2. Create a MySQL user and grant access to the database: CREATE USER &#8216;myuser&#8217;@&#8217;localhost&#8217; IDENTIFIED BY &#8216;mypassword&#8217;; GRANT ALL PRIVILEGES ON mydatabase.* TO &#8216;myuser&#8217;@&#8217;localhost&#8217;; 3. Create a PHP file and establish a connection to the MySQL database: &#60;?php $servername = &#8220;localhost&#8221;; $username = &#8220;myuser&#8221;; $password = &#8220;mypassword&#8221;; [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>1. Create a MySQL database:</p>



<p>CREATE DATABASE mydatabase;</p>



<p>2. Create a MySQL user and grant access to the database:</p>



<p>CREATE USER &#8216;myuser&#8217;@&#8217;localhost&#8217; IDENTIFIED BY &#8216;mypassword&#8217;;</p>



<p>GRANT ALL PRIVILEGES ON mydatabase.* TO &#8216;myuser&#8217;@&#8217;localhost&#8217;;</p>



<p>3. Create a PHP file and establish a connection to the MySQL database:</p>



<p>&lt;?php</p>



<p>$servername = &#8220;localhost&#8221;;</p>



<p>$username = &#8220;myuser&#8221;;</p>



<p>$password = &#8220;mypassword&#8221;;</p>



<p>$dbname = &#8220;mydatabase&#8221;;</p>



<p>$conn = new mysqli($servername, $username, $password, $dbname);</p>



<p>if ($conn-&gt;connect_error) {</p>



<p>   die(&#8220;Connection failed: &#8221; . $conn-&gt;connect_error);</p>



<p>}</p>



<p>echo &#8220;Connected successfully&#8221;;</p>



<p>?&gt;</p>



<p>4. Create a table in the database:</p>



<p>CREATE TABLE users (</p>



<p>  id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,</p>



<p>  firstname VARCHAR(30) NOT NULL,</p>



<p>  lastname VARCHAR(30) NOT NULL,</p>



<p>  email VARCHAR(50),</p>



<p>  reg_date TIMESTAMP</p>



<p>);</p>



<p>5. Insert data into the table:</p>



<p>INSERT INTO users (firstname, lastname, email)</p>



<p>VALUES (&#8216;John&#8217;, &#8216;Doe&#8217;, &#8216;john@example.com&#8217;);</p>



<p>6. Retrieve data from the table:</p>



<p>SELECT * FROM users;</p>



<p>7. Close the connection:</p>



<p>$conn-&gt;close();</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.searchenginegenie.com/programming-blog/build-a-mysql-database-using-php%ef%bf%bc/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>PHP Functions</title>
		<link>https://www.searchenginegenie.com/programming-blog/php-functions/</link>
					<comments>https://www.searchenginegenie.com/programming-blog/php-functions/#respond</comments>
		
		<dc:creator><![CDATA[Camilla]]></dc:creator>
		<pubDate>Thu, 10 Dec 2015 11:33:02 +0000</pubDate>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<guid isPermaLink="false">https://www.searchenginegenie.com/programming-blog/?p=799</guid>

					<description><![CDATA[A PHP function is a block of statements that can be used repeatedly in a program. It is not executed when page is loaded, instead implemented when a function is called. &#160; Function Syntax Function function _name () { Code to be executed; } &#160; Example Function test() { Echo “hello”; } Test(); &#160; Function [&#8230;]]]></description>
										<content:encoded><![CDATA[<p style="text-align: justify;">A PHP function is a block of statements that can be used repeatedly in a program. It is not executed when page is loaded, instead implemented when a function is called.</p>
<p>&nbsp;</p>
<p style="font-weight:bold">Function Syntax</p>
<p>Function function _name ()<br />
{<br />
Code to be executed;<br />
}<br />
&nbsp;</p>
<p style="font-weight:bold">Example</p>
<p>Function test()<br />
{<br />
Echo “hello”;<br />
}<br />
Test();<br />
&nbsp;</p>
<p style="font-weight:bold">Function with arguments</p>
<p style="text-align: justify;">Arguments or parameters are a piece of information, which is passed to function for executing the code. Functions can have any number of arguments, just separate them by comma.</p>
<p>&nbsp;</p>
<p style="text-align: justify;">Function test($fname)<br />
{<br />
Echo $fname;<br />
}<br />
Test(“janani”);</p>
<p>&nbsp;</p>
<p style="font-weight:bold">Default Argument Value</p>
<p style="text-align: justify;">The default argument will be set, if a function is called without parameters.</p>
<p>&nbsp;<br />
Function test($fname=50)<br />
{<br />
Echo $fname;<br />
}<br />
Test();<br />
&nbsp;</p>
<p style="font-weight:bold">Return value function</p>
<p style="text-align: justify;">Return value function is used when a function has to return a value after code execution.</p>
<p>&nbsp;<br />
Function test ($a, $b)<br />
{<br />
Return $a+$b;<br />
}<br />
Echo Test(2,3);</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.searchenginegenie.com/programming-blog/php-functions/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>PHP Form Validation</title>
		<link>https://www.searchenginegenie.com/programming-blog/php-form-validation/</link>
					<comments>https://www.searchenginegenie.com/programming-blog/php-form-validation/#respond</comments>
		
		<dc:creator><![CDATA[Camilla]]></dc:creator>
		<pubDate>Mon, 26 May 2014 07:03:32 +0000</pubDate>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[phpvalidation]]></category>
		<category><![CDATA[Programmer]]></category>
		<category><![CDATA[Programming]]></category>
		<guid isPermaLink="false">http://www.searchenginegenie.com/programming-blog/?p=758</guid>

					<description><![CDATA[&#60;?php // define variables and set to empty values $nameError = $emailError= $genderError = $websiteError = &#8220;&#8221;; $name = $email = $gender = $comment = $website = &#8220;&#8221;; if ($_SERVER[&#8220;REQUEST_METHOD&#8221;] == &#8220;POST&#8221;) { if (empty($_POST[&#8220;name&#8221;])) { $nameError = &#8220;Name is required&#8221;; } else { $name = test_input($_POST[&#8220;name&#8221;]); // check if name only contains letters and [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><span style="color: #ff0000;">&lt;?php<br />
// define variables and set to empty values<br />
$nameError = $emailError= $genderError = $websiteError = &#8220;&#8221;;<br />
$name = $email = $gender = $comment = $website = &#8220;&#8221;;</span></p>
<p>if ($_SERVER[&#8220;REQUEST_METHOD&#8221;] == &#8220;POST&#8221;) {<br />
if (empty($_POST[&#8220;name&#8221;])) {<br />
$nameError = &#8220;Name is required&#8221;;<br />
} else {<br />
$name = test_input($_POST[&#8220;name&#8221;]);<br />
// check if name only contains letters and whitespace<br />
if (!preg_match(&#8220;/^[a-zA-Z ]*$/&#8221;,$name)) {<br />
$nameError = &#8220;Only letters and white space allowed&#8221;;<br />
}<br />
}</p>
<p>if (empty($_POST[&#8220;email&#8221;])) {<br />
$emailError = &#8220;Email is required&#8221;;<br />
} else {<br />
$email = test_input($_POST[&#8220;email&#8221;]);<br />
// check if e-mail address syntax is valid<br />
if (!preg_match(&#8220;/([\w\-]+\@[\w\-]+\.[\w\-]+)/&#8221;,$email)) {<br />
$emailError = &#8220;Invalid email format&#8221;;<br />
}<br />
}</p>
<p>if (empty($_POST[&#8220;website&#8221;])) {<br />
$website = &#8220;&#8221;;<br />
} else {<br />
$website = test_input($_POST[&#8220;website&#8221;]);<br />
// check if URL address syntax is valid (this regular expression also allows dashes in the URL)<br />
if (!preg_match(&#8220;/\b(?:(?:https?|ftp):\/\/|www\.)[-a-z0-9+&amp;@#\/%?=~_|!:,.;]*[-a-z0-9+&amp;@#\/%=~_|]/i&#8221;,$website)) {<br />
$websiteError = &#8220;Invalid URL&#8221;;<br />
}<br />
}</p>
<p>if (empty($_POST[&#8220;comment&#8221;])) {<br />
$comment = &#8220;&#8221;;<br />
} else {<br />
$comment = test_input($_POST[&#8220;comment&#8221;]);<br />
}</p>
<p>if (empty($_POST[&#8220;gender&#8221;])) {<br />
$genderError = &#8220;Gender is required&#8221;;<br />
} else {<br />
$gender = test_input($_POST[&#8220;gender&#8221;]);<br />
}<br />
}</p>
<p>function test_input($data) {<br />
$data = trim($data);<br />
$data = stripslashes($data);<br />
$data = htmlspecialchars($data);<br />
return $data;<br />
}<br />
?&gt;<br style="color: #000000;" /><br style="color: #000000;" /><span style="color: #000000;">&lt;h2&gt;PHP Form Validation&lt;/h2&gt;</span><br style="color: #000000;" /><span style="color: #000000;">&lt;p&gt;&lt;span class=&#8221;error&#8221;&gt;* required field.&lt;/span&gt;&lt;/p&gt;</span><br style="color: #000000;" /><span style="color: #000000;">&lt;form method=&#8221;post&#8221; action=&#8221;</span><span style="color: #ff0000;">&lt;?php echo htmlspecialchars($_SERVER[&#8220;PHP_SELF&#8221;]);?&gt;</span><span style="color: #000000;">&#8220;&gt; </span><br style="color: #000000;" /><span style="color: #000000;">   Name: &lt;input type=&#8221;text&#8221; name=&#8221;name&#8221;&gt;</span><br style="color: #000000;" /><span style="color: #000000;">   &lt;span class=&#8221;error&#8221;&gt;* </span><span style="color: #ff0000;">&lt;?php echo $nameError;?&gt;</span><span style="color: #000000;">&lt;/span&gt;</span><br style="color: #000000;" /><span style="color: #000000;">   &lt;br&gt;&lt;br&gt;</span><br style="color: #000000;" /><span style="color: #000000;">   E-mail: &lt;input type=&#8221;text&#8221; name=&#8221;email&#8221;&gt;</span><br style="color: #000000;" /><span style="color: #000000;">   &lt;span class=&#8221;error&#8221;&gt;* </span><span style="color: #ff0000;">&lt;?php echo $emailError;?&gt;</span><span style="color: #000000;">&lt;/span&gt;</span><br style="color: #000000;" /><span style="color: #000000;">   &lt;br&gt;&lt;br&gt;</span><br style="color: #000000;" /><span style="color: #000000;">   Website: &lt;input type=&#8221;text&#8221; name=&#8221;website&#8221;&gt;</span><br style="color: #000000;" /><span style="color: #000000;">   &lt;span class=&#8221;error&#8221;&gt;</span><span style="color: #ff0000;">&lt;?php echo $websiteError;?&gt;</span><span style="color: #000000;">&lt;/span&gt;</span><br style="color: #000000;" /><span style="color: #000000;">   &lt;br&gt;&lt;br&gt;</span><br style="color: #000000;" /><span style="color: #000000;">   Comment: &lt;textarea name=&#8221;comment&#8221; rows=&#8221;5&#8243; cols=&#8221;40&#8243;&gt;&lt;/textarea&gt;</span><br style="color: #000000;" /><span style="color: #000000;">   &lt;br&gt;&lt;br&gt;</span><br style="color: #000000;" /><span style="color: #000000;">   Gender:</span><br style="color: #000000;" /><span style="color: #000000;">   &lt;input type=&#8221;radio&#8221; name=&#8221;gender&#8221; value=&#8221;female&#8221;&gt;Female</span><br style="color: #000000;" /><span style="color: #000000;">   &lt;input type=&#8221;radio&#8221; name=&#8221;gender&#8221; value=&#8221;male&#8221;&gt;Male</span><br style="color: #000000;" /><span style="color: #000000;">   &lt;span class=&#8221;error&#8221;&gt;* </span><span style="color: #ff0000;">&lt;?php echo $genderError;?&gt;</span><span style="color: #000000;">&lt;/span&gt;</span><br style="color: #000000;" /><span style="color: #000000;">   &lt;br&gt;&lt;br&gt;</span><br style="color: #000000;" /><span style="color: #000000;">   &lt;input type=&#8221;submit&#8221; name=&#8221;submit&#8221; value=&#8221;Submit&#8221;&gt; </span><br style="color: #000000;" /><span style="color: #000000;">&lt;/form&gt;</span><br style="color: #000000;" /><br style="color: #000000;" /><span style="color: #ff0000;">&lt;?php<br />
echo &#8220;&lt;h2&gt;Your Input:&lt;/h2&gt;&#8221;;<br />
echo $name;<br />
echo &#8220;&lt;br&gt;&#8221;;<br />
echo $email;<br />
echo &#8220;&lt;br&gt;&#8221;;<br />
echo $website;<br />
echo &#8220;&lt;br&gt;&#8221;;<br />
echo $comment;<br />
echo &#8220;&lt;br&gt;&#8221;;<br />
echo $gender;<br />
?&gt;</span><br style="color: #000000;" /><br style="color: #000000;" /><span style="color: #000000;">&lt;/body&gt;</span><br style="color: #000000;" /><span style="color: #000000;">&lt;/html&gt;</span></p>
<hr />
<p>&nbsp;</p>
<h2>PHP Form Validation</h2>
<p><span class="error">* required field.</span></p>
<form action="&lt;?php echo htmlspecialchars($_SERVER[" method="post">Name: <input name="name" type="text" /><br />
<span class="error">* <!--?php echo $nameError;?--></span><br />
E-mail: <input name="email" type="text" /><br />
<span class="error">* <!--?php echo $emailError;?--></span><br />
Website: <input name="website" type="text" /></p>
<p>Comment: <textarea cols="40" name="comment" rows="5"></textarea></p>
<p></p>
<p>Gender:<br />
<input name="gender" type="radio" value="female" />Female<br />
<input name="gender" type="radio" value="male" />Male<br />
<span class="error">* <!--?php echo $genderError;?--></span></p>
<p><input name="submit" type="submit" value="Submit" /></p>
</form>
<hr />
<h2>Your Input:</h2>
<p>Name<br />
Test@gmail.com<br />
www.example.com<br />
Test Comment<br />
Female</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.searchenginegenie.com/programming-blog/php-form-validation/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Simple Capcha using php</title>
		<link>https://www.searchenginegenie.com/programming-blog/simple-capcha-using-php/</link>
					<comments>https://www.searchenginegenie.com/programming-blog/simple-capcha-using-php/#respond</comments>
		
		<dc:creator><![CDATA[Camilla]]></dc:creator>
		<pubDate>Mon, 19 May 2014 10:22:09 +0000</pubDate>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programmer]]></category>
		<category><![CDATA[Programming]]></category>
		<guid isPermaLink="false">http://www.searchenginegenie.com/programming-blog/?p=752</guid>

					<description><![CDATA[Capcha Code: Save this code as &#8220;capcha.php&#8221; [php] &#60;?php session_start(); $text = rand(10000,99999); $_SESSION[&#8220;vercode&#8221;] = $text; $height = 25; $width = 65; $image_p = imagecreate($width, $height); $black = imagecolorallocate($image_p, 0, 0, 0); $white = imagecolorallocate($image_p, 255, 255, 255); $font_size = 14; imagestring($image_p, $font_size, 5, 5, $text, $white); imagejpeg($image_p, null, 80); ?&#62; [/php] &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; HTML: &#60;img [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><strong>Capcha Code:</strong></p>
<p>Save this code as &#8220;capcha.php&#8221;</p>
<p>[php]</p>
<p>&lt;?php<br />
session_start();<br />
$text = rand(10000,99999);<br />
$_SESSION[&#8220;vercode&#8221;] = $text;<br />
$height = 25;<br />
$width = 65;</p>
<p>$image_p = imagecreate($width, $height);<br />
$black = imagecolorallocate($image_p, 0, 0, 0);<br />
$white = imagecolorallocate($image_p, 255, 255, 255);<br />
$font_size = 14;</p>
<p>imagestring($image_p, $font_size, 5, 5, $text, $white);<br />
imagejpeg($image_p, null, 80);<br />
?&gt;<br />
[/php]</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
<strong>HTML:</strong></p>
<p>&lt;img src=&#8221;capcha.php&#8221; alt=&#8221;&#8221; align=&#8221;top&#8221; /&gt; &lt;input id=&#8221;vercode&#8221; class=&#8221;cap&#8221; name=&#8221;vercode&#8221; type=&#8221;text&#8221; align=&#8221;texttop&#8221; /&gt;<br />
&lt;div&gt;</p>
<p>&lt;input class=&#8221;sub&#8221; name=&#8221;subi&#8221; type=&#8221;submit&#8221; value=&#8221;Register&#8221; /&gt;</p>
<p>&lt;/div&gt;</p>
<p><img decoding="async" src="https://www.searchenginegenie.com/captcha_image1.php" alt="" align="top" /> <input id="vercode" class="cap" name="vercode" type="text" align="texttop" /></p>
<div>
<p><input class="sub" name="subi" type="submit" value="Register" /></p>
</div>
<p>Must set session to use the capcha</p>
<p><strong>PHP Code for the html page:</strong></p>
<p>[php]<br />
&lt;?php if ($_POST[&#8220;vercode&#8221;] != $_SESSION[&#8220;vercode&#8221;])<br />
{<br />
header(&#8220;location:contact.php?ver&#8221;); //incorrect verification code }<br />
?&gt;<br />
[/php]</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.searchenginegenie.com/programming-blog/simple-capcha-using-php/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>PHP Sessions</title>
		<link>https://www.searchenginegenie.com/programming-blog/php-sessions/</link>
					<comments>https://www.searchenginegenie.com/programming-blog/php-sessions/#respond</comments>
		
		<dc:creator><![CDATA[Camilla]]></dc:creator>
		<pubDate>Wed, 23 Apr 2014 12:40:15 +0000</pubDate>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programmer]]></category>
		<category><![CDATA[Programming]]></category>
		<guid isPermaLink="false">http://www.searchenginegenie.com/programming-blog/?p=729</guid>

					<description><![CDATA[Starting a PHP Session The session_start() function must appear BEFORE the &#60;html&#62; tag: [php] &#60;?php session_start(); ?&#62; &#60;html&#62; &#60;body&#62; &#60;/body&#62; &#60;/html&#62; [/php] The above code is used to register the user session in server. Destroying a Session [php] &#60;?php session_destroy(); ?&#62; [/php] The above code is used to destroy the complete session from the server. [&#8230;]]]></description>
										<content:encoded><![CDATA[<h2>Starting a PHP Session</h2>
<ul>
<li>The session_start() function must appear BEFORE the &lt;html&gt; tag:</li>
</ul>
<p>[php]</p>
<p>&lt;?php session_start(); ?&gt;</p>
<p>&lt;html&gt;<br />
&lt;body&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
[/php]</p>
<ul>
<li>The above code is used to register the user session in server.</li>
</ul>
<h2>Destroying a Session</h2>
<p>[php]<br />
&lt;?php<br />
session_destroy();<br />
 ?&gt;<br />
[/php]</p>
<ul>
<li>The above code is used to destroy the complete session from the server.</li>
</ul>
<p>NOTE :  The session is very very important to save the current user information on the server. Using UID(user id), The server saves the user information on the server.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.searchenginegenie.com/programming-blog/php-sessions/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Hide/Show using JavaScript</title>
		<link>https://www.searchenginegenie.com/programming-blog/hideshow-using-javascript/</link>
					<comments>https://www.searchenginegenie.com/programming-blog/hideshow-using-javascript/#respond</comments>
		
		<dc:creator><![CDATA[Camilla]]></dc:creator>
		<pubDate>Sat, 19 Apr 2014 13:47:08 +0000</pubDate>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[PHP]]></category>
		<guid isPermaLink="false">http://www.searchenginegenie.com/programming-blog/?p=714</guid>

					<description><![CDATA[To hide the Div : style=&#8221;display:none&#8221;; To visible the Div : style=&#8221;display:block&#8221;; [php] &#60;html&#62;&#60;head&#62;&#60;script type=&#34;text/javascript&#34;&#62; function showdiv() { if(document.getElementById(&#8216;child&#8217;).checked) { document.getElementById(&#8216;adu&#8217;).style.display = &#34;block&#34;; } else { document.getElementById(&#8216;adu&#8217;).style.display = &#34;none&#34;; } if(document.getElementById(&#8216;adult&#8217;).checked) { document.getElementById(&#8216;adu&#8217;).style.display = &#34;none&#34;; } } &#60;/script&#62; &#60;/head&#62; &#60;table border=&#34;0&#34;&#62; &#60;tbody&#62; &#60;tr&#62; &#60;td&#62;Member Type&#60;/td&#62; &#60;td&#62; &#60;input id=&#34;adult&#34; onclick=&#34;showdiv();&#34; type=&#34;radio&#34; name=&#34;member&#34; value=&#34;Adult&#34; /&#62; &#60;input id=&#34;child&#34; [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><strong>To hide the Div : style=&#8221;display:none&#8221;; </strong></p>
<p><strong>To visible the Div : style=&#8221;display:block&#8221;;</strong></p>
<p><script>// <![CDATA[
function showdiv() { if(document.getElementById('child').checked) { document.getElementById('adu').style.display = "block"; } else { document.getElementById('adu').style.display = "none"; } if(document.getElementById('adult').checked) { document.getElementById('adu').style.display = "none"; }  }
// ]]&gt;</script></p>
<p>[php]<br />
&lt;html&gt;&lt;head&gt;&lt;script type=&quot;text/javascript&quot;&gt;<br />
function showdiv()<br />
{<br />
if(document.getElementById(&#8216;child&#8217;).checked)<br />
{<br />
document.getElementById(&#8216;adu&#8217;).style.display = &quot;block&quot;;<br />
}<br />
else<br />
{<br />
document.getElementById(&#8216;adu&#8217;).style.display = &quot;none&quot;;<br />
}<br />
if(document.getElementById(&#8216;adult&#8217;).checked)<br />
{<br />
document.getElementById(&#8216;adu&#8217;).style.display = &quot;none&quot;;<br />
}<br />
}<br />
&lt;/script&gt;<br />
&lt;/head&gt;<br />
&lt;table border=&quot;0&quot;&gt;<br />
&lt;tbody&gt;<br />
&lt;tr&gt;<br />
&lt;td&gt;Member Type&lt;/td&gt;<br />
&lt;td&gt;<br />
&lt;input id=&quot;adult&quot; onclick=&quot;showdiv();&quot; type=&quot;radio&quot; name=&quot;member&quot; value=&quot;Adult&quot; /&gt;<br />
&lt;input id=&quot;child&quot; onclick=&quot;showdiv();&quot; type=&quot;radio&quot; name=&quot;member&quot; value=&quot;Child&quot; /&gt;&lt;/td&gt;<br />
&lt;/tr&gt;</p>
<p>&lt;div id=&quot;adu&quot; style=&quot;display:none&quot;&gt;<br />
&lt;tr&gt;&lt;td&gt;Name&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot; value=&quot;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;<br />
&lt;/div&gt;<br />
&lt;/tbody&gt;<br />
&lt;/table&gt;<br />
&lt;/html&gt;</p>
<p>[/php]</p>
<p><strong>Output:</strong></p>
<p>When you Click the Adult , you will not see the text box below.</p>
<p>When you click the child, the below text box will be visible.</p>
<table width="100%" cellspacing="1" cellpadding="4" bgcolor="">
<tbody>
<tr>
<td align="right" width="200" height="38"><span style="color: #000000;">Member Type</span></td>
<td align="left"><span style="color: #000000;"><input id="adult" name="member" type="radio" value="Adult" /> </span><span style="color: #ffffff; font-size: small;"><span style="color: #000000;">Adult</span><br />
</span><span style="color: #000000;"><input id="child" name="member" type="radio" value="Child" /> <span style="font-size: small;">Child</span></span></td>
</tr>
</tbody>
</table>
<table width="100%" cellspacing="1" cellpadding="4" bgcolor="">
<tbody>
<tr>
<td align="right" width="200" height="38">Name</td>
<td align="left">  <input id="parname" name="parname" type="text" value="" /> *</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.searchenginegenie.com/programming-blog/hideshow-using-javascript/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Validation Using Javascript</title>
		<link>https://www.searchenginegenie.com/programming-blog/validation-using-javascript/</link>
					<comments>https://www.searchenginegenie.com/programming-blog/validation-using-javascript/#respond</comments>
		
		<dc:creator><![CDATA[Camilla]]></dc:creator>
		<pubDate>Wed, 09 Apr 2014 12:44:21 +0000</pubDate>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<guid isPermaLink="false">http://www.searchenginegenie.com/programming-blog/?p=686</guid>

					<description><![CDATA[ [php] &#60;html&#62; &#60;head&#62; &#60;script type=&#34;text/javascript&#34;&#62; function vali() { if(document.myform.FirstName.value==&#34;&#34;) { alert(&#34;Please enter the FirstName&#34;); document.myform.FirstName.focus(); return false; } } &#60;/script&#62; &#60;/head&#62; &#60;form method=&#34;post&#34; name=&#34;myform&#34; onsubmit=&#34;return vali();&#34;&#62; Name : &#60;input type=&#34;text&#34; name=&#34;FirstName&#34; /&#62; &#60;input type=&#34;submit&#34; value=&#34;Submit&#34; /&#62; &#60;/form&#62; &#60;/html&#62; [/php] Output: Name :]]></description>
										<content:encoded><![CDATA[<p><script type="text/javascript">// <![CDATA[
function vali() { if(document.myform.FirstName.value=="") { alert("Please enter the FirstName"); document.myform.FirstName.focus(); return false; } }
// ]]&gt;</script></p>
<form method="post" name="myform" onsubmit="return vali();"> [php]<br />
&lt;html&gt;<br />
&lt;head&gt;<br />
&lt;script type=&quot;text/javascript&quot;&gt;<br />
function vali()<br />
{<br />
if(document.myform.FirstName.value==&quot;&quot;)<br />
{<br />
alert(&quot;Please enter the FirstName&quot;);<br />
document.myform.FirstName.focus();<br />
return false;<br />
}<br />
}<br />
&lt;/script&gt;<br />
&lt;/head&gt;<br />
&lt;form method=&quot;post&quot; name=&quot;myform&quot; onsubmit=&quot;return vali();&quot;&gt;<br />
Name : &lt;input type=&quot;text&quot; name=&quot;FirstName&quot; /&gt;<br />
&lt;input type=&quot;submit&quot; value=&quot;Submit&quot; /&gt;<br />
&lt;/form&gt;<br />
&lt;/html&gt;<br />
[/php]</p>
<p><strong>Output:</strong><br />
Name : <input type="text" name="FirstName" /><br />
<input type="submit" value="Submit" /></p>
</form>
]]></content:encoded>
					
					<wfw:commentRss>https://www.searchenginegenie.com/programming-blog/validation-using-javascript/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Code to get Title and Link in WordPress RSS Feed using PHP</title>
		<link>https://www.searchenginegenie.com/programming-blog/code-to-get-title-and-link-in-wordpress-rss-feed/</link>
					<comments>https://www.searchenginegenie.com/programming-blog/code-to-get-title-and-link-in-wordpress-rss-feed/#respond</comments>
		
		<dc:creator><![CDATA[Camilla]]></dc:creator>
		<pubDate>Fri, 05 Aug 2011 10:41:08 +0000</pubDate>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[PHP code for Rss Feed]]></category>
		<guid isPermaLink="false">http://www.searchenginegenie.com/programming-blog/?p=389</guid>

					<description><![CDATA[You would often want to display the RSS feed of your blog in your personalized home page or your professional page. This can be achieved, if you have basic knowledge on PHP and HTML. Just copy and paste the code below in the section where you want the feed to appear: [php] &#60;?PHP $con = [&#8230;]]]></description>
										<content:encoded><![CDATA[<p style="text-align: left;">You would often want to display the RSS feed of your blog in your personalized home page or your professional page. This can be achieved, if you have basic knowledge on PHP and HTML.</p>
<p style="text-align: left;">Just copy and paste the code below in the section where you want the feed to appear:</p>
<p>[php]<br />
&lt;?PHP</p>
<p>$con = file_get_contents(&#8216;http://www.xxxxxx.com/blog/feed/&#8217;);/* Feed Url */<br />
$title = getlinks(&quot;&lt;title&gt;&quot;, &quot;&lt;/title&gt;&quot;, $con); // gets Title and stored in array<br />
$url = getlinks(&quot;&lt;link&gt;&quot;, &quot;&lt;/link&gt;&quot;, $con); // gets Url and stored in array</p>
<p>echo &quot;&lt;ul&gt;&quot;;<br />
for($i=0; $i &lt; 6; $i++) {<br />
 echo &#8216;&lt;li&gt;&lt;a href=&quot;&#8217;.$url[$i].&#8217;&quot; title=&quot;&#8217;.$title[$i].&#8217;&quot; &gt;&#8217;.urldecode($title[$i]).'&lt;/a&gt;&lt;/li&gt;&#8217;;<br />
}<br />
echo &quot;&lt;/ul&gt;&quot;;</p>
<p>function getlinks($s1,$s2,$s) {<br />
 $myarray=array();<br />
 $s1 = strtolower($s1);<br />
 $s2 = strtolower($s2);<br />
 $L1 = strlen($s1);<br />
 $L2 = strlen($s2);<br />
 $scheck=strtolower($s);</p>
<p>do {<br />
 $pos1 = strpos($scheck,$s1);<br />
 if($pos1!==false) {<br />
 $pos2 = strpos(substr($scheck,$pos1+$L1),$s2);<br />
 if($pos2!==false) {<br />
 $myarray[]=substr($s,$pos1+$L1,$pos2);<br />
 $s=substr($s,$pos1+$L1+$pos2+$L2);<br />
 $scheck=strtolower($s);<br />
 }<br />
 }<br />
}<br />
while (($pos1!==false)and($pos2!==false));<br />
 return $myarray;<br />
}</p>
<p>?&gt;</p>
<p>[/php]</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.searchenginegenie.com/programming-blog/code-to-get-title-and-link-in-wordpress-rss-feed/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Explode function in php</title>
		<link>https://www.searchenginegenie.com/programming-blog/explode-function-in-php/</link>
					<comments>https://www.searchenginegenie.com/programming-blog/explode-function-in-php/#respond</comments>
		
		<dc:creator><![CDATA[Camilla]]></dc:creator>
		<pubDate>Mon, 23 Aug 2010 09:46:00 +0000</pubDate>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[php explode command]]></category>
		<guid isPermaLink="false">http://www.searchenginegenie.com/programming-blog/?p=365</guid>

					<description><![CDATA[How to split a name using explode function? 1. Get the name in a variable 2. Specify the position from which you need to split the name. 3. If you need to split the name after an underscore, use &#8220;_&#8221;. 4. If you need to split the name after @, use &#8220;@&#8221;. [php] &#60;?php $name  [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>How to split a name using explode function?<br />
1. Get the name in a variable<br />
2. Specify the position from which you need to split the name.<br />
3. If you need to split the name after an underscore, use &#8220;_&#8221;.<br />
4. If you need to split the name after @, use &#8220;@&#8221;.</p>
<p>[php]</p>
<p>&lt;?php</p>
<p>$name  = &quot;john_abraham@gmail.com&quot;;<br />
 $pieces = explode(&quot;_&quot;, $name);<br />
 echo &quot;firstname = $pieces[0]&quot;.&quot;&lt;br /&gt;&quot;;</p>
<p>$pieces = explode(&quot;@&quot;, $name);<br />
 echo &quot;username = $pieces[0]&quot;;</p>
<p>?&gt;</p>
<p>[/php]</p>
<p>Output will be displayed as:<br />
firstname = john<br />
username = john_abraham</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.searchenginegenie.com/programming-blog/explode-function-in-php/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>IF Statement In PHP</title>
		<link>https://www.searchenginegenie.com/programming-blog/if-statement-in-php/</link>
					<comments>https://www.searchenginegenie.com/programming-blog/if-statement-in-php/#comments</comments>
		
		<dc:creator><![CDATA[Camilla]]></dc:creator>
		<pubDate>Mon, 23 Aug 2010 06:11:05 +0000</pubDate>
				<category><![CDATA[PHP]]></category>
		<guid isPermaLink="false">http://www.searchenginegenie.com/programming-blog/?p=361</guid>

					<description><![CDATA[[php] &#60;html&#62; &#60;head&#62; &#60;title&#62;IF statements in PHP.&#60;/title&#62; &#60;/head&#62; &#60;body&#62; &#60;?php $name = &#34;Rose&#34;; if ( $name == &#34;Rose&#34; ) echo &#34;Your name is Rose!&#60;br /&#62;&#34;; else echo &#34;Welcome to my homepage!&#34;; ?&#62; &#60;/body&#62; &#60;/html&#62; [/php] Output: If the Given input is Rose,the output will be Your name is Rose! Else Welcome to my homepage!]]></description>
										<content:encoded><![CDATA[<p>[php]</p>
<p>&lt;html&gt;</p>
<p>&lt;head&gt;<br />
 &lt;title&gt;IF statements in PHP.&lt;/title&gt;<br />
 &lt;/head&gt;<br />
 &lt;body&gt;</p>
<p>&lt;?php</p>
<p>$name = &quot;Rose&quot;;</p>
<p>if ( $name == &quot;Rose&quot; )</p>
<p>echo &quot;Your name is Rose!&lt;br /&gt;&quot;;</p>
<p>else</p>
<p>echo &quot;Welcome to my homepage!&quot;;<br />
 ?&gt;<br />
 &lt;/body&gt;<br />
 &lt;/html&gt;</p>
<p>[/php]</p>
<p>Output:</p>
<p>If the Given input is Rose,the output will be</p>
<p>Your name is Rose!</p>
<p>Else</p>
<p>Welcome to my homepage!</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.searchenginegenie.com/programming-blog/if-statement-in-php/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/

Page Caching using Disk: Enhanced 
Minified using Disk

Served from: www.searchenginegenie.com @ 2024-07-18 03:44:44 by W3 Total Cache
-->