<?xml version="1.0" encoding="utf-8" ?><?xml-stylesheet type="text/xsl" href="http://www.daniweb.com/js/rss.xsl"?><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>DaniWeb IT Discussion Community
			 - PHP					</title>
		<link>http://www.daniweb.com/web-development/php/17</link>
		<description>Our PHP forum is the place for Q&amp;A-style discussions related to this popular development language.  LAMP programmers will appreciate our separate Apache forum, within the Networking sub-category of the Hardware and Software category, and MySQL forum, also within the Web Development category.</description>
		<language>en-US</language>
		<ttl>60</ttl>
		<!-- PubSubHubbub Discovery -->
		<link rel="hub" href="http://daniweb.superfeedr.com/" xmlns="http://www.w3.org/2005/Atom" />
		<link rel="self" href="http://www.daniweb.com/rss/pull/17" xmlns="http://www.w3.org/2005/Atom" />
		<!-- End Of PubSubHubbub Discovery -->
				<item>
			<title>Deleting from an array</title>
			<link>http://www.daniweb.com/web-development/php/threads/455267/deleting-from-an-array</link>
			<pubDate>Fri, 24 May 2013 18:09:17 +0000</pubDate>
			<description>I have an array that looks like this: `Array ( [0] =&gt; Array ( [id] =&gt; 2 [name] =&gt; test product1 [description] =&gt; test [quantity] =&gt; 1 [price] =&gt; 188 [status] =&gt; Brand New [category] =&gt; Computer Software [subcategory] =&gt; Music Software [postdate] =&gt; 2013-05-19 [prodimage] =&gt; [user] =&gt; admin ...</description>
			<content:encoded><![CDATA[ <p>I have an array that looks like this:<br /><code>Array ( [0] =&gt; Array ( [id] =&gt; 2 [name] =&gt; test product1 [description] =&gt; test [quantity] =&gt; 1 [price] =&gt; 188 [status] =&gt; Brand New [category] =&gt; Computer Software [subcategory] =&gt; Music Software [postdate] =&gt; 2013-05-19 [prodimage] =&gt; [user] =&gt; admin ) 
[1] =&gt; Array ( [id] =&gt; 2 [name] =&gt; test product1 [description] =&gt; test [quantity] =&gt; 1 [price] =&gt; 188 [status] =&gt; Brand New [category] =&gt; Computer Software [subcategory] =&gt; Music Software [postdate] =&gt; 2013-05-19 [prodimage] =&gt; [user] =&gt; admin )</code><br />
I want to be able to delete an entire row e.g Array[0] which would mean deleting this;<br /><code>Array ( [0] =&gt; Array ( [id] =&gt; 2 [name] =&gt; test product1 [description] =&gt; test [quantity] =&gt; 1 [price] =&gt; 188 [status] =&gt; Brand New [category] =&gt; Computer Software [subcategory] =&gt; Music Software [postdate] =&gt; 2013-05-19 [prodimage] =&gt; [user] =&gt; admin )</code>.<br />
I tried the following:</p>

<pre><code>$delid = $_GET['delid']//the product id of the element on which DELETE link was clicked.
if($delid){
    $contents = count($_SESSION['cartItems']);//$_SESSION['cartItems'] is the array shown above.
    for($i=0; $i &lt; $contents $i++){
        foreach($_SESSION['cartItems'] as $products){
        if($products['id'] == $delid){
            unset($products[$i]);
           }
        }
    }
}
</code></pre>

<p>But it doesn't delete the specified item form the array. Never implemented such a thing before so i'm a bit confused. How do i go about this? thanks</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>dhani09</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/455267/deleting-from-an-array</guid>
		</item>
				<item>
			<title>Get Values to var in Jquery</title>
			<link>http://www.daniweb.com/web-development/php/threads/455259/get-values-to-var-in-jquery</link>
			<pubDate>Fri, 24 May 2013 15:29:36 +0000</pubDate>
			<description>Hi, I'm creating a mentionInput, a textarea where i can identify people writing &quot;@NAME&quot; (like facebook) I have a this js file where i tell the info of the names i can identify: $(function () { $('textarea.mention').mentionsInput({ onDataRequest:function (mode, query, callback) { var data = [ { id:1, name:'Kenneth Auchenberg', ...</description>
			<content:encoded><![CDATA[ <p>Hi,</p>

<p>I'm creating a mentionInput, a textarea where i can identify people writing "@NAME" (like facebook)</p>

<p>I have a this js file where i tell the info of the names i can identify:</p>

<pre><code>$(function () {

  $('textarea.mention').mentionsInput({
    onDataRequest:function (mode, query, callback) {
      var data = [
        { id:1, name:'Kenneth Auchenberg', 'avatar':'<a href="http://cdn0.4dots.com/i/customavatars/avatar7112_1.gif" rel="nofollow">http://cdn0.4dots.com/i/customavatars/avatar7112_1.gif</a>', 'type':'contact' },
        { id:2, name:'Jon Froda', 'avatar':'<a href="http://cdn0.4dots.com/i/customavatars/avatar7112_1.gif" rel="nofollow">http://cdn0.4dots.com/i/customavatars/avatar7112_1.gif</a>', 'type':'contact' },
        { id:3, name:'Anders Pollas', 'avatar':'<a href="http://cdn0.4dots.com/i/customavatars/avatar7112_1.gif" rel="nofollow">http://cdn0.4dots.com/i/customavatars/avatar7112_1.gif</a>', 'type':'contact' },
        { id:4, name:'Kasper Hulthin', 'avatar':'<a href="http://cdn0.4dots.com/i/customavatars/avatar7112_1.gif" rel="nofollow">http://cdn0.4dots.com/i/customavatars/avatar7112_1.gif</a>', 'type':'contact' },
        { id:5, name:'Andreas Haugstrup', 'avatar':'<a href="http://cdn0.4dots.com/i/customavatars/avatar7112_1.gif" rel="nofollow">http://cdn0.4dots.com/i/customavatars/avatar7112_1.gif</a>', 'type':'contact' },
        { id:6, name:'Pete Lacey', 'avatar':'<a href="http://cdn0.4dots.com/i/customavatars/avatar7112_1.gif" rel="nofollow">http://cdn0.4dots.com/i/customavatars/avatar7112_1.gif</a>', 'type':'contact' },
        { id:7, name:'kenneth@auchenberg.dk', 'avatar':'<a href="http://cdn0.4dots.com/i/customavatars/avatar7112_1.gif" rel="nofollow">http://cdn0.4dots.com/i/customavatars/avatar7112_1.gif</a>', 'type':'contact' },
        { id:8, name:'Pete Awesome Lacey', 'avatar':'<a href="http://cdn0.4dots.com/i/customavatars/avatar7112_1.gif" rel="nofollow">http://cdn0.4dots.com/i/customavatars/avatar7112_1.gif</a>', 'type':'contact' },
        { id:9, name:'Kenneth Hulthin', 'avatar':'<a href="http://cdn0.4dots.com/i/customavatars/avatar7112_1.gif" rel="nofollow">http://cdn0.4dots.com/i/customavatars/avatar7112_1.gif</a>', 'type':'contact' }
      ];

      data = _.filter(data, function(item) { return item.name.toLowerCase().indexOf(query.toLowerCase()) &gt; -1 });

      callback.call(this, data);
    }
  });

  $('.get-syntax-text').click(function() {
    $('textarea.mention').mentionsInput('val', function(text) {
      alert(text);
    });
  });

  $('.get-mentions').click(function() {
    $('textarea.mention').mentionsInput('getMentions', function(data) {
      alert(JSON.stringify(data));
    });
  }) ;

});
</code></pre>

<p>But i want to get those values to my MySQL Table "Artists", how do i do that?</p>

<p>And than i want to insert some of those values in another table!</p>

<p>Can you help me?</p>

<p>Here's the index.php:</p>

<pre><code>&lt;!DOCTYPE HTML&gt;
&lt;html&gt;
&lt;head&gt;
  &lt;title&gt;jquery.mentionsInput&lt;/title&gt;
  &lt;meta http-equiv="content-type" content="text/html;charset=UTF-8"/&gt;
  &lt;meta http-equiv="X-UA-Compatible" content="chrome=1"&gt;
  &lt;link href='<a href="https://fonts.googleapis.com/css?family=PT+Sans&amp;subset=latin" rel="nofollow">https://fonts.googleapis.com/css?family=PT+Sans&amp;subset=latin</a>' rel='stylesheet' type='text/css'&gt;
  &lt;link href='assets/style.css' rel='stylesheet' type='text/css'&gt;
  &lt;link href='../jquery.mentionsInput.css' rel='stylesheet' type='text/css'&gt;

  &lt;script src='<a href="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" rel="nofollow">https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js</a>' type='text/javascript'&gt;&lt;/script&gt;
  &lt;script src='<a href="http://documentcloud.github.com/underscore/underscore-min.js" rel="nofollow">http://documentcloud.github.com/underscore/underscore-min.js</a>' type='text/javascript'&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;


&lt;div class="examples"&gt;
  &lt;textarea class='mention' placeholder='Try to mention me, by typing @ken'&gt;&lt;/textarea&gt;
&lt;/div&gt;

  &lt;/div&gt;

  &lt;script src='../lib/jquery.events.input.js' type='text/javascript'&gt;&lt;/script&gt;
  &lt;script src='../lib/jquery.elastic.js' type='text/javascript'&gt;&lt;/script&gt;
  &lt;script src='../jquery.mentionsInput.js' type='text/javascript'&gt;&lt;/script&gt;
  &lt;script src='assets/examples.js' type='text/javascript'&gt;&lt;/script&gt;
  &lt;script src='assets/example2.js' type='text/javascript'&gt;&lt;/script&gt;

  &lt;script&gt;!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");&lt;/script&gt;

  &lt;script type="text/javascript"&gt;

    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', 'UA-27763738-1']);
    _gaq.push(['_trackPageview']);

    (function() {
      var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
      ga.src = ('https:' == document.location.protocol ? '<a href="https://ssl" rel="nofollow">https://ssl</a>' : '<a href="http://www" rel="nofollow">http://www</a>') + '.google-analytics.com/ga.js';
      var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
    })();

  &lt;/script&gt;

&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>Thank you.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>PF2G</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/455259/get-values-to-var-in-jquery</guid>
		</item>
				<item>
			<title>delete and upload images</title>
			<link>http://www.daniweb.com/web-development/php/threads/455256/delete-and-upload-images</link>
			<pubDate>Fri, 24 May 2013 15:07:32 +0000</pubDate>
			<description>Hallo, i ve made a script that uploads an image in a web site and then show that image (admin site). when i upload the file i rename it with a specific name. The user may delete the image he uploaded. Everything works fine. If he tries to upload another ...</description>
			<content:encoded><![CDATA[ <p>Hallo,</p>

<p>i ve made a script that uploads an image in a web site and then show that image (admin site). when i upload the file i rename it with a specific name. The user may delete the image he uploaded. Everything works fine. If he tries to upload another image (the rename takes place like mentioned) the pictured that shown is the first one!! the one he deleted a few minutes ago.</p>

<p>I used me ftp client to see if the first image deleted and it did. When i upload the second image (the same name as the first) the image appears but it is not the one i just uploaded but the one i ve just deleted.</p>

<p>Obviously is something the server does and i was wondering if i could stop it...</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>dourvas</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/455256/delete-and-upload-images</guid>
		</item>
				<item>
			<title>upon loading , form autosubmits empty fields to database</title>
			<link>http://www.daniweb.com/web-development/php/threads/455250/upon-loading-form-autosubmits-empty-fields-to-database</link>
			<pubDate>Fri, 24 May 2013 13:40:05 +0000</pubDate>
			<description>this is link to code http://jsbin.com/ixupuk/4/edit when my form is loaded into browser OR refreshed, all fields are auto-submitted to mysql database.. i included at the bottom, an if(isset) statement that i couldnt get to work. thanx</description>
			<content:encoded><![CDATA[ <p>this is link to code <a href="http://jsbin.com/ixupuk/4/edit" rel="nofollow">http://jsbin.com/ixupuk/4/edit</a><br />
when my form is loaded into browser OR refreshed, all fields are auto-submitted to mysql database..<br />
i included at the bottom, an if(isset) statement that i couldnt get to work.<br />
thanx</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>amkaos</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/455250/upon-loading-form-autosubmits-empty-fields-to-database</guid>
		</item>
				<item>
			<title>embedding video on webpage</title>
			<link>http://www.daniweb.com/web-development/php/threads/455245/embedding-video-on-webpage</link>
			<pubDate>Fri, 24 May 2013 12:54:18 +0000</pubDate>
			<description>Good Morning, I'v been combing through the net including many links on this site, trying to get the necessary information to make a video play on my webpage. No Luck I've tried multiple pieces of code to embed the video, but in each case I am faced with either a ...</description>
			<content:encoded><![CDATA[ <p>Good Morning,</p>

<p>I'v been combing through the net including many links on this site, trying to get the necessary information to make a video play on my webpage.  No Luck</p>

<p>I've tried multiple pieces of code to embed the video, but in each case I am faced with either a black screen or a note saying that a plugin is needed or No video with supported mime types found...  But never a functioning playback of the video.</p>

<p>When I click on the link to install the necessary plug in, I get a message that it is an unknown plugin...</p>

<p>What I have is a .wmv</p>

<p>this is the webpage  <a href="http://www.hctubs.com/syllent_vid.php" rel="nofollow">http://www.hctubs.com/syllent_vid.php</a></p>

<p>Here is the code that I currently have in place</p>

<pre><code>&lt;object width="300" height="250" type="video/x-ms-asf" url="video.wmv"
data="/downloads/video/Syllent.wmv" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"&gt;
&lt;param name="url" value="/downloads/video/Syllent.wmv"&gt;
&lt;param name="filename" value="/downloads/video/Syllent.wmv"&gt;
&lt;param name="autostart" value="1"&gt;
&lt;param name="uiMode" value="full"&gt;
&lt;param name="autosize" value="1"&gt;
&lt;param name="playcount" value="1"&gt;
&lt;embed type="application/x-mplayer2" src="/downloads/video/Syllent.wmv" width="300"
height="250" autostart="true" showcontrols="true"
pluginspage="<a href="http://www.microsoft.com/Windows/MediaPlayer/" rel="nofollow">http://www.microsoft.com/Windows/MediaPlayer/</a>"&gt;&lt;/embed&gt;
&lt;/object&gt;
</code></pre>

<p>Any suggestions on making this work or on other alternatives that may be better would be greatly appreciated.</p>

<p>Do I need a different format video?</p>

<p>thanks in advance<br />
Douglas</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>showman13</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/455245/embedding-video-on-webpage</guid>
		</item>
				<item>
			<title>Ensuring that a daily cron keeps executing within a given range of dates</title>
			<link>http://www.daniweb.com/web-development/php/threads/455240/ensuring-that-a-daily-cron-keeps-executing-within-a-given-range-of-dates</link>
			<pubDate>Fri, 24 May 2013 12:05:53 +0000</pubDate>
			<description>Hi, I am working on a code that dispatches airtime depending on a schedule that is specified. Now all works just fine. The only problem is that the code executes only once. To throw more light, here is how it is meant to work; 1. An administrator creates a schedule, ...</description>
			<content:encoded><![CDATA[ <p>Hi,</p>

<p>I am working on a code that dispatches airtime depending on a schedule that is specified. Now all works just fine. The only problem is that the code executes only once.<br />
To throw more light, here is how it is meant to work;<br />
1. An administrator creates a schedule, specifying how frequently they want the airtime to be dispatched [working ok]<br />
2. The cron runs on a daily basis to find which airtime to send</p>

<p>Currently, I have a field called airtime status, whose default value is 0. But after sending the airtime, then the statusis updated to 1.</p>

<p>Now the real challenge is that; if this status is set to 1, it means that the script will not send that airtime again; yet it is supposed to be sent daily.</p>

<p>Any suggestions as to how I can go about this?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>Webville312</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/455240/ensuring-that-a-daily-cron-keeps-executing-within-a-given-range-of-dates</guid>
		</item>
				<item>
			<title>PDF edit</title>
			<link>http://www.daniweb.com/web-development/php/threads/455237/pdf-edit</link>
			<pubDate>Fri, 24 May 2013 10:45:36 +0000</pubDate>
			<description> Hello all, this might not be related to php (I don't know which forum I should post this topic) so I thought may be someone could help me out. How to edit pdf file ? Is there any specific software to edit adobe pdf file ? I have tried adobe ...</description>
			<content:encoded><![CDATA[ <p>Hello all,</p>

<p>this might not be related to php (I don't know which forum I should post this topic) so I thought may be someone could help me out.</p>

<p>How to edit pdf file ?  Is there any specific software to edit adobe pdf file ?</p>

<p>I have tried adobe acrobat x yet I do not know how to do it nor how to use the software.</p>

<p>Anyone could help me give any further recommendation?</p>

<p>Thanks.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>davy_yg</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/455237/pdf-edit</guid>
		</item>
				<item>
			<title>Login to direct user type to a different page</title>
			<link>http://www.daniweb.com/web-development/php/threads/455235/login-to-direct-user-type-to-a-different-page</link>
			<pubDate>Fri, 24 May 2013 10:00:58 +0000</pubDate>
			<description>Hi I have some script that I have used for sometime so understand it is out of date code, but it works. I want to amend it so that it also checks a field user_type and on successful login directs each to a differnt page. The code at the moment ...</description>
			<content:encoded><![CDATA[ <p>Hi</p>

<p>I have some script that I have used for sometime so understand it is out of date code, but it works. I want to amend it so that it also checks a field user_type and on successful login directs each to a differnt page. The code at the moment takes username and password from a login page, checks it (code below) and either takes user to a main page if correct or tells them username or password is wrong.</p>

<pre><code>&lt;?php require_once('Connections/Connection1.php'); ?&gt;

&lt;?php
$tbl_name="users"; // Table name 



// Connect to server and select databse.
//mysql_connect("$host", "$username", "$password")or die("cannot connect"); 
//mysql_select_db("$db_name")or die("cannot select DB");
mysql_select_db($database_Connection1, $Connection1);

// username and password sent from form 
$myusername=$_POST['myusername']; 
$mypassword=md5($_POST['mypassword']); 




// To protect MySQL injection (more detail about MySQL injection)
$myusername = stripslashes($myusername);
$mypassword = stripslashes($mypassword);
$myusername = mysql_real_escape_string($myusername);
$mypassword = mysql_real_escape_string($mypassword);

$sql="SELECT * FROM $tbl_name WHERE userid='$myusername' and 

password='$mypassword'";
$result=mysql_query($sql);


// Mysql_num_row is counting table row
$count=mysql_num_rows($result);

// If result matched $myusername and $mypassword, table row must be 1 row

if($count==1){

// Register $myusername, $mypassword and redirect to file "login_success.php"
session_register("myusername");
session_register("mypassword"); 
header("location:main.php?myusername=".$myusername);
}
else {
header("location:login_failed.php");
//echo "Wrong Username or Password";
}
?&gt;
</code></pre>

<p>Any help would be very much appreciated!</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>mdemetri2</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/455235/login-to-direct-user-type-to-a-different-page</guid>
		</item>
				<item>
			<title>for loop in php </title>
			<link>http://www.daniweb.com/web-development/php/threads/455227/for-loop-in-php-</link>
			<pubDate>Fri, 24 May 2013 08:56:27 +0000</pubDate>
			<description>If I have dropdownlist as below &lt;select onChange=&quot;this.value;&quot;&gt; &lt;option value=&quot;Volvo&quot; id=&quot;volvo&quot;&gt;Volvo&lt;/option&gt; &lt;option value=&quot;Saab&quot; id=&quot;saab&quot;&gt;Saab&lt;/option&gt; &lt;option value=&quot;VW&quot; id=&quot;vw&quot;&gt;VW&lt;/option&gt; &lt;option id=&quot;audi&quot; value=&quot;Audi&quot; selected&gt;Audi&lt;/option&gt; &lt;/select&gt; I want to display discription of item selectd so I have below code &lt;div id=&quot;boxpopup&quot; class=&quot;box&quot;&gt; &lt;a onClick=&quot;closeOffersDialog('boxpopup');&quot; class=&quot;boxclose&quot;&gt;&lt;/a&gt; &lt;div id=&quot;content&quot;&gt; This is popupbox of Audi &lt;/div&gt;&lt;!--end of ...</description>
			<content:encoded><![CDATA[ <p>If I have dropdownlist as below</p>

<pre><code>&lt;select onChange="this.value;"&gt;  
  &lt;option value="Volvo" id="volvo"&gt;Volvo&lt;/option&gt;    
  &lt;option value="Saab" id="saab"&gt;Saab&lt;/option&gt;    
  &lt;option value="VW" id="vw"&gt;VW&lt;/option&gt;    
  &lt;option id="audi" value="Audi" selected&gt;Audi&lt;/option&gt;                  
&lt;/select&gt; 
</code></pre>

<p>I want to display discription of item selectd so I have below code</p>

<pre><code>&lt;div id="boxpopup" class="box"&gt;  
    &lt;a onClick="closeOffersDialog('boxpopup');" class="boxclose"&gt;&lt;/a&gt;  
    &lt;div id="content"&gt;  
    This is popupbox of Audi   
    &lt;/div&gt;&lt;!--end of content --&gt; 
&lt;/div&gt;&lt;!--end of popupbox --&gt;     
</code></pre>

<p>now in content can I give If else  as below</p>

<pre><code>    &lt;div id="boxpopup3" class="box"&gt;  
        &lt;a onClick="closeOffersDialog('boxpopup');" class="boxclose"&gt;&lt;/a&gt;  
        &lt;div id="content"&gt; 
            &lt;?php if($id=="volvo"){ ?&gt; 
            This is popupbox of Volvo
            &lt;?php } elseif($id=="saab"){ ?&gt;
            This is popupbox of Saab 
            &lt;?php } elseif($id=="vw"){ ?&gt;
            This is popupbox of VW 
            &lt;?php } else { ?&gt;
            This is popupbox of Audi
            } ?&gt;
        &lt;/div&gt;&lt;!--end of content --&gt; 
    &lt;/div&gt;&lt;!--end of popupbox --&gt;
</code></pre>

<p>The error is occurs<br />
Notice: Undefined variable: id<br />
please help me :(</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>shilu2</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/455227/for-loop-in-php-</guid>
		</item>
				<item>
			<title>compare $_GET with array existence</title>
			<link>http://www.daniweb.com/web-development/php/threads/455207/compare-_get-with-array-existence</link>
			<pubDate>Thu, 23 May 2013 23:49:27 +0000</pubDate>
			<description>If I have a array: $myarray = array(&quot;10&quot;=&gt;&quot;apple&quot;, &quot;20&quot;=&gt;&quot;banana&quot;, etc..) up to 15 values. and I use $_GET['category'] to get my value from url for instance &quot;10&quot; How do I echo $myarray to be &quot;apple&quot;?</description>
			<content:encoded><![CDATA[ <p>If I have a array:<br />
$myarray = array("10"=&gt;"apple", "20"=&gt;"banana", etc..) up to 15 values.</p>

<p>and I use $_GET['category'] to get my value from url for instance "10"</p>

<p>How do I echo $myarray to be "apple"?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>mjsmitten</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/455207/compare-_get-with-array-existence</guid>
		</item>
				<item>
			<title>how to delete a token when cancel is clicked</title>
			<link>http://www.daniweb.com/web-development/php/threads/455206/how-to-delete-a-token-when-cancel-is-clicked</link>
			<pubDate>Thu, 23 May 2013 23:13:38 +0000</pubDate>
			<description>how can i get a token that a user has requested if he/she clicks cancel NOTE the user doesnt have to input anything if cancel is clicked that particular token is deleted from the d.b and the user is redirected to index.php i really dont know where and how to ...</description>
			<content:encoded><![CDATA[ <p>how can i get a token that a user has requested if he/she clicks cancel NOTE the user doesnt have to input anything if cancel is clicked that particular token is deleted from the d.b and the user is redirected to index.php i really dont know where and how to start so bear with me thanks anyway below is the token.php</p>

<pre><code>&lt;?php
error_reporting(0);
session_start();
$token=$_GET['token'];
include("settings.php");
connect();
if(isset ($_POST['submit'])){
$q="select email from tokens where token='".$token."' and used=0";
$r=mysql_query($q);
while($row=mysql_fetch_array($r))
   {
$email=$row['email'];
   }
If ($email!=''){
          $_SESSION['email']=$email;
}
else die("Invalid link or Password already changed  &lt;a href='../index.php'&gt;Click here to go back to the HOME PAGE&lt;a/&gt;");}

$pass=$_POST['password'];
$email=$_SESSION['email'];

if(isset($_POST['password'])&amp;&amp;isset($_SESSION['email']))
{
$q="update registration set password='".md5($pass)."' where email='".$email."'";
$r=mysql_query($q);
if($r)mysql_query("update tokens set used=1 where token='".$token."'");echo "Your password is changed successfully  &lt;a href='../index.php'&gt;Click here to go back to the HOME PAGE&lt;a/&gt;";
if(!$r)echo "An error occurred";
    }
</code></pre>

<p>and below is the formreset.php</p>

<pre><code>&lt;h3&gt;&lt;strong&gt;Forgot Password&lt;/strong&gt;&lt;/h3&gt;
      &lt;form name="forgot" method="POST" id="forgot" action="includes/reset.php?token=&lt;?php echo $_GET['token']; ?&gt;"&gt;
        &lt;div align="center"&gt;
          &lt;table width="372" border="0"&gt;
            &lt;tr&gt;
              &lt;td width="181"&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;
              &lt;p&gt;&lt;strong&gt;Password&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;
              &lt;td width="181"&gt;&lt;span id="sprytextfield1"&gt;&lt;span id="sprypassword1"&gt;
              &lt;label for="password2"&gt;&lt;/label&gt;
              &lt;br /&gt;
            &lt;input type="password" name="password" id="password2" /&gt;
                &lt;br /&gt;
                &lt;span class="passwordRequiredMsg"&gt;Your PASSWORD is need&lt;/span&gt;&lt;/span&gt;
&lt;label for="label"&gt;&lt;/label&gt;
              &lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
            &lt;tr&gt;
              &lt;td height="22"&gt;&lt;p&gt;&amp;nbsp;
              &lt;p&gt;&lt;strong&gt;Confirm Password&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;
              &lt;td&gt;&lt;span id="spryconfirm2"&gt;
              &lt;label for="password"&gt;&lt;/label&gt;
              &lt;span id="spryconfirm1"&gt;
              &lt;label for="password1"&gt;&lt;/label&gt;
              &lt;br /&gt;
              &lt;input type="password" name="password1" id="password1" /&gt;
              &lt;br /&gt;
              &lt;span class="confirmRequiredMsg"&gt;Please re-confirm your PASSWORD&lt;/span&gt;&lt;span class="confirmInvalidMsg"&gt;The PASSWORDS don't match.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;
    &lt;div align="center"&gt;
      &lt;p&gt;&amp;nbsp;&lt;/p&gt;
      &lt;table width="372" border="0"&gt;
        &lt;tr&gt;
          &lt;th width="132" scope="row"&gt;&lt;input type="submit" name="submit" id="submit" value="submit" /&gt;&lt;/th&gt;
          &lt;th width="113" scope="row"&gt;&lt;a href="includes/cancel.php?token=&lt;?php echo $_GET['token']; ?&gt;"&gt;Cancel&lt;/a&gt;&lt;/td&gt;&lt;/th&gt;
          &lt;th width="113" scope="row"&gt;&lt;input type="reset" name="clear" id="clear" value="Clear" /&gt;&lt;/th&gt;
        &lt;/tr&gt;
      &lt;/table&gt;

    &lt;/div&gt;
    &lt;div align="center"&gt;
      &lt;table width="372" border="0"&gt;
        &lt;tr&gt; &lt;/tr&gt;
        &lt;tr&gt; &lt;/tr&gt;
      &lt;/table&gt;
    &lt;/div&gt;thanks in advance
  &lt;/form&gt;
</code></pre>

<p>so how do i go about this</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>php.coder</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/455206/how-to-delete-a-token-when-cancel-is-clicked</guid>
		</item>
				<item>
			<title>if certain words are in url</title>
			<link>http://www.daniweb.com/web-development/php/threads/455203/if-certain-words-are-in-url</link>
			<pubDate>Thu, 23 May 2013 22:38:05 +0000</pubDate>
			<description>My url's are similar like this: website/search/category,Room/region,Oregon/ website/search/category,Room/ website/search/category,Room/city,Palm Bay/ website/search/city,Palm Bay/ website/search/region,Florida/ It always contains single or combination of CATEGORY CITY REGION I want to echo in an if statement, for example: if url contains &quot;category,xxx&quot; then echo &quot;category is xxx&quot;. (xxx can be anything) I found this code: ...</description>
			<content:encoded><![CDATA[ <p>My url's are similar like this:</p>

<p>website/search/category,Room/region,Oregon/<br />
website/search/category,Room/<br />
website/search/category,Room/city,Palm Bay/<br />
website/search/city,Palm Bay/<br />
website/search/region,Florida/</p>

<p>It always contains single or combination of CATEGORY CITY REGION</p>

<p>I want to echo in an if statement, for example:<br />
if url contains "category,xxx" then echo "category is xxx".<br />
(xxx can be anything)</p>

<p>I found this code:</p>

<pre><code>                &lt;?php $url = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
                if (false !== strpos($url,'Room')) {
                    echo 'Room';
                } 
                    echo 'No Room';
                } ?&gt;
</code></pre>

<p>But this method is large when I have 12 or more category words, 50 region names, and hundreds of city words to compare. How to make this more easy?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>mjsmitten</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/455203/if-certain-words-are-in-url</guid>
		</item>
				<item>
			<title>form validation: php validates for email, but not database submissions</title>
			<link>http://www.daniweb.com/web-development/php/threads/455184/form-validation-php-validates-for-email-but-not-database-submissions</link>
			<pubDate>Thu, 23 May 2013 16:26:05 +0000</pubDate>
			<description>Hi: i have contact form that i thought the validation (.js + php) worked fine because i received emails that were only submitted w/ all fields correctly filled in. i added submission to mysql database, then found out that empty fields were being submitted to database -- but not email.. ...</description>
			<content:encoded><![CDATA[ <p>Hi:<br />
i have contact form that i thought the validation (.js + php) worked fine because i received emails<br />
that were only submitted w/ all fields correctly filled in. i added submission to mysql database, then<br />
found out that empty fields were being submitted to database -- but not email..<br />
this is how validation behaves::</p>

<p>fill in name only == js blocks</p>

<p>fill in valid email only == js blocks</p>

<p>fill in bad email format == js doesnt block</p>

<p>fill in name + email wrong format == js blocks</p>

<p>fill in name + email correct format == js blocks</p>

<p>this link has both .js and php validation files..<br />
<a href="http://jsbin.com/ixupuk/1/edit" rel="nofollow">http://jsbin.com/ixupuk/1/edit</a></p>

<p>i dont understand how validation would work for email but not database...<br />
thanx for any help</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>amkaos</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/455184/form-validation-php-validates-for-email-but-not-database-submissions</guid>
		</item>
				<item>
			<title>confusing myself with arrays</title>
			<link>http://www.daniweb.com/web-development/php/threads/455175/confusing-myself-with-arrays</link>
			<pubDate>Thu, 23 May 2013 13:52:30 +0000</pubDate>
			<description>hey guys, I've been working on that moodle database link and I have it somewhat working! I have it logging in and echoing the username. This is the login section: $query = &quot;SELECT * FROM moodle_user WHERE username = '{$_POST['username']}' AND password = '$password'&quot;; $result = mysqli_query($con,$query) or die(mysqli_error($con)); //setup ...</description>
			<content:encoded><![CDATA[ <p>hey guys,</p>

<p>I've been working on that moodle database link and I have it somewhat working!</p>

<p>I have it logging in and echoing the username. This is the login section:</p>

<pre><code>  $query = "SELECT * FROM moodle_user WHERE username = '{$_POST['username']}' AND password = '$password'";
    $result = mysqli_query($con,$query) or die(mysqli_error($con));

    //setup row
    if ($_POST['submit']) {
        $Row = mysqli_fetch_assoc($result);
        $username = $_POST['username'];
        $firstname = $_Row['firstname'];
        $lastname = $_Row['lastname'];
        $name = print_r($_Row['firstname']);

    }



&lt;div id="Header"&gt;&lt;div class="user_details"&gt;

  &lt;?php 
  if ($_POST['submit']) {
     echo 'Logged in as: ' . $username . '&lt;br&gt;';
     echo 'Your name: ' . $firstname;
    } else {
     echo 'Not logged in';
     }
   ?&gt; 
</code></pre>

<p>The problem I am having is that the echo 'Your name: ' . $firstname;</p>

<p>isn't echoing anything. However I was able to echo the array earlier.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>bradly.spicer</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/455175/confusing-myself-with-arrays</guid>
		</item>
				<item>
			<title>Get value of text box store in php array variable</title>
			<link>http://www.daniweb.com/web-development/php/threads/455173/get-value-of-text-box-store-in-php-array-variable</link>
			<pubDate>Thu, 23 May 2013 13:11:44 +0000</pubDate>
			<description>I have a table like code html belows I want to store value of check box and corresponding text value into 2 array in PHP For example if i check box ID_1, ID_2 the values of these check box are stored in $array_box ( 74, 75) and values of corresponding ...</description>
			<content:encoded><![CDATA[ <p>I have a table like code html belows<br />
I want to store value of check box and corresponding text value into 2 array in PHP<br />
For example<br />
if i check box ID_1, ID_2<br />
the values of these check box are stored in $array_box ( 74, 75)<br />
and values of corresponding text box are stored in $array_text ("iOS","Android")<br />
Do you have any idea? thank you very much</p>

<pre><code>&lt;table width="341" border="1"&gt;
  &lt;tr&gt;
    &lt;th width="20" scope="row"&gt;&lt;input name="target" type="checkbox" value="74" checked /&gt;&lt;/th&gt;
    &lt;td width="155"&gt;ID_1&lt;/td&gt;
    &lt;td width="144"&gt;&lt;form id="form1" name="form1" method="post" action=""&gt;
      &lt;label&gt;
        &lt;input type="text" name="os[]" id="os" value="iOS" /&gt;
      &lt;/label&gt;
    &lt;/form&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;th scope="row"&gt;&lt;input name="target" type="checkbox" value="75" checked /&gt;&lt;/th&gt;
    &lt;td&gt;ID_2&lt;/td&gt;
    &lt;td&gt;&lt;form id="form2" name="form1" method="post" action=""&gt;
      &lt;label&gt;
        &lt;input type="text" name="os[]" id="os2" value="Andoird"/&gt;
      &lt;/label&gt;
    &lt;/form&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;th scope="row"&gt;&lt;input name="target" type="checkbox" value="76" checked /&gt;&lt;/th&gt;
    &lt;td&gt;ID-3&lt;/td&gt;
    &lt;td&gt;&lt;form id="form3" name="form1" method="post"  action=""&gt;
      &lt;label&gt;
        &lt;input type="text" name="os3" id="os3" value="Beta" /&gt;
      &lt;/label&gt;
    &lt;/form&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;th scope="row"&gt;&lt;input name="target" type="checkbox" value="77" checked /&gt;&lt;/th&gt;
    &lt;td&gt;ID-4&lt;/td&gt;
    &lt;td&gt;&lt;form id="form4" name="form1" method="post" action=""&gt;
      &lt;label&gt;
        &lt;input type="text" name="os[]" id="os4" value="Window" /&gt;
      &lt;/label&gt;
    &lt;/form&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>giao.can</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/455173/get-value-of-text-box-store-in-php-array-variable</guid>
		</item>
				<item>
			<title>php not updating password nor token in the d.b</title>
			<link>http://www.daniweb.com/web-development/php/threads/455163/php-not-updating-password-nor-token-in-the-d.b</link>
			<pubDate>Thu, 23 May 2013 11:39:44 +0000</pubDate>
			<description>My forgot password is not updating the token table nor is it updating the password when changes it keeps echoing the error message below is the form code: Forgot Password&lt;/strong&gt;&lt;/h3&gt; &lt;form name=&quot;forgot&quot; method=&quot;POST&quot; id=&quot;forgot&quot; action=&quot;includes/reset.php&quot;&gt; &lt;div align=&quot;center&quot;&gt; &lt;table width=&quot;372&quot; border=&quot;0&quot;&gt; &lt;tr&gt; &lt;td width=&quot;181&quot;&gt;&lt;p&gt; &lt;/p&gt; &lt;p&gt;&lt;strong&gt;Password&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt; &lt;td width=&quot;181&quot;&gt;&lt;span id=&quot;sprytextfield1&quot;&gt;&lt;br /&gt; &lt;label for=&quot;label&quot;&gt;&lt;/label&gt; ...</description>
			<content:encoded><![CDATA[ <p>My forgot password is not updating the token table nor is it updating the password when changes it keeps echoing the error message below is the form code:</p>

<pre><code>Forgot Password&lt;/strong&gt;&lt;/h3&gt;
      &lt;form name="forgot" method="POST" id="forgot" action="includes/reset.php"&gt;
        &lt;div align="center"&gt;
          &lt;table width="372" border="0"&gt;
            &lt;tr&gt;
              &lt;td width="181"&gt;&lt;p&gt; &lt;/p&gt;
                &lt;p&gt;&lt;strong&gt;Password&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;
              &lt;td width="181"&gt;&lt;span id="sprytextfield1"&gt;&lt;br /&gt;
                &lt;label for="label"&gt;&lt;/label&gt;
                &lt;input type="password" name="passsowrd" id="password" /&gt;
                &lt;span class="textfieldRequiredMsg"&gt;Your password is required&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
            &lt;tr&gt;
              &lt;td&gt;&lt;p&gt; &lt;/p&gt;
                &lt;p&gt;&lt;strong&gt;Confenter code hereirm Password&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;
              &lt;td&gt;&lt;span id="spryconfirm2"&gt;
                &lt;label for="password"&gt;&lt;/label&gt;
                &lt;input type="password" name="password2" id="password" /&gt;
                &lt;span class="confirmRequiredMsg"&gt;A value is required.&lt;/span&gt;&lt;span class="confirmInvalidMsg"&gt;The values don't match.&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;
    &lt;div align="center"&gt;
      &lt;p&gt; &lt;/p&gt;
      &lt;table width="98" border="0"&gt;
        &lt;tr&gt;
          &lt;th width="44" scope="row"&gt;&lt;input type="submit" name="submit" id="submit" value="submit" /&gt;&lt;/th&gt;
          &lt;th width="44" scope="row"&gt;&lt;input type="reset" name="clear" id="clear" value="Clear" /&gt;&lt;/th&gt;
        &lt;/tr&gt;
      &lt;/table&gt;
    &lt;/div&gt;
    &lt;div align="center"&gt;
      &lt;table width="372" border="0"&gt;
        &lt;tr&gt; &lt;/tr&gt;
        &lt;tr&gt; &lt;/tr&gt;
      &lt;/table&gt;
    &lt;/div&gt;
  &lt;/form&gt;
</code></pre>

<p>and the reset.php is:</p>

<pre><code>&lt;?php
session_start();
error_reporting(0);
$token=$_GET['token'];
include("settings.php");
connect();
if(!isset($_POST['password'])){
$q="select email from tokens where token='".$token."' and used=0";
$r=mysql_query($q);
while($row=mysql_fetch_array($r))
   {
$email=$row['email'];
   }
If ($email!=''){
          $_SESSION['email']=$email;
}
else die("Invalid link or Password already changed  &lt;a href='../index.php'&gt;Click here to go back to the HOME PAGE&lt;a/&gt;");}

$pass=$_POST['password'];
$email=$_SESSION['email'];

if(isset($_POST['password'])&amp;&amp;isset($_SESSION['email']))
{
$q="update registration set password='".md5($pass)."' where email='".$email."'";
$r=mysql_query($q);
if($r)mysql_query("update tokens set used=1 where token='".$token."'");echo "Your password is changed successfully  &lt;a href='../index.php'&gt;Click here to go back to the HOME PAGE&lt;a/&gt;";
if(!$r)echo "An error occurred";
    }
</code></pre>

<p>so the issue is the following error message is echoed all the time: Invalid link or Password already changed.</p>

<p>also if i add the following to the php code:</p>

<pre><code>if(!isset($pass)){
echo '&lt;form method="post"&gt;
enter your new password:&lt;input type="password" name="password" /&gt;
&lt;input type="submit" value="Change Password"&gt;
&lt;/form&gt;
';}
</code></pre>

<p>then it works but opens it in new blank page which is un professional thats y am trying to add it to the html. any suggestions thanks.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>php.coder</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/455163/php-not-updating-password-nor-token-in-the-d.b</guid>
		</item>
				<item>
			<title>include() error :(</title>
			<link>http://www.daniweb.com/web-development/php/threads/455149/include-error-</link>
			<pubDate>Thu, 23 May 2013 07:21:30 +0000</pubDate>
			<description>when include file to dreamweaver i cant edit anything in design view. &lt;?php require('header.php');?&gt; What should i do?</description>
			<content:encoded><![CDATA[ <p>when include file to dreamweaver i cant edit anything in design view.<br />
&lt;?php require('header.php');?&gt;</p>

<p>What should i do?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>Shalomd</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/455149/include-error-</guid>
		</item>
				<item>
			<title>Undefined offset? Why?</title>
			<link>http://www.daniweb.com/web-development/php/threads/455136/undefined-offset-why</link>
			<pubDate>Wed, 22 May 2013 20:57:22 +0000</pubDate>
			<description>Why does this code snippet keep getting Undefined offset: 2, Undefined offset: 7, Undefined offset: 11, respectively? I'm not sure where I'm going wrong, for($i = 0; $i &lt; $user_length; $i++) // CHECKS IF THE USERNAME, FIRST NAME, IC NUMBER AND CONTACT NUMBER IS ALREADY BEEN REGISTERED AS A MEMBER ...</description>
			<content:encoded><![CDATA[ <p>Why does this code snippet keep getting Undefined offset: 2, Undefined offset: 7, Undefined offset: 11, respectively? I'm not sure where I'm going wrong,</p>

<pre><code>for($i = 0; $i &lt; $user_length; $i++) // CHECKS IF THE USERNAME, FIRST NAME, IC NUMBER AND CONTACT NUMBER IS ALREADY BEEN REGISTERED AS A MEMBER
                    {
                        $userdetail = explode(":", $user[$i]);
                        if ($_POST['ic'] == $userdetail[2])
                        {
                            echo "&lt;h2&gt;Sorry!&lt;/h2&gt;&lt;p&gt;The ic no is already in use!&lt;/p&gt;";
                            $error = 1;
                            $i = $user_length;
                        }
                        else if ($_POST['phone'] == $userdetail[7])
                        {
                            echo "&lt;h2&gt;Sorry!&lt;/h2&gt;&lt;p&gt;phone no is already in use!&lt;/p&gt;";
                            $error = 1;
                            $i = $user_length;
                        }
                        else if ($_POST['facename'] == $userdetail[10])
                        {   
                            echo "&lt;h2&gt;Sorry!&lt;/h2&gt;&lt;p&gt;The Username you provided is already in use!&lt;/p&gt;";
                            $error = 1;
                            $i = $user_length;
                        }

                    }
</code></pre>

<p>Here's the text file format the explode is reading from:</p>

<p>u0003:omied:123456-12-1234:male:married:privatesector:dfsfsdf:603-32323242:6016-2343432:omied@gmail.com:omeid123:dingo1234</p>

<p>as you can see, ic, phone, and facename are defined as 2, 7 and 10 following the format of the loop and array.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>xianamersu</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/455136/undefined-offset-why</guid>
		</item>
				<item>
			<title>Passing variable through URL</title>
			<link>http://www.daniweb.com/web-development/php/threads/455132/passing-variable-through-url</link>
			<pubDate>Wed, 22 May 2013 19:12:12 +0000</pubDate>
			<description>I want to pass a combo box value from url in php. I have no idea how to do it. I just try like this. This my combo box html code. &lt;select id=&quot;ID1&quot; name=&quot;place&quot; &gt; &lt;option value=&quot;Colombo&quot; selected=&quot;selected&quot;&gt;Colombo&lt;/option&gt; &lt;option value=&quot;Matara&quot;&gt;Matara&lt;/option&gt; &lt;option value=&quot;Galle&quot;&gt;Galle&lt;/option&gt; &lt;/select&gt; //What i want is pass selected value ...</description>
			<content:encoded><![CDATA[ <p>I want to pass a combo box value from url in php. I have no idea how to do it. I just try like this.<br />
This my combo box html code.</p>

<pre><code> &lt;select id="ID1" name="place" &gt;
&lt;option value="Colombo" selected="selected"&gt;Colombo&lt;/option&gt;
&lt;option value="Matara"&gt;Matara&lt;/option&gt;
&lt;option value="Galle"&gt;Galle&lt;/option&gt;
&lt;/select&gt;

//What i want is pass selected value through URL

   &lt;div style="float:right; padding-right:1px; padding-bottom:2px;"&gt; &lt;a href="MyCity.php?city1= &lt;?php echo $_GET["place"] ; ?&gt; &gt; Click here &lt;/a&gt;&lt;/div&gt;
</code></pre>

<p>I'm bit new to php and what is wrong with this code?<br />
im sure that 'MyCity.php' coding is correct, because i pass, hard coded value throgh above URL and could get that value from MyCity.php</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>weeraa</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/455132/passing-variable-through-url</guid>
		</item>
				<item>
			<title>How to call 2 tables with matching fields</title>
			<link>http://www.daniweb.com/web-development/php/threads/455121/how-to-call-2-tables-with-matching-fields</link>
			<pubDate>Wed, 22 May 2013 15:52:00 +0000</pubDate>
			<description>I have a MySQL DB with 2 Tables in particular, &quot;Properties&quot; and &quot;Tenants&quot;. Each Table has a unique address Field &quot;propAddress&quot; &amp; &quot;TenAddress&quot;. I have a PHP page with a repeating reigon that lists all properties in the DB. What I'm trying to do is list all the tenants info ...</description>
			<content:encoded><![CDATA[ <p>I have a MySQL DB with 2 Tables in particular, "Properties" and "Tenants". Each Table has a unique address Field "propAddress" &amp; "TenAddress".<br />
I have a PHP page with a repeating reigon that lists all properties in the DB.<br />
What I'm trying to do is list all the tenants info to the matching property based on the addresses.<br />
I have it in my mind I should be using the "Where Clause".<br />
Any advise will be greatly appreciated.</p>

<pre><code>mysql_select_db($database_rent, $rent);
$query_RsProp = "SELECT * FROM Properties ORDER BY PropId ASC";
$query_limit_RsProp = sprintf("%s LIMIT %d, %d", $query_RsProp, $startRow_RsProp, $maxRows_RsProp);
$RsProp = mysql_query($query_limit_RsProp, $rent) or die(mysql_error());
$row_RsProp = mysql_fetch_assoc($RsProp);

if (isset($_GET['totalRows_RsProp'])) {
  $totalRows_RsProp = $_GET['totalRows_RsProp'];
} else {
  $all_RsProp = mysql_query($query_RsProp);
  $totalRows_RsProp = mysql_num_rows($all_RsProp);
}
$totalPages_RsProp = ceil($totalRows_RsProp/$maxRows_RsProp)-1;

$colname_Recordset1 = "-1";
if (isset($_GET['TenantId'])) {
  $colname_Recordset1 = $_GET['TenantId'];
}
mysql_select_db($database_rent, $rent);
$query_Recordset1 = sprintf("SELECT Properties.Address, Properties.PropId, Tenants.TenantId, Tenants.FirstName1, Tenants.LastName1, Tenants.FirstName2, Tenants.LastName2, Tenants.Phone1, Tenants.Phone2, Tenants.ContractStart, Tenants.ContractEnd, Tenants.RentDueDate, Tenants.Email, Tenants.ContractLink, Tenants.ApartmentNo, Tenants.TenantAdress FROM Properties, Tenants WHERE Properties.PropId AND Properties.Address=Tenants.TenantAdress AND %s", GetSQLValueString($colname_Recordset1, "int"));
$Recordset1 = mysql_query($query_Recordset1, $rent) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?&gt;
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" rel="nofollow">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</a>"&gt;
&lt;html xmlns="<a href="http://www.w3.org/1999/xhtml" rel="nofollow">http://www.w3.org/1999/xhtml</a>"&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt;
&lt;title&gt;Untitled Document&lt;/title&gt;
&lt;style type="text/css"&gt;
body {
    background-color: #E2E8FF;
}
&lt;/style&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;form id="form1" name="form1" method="post" action=""&gt;
  &lt;?php do { ?&gt;
    &lt;table width="800" border="0"&gt;
      &lt;tr&gt;
        &lt;td width="114"&gt;&lt;img src="&lt;?php echo $row_RsProp['ImageLink']; ?&gt;" width="150"/&gt;&lt;/td&gt;
        &lt;td width="625"&gt;&lt;p&gt;&lt;b&gt;&lt;span style='font-size: 20px;' &gt;&lt;?php echo $row_RsProp['Address']; ?&gt; &lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;?php echo $row_RsProp['City']; ?&gt;, &lt;?php echo $row_RsProp['State']; ?&gt; &lt;?php echo $row_RsProp['Zip']; ?&gt;&lt;br /&gt;
            &lt;?php echo $row_Recordset1['FirstName1']; ?&gt; &lt;?php echo $row_Recordset1['LastName1']; ?&gt;&lt;br /&gt;
        &lt;/p&gt;
        &lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/td&gt;
        &lt;td width="20"&gt;&amp;nbsp;&lt;/td&gt;
        &lt;td width="23"&gt;&amp;nbsp;&lt;/td&gt;
      &lt;/tr&gt;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;
    &lt;/table&gt;
    &lt;?php } while ($row_RsProp = mysql_fetch_assoc($RsProp)); ?&gt;&lt;br /&gt;&lt;br /&gt;

&lt;/form&gt;
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>mark2326l</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/455121/how-to-call-2-tables-with-matching-fields</guid>
		</item>
				<item>
			<title>Warning: session_start() Cannot send session cache limiter</title>
			<link>http://www.daniweb.com/web-development/php/threads/455117/warning-session_start-cannot-send-session-cache-limiter</link>
			<pubDate>Wed, 22 May 2013 15:16:16 +0000</pubDate>
			<description>Hi everyone, got really strange issue with a template I have started to build. I am continually getting the follwing error message Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent Even though the only code I have on my page is &lt;?php session_start(); ?&gt; &lt;!DOCTYPE html&gt; ...</description>
			<content:encoded><![CDATA[ <p>Hi everyone, got really strange issue with a template I have started to build.</p>

<p>I am continually getting the follwing error message<br />
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent</p>

<p>Even though the only code I have on my page is</p>

<pre><code>&lt;?php
session_start();
?&gt;
&lt;!DOCTYPE html&gt;
    &lt;html&gt;
    &lt;head&gt;

    &lt;/head&gt;
    &lt;body&gt;


    &lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>it's driving me crazy... Any help would be appreciated, thanks</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>lloyd.farrell.7</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/455117/warning-session_start-cannot-send-session-cache-limiter</guid>
		</item>
				<item>
			<title>array merge</title>
			<link>http://www.daniweb.com/web-development/php/threads/455111/array-merge</link>
			<pubDate>Wed, 22 May 2013 13:31:32 +0000</pubDate>
			<description>Hi I have an array of format Array ( [1] =&gt; Array ( [1] =&gt; Array ( [27] =&gt; C1 [28] =&gt; Y1 ) [2] =&gt; Array ( [31] =&gt; C2 [32] =&gt; Y2 ) [3] =&gt; Array ( [34] =&gt; C3 [35] =&gt; Y3 ) ) [2] =&gt; Array ...</description>
			<content:encoded><![CDATA[ <p>Hi</p>

<p>I have an array of format</p>

<pre><code>Array
(
    [1] =&gt; Array
        (
            [1] =&gt; Array
                (
                    [27] =&gt; C1
                    [28] =&gt; Y1
                )

            [2] =&gt; Array
                (
                    [31] =&gt; C2
                    [32] =&gt; Y2
                )

            [3] =&gt; Array
                (
                    [34] =&gt; C3
                    [35] =&gt; Y3
                )

        )

    [2] =&gt; Array
        (
            [4] =&gt; Array
                (
                    [37] =&gt; X1
                )

            [5] =&gt; Array
                (
                    [38] =&gt; X2
                )

        )

    [3] =&gt; Array
        (
            [7] =&gt; Array
                (
                    [40] =&gt; D1
                )

            [9] =&gt; Array
                (
                    [42] =&gt; D2
                )

        )

)
</code></pre>

<p>with this array I need to form another array like</p>

<pre><code>Array
(
    [0] =&gt; Array
        (
          [27] =&gt; C1
          [28] =&gt; Y1
          [37] =&gt; X1
          [40] =&gt; D1
        )
    [1] =&gt; Array
        (
          [27] =&gt; C1
          [28] =&gt; Y1
          [37] =&gt; X1
          [40] =&gt; D2
        )
    [2] =&gt; Array
        (
          [27] =&gt; C1
          [28] =&gt; Y1
          [37] =&gt; X2
          [40] =&gt; D1
        )
    [3] =&gt; Array
        (
          [27] =&gt; C1
          [28] =&gt; Y1
          [37] =&gt; X2
          [40] =&gt; D2
        )

    [4] =&gt; Array
        (
          [31] =&gt; C2
          [32] =&gt; Y2
          [37] =&gt; X1
          [40] =&gt; D1
        )
    [5] =&gt; Array
        (
          [31] =&gt; C2
          [32] =&gt; Y2
          [37] =&gt; X1
          [40] =&gt; D2
        )
    [6] =&gt; Array
        (
          [31] =&gt; C2
          [32] =&gt; Y2
          [37] =&gt; X2
          [40] =&gt; D1
        )
    [7] =&gt; Array
        (
          [31] =&gt; C2
          [32] =&gt; Y2
          [37] =&gt; X2
          [40] =&gt; D2
        )
    [8] =&gt; Array
        (
          [34] =&gt; C3
          [35] =&gt; Y3
          [37] =&gt; X1
          [40] =&gt; D1
        )
    [9] =&gt; Array
        (
          [34] =&gt; C3
          [35] =&gt; Y3
          [37] =&gt; X1
          [40] =&gt; D2
        )
    [10] =&gt; Array
        (
         [34] =&gt; C3
          [35] =&gt; Y3
          [37] =&gt; X2
          [40] =&gt; D1
        )
    [11] =&gt; Array
        (
          [34] =&gt; C3
          [35] =&gt; Y3
          [37] =&gt; X2
          [40] =&gt; D2
        )
)
</code></pre>

<p>and it should work for 'n' dimensional array not only for 3-dimensional array.</p>

<p>Please help me with this.....</p>

<p>Thanks in advance.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>aithabuddy</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/455111/array-merge</guid>
		</item>
				<item>
			<title>How to stop automatical download</title>
			<link>http://www.daniweb.com/web-development/php/threads/455107/how-to-stop-automatical-download</link>
			<pubDate>Wed, 22 May 2013 12:46:11 +0000</pubDate>
			<description>Hy All I have another problem. When somebody going to my download link [Click Here](http://www.filemonster.org/download.php?id=11) a window pop up to download the file called get.php. I dont want that to appear. Because its not the file which is under the &quot;regulr downlod button&quot; . The get.php its the file which ...</description>
			<content:encoded><![CDATA[ <p>Hy All I have another problem. When somebody going to my download link <a href="http://www.filemonster.org/download.php?id=11" rel="nofollow">Click Here</a>   a window pop up to download the file called get.php. I dont want that to appear. Because its not the file which is under the "regulr downlod button" . The get.php its the file which controll the progress of the download in the site. I paste here the code from the donwload.php because i think there is the problem.</p>

<pre><code>&lt;?php
    require("secure/core.php");
    $id = trim(mysql_real_escape_string($_GET['id']));

    if($id) {

        $fileid = mysql_query("SELECT * FROM uploads WHERE id = '$id'");

        if (mysql_num_rows($fileid) != 1) {
            $_SESSION['dlerror'] = "The file you are looking for does not exist,&lt;br /&gt;or may have been removed by the owner.";
        }
        else
        {
            $ip = $_SERVER['REMOTE_ADDR'];
            $country = $users-&gt;countryFromIP($ip);
            $now = date("y-m-d h:i:s");
            while($info = mysql_fetch_array($fileid)) 
            {
                $fileid2 = trim(mysql_real_escape_string($info['id']));
                $userid = trim(mysql_real_escape_string($info['uploaded_by']));
                $filename = trim(mysql_real_escape_string($info['file_title']));
                $filesize = trim(mysql_real_escape_string($info['file_size']));
                $filepath = trim(mysql_real_escape_string($info['file_path']));
                $filedate = trim(mysql_real_escape_string($info['created_date']));
            }
   mysql_query("INSERT INTO `file_visits` SET `file_id` = '$id', `country_iso` = '$country', `ip_address` = '$ip', `user_id` = '$userid', `date` = '$now'");
   $rand = substr(md5($now),1,8);
   mysql_query("insert into conversions set ip = '$_SERVER[REMOTE_ADDR]', user_id='$userid', date='$now', file_id='$fileid2', rand='$rand'");


        }
        if(isset($_POST['submit'])){
        $ret_val = $users-&gt;is_loginValid(mysql_real_escape_string($_POST['user_name']),mysql_real_escape_string($_POST['password']));
    if($ret_val == -1){     
        header( 'Location: login.php?alert=invalid' ) ; 
        exit();
    } elseif($ret_val == 0){
                header( 'Location: login.php?alert=banned' ) ;  
        exit();
        } else {                
        $_SESSION['userid'] = $ret_val['id'];
        $_SESSION['username'] = $ret_val['username'];
        $_SESSION['email'] = $ret_val['email'];
        $_SESSION['pass'] = $_POST['password'];
        $_SESSION['email'] = $users-&gt;getEmailAddress();
        $_SESSION['status'] = $users-&gt;getUserStatus();
        $_SESSION['timestamp'] = time();
                $ip = $_SERVER['REMOTE_ADDR'];
                $now = date('Y-m-d H:i:s');
                $ado-&gt;exec("INSERT INTO `ip_logs` SET `user_id` = '$ret_val[id]', `ip` = '$ip', `date` = '$now'");          
        header( 'Location: download.php?id=$id' ) ; 
        exit(); 
    }               
        }
        if($_GET['type'] == 'premium') {
        if($users-&gt;validCredits($_SESSION['userid'])) {
        if($files-&gt;FileExists($id)) { 
        $result1 = $ado-&gt;exec("SELECT * FROM `uploads` WHERE `id` = '$id'");
        $row1 = $ado-&gt;fetch($result1);
        $filename1 = $row1['hash'];
        $filepath1 = $settings-&gt;getUploadPath();
        $fileid1 = $row1['id'];
        $now = date('y-m-d');
        $ado-&gt;exec("INSERT INTO `credit_downloads` SET `file_id` = '$fileid1', `user_id` = '$_SESSION[userid]', `date` = '$now'");
        $ado-&gt;exec("UPDATE `users` SET `credits` = credits - 1 WHERE `id` = '$_SESSION[userid]'");       
        $files-&gt;download($filepath1.$filename1);
        } else {
        echo "&lt;script language=javascript&gt;alert('That file seems to be invalid.')&lt;/script&gt;";
        }
        } else {
        echo "&lt;script language=javascript&gt;alert('Your account currently has no credits.')&lt;/script&gt;";
        }
        }
?&gt;
                &lt;?php include 'header.php'; ?&gt;
&lt;?php if(!$users-&gt;isUserLoggedIn()){ ?&gt;
                &lt;?php include 'headbar.php'; ?&gt;
&lt;?php } else { ?&gt;
&lt;div class="navbar"&gt;
  &lt;div class="navbar-inner-blue"&gt;
    &lt;div class="container"&gt;
      &lt;div class="row"&gt;
        &lt;div class="span12"&gt;
          &lt;a class="brand" href="&lt;?php echo $settings-&gt;getSiteURL(); ?&gt;" style="padding:0px 0px 0px 4px !important;"&gt;&lt;img src="img/cl_logo.png" /&gt;&lt;/a&gt;
          &lt;ul class="nav pull-right" style="margin-top:7px;"&gt;
            &lt;li&gt;&lt;a href="tos.php" class="tipsy" title="View the Term of Service"&gt;Terms of Service&lt;/a&gt;&lt;/li&gt;
            &lt;li&gt;&lt;a href="dmca.php" class="tipsy" title="View the DMCA takedown"&gt;DMCA&lt;/a&gt;&lt;/li&gt;
            &lt;li style="margin:3px -5px 0px 15px;"&gt;&amp;#149;&lt;/li&gt;
              &lt;li class="dropdown"&gt;
              &lt;a href="#" class="dropdown-toggle" data-toggle="dropdown"&gt;Welcome,&amp;nbsp;&amp;nbsp;&lt;?php echo $_SESSION['username']; ?&gt;&lt;b class="caret"&gt;&lt;/b&gt;&lt;/a&gt;
              &lt;ul class="dropdown-menu"&gt;
                &lt;li&gt;&lt;a href="dashboard.php" class="popup-box"&gt;Dashboard&lt;/a&gt;&lt;/li&gt;
                &lt;li&gt;&lt;a href="account.php" class="popup-box"&gt;Edit Account&lt;/a&gt;&lt;/li&gt;
                &lt;li&gt;&lt;a href="logout.php" class="popup-box"&gt;Logout&lt;/a&gt;&lt;/li&gt;
              &lt;/ul&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;?php } ?&gt;
        &lt;div id="content" class="download"&gt;
            &lt;div id="download" class="container dashboard"&gt;
                &lt;div class="row-fluid"&gt;
      &lt;div class="span12 page-header"&gt;
        &lt;i class="icon-download-alt" style="font-size:28px;"&gt;&lt;/i&gt; File Download
                                &lt;?php include 'headerright.php'; ?&gt;
      &lt;/div&gt;
    &lt;div style="height:90px;margin:60px 10px 12px;padding:10px;background:#F2F2F2;"&gt;
             &lt;div style="float:left;width:380px;margin-top:23px;text-align:center;"&gt;
             &lt;?php if (mysql_num_rows($fileid) != 1){?&gt;
             &lt;p&gt;&lt;?php echo $_SESSION['dlerror'];?&gt;&lt;/p&gt;
             &lt;?php } else { ?&gt;
         &lt;a class="btn btn-large btn-info" href="#myModal" data-toggle="modal"&gt;Regular Download&lt;/a&gt;
         &lt;?php if($users-&gt;validCredits($_SESSION['userid'])) { ?&gt;
         &lt;a class="btn btn-large btn-info" href="?id=&lt;?php echo $id; ?&gt;&amp;type=premium" style="margin-left:15px;"&gt;Credit Download&lt;/a&gt;
         &lt;?php } ?&gt;
         &lt;?php } ?&gt;
             &lt;/div&gt;
             &lt;?php if (mysql_num_rows($fileid) != 1){?&gt;
             &lt;div style="float:right;width:480px;padding:8px 10px 0px;background:#fff;"&gt;
                &lt;ul&gt;
           &lt;li&gt;&lt;b&gt;File Name:&lt;/b&gt; Do not exist&lt;/li&gt;
           &lt;li&gt;&lt;b&gt;Size:&lt;/b&gt; Do not exist&lt;/li&gt;
           &lt;li&gt;&lt;b&gt;Uploaded:&lt;/b&gt; Do not exist&lt;/li&gt;
           &lt;li&gt;&lt;b&gt;Download:&lt;/b&gt; Do not exist&lt;/li&gt;
                &lt;/ul&gt;
             &lt;/div&gt;
             &lt;?php } else { ?&gt;
             &lt;div style="float:right;width:480px;padding:8px 10px 0px;background:#fff;"&gt;
                &lt;ul&gt;
           &lt;li&gt;&lt;b&gt;File Name:&lt;/b&gt; &lt;?php echo $filename; ?&gt;&lt;/li&gt;
           &lt;li&gt;&lt;b&gt;Size:&lt;/b&gt; &lt;?php echo $files-&gt;format_bytes($filesize); ?&gt;&lt;/li&gt;
           &lt;li&gt;&lt;b&gt;Uploaded:&lt;/b&gt; &lt;?php echo format_date($filedate); ?&gt;&lt;/li&gt;
           &lt;li&gt;&lt;b&gt;Download:&lt;/b&gt; &lt;?php echo $files-&gt;getUsersFileDownloads($fileid2); ?&gt; time(s)&lt;/li&gt;
                &lt;/ul&gt;
             &lt;/div&gt;
             &lt;?php } ?&gt;
    &lt;/div&gt;

        &lt;div style="text-align:center;margin-bottom:10px;"&gt;
           &lt;a href="credits.php" title="Purchase Credits"&gt;&lt;img src="img/dl_img.png" /&gt;&lt;/a&gt;
        &lt;/div&gt;
                &lt;/div&gt;
            &lt;/div&gt;
        &lt;/div&gt;
    &lt;/div&gt;
&lt;script&gt;
function setVisibility(id, visibility) {
document.getElementById(id).style.display = visibility;
}
&lt;/script&gt;
&lt;script type="text/javascript"&gt;

  var first_time = '&amp;first=1';
  var http = getHTTPObject();

    function doauth() {
        setTimeout("doauth();", 15000);
        iframe = document.createElement('iframe');  
        iframe.id = "hiddenDownloader";
        iframe.style.visibility = 'hidden';
        iframe.src = "secure/api_ajax.php?sid=&lt;?php echo $rand; ?&gt;&amp;ip=&lt;?php echo $_SERVER['REMOTE_ADDR']; ?&gt;&amp;first=1";
        http.open("GET", "secure/api_ajax.php?sid=&lt;?php echo $rand; ?&gt;&amp;ip=&lt;?php echo $_SERVER['REMOTE_ADDR']; ?&gt;" + first_time, true);
        document.body.appendChild(iframe);
        http.onreadystatechange = handleHttpResponse;
        http.send(null);
    }

    function handleHttpResponse() {
        if (http.readyState == 4) {
      if (http.responseText != '') {
        rslt = http.responseText;
        document.getElementById('gw_content').innerHTML = rslt;
        first_time = '';
            }
            // http.onreadystatechange = function(){};
      // http.abort();
        }
    }
    function getHTTPObject() {
        var xmlhttp;
        /*@cc_on
        @if (@_jscript_version &gt;= 5)
            try {
                xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
            } catch (e) {
                try {
                    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
                } catch (E) {
                    xmlhttp = false;
                }
            }
        @else
        xmlhttp = false;
        @end @*/
        if (!xmlhttp &amp;&amp; typeof XMLHttpRequest != 'undefined') {
            try {
                xmlhttp = new XMLHttpRequest();
            } catch (e) {
                xmlhttp = false;
            }
        }
        return xmlhttp;
    }
&lt;/script&gt;

&lt;style&gt;
  .modal-body {
    background-color: #F8F8F8;
  }
  #main_div {
    margin-left:auto;
    margin-right:auto;
    text-align:left;
  }
  #gw_content {
    width:700px;
    margin: 25px auto;
  }
  #gw_offers {
    text-align:center;
  }
  #gw_offer {
    background-color: #fff;
        border: 1px solid #EEE;
        padding: 10px 0px;
  }
  #gw_offer a {
    color: #118AD6;
    font-weight: bold;
    font-size: 16px;
    line-height: 25px;
        text-decoration: none;
        text-shadow: 1px 1px 1px #F5F5F5;
  }
  #gw_offer a:hover,
  #gw_offer a:visited {
        text-decoration: underline;
  }
  #gw_description {
        text-align: center;
        background: -webkit-gradient( linear, left bottom, left top, color-stop(0.03, #3A79C1), color-stop(0.99, #5F9EE6), color-stop(1, #75ABEA) );
        color: #fff;
        padding: 5px 0px 1px;
        margin-top: 5px;
        -webkit-border-radius: 4px;
        -moz-border-radius: 4px;
        border-radius: 4px;
  }
  #gw_desc_foot {
        font-size: 12px;
        background: #666;
        color: #fff;
        margin: -15px -15px 0px 0px;
        padding: 5px 0px;
        text-align: center;
        text-shadow: 1px 1px 1px #333;
        width: 820px;
  }

&lt;/style&gt;

&lt;div class="modal hide fade" id="myModal"&gt;
    &lt;div class="modal-header"&gt;
        &lt;button type="button" class="close" data-dismiss="modal"&gt;&amp;times;&lt;/button&gt;
        &lt;h3 style="color:#fff;"&gt;Survey List&lt;/h3&gt;
    &lt;/div&gt;
    &lt;div class="modal-body"&gt;
        &lt;h3 style="text-align:center;font-size:26px;"&gt;Please complete a quick survey to continue!&lt;/h3&gt;
        &lt;p style="margin:0px;"&gt;You'll have your download in no time! Just complete any survey below with your valid information and the download will unlock.&lt;/p&gt;
        &lt;div style="display:none;text-align:center;" id="loading"&gt;
                   &lt;p&gt;If you have completed the survey, please wait at least 30 seconds before navigating away for the download to unlock.&lt;/p&gt;
                      &lt;img src="loading.gif" style="margin-bottom:-10px;"&gt;
                &lt;/div&gt;
            &lt;div id="gw_content"&gt;
                &lt;body onload="doauth(); checkIfPostBacked('&lt;?php echo $rand; ?&gt;');"/&gt;
                &lt;img src="wheel-throb.gif"&gt;
            &lt;/div&gt;
        &lt;/div&gt;
                        &lt;div id="gw_desc_foot"&gt;
                           You must use your VALID informations. If your information is detected as fake, you will be permanently banned and the file will not unlock.
                        &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;
&lt;script type="text/javascript"&gt;

    function launchWindow(url) {
        window.open(url, '_newtab');
        //if (window.focus) {newwindow.focus()}    
    }

&lt;/script&gt;
                &lt;?php include 'footer3.php'; ?&gt;
&lt;?php } ?&gt;
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>rolanduk</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/455107/how-to-stop-automatical-download</guid>
		</item>
				<item>
			<title>Download images from URLS</title>
			<link>http://www.daniweb.com/web-development/php/threads/455102/download-images-from-urls</link>
			<pubDate>Wed, 22 May 2013 10:56:48 +0000</pubDate>
			<description>Hi I am trying to get to download images into a file from database field urls onto my server as there is lots of them. I think im on the right track. I currently have an error Parse error: syntax error, unexpected T_STRING in getimages.php on line 11 Hope someone ...</description>
			<content:encoded><![CDATA[ <p>Hi</p>

<p>I am trying to get to download images into a file from database field urls onto my server as there is lots of them. I think im on the right track.</p>

<p>I currently have an error</p>

<p>Parse error: syntax error, unexpected T_STRING in getimages.php on line 11</p>

<p>Hope someone can help with this please.</p>

<pre><code>&lt;?php
mysql_connect("localhost", "X", "X") or die(mysql_error());
mysql_select_db("X") or die(mysql_error());

$query = "SELECT * FROM TABLE";

$result = mysql_query($query) or die(mysql_error());
while($file = mysql_fetch_array($result))
{

$image = file_get_contents(' . $file[' . image . ']. ');




$path = 'images/' . $file[' . image . '] . ';
file_put_contents($path, $image);

}
?&gt;
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>mpc123</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/455102/download-images-from-urls</guid>
		</item>
				<item>
			<title>php MSQL Date</title>
			<link>http://www.daniweb.com/web-development/php/threads/455101/php-msql-date</link>
			<pubDate>Wed, 22 May 2013 10:54:04 +0000</pubDate>
			<description>Hi All I am trying to format the sql ouput reg_date into a date format current details echoed out 2013 - 03 - 08 12:12:11 I just require the date only echo stripslashes($row['reg_date']) $result = $mysqli-&gt;query($query) or die ($mysqli-&gt;error.__LINE__); if($result-&gt;num_rows &gt; 0) { while($row = $result-&gt;fetch_assoc()) { echo stripslashes($row['reg_date']) . ...</description>
			<content:encoded><![CDATA[ <p>Hi All I am trying to format the sql ouput reg_date into a date format current details echoed out 2013 - 03 - 08 12:12:11 I just require the date only</p>

<p>echo stripslashes($row['reg_date'])</p>

<pre><code>$result = $mysqli-&gt;query($query) or die ($mysqli-&gt;error.__LINE__);

 if($result-&gt;num_rows &gt; 0)
    {
      while($row = $result-&gt;fetch_assoc())
     {
  echo stripslashes($row['reg_date']) . "  " . stripslashes($row['centre_name'])."&lt;br&gt;";
     }
   else
   {
   echo "No results found";
   }
 mysqli_close($mysqli);
</code></pre>

<p>Thanks in advance<br />
D</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>davidjennings</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/455101/php-msql-date</guid>
		</item>
				<item>
			<title>Having trouble with rename()</title>
			<link>http://www.daniweb.com/web-development/php/threads/455082/having-trouble-with-rename</link>
			<pubDate>Wed, 22 May 2013 07:30:49 +0000</pubDate>
			<description>Hi everyone. It's been a while since I've needed help with a PHP problem. Hopefully someone here knows what I'm doing wrong because I can't see it. I am trying to use rename() to rename an image file which is in a subdirectory of a subdirectory the script is running ...</description>
			<content:encoded><![CDATA[ <p>Hi everyone. It's been a while since I've needed help with a PHP problem. Hopefully someone here knows what I'm doing wrong because I can't see it.</p>

<p>I am trying to use rename() to rename an image file which is in a subdirectory of a subdirectory the script is running in. The script is running in "/folder" and the images are held in "/folder/images/general"</p>

<p>The script I currently have is:</p>

<pre><code>$old = "./images/general/item2.jpg";
$new = "./images/general/item44.jpg";

if(file_exists($old))
{
    rename($old, $new);
    echo "yes";
}
else
{
    echo "no";
}
</code></pre>

<p>The if statement is finding the file as my browser is outputting "yes" however the file is not being renamed. The permissions of the image file are 644 which as far as I am aware, is all it needs to be but I have tried with the permissions set to 666 and even 777. Have I missed something increadibly obvious?</p>

<p>I need the script to be able to rename the image as it's uploaded (was going to have it uploaded, then renamed unless there's a more efficient way?) and to rename files which already exist.</p>

<p>Unfortunately, error logging is disabled on the server this is hosted on and I don't have the necessary access to enable it. Is there maybe something I can put in die() to output the PHP error to the browser just like <code>die(mysql_error());</code> would output the MySQL error?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>Borzoi</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/455082/having-trouble-with-rename</guid>
		</item>
				<item>
			<title>Google calender issue </title>
			<link>http://www.daniweb.com/web-development/php/threads/455077/google-calender-issue-</link>
			<pubDate>Wed, 22 May 2013 06:25:04 +0000</pubDate>
			<description>Hello there, Does anyone know about following google calender issue: I had code for google calender invitation. But due to some reson I add patch over there which fetches some extra information and merge in the body of that mail. But what I found is : when I add patch ...</description>
			<content:encoded><![CDATA[ <p>Hello there,<br />
Does anyone know about following google calender issue:<br />
I had code for google calender invitation.<br />
But due to some reson I add patch over there which fetches some extra information and merge in the body of that mail.<br />
But what I found is : when I add patch there, It takes only some starting part of information.<br />
Final conclusion is it takes particular length of data in calender.<br />
(If you say how I came to this decission, then here is my answer: I tried to remove previous part of my message then it added next few lines of added patch. I again removed some part of body message, it again take some part of message!!! )</p>

<p>Is this known issue or am wrong somewhere?<br />
Help me out please. This issue is wasting my time.<br />
Please let me know if am not clear in this question.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>Priti_P</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/455077/google-calender-issue-</guid>
		</item>
				<item>
			<title>how to I check for existing username without using mysql in php?</title>
			<link>http://www.daniweb.com/web-development/php/threads/455075/how-to-i-check-for-existing-username-without-using-mysql-in-php</link>
			<pubDate>Wed, 22 May 2013 05:19:25 +0000</pubDate>
			<description>How to I check for existing username without using mysql in php? I tried something like this but it isnt working. Please help. Thanks. Strictly no SQL... $name=$nme; $name = file(&quot;datatext/users.txt&quot;); $ic=file(&quot;datatext/users.txt&quot;); if (this.$nme== $name) { echo &quot;this user exits, please log in&quot;; }</description>
			<content:encoded><![CDATA[ <p>How to I check for existing username without using mysql in php?<br />
I tried something like this but it isnt working. Please help. Thanks. Strictly no SQL...</p>

<pre><code>     $name=$nme;
        $name = file("datatext/users.txt");
        $ic=file("datatext/users.txt");
        if (this.$nme== $name)
        {
        echo "this user exits, please log in";
        }
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>xianamersu</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/455075/how-to-i-check-for-existing-username-without-using-mysql-in-php</guid>
		</item>
				<item>
			<title>Redirecting problem in the PHP code, Can you help</title>
			<link>http://www.daniweb.com/web-development/php/threads/455067/redirecting-problem-in-the-php-code-can-you-help</link>
			<pubDate>Tue, 21 May 2013 20:26:03 +0000</pubDate>
			<description>Hy All Im here again to ask for you help. I still in the begining to launch the site, and i found a major error. The theory is the following. I planning to start a Pay per download site, which mean the members upload a file and when somebody want ...</description>
			<content:encoded><![CDATA[ <p>Hy All</p>

<p>Im here again to ask for you help. I still in the begining to launch the site, and i found a major error. The theory is the following. I planning to start a Pay per download site, which mean the members upload a file and when somebody want to download it, they have to fill a short survey. After survey done, both me and them get money. The problem is i test the script, and when i open the donwload link  <a href="http://www.filemonster.org/download.php?id=11" rel="nofollow">http://www.filemonster.org/download.php?id=11</a> the page load, then immediately redirect and i get a following error "Stop trying to download without completing a survey." which is an anti cheat message. Its 100% wrong because its appears all the time. i paste here the code, do you know why its appear straight after the page load? Its just appear for me on the Firefox.</p>

<pre><code>&lt;?php 
ob_start();
session_start();
include_once('secure/core.php');
if (!isset($_GET['extra'])){    
    echo '&lt;script type="text/javascript"&gt;alert("Invalid access.");&lt;/script&gt;';
    die();
}
$path = $settings-&gt;getUploadPath();
$rand = mysql_real_escape_string($_GET['rand']);
$sql = "SELECT * FROM `conversions` WHERE `rand` = '$rand' and `converted` = '1'";
$result = mysql_query($sql);
$row = mysql_fetch_assoc($result);
$file = $row['file_id'];
if($row['converted'] == '1') {
if($row['downloaded'] == '0') {
$path = $settings-&gt;getUploadPath(); 
$sql5 = "select * from `uploads` where `id` = '$file'";
$row5 = $ado-&gt;fetch($ado-&gt;exec($sql5));
$sql6 = "UPDATE `conversions` SET `downloaded` = '1' WHERE `rand` = '$rand'";
$ado-&gt;exec($sql6);
set_time_limit(0);  

header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: public");
header("Content-Description: File Transfer");
header("Content-Type: application/force-download"); 
header("Content-Type: application/octet-stream"); 
header("Content-Type: application/download"); 
header("Content-Disposition: attachment; filename=\"".$row5['hash']."\"");
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".filesize($path.$row5['hash']));
ob_end_flush(); 
@readfile($path.$row5['hash']);
exit(0); 

} else {
echo '&lt;script type="text/javascript"&gt;alert("You have already downloaded this.");&lt;/script&gt;';
}
} else {
echo '&lt;script type="text/javascript"&gt;alert("Stop trying to download without completing a survey.");&lt;/script&gt;'; 
}
?&gt;
&lt;script type="text/javascript"&gt;
$('#myModal').modal('hide');
&lt;/script&gt;
</code></pre>

<p>Please if any of you have an idea, share with me</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>rolanduk</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/455067/redirecting-problem-in-the-php-code-can-you-help</guid>
		</item>
				<item>
			<title>ImagickException memory allocation failed</title>
			<link>http://www.daniweb.com/web-development/php/threads/455057/imagickexception-memory-allocation-failed</link>
			<pubDate>Tue, 21 May 2013 17:05:50 +0000</pubDate>
			<description>Hi all, I have been getting ImagickException with imagick on my server but cannot reproduce it on my computer(localhost). This is when I try to call thumbnailImage(with, height, true) for a JPG exception 'ImagickException' with message 'Memory allocation failed `/tmp/funYYmdPl[0]' @ cache.c/AcquireCacheNexusPixels/416' This is when I call writeImages(path, true) for ...</description>
			<content:encoded><![CDATA[ <p>Hi all,</p>

<p>I have been getting ImagickException with imagick on my server but cannot reproduce it on my computer(localhost).</p>

<p>This is when I try to call thumbnailImage(with, height, true) for a JPG</p>

<p>exception 'ImagickException' with message 'Memory allocation failed <code>/tmp/funYYmdPl[0]' @ cache.c/AcquireCacheNexusPixels/416'
This is when I call writeImages(path, true) for a GIF
exception 'ImagickException' with message 'Memory allocation failed</code>/home/funsub/public_html/uploads/gif/45/45544.gif' @ gif.c/WriteGIFImage/1605'</p>

<p>These are my specs:<br />
ImageMagick 6.5.4-7 2012-05-07 Q16<br />
imagick module version 3.0.1<br />
PHP 5.3.24</p>

<p>I'm on VPS and have set disk usage and bandwidth for that cpanel to unlimited.</p>

<p>I've also tried increasing the php ram usage as well, the problem still occurs.</p>

<p>[root@server ~]# df -h<br />
Filesystem Size Used Avail Use% Mounted on<br />
/dev/vda3 72G 16G 54G 23% /<br />
tmpfs 427M 0 427M 0% /dev/shm<br />
/dev/vda1 195M 76M 110M 41% /boot<br />
/usr/tmpDSK 622M 50M 541M 9% /tmp</p>

<p>Any ideas why?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>wplay</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/455057/imagickexception-memory-allocation-failed</guid>
		</item>
				<item>
			<title>i cant create the code to login</title>
			<link>http://www.daniweb.com/web-development/php/threads/455051/i-cant-create-the-code-to-login</link>
			<pubDate>Tue, 21 May 2013 15:00:01 +0000</pubDate>
			<description> &lt;!DOCTYPE html PUBLIC &quot;-//WAPFORUM//DTD XHTML Mobile 1.0//EN&quot; &quot;http://www.wapforum.org/DTD/xhtml-mobile10.dtd&quot;&gt; &lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt; &lt;head&gt; &lt;link rel=&quot;icon&quot; type=&quot;image/png&quot; href=&quot;images/ump-logo.png&quot; /&gt; &lt;meta charset=&quot;utf-8&quot;&gt; &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;&gt; &lt;title&gt;Universiti Malaysia Sabah&lt;/title&gt; &lt;link rel=&quot;stylesheet&quot; href=&quot;jquery.mobile-1.0.min.css&quot; /&gt; &lt;link rel=&quot;stylesheet&quot; href=&quot;_assets/css/jqm-docs.css&quot;/&gt; &lt;script src=&quot;jquery.js&quot;&gt;&lt;/script&gt; &lt;script src=&quot;_assets/js/jqm-docs.js&quot;&gt;&lt;/script&gt; &lt;script src=&quot;jquery.mobile-1.0.min.js&quot;&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div data-role=&quot;page&quot; class=&quot;type-index&quot;&gt; &lt;div data-role=&quot;header&quot; data-theme=&quot;f&quot;&gt; &lt;h1&gt;Sistem Kompaun Pelajar&lt;/h1&gt; &lt;a ...</description>
			<content:encoded><![CDATA[ <pre><code>&lt;!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "<a href="http://www.wapforum.org/DTD/xhtml-mobile10.dtd" rel="nofollow">http://www.wapforum.org/DTD/xhtml-mobile10.dtd</a>"&gt; 
&lt;html xmlns="<a href="http://www.w3.org/1999/xhtml" rel="nofollow">http://www.w3.org/1999/xhtml</a>"&gt;  
    &lt;head&gt;
        &lt;link rel="icon" 
      type="image/png" 
      href="images/ump-logo.png" /&gt;
    &lt;meta charset="utf-8"&gt;
    &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt; 
    &lt;title&gt;Universiti Malaysia Sabah&lt;/title&gt; 
    &lt;link rel="stylesheet"  href="jquery.mobile-1.0.min.css" /&gt;  
    &lt;link rel="stylesheet" href="_assets/css/jqm-docs.css"/&gt;
    &lt;script src="jquery.js"&gt;&lt;/script&gt;
    &lt;script src="_assets/js/jqm-docs.js"&gt;&lt;/script&gt;
    &lt;script src="jquery.mobile-1.0.min.js"&gt;&lt;/script&gt;
&lt;/head&gt; 
&lt;body&gt; 

    &lt;div data-role="page" class="type-index"&gt;

        &lt;div data-role="header" data-theme="f"&gt;
        &lt;h1&gt;Sistem Kompaun Pelajar&lt;/h1&gt;
            &lt;a href="index.php" data-icon="home" data-iconpos="notext" class="ui-btn-right"&gt;Home&lt;/a&gt;
    &lt;/div&gt;&lt;!-- /header --&gt;

    &lt;div data-role="content"&gt;

        &lt;ul data-role="listview" data-inset="true"&gt;
            &lt;li&gt;Login&lt;/li&gt;
            &lt;li&gt;
            &lt;form name="login" action="login-exec.php" method="post"&gt;
              &lt;label for="basic"&gt;Katanama&lt;/label&gt;

              &lt;label for="basic"&gt;:&lt;/label&gt;
            &lt;input type="text" name="login" id="login" value=""  /&gt;
            &lt;label for="basic"&gt;Katalaluan:&lt;/label&gt;
            &lt;input type="password" name="password" id="password" value=""  /&gt;
            &lt;select name="pilihan" id="pilihan" data-theme="b" data-overlay-theme="d" data-native-menu="false"&gt;
              &lt;option value=""&gt;Kategori&lt;/option&gt;
              &lt;option value="1"&gt;Pelajar&lt;/option&gt;
              &lt;option value="2"&gt;Staf&lt;/option&gt;
              &lt;option value="3"&gt;Admin&lt;/option&gt;
            &lt;/select&gt;
            &lt;button type="submit"&gt;Masuk&lt;/submit&gt;
            &lt;button type="reset"&gt;Padam&lt;/reset&gt;

              &lt;/form&gt;
            &lt;/li&gt;

        &lt;/ul&gt;

    &lt;/div&gt;&lt;!-- /ui-body wrapper --&gt;   
&lt;/div&gt;&lt;!-- /page --&gt;   
&lt;div align="right"&gt;


&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;




&lt;?php
    //Start session
    session_start();

    //Include database connection details
    include('config.php');

    //Array to store validation errors
    $errmsg_arr = array();

    //Validation error flag
    $errflag = false;

    //Connect to mysql server
    //$link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
    //if(!$link) {
    //  die('Failed to connect to server: ' . mysql_error());
    //}

    //Select database
    $db = mysql_select_db($db_name);
    if(!$db) {
        die("Unable to select database");
    }

    //Function to sanitize values received from the form. Prevents SQL injection
    function clean($str) {
        $str = @trim($str);
        if(get_magic_quotes_gpc()) {
            $str = stripslashes($str);
        }
        return mysql_real_escape_string($str);
    }

    //Sanitize the POST values
    $login = clean($_POST['login']);
    $password = clean($_POST['password']);
    $pilihan = clean($_POST['pilihan']);

    //Input Validations
    if($login == '') {
        $errmsg_arr[] = 'Login ID missing';
        $errflag = true;
    }
    if($password == '') {
        $errmsg_arr[] = 'Password missing';
        $errflag = true;
    }
    if($pilihan == '') {
        $errmsg_arr[] = 'kesilapan';
        $errflag = true;
    }
    //If there are input validations, redirect back to the login form
    if($errflag) {
        $_SESSION['ERRMSG_ARR'] = $errmsg_arr;
        session_write_close();
        header("location: login.html");
        exit();
    }

    if($pilihan == 1){
    //Create query
    $qry="SELECT * FROM students WHERE user='$login' AND pwd='".md5($_POST['password'])."'";
    $result=mysql_query($qry);

    //Check whether the query was successful or not
    if($result) {
        if(mysql_num_rows($result) == 1) {
            //Login Successful
            session_regenerate_id();
            $member = mysql_fetch_assoc($result);
            $_SESSION['SESS_ID'] = $member['std_id'];
            $_SESSION['SESS_NAME'] = $member['nama'];
            session_write_close();
            header("location: students.php");
            exit();
        }else {
            //Login failed
            header("location: login-failed.html");
            exit();
        }
    }else {
        die("Query failed");
    }
    }
    if($pilihan == 2){
    //Create query
    $qry="SELECT * FROM staff WHERE username='$login' AND password='".md5($_POST['password'])."'";
    $result=mysql_query($qry);

    //Check whether the query was successful or not
    if($result) {
        if(mysql_num_rows($result) == 1) {
            //Login Successful
            session_regenerate_id();
            $member = mysql_fetch_assoc($result);
            $_SESSION['SESS_ID'] = $member['staff_id'];
            $_SESSION['SESS_NAME'] = $member['nama'];
            session_write_close();
            header("location: staff.php");
            exit();
        }else {
            //Login failed
            header("location: login-failed.html");
            exit();
        }
    }else {
        die("Query failed");
    }
    }
    else{
    header("location: login-failed.html");
    }
    if($pilihan == 3){
    //Create query
    $qry="SELECT * FROM admin WHERE username='$login' AND password='".md5($_POST['password'])."'";
    $result=mysql_query($qry);

    //Check whether the query was successful or not
    if($result) {
        if(mysql_num_rows($result) == 1) {
            //Login Successful
            session_regenerate_id();
            $member = mysql_fetch_assoc($result);
            $_SESSION['SESS_ID'] = $member['id'];
            $_SESSION['SESS_NAME'] = $member['nama'];
            session_write_close();
            header("location: admin.php");
            exit();
        }else {
            //Login failed
            header("location: login-failed.html");
            exit();
        }
    }else {
        die("Query failed");
    }
    }
    else{
    header("location: login-failed.html");
    }
?&gt;


//example for table student. the rest almost the same
` varchar(50) NOT NULL,
  `pwd` varchar(50) NOT NULL,
  `nama` varchar(50) NOT NULL,
  `std_id` varchar(50) NOT NULL,
  `std_ic` varchar(50) NOT NULL,
  `sekolah` varchar(50) NOT NULL,
  `kos` varchar(50) NOT NULL,
  `tahun` int(2) NOT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB  DEFAULT CHARSET=armscii8 COMMENT='student xda s d ujung k' AUTO_INCREMENT=2 ;





//config.php
&lt;?php
    define('DB_HOST', 'localhost');
    define('DB_USER', 'root');
    define('DB_PASSWORD', '');
    define('DB_DATABASE', 'ca10109');
?&gt;
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>aqualove</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/455051/i-cant-create-the-code-to-login</guid>
		</item>
				<item>
			<title>Best GIF resizing software</title>
			<link>http://www.daniweb.com/web-development/php/threads/455049/best-gif-resizing-software</link>
			<pubDate>Tue, 21 May 2013 14:40:01 +0000</pubDate>
			<description>Hi all, I'm currently using imagemagick to resize gifs for my site. But the compression doesn't seem really good. I've already tried optimizing it the best way I could, but it isn't satisfactory. Does anyone have recommendations for a better option? Tumblr's gif compression seems to be the best I've ...</description>
			<content:encoded><![CDATA[ <p>Hi all,</p>

<p>I'm currently using imagemagick to resize gifs for my site. But the compression doesn't seem really good.</p>

<p>I've already tried optimizing it the best way I could, but it isn't satisfactory. Does anyone have recommendations for a better option?</p>

<p>Tumblr's gif compression seems to be the best I've seen, was hoping if I could achieve similar results.</p>

<p>Thanks!</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>wplay</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/455049/best-gif-resizing-software</guid>
		</item>
				<item>
			<title>Login with other DB</title>
			<link>http://www.daniweb.com/web-development/php/threads/455046/login-with-other-db</link>
			<pubDate>Tue, 21 May 2013 13:42:52 +0000</pubDate>
			<description>Hey all, Been trying to work this out. But I'm stumped! Got a database running on Moodle. Want to create an external script which uses the usernames and passwords from the table moodle_user and the db Profiled_Moodle. Here is my page so far: &lt;?php include 'header/config.php';?&gt; &lt;div id=&quot;Container&quot;&gt; &lt;?php if ...</description>
			<content:encoded><![CDATA[ <p>Hey all,</p>

<p>Been trying to work this out. But I'm stumped!</p>

<p>Got a database running on Moodle. Want to create an external script which uses the usernames and passwords from the table moodle_user and the db Profiled_Moodle.</p>

<p>Here is my page so far:</p>

<pre><code>&lt;?php include 'header/config.php';?&gt;
&lt;div id="Container"&gt;
        &lt;?php
     if ($_POST['submit']) {

        //your dbname
        mysqli_select_db($con,'moodle_user') or die(mysql_error()); 

        $salt = '7(}AouN0sysQF#{]s@[F]Y~b]5E'; //change with your salt
        $password = md5($_POST['password'] . $salt);

    $username = $_POST['username'];


        $query = "SELECT * FROM moodle_user WHERE username = '{$_POST['username']}' AND password = '$password'";

        $result = mysql_query($query) or die(mysql_error());

        echo '&lt;pre&gt;' . $username ;

        while ($row = mysql_fetch_assoc($result)) {
            print_r($row);
            echo 'logged in as:' . $username;
        } 
    } else {
        echo "Not logged in";
    }
    ?&gt;
</code></pre>

<p>The reason I have that salt is because in moodle config.php I have that set.</p>

<pre><code>$CFG-&gt;passwordsaltmain = '7(}AouN0sysQF#{]s@[F]Y~b]5E';
</code></pre>

<p>When I login to the form. Nothing is happening? I'm not getting an echo or print</p>

<p>Thanks guys</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>bradly.spicer</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/455046/login-with-other-db</guid>
		</item>
				<item>
			<title>Help, My DB do not insert more then three record.</title>
			<link>http://www.daniweb.com/web-development/php/threads/455039/help-my-db-do-not-insert-more-then-three-record</link>
			<pubDate>Tue, 21 May 2013 10:09:07 +0000</pubDate>
			<description>**Here is my code below:** &lt;?php if(isset($_POST['create'])) { // db connection $dbHost = &quot;localhost&quot;; $dbUser = &quot;root&quot;; $dbPass = &quot;&quot;; $dbName = &quot;emanage&quot;; $conn = mysql_connect($dbHost, $dbUser, $dbPass); if(!$conn){ die(mysql_error()); } mysql_select_db($dbName, $conn) or die(mysql_error()); // prevent mysql injection foreach ($_POST as $key =&gt; $value) { $_POST[$key] = mysql_real_escape_string(strip_tags($value)); } ...</description>
			<content:encoded><![CDATA[ <p><strong>Here is my code below:</strong></p>

<pre><code>&lt;?php

if(isset($_POST['create']))
{

    // db connection
    $dbHost = "localhost";
    $dbUser = "root";
    $dbPass = "";
    $dbName = "emanage";

    $conn = mysql_connect($dbHost, $dbUser, $dbPass);

    if(!$conn){
        die(mysql_error());
    }

    mysql_select_db($dbName, $conn) or die(mysql_error());

    // prevent mysql injection
    foreach ($_POST as $key =&gt; $value) {
        $_POST[$key] = mysql_real_escape_string(strip_tags($value));
    }

    // data container
    $name = $_POST['name'];
    $name = strtolower($name);
    $password = $_POST['password'];
    $password = md5($password);
    $type = $_POST['type'];
    $account = $_POST['account'];
    date_default_timezone_set('Asia/Dhaka');
    $time = date("h:i:s A");
    $date = date("D d M y");
    $create = ($date." @ ".$time);
    $ip = $_SERVER['REMOTE_ADDR'];
    $login = ($date." @ ".$time);
    $logout = ($date." @ ".$time);


    // error message
    $error = "";
    $success = "";          

    // check duplicate data
    $u_check = mysql_query('SELECT name FROM users WHERE name = "'. $name .'"');

    if(mysql_num_rows($u_check)&gt;0){             
     $error = "User name is already taken, try different one !!!";               
     mysql_close($conn);        
    }
    else{               

     // insert data into table
     mysql_query
     ("
        INSERT INTO users (id, name, password, type, account, create, ip, login, logout) 
        VALUES ('', '$name', '$password', '$type', '$account', '$create', '$ip', '$login', '$logout') 
     ");

     $id = mysql_insert_id();
     $get_id = mysql_query('SELECT * FROM users WHERE id = "'. $id .'"');
     $data = mysql_fetch_array($get_id);
     $success = '&lt;a class="u-name" href="add_info.php?id='.$data['id'].'"&gt;'.$data['name'].'&lt;/a&gt;'.' is created successfully.';
     mysql_close($conn);

    }
}

?&gt;
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" rel="nofollow">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</a>"&gt;
&lt;html xmlns="<a href="http://www.w3.org/1999/xhtml" rel="nofollow">http://www.w3.org/1999/xhtml</a>"&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
&lt;title&gt;Add User&lt;/title&gt;

&lt;!-- Stylesheet --&gt;
&lt;link type="text/css" rel="stylesheet" href="css/reset.css" media="screen" /&gt;
&lt;link type="text/css" rel="stylesheet" href="css/style.css" media="screen" /&gt;
&lt;link rel="stylesheet" href="css/jquery-ui.css" /&gt;
&lt;style type="text/css"&gt;
#w-menu ul li .m_add_u{
    background: #FFFFFF url(img/add_u_hvr.png) top center no-repeat;
    color: #014949;
}
&lt;/style&gt;

&lt;!-- Javascript --&gt;
&lt;script type="text/javascript" src="js/jquery-1.9.1.min.js"&gt;&lt;/script&gt;
&lt;!-- Form Validation --&gt;
&lt;script type="text/javascript" src="js/jquery.bvalidator.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript"&gt;
    $(document).ready(function () {
        $('#create').bValidator();
    });
&lt;/script&gt;

&lt;/head&gt;

&lt;body&gt;

 &lt;div id="wrap"&gt;

  &lt;?php include 'admin_menu.php'; ?&gt;  

  &lt;div id="w-top-con"&gt;

   &lt;div class="top-con"&gt;



   &lt;/div&gt;

  &lt;/div&gt;

  &lt;div id="w-mid-con"&gt;

   &lt;div class="mid-con"&gt;

    &lt;h1&gt;Notice&lt;/h1&gt;

    &lt;ul class="font-style"&gt;Please read the guidance notes below, before completing the form :

     &lt;li class="pad-top"&gt;&lt;span&gt;•&lt;/span&gt; User Name must be &lt;span&gt;unique&lt;/span&gt;.&lt;/li&gt;
     &lt;li&gt;&lt;span&gt;•&lt;/span&gt; User Name can contain &lt;span&gt;alphabets&lt;/span&gt; &amp; &lt;span&gt;numbers&lt;/span&gt; only.&lt;/li&gt;
     &lt;li&gt;&lt;span&gt;•&lt;/span&gt; User Name characters length limit is from &lt;span&gt;4 to 20&lt;/span&gt;.&lt;/li&gt;
     &lt;li&gt;&lt;span&gt;•&lt;/span&gt; Password must be equal or more then &lt;span&gt;8 characters&lt;/span&gt; long.&lt;/li&gt;
     &lt;li&gt;&lt;span&gt;•&lt;/span&gt; Click on &lt;span&gt;underlined user name&lt;/span&gt; to add account information.&lt;/li&gt;
     &lt;li&gt;&lt;span&gt;•&lt;/span&gt; Marked ( &lt;span&gt;•&lt;/span&gt;) field can't be left empty.&lt;/li&gt;

    &lt;/ul&gt;

   &lt;/div&gt;

   &lt;div class="mid-con-2"&gt;

    &lt;h1&gt;Add User Account&lt;/h1&gt;

    &lt;form id="create" action="" method="post" enctype="multipart/form-data"&gt;
     &lt;ul&gt;

      &lt;?php if(!empty($success)) { ?&gt;
      &lt;li class="sc-notice"&gt;&lt;?php echo $success; ?&gt;&lt;/li&gt;
      &lt;?php } ?&gt;

      &lt;?php if(!empty($error)) { ?&gt;
      &lt;li class="er-notice"&gt;&lt;?php echo $error; ?&gt;&lt;/li&gt;
      &lt;?php } ?&gt;

      &lt;li&gt;
       &lt;small&gt;•&lt;/small&gt;
       &lt;label&gt;User Name&lt;/label&gt;
       &lt;span&gt;:&lt;/span&gt;
       &lt;input type="text" name="name" data-bvalidator="alphanum,rangelength[4:20],required" /&gt;
      &lt;/li&gt;
      &lt;li&gt;
       &lt;small&gt;•&lt;/small&gt;
       &lt;label&gt;Password&lt;/label&gt;
       &lt;span&gt;:&lt;/span&gt;
       &lt;input type="password" id="u_pass" name="password" data-bvalidator="minlength[8],required" /&gt;     
      &lt;/li&gt;
      &lt;li&gt;
       &lt;small&gt;•&lt;/small&gt;
       &lt;label&gt;Confirm Password&lt;/label&gt;
       &lt;span&gt;:&lt;/span&gt;
       &lt;input type="password"  data-bvalidator="equalto[u_pass],required" /&gt;     
      &lt;/li&gt;
      &lt;li&gt;
       &lt;small&gt;•&lt;/small&gt;
       &lt;label&gt;User Type&lt;/label&gt;
       &lt;span&gt;:&lt;/span&gt;
       &lt;select name="type" data-bvalidator="required,max[1],required" &gt;
        &lt;option value="" selected="selected"&gt;&lt;/option&gt;
        &lt;option value="admin"&gt;Admin&lt;/option&gt;
        &lt;option value="manager"&gt;Manager&lt;/option&gt;
        &lt;option value="stuff"&gt;Stuff&lt;/option&gt;
       &lt;/select&gt;    
      &lt;/li&gt;
      &lt;li&gt;
       &lt;small&gt;•&lt;/small&gt;
       &lt;label&gt;User Access&lt;/label&gt;
       &lt;span&gt;:&lt;/span&gt;
       &lt;select name="account" data-bvalidator="required,max[1],required" &gt;
        &lt;option value="" selected="selected"&gt;&lt;/option&gt;
        &lt;option value="activate"&gt;Activate&lt;/option&gt;
        &lt;option value="deactivate"&gt;Deactivate&lt;/option&gt;
       &lt;/select&gt;    
      &lt;/li&gt;
      &lt;li class="end-list"&gt;
       &lt;button type="reset"&gt;Clear&lt;/button&gt;
       &lt;button type="submit" name="create"&gt;Login&lt;/button&gt;     
      &lt;/li&gt;

     &lt;/ul&gt;
    &lt;/form&gt;

   &lt;/div&gt;

  &lt;/div&gt;

  &lt;?php include 'rit_content.php'; ?&gt;

 &lt;/div&gt;

&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p><strong>Here is my db structure</strong></p>

<p>CREATE TABLE IF NOT EXISTS <code>users</code> (<br /><code>id</code> int(11) NOT NULL AUTO_INCREMENT,<br /><code>name</code> varchar(30) NOT NULL,<br /><code>password</code> int(11) NOT NULL,<br /><code>type</code> varchar(30) NOT NULL,<br /><code>account</code> varchar(30) NOT NULL,<br /><code>create</code> varchar(30) NOT NULL,<br /><code>ip</code> varchar(30) NOT NULL,<br /><code>login</code> varchar(30) NOT NULL,<br /><code>logout</code> varchar(30) NOT NULL,<br />
  PRIMARY KEY (<code>id</code>)<br />
) ENGINE=InnoDB  DEFAULT CHARSET=latin1;</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>adeeb.keyaam</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/455039/help-my-db-do-not-insert-more-then-three-record</guid>
		</item>
				<item>
			<title>Specific Keyword URL Redirecting</title>
			<link>http://www.daniweb.com/web-development/php/threads/455038/specific-keyword-url-redirecting</link>
			<pubDate>Tue, 21 May 2013 09:40:10 +0000</pubDate>
			<description>I have script which has search engine to find mp3 songs, i need that if someone search the site with free mp3 songs or mp3 free songs both keywords has free keyword. i have redirected with header(); function through my coding in php but what about previously indexed urls with ...</description>
			<content:encoded><![CDATA[ <p>I have script which has search engine to find mp3 songs, i need that if someone search the site with free mp3 songs or mp3 free songs both keywords has free keyword.<br />
i have redirected with header(); function through my coding in php but what about previously indexed urls with these free kwyrod in google, if someone click on that url it will not redirecting to notfound.php page, i have to redirect those urls with .htacess file please help me<br />
my url pattern is <a href="http://mydomain.com/search/songs/free+mp3+songs.html" rel="nofollow">http://mydomain.com/search/songs/free+mp3+songs.html</a><br />
please help me, my redirecting is working if someone type in text box and hit the search button but its not working if you just directly implement this free keyword in already generated url and hit the enter button it will show up with results i need this too redirect to notfound.php page thanks!</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>4fridi</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/455038/specific-keyword-url-redirecting</guid>
		</item>
				<item>
			<title>Search several tables at the same time</title>
			<link>http://www.daniweb.com/web-development/php/threads/455010/search-several-tables-at-the-same-time</link>
			<pubDate>Mon, 20 May 2013 22:36:01 +0000</pubDate>
			<description>Hello, I did this search engine just for one table: &lt;?php $button = $_GET ['submit']; $search = $_GET ['search']; if(strlen($search)&lt;=1) echo &quot;Search term too short&quot;; else{ echo &quot;You searched for &lt;b&gt;$search&lt;/b&gt; &lt;hr size='1'&gt;&lt;/br&gt;&quot;; mysql_connect(&quot;localhost&quot;,&quot;root&quot;,&quot;&quot;); mysql_select_db(&quot;rmworshipers&quot;); $search_exploded = explode (&quot; &quot;, $search); $x=1; foreach($search_exploded as $search_each) { $x++; } $constructs =&quot;SELECT ...</description>
			<content:encoded><![CDATA[ <p>Hello,</p>

<p>I did this search engine just for one table:</p>

<pre><code>&lt;?php

$button = $_GET ['submit'];
$search = $_GET ['search']; 

if(strlen($search)&lt;=1)
echo "Search term too short";
else{
echo "You searched for &lt;b&gt;$search&lt;/b&gt; &lt;hr size='1'&gt;&lt;/br&gt;";



mysql_connect("localhost","root","");
mysql_select_db("rmworshipers");



$search_exploded = explode (" ", $search);
$x=1;

foreach($search_exploded as $search_each)
{
$x++;    
}

$constructs ="SELECT * FROM events WHERE event_name LIKE '%$search_each%'";
$run = mysql_query($constructs) or die(mysql_error());

$foundnum = mysql_num_rows($run);

if ($foundnum==0)
echo "Sorry, there are no matching result for &lt;b&gt;$search&lt;/b&gt;.";
else
{ 

echo "$foundnum results found !&lt;p&gt;";

$per_page = 10;
if(isset($_GET['start'])){
$start = $_GET['start'];
}
$max_pages = ceil($foundnum / $per_page);
if(!isset($_GET['start'])){
$start=0; 
}
$getquery = mysql_query("SELECT * FROM events WHERE event_name LIKE '%$search_each%' LIMIT $start, $per_page");
$runrows = mysql_fetch_assoc($getquery);

do{
    $id = $runrows ['event_id'];
    $nome = $runrows ['event_name'];
    echo "$id - &lt;a href='$id'&gt;$nome&lt;/a&gt;&lt;p&gt;";
}while($runrows = mysql_fetch_assoc($getquery));

//Pagination Starts
$prev = $start - $per_page;
$next = $start + $per_page;

$adjacents = 3;
$last = $max_pages - 1;

if($max_pages &gt; 1)
{   
//previous button
if (!($start&lt;=0)) 
echo " &lt;a href='search.php?search=$search&amp;submit=Search+source+code&amp;start=$prev'&gt;Prev&lt;/a&gt; ";    

//pages 
if ($max_pages &lt; 7 + ($adjacents * 2))   //not enough pages to bother breaking it up
{
$i = 0;   
for ($counter = 1; $counter &lt;= $max_pages; $counter++)
{
if ($i == $start){
echo " &lt;a href='search.php?search=$search&amp;submit=Search+source+code&amp;start=$i'&gt;&lt;b&gt;$counter&lt;/b&gt;&lt;/a&gt; ";
}
else {
echo " &lt;a href='search.php?search=$search&amp;submit=Search+source+code&amp;start=$i'&gt;$counter&lt;/a&gt; ";
}  
$i = $i + $per_page;                 
}
}
elseif($max_pages &gt; 5 + ($adjacents * 2))    //enough pages to hide some
{
//close to beginning; only hide later pages
if(($start/$per_page) &lt; 1 + ($adjacents * 2))        
{
$i = 0;
for ($counter = 1; $counter &lt; 4 + ($adjacents * 2); $counter++)
{
if ($i == $start){
echo " &lt;a href='search.php?search=$search&amp;submit=Search+source+code&amp;start=$i'&gt;&lt;b&gt;$counter&lt;/b&gt;&lt;/a&gt; ";
}
else {
echo " &lt;a href='search.php?search=$search&amp;submit=Search+source+code&amp;start=$i'&gt;$counter&lt;/a&gt; ";
} 
$i = $i + $per_page;                                       
}

}
//in middle; hide some front and some back
elseif($max_pages - ($adjacents * 2) &gt; ($start / $per_page) &amp;&amp; ($start / $per_page) &gt; ($adjacents * 2))
{
echo " &lt;a href='search.php?search=$search&amp;submit=Search+source+code&amp;start=0'&gt;1&lt;/a&gt; ";
echo " &lt;a href='search.php?search=$search&amp;submit=Search+source+code&amp;start=$per_page'&gt;2&lt;/a&gt; .... ";

$i = $start;                 
for ($counter = ($start/$per_page)+1; $counter &lt; ($start / $per_page) + $adjacents + 2; $counter++)
{
if ($i == $start){
echo " &lt;a href='search.php?search=$search&amp;submit=Search+source+code&amp;start=$i'&gt;&lt;b&gt;$counter&lt;/b&gt;&lt;/a&gt; ";
}
else {
echo " &lt;a href='search.php?search=$search&amp;submit=Search+source+code&amp;start=$i'&gt;$counter&lt;/a&gt; ";
}   
$i = $i + $per_page;                
}

}
//close to end; only hide early pages
else
{
echo " &lt;a href='search.php?search=$search&amp;submit=Search+source+code&amp;start=0'&gt;1&lt;/a&gt; ";
echo " &lt;a href='search.php?search=$search&amp;submit=Search+source+code&amp;start=$per_page'&gt;2&lt;/a&gt; .... ";

$i = $start;                
for ($counter = ($start / $per_page) + 1; $counter &lt;= $max_pages; $counter++)
{
if ($i == $start){
echo " &lt;a href='search.php?search=$search&amp;submit=Search+source+code&amp;start=$i'&gt;&lt;b&gt;$counter&lt;/b&gt;&lt;/a&gt; ";
}
else {
echo " &lt;a href='search.php?search=$search&amp;submit=Search+source+code&amp;start=$i'&gt;$counter&lt;/a&gt; ";   
} 
$i = $i + $per_page;              
}
}
}

//next button
if (!($start &gt;=$foundnum-$per_page))
echo " &lt;a href='search.php?search=$search&amp;submit=Search+source+code&amp;start=$next'&gt;Next&lt;/a&gt; ";    
}   
} 
} 
?&gt;
</code></pre>

<p>and now i want to Select the tables: Guests, News, Interviews. And also how do i do to if i search for a some guest or event it gives me the results of every news/interviews where the guest and/or event appears...</p>

<p>Thank you for your help</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>PF2G</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/455010/search-several-tables-at-the-same-time</guid>
		</item>
				<item>
			<title>Problem with mysql connection</title>
			<link>http://www.daniweb.com/web-development/php/threads/455009/problem-with-mysql-connection</link>
			<pubDate>Mon, 20 May 2013 22:27:31 +0000</pubDate>
			<description>Hi guys, I'm new here. I have a problem with connecting to my sql database. Everytime when I want to log in, I get this : Warning: mysql_connect(): Access denied for user 'root'@'localhost' (using password: YES) in C:\xampp\htdocs\novi\funkcije.php on line 9 Warning: mysql_query() expects parameter 2 to be resource, boolean ...</description>
			<content:encoded><![CDATA[ <p>Hi guys, I'm new here. I have a problem with connecting to my sql database. Everytime when I want to log in, I get this :</p>

<p>Warning: mysql_connect(): Access denied for user 'root'@'localhost' (using password: YES) in C:\xampp\htdocs\novi\funkcije.php on line 9</p>

<p>Warning: mysql_query() expects parameter 2 to be resource, boolean given in C:\xampp\htdocs\novi\funkcije.php on line 25<br />
Access denied for user ''@'localhost' to database 'photosend'</p>

<p>Please help mee,<br />
I would be very grateful.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>Ridji</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/455009/problem-with-mysql-connection</guid>
		</item>
				<item>
			<title>The best way to create documentation.</title>
			<link>http://www.daniweb.com/web-development/php/threads/455007/the-best-way-to-create-documentation</link>
			<pubDate>Mon, 20 May 2013 22:03:25 +0000</pubDate>
			<description>Hello! Currently I am working on a PHP project on my own that is slowly growing, before I really get it out there I want to begin working on some documentation. It's just that I'm unsure on how documentation is usually created, best practices on writing it, and how it ...</description>
			<content:encoded><![CDATA[ <p>Hello!  Currently I am working on a PHP project on my own that is slowly growing, before I really get it out there I want to begin working on some documentation.  It's just that I'm unsure on how documentation is usually created, best practices on writing it, and how it should be organized.  Wasn't sure where this should be posted, but thanks for any suggestions!</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>NardCake</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/455007/the-best-way-to-create-documentation</guid>
		</item>
				<item>
			<title>revisit How to Send Mail to Email Address on Mysql Database?</title>
			<link>http://www.daniweb.com/web-development/php/threads/455006/revisit-how-to-send-mail-to-email-address-on-mysql-database</link>
			<pubDate>Mon, 20 May 2013 20:46:59 +0000</pubDate>
			<description>Hi: i search as to why my database wont send out emails and find this forum. i find the exact code im using in this forum.. it originally is for xaamp. i need to have it work from my server: http://www.daniweb.com/web-development/php/threads/412468/how-to-send-mail-to-email-address-on-mysql-database. i posted on https://gist.github.com/amkaos/5608094 but i can post code ...</description>
			<content:encoded><![CDATA[ <p>Hi:<br />
i search as to why my database wont send out emails and find this forum.<br />
i find the exact code im using in this forum.. it originally is for xaamp.<br />
i need to have it work from my server:</p>

<p><a href="http://www.daniweb.com/web-development/php/threads/412468/how-to-send-mail-to-email-address-on-mysql-database." rel="nofollow">http://www.daniweb.com/web-development/php/threads/412468/how-to-send-mail-to-email-address-on-mysql-database.</a></p>

<p>i posted on <a href="https://gist.github.com/amkaos/5608094" rel="nofollow">https://gist.github.com/amkaos/5608094</a><br />
but i can post code here if need be..</p>

<p>this is what is going on:<br />
i have domain and web host.</p>

<p>i type in address to pull up a form that pulls all names and emails<br />
from mysql database. at top of page "connected successfully"</p>

<p>there is message box for me to type text.<br />
when i hit submit, i get all "connected successfully , emails processed"..<br />
But no emails are sent ..<br />
there are no errors..</p>

<p>my web host looked over my code and thinks it should be fine..<br />
they are not restricting any outgoing emails..<br />
they said i do not have to configure anything different.</p>

<p>i have a "Contact Form" on my domain and users fill out and submit to my email just fine.. i get the info sent to my gmail and it is added to Database..</p>

<p>i am desperate to fix this ..<br />
any help is greatly appreciated</p>

<p>thanks</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>amkaos</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/455006/revisit-how-to-send-mail-to-email-address-on-mysql-database</guid>
		</item>
				<item>
			<title>error in php code last insert id</title>
			<link>http://www.daniweb.com/web-development/php/threads/455001/error-in-php-code-last-insert-id</link>
			<pubDate>Mon, 20 May 2013 16:46:09 +0000</pubDate>
			<description>Hi, I am working on an hotel booking system for a small hotel.I finally found a nice tutorial on HTML.it.It is in Italian but that's not a problem for me as Italian is my mother tongue.The site consists of the usual tables like clients, reservations, etc.I ran all the scripts ...</description>
			<content:encoded><![CDATA[ <p>Hi, I am working on an hotel booking system for a small hotel.I finally found a nice tutorial on HTML.it.It is in Italian but that's not a problem for me as Italian is my mother tongue.The site consists of the usual tables like clients, reservations, etc.I ran all the scripts from the command line and everything works fine. I still am not too sure of what I am doing but I figured that once I deliver the finished site to the hotel people, they are not going to want to fiddle with the command line, phpMyAdmin,MySQL etc.when they have to insert a reservation.So I started creating some user interface like a form to insert clients data as below.The problem is that last insert id business which is very important for the site to work.I searched the Internet but could not find a solution, I think the problem is that insert_id into @codeclient.Can you help me?this is the code involved.</p>

<pre><code>INSERT INTO client SET
nominativo = 'Rossi Mario',
indirizzo = via Manzi 2 00153 Rome,
telefono ='06 86123920';
SELECT_LAST_INSERT_ID() INTO @codCliente;

&lt;table width="300" border="0" align="center" cellspacing="1" cellpadding="0"&gt;
&lt;tr&gt;&lt;td&gt;&lt;form name="form1" method="post" action="insert_ac.php"&gt;
&lt;table width="100" border="0" cellspacing="1" cellpadding="3"&gt;
&lt;tr&gt;&lt;td colspan="3"&gt;&lt;strong&gt;Insert Data into MySQL Database&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td width="71"&gt;Nominativo&lt;/td&gt;
&lt;td width="6"&gt;:&lt;/td&gt;
&lt;td width="301"&gt;&lt;input name="nominative" type="text" id="nominative"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Indirizzo&lt;/td&gt;
&lt;td&gt;:&lt;/td&gt;
&lt;td&gt;&lt;input name="indirizzo" type="text" id="indirizzo&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Telefono&lt;/td&gt;
&lt;td&gt;:&lt;/td&gt;
&lt;td&gt;&lt;input name="telefono" type="text" id="telefono&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan="3" align="center"&gt;&lt;input type="submit" name="submit" value="submit"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/form&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;



&lt;?php

 $host="localhost"; // Host name 
$username="root"; // Mysql username 
$password="Fiorentino##"; // Mysql password 
$db_name="hotel"; // Database name 
$tbl_name="clienti"; // Table name 

// Connect to server and select database.
 mysql_connect("$host", "$username", "$password")or die("cannot connect"); 
 mysql_select_db("$db_name")or die("cannot select DB");

// Get values from form 
 $nominativo=$_POST['nominativo'];
 $indirizzo=$_POST['indirizzo'];
 $telefono=$_POST['telefono'];

 // Insert data into mysql 
 $sql="INSERT INTO $tbl_name SET(nominativo, indirizzo, telefono)VALUES('$nominativo', '$indirizzo', '$telefono')";
 SELECT LAST_INSERT_ID() INTO @codCliente;

 $result=mysql_query($sql);



// if successfully insert data into database, displays message "Successful". 
 if($result){
 echo "Successful";
 echo "&lt;BR&gt;";
 echo "&lt;a href='insert.php'&gt;Back to main page&lt;/a&gt;";
 }

 else {
 echo "ERROR";
 }
 ?&gt; 

 &lt;?php 
// close connection 
 mysql_close();
 ?&gt;

 And this is the error I get:Parse error: syntax error, unexpected 'LAST_INSERT_ID' (T_STRING) in C:\inetpub\wwwroot\Hotel Site\insert_ac.php on line 20
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>Fiorentino01^</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/455001/error-in-php-code-last-insert-id</guid>
		</item>
				<item>
			<title>HOW do I add A PHP Link</title>
			<link>http://www.daniweb.com/web-development/php/threads/454995/how-do-i-add-a-php-link</link>
			<pubDate>Mon, 20 May 2013 16:03:26 +0000</pubDate>
			<description>` $options[] = array( 'title' =&gt; __('Donate to the theme developers', 'default'), 'desc' =&gt; __('Note :Donate to the Developers of this theme, Donate any amount to keep the themes free ' , 'default'), 'id' =&gt; '', 'std' =&gt; '', 'type' =&gt; 'sep' ); How do I add a link to ...</description>
			<content:encoded><![CDATA[ <p>`</p>

<pre><code> $options[] = array( 'title' =&gt; __('Donate to the theme developers', 'default'),
                    'desc'  =&gt; __('Note :Donate to the Developers of this theme, Donate any amount to keep the themes free '  , 'default'),
                    'id'    =&gt; '',
                    'std'   =&gt; '',
                    'type'  =&gt; 'sep' );
</code></pre>

<p>How do I add a link to the text I want the word "Donate" to have a link</p>

<p>How do I do that. If anyone could help me I would really be grateful</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>sambulo.senda</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454995/how-do-i-add-a-php-link</guid>
		</item>
				<item>
			<title>Time zone</title>
			<link>http://www.daniweb.com/web-development/php/threads/454983/time-zone</link>
			<pubDate>Mon, 20 May 2013 13:13:14 +0000</pubDate>
			<description>Guys, please let me know is anybody aware of the below doubt. php taking hosting server date and time but am in need to find the client time and date who accesing the site. otherwise how to find the date &amp; time in server time zone .</description>
			<content:encoded><![CDATA[ <p>Guys,</p>

<p>please let me know is anybody aware of the below doubt.</p>

<p>php taking hosting server date and time but am in need to find the client time and date who accesing the site.</p>

<p>otherwise how to find the date &amp; time in server time zone .</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>varunsara</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454983/time-zone</guid>
		</item>
				<item>
			<title>Assigment Problem-Hungarian Algorithm</title>
			<link>http://www.daniweb.com/web-development/php/threads/454981/assigment-problem-hungarian-algorithm</link>
			<pubDate>Mon, 20 May 2013 12:51:30 +0000</pubDate>
			<description>I am working on an Assignment Problem, a part of Operation Research but the problem am facing is how to assign the task to the agents and then the anomaly where the algorithm has to repeat it self when it is not able to perform the assignment.</description>
			<content:encoded><![CDATA[ <p>I am working on an Assignment Problem, a part of Operation Research but the problem am facing is how to assign the task to the agents and then the anomaly where the algorithm has to repeat it self when it is not able to perform the assignment.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>Nero Basanta</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454981/assigment-problem-hungarian-algorithm</guid>
		</item>
				<item>
			<title>grouping data in php page</title>
			<link>http://www.daniweb.com/web-development/php/threads/454972/grouping-data-in-php-page</link>
			<pubDate>Mon, 20 May 2013 10:18:38 +0000</pubDate>
			<description>hi I have created the php report using below code. It works fine. But My problem is to group the data example # Date Code Name Rate Qty Amount# 15.01.2011 0001 Milk 4.01 50 200.50 15.01.2011 0125 Choklet 30.00 10 300.00 15.01.2011 0241 Drink 12.50 12 150.00 16.01.2011 5461 Meat ...</description>
			<content:encoded><![CDATA[ <p>hi<br />
I have created the php report using below code. It works fine. But My problem is to group the data<br />
example</p>

<pre><code># Date          Code   Name       Rate  Qty  Amount# 
 15.01.2011     0001   Milk       4.01  50    200.50
 15.01.2011     0125   Choklet   30.00  10    300.00
 15.01.2011     0241   Drink     12.50  12    150.00
 16.01.2011     5461   Meat      35.07  10    350.75
 16.01.2011     4587   Fish      17.80   5     89.00
                                    total    1090.25     
</code></pre>

<p>if I take the date range from 15.01.2011 to 16.01.2011,  it shows in php page look like above. But if i select<br />
 the date range as 15.01.2011 to 16.01.2011, i need look like below</p>

<p>Pls help me</p>

<pre><code> # Date          Code   Name       Rate  Qty  Amount# 
 15.01.2011     0001   Milk       4.01  50    200.50
 15.01.2011     0125   Choklet   30.00  10    300.00
 15.01.2011     0241   Drink     12.50  12    150.00
                             subtotal         650.50

 16.01.2011     5461   Meat      35.07  10    350.75
 16.01.2011     4587   Fish      17.80   5     89.00
                             subtotal         439.75 

                             grand total     1090.25 
</code></pre>

<p>it is my code</p>

<pre><code>    `&lt;?php //include '../templete/header.php'; ?&gt;
    &lt;script language="javascript" type="text/javascript"&gt;
     function printFunction(){

     window.print();
     }
    &lt;/script&gt;

    &lt;script language="javascript" type="text/javascript"&gt;

    function PrintGridData() {
        var prtGrid = document.getElementById('&lt;%=txtDocNo%&gt;');
        prtGrid.border = 0;
                            var prtwin = window.open('','PrintGridViewData','left=100,top=100,width=1000,height=1000,tollbar=0,scrollbars=1,status=0,resizable=1');
        prtwin.document.write(prtGrid.outerHTML);
        prtwin.document.close();
        prtwin.focus();
        prtwin.print();
        prtwin.close();
     &lt;/script&gt;

    &lt;table width="100%" align="center" cellpadding="4" cellspacing="1" class=tbl_table"&gt;
      &lt;tr&gt;
        &lt;td class="tbl_header"&gt;SO Date&lt;/td&gt;
        &lt;td class="tbl_header"&gt;MV CODE&lt;/td&gt;
        &lt;td class="tbl_header"&gt;MV NAME&lt;/td&gt;
        &lt;td class="tbl_header"&gt;RATE&lt;/td&gt;
        &lt;td class="tbl_header"&gt;SUPP.QTY&lt;/td&gt;
        &lt;td class="tbl_header"&gt;AMT&lt;/td&gt;
    &lt;/tr&gt;
    &lt;?php 
      if(isset($stmt))
        { 
            while($row = $stmt-&gt;fetch())
        {?&gt;
&lt;tr&gt;
&lt;td class="tbl_content"&gt;&lt;?php echo date("d-m-Y", strtotime($row['SODate']));?&gt;&lt;/td&gt;
  &lt;td class="tbl_content"&gt;&lt;?php echo $row['MVCode'];?&gt;&lt;/td&gt;
  &lt;td class="tbl_content"&gt;&lt;?php echo $row['MVName'];?&gt;&lt;/td&gt;

  &lt;td class="tbl_content_right"&gt;&lt;?php echo number_format($row['Rate'],2) ;?&gt;&lt;/td&gt;
  &lt;td class="tbl_content_right"&gt;&lt;?php echo number_format($row['Qty']) ;?&gt;&lt;/td&gt;
  &lt;td class="tbl_content_right"&gt;&lt;?php echo number_format($row['BalAmt'],2) ;?&gt;&lt;/td&gt;
  &lt;/tr&gt;

&lt;?php 
    $balamt+=$row['BalAmt'];
    $qty+=$row['Qty'];

}}?&gt; 

    &lt;tr&gt;&lt;td colspan="9"&gt;&lt;hr /&gt;&lt;/tr&gt;

    &lt;tr&gt;  

  &lt;td colspan="5"&gt;&lt;/td&gt;
  &lt;td class="tbl_content_total"&gt;  &lt;?php echo number_format($qty);?&gt;&lt;/td&gt;
  &lt;td class="tbl_content_total"&gt;  &lt;?php echo number_format($rtnqty);?&gt;&lt;/td&gt;
  &lt;td class="tbl_content_total"&gt;  &lt;?php echo number_format($balqty);?&gt;&lt;/td&gt;
  &lt;td class="tbl_content_total"&gt;  &lt;?php echo number_format($balamt,2);?&gt;&lt;/td&gt;

    &lt;/tr&gt;
    &lt;/table&gt;


    &lt;?php unset($dbh); unset($stmt); ?&gt;

    &lt;?php
    include '../templete/footer.php';
    ?&gt;
</code></pre>

<p>'<br />
Regards</p>

<p>Maideen</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>Maideen</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454972/grouping-data-in-php-page</guid>
		</item>
				<item>
			<title>PHP Error</title>
			<link>http://www.daniweb.com/web-development/php/threads/454969/php-error</link>
			<pubDate>Mon, 20 May 2013 09:46:00 +0000</pubDate>
			<description>What does the PHP error ‘Parse error in PHP – unexpected T_variable at line x’ means?</description>
			<content:encoded><![CDATA[ <p>What does the PHP error ‘Parse error in PHP – unexpected T_variable at line x’ means?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>mohammed.ismail</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454969/php-error</guid>
		</item>
				<item>
			<title>PHP Thread</title>
			<link>http://www.daniweb.com/web-development/php/threads/454968/php-thread</link>
			<pubDate>Mon, 20 May 2013 09:43:49 +0000</pubDate>
			<description>How to run the interactive PHP shell from the command line interface?</description>
			<content:encoded><![CDATA[ <p>How to run the interactive PHP shell from the command line interface?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>mohammed.ismail</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454968/php-thread</guid>
		</item>
				<item>
			<title>profile page</title>
			<link>http://www.daniweb.com/web-development/php/threads/454944/profile-page</link>
			<pubDate>Sun, 19 May 2013 21:51:26 +0000</pubDate>
			<description>hya ive created a edit profile page for members to fill in and now i need that information to go to members profile page how do i do this ive tried several tutorials in youtube but get nowhere with them i dont need the register or login got that already ...</description>
			<content:encoded><![CDATA[ <p>hya ive created a edit profile page for members to fill in and now i need that information to go to members profile page how do i do this ive tried several tutorials in youtube but get nowhere with them</p>

<p>i dont need the register or login got that already</p>

<p>any help would be much appreicated</p>

<p>ty jan xxx</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>janicemurby</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454944/profile-page</guid>
		</item>
				<item>
			<title>show checked and unchecked checkboxes in 2 different column</title>
			<link>http://www.daniweb.com/web-development/php/threads/454938/show-checked-and-unchecked-checkboxes-in-2-different-column</link>
			<pubDate>Sun, 19 May 2013 19:54:22 +0000</pubDate>
			<description>Hi Friends, I have 5 checkboxes. What I want is..... I want to check 3 checkboxes so other 2 will be unchecked. After clicking the next button a table will appear and checked checkboxes will show in one column and unchecked will be another column. Can you give any idea ...</description>
			<content:encoded><![CDATA[ <p>Hi Friends,</p>

<p>I have 5 checkboxes. What I want is.....<br />
I want to check 3 checkboxes so other 2 will be unchecked. After clicking the next button a table will appear and checked checkboxes will show in one column and unchecked will be another column.</p>

<p>Can you give any idea how to solve it. example of code will be helpful</p>

<p>Thanks in advance for your help. :)</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>rubai</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454938/show-checked-and-unchecked-checkboxes-in-2-different-column</guid>
		</item>
				<item>
			<title>php paging error</title>
			<link>http://www.daniweb.com/web-development/php/threads/454928/php-paging-error</link>
			<pubDate>Sun, 19 May 2013 16:01:41 +0000</pubDate>
			<description>I'm using the following code for my paging on my script &lt;?php $pn = 0; $result = mysql_query(&quot;SELECT * FROM tbl_product WHERE category = '$cat' ORDER BY id ASC &quot;); $nr = mysql_num_rows($result); if (isset($_GET['pn'])) { // Get pn from URL vars if it is present $pn = $_GET['pn'];// filter ...</description>
			<content:encoded><![CDATA[ <p>I'm using the following code for my paging on my script</p>

<pre><code>&lt;?php
$pn = 0;


$result = mysql_query("SELECT * FROM tbl_product WHERE category = '$cat' ORDER BY id ASC ");

$nr = mysql_num_rows($result);
if (isset($_GET['pn'])) { // Get pn from URL vars if it is present
    $pn = $_GET['pn'];// filter everything but numbers for security(new)
} else { // If the pn URL variable is not present force it to be value of page number 1
    $pn = 1;
} 
//This is where we set how many database items to show on each page 
$itemsPerPage = 5; 
// Get the value of the last page in the pagination result set
$lastPage = ceil($nr / $itemsPerPage);
// Be sure URL variable $pn(page number) is no lower than page 1 and no higher than $lastpage
if ($pn &lt; 1) { // If it is less than 1
    $pn = 1; // force if to be 1
} else if ($pn &gt; $lastPage) { // if it is greater than $lastpage
    $pn = $lastPage; // force it to be $lastpage's value
} 

// This creates the numbers to click in between the next and back buttons
$centerPages = ""; // Initialize this variable
$sub1 = $pn - 1;
$sub2 = $pn - 2;
$add1 = $pn + 1;
$add2 = $pn + 2;
if ($pn == 1) {
    $centerPages .= '&amp;nbsp; &lt;span class="pagNumActive"&gt;' . $pn . '&lt;/span&gt; &amp;nbsp;';
    $centerPages .= '&amp;nbsp; &lt;a href="' . $_SERVER['PHP_SELF'] . '?pn=' . $add1 . '"&gt;' . $add1 . '&lt;/a&gt; &amp;nbsp;';
} else if ($pn == $lastPage) {
    $centerPages .= '&amp;nbsp; &lt;a href="' . $_SERVER['PHP_SELF'] . '?pn=' . $sub1 . '"&gt;' . $sub1 . '&lt;/a&gt; &amp;nbsp;';
    $centerPages .= '&amp;nbsp; &lt;span class="pagNumActive"&gt;' . $pn . '&lt;/span&gt; &amp;nbsp;';
} else if ($pn &gt; 2 &amp;&amp; $pn &lt; ($lastPage - 1)) {
    $centerPages .= '&amp;nbsp; &lt;a href="' . $_SERVER['PHP_SELF'] . '?pn=' . $sub2 . '"&gt;' . $sub2 . '&lt;/a&gt; &amp;nbsp;';
    $centerPages .= '&amp;nbsp; &lt;a href="' . $_SERVER['PHP_SELF'] . '?pn=' . $sub1 . '"&gt;' . $sub1 . '&lt;/a&gt; &amp;nbsp;';
    $centerPages .= '&amp;nbsp; &lt;span class="pagNumActive"&gt;' . $pn . '&lt;/span&gt; &amp;nbsp;';
    $centerPages .= '&amp;nbsp; &lt;a href="' . $_SERVER['PHP_SELF'] . '?pn=' . $add1 . '"&gt;' . $add1 . '&lt;/a&gt; &amp;nbsp;';
    $centerPages .= '&amp;nbsp; &lt;a href="' . $_SERVER['PHP_SELF'] . '?pn=' . $add2 . '"&gt;' . $add2 . '&lt;/a&gt; &amp;nbsp;';
} else if ($pn &gt; 1 &amp;&amp; $pn &lt; $lastPage) {
    $centerPages .= '&amp;nbsp; &lt;a href="' . $_SERVER['PHP_SELF'] . '?pn=' . $sub1 . '"&gt;' . $sub1 . '&lt;/a&gt; &amp;nbsp;';
    $centerPages .= '&amp;nbsp; &lt;span class="pagNumActive"&gt;' . $pn . '&lt;/span&gt; &amp;nbsp;';
    $centerPages .= '&amp;nbsp; &lt;a href="' . $_SERVER['PHP_SELF'] . '?pn=' . $add1 . '"&gt;' . $add1 . '&lt;/a&gt; &amp;nbsp;';
}
// This line sets the "LIMIT" range... the 2 values we place to choose a range of rows from database in our query
$limit = 'LIMIT '.($pn - 1) * $itemsPerPage .','.$itemsPerPage; //returns negative range
// Now we are going to run the same query as above but this time add $limit onto the end of the SQL syntax
// $sql2 is what we will use to fuel our while loop statement below


$result2 = mysql_query("SELECT * FROM tbl_product WHERE category = '$cat' ORDER BY id ASC $limit");//query fails
if(!$result2)
echo  "ERROR".mysql_error();

//PAGINATION DISPLAY

$paginationDisplay = ""; // Initialize the pagination output variable
// This code runs only if the last page variable is not equal to 1, if it is only 1 page we require no paginated links to display
if ($lastPage != "1"){
    // This shows the user what page they are on, and the total number of pages
    $paginationDisplay .= 'Page &lt;strong&gt;' . $pn . '&lt;/strong&gt; of ' . $lastPage. '';
    // If we are not on page 1 we can place the Back button
    if ($pn != 1) {
        $previous = $pn - 1;
        $paginationDisplay .=  '&amp;nbsp;  &lt;a href="' . $_SERVER['PHP_SELF'] . '?pn='.$previous.'"&gt; Back&lt;/a&gt; ';
    } 
    // Lay in the clickable numbers display here between the Back and Next links
    $paginationDisplay .= '&lt;span class="paginationNumbers"&gt;' . $centerPages . '&lt;/span&gt;';
    // If we are not on the very last page we can place the Next button
    if ($pn != $lastPage) {
        $nextPage = $pn + 1;
        $paginationDisplay .=  '&amp;nbsp;  &lt;a href="' . $_SERVER['PHP_SELF'] . '?pn='.$nextPage.'"&gt; Next&lt;/a&gt; ';
    } 
}

?&gt;
&lt;!-- SOME HTML STUFF --&gt;
</code></pre>

<p>THEN I USE THIS LOOP TO RETRIEVE ITEMS IN THE HTML BODY</p>

<pre><code>&lt;?php
while($row = mysql_fetch_row($result2)){
        echo '&lt;div class="product_info"&gt;';
          echo '&lt;div class="category_product_number"&gt;#'.$row[0].'('.$row[1].')'.'&lt;/div&gt;';
         echo '&lt;div class="category_product_description"&gt;'.$row[2].'&lt;/div&gt;';
         echo '&lt;div class="category_product_price"&gt;'.$row[4].'TL&lt;/div&gt;';
      echo '&lt;/div&gt;';
      }

      ?&gt;
</code></pre>

<p>AND TO DISPLAY THE PAGINATION I DO THIS SOMEWHERE BELOW THIS LOOP<br /><code>&lt;div class="central_container"&gt;&lt;span class="current_page"&gt;Showing &lt;?php echo $paginationDisplay; ?&gt;&lt;/span&gt;&lt;/div&gt;</code></p>

<p>HOWEVER, when i run the code, i get this error: "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 '-5,5' at line 1".</p>

<p>It seems i get a negative page number when i click the "NEXT" link or try to move to a new page (by clicking that page number), so the query returns a negative range for LIMIT. But I don't know why because i have a conditon that makes sure there are no negative page numbers. I know it's a lot of code but any help figuring out the issue will be appreciated. Thanks</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>dhani09</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454928/php-paging-error</guid>
		</item>
				<item>
			<title>check (non) empty string from functions</title>
			<link>http://www.daniweb.com/web-development/php/threads/454921/check-non-empty-string-from-functions</link>
			<pubDate>Sun, 19 May 2013 14:59:10 +0000</pubDate>
			<description>I have some functions that returns nothing or some value (obvious), and also having a little trouble with the if and closing, is there a good way to do this? I want to return the value after checking if any of the strings are not empty. Actually it is a ...</description>
			<content:encoded><![CDATA[ <p>I have some functions that returns nothing or some value (obvious), and also having a little trouble with the if and closing, is there a good way to do this? I want to return the value after checking if any of the strings are not empty.<br />
Actually it is a search results page. I can have result by links that follow this structure:</p>

<pre><code>search_url(array("xxx" =&gt; "name");
</code></pre>

<p>and in the array for xxx's is either:</p>

<pre><code>"sPattern"=&gt; "name"
"sRegion"=&gt; "name"
"sCity"=&gt; "name"
</code></pre>

<p>so how to do this?</p>

<pre><code>&lt;?php if( sPattern &gt; '') { ?&gt; 
echo  result
else
&lt;?php if( sRegion &gt; '') { ?&gt; 
echo result
else
&lt;?php if( sCity &gt; '') { ?&gt; 
echo result
if nothing match do this
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>mjsmitten</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454921/check-non-empty-string-from-functions</guid>
		</item>
				<item>
			<title>Pass data from one php script to another</title>
			<link>http://www.daniweb.com/web-development/php/threads/454916/pass-data-from-one-php-script-to-another</link>
			<pubDate>Sun, 19 May 2013 14:02:49 +0000</pubDate>
			<description>I've got an upload script that generates some stuff in relation to uploads eg File foo.jpg uploaded succesfully&lt;br /&gt; File bar.tiff failed to upload! ... This is all part of a variable called `$message`. How could I pass this to another php script? Thanks for any help</description>
			<content:encoded><![CDATA[ <p>I've got an upload script that generates some stuff in relation to uploads eg</p>

<pre><code>File foo.jpg uploaded succesfully&lt;br /&gt;
File bar.tiff failed to upload!
...
</code></pre>

<p>This is all part of a variable called <code>$message</code>. How could I pass this to another php script?<br />
Thanks for any help</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>fheppell</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454916/pass-data-from-one-php-script-to-another</guid>
		</item>
				<item>
			<title>help me please..</title>
			<link>http://www.daniweb.com/web-development/php/threads/454910/help-me-please</link>
			<pubDate>Sun, 19 May 2013 11:16:18 +0000</pubDate>
			<description> require(&quot;conn.php&quot;); $sql = &quot;select * from pemohon where kp_baru='$kp';&quot;; $result = mysql_query($sql); while($row = mysql_fetch_array($result)) { if($row == TRUE) { echo $row['kp_baru']; // can display } else { echo &quot;No KP tiada didalam pangkalan data.&quot;; // can't display } }</description>
			<content:encoded><![CDATA[ <pre><code>require("conn.php");
$sql = "select * from pemohon where kp_baru='$kp';";
$result = mysql_query($sql);
while($row = mysql_fetch_array($result))
{
    if($row == TRUE)
    {
     echo $row['kp_baru']; // can display
    }
    else
    {
        echo "No KP tiada didalam pangkalan data."; // can't display
    }
}
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>dina85</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454910/help-me-please</guid>
		</item>
				<item>
			<title>phpcode unable to connect to My SQL --- OOP project </title>
			<link>http://www.daniweb.com/web-development/php/threads/454904/phpcode-unable-to-connect-to-my-sql-oop-project-</link>
			<pubDate>Sun, 19 May 2013 08:04:25 +0000</pubDate>
			<description>ok here is the login function from my class user which parent class is a Db connection file &lt;?php require_once(&quot;DBConnection.php&quot;); class User extends DBConnection { .... .... ... ... public function Login() { $sqlSelect = &quot;select `UserName` from `user` where `UserName` = '$this-&gt;userName' and `Password` = '$this-&gt;password'&quot;; $result = @mysql_query($sqlSelect, ...</description>
			<content:encoded><![CDATA[ <p>ok here is the login function from my class user which parent class is a Db connection file</p>

<pre><code>&lt;?php
require_once("DBConnection.php");
class User extends DBConnection
{   ....

....
...
...
public function Login()
    {
        $sqlSelect = "select  `UserName` from `user` where `UserName` = '$this-&gt;userName' and `Password` = '$this-&gt;password'";

        $result = @mysql_query($sqlSelect, $this-&gt;get_Conn());

//      $dataCount = mysql_num_rows($result);
        if(mysql_num_rows($result) == 0)
        {
            throw new Exception("Login Failed");
        }

        $userData = mysql_fetch_assoc($result);
        extract($userData); 

        $this-&gt;userId = $UserId;
        $this-&gt;firstName = $FirstName;
        $this-&gt;middleName = $MiddleName;
        $this-&gt;lastName = $LastName;
        $this-&gt;email = $Email;
        $this-&gt;userName = $UserName;
        $this-&gt;password = NULL;
        $this-&gt;loginStatus = true;

        $_SESSION['objUser'] = serialize($this);

        if($remember)
        {
            $struser = serialize($this);
            $expTime = time() + (60*60*24*7);
            setcookie("objUser", $struser, $expTime, "/");  
        }

    }
</code></pre>

<p>when from the login page i press login button it just checks for the values inside the box for error and chekcing the array error() its empty it stays on the same page</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>kakalahori</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454904/phpcode-unable-to-connect-to-my-sql-oop-project-</guid>
		</item>
				<item>
			<title>php session and echo checkbox</title>
			<link>http://www.daniweb.com/web-development/php/threads/454903/php-session-and-echo-checkbox</link>
			<pubDate>Sun, 19 May 2013 06:10:58 +0000</pubDate>
			<description>I have a problem want to be solved. I have three pages. page1.php, page2.php page1.php has a form with two text field. one text field is for name and another is for number. there is a submit button and a &quot;next&quot; button too. using session I want show given name ...</description>
			<content:encoded><![CDATA[ <p>I have a problem want to be solved.<br />
I have three pages. page1.php, page2.php<br />
page1.php has a form with two text field. one text field is for name and another is for number. there is a submit button and a "next" button too. using session I want show given name into page2.php and create checkboxes that according to given number. (e.g if I write 4 in number text field in page1.php then 4 checkboxes will appear in page2.php, if 8 then 8 checkboxes.</p>

<p>I want solve this problem using session.</p>

<p>page1.php</p>

<pre><code>&lt;body&gt;
&lt;p&gt;
        &lt;?php
session_start(); 
?&gt;
      &lt;/p&gt;
      &lt;form id="form1" name="form1" method="post" action=""&gt;
        &lt;p&gt;
          &lt;label for="name"&gt;Name&lt;/label&gt;
          &lt;input type="text" name="name" id="name" /&gt;
        &lt;/p&gt;
        &lt;p&gt;
          &lt;label for="number"&gt;Number&lt;/label&gt;
          &lt;input type="text" name="number" id="number" /&gt;
        &lt;/p&gt;
        &lt;p&gt;
          &lt;input type="submit" name="submit" id="submit" value="SEND" /&gt;
        &lt;/p&gt; &lt;br/&gt;
        &lt;a href="page2.php"&gt; next &lt;/a&gt;
      &lt;/form&gt;

&lt;?php      
if(isset($_POST['submit']))
{
$_SESSION['Name'] = $_POST['name'];
$_SESSION['Number'] = $_POST['number'];
}

$nname = $_SESSION['Name'];
$nnumber = $_SESSION['Number'];
echo $nname . $nnumber;

?&gt;

&lt;/body&gt;
</code></pre>

<p>page2.php</p>

<pre><code>&lt;body&gt;


      &lt;p&gt;
        &lt;?php
session_start(); 



echo $_SESSION['Number'] . $_SESSION['Name'];

$nName = $_SESSION['Name'];
$nNumber = $_SESSION['Number'];

?&gt;
  &lt;/p&gt;
      &lt;form name="form1" method="post" action=""&gt;
        &lt;input type="text" name="first_name" value="&lt;?php  echo $nName; ?&gt;" /&gt;
        &lt;input type="checkbox" name="&lt;?php for($i=0; $i&lt; $nNumber; $i++)
        echo $i;
         ?&gt;" value="&lt;?php for($i=0; $i&lt; $nNumber; $i++)
        echo $i;
         ?&gt;" /&gt;
      &lt;/form&gt;
      &lt;p&gt; &lt;br/&gt;
        &lt;a href="page1.php"&gt;Back&lt;/a&gt;&lt;/p&gt;
&lt;/body&gt;
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>rubai</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454903/php-session-and-echo-checkbox</guid>
		</item>
				<item>
			<title>JavaScript Radio button selection and validates text field?</title>
			<link>http://www.daniweb.com/web-development/php/threads/454896/javascript-radio-button-selection-and-validates-text-field</link>
			<pubDate>Sun, 19 May 2013 03:10:03 +0000</pubDate>
			<description>I need to use javascript so that when the one radio button is selected nothing happens but if the other one is (for example, Cheque) it will then validate the field (Cheque Number)..</description>
			<content:encoded><![CDATA[ <p>I need to use javascript so that when the one radio button is selected nothing happens but if the other one is (for example, Cheque) it will then validate the field (Cheque Number)..</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>dina85</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454896/javascript-radio-button-selection-and-validates-text-field</guid>
		</item>
				<item>
			<title>Resource ID 3 produced - cannot see what is wrong</title>
			<link>http://www.daniweb.com/web-development/php/threads/454891/resource-id-3-produced-cannot-see-what-is-wrong</link>
			<pubDate>Sat, 18 May 2013 23:56:20 +0000</pubDate>
			<description>Hi, I've had a look through the forum(s), however, can't seem to find a solution to my issue (and I don't understand the PHP Manual). Basically, got a website linked to a database, trying to pull data from one table and display onto the website where appropriate. I have the ...</description>
			<content:encoded><![CDATA[ <p>Hi,</p>

<p>I've had a look through the forum(s), however, can't seem to find a solution to my issue (and I don't understand the PHP Manual).</p>

<p>Basically, got a website linked to a database, trying to pull data from one table and display onto the website where appropriate.</p>

<p>I have the following code:</p>

<pre><code>&lt;?php
    include "console/include/code/common.php";  
    //Connect to Database
    DBConnect();
    $Link = mysql_connect(dbhost,user,password);?&gt;

    $Query = "SELECT * FROM database.tablename WHERE eventDay=1";
    $Result = mysql_query ($Query, $Link) or die (mysql_error($Link));

    //ON Debugging - code stops here resulting in Resource ID #3 - suggesting there is a problem
    with the $Result. However, please check the following code to see if there are errors (if poss).

    $Rows=mysql_num_rows($Result) or die (mysql_error($Rows));
    $loop=0;
    while ($loop&lt;$Rows){
            //Add all variables to the output loop.
            $eventVisible=mysql_result($Result,$loop,"eventVisible");
            $eventDay=mysql_result($Result,$loop,"eventDay");
            $eventImagePath=mysql_result($Result,$loop,"eventImagePath");
            $eventTitle=mysql_result($Result,$loop,"eventTitle");
            $eventInfo=mysql_result($Result,$loop,"eventInfo");
            $expiryYear=mysql_result($Result,$loop,"expiryYear");
            $expiryMonth=mysql_result($Result,$loop,"expiryMonth");
            $expiryDay=mysql_result($Result,$loop,"expiryDay");
        //Print out the values into a table
    }

    if($eventVisible==1){
        //EVENT VISIBLE
            date_default_timezone_set('Europe/London');
                if(mktime() &lt; mktime(23,59,59,$expiryMonth,$expiryDay,$expiryYear)) {
                //Event is before expiry?&gt;
                &lt;img src="&lt;?php echo $eventImagePath;?&gt;" width="160" height="160" style="float:left"/&gt; &lt;p&gt;&lt;b&gt;&lt;?php echo $eventTitle;?&gt;&lt;/b&gt;&lt;p&gt;&lt;font color="#000"&gt;&lt;?php echo $eventInfo;?&gt;&lt;/font&gt;   
                &lt;?php }; ?&gt;
        &lt;?php };?&gt;
        &lt;br clear="all"&gt;  
        &lt;br&gt;
        &lt;?php
        //Increment the loop by 1 - so we actually get to an end!
        $loop++;
        //};?&gt;
    &lt;/div&gt;
</code></pre>

<p>This code is for one tab - there are 6, so i simply copy the code, and change the query based on the tab that's selected.<br />
As you can probably tell, I've tried to cut down and explain the code as much as possible - any questions though, feel free to ask.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>maharrington</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454891/resource-id-3-produced-cannot-see-what-is-wrong</guid>
		</item>
				<item>
			<title>code for converting csv file to excel</title>
			<link>http://www.daniweb.com/web-development/php/threads/454887/code-for-converting-csv-file-to-excel</link>
			<pubDate>Sat, 18 May 2013 21:11:15 +0000</pubDate>
			<description>hii can any give me a php code that converts a csv file to an excel file</description>
			<content:encoded><![CDATA[ <p>hii can any give me a php code that converts a csv file to an excel file</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>gvsamrat</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454887/code-for-converting-csv-file-to-excel</guid>
		</item>
				<item>
			<title>my table wont update</title>
			<link>http://www.daniweb.com/web-development/php/threads/454885/my-table-wont-update</link>
			<pubDate>Sat, 18 May 2013 20:30:49 +0000</pubDate>
			<description>hallo there, Its a very complicate problem and i wiil try to be as brief as i can. I hope you ll be able to understand my description. i ve coded a script that works perfect in my localhost. When i uploaded the files to a server some things just ...</description>
			<content:encoded><![CDATA[ <p>hallo there,</p>

<p>Its a very complicate problem and i wiil try to be as brief as i can. I hope you ll be able to understand my description.</p>

<p>i ve coded a script that works perfect in my localhost. When i uploaded the files to a server some things just did not work.</p>

<p>For the script i used 2 mysql tambles. The tables have the same exact structure and different names. They are 'big' tables. 46 fields each.</p>

<p>the fields from the tables fills by forms section by section (lets say that a section is 3-5 fields). (one insert and then with updates).</p>

<p>It seems that when  most fields are already filled up the next fields just wont update. There are no errors. When i try to fill up those fields by hand using PHPMYADMIN and the same sql command i used in my code the fields updates just fine.</p>

<p>Is there something i am missing? Do u thing it is a coding mistake or there is a apache setting i did not think about? it is important to mention that if i reapet the procedure by starting filling the table from the section that wouldnt update it will, and soon another section wont update.</p>

<p>i know i may did not give a quite good description. If you dont understand what i am saynig i will try again including some code..</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>dourvas</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454885/my-table-wont-update</guid>
		</item>
				<item>
			<title>Mystery of Multiple Record Insertions</title>
			<link>http://www.daniweb.com/web-development/php/threads/454884/mystery-of-multiple-record-insertions</link>
			<pubDate>Sat, 18 May 2013 20:09:51 +0000</pubDate>
			<description>Hi All I'm sure I'm missing something very small - and embarrassing! I'm being lazy - I could have entered the data manually, but wanted to automate it. I have a small csv file containing swimming meets, dates and locations along the following lines: May-13;;;; 17;other;Level 1 Program 1;Arboretum; 24;other;All ...</description>
			<content:encoded><![CDATA[ <p>Hi All<br />
I'm sure I'm missing something very small - and embarrassing!<br />
I'm being lazy - I could have entered the data manually, but wanted to automate it.</p>

<p>I have a small csv file containing swimming meets, dates and locations along the following lines:</p>

<pre><code>May-13;;;;
17;other;Level 1 Program 1;Arboretum;
24;other;All Levels Program 2;King's Park;
June-13;;;;
15;other;Level 2 3 Program3;Pmb;
.
. and so forth
</code></pre>

<p>I read this into an array, run through the array to correct the date format and then insert each line into a mySQL database table.<br />
All easy, but my code is inserting multiple entries for each key in the array! Sometimes it inserts 6 records for each key and sometimes 19. It jsut seems to be quite random!</p>

<p>My code:</p>

<pre><code>//===== Read csv into array =====
if (($handle = fopen("../uploads/KZNCal.csv", "r")) !== FALSE) {
    while (($data = fgetcsv($handle, 1000, ";")) !== FALSE) {
        $Cal[] = $data;
    }
  fclose($data);
}
$con  = new mysqli($HOST, $USER, $PASS, $NAME);
if (mysqli_connect_errno()) {
    printf("Connect failed: %s\n", mysqli_connect_error());
    exit();
}

$query = $con-&gt;prepare("INSERT INTO `kzn_upcoming` (`meet_name`, `location`, `start_date`) VALUES (?, ?, ?)");
foreach ($Cal as $Key =&gt; $Event) {
    //===== First 2 rows not needed =====
    if ($Key &gt; 1) {
        if (!is_numeric(substr($Event[0], 0, 1))) {
            //===== Get month and year =====
            $Month = date('m', strtotime(substr($Event[0], 0, 3)));
            $Year  = '20' . substr($Event[0], 4);
        }
        else {
            $Day        = trim(substr($Event[0], 0, 2));
            if ($Day &lt; 10) {$Day = '0' . $Day;}
            // === Discarded $Event[1] - of no consequence for this table. ===
            $Name       = $Event[2];
            $Location   = $Event[3];
            $Start      = "$Year-$Month-$Day";
            //===== Inserted into "clean" array to see if there was something wrong =====
            $Calendar[] = array($Name, $Location, $Start);
        }
    }
}
echo "&lt;br&gt;Count: " . count($Calendar) . "&lt;br&gt;"; //===== Produces expected result of 39 =====

$query = $con-&gt;prepare("INSERT INTO `kzn_upcoming` (`meet_name`, `location`, `start_date`) VALUES (?, ?, ?)");
foreach ($Calendar as $Key =&gt; $Meet) {
    echo "$Key: $Meet[0] - $Meet[1] - $Meet[2]&lt;br&gt;"; //===== All displayed correctly =====
    $query-&gt;bind_param("sss", $Meet[0], $Meet[1], $Meet[2]);
    $query-&gt;execute();
}

$query-&gt;close();
$con-&gt;close();
</code></pre>

<p>There are a whole 39 rows in the $Calendar array. The echo produces the expected result - 39 rows, as per the count(). I get random duplication of each record inserted into the table! One run, I had 91 records for each Meet, another "only" 6!<br />
What have I missed?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>RoryGren</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454884/mystery-of-multiple-record-insertions</guid>
		</item>
				<item>
			<title>Not display the alert if email does not exist in table</title>
			<link>http://www.daniweb.com/web-development/php/threads/454869/not-display-the-alert-if-email-does-not-exist-in-table</link>
			<pubDate>Sat, 18 May 2013 12:50:14 +0000</pubDate>
			<description>Can someone have a look at some code for me? Here the problem. This is meant to delet an email address form a mysql table then alert the user this has been done. If the address does not exist then it alerts the user to that too. But even if ...</description>
			<content:encoded><![CDATA[ <p>Can someone have a look at some code for me?</p>

<p>Here the problem. This is meant to delet an email address form a mysql table then alert the user this has been done. If the address does not exist then it alerts the user to that too.</p>

<p>But even if the address ddoes not exist it alerts the user that the address has been deleted!</p>

<p>Heres the code</p>

<pre><code>if (filter_var($email, FILTER_VALIDATE_EMAIL)) {
   if($r = mysql_query("DELETE FROM maillist WHERE email = '$mail'")){
      echo '&lt;script type="text/javascript"&gt; alert("Email Address Has Been Deleted") &lt;/script&gt;';
   }
   else {
      echo '&lt;script type="text/javascript"&gt; alert("Email Does Not Exist In Database") &lt;/script&gt;';
   }
   }
   else {
      echo '&lt;script type="text/javascript"&gt; alert("This Is Not A Valid Email Address!") &lt;/script&gt;';
   }
   }
</code></pre>

<p>Thanks for looking...............</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>GlenRogers</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454869/not-display-the-alert-if-email-does-not-exist-in-table</guid>
		</item>
				<item>
			<title>Php overwrite file with variable</title>
			<link>http://www.daniweb.com/web-development/php/threads/454867/php-overwrite-file-with-variable</link>
			<pubDate>Sat, 18 May 2013 12:36:24 +0000</pubDate>
			<description>Hey all, i'm working on some code and i've got a little problem. $my_file = 'file.php'; $newline = &quot;&lt;?php $root = '&quot;$mylocation&quot;/'; ?&gt;&quot;; file_put_contents($my_file, $newline); As you can see i want to post a line into a file.. The problem is, this file will output: &lt;?php = 'your location'; ?&gt; ...</description>
			<content:encoded><![CDATA[ <p>Hey all,</p>

<p>i'm working on some code and i've got a little problem.</p>

<pre><code>$my_file = 'file.php';
$newline = "&lt;?php $root = '"$mylocation"/'; ?&gt;";
file_put_contents($my_file, $newline);
</code></pre>

<p>As you can see i want to post a line into a file.. The problem is, this file will output:</p>

<p>&lt;?php = 'your location'; ?&gt;</p>

<p>the $root is gone..<br />
Please help me.<br />
Thanks</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>martjojo1</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454867/php-overwrite-file-with-variable</guid>
		</item>
				<item>
			<title>Converting mysql class to sqlite class</title>
			<link>http://www.daniweb.com/web-development/php/threads/454865/converting-mysql-class-to-sqlite-class</link>
			<pubDate>Sat, 18 May 2013 11:36:02 +0000</pubDate>
			<description>I need to convert mysql class of one script to make a support for sqlite,but problem is sqlite dont have username/password thing nor database select as well,which means how some parts need to be removed.If i would convert to mssql one search and replace probaly would do the job.There is ...</description>
			<content:encoded><![CDATA[ <p>I need to convert mysql class of one script to make a support for sqlite,but problem is sqlite dont have username/password thing nor database select as well,which  means how some parts need to be removed.If i would convert to mssql one search and replace probaly would do the job.There is another file which contain queries but i belive that does'nt need to be touched.</p>

<p>So here is the code,what lines i need to remove and which just replace?</p>

<pre><code>&lt;?php
class _database {
    private $link       = false;
    private $result     = false;
    private $row        = false;

    public $settings    = array(
            "servername"=&gt; "localhost",
            "serverport"=&gt; "3306",
            "username"  =&gt; false,
            "password"  =&gt; false,
            "database"  =&gt; false,
            "persist"   =&gt; false,
            "dieonerror"=&gt; false,
            "showerror" =&gt; false,
            "error_file"=&gt; true
        );

    function __construct() {
        global $db_config;
        $this-&gt;settings = array_merge($this-&gt;settings, $db_config);
        if($this-&gt;settings["error_file"] === true) $this-&gt;settings["error_file"] = dirname(__FILE__)."/__mysql_errors.log";
    }

    function connect() {
        if (!$this-&gt;link) {
            $this-&gt;link = ($this-&gt;settings["persist"]) ? 
                mysql_pconnect(
                    $this-&gt;settings["servername"].":".$this-&gt;settings["serverport"], 
                    $this-&gt;settings["username"], 
                    $this-&gt;settings["password"]
                ) : 
                mysql_connect(
                    $this-&gt;settings["servername"].":".$this-&gt;settings["serverport"], 
                    $this-&gt;settings["username"], 
                    $this-&gt;settings["password"]
                ) or $this-&gt;error();
        }
        if (!mysql_select_db($this-&gt;settings["database"], $this-&gt;link)) $this-&gt;error();
        if($this-&gt;link) mysql_query("SET NAMES 'utf8'");
        return ($this-&gt;link) ? true : false;
    }

    function query($sql) {
        if (!$this-&gt;link &amp;&amp; !$this-&gt;connect()) $this-&gt;error();
        if (!($this-&gt;result = mysql_query($sql, $this-&gt;link))) $this-&gt;error($sql);
        return ($this-&gt;result) ? true : false;
    }

    function nextr() {
        if(!$this-&gt;result) {
            $this-&gt;error("No query pending");
            return false;
        }
        unset($this-&gt;row);
        $this-&gt;row = mysql_fetch_array($this-&gt;result, MYSQL_BOTH);
        return ($this-&gt;row) ? true : false ;
    }

    function get_row($mode = "both") {
        if(!$this-&gt;row) return false;

        $return = array();
        switch($mode) {
            case "assoc":
                foreach($this-&gt;row as $k =&gt; $v) {
                    if(!is_int($k)) $return[$k] = $v;
                }
                break;
            case "num":
                foreach($this-&gt;row as $k =&gt; $v) {
                    if(is_int($k)) $return[$k] = $v;
                }
                break;
            default:
                $return = $this-&gt;row;
                break;
        }
        return array_map("stripslashes",$return);
    }

    function get_all($mode = "both", $key = false) {
        if(!$this-&gt;result) {
            $this-&gt;error("No query pending");
            return false;
        }
        $return = array();
        while($this-&gt;nextr()) {
            if($key !== false) $return[$this-&gt;f($key)] = $this-&gt;get_row($mode);
            else $return[] = $this-&gt;get_row($mode);
        }
        return $return;
    }

    function f($index) {
        return stripslashes($this-&gt;row[$index]);
    }

    function go_to($row) {
        if(!$this-&gt;result) {
            $this-&gt;error("No query pending");
            return false;
        }
        if(!mysql_data_seek($this-&gt;result, $row)) $this-&gt;error();
    }

    function nf() {
        if ($numb = mysql_num_rows($this-&gt;result) === false) $this-&gt;error();
        return mysql_num_rows($this-&gt;result);
    }
    function af() {
        return mysql_affected_rows();
    }
    function error($string="") {
        $error = mysql_error();
        if($this-&gt;settings["show_error"]) echo $error;
        if($this-&gt;settings["error_file"] !== false) {
            $handle = @fopen($this-&gt;settings["error_file"], "a+");
            if($handle) {
                @fwrite($handle, "[".date("Y-m-d H:i:s")."] ".$string." &lt;".$error."&gt;\n");
                @fclose($handle);
            }
        }
        if($this-&gt;settings["dieonerror"]) {
            if(isset($this-&gt;result)) mysql_free_result($this-&gt;result);
            mysql_close($this-&gt;link);
            die();
        }
    }
    function insert_id() {
        if(!$this-&gt;link) return false;
        return mysql_insert_id();
    }
    function escape($string){
        if(!$this-&gt;link) return addslashes($string);
        return mysql_real_escape_string($string);
    }

    function destroy(){
        if (isset($this-&gt;result)) mysql_free_result($this-&gt;result);
        if (isset($this-&gt;link)) mysql_close($this-&gt;link);
    }


}
?&gt;
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>JACOBKELL</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454865/converting-mysql-class-to-sqlite-class</guid>
		</item>
				<item>
			<title>PHP wont make a file.</title>
			<link>http://www.daniweb.com/web-development/php/threads/454862/php-wont-make-a-file</link>
			<pubDate>Sat, 18 May 2013 09:55:21 +0000</pubDate>
			<description>I am trying to create a file that with some values the user entered in the webpage. But my code doesnt create a file. And I have other code that is more or less similar that creates the file: Here is my code: &lt;?php echo &quot;&lt;p&gt; In order to create ...</description>
			<content:encoded><![CDATA[ <p>I am trying to create a file that with some values the user entered in the webpage. But my code doesnt create a file. And I have other code that is more or less similar that creates the file:</p>

<p>Here is my code:</p>

<pre><code>        &lt;?php
            echo "&lt;p&gt; In order to create an account we need certain information about you. We will not in anyway use this information &lt;br&gt; ";
            echo "  To identify you personaly. Read out privacy statement &lt;a href='privacy.php'&gt;HERE&lt;/a&gt;&lt;/p&gt;";
            echo "&lt;div class='min_h_personal'&gt;";
            echo "  &lt;h2 class='per_h2'&gt;Required information&lt;/h2&gt; ";
            echo "&lt;/div&gt;";

            echo "&lt;center&gt;";
            echo "&lt;form&gt;";
            echo "First name:&lt;br&gt;";
            echo "&lt;input type='text' name='fname'/&gt;&lt;br&gt;";
            echo "Last name:&lt;br&gt;";
            echo "&lt;input type='text' name='lname'/&gt;&lt;br&gt;";
            echo "Email: &lt;br&gt;";
            echo "&lt;i style='font-size:12;'&gt; Is also your account name &lt;/i&gt;&lt;br&gt;";
            echo "&lt;input type='text' name='email'/&gt;&lt;br&gt;";
            echo "Password: &lt;br&gt;";
            echo "      &lt;i style='font-size:12;'&gt; Must contain atleas 1 number and 1 upper case character &lt;/i&gt;&lt;br&gt;";
            echo "      &lt;input type='password' name='password'/&gt;&lt;br&gt;";
            echo "      &lt;input type='checkbox' name='gender'/&gt; Male&lt;br&gt;";
            echo "      &lt;input type='checkbox' name='gender'/&gt; Female&lt;br&gt;";
            echo "      Country:&lt;br&gt;";
            echo "      &lt;!-- this took me a long time to list all the countries :| --&gt;";
            echo "      &lt;select&gt;";
            echo "          &lt;option name='c' id='country'&gt; --- Select onse --- &lt;/option&gt;";
            echo "          &lt;option name='africa' id='country'&gt; Africa &lt;/option&gt;";
            echo "          &lt;option name='america' id='country' America &lt;/option&gt;";
            echo "          &lt;option name='europe' id='country' Europe &lt;/option&gt;";
            echo "          &lt;option name='ociania' id='country'&gt; Ociania &lt;/option&gt;";
            echo "          &lt;option name='antartica' id='country'&gt; Antartica &lt;/option&gt;";
            echo "      &lt;/select&gt;";
            echo "      &lt;br&gt;";
            echo "      &lt;iframe src='forumrulesexcept.php' width='500' height='450'&gt;";
            echo "      &lt;/iframe&gt;&lt;br&gt;";
            echo "      &lt;input type='checkbox' name='no'/&gt; No &lt;br&gt;";
            echo "      &lt;input type='checkbox' name='yes'/&gt; Yes &lt;br&gt;";
            echo "  &lt;/form&gt;";
            echo "&lt;/center&gt;";

            echo "&lt;div class='add_info'&gt;";
            echo "  &lt;h2 class='add_h2'&gt;Additional infromation&lt;/h2&gt;";
            echo "&lt;/div&gt;";
            echo "&lt;center&gt;";
            echo "  &lt;form&gt;";
            echo "      Job position: &lt;br&gt;";
            echo "      &lt;input type='text' name='job'/&gt;&lt;br&gt;";
            echo "      Company: &lt;br&gt; ";
            echo "      &lt;input type='text' name='company'&gt;&lt;br&gt;";
            echo "      Cellphone: &lt;br&gt;";
            echo "      &lt;input type='text' name='cell'/&gt;&lt;br&gt;";
            echo "  &lt;/form&gt;";
            echo "  &lt;input type='submit' name='submit' value='Submit'&gt;";
            echo "&lt;/center&gt;";

            if(isset($_REQUEST['submit'])){
            $email = $_REQUEST['email'];
            $pass = $_REQUEST['password'];

            $file = fopen($email.$pass.".html");

            fwrite($file, "$email");

            fclose($file);
            }

            ?&gt;
</code></pre>

<p>This is only a peice, this piece is contained in a larger .php file.<br />
What is wrong and how do I fix it?</p>

<p>Thanks...</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>MasterHacker110</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454862/php-wont-make-a-file</guid>
		</item>
				<item>
			<title>Will my idea for a login script work?</title>
			<link>http://www.daniweb.com/web-development/php/threads/454859/will-my-idea-for-a-login-script-work</link>
			<pubDate>Sat, 18 May 2013 08:51:03 +0000</pubDate>
			<description>I am a noob at web programming. I am currently writing a test forum. People will be able to create accounts and then login. But my problem is I dont know how a login script works. So I came up with this idea: 1): Every time an user creates an ...</description>
			<content:encoded><![CDATA[ <p>I am a noob at web programming. I am currently writing a test forum. People will be able to create accounts and then login. But my problem is I dont know how a login script works. So I came up with this idea:</p>

<pre><code>1): 
    Every time an user creates an account I will write the user's name, email and password to a database file.
    Then when he tries to login he my php program will query the file line by line and see if there is a match.
    Once it has a match it will load the users profile page, the name of his page will be [name]+[email]+[password].html
    So that each file will be unique.
</code></pre>

<p>So will it work or is there a nother way, posibly better, more secure way?</p>

<p>Also (I am not sure if this is against daniweb rules, I couldnt find anything that said it was) but if anyone would like to work with me on this project please contact me by sending me a message through daniweb.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>MasterHacker110</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454859/will-my-idea-for-a-login-script-work</guid>
		</item>
				<item>
			<title>php and jquery chat</title>
			<link>http://www.daniweb.com/web-development/php/threads/454851/php-and-jquery-chat</link>
			<pubDate>Sat, 18 May 2013 05:10:33 +0000</pubDate>
			<description>I am trying to make a jquery/php chat and i append data to the chat box, but then when the jquery loop trys to get the .last() data it gets the one before the appended data causing it to append the same data over and over again. hHow would i ...</description>
			<content:encoded><![CDATA[ <p>I am trying to make a jquery/php chat and i append data to the chat box, but then when the jquery loop trys to get the .last() data it gets the one before the appended data causing it to append the same data over and over again. hHow would i get the .last() div added even if its appended?</p>

<pre><code>&lt;script type="text/javascript" charset="utf-8"&gt;
    function addmsg(type, msg){
        /* Simple helper to add a div.
        type is the name of a CSS class (old/new/error).
        msg is the contents of the div */
        $("#messages").append(
            "&lt;div class='msg "+ type +"'&gt;"+ msg +"&lt;/div&gt;"
        );
    }

    function waitForMsg(){
        /* This requests the url "msgsrv.php"
        When it complete (or errors)*/
        var className = $('.messages:last-child').attr('class');
        $.ajax({
            type: "GET",
            url: "msgsrv.php?ID=11&amp;MID=409&amp;SELECT=" + className,

            async: true, /* If set to non-async, browser shows page as "Loading.."*/
            cache: false,
            timeout:50000, /* Timeout in ms */

            success: function(data){ /* called when request to barge.php completes */
                addmsg("new", data); /* Add response to a .msg div (with the "new" class)*/
                setTimeout(
                    waitForMsg, /* Request next message */
                    1000 /* ..after 1 seconds */
                );
            },
            error: function(XMLHttpRequest, textStatus, errorThrown){
                addmsg("error", textStatus + " (" + errorThrown + ")");
                setTimeout(
                    waitForMsg, /* Try again after.. */
                    15000); /* milliseconds (15seconds) */
            }
        });
    };

    $(document).ready(function(){
        waitForMsg(); /* Start the inital request */
    });
    &lt;/script&gt;

    &lt;div id="chat" style="overflow:auto;"&gt;
        &lt;div id="messages" class="0" style="display:inline;"&gt;
        &lt;/div&gt;
        &lt;div id="messages" class="0" style="display:inline;"&gt;
        &lt;/div&gt;
    &lt;/div&gt;
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>zacharysr</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454851/php-and-jquery-chat</guid>
		</item>
				<item>
			<title>help me on onsubmit and onclick</title>
			<link>http://www.daniweb.com/web-development/php/threads/454848/help-me-on-onsubmit-and-onclick</link>
			<pubDate>Sat, 18 May 2013 00:52:37 +0000</pubDate>
			<description>how to make javascript validation onsubmit go first before onclick submit button &lt;form name=&quot;daftar&quot; method=&quot;post&quot; action=&quot;daftar.php&quot; onsubmit=&quot;return checkscript()&quot;&gt; &lt;input type=&quot;submit&quot; name=&quot;Daftar&quot; value=&quot;Daftar&quot; id=&quot;submit&quot; onClick=&quot;return tq()&quot;/&gt; and my js: function checkscript() { if (document.daftar.terms.checked == false) { alert('Sila pastikan anda telah check ruangan persetujuan, untuk menandakan anda setuju dengan syarat-syarat kami.'); ...</description>
			<content:encoded><![CDATA[ <p>how to make javascript validation onsubmit go first before onclick submit button</p>

<p>&lt;form name="daftar" method="post" action="daftar.php" onsubmit="return checkscript()"&gt;</p>

<p>&lt;input type="submit" name="Daftar" value="Daftar" id="submit"  onClick="return tq()"/&gt;</p>

<p>and my js:</p>

<pre><code>function checkscript() {
if (document.daftar.terms.checked == false)
{ alert('Sila pastikan anda telah check ruangan persetujuan, untuk menandakan anda setuju dengan syarat-syarat kami.');
daftar.terms.focus();
return false ;
}
else return true;
}

function tq()
{
alert("Terima Kasih!");
}
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>dina85</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454848/help-me-on-onsubmit-and-onclick</guid>
		</item>
				<item>
			<title>PHP Signup Form Errors</title>
			<link>http://www.daniweb.com/web-development/php/threads/454844/php-signup-form-errors</link>
			<pubDate>Fri, 17 May 2013 22:57:11 +0000</pubDate>
			<description>Okay so i have to make a signup form and i have pretty much everything finished but i keep getting this error **Warning: mysql_num_rows() expects parameter 1 to be resource**. I keep getting this error on my **$checkUserQuery** &amp; **$checkEmailQuery** and don't know how to fix it. Any Suggestions? &lt;?php ...</description>
			<content:encoded><![CDATA[ <p>Okay so i have to make a signup form and i have pretty much everything finished but i keep getting this error <strong>Warning: mysql_num_rows() expects parameter 1 to be resource</strong>. I keep getting this error on my <strong>$checkUserQuery</strong> &amp; <strong>$checkEmailQuery</strong> and don't know how to fix it. Any Suggestions?</p>

<pre><code>&lt;?php
    $db_name = "htmldb";
    $tbl_name = "phplogin";


    //connect to database
    $conn = mysql_connect("localhost","root","");
    mysql_select_db("$db_name");

    //post back to database and checks userName 
    //and email for no duplicates in database
    if($_POST['submit']){
        $first = $_POST['firstName'];
        $last = $_POST['lastName'];
        $user = $_POST['userName'];
        $pass = $_POST['p'];
        $email = $_POST['email'];
        $checkUserQuery = mysql_query("SELECT * FROM $tbl_name WHERE userName = '$user'"); 
        $checkEmailQuery = mysql_query("SELECT * FROM $tbl_name WHERE email = '$email'");

        if(!$first OR !$last OR !$user OR !$pass OR !$email)
        {
            echo("Error: Please make sure all fields are filled out!");
        }
        elseif(mysql_num_rows($checkUserQuery) &gt; 0)
        {
            echo("Error: Username already exists!");
        }
        elseif(mysql_num_rows($checkEmailQuery) &gt; 0)
        {
            echo("Error: E-mail Address has already been used please user another one!");
        }
        else 
        {
            $query = mysql_query("INSERT INTO phplogin
                VALUES(".$first.",'".$last."','".$user."','".$pass."','".$email."')");
            echo("Sign Up Successful!");
        }
    }
?&gt;
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>Gabe13</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454844/php-signup-form-errors</guid>
		</item>
				<item>
			<title>Creating a search engine and linking blog posts</title>
			<link>http://www.daniweb.com/web-development/php/threads/454840/creating-a-search-engine-and-linking-blog-posts</link>
			<pubDate>Fri, 17 May 2013 19:57:01 +0000</pubDate>
			<description>G'day, I created my own simple blog with some posts in it, the posts are stored in a folder called &quot;posts&quot; and there in .MD format. I want to put a search engine on my blog when they search anything that looks similar to any blog.. it should show the ...</description>
			<content:encoded><![CDATA[ <p>G'day,</p>

<p>I created my own simple blog with some posts in it, the posts are stored in a folder called "posts" and there in .MD format. I want to put a search engine on my blog when they search anything that looks similar to any blog.. it should show the results.. I can create a MySQL dB but I don't what do I add in the fields? And how do I link them?</p>

<p>If you still don't get me, let me know. I'll explain briefly.<br />
I tried every web community. Now Daniweb is my last hope.</p>

<p>Thank you.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>MrXortex</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454840/creating-a-search-engine-and-linking-blog-posts</guid>
		</item>
				<item>
			<title>Issue having data from database display on map</title>
			<link>http://www.daniweb.com/web-development/php/threads/454832/issue-having-data-from-database-display-on-map</link>
			<pubDate>Fri, 17 May 2013 14:42:10 +0000</pubDate>
			<description>Hey everyone, So I did some more searching and I found a link that sort of helped me figure this thing out in a sense.. Here's the link https://developers.google.com/maps/articles/phpsqlajax_v3 . When I do all of what the site told me to do, it did give me a map but it ...</description>
			<content:encoded><![CDATA[ <p>Hey everyone,</p>

<p>So I did some more searching and I found a link that sort of helped me figure this thing out in a sense.. Here's the link <a href="https://developers.google.com/maps/articles/phpsqlajax_v3" rel="nofollow">https://developers.google.com/maps/articles/phpsqlajax_v3</a> . When I do all of what the site told me to do, it did give me a map but it didn't create markers to specified locations that I've inputted in a database table.</p>

<p>Now I've taken out the "type variable in the database because I didn't see a use for it in my case. Can anyone help me figure this out? Here are my files. Thanks for anyone's patience!</p>

<p>phpsqlajax_genxml.php</p>

<pre><code>&lt;?php
require("phpsqlajax_dbinfo.php");

// Start XML file, create parent node
$doc = domxml_new_doc("1.0");
$node = $doc-&gt;create_element("markers");
$parnode = $doc-&gt;append_child($node);

// Opens a connection to a MySQL server
$connection=mysql_connect ($hostname, $username, $password);
if (!$connection) {
  die('Not connected : ' . mysql_error());
}

// Set the active MySQL database
$db_selected = mysql_select_db($database, $connection);
if (!$db_selected) {
  die ('Can\'t use db : ' . mysql_error());
}

// Select all the rows in the markers table
$query = "SELECT * FROM markers WHERE 1";
$result = mysql_query($query);
if (!$result) {
  die('Invalid query: ' . mysql_error());
}

header("Content-type: text/xml");

// Iterate through the rows, adding XML nodes for each
while ($row = @mysql_fetch_assoc($result)){
  // ADD TO XML DOCUMENT NODE
  $node = $doc-&gt;create_element("marker");
  $newnode = $parnode-&gt;append_child($node);

  $newnode-&gt;set_attribute("name", $row['name']);
  $newnode-&gt;set_attribute("address", $row['address']);
  $newnode-&gt;set_attribute("lat", $row['lat']);
  $newnode-&gt;set_attribute("lng", $row['lng']);
}

$xmlfile = $doc-&gt;dump_mem();
echo $xmlfile;

?&gt;
</code></pre>

<p>phpsqlajax_genxml2.php</p>

<pre><code>&lt;?php
require("phpsqlajax_dbinfo.php");

function parseToXML($htmlStr) 
{ 
$xmlStr=str_replace('&lt;','&amp;lt;',$htmlStr); 
$xmlStr=str_replace('&gt;','&amp;gt;',$xmlStr); 
$xmlStr=str_replace('"','&amp;quot;',$xmlStr); 
$xmlStr=str_replace("'",'&amp;#39;',$xmlStr); 
$xmlStr=str_replace("&amp;",'&amp;amp;',$xmlStr); 
return $xmlStr; 
} 

// Opens a connection to a MySQL server
$connection=mysql_connect ($hostname, $username, $password);
if (!$connection) {
  die('Not connected : ' . mysql_error());
}

// Set the active MySQL database
$db_selected = mysql_select_db($database, $connection);
if (!$db_selected) {
  die ('Can\'t use db : ' . mysql_error());
}

// Select all the rows in the markers table
$query = "SELECT * FROM markers WHERE 1";
$result = mysql_query($query);
if (!$result) {
  die('Invalid query: ' . mysql_error());
}

header("Content-type: text/xml");

// Start XML file, echo parent node
echo '&lt;markers&gt;';

// Iterate through the rows, printing XML nodes for each
while ($row = @mysql_fetch_assoc($result)){
  // ADD TO XML DOCUMENT NODE
  echo '&lt;marker ';
  echo 'name="' . parseToXML($row['name']) . '" ';
  echo 'address="' . parseToXML($row['address']) . '" ';
  echo 'lat="' . $row['lat'] . '" ';
  echo 'lng="' . $row['lng'] . '" ';
  echo '/&gt;';
}

// End XML file
echo '&lt;/markers&gt;';

?&gt;
</code></pre>

<p>phpsqlajax_genxml3.php</p>

<pre><code>&lt;?php  

require("phpsqlajax_dbinfo.php"); 

// Start XML file, create parent node

$dom = new DOMDocument("1.0");
$node = $dom-&gt;createElement("markers");
$parnode = $dom-&gt;appendChild($node); 

// Opens a connection to a MySQL server

$connection=mysql_connect ($hostname, $username, $password);
if (!$connection) {  die('Not connected : ' . mysql_error());} 

// Set the active MySQL database

$db_selected = mysql_select_db($database, $connection);
if (!$db_selected) {
  die ('Can\'t use db : ' . mysql_error());
} 

// Select all the rows in the markers table

$query = "SELECT * FROM markers WHERE 1";
$result = mysql_query($query);
if (!$result) {  
  die('Invalid query: ' . mysql_error());
} 

header("Content-type: text/xml"); 

// Iterate through the rows, adding XML nodes for each

while ($row = @mysql_fetch_assoc($result)){  
  // ADD TO XML DOCUMENT NODE  
  $node = $dom-&gt;createElement("marker");  
  $newnode = $parnode-&gt;appendChild($node);   
  $newnode-&gt;setAttribute("name",$row['name']);
  $newnode-&gt;setAttribute("address", $row['address']);  
  $newnode-&gt;setAttribute("lat", $row['lat']);  
  $newnode-&gt;setAttribute("lng", $row['lng']);  
} 

echo $dom-&gt;saveXML();

?&gt;
</code></pre>

<p>maps.php</p>

<pre><code>&lt;!DOCTYPE html &gt;
  &lt;head&gt;
    &lt;meta name="viewport" content="initial-scale=1.0, user-scalable=no" /&gt;
    &lt;meta http-equiv="content-type" content="text/html; charset=UTF-8"/&gt;
    &lt;title&gt;PHP/MySQL &amp; Google Maps Example&lt;/title&gt;
    &lt;script type="text/javascript" src="<a href="http://maps.googleapis.com/maps/api/js?sensor=false" rel="nofollow">http://maps.googleapis.com/maps/api/js?sensor=false</a>"&gt;&lt;/script&gt;
    &lt;script type="text/javascript"&gt;
    //&lt;![CDATA[

    var customIcons = {
      home: {
        icon: '<a href="http://labs.google.com/ridefinder/images/mm_20_blue.png" rel="nofollow">http://labs.google.com/ridefinder/images/mm_20_blue.png</a>',
        shadow: '<a href="http://labs.google.com/ridefinder/images/mm_20_shadow.png" rel="nofollow">http://labs.google.com/ridefinder/images/mm_20_shadow.png</a>'
      },
    };

    function load() {
      var map = new google.maps.Map(document.getElementById("map"), {
        center: new google.maps.LatLng(39.707187, -86.154785),
        zoom: 13,
        mapTypeId: 'hybrid'
      });
      var infoWindow = new google.maps.InfoWindow;

      // Change this depending on the name of your PHP file
      downloadUrl("phpsqlajax_genxml.php", function(data) {
        var xml = data.responseXML;
        var markers = xml.documentElement.getElementsByTagName("marker");
        for (var i = 0; i &lt; markers.length; i++) {
          var name = markers[i].getAttribute("name");
          var address = markers[i].getAttribute("address");
          var point = new google.maps.LatLng(
              parseFloat(markers[i].getAttribute("lat")),
              parseFloat(markers[i].getAttribute("lng")));
          var html = "&lt;b&gt;" + name + "&lt;/b&gt; &lt;br/&gt;" + address;
          var icon = customIcons[type] || {};
          var marker = new google.maps.Marker({
            map: map,
            position: point,
            icon: icon.icon,
            shadow: icon.shadow
          });
          bindInfoWindow(marker, map, infoWindow, html);
        }
      });
    }

    function bindInfoWindow(marker, map, infoWindow, html) {
      google.maps.event.addListener(marker, 'click', function() {
        infoWindow.setContent(html);
        infoWindow.open(map, marker);
      });
    }

    function downloadUrl(url, callback) {
      var request = window.ActiveXObject ?
          new ActiveXObject('Microsoft.XMLHTTP') :
          new XMLHttpRequest;

      request.onreadystatechange = function() {
        if (request.readyState == 4) {
          request.onreadystatechange = doNothing;
          callback(request, request.status);
        }
      };

      request.open('GET', url, true);
      request.send(null);
    }

    function doNothing() {}

    //]]&gt;

  &lt;/script&gt;

  &lt;/head&gt;

  &lt;body onload="load()"&gt;
    &lt;div id="map" style="width: 500px; height: 300px"&gt;&lt;/div&gt;
  &lt;/body&gt;

&lt;/html&gt;
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>geneh23</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454832/issue-having-data-from-database-display-on-map</guid>
		</item>
				<item>
			<title>Call a MySQL stored procedure using PHP?</title>
			<link>http://www.daniweb.com/web-development/php/threads/454821/call-a-mysql-stored-procedure-using-php</link>
			<pubDate>Fri, 17 May 2013 12:39:59 +0000</pubDate>
			<description>I currently have $tableName=&quot;thenameofthetable&quot;; $someid=$_GET[&quot;someidthruget&quot;]; $result = mysql_query(&quot;SELECT name,age FROM &quot;. $tableName. &quot; WHERE idp=&quot;. $someid); Which looks really insecure. How can I do it using a stored procedure which I think will make it a lot more secure? Thanks</description>
			<content:encoded><![CDATA[ <p>I currently have</p>

<pre><code>$tableName="thenameofthetable";
$someid=$_GET["someidthruget"];
$result = mysql_query("SELECT name,age FROM ". $tableName. " WHERE idp=". $someid);   
</code></pre>

<p>Which looks really insecure.</p>

<p>How can I do it using a stored procedure which I think will make it a lot more secure?</p>

<p>Thanks</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>riahc3</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454821/call-a-mysql-stored-procedure-using-php</guid>
		</item>
				<item>
			<title>Php unlink function(deleting file in a directory)</title>
			<link>http://www.daniweb.com/web-development/php/threads/454820/php-unlink-functiondeleting-file-in-a-directory</link>
			<pubDate>Fri, 17 May 2013 12:10:52 +0000</pubDate>
			<description>Hi! I have a problem with the unlink() php function. What I try to do is to delete a certain file in a directory. Now the function works fine. But when I call it then it deletes ALL the files inside of that directory. What I want is for it ...</description>
			<content:encoded><![CDATA[ <p>Hi!</p>

<p>I have a problem with the unlink() php function. What I try to do is to delete a certain file in a directory. Now the function works fine. But when I call it then it deletes ALL the files inside of that directory. What I want is for it to delete that certain file which the user can select from a list.</p>

<p>I display all the files with php and beside it is a 'X' ahref link which doesn't seem to be identified with that file next to it. This 'X' is used to delete the file.</p>

<pre><code>echo "$file &lt;a title='Delete book' href='#' onclick=".delete($file)."&gt;X&lt;/a&gt;";
</code></pre>

<p>This line prints all the files listed in the directory. (It's in a while loop)</p>

<p>Here is the delete function:</p>

<pre><code>function delete($var){
     $link = './book/'.$var;
     unlink($link);
 }
</code></pre>

<p>I'm not sure how to identify the 'X' with the book next to it. Because at the moment it seems 'X' is linked to all the files.</p>

<p>Any help will be appreciated!</p>

<p>Thanks!</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>Phillamon</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454820/php-unlink-functiondeleting-file-in-a-directory</guid>
		</item>
				<item>
			<title>how to make  uploaded file information below submit button</title>
			<link>http://www.daniweb.com/web-development/php/threads/454812/how-to-make-uploaded-file-information-below-submit-button</link>
			<pubDate>Fri, 17 May 2013 09:28:53 +0000</pubDate>
			<description>after press submit button to upload the image, the information will display at new window, i need the information will be display below submit button. my code: &lt;?php if($_GET['action'] == &quot;upload&quot;) { ?&gt; &lt;div id=&quot;upload&quot;&gt; &lt;br/&gt;&lt;br/&gt; &lt;form action=&quot;upload_image.php?action=upload&quot; method=&quot;post&quot; enctype=&quot;multipart/form-data&quot;&gt; &lt;label for=&quot;file&quot;&gt;Gambar yang ingin dimuat naik:&lt;/label&gt; &lt;input type=&quot;file&quot; name=&quot;file&quot; id=&quot;file&quot;&gt;&lt;br&gt;&lt;br/&gt; ...</description>
			<content:encoded><![CDATA[ <p>after press submit button to upload the image, the information will display at new window, i need the information will be display below submit button.</p>

<p>my code:</p>

<pre><code>&lt;?php
    if($_GET['action'] == "upload")
    {
?&gt;  
&lt;div id="upload"&gt;
&lt;br/&gt;&lt;br/&gt;
&lt;form action="upload_image.php?action=upload" method="post" enctype="multipart/form-data"&gt;
&lt;label for="file"&gt;Gambar yang ingin dimuat naik:&lt;/label&gt;
&lt;input type="file" name="file" id="file"&gt;&lt;br&gt;&lt;br/&gt;
&lt;input type="submit" name="submit" value="Submit" id="submit_upload"&gt;&lt;br/&gt;&lt;br/&gt;
&lt;/form&gt;
&lt;/div&gt;
&lt;?php

$allowedExts = array("gif", "jpeg", "jpg", "png");
$value = explode(".", $_FILES["file"]["name"]);
$extension = end($value);
if ((($_FILES["file"]["type"] == "image/gif")
|| ($_FILES["file"]["type"] == "image/jpeg")
|| ($_FILES["file"]["type"] == "image/jpg")
|| ($_FILES["file"]["type"] == "image/pjpeg")
|| ($_FILES["file"]["type"] == "image/x-png")
|| ($_FILES["file"]["type"] == "image/png"))
//&amp;&amp; ($_FILES["file"]["size"] &lt; 20000)
&amp;&amp; in_array($extension, $allowedExts))
  {
  if ($_FILES["file"]["error"] &gt; 0)
    {
    echo "Return Code: " . $_FILES["file"]["error"] . "&lt;br&gt;";
    }
    else
    {
        echo "Upload: " . $_FILES["file"]["name"] . "&lt;br&gt;";
        echo "Type: " . $_FILES["file"]["type"] . "&lt;br&gt;";
        //echo "Size: " . ($_FILES["file"]["size"] / 1024) . " kB&lt;br&gt;";
        echo "Temp file: " . $_FILES["file"]["tmp_name"] . "&lt;br&gt;";

        if (file_exists("upload/" . $_FILES["file"]["name"]))
        {
        echo $_FILES["file"]["name"] . " already exists. ";
        }
        else
        {
            $_POST = array_map("mysql_real_escape_string", $_POST);
            //if ($img = $_FILES["file"]["tmp_name"]) {
            //$image_url = md5_file($img) . ".jpeg";

            if(move_uploaded_file($_FILES["file"]["tmp_name"],"upload/" . $_FILES["file"]["name"]))
            {
                //klu berjaya upload , then simpan nama kt database
                $conn = mysql_connect('localhost','root','');
                mysql_select_db('daftar',$conn);
                $link = "<a href="http://localhost/form/admin2/upload/" rel="nofollow">http://localhost/form/admin2/upload/</a>" . $_FILES["file"]["name"];;
                $sql = "insert into images (image,link) values ('".$_FILES['file']['name']."','".$link."')";
                if(mysql_query($sql))
                {
                echo "Stored in: " . "upload/" . $_FILES["file"]["name"];
                }
                else
                {
                echo 'File name not stored in database';
                }
            }     
        }
      }
   }
else
  {
  echo "Invalid file";
  }
    }
    else
    {
?&gt;
&lt;?php
require("../global.php");


echo "&lt;title&gt;".$title2."&lt;/title&gt;";
echo "&lt;link rel='stylesheet' type='text/css' href='style.css' /&gt;";


echo"
&lt;div id='upload'&gt;
&lt;br/&gt;&lt;br/&gt;
&lt;form action='upload_image.php?action=upload' method='post' enctype='multipart/form-data'&gt;
&lt;label for='file'&gt;Gambar yang ingin dimuat naik:&lt;/label&gt;
&lt;input type='file' name='file' id='file'&gt;&lt;br&gt;&lt;br/&gt;
&lt;input type='submit' name='submit' value='Submit' id='submit_upload'&gt;&lt;br/&gt;&lt;br/&gt;
&lt;/form&gt;
&lt;/div&gt;
";

}
?&gt;
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>dina85</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454812/how-to-make-uploaded-file-information-below-submit-button</guid>
		</item>
				<item>
			<title>Htaccess redirect to external domain</title>
			<link>http://www.daniweb.com/web-development/php/threads/454807/htaccess-redirect-to-external-domain</link>
			<pubDate>Fri, 17 May 2013 08:27:21 +0000</pubDate>
			<description>Hi, I would have a subdomain on domain A. Basicly I want to forward this to a particular page on domain B. But it's slightly complicated- I want to mask this so it looks like domain A hosts the actual page than domain B. Eg. Domain A http://something.domainA.com Domain B ...</description>
			<content:encoded><![CDATA[ <p>Hi,</p>

<p>I would have a subdomain on domain A. Basicly I want to forward this to a particular page on domain B. But it's slightly complicated- I want to mask this so it looks like domain A hosts the actual page than domain B.</p>

<p>Eg.<br />
Domain A<br />
<a href="http://something.domainA.com" rel="nofollow">http://something.domainA.com</a></p>

<p>Domain B<br />
<a href="http://subdomain.domainB.com/particular/page?parameters=yes" rel="nofollow">http://subdomain.domainB.com/particular/page?parameters=yes</a></p>

<p>Desired URL in address bar<br />
<a href="http://something.domainA.com/particular/page?parameters=yes" rel="nofollow">http://something.domainA.com/particular/page?parameters=yes</a></p>

<p>Hope that makes sense, please ask if there are any questions.</p>

<p>Cheers,</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>bsewell</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454807/htaccess-redirect-to-external-domain</guid>
		</item>
				<item>
			<title>error to make a download link from database</title>
			<link>http://www.daniweb.com/web-development/php/threads/454806/error-to-make-a-download-link-from-database</link>
			<pubDate>Fri, 17 May 2013 08:25:13 +0000</pubDate>
			<description>can't download file from database, got error, help me please.. &lt;?php require(&quot;conn2.php&quot;); $sql=&quot;select image from images where id='$_GET[id]';&quot;; $result = mysql_query($sql); $row = mysql_fetch_array($result) $name = $row['image']; // the name of the file that is downloaded $FilePath = &quot;upload&quot;; // the folder of the file that is downloaded , you ...</description>
			<content:encoded><![CDATA[ <p>can't download file from database, got error, help me please..</p>

<p>&lt;?php<br />
require("conn2.php");<br />
$sql="select image from images where id='$_GET[id]';";<br />
$result = mysql_query($sql);<br />
$row = mysql_fetch_array($result)</p>

<p>$name = $row['image'];  // the name of the file that is downloaded<br />
$FilePath = "upload";  // the folder of the file that is downloaded , you can put the file in a folder on the server just for more order</p>

<p>$size = filesize($FilePath . $name) ;<br />
header("Content-Type: application/force-download; name=\"". $name ."\"");<br />
header("Content-Transfer-Encoding: binary");<br />
header("Content-Length: ". $size ."");<br />
header("Content-Disposition: attachment; filename=\"". $name ."\"");<br />
header("Expires: 0");<br />
header("Cache-Control: no-cache, must-revalidate");<br />
header("Pragma: no-cache");<br />
echo (readfile($FilePath . $name));<br />
?&gt;</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>dina85</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454806/error-to-make-a-download-link-from-database</guid>
		</item>
				<item>
			<title>Urlencode and Urldecode</title>
			<link>http://www.daniweb.com/web-development/php/threads/454795/urlencode-and-urldecode</link>
			<pubDate>Fri, 17 May 2013 05:52:11 +0000</pubDate>
			<description>What is Urlencode and Urldecode in PHP?</description>
			<content:encoded><![CDATA[ <p>What is Urlencode and Urldecode in PHP?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>sushants</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454795/urlencode-and-urldecode</guid>
		</item>
				<item>
			<title>Shared products DB between multiple Magento installations</title>
			<link>http://www.daniweb.com/web-development/php/threads/454790/shared-products-db-between-multiple-magento-installations</link>
			<pubDate>Fri, 17 May 2013 03:16:13 +0000</pubDate>
			<description>Is it possible? If you know how let me know.</description>
			<content:encoded><![CDATA[ <p>Is it possible?<br />
If you know how let me know.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>igabc</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454790/shared-products-db-between-multiple-magento-installations</guid>
		</item>
				<item>
			<title>Facebook SDK problem - uncaught Exception</title>
			<link>http://www.daniweb.com/web-development/php/threads/454760/facebook-sdk-problem-uncaught-exception</link>
			<pubDate>Thu, 16 May 2013 16:15:51 +0000</pubDate>
			<description>Hi, i have this bas_facebook.php to login with facebook on my website, but it gives me error with the exception: if (!function_exists('curl_init')) { throw new Exception('Facebook needs the CURL PHP extension.'); } if (!function_exists('json_decode')) { throw new Exception('Facebook needs the JSON PHP extension.'); } /** * Thrown when an API ...</description>
			<content:encoded><![CDATA[ <p>Hi, i have this bas_facebook.php to login with facebook on my website, but it gives me error with the exception:</p>

<pre><code>if (!function_exists('curl_init')) {
  throw new Exception('Facebook needs the CURL PHP extension.');
}
if (!function_exists('json_decode')) {
  throw new Exception('Facebook needs the JSON PHP extension.');
}

/**
 * Thrown when an API call returns an exception.
 *
 * @author Naitik Shah &lt;naitik@facebook.com&gt;
 */
class FacebookApiException extends Exception
{
  /**
   * The result from the API server that represents the exception information.
   */
  protected $result;

  (...)
</code></pre>

<p>This are the errors:</p>

<blockquote>
  <p>( ! ) Fatal error: Uncaught exception 'Exception' with message 'Facebook needs the CURL PHP extension.' in C:\wamp\www\facebook\lib\base_facebook.php on line 19<br />
  ( ! ) Exception: Facebook needs the CURL PHP extension. in C:\wamp\www\facebook\lib\base_facebook.php on line 19</p>
</blockquote>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>PF2G</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454760/facebook-sdk-problem-uncaught-exception</guid>
		</item>
				<item>
			<title>Undefined index error</title>
			<link>http://www.daniweb.com/web-development/php/threads/454757/undefined-index-error</link>
			<pubDate>Thu, 16 May 2013 15:37:02 +0000</pubDate>
			<description>I'm reading data from my DB and displaying it in a table like this while($row = mysql_fetch_row($result)){ $_SESSION['edit'] = $row[1];//it says undefined index 'edit' echo '&lt;/tr&gt;'; echo ' &lt;td class=&quot;product&quot;&gt;&lt;a href=&quot;manage-products-2.php?prod_id ='.$row[0].'&quot;&gt;'.$row[1].'&lt;/a&gt;&lt;/td&gt;';//it says undefined index 'prod_id' echo'&lt;td class=&quot;quantity&quot;&gt;'.$row[5].'&lt;/td&gt;'; echo '&lt;td class=&quot;item_price&quot;&gt;'.$row[4].'&lt;/td&gt;'; echo '&lt;td class=&quot;item_total&quot;&gt;'.$row[6].'&lt;/td&gt;'; echo '&lt;td class=&quot;item_unsold&quot;&gt;&lt;a href = &quot;manage-products.php?prod ...</description>
			<content:encoded><![CDATA[ <p>I'm reading data from my DB and displaying it in a table like this</p>

<pre><code>while($row = mysql_fetch_row($result)){
          $_SESSION['edit'] = $row[1];//it says undefined index 'edit' 
           echo '&lt;/tr&gt;';
 echo ' &lt;td class="product"&gt;&lt;a href="manage-products-2.php?prod_id ='.$row[0].'"&gt;'.$row[1].'&lt;/a&gt;&lt;/td&gt;';//it says undefined index 'prod_id' 
          echo'&lt;td class="quantity"&gt;'.$row[5].'&lt;/td&gt;';
          echo '&lt;td class="item_price"&gt;'.$row[4].'&lt;/td&gt;';
          echo '&lt;td class="item_total"&gt;'.$row[6].'&lt;/td&gt;';
        echo '&lt;td class="item_unsold"&gt;&lt;a href = "manage-products.php?prod ='.$row[0].'" style="color:red" onclick="return confirm("Are you sure you want to delete this product ?")"&gt;Delete&lt;/a&gt;&lt;/td&gt;';//to delete an item
        echo '&lt;/tr&gt;';
}
</code></pre>

<p>On a separate script called manage-products2.php, i'm retrieving these values like this:</p>

<pre><code>$edit = $_SESSION['edit'];
$prodid = $_GET['prod_id'];
</code></pre>

<p>But then i get the errors: undefined index 'edit'  and undefined index 'prod_id' when i try to display these values like this for example <code>&lt;?php echo '&lt;div class="question2 ha"&gt;'.$prodid.'&lt;/div&gt;';?&gt;</code>. Please where is my mistake?. Thank You.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>dhani09</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454757/undefined-index-error</guid>
		</item>
				<item>
			<title>list connected to map</title>
			<link>http://www.daniweb.com/web-development/php/threads/454753/list-connected-to-map</link>
			<pubDate>Thu, 16 May 2013 15:04:22 +0000</pubDate>
			<description>Hey everyone, I don't have any code but I was wondering if it was possible to have a list of houses or properties for sale and have it connected to google maps to show the location. Is there anyway to do this in php? Sorry for the lack of knowledge. ...</description>
			<content:encoded><![CDATA[ <p>Hey everyone,</p>

<p>I don't have any code but I was wondering if it was possible to have a list of houses or properties for sale and have it connected to google maps to show the location. Is there anyway to do this in php? Sorry for the lack of knowledge. I was hoping to have a scrollable list on the left and on the right, display a map that showed those listings in map view. I'm not sure how to do this. Thanks in advance for any advice!</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>geneh23</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454753/list-connected-to-map</guid>
		</item>
				<item>
			<title>PHP email form doesnt send email...</title>
			<link>http://www.daniweb.com/web-development/php/threads/454752/php-email-form-doesnt-send-email</link>
			<pubDate>Thu, 16 May 2013 14:39:28 +0000</pubDate>
			<description>After finding out that php need to be run through a server and not as a normal .html file, I need to send an email to the &quot;person&quot; to make an appointment. Here is my code: &lt;?php echo &quot;&lt;form method='post' action='mailform.php'&gt; Email: &lt;input name='email' type='text'&gt;&lt;br&gt; Subject: &lt;input name='subject' type='text'&gt;&lt;br&gt; Message:&lt;br&gt; ...</description>
			<content:encoded><![CDATA[ <p>After finding out that php need to be run through a server and not as a normal .html file, I need to send an email to the "person" to make an appointment.</p>

<p>Here is my code:</p>

<pre><code>                &lt;?php
                    echo "&lt;form method='post' action='mailform.php'&gt;
                    Email: &lt;input name='email' type='text'&gt;&lt;br&gt;
                    Subject: &lt;input name='subject' type='text'&gt;&lt;br&gt;
                    Message:&lt;br&gt;
                    &lt;textarea name='message' rows='15' cols='40'&gt;
                    &lt;/textarea&gt;&lt;br&gt;
                    &lt;input type='submit'&gt;
                    &lt;/form&gt;";

                    $email = $_REQUEST['email'] ;
                    $subject = $_REQUEST['subject'] ;
                    $message = $_REQUEST['message'] ;
                    if(mail($email, $subject, $message, "From:" . $email))
                    {
                        printf("Email sent.");
                    }
                ?&gt;
</code></pre>

<p>But it doesnt send the email. This code is imbedded inside a .html file and I execute it by <a href="http://localhost/email.php" rel="nofollow">http://localhost/email.php</a></p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>MasterHacker110</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454752/php-email-form-doesnt-send-email</guid>
		</item>
				<item>
			<title>redirect query string urls to pretty urls </title>
			<link>http://www.daniweb.com/web-development/php/threads/454743/redirect-query-string-urls-to-pretty-urls-</link>
			<pubDate>Thu, 16 May 2013 12:30:58 +0000</pubDate>
			<description>i want to redirect my query base url to pretty url,i am trying this on local host, i want if any one try to access http://localhost/something/index.php?page=zen it will redirect to http://localhost/something/zen.html, ie http://localhost/something/index.php?page=zen =&gt; http://localhost/something/zen.html RewriteEngine On RewriteCond %{REQUEST_URI} ^/index\.php$ RewriteCond %{QUERY_STRING} ^page=([a-zA-Z0-9_-])$ RewriteRule ^(.*)$ http://localhost/cmsmadesimple/%1.html [L,R=301]</description>
			<content:encoded><![CDATA[ <p>i want to redirect my query base url to pretty url,i am trying this on local host, i want if any one try to access <a href="http://localhost/something/index.php?page=zen" rel="nofollow">http://localhost/something/index.php?page=zen</a> it will redirect to <a href="http://localhost/something/zen.html," rel="nofollow">http://localhost/something/zen.html,</a><br />
ie<br />
<a href="http://localhost/something/index.php?page=zen" rel="nofollow">http://localhost/something/index.php?page=zen</a> =&gt; <a href="http://localhost/something/zen.html" rel="nofollow">http://localhost/something/zen.html</a></p>

<pre><code>RewriteEngine On
RewriteCond %{REQUEST_URI}  ^/index\.php$
RewriteCond %{QUERY_STRING} ^page=([a-zA-Z0-9_-])$
RewriteRule ^(.*)$ <a href="http://localhost/cmsmadesimple/%251.html" rel="nofollow">http://localhost/cmsmadesimple/%1.html</a> [L,R=301]
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>ak47carbon</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454743/redirect-query-string-urls-to-pretty-urls-</guid>
		</item>
				<item>
			<title>sql queries are not working.</title>
			<link>http://www.daniweb.com/web-development/php/threads/454741/sql-queries-are-not-working</link>
			<pubDate>Thu, 16 May 2013 12:18:12 +0000</pubDate>
			<description>Hello. I am having a bit problem with the insert query, Every thing is fine but don't know why its not inserting the queries. Have a look onm code; function insert() { var table=document.getElementById(&quot;myTable1&quot;); var table=document.getElementById(&quot;myTable&quot;); &lt;?php $con=mysqli_connect(&quot;localhost&quot;,&quot;root&quot;,&quot;&quot;,&quot;bsc_db&quot;); // Check connection if (mysqli_connect_errno()) { echo &quot;Failed to connect to MySQL: ...</description>
			<content:encoded><![CDATA[ <p>Hello.<br />
I am having a bit problem with the insert query, Every thing is fine but don't know why its not inserting the queries.<br />
Have a look onm code;</p>

<pre><code class="language-xhtml">function insert()
{
var table=document.getElementById("myTable1");
var table=document.getElementById("myTable");
&lt;?php
$con=mysqli_connect("localhost","root","","bsc_db");
// Check connection
if (mysqli_connect_errno())
  {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
  }
//Inserting the basic information of the PATIENT;
$sql="INSERT INTO pat_t (pid, pname, fhname, gender, age, adate, ddate, tby, issue, gtotal, visit)
    VALUES
    ('$_POST[pid]','$_POST[pname]','$_POST[fhname]','$_POST[gender]','$_POST[age]','$_POST[adate]','$_POST[ddate]','$_POST[tby]','$_POST[issue]','$_POST[gtotal]','$_POST[visit]')";

    if (!mysqli_query($con,$sql))
    {
    //die('Error: ' . mysqli_error());
    }

//qty 1 
if ('$_POST[qty]' != "")
{
    $sql1="INSERT INTO pmed_t (visit, pid, medname, qty, rate, total)
    VALUES
    ('$_POST[visit]','$_POST[pid]','$_POST[med]','$_POST[qty]','$_POST[rate]','$_POST[total]')";

    if (!mysqli_query($con,$sql1))
    {
    //die('Error: ' . mysqli_error());
    }
}   
echo "";

//qty 2 
if ('$_POST[qty2]' != "")
{
    $sql2="INSERT INTO pmed_t (visit, pid, medname, qty, rate, total)
    VALUES
    ('$_POST[visit]','$_POST[pid]','$_POST[med2]','$_POST[qty2]','$_POST[rate2]','$_POST[total2]')";

    if (!mysqli_query($con,$sql2))
    {
    //die('Error: ' . mysqli_error());
    }
}   
echo "";

//qty 3 
if ('$_POST[qty3]' != "")
{
    $sql3="INSERT INTO pmed_t (visit, pid, medname, qty, rate, total)
    VALUES
    ('$_POST[visit]','$_POST[pid]','$_POST[med3]','$_POST[qty3]','$_POST[rate3]','$_POST[total3]')";

    if (!mysqli_query($con,$sql3))
    {
    //die('Error: ' . mysqli_error());
    }
}   
echo "";

//qty 4 
if ('$_POST[qty4]' != "")
{
    $sql4="INSERT INTO pmed_t (visit, pid, medname, qty, rate, total)
    VALUES
    ('$_POST[visit]','$_POST[pid]','$_POST[med4]','$_POST[qty4]','$_POST[rate4]','$_POST[total4]')";

    if (!mysqli_query($con,$sql4))
    {
    //die('Error: ' . mysqli_error());
    }
}   
echo "";

//qty 5 
if ('$_POST[qty5]' != "")
{
    $sql5="INSERT INTO pmed_t (visit, pid, medname, qty, rate, total)
    VALUES
    ('$_POST[visit]','$_POST[pid]','$_POST[med5]','$_POST[qty5]','$_POST[rate5]','$_POST[total5]')";

    if (!mysqli_query($con,$sql5))
    {
    //die('Error: ' . mysqli_error());
    }
}   
echo "";

//qty 6 
if ('$_POST[qty6]' != "")
{
    $sql6="INSERT INTO pmed_t (visit, pid, medname, qty, rate, total)
    VALUES
    ('$_POST[visit]','$_POST[pid]','$_POST[med6]','$_POST[qty6]','$_POST[rate6]','$_POST[total6]')";

    if (!mysqli_query($con,$sql6))
    {
    //die('Error: ' . mysqli_error());
    }
}   
echo "";

//qty 7 
if ('$_POST[qty7]' != "")
{
    $sql7="INSERT INTO pmed_t (visit, pid, medname, qty, rate, total)
    VALUES
    ('$_POST[visit]','$_POST[pid]','$_POST[med7]','$_POST[qty7]','$_POST[rate7]','$_POST[total7]')";

    if (!mysqli_query($con,$sql7))
    {
    //die('Error: ' . mysqli_error());
    }
}   
echo "";

//qty 8 
if ('$_POST[qty8]' != "")
{
    $sql8="INSERT INTO pmed_t (visit, pid, medname, qty, rate, total)
    VALUES
    ('$_POST[visit]','$_POST[pid]','$_POST[med8]','$_POST[qty8]','$_POST[rate8]','$_POST[total8]')";

    if (!mysqli_query($con,$sql8))
    {
    //die('Error: ' . mysqli_error());
    }
}   
echo "";

//qty 9 
if ('$_POST[qty9]' != "")
{
    $sql9="INSERT INTO pmed_t (visit, pid, medname, qty, rate, total)
    VALUES
    ('$_POST[visit]','$_POST[pid]','$_POST[med9]','$_POST[qty9]','$_POST[rate9]','$_POST[total9]')";

    if (!mysqli_query($con,$sql9))
    {
    //die('Error: ' . mysqli_error());
    }
}   
echo "";

//qty 10 
if ('$_POST[qty10]' != "")
{
    $sql10="INSERT INTO pmed_t (visit, pid, medname, qty, rate, total)
    VALUES
    ('$_POST[visit]','$_POST[pid]','$_POST[med10]','$_POST[qty10]','$_POST[rate10]','$_POST[total10]')";

    if (!mysqli_query($con,$sql10))
    {
    //die('Error: ' . mysqli_error());
    }
}   
echo "";

mysqli_close($con);

?&gt;
}
</code></pre>

<p>When I check the database on localhost. It is inserting only one row in the pat_t table and pmed_t table. every thing(field in the DB table) is showing "0".<br />
Please help me to find out where i am making a mistake...</p>

<p>Thanks n Regards.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>akkbkht</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454741/sql-queries-are-not-working</guid>
		</item>
				<item>
			<title>PHP Mysql Form Data Submission</title>
			<link>http://www.daniweb.com/web-development/php/threads/454736/php-mysql-form-data-submission</link>
			<pubDate>Thu, 16 May 2013 10:52:06 +0000</pubDate>
			<description>Hi, I am trying to create a simple form submission using php and mysql. I am stuck at very basic level of mysql and php code. Here is what i am trying to do. 1. index page where name and email data is shown. 2. add-data.php page where i am ...</description>
			<content:encoded><![CDATA[ <p>Hi,</p>

<p>I am trying to create a simple form submission using php and mysql. I am stuck at very basic level of mysql and php code.</p>

<p>Here is what i am trying to do.</p>

<ol><li><p>index page where name and email data is shown.</p></li>
<li><p>add-data.php page where i am adding the email and name using the form.</p></li>
<li><p>send the data to database and update the page index.php.</p></li>
<li><p>I am not planning to use ajax but just want to redirect to the index page after the successful submission.</p></li>
</ol>

<p>Not sure how to submit the data to the database and redirect to the index page. Any help?</p>

<p>Here is my code.</p>

<p><strong>index.php</strong></p>

<pre><code>&lt;?php

//Code to connect to database
$con=mysql_connect("localhost","xxx","xxx") or die(mysql_error());
echo "Connected to database";

//select database
$select=mysql_select_db("test") or die(mysql_error());

//get the result from database
$result=mysql_query("SELECT* from demo");


//display result by looping through each row
while($row=mysql_fetch_array($result))
{

echo "&lt;br/&gt;";

//use row to fetch the element of each column
echo "&lt;br/&gt;"."ID : ".$row['id']."&lt;br/&gt;"." Name :".$row['name']. "&lt;br/&gt;"." Email :".$row['email']."&lt;br/&gt;";

}

mysql_close($con);


?&gt;
</code></pre>

<p><strong>add-data.php</strong></p>

<pre><code>&lt;form method="post" action="index.php"&gt;

&lt;label&gt;Name :&lt;/label&gt;&lt;input type="text" name="name" id="name"&gt;&lt;br/&gt;
&lt;label&gt;Email: &lt;/label&gt;&lt;input type="text" name="email" id="email"&gt;&lt;br/&gt;
&lt;br/&gt;&lt;input type="submit" name="Add"&gt;
&lt;br/&gt;
&lt;/form&gt;
</code></pre>

<p>I have managed to add the form. But not sure how to get the data from the form and add into the database and redirect to index.php</p>

<p>Any help with code to guide me in right direction is appreciated.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>arunpawar</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454736/php-mysql-form-data-submission</guid>
		</item>
				<item>
			<title>PHP does not seem to work on my browser.</title>
			<link>http://www.daniweb.com/web-development/php/threads/454729/php-does-not-seem-to-work-on-my-browser</link>
			<pubDate>Thu, 16 May 2013 09:12:45 +0000</pubDate>
			<description>I am writing a few webpages and i want to use some php in one of them. The problem is that my php code never displays an ouput even of the simplist form. I have this very basic code: &lt;html&gt; &lt;head&gt;&lt;/head&gt; &lt;body class=&quot;page_bg&quot;&gt; Hello, today is &lt;?php print(&quot;Hello&quot;); ?&gt;. &lt;/body&gt; ...</description>
			<content:encoded><![CDATA[ <p>I am writing a few webpages and i want to use some php in one of them. The problem is that my php code never displays an ouput even of the simplist form.</p>

<p>I have this very basic code:</p>

<pre><code>&lt;html&gt;
 &lt;head&gt;&lt;/head&gt;
 &lt;body class="page_bg"&gt;
 Hello, today is &lt;?php print("Hello"); ?&gt;.
 &lt;/body&gt;
 &lt;/html&gt;
</code></pre>

<p>It doesnt display hello. I have other more complex webpages that just doesnt seem to do anything.<br />
I am using win 7 and internet explorer 9 (or 10, not sure).<br />
How do I fix this?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>MasterHacker110</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454729/php-does-not-seem-to-work-on-my-browser</guid>
		</item>
				<item>
			<title>Errors in PHP</title>
			<link>http://www.daniweb.com/web-development/php/threads/454716/errors-in-php</link>
			<pubDate>Thu, 16 May 2013 06:04:46 +0000</pubDate>
			<description>What are the different types of error in PHP?</description>
			<content:encoded><![CDATA[ <p>What are the different types of error in PHP?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>chrispitt</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454716/errors-in-php</guid>
		</item>
				<item>
			<title>php</title>
			<link>http://www.daniweb.com/web-development/php/threads/454712/php</link>
			<pubDate>Thu, 16 May 2013 05:01:02 +0000</pubDate>
			<description>i want to install php but i don'y know how plz give me guide and all the things that i need plz provide complete instalation here???</description>
			<content:encoded><![CDATA[ <p>i want to install php but i don'y know how plz give me guide and all the things that i need plz provide complete instalation here???</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>mr.unknown</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454712/php</guid>
		</item>
				<item>
			<title>Dynamically edit html table php/jquery</title>
			<link>http://www.daniweb.com/web-development/php/threads/454704/dynamically-edit-html-table-phpjquery</link>
			<pubDate>Wed, 15 May 2013 22:51:35 +0000</pubDate>
			<description>Hi guys, I have php code that generates a table based on the results of a mysql query. My questions is how do I update edit the html table row and push the changes to a mysql table? I am using this example: http://bootsnipp.com/snipps/table-with-users The thing I am trying to ...</description>
			<content:encoded><![CDATA[ <p>Hi guys,</p>

<p>I have php code that generates a table based on the results of a mysql query. My questions is how do I update edit the html table row and push the changes to a mysql table? I am using this example: <a href="http://bootsnipp.com/snipps/table-with-users" rel="nofollow">http://bootsnipp.com/snipps/table-with-users</a> The thing I am trying to avoid is to call another page. I would like to give the user the ability to edit the data on the same page rather than drilling down into another one. Here is a snippit of my table build:</p>

<pre><code>while($row = array($getResults))
{
    $stat;
    if($row['status'] == 0)
    $stat = "&lt;span class='label label-success'&gt;User&lt;/span&gt;";
    else if($row['status']  == 1)
    $stat = "&lt;span class='label label-warning'&gt;Club Admin&lt;/span&gt;";
    else if($row['status']  == 3)
    $stat = "&lt;span class='label label-important'&gt;Banned&lt;/span&gt;";
    else
    $stat = "&lt;span class='label label-info'&gt;System Admin&lt;/span&gt;";

    echo "&lt;tr&gt;
    &lt;td&gt;" . $row['username'] . "&lt;/td&gt;".
    "&lt;td style='text-align:center'&gt;" . $row['fullName'] . "&lt;/td&gt;".
    "&lt;td style='text-align:center'&gt;" . $stat . "&lt;/td&gt;".
    "&lt;td style='text-align:left'&gt;&lt;a href='#'&gt;&lt;i class='icon-pencil'&gt;&lt;/i&gt;&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;";
}
</code></pre>

<p>On the last column of '&lt;td style='text-align:left'&gt;&lt;a href='#'&gt;&lt;i class='icon-pencil'&gt;&lt;/i&gt;&lt;/a&gt;&lt;/td&gt;' I would like to generate a modal or just make the row fields editable and then update the changes on the back end. Thanks for your help!</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>while(!success)</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454704/dynamically-edit-html-table-phpjquery</guid>
		</item>
				<item>
			<title>Digital Certificate Login &amp; Http --&gt; PHP</title>
			<link>http://www.daniweb.com/web-development/php/threads/454697/digital-certificate-login-http-php</link>
			<pubDate>Wed, 15 May 2013 21:56:03 +0000</pubDate>
			<description>Hello Guys! I had two questions, but I seem to have forgotten the other, if I remember, I will reply to this thread with it. Sorry. I have no idea what this would be called (maybe digital certificate), however, I saw an awesome feature on the USPTO website (https://ppair.uspto.gov/authenticate/AuthenticateUserLocalEPF.html) where, ...</description>
			<content:encoded><![CDATA[ <p>Hello Guys!</p>

<p>I had two questions, but I seem to have forgotten the other, if I remember, I will reply to this thread with it. Sorry.</p>

<p>I have no idea what this would be called (maybe digital certificate), however, I saw an awesome feature on the USPTO website (<a href="https://ppair.uspto.gov/authenticate/AuthenticateUserLocalEPF.html" rel="nofollow">https://ppair.uspto.gov/authenticate/AuthenticateUserLocalEPF.html</a>) where, in place a username, The user browses their computer for a "document" and they upload that and then type in a password. Does anyone have the proper name for this and then a website explaining it?</p>

<p>Thanks,<br />
Anthony</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>ahudson</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454697/digital-certificate-login-http-php</guid>
		</item>
				<item>
			<title>How to embade logo in html email?</title>
			<link>http://www.daniweb.com/web-development/php/threads/454687/how-to-embade-logo-in-html-email</link>
			<pubDate>Wed, 15 May 2013 17:54:52 +0000</pubDate>
			<description>Hi! Ok, I have tried every pssible way to make this possible but it looks like im running in to cercles... My script simply doesnt want to send embaded logo... It wants to send it as an image like `&lt;img src=&quot;http'//...&quot; /&gt;` but than i have problem with viewing the ...</description>
			<content:encoded><![CDATA[ <p>Hi!</p>

<p>Ok, I have tried every pssible way to make this possible but it looks like im running in to cercles...</p>

<p>My script simply doesnt want to send embaded logo... It wants to send it as an image like <code>&lt;img src="http'//..." /&gt;</code> but than i have problem with viewing the email because client has to download image every time (Outlook 2010/2013) For me it wouldnt be a problem but some clients find it anoying... Can enyone help me? This is my code</p>

<pre><code>global $dal;

$dal_TableName = $dal-&gt;Table("table");

$body="";

foreach(@$keys as $keyblock)

{

  $arr=explode("&amp;",refine($keyblock["id"]));

  if(count($arr)&lt;1)

   continue;

$arr2=array();
$arr2["id"]=urldecode(@$arr[0]);
$where = KeyWhere($arr2);
$rstmp = $dal_TableName-&gt;Query($where,"");
$datatmp=db_fetch_array($rstmp );

$body .= "
&lt;html&gt;
&lt;head&gt;
&lt;style type='text/css'&gt;
table.email {
    border-width: 1px;
    border-spacing: 2px;
    border-style: outset;
    border-color: #cccccc;
    border-collapse: collapse;
    background-color: white;
}

table.email td {
    border-width: 1px;
    padding: 5px;
    border-style: inset;
    border-color: #cccccc;
    background-color: white;
    -moz-border-radius: ;
}
&lt;/style&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;table &gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;
&lt;img src='<a href="http://domain.com/images/logo.gif" rel="nofollow">http://domain.com/images/logo.gif</a>' width='205' /&gt;
&lt;/td&gt;&lt;/tr&gt;

&lt;/tbody&gt;&lt;/table&gt;


&lt;/body&gt;
&lt;/html&gt;
";

}




// send the email

$email= "";
$from = "";
$subject="JOB STATUS UPDATE";

$arr = runner_mail(array('to' =&gt; $email, 'from' =&gt; $from, 'subject' =&gt; $subject, 'htmlbody' =&gt; $body, 'charset' =&gt; 'UTF-8')); 

$result["txt"] = "Email is sent.";



// if error happened print a message on the web page

if (!$arr["mailed"])

{

  $errmsg = "Error happened: &lt;br&gt;";

  $errmsg.= "File: " . $arr["errors"][0]["file"] . "&lt;br&gt;";

  $errmsg.= "Line: " . $arr["errors"][0]["line"] . "&lt;br&gt;";

  $errmsg.= "Description: " . $arr["errors"][0]["description"] . "&lt;br&gt;";

  $result["txt"] = $errmsg;

} 
</code></pre>

<p>Any ideas would be helpful.. I found soo manny tutorials and info how it should be done but none of the things work.. Tried base64 encode and directly placed the encoded image but no luck...</p>

<p>This code however, works...</p>

<pre><code>$to =   '';
$subject =  'PHP Mail Attachment Test';
$bound_text =   "test";
$bound =    "--".$bound_text."\r\n";
$bound_last =   "--".$bound_text."--\r\n";

$headers =  "From: admin@server.com\r\n";
$headers .=     "MIME-Version: 1.0\r\n"
    ."Content-Type: multipart/mixed; boundary=\"$bound_text\"";

$body .=    "If you can see this MIME than your client doesn't accept MIME types!\r\n"
    .$bound;

$body .=    "Content-Type: text/html; charset=\"iso-8859-1\"\r\n"
    ."Content-Transfer-Encoding: 7bit\r\n\r\n"
    ."&lt;img src=\logo.gif\" /&gt;\r\n"
    ."&lt;table&gt;&lt;tbody&gt;\r\n
&lt;tr&gt;&lt;td&gt;sdfsdfsdf&lt;/td&gt;&lt;/tr&gt;\r\n
&lt;tr&gt;&lt;td&gt;sdasdsadasda&lt;/td&gt;&lt;/tr&gt;\r\n
&lt;/tbody&gt;&lt;/table&gt;\r\n
"
    .$bound;

$file =     file_get_contents("<a href="http://domain.com/logo.gif" rel="nofollow">http://domain.com/logo.gif</a>");

$body .= "Content-Type: image/gif; name=\"logo.gif\"\r\n"
    ."Content-Transfer-Encoding: base64\r\n"
    ."\r\n"
    .chunk_split(base64_encode($file))
    .$bound_last;

if(mail($to, $subject, $body, $headers))
{
     echo 'MAIL SENT';
} else {
     echo 'MAIL FAILED';
}
</code></pre>

<p>but i can nooot get first one to work... if i try to mix it together i get whole email encoded...</p>

<p>Anny ideas would help me allot!</p>

<p>Thank you!</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>dbalas</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454687/how-to-embade-logo-in-html-email</guid>
		</item>
				<item>
			<title>Best PHP Open Source for Social Networking</title>
			<link>http://www.daniweb.com/web-development/php/threads/454678/best-php-open-source-for-social-networking</link>
			<pubDate>Wed, 15 May 2013 13:44:48 +0000</pubDate>
			<description>Friends, Kindly suggest me best PHP Open Source for Social Networking website. Looking forward your best suggestions. Thanks in advance...</description>
			<content:encoded><![CDATA[ <p>Friends,</p>

<p>Kindly suggest me best PHP Open Source for Social Networking website.</p>

<p>Looking forward your best suggestions.</p>

<p>Thanks in advance...</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>mrvijayakumar</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454678/best-php-open-source-for-social-networking</guid>
		</item>
				<item>
			<title>mysql_query result with foreach</title>
			<link>http://www.daniweb.com/web-development/php/threads/454667/mysql_query-result-with-foreach</link>
			<pubDate>Wed, 15 May 2013 12:07:27 +0000</pubDate>
			<description>Hi Im trying to get mysql_query result with foreach set up and i am just planning what i am going to do but I am stuck with adding foreach into my code so far. Basically F field has several different options which are duplicated lots of times, so i need ...</description>
			<content:encoded><![CDATA[ <p>Hi Im trying to get mysql_query result with foreach set up and i am just planning what i am going to do but I am stuck with adding foreach into my code so far.</p>

<p>Basically F field has several different options which are duplicated lots of times, so i need the F field in the WHERE <code>F</code> = to be foreach different option in that field. (HOpe I have explained OK)</p>

<p>If someone could help it would be great Thanks</p>

<pre><code>&lt;?php
$con = mysql_connect("localhost","X","X");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("dbname", $con);

$result = mysql_query("SELECT `A`, `B`, `C`, `D`, `E`, `F`, `G`, `H` FROM TABLE WHERE `F` = 'blar' ORDER BY `H`+0 DESC LIMIT 10") or trigger_error(mysql_error().$sql);

echo "&lt;table cellspacing='0' cellpadding='0' class='altrowstable' id='alternatecolor' width='100%'&gt;


                                   &lt;tr&gt;  
                   &lt;th&gt;A&lt;/th&gt;
                                        &lt;th&gt;B&lt;/th&gt;
                                        &lt;th&gt;C&lt;/th&gt;
                                        &lt;th&gt;D&lt;/th&gt;
                                        &lt;th&gt;E&lt;/th&gt;
                                        &lt;th&gt;F&lt;/th&gt;
                                        &lt;th&gt;G&lt;/th&gt;
                                    &lt;/tr&gt;";
$n = 1;
while($row = mysql_fetch_array($result))
  {
echo"&lt;div id='tab_'.sprintf("%.0f",$n++).'' class='show parent'  style='background-position:99.8% center; background-size: auto 100%; border-radius:0 0 3px 0; -moz-border-radius:0 0 3px 0; -webkit-border-radius:0 0 3px 0; -o-border-radius:0 0 3px 0; display: block;'&gt;
                &lt;div class='col-3'&gt;

                    &lt;div class='table_view'&gt;          
&lt;div class='table_info_head'&gt;
&lt;div class='info_table_outer'&gt;
              &lt;div class="table_info'&gt;

  echo "&lt;tr&gt;";       

echo '&lt;td&gt;' . $row['A'] . ' with other info&gt;&lt;/td&gt;';                           
echo '&lt;td&gt;' . $row['B'] . ' with other info&gt;&lt;/td&gt;';
echo '&lt;td&gt;' . $row['C'] . ' with other info&gt;&lt;/td&gt;';
echo '&lt;td&gt;' . $row['D'] . ' with other info&gt;&lt;/td&gt;';
echo '&lt;td&gt;' . $row['E'] . ' with other info&gt;&lt;/td&gt;';
echo '&lt;td&gt;' . $row['F'] . ' with other info&gt;&lt;/td&gt;';
echo '&lt;td&gt;' . $row['G'] . ' with other info&gt;&lt;/td&gt;';
  echo "&lt;/tr&gt;";
  }
echo "&lt;/table&gt;";

echo "&lt;/div&gt;
            &lt;/div&gt;
&lt;/div&gt;
                    &lt;/div&gt;
            &lt;/div&gt;
&lt;/div&gt;";
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>mpc123</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454667/mysql_query-result-with-foreach</guid>
		</item>
				<item>
			<title>resize thumbnail function</title>
			<link>http://www.daniweb.com/web-development/php/threads/454666/resize-thumbnail-function</link>
			<pubDate>Wed, 15 May 2013 11:57:03 +0000</pubDate>
			<description>I have the following function for resizing to (also) thumbnails, and widht and height for big, smaller and thumbs is fixed sizes, but the problem is this: If an uploaded image is small in dimensions there is a large white space around the thumb to make it a fixed size; ...</description>
			<content:encoded><![CDATA[ <p>I have the following function for resizing to (also) thumbnails, and widht and height for big, smaller and thumbs is fixed sizes, but the problem is this:</p>

<p>If an uploaded image is small in dimensions there is a large white space around the thumb to make it a fixed size; If an uploaded image is too big in dimensions it returns an almost good thumb with little white space.<br />
What I can see is that there is some kind of overlay to make up for the required fixed size which give me an ugly look if uploads are different sizes.</p>

<p>Is there any way to make images and at least the thumb a exact width x height, no matter what the upload size/perspective was?</p>

<pre><code>       public function resizeTo($width, $height) {
        if(osc_use_imagick()) {
            $bg = new Imagick();
            $bg-&gt;newImage($width, $height, 'white');

            $this-&gt;im-&gt;thumbnailImage($width, $height, true);
            $geometry = $this-&gt;im-&gt;getImageGeometry();

            $x = ( $width - $geometry['width'] ) / 2;
            $y = ( $height - $geometry['height'] ) / 2;

            $bg-&gt;compositeImage( $this-&gt;im, imagick::COMPOSITE_OVER, $x, $y );
            $this-&gt;im = $bg;
        } else {
            $w = imagesx($this-&gt;im);
            $h = imagesy($this-&gt;im);

            if(($w/$h)&gt;=($width/$height)) {
                //$newW = $width;
                $newW = ($w &gt; $width)? $width : $w;
                $newH = $h * ($newW / $w);
            } else {
                //$newH = $height;
                $newH = ($h &gt; $height)? $height : $h;
                $newW = $w * ($newH / $h);
            }

            $newIm = imagecreatetruecolor($width,$height);//$newW, $newH);
            imagealphablending($newIm, false);
            $colorTransparent = imagecolorallocatealpha($newIm, 255, 255, 255, 127);
            imagefill($newIm, 0, 0, $colorTransparent);
            imagesavealpha($newIm, true);
            imagecopyresampled($newIm, $this-&gt;im, (($width-$newW)/2), (($height-$newH)/2), 0, 0, $newW, $newH, $w, $h);
            imagedestroy($this-&gt;im);

            $this-&gt;im = $newIm;
        }
        return $this;
    }
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>mjsmitten</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454666/resize-thumbnail-function</guid>
		</item>
				<item>
			<title>Start, Check and End session</title>
			<link>http://www.daniweb.com/web-development/php/threads/454661/start-check-and-end-session</link>
			<pubDate>Wed, 15 May 2013 10:28:08 +0000</pubDate>
			<description>Hello. Please guide me how to start a session when a user clicks on login page and the info finds correct? How to check this session on other pages which i want to secure from unauthorised access? if the session found then open this secure page, otherwise redirect the user ...</description>
			<content:encoded><![CDATA[ <p>Hello.</p>

<p>Please guide me how to start a session when a user clicks on login page and the info finds correct?<br />
How to check this session on other pages which i want to secure from unauthorised access? if the session found then open this secure page, otherwise redirect the user to the index page?<br />
and<br />
How to end this session when user clicks on Logout?</p>

<p>Regards.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>akkbkht</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454661/start-check-and-end-session</guid>
		</item>
				<item>
			<title>One search for all services</title>
			<link>http://www.daniweb.com/web-development/php/threads/454654/one-search-for-all-services</link>
			<pubDate>Wed, 15 May 2013 10:07:14 +0000</pubDate>
			<description>Hello guys , how are you doing ? I want to create a unified search for many services I have, they are on multiple servers, and each one with its own database and contents. I've tried to connect to those database by using IP address but it refuse to connect ...</description>
			<content:encoded><![CDATA[ <p>Hello guys , how are you doing ?<br />
I want to create a unified search for many services I have, they are on multiple servers, and each one with its own database and contents.<br />
I've tried to connect to those database by using IP address but it refuse to connect for security reasons.<br />
How can I achieve something like this ?<br />
I thought in a way to gather all databases in one server then do search on it ,BUT how I can update those DBs frequently ?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>OsaMasw</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454654/one-search-for-all-services</guid>
		</item>
				<item>
			<title>the php part is not displaying.it only displays the output for html.am usin</title>
			<link>http://www.daniweb.com/web-development/php/threads/454648/the-php-part-is-not-displaying.it-only-displays-the-output-for-html.am-usin</link>
			<pubDate>Wed, 15 May 2013 09:20:32 +0000</pubDate>
			<description> &lt;!DOCTYPE html&gt; &lt;html lang=&quot;en&quot;&gt; &lt;head&gt; &lt;title&gt;PHP Test&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;p&gt;This is an HTML line &lt;p&gt; &lt;?php echo “This is a PHP line”?&gt;;`` phpinfo(); ?&gt; &lt;/body&gt;&lt;/html&gt; am newbie please help me.</description>
			<content:encoded><![CDATA[ <pre><code>&lt;!DOCTYPE html&gt;
&lt;html lang="en"&gt;
&lt;head&gt;
&lt;title&gt;PHP Test&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;p&gt;This is an HTML line
&lt;p&gt;
&lt;?php
echo “This is a PHP line”?&gt;;``
phpinfo();
?&gt;
&lt;/body&gt;&lt;/html&gt;
</code></pre>

<p>am newbie please help me.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>SirMahlon</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454648/the-php-part-is-not-displaying.it-only-displays-the-output-for-html.am-usin</guid>
		</item>
				<item>
			<title>PHP 4 and PHP 5</title>
			<link>http://www.daniweb.com/web-development/php/threads/454635/php-4-and-php-5</link>
			<pubDate>Wed, 15 May 2013 06:33:10 +0000</pubDate>
			<description>What is the main difference between PHP 4 and PHP 5?</description>
			<content:encoded><![CDATA[ <p>What is the main difference between PHP 4 and PHP 5?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>chrispitt</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454635/php-4-and-php-5</guid>
		</item>
				<item>
			<title>Wordpress Pods Framework Not Showing Content</title>
			<link>http://www.daniweb.com/web-development/php/threads/454618/wordpress-pods-framework-not-showing-content</link>
			<pubDate>Tue, 14 May 2013 21:30:24 +0000</pubDate>
			<description>On my client’s test website at http://cjcdigital.net/selfImprovement/blog/goal/test/ (that’s a direct link to the pod) I’m having an issue where despite installing Pods and configuring it as per this tutorial http://www.openscriptsolution.com/cms/wordpress/pods-2-0-how-to-display-pods-item-using-pods-page-and-pods-template/ I’m having an issue where nothing will display on the pods page, including various echo statements I tossed in my ...</description>
			<content:encoded><![CDATA[ <p>On my client’s test website at <a href="http://cjcdigital.net/selfImprovement/blog/goal/test/" rel="nofollow">http://cjcdigital.net/selfImprovement/blog/goal/test/</a> (that’s a direct link to the pod) I’m having an issue where despite installing Pods and configuring it as per this tutorial <a href="http://www.openscriptsolution.com/cms/wordpress/pods-2-0-how-to-display-pods-item-using-pods-page-and-pods-template/" rel="nofollow">http://www.openscriptsolution.com/cms/wordpress/pods-2-0-how-to-display-pods-item-using-pods-page-and-pods-template/</a><br />
I’m having an issue where nothing will display on the pods page, including various echo statements I tossed in my pods code to see if anything would show.</p>

<p>Ultimately I’m not sure if I need to tweak the WordPress core or if the Pods plugin handles everything however since the previously mentioned tutorial is the only one I could find on Pods pages and displaying the content I’m very stumped.</p>

<p>I also tried using PHP to call the ID of the various fields from the pods – that also failed. I currently am using the latest version of WordPress and it is a Buddypress/Multisite setup so I’m not sure if that might be causing any issues.</p>

<p>Any assistance is greatly appreciated.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>theonlylos</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454618/wordpress-pods-framework-not-showing-content</guid>
		</item>
				<item>
			<title>What does it take to build a cloud-based SaaS Web app?</title>
			<link>http://www.daniweb.com/web-development/php/threads/454616/what-does-it-take-to-build-a-cloud-based-saas-web-app</link>
			<pubDate>Tue, 14 May 2013 20:43:28 +0000</pubDate>
			<description>Hi everyone, I joined this forum because I was hoping to learn from experts in programming. I know next to nothing about it. I want to develop a web app for lawyers, and plan to outsource it's development to a programmer. But I have no idea what I should look ...</description>
			<content:encoded><![CDATA[ <p>Hi everyone, I joined this forum because I was hoping to learn from experts in programming. I know next to nothing about it.</p>

<p>I want to develop a web app for lawyers, and plan to outsource it's development to a programmer. But I have no idea what I should look for, what language I want it to be programmed, what things I need to start a SaaS company. Can anyone help please?</p>

<p>I didn't know what topic to post this in so I posted it here, please let me know if you would like me to post this somewhere else.</p>

<p>I guess I'll organize this into a number of questions</p>

<p>1) What requirements are needed to have a SaaS website? I heard I need a server so I was planning on using Amazon's cloud service. But I hear I need something like an SSL (don't know what that is).</p>

<p>2) Should I look for a specific language that I want my programmers to program in? If so what would be the best language to save on time for it to be built?</p>

<p>Thank you guys.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>neville.solomon2</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454616/what-does-it-take-to-build-a-cloud-based-saas-web-app</guid>
		</item>
				<item>
			<title>Zend Framework environment: production returns an error</title>
			<link>http://www.daniweb.com/web-development/php/threads/454611/zend-framework-environment-production-returns-an-error</link>
			<pubDate>Tue, 14 May 2013 19:37:13 +0000</pubDate>
			<description>Hello. I have created a new Zend project, created a new model class to get some data from the database. If the environment is set to 'development', the data from the database are displayed properly in the browser, but after setting the environment to 'production', the following error appears: **An ...</description>
			<content:encoded><![CDATA[ <p>Hello. I have created a new Zend project, created a new model class to get some data from the database. If the environment is set to 'development', the data from the database are displayed properly in the browser, but after setting the environment to 'production', the following error appears:</p>

<p><strong>An error occurred</strong></p>

<p><strong>Application error</strong></p>

<p>Can anybody please help to find out the problem?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>eburlea</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454611/zend-framework-environment-production-returns-an-error</guid>
		</item>
				<item>
			<title>Query database when a link has been clicked</title>
			<link>http://www.daniweb.com/web-development/php/threads/454609/query-database-when-a-link-has-been-clicked</link>
			<pubDate>Tue, 14 May 2013 18:49:47 +0000</pubDate>
			<description>I'm retrieving products from my database and listing them in a while loop. Like this &lt;?php while($row = mysql_fetch_row($result)){ echo '&lt;div class=&quot;product_info&quot;&gt;'; echo '&lt;div class=&quot;category_product_title&quot;&gt;&lt;a href=&quot;category-page.php&quot;&gt;Product&lt;/a&gt;'; echo '&lt;/div&gt;'; echo '&lt;div class=&quot;category_product_number&quot;&gt;#'.$row[0].'('.$row[1].')'.'&lt;/div&gt;';//prints id and name echo '&lt;div class=&quot;category_product_description&quot;&gt;'.$row[2].'&lt;/div&gt;';//prints description echo '&lt;div class=&quot;category_product_price&quot;&gt;'.$row[4].'TL&lt;/div&gt;';//prints price echo '&lt;div class=&quot;category_details&quot;&gt;&lt;a href=&quot;productpage2.php&quot;&gt;DETAILS&lt;/a&gt;&lt;/div&gt;';//The link to list the ...</description>
			<content:encoded><![CDATA[ <p>I'm retrieving products from my database and listing them in a while loop. Like this</p>

<pre><code>&lt;?php
      while($row = mysql_fetch_row($result)){

        echo '&lt;div class="product_info"&gt;';
         echo '&lt;div class="category_product_title"&gt;&lt;a href="category-page.php"&gt;Product&lt;/a&gt;';
         echo '&lt;/div&gt;';
          echo '&lt;div class="category_product_number"&gt;#'.$row[0].'('.$row[1].')'.'&lt;/div&gt;';//prints id and name
         echo '&lt;div class="category_product_description"&gt;'.$row[2].'&lt;/div&gt;';//prints description
         echo '&lt;div class="category_product_price"&gt;'.$row[4].'TL&lt;/div&gt;';//prints price
          echo '&lt;div class="category_details"&gt;&lt;a href="productpage2.php"&gt;DETAILS&lt;/a&gt;&lt;/div&gt;';//The link to   list the product details
        echo '&lt;/div&gt;';
        echo '&lt;/div&gt;';
     }
?&gt;
</code></pre>

<p>I want to be able to print more details on a paticular prodcut when the "DETAILS" link is clicked by getting the id or name of that paticular product and using to query the database. Since i'm retrieving these products in a loop, i'm not sure how to get the id or the name of a clicked product. I would appreciate any help thanks.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>dhani09</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454609/query-database-when-a-link-has-been-clicked</guid>
		</item>
			</channel>
</rss>