<?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			Solved Articles
					</title>
		<link>http://www.daniweb.com/web-development/php/solved/_/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/solved" xmlns="http://www.w3.org/2005/Atom" />
		<!-- End Of PubSubHubbub Discovery -->
				<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>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>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>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>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>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>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>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>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>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>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 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>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>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>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>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>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>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>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>
				<item>
			<title>Allowing users to download files after liking Facebook page</title>
			<link>http://www.daniweb.com/web-development/php/threads/454584/allowing-users-to-download-files-after-liking-facebook-page</link>
			<pubDate>Tue, 14 May 2013 11:03:32 +0000</pubDate>
			<description>Hi all, Currently am developing a wordpress blog to download free resouces. I need a pure PHP script that allow useres to download files after liking my facebook page/follow my twitter page. Thanks in advance...</description>
			<content:encoded><![CDATA[ <p>Hi all,</p>

<p>Currently am developing a wordpress blog to download free resouces.</p>

<p>I need a pure PHP script that allow useres to download files after liking my facebook page/follow my twitter page.</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/454584/allowing-users-to-download-files-after-liking-facebook-page</guid>
		</item>
				<item>
			<title>Wordpress development concept question</title>
			<link>http://www.daniweb.com/web-development/php/threads/454576/wordpress-development-concept-question</link>
			<pubDate>Tue, 14 May 2013 08:51:21 +0000</pubDate>
			<description>Howdy, I'm a relatively experienced PHP developer looking to start building websites in Wordpress. I have previously built my own simple theme consisting of an index page that contains a bunch of posts and a template that is used for single posts with comments etc. I wouldn't say I'm very ...</description>
			<content:encoded><![CDATA[ <p>Howdy,</p>

<p>I'm a relatively experienced PHP developer looking to start building websites in Wordpress. I have previously built my own simple theme consisting of an index page that contains a bunch of posts and a template that is used for single posts with comments etc. I wouldn't say I'm very experienced with Wordpress but I wouldn't say I'm completely new to it.</p>

<p>Anyway my question is better explained with an example. Say I was to build a website for a garage that does repairs, MOTs (An annual vehicle inspection for a vehicle to be declared road safe in the UK), sells used cars etc. I understand that I can create page templates and use them for different types of pages and incorporate Wordpress' blogging system into the website without any trouble.</p>

<p>However, say I wanted to develop a used car system where the owner of the site can add cars (Each individual detail of the car: mileage, year, make, model, colour, date of MOT, transmission, engine size etc.) that he/she has for sale at the garage. My initial plan would be to add a category for cars, create a post for each car and assign them to that category.</p>

<p>My problem is that I want to be able to pull out each different piece of information for each car both on the actual car page and the car listings page. For example, I would like to pull out the mileage, make, model and price etc. all separately and style them exactly how I want. In a Wordpress post there are no fields for all of these individual pieces of information, so I can't get my head around how I would approach this.</p>

<p>Essentially what I would need is a bit in the CMS to "add a car" such that I can give fields for the owner to input each piece of information about the car separately which would allow me to simply pull out each field by itself. Is this something Wordpress can do? Perhaps I could extend the system in a way that allows me to add a car and provide a number of fields that I can use.</p>

<p>How would you approach this problem?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>bops</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454576/wordpress-development-concept-question</guid>
		</item>
				<item>
			<title>Argent please help </title>
			<link>http://www.daniweb.com/web-development/php/threads/454547/argent-please-help-</link>
			<pubDate>Mon, 13 May 2013 21:22:54 +0000</pubDate>
			<description> &lt;td width=&quot;186&quot; align=&quot;right&quot;&gt;&lt;label for=&quot;collegetxt&quot;&gt;&lt;/label&gt; &lt;select name=&quot;collegecategory&quot; dir=&quot;rtl&quot; id=&quot;collegecategory&quot; class=&quot;title&quot;&gt; &lt;option value=&quot;-1&quot;&gt;Choose college&lt;/option&gt; &lt;?php $rs=$db-&gt;GetAllCollegCategory(); while(list($name)=mysql_fetch_array($rs)){ echo &quot;&lt;option &quot;.($collegSearch==$name?&quot; selected=selected &quot;:&quot;&quot;).&quot; value='$name'&gt;$name&lt;/option&gt;&quot;; } ?&gt; &lt;/select&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;strong&gt;Teacher Number:&lt;/strong&gt;&lt;/td&gt; &lt;td width=&quot;217&quot; align=&quot;right&quot;&gt;&lt;label for=&quot;Teachesearch&quot;&gt;&lt;/label&gt; &lt;label for=&quot;TeacherNo&quot;&gt;&lt;/label&gt; &lt;input type=&quot;text&quot; name=&quot;TeacherNo&quot; id=&quot;TeacherNo&quot; class=&quot;title&quot; checked=&quot;checked&quot;/&gt;&lt;/td&gt; &lt;input type=&quot;submit&quot; name=&quot;evlBtn1&quot; id=&quot;evlBtn1&quot; value=&quot;Evaluate&quot; style=&quot;width:119px;height:39px;font-size:16px;&quot; /&gt; Hi, ...</description>
			<content:encoded><![CDATA[ <pre><code>    &lt;td width="186" align="right"&gt;&lt;label for="collegetxt"&gt;&lt;/label&gt;
  &lt;select name="collegecategory"  dir="rtl" id="collegecategory" class="title"&gt;
                &lt;option value="-1"&gt;Choose college&lt;/option&gt;
              &lt;?php

                $rs=$db-&gt;GetAllCollegCategory();
                while(list($name)=mysql_fetch_array($rs)){
                    echo "&lt;option ".($collegSearch==$name?" selected=selected ":"")." value='$name'&gt;$name&lt;/option&gt;";
             } ?&gt;

        &lt;/select&gt;
        &lt;/td&gt;

      &lt;/tr&gt;
      &lt;tr&gt;
      &lt;td&gt; &lt;strong&gt;Teacher Number:&lt;/strong&gt;&lt;/td&gt;
      &lt;td width="217" align="right"&gt;&lt;label for="Teachesearch"&gt;&lt;/label&gt;
        &lt;label for="TeacherNo"&gt;&lt;/label&gt;
        &lt;input type="text" name="TeacherNo" id="TeacherNo" class="title" checked="checked"/&gt;&lt;/td&gt;
        &lt;input type="submit" name="evlBtn1" id="evlBtn1" value="Evaluate" style="width:119px;height:39px;font-size:16px;" /&gt;
</code></pre>

<p>Hi,<br />
 i don't know how to keep the &lt;input type="text"/&gt; selected whenever i've pressed the Evaluate button<br />
as  the &lt;select&gt; value above was seleced ?!!</p>

<p>how can i keep it checked or selected..?!!</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>Nirmeen Ased</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454547/argent-please-help-</guid>
		</item>
				<item>
			<title>Getting dependant data from two tables</title>
			<link>http://www.daniweb.com/web-development/php/threads/454543/getting-dependant-data-from-two-tables</link>
			<pubDate>Mon, 13 May 2013 20:38:43 +0000</pubDate>
			<description>Hi Guys I'm trying to create a page which uses session data to find a user in a database and then sends the events that this user has signed up to. I'm a bit of a newbie and have got very confused with where I am at. I am using ...</description>
			<content:encoded><![CDATA[ <p>Hi Guys</p>

<p>I'm trying to create a page which uses session data to find a user in a database and then sends the events that this user has signed up to. I'm a bit of a newbie and have got very confused with where I am at. I am using two different tables to get the data, and this is where I'm getting confused. I'm not getting any errors but I'm not recieving any Events. Thanks in Advance</p>

<pre><code>&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;?php
session_start();
?&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=iso-8859-1" /&gt;
&lt;title&gt;Untitled Document&lt;/title&gt;
&lt;/head&gt;
&lt;?php

$username = $_SESSION['username'];
$email = $_SESSION['user_email'];

$con=mysqli_connect("localhost","emuas","******","EMUAS_signUp");
// Check connection
if (mysqli_connect_errno())
  {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
  }

echo "&lt;table&gt;
&lt;tr&gt;
&lt;td&gt; Logged in as:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;th&gt;" . $username . "&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;th&gt;Event&lt;/th&gt;
&lt;/tr&gt;";

$find = mysqli_query($con,"SELECT * FROM SIGN_UP_TEST WHERE User = '$username'");

while($find_row = mysqli_fetch_array($find)){
    //Get Event ID
    $eventId = $find_row['EventID'];
    //Use Event ID to get Event Name
   $result = mysqli_query($con,"SELECT * TEST WHERE EventID = $eventId ORDER BY StartDate");
//Insert Event Name into table with link from Page Name
while($row = mysqli_fetch_array($result))
  {
  echo "&lt;tr&gt;";
  echo "&lt;td&gt; &lt;a href='<a href="http://www.emuas.co.uk/members/sign_up_sheets/S" rel="nofollow">http://www.emuas.co.uk/members/sign_up_sheets/S</a>" . $row['PageName'] . ".php'&gt;" . $row["EventName"] . "&lt;/a&gt; &lt;/td&gt;";
  echo "&lt;/tr&gt;";
  }
  }
echo "&lt;/table&gt;";

?&gt;
&lt;body&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>bfitzgerald</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454543/getting-dependant-data-from-two-tables</guid>
		</item>
				<item>
			<title>PHP log in system with phpBB Forum</title>
			<link>http://www.daniweb.com/web-development/php/threads/454534/php-log-in-system-with-phpbb-forum</link>
			<pubDate>Mon, 13 May 2013 18:25:31 +0000</pubDate>
			<description>Hi guys I'm trying to create a login system on my site that uses the login information from my phpBB forum. I'm having trouble retrieving the password hash from the forum database. I'm a bit of a newbie to php so am a bit lost. Thanks in advanced. &lt;?php //include ...</description>
			<content:encoded><![CDATA[ <p>Hi guys</p>

<p>I'm trying to create a login system on my site that uses the login information from my phpBB forum. I'm having trouble retrieving the password hash from the forum database. I'm a bit of a newbie to php so am a bit lost. Thanks in advanced.</p>

<pre><code>&lt;?php

//include functions.php/function.php
include ("functions.php");

//ob
ob_start();

//session
session_start();

$username = addslashes(strip_tags(strtolower($_POST['username'])));
$password = addslashes(strip_tags($_POST['password']));

if (empty($username) == FALSE &amp;&amp; empty($password) == FALSE) {

//connect
  $con=mysqli_connect("localhost","client106959","******","EMUAS");
// Check connection
if (mysqli_connect_errno())
  {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
  }
$find = mysqli_query($con, "SELECT * FROM user WHERE username_clean='$username'"); 
$find_row = mysqli_fetch_array($find);
//grab password
$password_hash = $find_row['user_password'];


echo ($username);
echo ($password);
echo ($password_hash);
}
else{
    echo ('&lt;script type="text/javascript"&gt;
 alert("Please Enter a Username and Password");
  &lt;/script&gt;');
  header("Location: {$_SERVER['HTTP_REFERER']}");
  }

mysqli_close($con);

?&gt;
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>bfitzgerald</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454534/php-log-in-system-with-phpbb-forum</guid>
		</item>
				<item>
			<title>PHP SCRIPT Insert 0 values into MYSQL </title>
			<link>http://www.daniweb.com/web-development/php/threads/454509/php-script-insert-0-values-into-mysql-</link>
			<pubDate>Mon, 13 May 2013 13:00:33 +0000</pubDate>
			<description>Hello guys, Long story short, when I register a user on my website, it enters for every single column value 0. It should be due to the fact that's not picking up the data from my registration page? Although, it should be ok as I am only picking up the ...</description>
			<content:encoded><![CDATA[ <p>Hello guys,</p>

<p>Long story short, when I register a user on my website, it enters for every single column value 0.</p>

<p>It should be due to the fact that's not picking up the data from my registration page? Although, it should be ok as I am only picking up the value....</p>

<p>Any help would appriciated.</p>

<pre><code>&lt;?php
session_start();
error_reporting (E_ALL ^ E_NOTICE);

echo '&lt;head&gt;';

echo ' &lt;link rel="stylesheet" TYPE="text/css" HREF="css/style.css"/&gt;';

echo '&lt;/head&gt;';
// for error handling
ini_set('session.bug_compat_42',0);
ini_set('session.bug_compat_warn',0);
error_reporting(-1);
ini_set('display_errors', 'On');
$errorMessage = "";

$ename = $_POST["ename"];
$epass  = $_POST["epass"];
$cpass  = $_POST["cpass"];
$CompanyName = $_POST["CompanyName"];
$CompanyCountry = $_POST["CompanyCountry"];
$CompanyState = $_POST["CompanyState"];
$CompanyZip = $_POST["CompanyZip"];
$CompanyCity = $_POST["CompanyCity"];
$CompanyAddress = $_POST["CompanyAddress"]; 
$CompanyPhone = $_POST["CompanyPhone"];
$CompanyPhone2 = $_POST["CompanyPhone2"]; 
$CompanyEmail = $_POST["CompanyEmail"];




$conn = mysql_connect("localhost", "root", "") or die("cannot connect"); 
mysql_select_db("recruiting") or die (mysql_error());




if ($epass == $cpass) 
{
   if(!empty($ename) &amp;&amp; !empty($epass) &amp;&amp; !empty($CompanyName) &amp;&amp; !empty($CompanyCountry)  &amp;&amp; !empty($CompanyZip) &amp;&amp; !empty($CompanyCity) &amp;&amp; !empty($CompanyAddress) &amp;&amp; !empty($CompanyPhone) &amp;&amp; !empty($CompanyEmail))
   {
    $q1 = ("INSERT INTO job_employer_info
    (ename, 
    epass,
    CompanyName, 
    CompanyCountry, 
    CompanyState, 
    CompanyZip, 
    CompanyCity, 
    CompanyAddress, 
    CompanyPhone, 
    CompanyPhone2, 
    CompanyEmail)
         VALUES(
         ename = '$ename', 
        epass = '$epass',
        CompanyName = '$CompanyName', 
        CompanyCountry = '$CompanyCountry', 
        CompanyState = '$CompanyState',
        CompanyZip = '$CompanyZip', 
        CompanyCity = '$CompanyCity', 
        CompanyAddress = '$CompanyAddress', 
        CompanyPhone = '$CompanyPhone', 
        CompanyPhone2 = '$CompanyPhone2', 
        CompanyEmail = '$CompanyEmail')");


    $r1 = mysql_query($q1);

if($r1 == FALSE)
{
    echo "ERROR - No mactching rows from th database!&lt;br/&gt;";
}
else
{


    // Redirect to the main menu
    header ("Location: index.html");

}


//$to = $CompanyEmail;
//$subject = "Your account at yourdomain.com";
//$message = "This is your account information at yourdomain.com\n\n username: $ename\n password: $epass\n\n\n Keep this information in a secure place. \n\n Thanks for your registration. We believe you will find the staff you need at  <a href="http://yourdomain.com" rel="nofollow">http://yourdomain.com</a> ";
//$from = "From: &lt;youremail@youremail.com&gt;";

//mail($to, $subject, $message, $from);

   }    
    else{
    echo "&lt;center&gt;&lt;font color=red&gt;&lt;b&gt; You didn't fill some of the required fields.&lt;br&gt;Go back and fill them correctly, please.&lt;/b&gt;&lt;/font&gt;&lt;/canter&gt;";
    }
}
else
{
    echo "&lt;center&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;font color=red&gt;&lt;b&gt; You have a mistake filling the password/confirm password fields. &lt;br&gt; Go &lt;a class=ERR href=employer_registration.php&gt; back &lt;/a&gt; and fill all them  properly, please.&lt;/b&gt;&lt;/font&gt;&lt;/center&gt;";
}





 mysql_close($conn);
?&gt;
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>SQLpower</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454509/php-script-insert-0-values-into-mysql-</guid>
		</item>
				<item>
			<title>Most uploaded users</title>
			<link>http://www.daniweb.com/web-development/php/threads/454495/most-uploaded-users</link>
			<pubDate>Mon, 13 May 2013 10:12:32 +0000</pubDate>
			<description>hey guys how are you, I want to create a function ( or more than function ) to show most uploaded users in the site, so I've created simpple code to test this and its worked &lt;?php $sql = &quot;SELECT username FROM users&quot;; $run = mysql_query($sql); if (mysql_num_rows($run) &gt; 0 ...</description>
			<content:encoded><![CDATA[ <p>hey guys how are you, I want to create a function ( or more than function ) to show most uploaded users in the site, so I've created simpple code to test this and its worked</p>

<pre><code>&lt;?php
$sql = "SELECT username FROM users";
$run = mysql_query($sql);
if (mysql_num_rows($run) &gt; 0 ) {
while ($data = mysql_fetch_assoc($run)) {
$sql2 = "SELECT addedby FROM files WHERE addedby = '".$data['username']."' ";
$run2 = mysql_query($sql2);
echo $data['username']." uploaded :  ". mysql_num_rows($run2)." files";
echo "&lt;br/&gt;";
}
}
?&gt;
</code></pre>

<p>and the output was somthing like this<br />
user1 uploaded : 5 files<br />
user2 uploaded : 50 files<br />
and so on .....<br />
I need to minimize this huge sql since my site contain more than 3000 users so I need to show only most <strong>20</strong> users that have uploaded on site.</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/454495/most-uploaded-users</guid>
		</item>
				<item>
			<title>wpml plugin not working for some labels on front end please help </title>
			<link>http://www.daniweb.com/web-development/php/threads/454444/wpml-plugin-not-working-for-some-labels-on-front-end-please-help-</link>
			<pubDate>Sun, 12 May 2013 13:11:44 +0000</pubDate>
			<description>wpml plugin not working for some labels on front end please help http://174.120.60.2/~prime/?property=apartment&amp;lang=ar see this link on this bedroom bathroom and property type not translated please helpo me guys i am using wpml plugin</description>
			<content:encoded><![CDATA[ <p>wpml plugin not working for some labels on front end please help</p>

<p><a href="http://174.120.60.2/~prime/?property=apartment&amp;lang=ar" rel="nofollow">http://174.120.60.2/~prime/?property=apartment&amp;lang=ar</a></p>

<p>see this link on this bedroom bathroom and property type not translated please helpo me guys i am using wpml plugin</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>sismaster2010</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454444/wpml-plugin-not-working-for-some-labels-on-front-end-please-help-</guid>
		</item>
				<item>
			<title>Parse SOAP response in php</title>
			<link>http://www.daniweb.com/web-development/php/threads/454428/parse-soap-response-in-php</link>
			<pubDate>Sun, 12 May 2013 02:02:24 +0000</pubDate>
			<description>I'm dealing with a SOAP client response for a flight booking application, I successfully got the response, See the response below: &lt;arzoo__response&gt; &lt;Response__Depart&gt; &lt;OriginDestinationOptions&gt; &lt;OriginDestinationOption&gt; &lt;FareDetails&gt; &lt;ChargeableFares&gt; &lt;ActualBaseFare&gt;4850&lt;/ActualBaseFare&gt; &lt;Tax&gt;4267&lt;/Tax&gt; &lt;STax&gt;31&lt;/STax&gt; &lt;SCharge&gt;0&lt;/SCharge&gt; &lt;TDiscount&gt;0&lt;/TDiscount&gt; &lt;TPartnerCommission&gt;0&lt;/TPartnerCommission&gt; &lt;/ChargeableFares&gt; &lt;NonchargeableFares&gt; &lt;TCharge&gt;0&lt;/TCharge&gt; &lt;TMarkup&gt;0&lt;/TMarkup&gt; &lt;TSdiscount&gt;0&lt;/TSdiscount&gt; &lt;/NonchargeableFares&gt; &lt;/FareDetails&gt; &lt;FlightSegments&gt; &lt;FlightSegment&gt; &lt;AirEquipType&gt;321&lt;/AirEquipType&gt; &lt;ArrivalAirportCode&gt;DEL&lt;/ArrivalAirportCode&gt; &lt;ArrivalDateTime&gt;2013-05-20T08:00:00&lt;/ArrivalDateTime&gt; &lt;DepartureAirportCode&gt;BOM&lt;/DepartureAirportCode&gt; &lt;DepartureDateTime&gt;2013-05-20T06:00:00&lt;/DepartureDateTime&gt; &lt;FlightNumber&gt;601&lt;/FlightNumber&gt; &lt;OperatingAirlineCode&gt;AI&lt;/OperatingAirlineCode&gt; &lt;OperatingAirlineFlightNumber&gt;601&lt;/OperatingAirlineFlightNumber&gt; ...</description>
			<content:encoded><![CDATA[ <p>I'm dealing with a SOAP client response for a flight booking application, I successfully got the response, See the response below:</p>

<pre><code>&lt;arzoo__response&gt;
&lt;Response__Depart&gt;
    &lt;OriginDestinationOptions&gt;
        &lt;OriginDestinationOption&gt;
            &lt;FareDetails&gt;
                &lt;ChargeableFares&gt;
                    &lt;ActualBaseFare&gt;4850&lt;/ActualBaseFare&gt;
                    &lt;Tax&gt;4267&lt;/Tax&gt;
                    &lt;STax&gt;31&lt;/STax&gt;
                    &lt;SCharge&gt;0&lt;/SCharge&gt;
                    &lt;TDiscount&gt;0&lt;/TDiscount&gt;
                    &lt;TPartnerCommission&gt;0&lt;/TPartnerCommission&gt;
                &lt;/ChargeableFares&gt;
                &lt;NonchargeableFares&gt;
                    &lt;TCharge&gt;0&lt;/TCharge&gt;
                    &lt;TMarkup&gt;0&lt;/TMarkup&gt;
                    &lt;TSdiscount&gt;0&lt;/TSdiscount&gt;
                &lt;/NonchargeableFares&gt;
            &lt;/FareDetails&gt;
            &lt;FlightSegments&gt;
                &lt;FlightSegment&gt;
                    &lt;AirEquipType&gt;321&lt;/AirEquipType&gt;
                    &lt;ArrivalAirportCode&gt;DEL&lt;/ArrivalAirportCode&gt;
                    &lt;ArrivalDateTime&gt;2013-05-20T08:00:00&lt;/ArrivalDateTime&gt;
                    &lt;DepartureAirportCode&gt;BOM&lt;/DepartureAirportCode&gt;
                    &lt;DepartureDateTime&gt;2013-05-20T06:00:00&lt;/DepartureDateTime&gt;
                    &lt;FlightNumber&gt;601&lt;/FlightNumber&gt;
                    &lt;OperatingAirlineCode&gt;AI&lt;/OperatingAirlineCode&gt;
                    &lt;OperatingAirlineFlightNumber&gt;601&lt;/OperatingAirlineFlightNumber&gt;
                    &lt;RPH&gt;&lt;/RPH&gt;
                    &lt;StopQuantity&gt;0&lt;/StopQuantity&gt;
                    &lt;airLineName&gt;Air India&lt;/airLineName&gt;
                    &lt;airportTax&gt;4267&lt;/airportTax&gt;
                    &lt;imageFileName&gt;<a href="http://live.arzoo.com/FlightWS/image/AirIndia.gif" rel="nofollow">http://live.arzoo.com/FlightWS/image/AirIndia.gif</a>&lt;/imageFileName&gt;
                    &lt;viaFlight&gt;&lt;/viaFlight&gt;
                    &lt;BookingClass&gt; 
                        &lt;Availability&gt;4&lt;/Availability&gt;
                        &lt;ResBookDesigCode&gt;U&lt;/ResBookDesigCode&gt;
                    &lt;/BookingClass&gt;
                    &lt;BookingClassFare&gt;
                        &lt;adultFare&gt;4850&lt;/adultFare&gt;
                        &lt;bookingclass&gt;U&lt;/bookingclass&gt;
                        &lt;classType&gt;Economy&lt;/classType&gt;
                        &lt;farebasiscode&gt;fjyS3YyUlEusLfJ4bwgPvQ==&lt;/farebasiscode&gt;
                        &lt;Rule&gt;This fare is Refundable &amp;lt;br&amp;gt; Baggage : 25K&amp;lt;br&amp;gt;Booking Class : U|Re-Schedule Charges: Rs. 750 per sector + Fare difference (If any) +admin fee 500 + Service Fee of Rs. 250 Sector .|Cancellation Charges : Basic fare +Airline administration fee 500 + Service Charges 250 Per Passenger Per Sector . |&lt;/Rule&gt;
                        &lt;adultCommission&gt;0&lt;/adultCommission&gt;
                        &lt;childCommission&gt;0&lt;/childCommission&gt;
                        &lt;commissionOnTCharge&gt;0&lt;/commissionOnTCharge&gt;
                    &lt;/BookingClassFare&gt;
                    &lt;Discount&gt;0&lt;/Discount&gt;
                    &lt;airportTaxChild&gt;0&lt;/airportTaxChild&gt;
                    &lt;airportTaxInfant&gt;0&lt;/airportTaxInfant&gt;
                    &lt;adultTaxBreakup&gt;2800,147,1320&lt;/adultTaxBreakup&gt;
                    &lt;childTaxBreakup&gt;0,0,0&lt;/childTaxBreakup&gt;
                    &lt;infantTaxBreakup&gt;0,0,0&lt;/infantTaxBreakup&gt;
                    &lt;octax&gt;0&lt;/octax&gt;
                &lt;/FlightSegment&gt; 
            &lt;/FlightSegments&gt;
            &lt;id&gt;arzoo11&lt;/id&gt;
            &lt;key&gt;wtZcSVMY/gphWFSOTFWg8oKRnosq3p9wt7R4SjMB0EUK8sDjVS91GicTJzH+TWN+pNURIyTJYKOW O8yH8+0tzpA4t8aEEvzaOE6ZnTtBotFDwLtSiN0xXqMsaDl8diV51l7d9ata/3rxTgfh9d8ZSmFY VI5MVaDywdHNcjAR1vwnEycx/k1jftlsnmWWqYGnJxMnMf5NY36YIq2FtLkfcHtsd+IDEhxpxJuT v4YyS+QnEycx/k1jftlsnmWWqYGnJxMnMf5NY37ZbJ5llqmBpycTJzH+TWN+GlZsae+KA6L3dlms eLkXZFKXPvd5FAnBXnTfRGc5sz+UC8CsZNzDV2FYVI5MVaDyFiThuG7WKPhzqWDbQb1E1IqUKT5I FtF6OaCYjb6EFGhDwLtSiN0xXt7N3OmPGVH2v18OFlhFoI+A/uAfnTovYr9fDhZYRaCPgP7gH506 L2K/Xw4WWEWgj4D+4B+dOi9iv18OFlhFoI+A/uAfnTovYr9fDhZYRaCPgP7gH506L2K/Xw4WWEWg j4D+4B+dOi9iv18OFlhFoI/87KPqwdBsCm4nF4DlZwRNQ/zni8QE42g8S0GV1z3SJXaOdoTFisn9 v18OFlhFoI+ThOYsjNAbXEP854vEBONoPEtBldc90iVD/OeLxATjaAwTg0ygCEBmEgnKEhG4Md1D /OeLxATjaDxLQZXXPdIlQ/zni8QE42jXGTnbB/ydvR4daAuN34kWYVhUjkxVoPJtRWbi6bZrXL9f DhZYRaCPgP7gH506L2K/Xw4WWEWgj4D+4B+dOi9iv18OFlhFoI8KriAmVoEyR3OpYNtBvUTUp1Mf I240+obPusGaAOeuxg==&lt;/key&gt;
        &lt;/OriginDestinationOption&gt;
    &lt;/OriginDestinationOptions&gt;
&lt;/Response__Depart&gt;
&lt;/arzoo__response&gt;
</code></pre>

<p>Now i have to display them as :</p>

<p>Base Price: 4850<br />
Tax: 31<br />
STax: 31<br />
SCharge: 0<br />
TDiscount: 0<br />
TPartnerCommission: 0<br />
.....................<br />
Arrival Airport Code: DEL<br />
.....................</p>

<p>I tried several methods using <code>foreach()</code>:</p>

<pre><code>   $result = $client-&gt;__call('getAvailability',array($test));   
   $xml = simplexml_load_string($result);
    foreach($xml-&gt;OriginDestinationOption as $od){
        foreach($od-&gt;FareDetails as $fd){
            foreach($fd-&gt;ChargeableFares as $cf){
                echo $cf-&gt;ActualBaseFare;
            }
        }
    }
</code></pre>

<p>but never sot it out. Can any one please help me out on this ?<br />
Your help must appreciated. Thanks in advance</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>rayidi</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454428/parse-soap-response-in-php</guid>
		</item>
				<item>
			<title>PHP getting rid of certaint charecters</title>
			<link>http://www.daniweb.com/web-development/php/threads/454426/php-getting-rid-of-certaint-charecters</link>
			<pubDate>Sun, 12 May 2013 01:32:02 +0000</pubDate>
			<description>So i have created this code that is grabing info from a server, the string that it is giving me has these specail charecters that i need to get rid of, then I need to exploade it by another. Here is my code: function fetch_server_info($ip, $port){ $socket = @fsockopen($ip, $port, ...</description>
			<content:encoded><![CDATA[ <p>So i have created this code that is grabing info from a server, the string that it is giving me has these specail charecters that i need to get rid of, then I need to exploade it by another.</p>

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

<pre><code>function fetch_server_info($ip, $port){
$socket = @fsockopen($ip, $port, $errno, $errstr, 0.5);

if($socket === false){
return false;
}

fwrite($socket, "\xfe");

$data = fread($socket, 256);

if(substr($data, 0, 1) != "\xff"){
return false;
}

$data = mb_convert_encoding(substr($data, 3), 'utf-8', 'UCS-2');

var_dump($data);

/*return array(
'motd' =&gt; $data[0],
'players' =&gt; intval($data[1]),
'max_players' =&gt; intval($data[2]),
);*/
}
</code></pre>

<p>and here is the string that i am geting: string(46) "Â§4MineÂ§bMad Â§4Multi-World Â§f[1.5.1]Â§3Â§15"</p>

<p>I need to take out the Â's the 4's the lower case b and f and i need to explode it by the §, but I know how to explode it bye that but first I need to take out the other stuff.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>SureEM25</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454426/php-getting-rid-of-certaint-charecters</guid>
		</item>
				<item>
			<title>Sending post data using SOAP in php for a flight search api</title>
			<link>http://www.daniweb.com/web-development/php/threads/454364/sending-post-data-using-soap-in-php-for-a-flight-search-api</link>
			<pubDate>Fri, 10 May 2013 23:28:52 +0000</pubDate>
			<description>I'm curremtly working on a project &quot;Flight search&quot; with SOAP and PHP. I'm new to this SOAP Technology. I've to send the XML over POST Request and get the response: &lt;Request&gt; &lt;Origin&gt;BOM&lt;/Origin&gt; &lt;Destination&gt;DEL&lt;/Destination&gt; &lt;DepartDate&gt;2013-05-20&lt;/DepartDate&gt; &lt;ReturnDate&gt;2013-05-21&lt;/ReturnDate&gt; &lt;AdultPax&gt;1&lt;/AdultPax&gt; &lt;ChildPax&gt;0&lt;/ChildPax&gt; &lt;InfantPax&gt;0&lt;/InfantPax&gt; &lt;Currency&gt;INR&lt;/Currency&gt; &lt;Clientid&gt;*********&lt;/Clientid&gt; &lt;Clientpassword&gt;**************************&lt;/Clientpassword&gt; &lt;Clienttype&gt;ArzooFWS1.1&lt;/Clienttype&gt; &lt;Preferredclass&gt;E&lt;/Preferredclass&gt; &lt;mode&gt;ONE&lt;/mode&gt; &lt;PreferredAirline&gt;AI&lt;/PreferredAirline&gt; &lt;/Request&gt; to the URL: &gt; ...</description>
			<content:encoded><![CDATA[ <p>I'm curremtly working on a project "Flight search" with SOAP and PHP. I'm new to this SOAP Technology.</p>

<p>I've to send the XML over POST Request and get the response:</p>

<pre><code>&lt;Request&gt;
&lt;Origin&gt;BOM&lt;/Origin&gt;
&lt;Destination&gt;DEL&lt;/Destination&gt;
&lt;DepartDate&gt;2013-05-20&lt;/DepartDate&gt;
&lt;ReturnDate&gt;2013-05-21&lt;/ReturnDate&gt;
&lt;AdultPax&gt;1&lt;/AdultPax&gt;
&lt;ChildPax&gt;0&lt;/ChildPax&gt;
&lt;InfantPax&gt;0&lt;/InfantPax&gt;
&lt;Currency&gt;INR&lt;/Currency&gt;
&lt;Clientid&gt;*********&lt;/Clientid&gt;
&lt;Clientpassword&gt;**************************&lt;/Clientpassword&gt;
&lt;Clienttype&gt;ArzooFWS1.1&lt;/Clienttype&gt;
&lt;Preferredclass&gt;E&lt;/Preferredclass&gt;
&lt;mode&gt;ONE&lt;/mode&gt;
&lt;PreferredAirline&gt;AI&lt;/PreferredAirline&gt;
&lt;/Request&gt;
</code></pre>

<p>to the URL:</p>

<blockquote>
  <p><a href="http://xx.xxx.xx.xxx/ArzooWS/services/DOMFlightAvailability?wsdl" rel="nofollow">http://xx.xxx.xx.xxx/ArzooWS/services/DOMFlightAvailability?wsdl</a></p>
</blockquote>

<p>Can any one please help ? I'm struggling with this. Thanks in advance.</p>

<p>EDIT: I'm trying the following but its getting error:</p>

<pre><code>$dom_document = simplexml_load_file("availability.xml");

    try{
        $soap_client =
            new soapclient("<a href="http://xx.xxx.xx.xxx/ArzooWS/services/DOMFlightAvailability?wsdl" rel="nofollow">http://xx.xxx.xx.xxx/ArzooWS/services/DOMFlightAvailability?wsdl</a>");
        $availability = $soap_client-&gt;getAvailability($dom_document);
        echo $availability-&gt;getAvailabilityResponse;
    }catch(SoapFault $exception){
        echo $exception-&gt;getMessage();
    }
</code></pre>

<p>The error i'm getting:</p>

<blockquote>
  <p>Notice: Trying to get property of non-object in<br />
  C:\xampp\htdocs\Flight\availability.php on line 9</p>
</blockquote>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>rayidi</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454364/sending-post-data-using-soap-in-php-for-a-flight-search-api</guid>
		</item>
				<item>
			<title>Querying a database</title>
			<link>http://www.daniweb.com/web-development/php/threads/454338/querying-a-database</link>
			<pubDate>Fri, 10 May 2013 14:40:40 +0000</pubDate>
			<description> Just a quick question really, I'm using a database which is for Moodle, and I want to extract the login details for an Android app I am writing so they can login to that database and See their information. Part of it is in PHP... so it's Java &gt; PHP ...</description>
			<content:encoded><![CDATA[ <p>Just a quick question really,</p>

<p>I'm using a database which is for Moodle, and I want to extract the login details for an Android app I am writing so they can login to that database and See their information.</p>

<p>Part of it is in PHP... so it's Java &gt; PHP &gt; Android.</p>

<pre><code>&lt;?php

require_once 'include/config.php';

//Values
    $username_in = $_POST['username'];
    $password_in = $_POST['password'];

    $query = "SELECT * from moodle_user where username ='".$username_in."' AND password = '".$password_in."'";
    $query_exec = mysqli_query($con, $query) or die(mysqli_error($con));

//if and else

    $rows = mysqli_num_rows($query_exec);
    if($rows == 0) {
        echo "No users found";
        mysqli_fetch_row ($con,$query);
    } else {
        echo "Found user: " . $username_in;
    }

        //Make your query and store it in $result

        while ($rows = mysql_fetch_assoc($query_exec))
        {
           echo "usernames: " . $rows['username'];
        }


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

<p>I know for a fact that it is populated: <a href="http://prntscr.com/149dvu" rel="nofollow">http://prntscr.com/149dvu</a><br />
I'm just wondering why it says it's connected but cannot grab the information..</p>

<p>Thanks guys.</p>

<p>P.s</p>

<p>I know I know it's procedural :P I'm sorry!</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/454338/querying-a-database</guid>
		</item>
				<item>
			<title>Image uploader Issues</title>
			<link>http://www.daniweb.com/web-development/php/threads/454292/image-uploader-issues</link>
			<pubDate>Fri, 10 May 2013 03:24:46 +0000</pubDate>
			<description>Hello, I have a php script which detects if an image is vericle or horizontal. Then it resizes it to my certian specifications. An issue is I want the script to resize the image and then create a thumbnail image as well. The script works when resizing an image but ...</description>
			<content:encoded><![CDATA[ <p>Hello, I have a php script which detects if an image is vericle or horizontal. Then it resizes it to my certian specifications. An issue is I want the script to resize the image and then create a thumbnail image as well. The script works when resizing an image but I cant make it create the thumb nail. This is the script.</p>

<pre><code>&lt;?php
include('SimpleImage.php');
//connect to database
        $hostname = "localhost";
        $username = "root";
        $password = "";
        $database = "";
        $con = mysql_connect("$hostname","$username","$password");
        if (!$con)
            {
                die('Could not connect: ' . mysql_error());
            }

        mysql_select_db("$database", $con);




    $id = (md5(time()));
    $thumb = (md5(time()));

    if (isset($_POST['caption'])){
    $caption = $_POST['caption'];
    }
    else{$caption = "";}
    if (isset($_POST['column'])){
    $column = $_POST['column'];
    }
    else{header('location:imageuploader.php');}
    if (isset($_POST['slide'])){
    $slide = $_POST['slide'];
    }
    else{header('location:imageuploader.php');}
    list($width, $height, $type, $attr) = getimagesize($_FILES['uploaded_image']['tmp_name']);
    if ($width &gt; $height){
            $stance = "h";
            $image = new SimpleImage();
    $image-&gt;load($_FILES['uploaded_image']['tmp_name']);
    $image-&gt;resizeToWidth(440);
    $image-&gt;save('uploaded_images/'.$id.'.png');

    }
    else{
                $stance = "v";
                $image = new SimpleImage();
    $image-&gt;load($_FILES['uploaded_image']['tmp_name']);
    $image-&gt;resizeToHeight(507);
    $image-&gt;save('uploaded_images/'.$id.'.png');
        }
        //make thumb
        $image = new SimpleImage();
    $image-&gt;load($_FILES['uploaded_image']['tmp_name']);
    $image-&gt;resizeToWidth(150);
    $image-&gt;save('uploaded_images/'.$thumb.'.png');


    $query = "INSERT INTO images
              VALUES(
              NULL,
              '$id',
              '$caption',
              '$stance',
              '$column',
              '$slide',
              '$thumb')          ";
    mysql_query($query);

    echo mysql_error();


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

<p>With this script it only makes the thumbnail but if I remove the thumnail code it will create the larger image. I want it to create both.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>garyjohnson</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454292/image-uploader-issues</guid>
		</item>
				<item>
			<title>File not saved error</title>
			<link>http://www.daniweb.com/web-development/php/threads/454287/file-not-saved-error</link>
			<pubDate>Fri, 10 May 2013 02:38:10 +0000</pubDate>
			<description>Hi there I've uploaded a file to the server online and I can even see the file i uploaded but the problem is that I get &quot;page no found&quot; error when i try to open that file on my url, when I try to edit the file(online on the server) ...</description>
			<content:encoded><![CDATA[ <p>Hi there</p>

<p>I've uploaded a file to the server online and I can even see the file i uploaded but the problem is that I get "page no found" error when i try to open that file on my url, when I try to edit the file(online on the server) I get an error that reads " Status: This file has not yet been saved", which is my main consern. How can I solve this?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>tshukela.george</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454287/file-not-saved-error</guid>
		</item>
				<item>
			<title>Using Pagination with Mysql Queries</title>
			<link>http://www.daniweb.com/web-development/php/threads/454277/using-pagination-with-mysql-queries</link>
			<pubDate>Thu, 09 May 2013 20:13:59 +0000</pubDate>
			<description>I am unable to maintain a GET variable with this pagination script. Was hoping you all could help. I am using a GET function so the user can choose which categories are displayed. I'm using a pagination script I found online and I am now confronted with this issue, when ...</description>
			<content:encoded><![CDATA[ <p>I am unable to maintain a GET variable with this pagination script. Was hoping you all could help.</p>

<p>I am using a GET function so the user can choose which categories are displayed. I'm using a pagination script I found online and I am now confronted with this issue, when I choose "page 2" $dynCat no longer is parsed in the URL because the pagination script creates a new URL and uses GET also.</p>

<p>Could someone help me out with using pagination with a variable query? Thank you.</p>

<p>ERROR  Notice: Undefined index: dynCat ----/dynCat.php on line 32<br />
I understand why it is undefined, I just don't know how to integrate and maintain the user's Query (i.e. GET variable from URL) with the pagination script. Thanks again.</p>

<p>Page1 (User Selects option)</p>

<pre><code>&lt;?php 
//Generate and list Categories
include "storescripts/connect_to_mysql.php"; 
        $dynCat = "";
            $data = mysql_query("SELECT category, id FROM products GROUP BY category") or die(mysql_error());
            while($info = mysql_fetch_array( $data ))
                { 
                $listcategory = $info["category"];
                $dynCat .=
                '
                &lt;li&gt;
                &lt;a href="dynCat.php?dynCat='.$listcategory.'" &gt; '.$listcategory.' &lt;/a&gt; 
                &lt;/li&gt;
                ';
                }   
mysql_close();  
?&gt;


&lt;?php echo $dynCat; ?&gt;
</code></pre>

<p>Page2 dynCat.php (User Views Selection with Pagination)</p>

<pre><code>&lt;?php 
error_reporting(E_ALL);
ini_set('display_errors', '1');
?&gt;

&lt;?php 
//Generate and list Categories

include "storescripts/connect_to_mysql.php"; 
        $dynGallery = "";
        $dynCat = "";
            $data = mysql_query("SELECT category, id FROM products GROUP BY category") or die(mysql_error());
            while($info = mysql_fetch_array( $data ))
                { 
                $listcategory = $info["category"];
                $dynCat .=
                '
                &lt;li&gt;
                &lt;a href="dynCat.php?dynCat='.$listcategory.'" &gt; '.$listcategory.' &lt;/a&gt; 
                &lt;/li&gt;
                ';
                }   
mysql_close();  
?&gt;



&lt;?php
//Query User Selection &amp;  Pagination

    include('storescripts/connect_to_mysql.php');
    $cat = mysql_escape_string($_GET['dynCat']);
    $tableName="products";      
    $targetpage = "dynCat.php";     
    $limit = 3; 
    $query = "SELECT COUNT(*) as num FROM $tableName WHERE category = '$cat'";
    $total_pages = mysql_fetch_array(mysql_query($query));
    $total_pages = $total_pages['num'];

    $stages = 3;
    $page = mysql_escape_string(isset($_GET['page'])) ? mysql_escape_string($_GET['page']) : 0;
    if($page){
        $start = ($page - 1) * $limit; 
    }else{
        $start = 0; 
        }   

    // Get category Data and Images
    $query1 = "SELECT * FROM $tableName WHERE category = '$cat' ORDER BY views DESC LIMIT $start, $limit";
    $result = mysql_query($query1);

    // Initial page num setup
    if ($page == 0){$page = 1;}
    $prev = $page - 1;  
    $next = $page + 1;                          
    $lastpage = ceil($total_pages/$limit);      
    $LastPagem1 = $lastpage - 1;                    

    $paginate = '';
    if($lastpage &gt; 1)
    {   

        $paginate .= "&lt;div class='paginate'&gt;";
        // Previous
        if ($page &gt; 1){
            $paginate.= "&lt;a href='$targetpage?page=$prev#gallery'&gt;previous&lt;/a&gt;";
        }else{
            $paginate.= "&lt;span class='disabled'&gt;previous&lt;/span&gt;"; }

        // Pages    
        if ($lastpage &lt; 7 + ($stages * 2))   // Not enough pages to breaking it up
        {   
            for ($counter = 1; $counter &lt;= $lastpage; $counter++)
            {
                if ($counter == $page){
                    $paginate.= "&lt;span class='current'&gt;$counter&lt;/span&gt;";
                }else{
                    $paginate.= "&lt;a href='$targetpage?page=$counter#gallery'&gt;$counter&lt;/a&gt;";}                  
            }
        }
        elseif($lastpage &gt; 5 + ($stages * 2))   // Enough pages to hide a few?
        {
            // Beginning only hide later pages
            if($page &lt; 1 + ($stages * 2))        
            {
                for ($counter = 1; $counter &lt; 4 + ($stages * 2); $counter++)
                {
                    if ($counter == $page){
                        $paginate.= "&lt;span class='current'&gt;$counter&lt;/span&gt;";
                    }else{
                        $paginate.= "&lt;a href='$targetpage?page=$counter#gallery'&gt;$counter&lt;/a&gt;";}                  
                }
                $paginate.= "...";
                $paginate.= "&lt;a href='$targetpage?page=$LastPagem1#gallery'&gt;$LastPagem1&lt;/a&gt;";
                $paginate.= "&lt;a href='$targetpage?page=$lastpage#gallery'&gt;$lastpage&lt;/a&gt;";     
            }
            // Middle hide some front and some back
            elseif($lastpage - ($stages * 2) &gt; $page &amp;&amp; $page &gt; ($stages * 2))
            {
                $paginate.= "&lt;a href='$targetpage?page=1#gallery'&gt;1&lt;/a&gt;";
                $paginate.= "&lt;a href='$targetpage?page=2#gallery'&gt;2&lt;/a&gt;";
                $paginate.= "...";
                for ($counter = $page - $stages; $counter &lt;= $page + $stages; $counter++)
                {
                    if ($counter == $page){
                        $paginate.= "&lt;span class='current'&gt;$counter&lt;/span&gt;";
                    }else{
                        $paginate.= "&lt;a href='$targetpage?page=$counter#gallery'&gt;$counter&lt;/a&gt;";}                  
                }
                $paginate.= "...";
                $paginate.= "&lt;a href='$targetpage?page=$LastPagem1#gallery'&gt;$LastPagem1&lt;/a&gt;";
                $paginate.= "&lt;a href='$targetpage?page=$lastpage#gallery'&gt;$lastpage&lt;/a&gt;";     
            }
            // End only hide early pages
            else
            {
                $paginate.= "&lt;a href='$targetpage?page=1#gallery'&gt;1&lt;/a&gt;";
                $paginate.= "&lt;a href='$targetpage?page=2#gallery'&gt;2&lt;/a&gt;";
                $paginate.= "...";
                for ($counter = $lastpage - (2 + ($stages * 2)); $counter &lt;= $lastpage; $counter++)
                {
                    if ($counter == $page){
                        $paginate.= "&lt;span class='current'&gt;$counter&lt;/span&gt;";
                    }else{
                        $paginate.= "&lt;a href='$targetpage?page=$counter#gallery'&gt;$counter&lt;/a&gt;";}                  
                }
            }
        }           
                // Next
        if ($page &lt; $counter - 1){ 
            $paginate.= "&lt;a href='$targetpage?page=$next#gallery'&gt;next&lt;/a&gt;";
        }else{
            $paginate.= "&lt;span class='disabled'&gt;next&lt;/span&gt;";
            }

        $paginate.= "&lt;/div&gt;";        

}
mysql_close();  
?&gt;

&lt;?php 
        $productCount = mysql_num_rows($result); // count the output amount
            while($row = mysql_fetch_array($result))
            { 
             $id = $row["id"];
             $product_name = $row["product_name"];
             $price = $row["price"];
             $category = $row["category"];
             $subcategory = $row["subcategory"];
             $date_added = strftime("%b %d, %Y", strtotime($row["date_added"]));
             $dynGallery .= 
            '
            &lt;div&gt;
                &lt;li&gt;
                    &lt;a href="product.php?id=' . $id . '#gallery"&gt;
                    &lt;img style="border:#FFF 1px solid;" src="inventory_images/' . $id . '.jpg" alt="' . $product_name . '" width="180" height="255" border="1" style="opacity: 0;/&gt;&lt;/a&gt;
                    &lt;h4&gt; &lt;a name= ' . $id . '  id= ' . $id . '  value= ' . $id . '  href="product.php?id= ' . $id . '#gallery"&gt; ' . $product_name . ' &lt;/a&gt; &lt;/h4&gt;
                    &lt;p&gt;'. $category .'&lt;/p&gt; 
                    &lt;p&gt;'. $subcategory .'&lt;/p&gt; 
                    &lt;span&gt;  $' . $price . '&lt;/span&gt;
                &lt;/li&gt;
            &lt;/div&gt;
            ';
            }
    ?&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;body&gt;
&lt;?php include ("../header.php");?&gt;
&lt;?php include ("../menu.php");?&gt;
&lt;a id="shop"&gt;&lt;/a&gt;
        &lt;div class="body"&gt;
            &lt;div class="sidebar"&gt;
                &lt;div class="first"&gt;
                    &lt;h2&gt;&lt;a href="index.php"&gt;Dora Designs&lt;/a&gt;&lt;/h2&gt;       
                    &lt;!-- Dynamic Categories --&gt;
                    &lt;ul&gt;
                    &lt;?php echo $dynCat; ?&gt;
                    &lt;/ul&gt;
                &lt;/div&gt;
                &lt;!-- &lt;div&gt;
                    &lt;h2&gt;&lt;a href="#"&gt;Weddings&lt;/a&gt;&lt;/h2&gt;
                    &lt;/div&gt;
                    &lt;div&gt;
                    &lt;h2&gt;&lt;a href="#"&gt;Birthdays&lt;/a&gt;&lt;/h2&gt;
                    &lt;/div&gt;
                --&gt;
            &lt;/div&gt;
            &lt;div class="content"&gt;
                &lt;div class="figure"&gt;
                    &lt;img src="/images/galleryholder.png" alt=""/&gt;
                &lt;/div&gt;
            &lt;div class="products"&gt;
            &lt;div class="paging" align = "center"&gt;                    

            &lt;a id="gallery"&gt;&lt;/a&gt;
            &lt;? echo $paginate;?&gt;     
            &lt;? echo '&lt;/br&gt;'. $cat;?&gt;
            &lt;? echo '&lt;/br&gt;'. $total_pages.' Results'; ?&gt;
            &lt;/div&gt; 

        &lt;ul&gt;
    &lt;?php echo $dynGallery; ?&gt;
        &lt;/ul&gt;
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>cheelo007</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454277/using-pagination-with-mysql-queries</guid>
		</item>
				<item>
			<title>Url Parameter gets lost</title>
			<link>http://www.daniweb.com/web-development/php/threads/454219/url-parameter-gets-lost</link>
			<pubDate>Thu, 09 May 2013 07:14:48 +0000</pubDate>
			<description>Hey guys, I am trying to dynamically parametize my url, but it gets lost and I have no idea why. Perhaps some insight from you guys will help. Here's the code: while($row = mysql_fetch_assoc($getID)) { echo &quot;&lt;tr&gt;&quot;; echo &quot;&lt;td&gt;&lt;a href='View.php?id='&quot; . $row['ID'] . &quot;'&gt;&quot; . $row['ID'] . &quot;&lt;/a&gt;&quot; . &quot;&lt;br ...</description>
			<content:encoded><![CDATA[ <p>Hey guys,</p>

<p>I am trying to dynamically parametize my url, but it gets lost and I have no idea why. Perhaps some insight from you guys will help. Here's the code:</p>

<pre><code>while($row = mysql_fetch_assoc($getID))
{
    echo "&lt;tr&gt;";
    echo "&lt;td&gt;&lt;a href='View.php?id='" . $row['ID'] . "'&gt;" . $row['ID'] . "&lt;/a&gt;" . "&lt;br /&gt;" . "-" 
    . $row['Description'] . "&lt;/td&gt;";
    echo "&lt;td style='text-align:center; width:35%'&gt;" . $row['dateCreated']. "&lt;/td&gt;";
    echo "&lt;/tr&gt;";
}
</code></pre>

<p>In View.php I have this to try and debug:</p>

<pre><code>if (isset($GET['ID']))
    echo $GET['ID'];
else
    "Not set";
</code></pre>

<p>When I am redirected to this page, nothing displays and the url reads View.php?id=</p>

<p>Why is it empty?</p>

<p>Thanks</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/454219/url-parameter-gets-lost</guid>
		</item>
				<item>
			<title>Rotating header graphics with PHP</title>
			<link>http://www.daniweb.com/web-development/php/threads/454214/rotating-header-graphics-with-php</link>
			<pubDate>Thu, 09 May 2013 05:12:57 +0000</pubDate>
			<description>I have been searching for the past several hours to find a way to rotate through 4-5 different graphics in the header of a web page that I am creating, but have had very little useful help. There seems to be countless jquery slider scripts out there, but even after ...</description>
			<content:encoded><![CDATA[ <p>I have been searching for the past several hours to find a way to rotate through 4-5 different graphics in the header of a web page that I am creating, but have had very little useful help.</p>

<p>There seems to be countless jquery slider scripts out there, but even after downloading a couple of them and attempting to decipher what is to be done with them, I'm no closer to finding the solution then I was at 8 this morning.</p>

<p>Is there any way in PHP to accomplish this?  It doesn't have to be fancy, just be able to rotate through a number of slides basically.</p>

<p>Any feedback would be appreciated, even if it is that jquery is the only way to go along with some direction in how to make it work.</p>

<p>Thanks in advance.</p>

<p>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/454214/rotating-header-graphics-with-php</guid>
		</item>
				<item>
			<title>Fatal error: Call to undefined function field_attach_load() </title>
			<link>http://www.daniweb.com/web-development/php/threads/454199/fatal-error-call-to-undefined-function-field_attach_load-</link>
			<pubDate>Wed, 08 May 2013 22:04:27 +0000</pubDate>
			<description>there few number of questoins that need to be answered one does drupal data base has to co be collation? after i have executed the the database query in drupal instal i get error but i refresh and the tables are made in database(collation) on local host machine.Does this causes ...</description>
			<content:encoded><![CDATA[ <p>there few number of questoins that need to be answered</p>

<p>one does drupal data base has to co be collation?<br />
 after i have executed the the database query in drupal instal i get error but i refresh and the tables are made in database(collation) on local host machine.Does this causes any error ??</p>

<p>on the second last step of the installation i get this error</p>

<p>Fatal error: Call to undefined function field_attach_load()</p>

<p>i have searched hte net but could not find any possible result !!</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/454199/fatal-error-call-to-undefined-function-field_attach_load-</guid>
		</item>
				<item>
			<title>PHP not executing</title>
			<link>http://www.daniweb.com/web-development/php/threads/454148/php-not-executing</link>
			<pubDate>Wed, 08 May 2013 08:54:56 +0000</pubDate>
			<description>Hi, Been working on this PHP snippet and it was fine until I changed one line. I am doing this inside Wordpress so I can't echo the problems out. &quot;Server error&quot; Hopefull you guys can see where my snippet has gone wrong :)) &lt;?php //Create connection //new mysqli(&quot;localhost&quot;, &quot;user&quot;, &quot;password&quot;, ...</description>
			<content:encoded><![CDATA[ <p>Hi,</p>

<p>Been working on this PHP snippet and it was fine until I changed one line. I am doing this inside Wordpress so I can't echo the problems out.</p>

<p>"Server error"</p>

<p>Hopefull you guys can see where my snippet has gone wrong :))</p>

<pre><code>        &lt;?php
        //Create connection
        //new mysqli("localhost", "user", "password", "database");
        $db = mysqli_connect("localhost", "ebook","Password", "Ebook") or die("Cannot Connect to the database");



        //Adding Sent Over Data

        ///////////////Values///////////////////
            $value_name = $_POST['Name'];
           $value_email = $_POST['Email'];
        $value_category = $_POST['Category'];
        $value_download= $row['Download'];
        ////////////////////////////////////////

        $ChangeDownloadSQL = "SELECT Name FROM details WHERE Download=1 UPDATE Download=0";
        $Changers = mysqli_query($db, $ChangeDownloadSQL);


        if ($Changers) {
            mysqli_fetch_assoc($ChangeDownloadSQL){
            echo "Changed Details";
        } else {
            echo "Failed";
            }
        }
        //CRONJOBCHECK//
        //$sqlquery = "SELECT ID, Name FROM details WHERE Download=0";
        $strSQL = "SELECT Name FROM details WHERE Download=1";
        //RS = Record Set
        $rs = mysqli_query($db, $strSQL);
        if ( $rs) {

            while($row = mysqli_fetch_assoc($rs)){
               echo "&lt;p&gt;" . $row['Name'] . " " . "&lt;/p&gt;";
               echo $value_download;
            }
        }else{
            //Display Error Message
            echo '&lt;p&gt;';
            echo mysqli_error($db);
            echo '&lt;/p&gt;';
        }

        echo "&lt;p&gt;" . $row['ID'] . $row['Name'] . "&lt;/p&gt;";
        ?&gt;
</code></pre>
 ]]></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/454148/php-not-executing</guid>
		</item>
				<item>
			<title>wordpress php</title>
			<link>http://www.daniweb.com/web-development/php/threads/454136/wordpress-php</link>
			<pubDate>Wed, 08 May 2013 05:49:08 +0000</pubDate>
			<description> &lt;?php //global $wpdb; /* Plugin Name:new plugin Description: A simple hello world wordpress plugin Version: 1.0 Author: arti shrivas Author URI: http://yourdomain.com License: GPL */ /* This calls hello_world() function when wordpress initializes.*/ //Note that the hello_world doesnt have brackets. add_action('init','new_plugin'); function new_plugin() { //echo &quot;Hello World&quot;; global $wpdb; $table_name ...</description>
			<content:encoded><![CDATA[ <pre><code>&lt;?php
//global $wpdb;
/*
 Plugin Name:new plugin
 Description: A simple hello world wordpress plugin
Version: 1.0
Author: arti shrivas
Author URI: <a href="http://yourdomain.com" rel="nofollow">http://yourdomain.com</a>
License: GPL
*/
/* This calls hello_world() function when wordpress initializes.*/
 //Note that the hello_world doesnt have brackets.

add_action('init','new_plugin');

function new_plugin()
{
//echo "Hello World";
global $wpdb;
$table_name ='wp_register';
if(isset($_POST['sub']))
{
   // echo "hello";

   $name=$_POST['name'];
   $dob=$_POST['dob'];
   $email=$_POST['email'];
  // echo $name." ".$dob." ".$email;



$wpdb-&gt;insert(  
    $table_name,  
    array(  
        'name' =&gt; $name,  
        'dob' =&gt; $dob,
        'email'=&gt;$email
    ),  
    array(  
        '%s',  
        '%s',
        '%s'
    )  
); 

   //$wpdb-&gt;query("INSERT INTO $table_name (name, dob,email) VALUES('".$name."','".$dob."','".$email."')");
  // echo '&lt;pre&gt;';print_r($wpdb);  die;
}
if(is_page('132')){
?&gt;
        &lt;div class="new"&gt;
            &lt;div class="new1"&gt;
                &lt;form method="post" &gt;
                        &lt;?php //wp_nonce_field('update-options'); ?&gt;

                       &lt;lable&gt;Your name&lt;/lable&gt; &lt;input type="text" name="name"&gt;&lt;br/&gt;
                       &lt;lable&gt;Date of birth&lt;/lable&gt; &lt;input type="text" name="dob"&gt;&lt;br/&gt;
                       &lt;lable&gt;Email id&lt;/lable&gt;&lt;input type="text" name="email"&gt;                 
                        &lt;br/&gt;

                        &lt;input type="submit" value="&lt;?php _e('Save Changes') ?&gt;" name="sub"/&gt;
                &lt;/form&gt;
            &lt;/div&gt;
        &lt;/div&gt;
&lt;?php
}
}
?&gt;
</code></pre>

<p>i am new to wp and i am try to create an simple registration plugin everythig is right but when i submit page it gives me a message<br />
"This is somewhat embarrassing, isn’t it?</p>

<p>It seems we can’t find what you’re looking for. Perhaps searching can help."</p>

<p>what i am doing wrong plz help me<br />
thanx in advance</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>arti18</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454136/wordpress-php</guid>
		</item>
				<item>
			<title>Stop php execution with if statement</title>
			<link>http://www.daniweb.com/web-development/php/threads/454096/stop-php-execution-with-if-statement</link>
			<pubDate>Tue, 07 May 2013 12:11:53 +0000</pubDate>
			<description>Hi Guys I'm using a form which sends data to a php file so that ti can be sent to a database. However some of the data passed are dates for the start, end of teh event and when sign ups expire. I want to stop the from data been ...</description>
			<content:encoded><![CDATA[ <p>Hi Guys</p>

<p>I'm using a form which sends data to a php file so that ti can be sent to a database. However some of the data passed are dates for the start, end of teh event and when sign ups expire. I want to stop the from data been sent to the database if the start date is after the end date and if the start date is after the expiry date. AS of yet I can't stop it been written to the database but it does redirect. Tthis is what i have so far for the if function</p>

<pre><code> $sitename = $_POST[eName];
   $title = $_POST[eName];
   $sDate = $_POST[sDate];
   $enDate = $_POST[enDate];
   $exDate = $_POST[exDate];
   $desc = $_POST[desc];
   $pName = $_POST[eName];

   if ($sDate&gt;$enDate){
  header( 'Location: sign_up_create.php' );
}
    if ($sDate&lt;$exDate){
header( 'Location: sign_up_create.php' );
}
</code></pre>

<p>Thanks in advance</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>bfitzgerald</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454096/stop-php-execution-with-if-statement</guid>
		</item>
				<item>
			<title>SESSION data</title>
			<link>http://www.daniweb.com/web-development/php/threads/454045/session-data</link>
			<pubDate>Mon, 06 May 2013 21:29:53 +0000</pubDate>
			<description>I have a small site that is not too data intensive, but requires the user to login to access pages that handle data and pages that interact with the database. To enhance the site security I am hoping to that I do not need to use cookies, instead handle all ...</description>
			<content:encoded><![CDATA[ <p>I have a small site that is not too data intensive, but requires the user to login to access pages that handle data and pages that interact with the database.</p>

<p>To enhance the site security I am hoping to that I do not need to use cookies, instead handle all of the data states (between pages and to/from the database) on the server-side, utilizing $_SESSION and session arrays.</p>

<p>Whilst this means the user has to physically login each time they visit the site (rather than the site recognising them via a cookie), will this approach help make the site more secure, or am I just making more work for myself and/or my visitors?</p>

<p>Of course I will be making sure unused data arrays are destroyed once used. I will be making sure I regenerate the session for each login.</p>

<p>Many thanks.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>Thorby68</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454045/session-data</guid>
		</item>
				<item>
			<title>Writing code to a new static html page</title>
			<link>http://www.daniweb.com/web-development/php/threads/454030/writing-code-to-a-new-static-html-page</link>
			<pubDate>Mon, 06 May 2013 16:55:21 +0000</pubDate>
			<description>Hi Guys I have been asked to make an online sign up sheet system by my boss. I have almost finished but have encountered a problem. To sign up to the created activity I have use a previous form to add a &quot;page name&quot; which is then used to generate ...</description>
			<content:encoded><![CDATA[ <p>Hi Guys</p>

<p>I have been asked to make an online sign up sheet system by my boss. I have almost finished but have encountered a problem. To sign up to the created activity I have use a previous form to add a "page name" which is then used to generate a new html page. I now want to write to this new page with important info, such as Event name, dates, etc. I came up with a method so far to do this, as messy as it may be. However halfway through (line 88) it stops writing properly and just prints out the php code as text. I have only just learned php so that I can do this project so am not particulary good at it. Many thanks and sorry for the essay.</p>

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

        &lt;body&gt;

        &lt;?php

          ob_start();
          header("location: sign_up.php");

           $sitename = $_POST[eName];
           $title = $_POST[eName];
           $sDate = $_POST[sDate];
           $enDate = $_POST[enDate];
           $exDate = $_POST[exDate];
           $desc = $_POST[desc];
           $pName = $_POST[eName];

        $con=mysqli_connect("localhost","emuas","flgdls","EMUAS_signUp");
        // Check connection
        if (mysqli_connect_errno())
          {
          echo "Failed to connect to MySQL: " . mysqli_connect_error();
          }

        $sql="INSERT INTO TEST (EventName, StartDate, EndDate, ExpiryDate, PageName, Description)
        VALUES
        ('$_POST[eName]','$_POST[sDate]','$_POST[enDate]','$_POST[exDate]','$_POST[eName]','$_POST[desc]')";

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


            $fileStart='&lt;html&gt;
           &lt;head&gt;
           &lt;title&gt;';

           $fileStTable=' &lt;/title&gt;
           &lt;/head&gt;
           &lt;body&gt;

         &lt;table&gt;
         &lt;tr align="left"&gt;
         &lt;th&gt; ';

         $fileSDate=' &lt;/th&gt;
         &lt;/tr&gt;
         &lt;tr align="left"&gt;
         &lt;th&gt; Start Date: ';

         $fileEnDate='&lt;/th&gt;
         &lt;th&gt; End Date: ';

           $fileExDate='&lt;/th&gt; 
         &lt;th&gt; Expiry Date: ';

         $fileDesc='&lt;/th&gt;
         &lt;/tr&gt;
         &lt;/table&gt;
         &lt;table id =createSheet&gt;
         &lt;tr align="left"&gt;
         &lt;th&gt; Description: ';

         $fileEnTable='&lt;/th&gt;
         &lt;/tr&gt;
        &lt;/table&gt;
        ';

         $filePHP='
         &lt;?php 
        $con=mysqli_connect("localhost","emuas","flgdls","EMUAS_signUp");
        // Check connection
        if (mysqli_connect_errno())
          {
          echo "Failed to connect to MySQL: " . mysqli_connect_error();
          }

        $sign = mysqli_query($con,"SELECT * FROM SIGN_UP_TEST ORDER BY User");

        echo "&lt;table&gt;
        &lt;tr&gt;
        &lt;th&gt;Name&lt;/th&gt;
        &lt;th&gt;Status&lt;/th&gt;
        &lt;th&gt;Comments&lt;/th&gt;
        &lt;/tr&gt;"; // Error occurs on this line by writing the "; and everythign after as text

        while($row = mysqli_fetch_array($sign))
          {
          echo "&lt;tr&gt;";
          echo "&lt;td&gt;" . $row["User"] . "&lt;/td&gt;";
          echo "&lt;td&gt;" Attending "&lt;/td&gt;";
          echo "&lt;td&gt;" . $row["Comments"] . "&lt;/td&gt;";
          echo "&lt;/tr&gt;"; 
          }
        echo "&lt;/table&gt;";

        mysqli_close($con);
        ?&gt;';

        $fileForm='
        &lt;form action="sign_user.php"&gt;
        &lt;table&gt;
        &lt;tr&gt;
        &lt;td&gt; Name: &lt;br /&gt; &lt;input type="text" name="User"  /&gt; &lt;input type="submit" value="Sign Up"/&gt;  &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
        &lt;td&gt; comments: &lt;br /&gt; &lt;input type="text" name="comments" /&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;/table&gt;
        &lt;/form&gt;';

        $fileEnd=' &lt;/body&gt;
           &lt;/html&gt;';


           $fp = fopen("sign_up_sheets/$sitename.html", "w");
           fputs($fp, $fileStart);
           fputs($fp, $title);
           fputs($fp, $fileStTable);
           fputs($fp, $sitename);
           fputs($fp, $fileSDate);
           fputs($fp, $sDate);
           fputs($fp, $fileEnDate);
           fputs($fp, $enDate);
           fputs($fp, $fileExDate);
           fputs($fp, $exDate);
           fputs($fp, $fileDesc);
           fputs($fp, $desc);
           fputs($fp, $fileEnTable);
           fputs($fp, $filePHP);
           fputs($fp, $fileForm);
           fputs($fp, $fileEnd);
           fclose($fp);

        mysqli_close($con);
        ?&gt;

        &lt;script&gt;
        window.alert("Your event has been created")
        &lt;/script&gt;

        ob_end_flush();


        &lt;/body&gt;
        &lt;/html&gt;
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>bfitzgerald</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454030/writing-code-to-a-new-static-html-page</guid>
		</item>
				<item>
			<title>Cant insert record into the MySQL</title>
			<link>http://www.daniweb.com/web-development/php/threads/454028/cant-insert-record-into-the-mysql</link>
			<pubDate>Mon, 06 May 2013 15:24:42 +0000</pubDate>
			<description>The connection and setting are fine as I can insert things into the same db with different tables. Long story short below is the value that I want to insert into the db but it give me no error and nothing insert. I have use the echo and checked every ...</description>
			<content:encoded><![CDATA[ <p>The connection and setting are fine as I can insert things into the same db with different tables.</p>

<p>Long story short below is the value that I want to insert into the db but it give me no error and nothing insert. I have use the echo and checked every field have a value...</p>

<pre><code>"data"
    1   id  int(6)          No  None    AUTO_INCREMENT  
    2   title   varchar(80)     latin1_swedish_ci       No          
    3   docname     varchar(80)     latin1_swedish_ci       No          
    4   version     varchar(10)     latin1_swedish_ci       No  None        
    5   Categroy    varchar(30)     latin1_swedish_ci       No  None        
    6   Sub_Categroy    varchar(30)     latin1_swedish_ci       No  None        
    7   Author  varchar(50)     latin1_swedish_ci       No  None        
    8   approval    enum('approved', 'pending')     latin1_swedish_ci       No  None        
    9   documentdir     varchar(100)    latin1_swedish_ci       No  None        
    10  description     longtext    latin1_swedish_ci       No  None        
    11  type    varchar(20)     latin1_swedish_ci       No          
    12  size    varchar(20)     latin1_swedish_ci       No          
    13  Updated_by  varchar(80)     latin1_swedish_ci       No          
    14  md5hash     varchar(32)     latin1_swedish_ci       No          ctions More
    15  Delete  enum('0', '1')  latin1_swedish_ci       No  None        
    16  date_added  datetime

$title = trim($_SESSION['title']);
$docname = trim($_SESSION['docname']);
$Categroy = trim($_SESSION['Categroy']);
$Sub_Categroy = trim($_SESSION['Sub_Categroy']);
$author = trim($_SESSION['author']);
$docdir = trim($_SESSION['docdir']);
$description = trim($_SESSION['description']);
$size = trim($_SESSION['size']);
$type = trim($_SESSION['type']);
$md5 = trim($_SESSION['md5']);
$approval = trim($_SESSION['approval'] );
$version = trim($_SESSION['version'] );
$tempfile = trim($_SESSION['tempfile'] );
$Delete = 0;
$user=$_SESSION['user'];
$date = DATE('Y-m-d H:i:s');


$query = "INSERT INTO data (id, title, docname, version, Categroy, Sub_Categroy, Author, approval, documentdir, description, type, size, Updated_by, md5hash, Delete, date_added)
VALUES ('', '$title', '$docname', '$version', '$Categroy', '$Sub_Categroy', '$author', '$approval', '$docdir', '$description', '$type', '$size', '$user', '$md5', '$Delete', '$date')";
$results = mysql_query($query);

echo $title."&lt;/br&gt;";
echo $docname."&lt;/br&gt;";
echo $Categroy."&lt;/br&gt;";
echo $Sub_Categroy."&lt;/br&gt;";
echo $author."&lt;/br&gt;";
echo $docdir."&lt;/br&gt;";
echo $description."&lt;/br&gt;";
echo $size."&lt;/br&gt;";
echo $type."&lt;/br&gt;";
echo $md5."&lt;/br&gt;";
echo $approval."&lt;/br&gt;";
echo $version."&lt;/br&gt;";
echo $Delete."&lt;/br&gt;";
echo $user."&lt;/br&gt;";
echo $date."&lt;/br&gt;";
</code></pre>

<p>after the echo, I got below result. But nothing insert into the table</p>

<p>Research Project<br />
project.V1.3.02-07-2012.pdf<br />
Type A<br />
Small<br />
8080<br />
IT773<br />
Research Project Report<br />
932.424<br />
pdf<br />
e89eeb337b7895020eddb49ddf91f489<br />
approved<br />
V1.3<br />
0<br />
8080<br />
2013-05-06 17:19:02</p>

<p>Ive checked the spelling but seem to be there is no mistake...I think I have a small mistake somewhere but just couldnt locat it...<br />
thanks</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>yy886</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/454028/cant-insert-record-into-the-mysql</guid>
		</item>
				<item>
			<title>url redirection .htaccess</title>
			<link>http://www.daniweb.com/web-development/php/threads/454009/url-redirection-.htaccess</link>
			<pubDate>Mon, 06 May 2013 11:52:28 +0000</pubDate>
			<description>i want to redirect all .html file in subdirtories into root directory with .htaccess file,it does not manner that how much directory is complicated or long. example1: http://www.example.com/folder/folder2/folder3/folder4/main.html to http://www.example.com/main.html example2 http://www.example.com/folder/manyfolder/main.html to http://www.example.com/main.html</description>
			<content:encoded><![CDATA[ <p>i want to redirect all .html file in subdirtories into root directory with .htaccess file,it does not manner that how much directory is complicated or long.</p>

<p>example1: <a href="http://www.example.com/folder/folder2/folder3/folder4/main.html" rel="nofollow">http://www.example.com/folder/folder2/folder3/folder4/main.html</a><br />
to<br />
<a href="http://www.example.com/main.html" rel="nofollow">http://www.example.com/main.html</a><br />
example2<br />
<a href="http://www.example.com/folder/manyfolder/main.html" rel="nofollow">http://www.example.com/folder/manyfolder/main.html</a><br />
to<br />
<a href="http://www.example.com/main.html" rel="nofollow">http://www.example.com/main.html</a></p>
 ]]></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/454009/url-redirection-.htaccess</guid>
		</item>
				<item>
			<title>Problem on uploading file...</title>
			<link>http://www.daniweb.com/web-development/php/threads/453974/problem-on-uploading-file</link>
			<pubDate>Mon, 06 May 2013 01:32:30 +0000</pubDate>
			<description>It seem to be I have a problem on that code as this only go though the first one and then stopped...so other file extension is not allow... //Check the file extension if (($_FILES[&quot;file&quot;][&quot;type&quot;] == &quot;application/pdf&quot;) || ($_FILES[&quot;file&quot;][&quot;type&quot;] == &quot;application/doc&quot;) || ($_FILES[&quot;file&quot;][&quot;type&quot;] == &quot;application/docx&quot;) || ($_FILES[&quot;file&quot;][&quot;type&quot;] == &quot;application/ppt&quot;) || ($_FILES[&quot;file&quot;][&quot;type&quot;] ...</description>
			<content:encoded><![CDATA[ <p>It seem to be I have a problem on that code as this only go though the first one and then stopped...so other file extension is not allow...</p>

<pre><code>//Check the file extension
if (($_FILES["file"]["type"] == "application/pdf") 
|| ($_FILES["file"]["type"] == "application/doc") 
|| ($_FILES["file"]["type"] == "application/docx")
|| ($_FILES["file"]["type"] == "application/ppt")
|| ($_FILES["file"]["type"] == "application/pptx") 
&amp;&amp; ($_FILES["file"]["size"] &lt; 20000000))
{
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>yy886</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/453974/problem-on-uploading-file</guid>
		</item>
				<item>
			<title>Singular/plural function issue</title>
			<link>http://www.daniweb.com/web-development/php/threads/453931/singularplural-function-issue</link>
			<pubDate>Sun, 05 May 2013 00:34:46 +0000</pubDate>
			<description>Hey Everyone, I previously had an issue with a date display format. I have a different question that deals with displaying singular or plural words using a version of an if statement that displays an &quot;s&quot; or displays nothing based on how many comments there are in a specific blog ...</description>
			<content:encoded><![CDATA[ <p>Hey Everyone,</p>

<p>I previously had an issue with a date display format. I have a different question that deals with displaying singular or plural words using a version of an if statement that displays an "s" or displays nothing based on how many comments there are in a specific blog post. Here is the function that I've written and I'm afraid it may not be right. Any suggestions?<br />
comments.inc.php</p>

<pre><code>function gather_comments ($pid){
    $pid = (int)$pid;

    $sql = "SELECT * FROM `comments` WHERE `post_id`= {$pid}";

    $comments = mysql_query($sql);

    return $comments;

}
</code></pre>

<p>and here is blog_list.php</p>

<pre><code>&lt;h4 style="text-decoration: none;"&gt;(&lt;?php echo $post['total_comments']; ?&gt; comment&lt;?php if(gather_comments() !=1){ echo '';}elseif(gather_comments == 0 || 1){echo 's';} ?&gt;, last comment &lt;?php echo $post['last_comment']; ?&gt;)&lt;/h4&gt;
</code></pre>

<p>basically, I want the word comment to be plural if there are either no or more than one comments in the database and if there are more than one comment in a database, to output the "s" and if there is either 1 to output nothing. This may seem simple to most but It would be very helpful to guide me in the right direction on how to handle this. Thanks in advance!</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/453931/singularplural-function-issue</guid>
		</item>
				<item>
			<title>How to export all records from one table in to pdf with TCPDF?</title>
			<link>http://www.daniweb.com/web-development/php/threads/453829/how-to-export-all-records-from-one-table-in-to-pdf-with-tcpdf</link>
			<pubDate>Fri, 03 May 2013 09:27:11 +0000</pubDate>
			<description>Hi! Anyone can help please? I am searching around like crazy to make this work but no luck... There are allot of articles with some solutions but nothing works for me... Here is my code &lt;?php require_once('../tcpdf/config/lang/eng.php'); require_once('../tcpdf/tcpdf.php'); // create new PDF document $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, ...</description>
			<content:encoded><![CDATA[ <p>Hi!</p>

<p>Anyone can help please?</p>

<p>I am searching around like crazy to make this work but no luck... There are allot of articles with some solutions but nothing works for me... Here is my code</p>

<pre><code>&lt;?php
require_once('../tcpdf/config/lang/eng.php');
require_once('../tcpdf/tcpdf.php');


// create new PDF document
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);

// set document information
$pdf-&gt;SetCreator(PDF_CREATOR);
$pdf-&gt;SetAuthor('Dario Balas');
$pdf-&gt;SetTitle('PDF');
$pdf-&gt;SetSubject('PDF');
$pdf-&gt;SetKeywords('PDF');

// set default monospaced font
$pdf-&gt;SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);

//set margins
$pdf-&gt;SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);

//set auto page breaks
$pdf-&gt;SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);

//set image scale factor
$pdf-&gt;setImageScale(PDF_IMAGE_SCALE_RATIO);

//set some language-dependent strings
$pdf-&gt;setLanguageArray($l);

// ---------------------------------------------------------

// set default font subsetting mode
$pdf-&gt;setFontSubsetting(true);

// Set font
// dejavusans is a UTF-8 Unicode font, if you only need to
// print standard ASCII chars, you can use core fonts like
// helvetica or times to reduce file size.
$pdf-&gt;SetFont('dejavusans', '', 14, '', true);

// Add a page
// This method has several options, check the source code documentation for more information.
$pdf-&gt;AddPage();




// Set some content to print
$tbl_header = '&lt;table border="1"&gt;';
$tbl_footer = '&lt;/table&gt;';
$tbl ='';

$con=mysqli_connect("localhost","user","pass","db");
// Check connection
if (mysqli_connect_errno())
  {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
  }
$result = mysqli_query($con,"SELECT * FROM fl_account_fields");

while($row = mysqli_fetch_array($result))
  {
  $id = $row['ID'];
  $key = $row['Key'];


$tbl = '&lt;tr&gt;&lt;td&gt;'.$id.'&lt;/td&gt;&lt;td&gt;'.$key.'&lt;/td&gt;&lt;/tr&gt;';
}

// Print text using writeHTMLCell()
$pdf-&gt;writeHTML($tbl_header . $tbl . $tbl_footer, true, false, false, false, '');

// ---------------------------------------------------------

// Close and output PDF document
// This method has several options, check the source code documentation for more information.
$pdf-&gt;Output('', 'I');

//============================================================+
// END OF FILE
//============================================================+
?&gt;
</code></pre>

<p>I can display only last record. What do i need to do to display all the records? There is no difference if i put <code>$tbl</code> in or outside of the loop...</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/453829/how-to-export-all-records-from-one-table-in-to-pdf-with-tcpdf</guid>
		</item>
				<item>
			<title>Magento Code</title>
			<link>http://www.daniweb.com/web-development/php/threads/453773/magento-code</link>
			<pubDate>Thu, 02 May 2013 15:36:26 +0000</pubDate>
			<description>Hi I was looking magento tutorial there I found following lines &lt;input type=&quot;text&quot; name=&quot;custom[ssn]&quot; value=&quot;&lt;?php echo $this-&gt;htmlEscape($this-&gt;getQuote()-&gt;getSsn()) ?&gt;&quot; title=&quot;&lt;?php echo $this-&gt;__('SSN') ?&gt;&quot; class=&quot;input-text required-entry&quot; id=&quot;billing:ssn&quot; /&gt; &lt;/div&gt; can you please explain me what do you mean by $this-&gt;getQuote()-&gt;getSsn() tutorial link is http://www.excellencemagentoblog.com/magento-add-custom-fields-checkout-page</description>
			<content:encoded><![CDATA[ <p>Hi<br />
I was looking magento tutorial there I found following lines</p>

<pre><code>&lt;input type="text" name="custom[ssn]" value="&lt;?php echo $this-&gt;htmlEscape($this-&gt;getQuote()-&gt;getSsn()) ?&gt;" title="&lt;?php echo $this-&gt;__('SSN') ?&gt;" class="input-text required-entry" id="billing:ssn" /&gt;
                    &lt;/div&gt;
</code></pre>

<p>can you please explain me what do you mean by</p>

<pre><code>$this-&gt;getQuote()-&gt;getSsn()
</code></pre>

<p>tutorial link is<br />
<a href="http://www.excellencemagentoblog.com/magento-add-custom-fields-checkout-page" rel="nofollow">http://www.excellencemagentoblog.com/magento-add-custom-fields-checkout-page</a></p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>ankit.4aug</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/453773/magento-code</guid>
		</item>
				<item>
			<title>help with csv and mysql</title>
			<link>http://www.daniweb.com/web-development/php/threads/453767/help-with-csv-and-mysql</link>
			<pubDate>Thu, 02 May 2013 14:45:24 +0000</pubDate>
			<description>i have multiple users who need to update a table into mysql with a csv file they will need to do this by pasting the csv file into a text area on the website the first row of that file contains the name of each feild and i need to ...</description>
			<content:encoded><![CDATA[ <p>i have multiple users who need to update a table into mysql with a csv file they will need to do this by pasting the csv file into a text area on the website<br />
the first row of that file contains the name of each feild  and i need to get rid of that plus i also need to add<br />
the user name to each rows  (so i know who the user is for each row)  and finaly i need to get rid of the last row of the csv file too (and the file dont have  the same amount of rows)</p>

<p>ill paste you a bit of the file so you understand better</p>

<p>Id  Name    Position    Reference   city guards ballistas   rangers guardians   templars    berserkers  mages   scouts  crossbowmen paladins    knights warlocks    rams    catapults   frigates    sloops  war galleons    barons  TS  Summary (dbl click to select)<br />
"27132364"  "Landingzone"   "'460:414"  ""  "487"   "0" "0" "0" "0" "1993"  "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "1993"  "487 city guards, 1993 berserkers"<br />
"27263434"  "valcartier"    "'458:416"  ""  "0" "0" "24411" "12354" "0" "24837" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "61602" "24411 rangers, 12354 guardians, 24837 berserkers"<br />
"26935754"  "Magog" "'458:411"  ""  "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "24"    "0" "0" "2400"  "24 sloops"<br />
"Total" "Total" "'" ""  "487"   "0" "24411" "12354" "0" "26971" "0" "0" "0" "0" "0" "0" "0" "0" "0" "24"    "0" "1" "66137" "487 city guards, 24411 rangers, 12354 guardians, 26971 berserkers, 24 sloops, 1 baron"</p>

<p>as you see the feild are delimited by double quote and i have no clue how the row change is made  i am really lost here  any help would be welcomed ty</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>jethaya</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/453767/help-with-csv-and-mysql</guid>
		</item>
				<item>
			<title>Check isset and check of undefined</title>
			<link>http://www.daniweb.com/web-development/php/threads/453710/check-isset-and-check-of-undefined</link>
			<pubDate>Wed, 01 May 2013 16:34:52 +0000</pubDate>
			<description>I haven't had to do Php in about 5years and I'm having some trouble doing the simplest task. I use Javascript to send some parameters from a querystring to my page and so some may be 'undefined' I want to build a mySQL query based on these parameters, therefore need ...</description>
			<content:encoded><![CDATA[ <p>I haven't had to do Php in about 5years and I'm having some trouble doing the simplest task.</p>

<p>I use Javascript to send some parameters from a querystring to my page and so some may be 'undefined'</p>

<p>I want to build a mySQL query based on these parameters, therefore need to skip those that are 'undefined'</p>

<p>I can't seem to get this to work properly..any help would be appreciated.</p>

<pre><code>    $WhereClause = "";  

     if (isset($_REQUEST['lname']) &amp;&amp; $_REQUEST['lname'] === 'undefined')        
        {
            $WhereClause .= " surname like \"%$lname%\"";
        }           


    $query = "SELECT * from foo

            " . $WhereClause . "

            LIMIT $start, $pagesize";
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>TimCadieux</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/453710/check-isset-and-check-of-undefined</guid>
		</item>
				<item>
			<title>Passing Form $_Post Content</title>
			<link>http://www.daniweb.com/web-development/php/threads/453708/passing-form-_post-content</link>
			<pubDate>Wed, 01 May 2013 15:25:56 +0000</pubDate>
			<description>How do I post the following through a form? $answers = $_POST['selected_answers$questionNr']; Every time I post the browser displays the following: I see the following error Notice: Undefined index: selected_answers{$questionNr} This is the code I am using to $_POST the form output: &lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot; &quot;http://www.w3.org/TR/html4/loose.dtd&quot;&gt; ...</description>
			<content:encoded><![CDATA[ <p>How do I post the following through a form?</p>

<pre><code>$answers = $_POST['selected_answers$questionNr'];
</code></pre>

<p>Every time I post the browser displays the following:</p>

<pre><code>I see the following error Notice: Undefined index: selected_answers{$questionNr}
</code></pre>

<p>This is the code I am using to $_POST the form output:</p>

<pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "<a href="http://www.w3.org/TR/html4/loose.dtd" rel="nofollow">http://www.w3.org/TR/html4/loose.dtd</a>"&gt;
    &lt;head&gt;
    &lt;style&gt;
    style1 {font-family: "Baskerville Old Face"}
.style2 {
    font-family: "Baskerville Old Face";
    font-size: 12px;
    font-style: italic;
}
body {
    background-color: #99CC66;
}
#text_disabled{
border:0;
font-size:10pt;
color:black;
}
&lt;/style&gt;
    &lt;title&gt;Question and Answer Read From Text File&lt;/title&gt;
    &lt;/head&gt;
    &lt;body&gt;
        &lt;form action="processor.php" method="POST"&gt;
        &lt;b&gt;&lt;u&gt; QUESTIONS AND ANSWERS QUIZ&lt;/u&gt;&lt;/b&gt; &lt;br /&gt;&lt;br /&gt;
&lt;?php
$openFile = fopen("questionandanswers.txt", "r") or exit ("unable to open the text       file");
$string = fread($openFile, filesize("questionandanswers.txt"));


//Regex to get from the first number to the string's end, so we ignore the Number Question... bit;
preg_match('/\d.*/', $string, $match);

//We get all the strings starting with a number until it finds another number (which will be the beginning of another question;
preg_match_all('/\d\D*/', $match[0], $results);

$qas = array(); // We prepare an array that will store the questions/answers
foreach($results[0] as $result)
{
    //Separating the question from the string with all the answers.
    list($question, $all_answers) = explode(':', $result);

    //Separating the different answers

    $answers_array = explode('.', $all_answers);

    //removes unnecesary spaces in the questions

    $answers_array_trimmed = array_map('trim', $answers_array);

    //Storing the question and the array with all the answers into the previously prepared array;

    $qas[] = array('question' =&gt; $question, 'answers' =&gt; $answers_array);
}
//Looping through the array and outputting all the info into a form;
        echo "&lt;script type=\"text/javascript\" src=\"js/form.js\"&gt;&lt;/script&gt;";

$questionNr = 0;    
foreach($qas as $k=&gt;$v)
    {
    echo "&lt;input id='question{$questionNr}' style='width:40%' type='text' value='".$v['question']."' name='questions[]' &gt;";
    echo '&lt;br /&gt;&lt;br /&gt;';
//Puts the answers of each question unique and in the form of radios
    foreach($v['answers'] as $answer)
        {
        echo "&lt;input type=\"radio\" name=\"selected_answers{$questionNr}[]\" value='\"' /&gt;";
        echo "$answer";
        echo '&lt;br/&gt;&lt;br /&gt;';
        }
    $questionNr++;
    }
?&gt;
&lt;input name= "submit" type="submit" value="Submit Answers"&gt;&amp;nbsp &lt;input type="reset" value ="Clear Answers"&gt;
&lt;/form&gt;
    &lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>Where exactly Am I going wrong because It seems not to be going through.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>ferdinandmucos</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/453708/passing-form-_post-content</guid>
		</item>
				<item>
			<title>JS variable to Php</title>
			<link>http://www.daniweb.com/web-development/php/threads/453706/js-variable-to-php</link>
			<pubDate>Wed, 01 May 2013 13:26:38 +0000</pubDate>
			<description>Hi all! I have a problem which I can't seem to fix. I would like to know is it possible to send a normal JS variable to a php page. I've tried the following and nothing seems to work. &lt;input type=&quot;submit&quot; value=&quot;Bookmark&quot; onclick=&quot;bookmark();&quot;&gt; function bookmark() { var pageNum = 2; ...</description>
			<content:encoded><![CDATA[ <p>Hi all!</p>

<p>I have a problem which I can't seem to fix. I would like to know is it possible to send a normal JS variable to a php page. I've tried the following and nothing seems to work.</p>

<pre><code>&lt;input type="submit" value="Bookmark" onclick="bookmark();"&gt;

function bookmark() {
  var pageNum = 2;
  var xmlhttp;
  if (window.XMLHttpRequest)
  {
     xmlhttp = new XMLHttpRequest();
  }else{
     alert("Not assigned!");
  }

   xmlhttp.open("GET", "Bookmark.php?pageNum="+pageNum, true);
   xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); with or without this it doesn't work
   xmlhttp.send();
   alert("Bookmark send!");
}
</code></pre>

<p>Then in the php:</p>

<pre><code>$pageNum = $_GET['pageNum']; 
echo "Page numbers:" + $pageNum;
</code></pre>

<p>I've tried post aswell and I've tried</p>

<p><code>var pageNum = 'pageNum=' + 2;</code><br /><code>xmlhttp.open("POST", "Bookmark.php", true);</code><br /><code>xmlhttp.send(pageNum);</code></p>

<p>php:</p>

<p><code>$pageNum = $_POST['pageNum'];</code><br /><code>echo "Page numbers:" + $pageNum;</code></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/453706/js-variable-to-php</guid>
		</item>
				<item>
			<title>How to send html email with all records from two tables?</title>
			<link>http://www.daniweb.com/web-development/php/threads/453690/how-to-send-html-email-with-all-records-from-two-tables</link>
			<pubDate>Wed, 01 May 2013 09:34:27 +0000</pubDate>
			<description>Hi! I need help with sending html email with all the records from two tables. I tried joint tables but it doesnt work as it should... Here is what i have session_start(); if(!@$_SESSION[&quot;UserID&quot;]) { header(&quot;Location: login.php&quot;); return; } ?&gt; &lt;?php $con=mysqli_connect(&quot;...&quot;); // Check connection if (mysqli_connect_errno()) { echo &quot;Failed to ...</description>
			<content:encoded><![CDATA[ <p>Hi!</p>

<p>I need help with sending html email with all the records from two tables. I tried joint tables but it doesnt work as it should... Here is what i have</p>

<pre><code>session_start();

if(!@$_SESSION["UserID"])
{
        header("Location: login.php");
        return;
}
?&gt;

&lt;?php
$con=mysqli_connect("...");
// Check connection
if (mysqli_connect_errno())
  {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
  }
$result = mysqli_query($con,"SELECT add_delete_record.content, handover.shipment_type FROM add_delete_record, handover ");

$body .= "&lt;html&gt;&lt;head&gt;
&lt;style type='text/css'&gt;
table.email {

    background-color: white;
    font-size:10px; 
    font-family:Arial;
}

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

table.email th {
    border-width: 1px;
    padding: 5px;
    border-style: inset;
    border-color: #cccccc;
    border-bottom:none;
    background-color: #f0f0f0;
    -moz-border-radius: ;
}

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

&lt;p align='center' &gt;&lt;font style='font-size:25px;'&gt;HANDOVER&lt;hr /&gt;&lt;/font&gt;&lt;/p&gt;&lt;br /&gt;";

while($row = mysqli_fetch_array($result))

$body .= "&lt;li&gt;" . $row['content'] . "&lt;/li&gt;";

$body .= "&lt;table border='0' cellpadding='0' cellspacing='0' class='email'&gt;&lt;thead&gt;
&lt;tr&gt;

&lt;th&gt;Shipment Type&lt;/th&gt;

&lt;/tr&gt;&lt;/thead&gt;";



$body .= "&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;" . $row['shipment_type'] . "&lt;/td&gt;&lt;/tr&gt;";

$body .= "&lt;/tbody&gt;&lt;/table&gt;&lt;/body&gt;&lt;/html&gt;";

$to = "email@email.com";
$subject = 'Handover';

$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

mail($to,$subject,$body,$headers);


mysqli_close($con);
</code></pre>

<p>If i want to send all records from one table, it works fine, but selecting records from two tables is a problem.</p>

<p>Any ideas?</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/453690/how-to-send-html-email-with-all-records-from-two-tables</guid>
		</item>
				<item>
			<title>Change Select value to Check boxes</title>
			<link>http://www.daniweb.com/web-development/php/threads/453688/change-select-value-to-check-boxes</link>
			<pubDate>Wed, 01 May 2013 08:08:55 +0000</pubDate>
			<description>How do I Change the select option to check boxes in the following code: foreach($qas as $k=&gt;$v) { echo &quot;&lt;input id='text' style='width:40%' type='text' value='&quot;.$v['question'].&quot;' name='questions[]' &gt;&quot;; echo &quot;&lt;select name='selected_answers[]'&gt;&quot;; foreach($v['answers'] as $answer){ echo &quot;&lt;option value='&quot;.$answer.&quot;'&gt;&quot;.$answer.&quot;&lt;/option&gt;&quot;; } echo &quot;&lt;/select&gt;&quot;; echo &quot;&lt;br/&gt;&lt;br/&gt;&quot;; }</description>
			<content:encoded><![CDATA[ <p>How do I Change the select option to check boxes in the following code:</p>

<pre><code>foreach($qas as $k=&gt;$v)
{
echo "&lt;input id='text' style='width:40%' type='text' value='".$v['question']."' name='questions[]' &gt;";
echo "&lt;select name='selected_answers[]'&gt;";
foreach($v['answers'] as $answer){
echo "&lt;option value='".$answer."'&gt;".$answer."&lt;/option&gt;";
}
echo "&lt;/select&gt;";
echo "&lt;br/&gt;&lt;br/&gt;";
}
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>ferdinandmucos</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/453688/change-select-value-to-check-boxes</guid>
		</item>
				<item>
			<title>Array Comparison and computation</title>
			<link>http://www.daniweb.com/web-development/php/threads/453637/array-comparison-and-computation</link>
			<pubDate>Tue, 30 Apr 2013 10:40:57 +0000</pubDate>
			<description>The two arrays does not compare and compute by adding one for every similar and 0 if otherwise I don't know what is wrong with the codes, but to me is seems fine. What might be the problem? &lt;html&gt; &lt;head&gt; &lt;title&gt;Chosen answers&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;pre&gt; &lt;?php //Posting of the chosen ...</description>
			<content:encoded><![CDATA[ <p>The two arrays does not compare and compute by adding one for every similar and 0 if otherwise I don't know what is wrong with the codes, but to me is seems fine. What might be the problem?</p>

<pre><code>&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Chosen answers&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;pre&gt;
&lt;?php
//Posting of the chosen answers

$answers = $_POST['selected_answers'];
echo '&lt;b&gt;&lt;u&gt;THE ANSWERS YOU HAVE CHOSEN ARE:&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;';
print_r($answers);

//Opening of the answers file, reading and printing it

$openFile = fopen("answers.txt", "r") or exit ("unable to open the answers file");
$fileContents = fread($openFile, filesize("answers.txt"));
fclose($openFile);
$delimiter = "  ";
$myArray = explode($delimiter, $fileContents);

$score = $score1 = $score2 = $score3 = $score4 = $score5 = $score6 = $score7 = $score8 = 0;

//Computation of marks scored for the answered questions

if ($answers[0] == $myArray[0])
{
    $score = 1;
}
if ($answers[1] == $myArray[1])
{
    $score1 = 1;
}
if ($answers[2] == $myArray[2])
{
    $score2 = 1;
}
if ($answers[3] == $myArray[3])
{
    $score3 = 1;
}
if ($answers[4] == $myArray[4])
{
    $score4 = 1;
}

if ($answers[5] == $myArray[5])
{
    $score5 = 1;
}

if ($answers[6] == $myArray[6])
{
    $score6 = 1;
}

if ($answers[7] == $myArray[7])
{
    $score7 = 1;
}
if ($answers[8] == $myArray[8])
{
    $score8 = 1;
}

$Total = $score + $score1 + $score2 + $score3 + $score4 + $score5 + $score6 + $score7 + $score8 ;
echo '&lt;br /&gt;';
echo "&lt;b&gt;&lt;u&gt;$Total&lt;/u&gt;&lt;/b&gt;";
?&gt;
&lt;/pre&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>ferdinandmucos</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/453637/array-comparison-and-computation</guid>
		</item>
				<item>
			<title>Button</title>
			<link>http://www.daniweb.com/web-development/php/threads/453636/button</link>
			<pubDate>Tue, 30 Apr 2013 10:22:58 +0000</pubDate>
			<description> &lt;a class=&quot;topLink&quot; href=&quot;input_image.php&quot;&gt;&lt;input type=&quot;submit&quot; name=&quot;productbaru&quot; value=&quot;Product Baru&quot;/&gt;&lt;/a&gt; If I press Product Baru why they do not take me to input_image.php ?</description>
			<content:encoded><![CDATA[ <pre><code> &lt;a class="topLink" href="input_image.php"&gt;&lt;input type="submit" name="productbaru" value="Product Baru"/&gt;&lt;/a&gt;
</code></pre>

<p>If I press Product Baru why they do not take me to input_image.php ?</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/453636/button</guid>
		</item>
				<item>
			<title>while loop problem - combining the result of looping</title>
			<link>http://www.daniweb.com/web-development/php/threads/453603/while-loop-problem-combining-the-result-of-looping</link>
			<pubDate>Tue, 30 Apr 2013 00:19:57 +0000</pubDate>
			<description> i have problem about while loop. this my code, error_reporting(E_ALL ^ (E_NOTICE | E_WARNING)); function multiexplode ($delimiters,$string) { $ready = str_replace($delimiters, $delimiters[0], $string); $launch = explode($delimiters[0], $ready); return $launch; } function my_replace($srch, $replace, $subject, $skip=1){ $subject = explode($srch, $subject.' ', $skip+1); $subject[$skip] = str_replace($srch, $replace, $subject[$skip]); while (($tmp = array_pop($subject)) ...</description>
			<content:encoded><![CDATA[ <p>i have problem about while loop. this my code,</p>

<pre><code>error_reporting(E_ALL ^ (E_NOTICE | E_WARNING)); 

function multiexplode ($delimiters,$string) {
    $ready = str_replace($delimiters, $delimiters[0], $string);
    $launch = explode($delimiters[0], $ready);
    return  $launch;
}

function my_replace($srch, $replace, $subject, $skip=1){
    $subject = explode($srch, $subject.' ', $skip+1);
    $subject[$skip] = str_replace($srch, $replace, $subject[$skip]);
    while (($tmp = array_pop($subject)) == '')
        ;

    $subject[]=$tmp;
    return implode($srch, $subject);
}

function replace_element($str,$search,$replace,$num) {
    $num = $num - 1;
    $pieces = explode(',',$str);
    if($pieces[$num] == $search) {
        $pieces[$num] = $replace;
    }
    return implode(',',$pieces);
} 

function returnFormat($template, $subject){
    preg_match_all("/\|/", $template, $matches, PREG_OFFSET_CAPTURE);
    foreach($matches[0] as $v) 
        $subject = substr_replace($subject, "|", $v[1], 1);

    return $subject;
}   

$replace = "|"; $pattern = "\|";

function combine_arrays( $array1, $array2 )
{
    $size = max( count($array1), count($array2) );
    $data = array();
    for ($i=0; $i &lt; $size; $i++) { 
        $thisVal = ( $array1[$i] == 'JJJJ' OR $array2[$i] == 'JJJJ' ) ? 'JJJJ' : $array1[$i];
        $data[] = $thisVal;
    }       
    return $data;
}   

$s=mysql_query("select * from tab"); 
while ($j=mysql_fetch_array($s)) 
{ 
    $string=$j[1]; 
    $data=$j[2]; 
    $char = '3';
    $string = str_replace('|', '', $string);    
    $positions = array();
    $pos = -1; 
    $b=0; 
    while (($pos = strpos($string, $char, $pos+1)) !== false) 
    {
        {
            $positions[] = $pos+1; 
        }

        $result2 = implode(',', $positions);
        $res = explode(',',$result2); 
        $exp = multiexplode(array(",","|"),$data);
        $eyz= my_replace('|', ',', $data, 0);       
        $z=1; 
        $y=1;
        foreach ($res as $val) {
            $res2[$z]=$val; 
            $valz = $res2[$z];
            $z++; 
        }
        foreach ($exp as $value) {
            $exp2[$y]=$value; 
            $vals = $exp2[$valz];
            $y++; 
        }     
        $items = explode(',',$eyz); 
        $occurences = array_count_values($items);   
        $st=$occurences[$vals];
        $fix=replace_element($eyz,$vals,'JJJJ',$valz);
        preg_match_all("/$pattern/", $data, $matches, PREG_OFFSET_CAPTURE);
        foreach($matches[0] as $v) 
            $fix = substr_replace($fix, $replace, $v[1], 1);

        $arrayToCombine[] = multiexplode([","], $fix);
        $b++;
    }
    echo(implode(",",combine_arrays( $arrayToCombine[0], $arrayToCombine[1] )));
} //end while
</code></pre>

<p>i have a table, the name is tab, i have, 3 field, ID, STRING, DATA, and 2 content.</p>

<pre><code>ID = 1
string = 101131110|101113110| 
data = 1020,0000,2022,1023,1024,1025,1024,1025,0000|1020,0000,2022,1023,1027,1025,1024,1025,0000|
ID = 2
string = 101111310|101111310| 
data = 1020,0000,2022,1023,1024,1025,1024,1025,0000|1020,0000,2022,1023,1027,1025,1024,1025,0000|
</code></pre>

<p>this script to change the order in the data field into JJJJ to the position in the string field that has the number 3, for ID 1 i get result : this is true</p>

<pre><code>1020,0000,2022,1023,JJJJ,1025,1024,1025,0000|1020,0000,2022,1023,1027,JJJJ,1024‌,1025,0000|
</code></pre>

<p>Now, i have problem about while loop.<br />
The following are two examples of the output of the data<br />
for ID 1 (true)</p>

<pre><code>1020,0000,2022,1023,JJJJ,1025,1024,1025,0000|1020,0000,2022,1023,1027,JJJJ,1024‌,1025,0000|
</code></pre>

<p><strong>and</strong><br />
for ID 2 (false)</p>

<pre><code>1020,0000,2022,1023,JJJJ,1025,1024,1025,0000|1020,0000,2022,1023,1027,JJJJ,1024,‌1025,0000|
</code></pre>

<p>if only one field content, e.g only ID 1, this script works well, but if there are two or more content at field and if i use while loop like as my code the results echo: the second data, and others, to be the same as the first like the example above.</p>

<p>how to fix, can you tell me how I can solve this problem while loop.</p>

<p>the correct result should be a<br />
for ID 1 (true)</p>

<pre><code>1020,0000,2022,1023,JJJJ,1025,1024,1025,0000|1020,0000,2022,1023,1027,JJJJ,1024‌,1025,0000|
</code></pre>

<p><strong>and</strong><br />
for ID 2 (true)</p>

<pre><code>1020,0000,2022,1023,1024,1025,JJJJ,1025,0000|1020,0000,2022,1023,1024,1025,JJJJ,1025,0000|
</code></pre>

<p>thanks in advance.</p>

<p>regards,</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>ivanichi</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/453603/while-loop-problem-combining-the-result-of-looping</guid>
		</item>
				<item>
			<title>Silly q, but it is late on friday</title>
			<link>http://www.daniweb.com/web-development/php/threads/453586/silly-q-but-it-is-late-on-friday</link>
			<pubDate>Mon, 29 Apr 2013 19:23:53 +0000</pubDate>
			<description>I have a very simple class for date display: class timing { public $today; public $year; function __construct() { date_default_timezone_set('GMT'); } function now() { return $this-&gt;today = date(&quot;D j M Y&quot;); } function year() { return $this-&gt;year = date(&quot;Y&quot;); } } I am pulling in using: $x = new timing(); ...</description>
			<content:encoded><![CDATA[ <p>I have a very simple class for date display:</p>

<pre><code>class timing {

    public $today;
    public $year;

    function __construct() {
        date_default_timezone_set('GMT');
    }

    function now() {
        return $this-&gt;today = date("D j M Y");
    }

    function year() {
        return $this-&gt;year = date("Y");
    }

}
</code></pre>

<p>I am pulling in using:</p>

<pre><code>$x = new timing();
echo $x-&gt;today();
</code></pre>

<p>But i get nothing back. What am i missing :'(</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>Squidge</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/453586/silly-q-but-it-is-late-on-friday</guid>
		</item>
				<item>
			<title>PHP/MYSQL query result iteration with additional task</title>
			<link>http://www.daniweb.com/web-development/php/threads/453570/phpmysql-query-result-iteration-with-additional-task</link>
			<pubDate>Mon, 29 Apr 2013 13:26:01 +0000</pubDate>
			<description>Hi all: I'm trying to pull from a table all values of a specific row (accountids) and would like to iterate through each query result while perform a specified task with each value. Example: The following q-- $get_acctids=&quot;select accountid from company_info&quot;; $result = mysql_query($get_acctids) or die(mysql_error()); while($row = mysql_fetch_array($result)){ $id_num= ...</description>
			<content:encoded><![CDATA[ <p>Hi all:</p>

<p>I'm trying to pull from a table all values of a specific row (accountids) and would like to iterate through each query result while perform a specified task with each value.</p>

<p>Example: The following q--</p>

<pre><code>$get_acctids="select accountid from company_info";
$result = mysql_query($get_acctids) or die(mysql_error());
while($row = mysql_fetch_array($result)){
  $id_num= $row['accountid'];
  }
</code></pre>

<p>Outputs the following ids:</p>

<pre><code>425786
663890
319721
818284
121897
703272
</code></pre>

<p>Now, I would like to iterate through each id while executing another script (at a different location) with each id as a variable being passed to that script.</p>

<p>I would appreciate some thoughts on this!</p>

<p>Best,</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>mbarandao</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/453570/phpmysql-query-result-iteration-with-additional-task</guid>
		</item>
				<item>
			<title>Clean Url&#039;s</title>
			<link>http://www.daniweb.com/web-development/php/threads/453527/clean-urls</link>
			<pubDate>Sun, 28 Apr 2013 21:39:44 +0000</pubDate>
			<description>Hi, i'm trying to do clean url's using .htaccess but i'm having problems. Here i have my .htaccess: &lt;IfModule mod_rewrite.c&gt; RewriteEngine on RewriteRule ^([a-z]+)\/([0-9]+)\/?$ parameter_letter_and_number.php?param=$1&amp;param2=$2 [NC] RewriteRule ^([a-z]+)\/?$ $1.php [NC] RewriteRule ^([0-9]+)\/?$ parameter_number.php?param=$1 [NC] RewriteRule ^([0-9_]+)\/?$ parameter_number_and_underscore.php?param=$1 [NC] &lt;/IfModule&gt; Here is my parameters page so i can test: &lt;!DOCTYPE HTML&gt; ...</description>
			<content:encoded><![CDATA[ <p>Hi, i'm trying to do clean url's using .htaccess but i'm having problems.</p>

<p>Here i have my .htaccess:</p>

<pre><code>&lt;IfModule mod_rewrite.c&gt;

    RewriteEngine on

    RewriteRule ^([a-z]+)\/([0-9]+)\/?$ parameter_letter_and_number.php?param=$1&amp;param2=$2 [NC]

    RewriteRule ^([a-z]+)\/?$ $1.php [NC]

    RewriteRule ^([0-9]+)\/?$ parameter_number.php?param=$1 [NC]

    RewriteRule ^([0-9_]+)\/?$ parameter_number_and_underscore.php?param=$1 [NC]

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

<p>Here is my parameters page so i can test:</p>

<pre><code>&lt;!DOCTYPE HTML&gt;
&lt;html&gt;
    &lt;head&gt;
        &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt;
        &lt;title&gt;Clean URL tutorial with .htaccess and PHP by <a href="http://codeofaninja.com/" rel="nofollow">http://codeofaninja.com/</a>&lt;/title&gt;

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

&lt;h1&gt;Parameter: Letter and Number ONLY. This is parameter_letter_and_number.php&lt;/h1&gt;
&lt;?php 
echo "PARAMETER VALUE 1: " . $_REQUEST['param'];
echo "&lt;br /&gt;";
echo "PARAMETER VALUE 2: " . $_REQUEST['param2'];
?&gt;

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

<p>it should appear somthing like this:<br />
<a href="http://localhost/clean-urls/post/143" rel="nofollow">http://localhost/clean-urls/post/143</a></p>

<p>but in that way gives me 404 Error it works only if the url is <a href="http://localhost/clean-urls/parameter_letter_and_number.php?param=post&amp;param2=143" rel="nofollow">http://localhost/clean-urls/parameter_letter_and_number.php?param=post&amp;param2=143</a></p>

<p>Can someone help me please?</p>

<p>Thank You,<br />
PF2G</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/453527/clean-urls</guid>
		</item>
				<item>
			<title>trying to display query result from db into a text area</title>
			<link>http://www.daniweb.com/web-development/php/threads/453522/trying-to-display-query-result-from-db-into-a-text-area</link>
			<pubDate>Sun, 28 Apr 2013 20:02:38 +0000</pubDate>
			<description>here is the full page code sorry its bit long but i have no clue where i went wrong all i get when i run this is the page with its background and an empty text area basicly i am trying to get the info from a table in my ...</description>
			<content:encoded><![CDATA[ <p>here is the full page code  sorry its bit long  but i have no clue where i went wrong<br />
all i get when i run this is the page with its background and an empty text area</p>

<p>basicly i am trying to get the info from a table in my database and display them in an array into a text area</p>

<pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "<a href="http://www.w3.org/TR/html4/loose.dtd" rel="nofollow">http://www.w3.org/TR/html4/loose.dtd</a>"&gt;

&lt;html&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
&lt;title&gt;Untitled Page&lt;/title&gt;
&lt;style type="text/css"&gt;
body
{
   background-color: #FFFFFF;
   background-image: url(images/backgroundlou.jpg);
   background-repeat: no-repeat;
   color: #000000;
}
a    
{    
   color: #0000FF;    
   text-decoration: underline;    
}    
a:visited    
{    
   color: #800080;    
}    
a:active    
{    
   color: #FF0000;    
}    
a:hover    
{    
   color: #0000FF;    
   text-decoration: underline;    
}    
#TextArea1
{
   border: 1px #C0C0C0 solid;
   background-color: #FFFFFF;
   color :#000000;
   font-family: Arial;
   font-size: 13px;    
   text-align: left;    
}    
&lt;/style&gt;    
&lt;/head&gt;    
&lt;body&gt;
&lt;?php
// information pour la connection à le DB
$host = 'localhost';
$user = 'userd';
$pass = 'nopass';
$db = 'dbname';

// connection à la DB
$link = mysql_connect ($host,$user,$pass) or die ('Erreur : '.mysql_error() ) ;
mysql_select_db($db) or die ('Erreur :'.mysql_error()) ;

// requête SQL qui compte le nombre total d'enregistrements dans la table et qui
//récupère tous les enregistrements
$select = 'SELECT nom,continent,coord FROM test';
$result = mysql_query($select,$link) or die ('Erreur : '.mysql_error() );
$total = mysql_num_rows($result);    

// if result we display.
if($total) {    
echo '&lt;textarea name="TextArea1" id="TextArea1" style="position:absolute;left:379px;top:190px;width:592px;height:266px;z-index:0;" rows="15" cols="93"&gt; "\n";
        // première ligne on affiche les titres prénom et surnom dans 2 colonnes
       echo '&lt;table&gt;';
        echo '&lt;tr&gt;';
        echo '&lt;td&gt;&lt;b&gt;&lt;u&gt;Continent&lt;/u&gt;&lt;/b&gt;&lt;/td&gt;';
        echo '&lt;td&gt; &gt;&lt;b&gt;&lt;u&gt;Coord&lt;/u&gt;&lt;/b&gt;&lt;/td&gt;';
          echo '&lt;td&gt;&lt;b&gt;&lt;u&gt;Player&lt;/u&gt;&lt;/b&gt;&lt;/td&gt;';
        echo '&lt;/tr&gt;'."\n";
    // lecture et affichage des résultats sur 2 colonnes, 1 résultat par ligne.    
    while($row = mysql_fetch_array($result)) {
        echo '&lt;tr&gt;';
        echo '&lt;td&gt;'.$row['continent'].'&lt;/td&gt;';
        echo '&lt;td&gt;'.$row['coord'].'&lt;/td&gt;';
          echo '&lt;td&gt;'.$row['nom'].'&lt;/td&gt;';
        echo '&lt;/tr&gt;'."\n";
    }
    echo '&lt;/table&gt;'."\n";
    }
else echo 'Pas d\'enregistrements dans cette table...';

// on libère le résultat
mysql_free_result($result);
?&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>jethaya</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/453522/trying-to-display-query-result-from-db-into-a-text-area</guid>
		</item>
				<item>
			<title>Create visitor counter using sessions</title>
			<link>http://www.daniweb.com/web-development/php/threads/453486/create-visitor-counter-using-sessions</link>
			<pubDate>Sun, 28 Apr 2013 05:46:24 +0000</pubDate>
			<description>hello there thanks for help mke in many questions, I've learened a lot from this great community I have question about creating visitor counter,daily,monthly,yearly I've created a counter depending on IP address but all my costomer are in the same IP so this counter will not be accurate, So I ...</description>
			<content:encoded><![CDATA[ <p>hello there thanks for help mke in many questions, I've learened a lot from this great community<br />
I have question about creating visitor counter,daily,monthly,yearly<br />
I've created a counter depending on IP address but all my costomer are in the same IP so this counter will not be accurate, So I used session ID as an Identifire, so every visitor enter the site a session will created and saved with time into database, and the total of these sessions will be the counter for visitors</p>

<ul><li>I want to know how to seperate daily visitor from monthly ?</li>
<li>I've created a second table to store final result so I can clear the visitors table.</li>
</ul>

<h2>visitor table</h2>

<p>session_id  --  time</p>

<p>here is the results for saving<br /><img src="/attachments/fetch/L2ltYWdlcy9hdHRhY2htZW50cy8zL2U0NjI2NjEwOWFjMTg4NDVmYzM1YmMzNzMzOTdkMmIwLnBuZw%3D%3D/270" alt="e46266109ac18845fc35bc373397d2b0" /></p>

<p>and this code I used for saving</p>

<pre><code>&lt;?php
session_start(); 
$session_id = session_id();
counters();
function counters() {
    global $session_id;
    $time = time();
    $num = mysql_num_rows(mysql_query("SELECT * FROM online_visitors WHERE session_id='{$session_id}' LIMIT 1"));
    if($num != 1){
    $sql = "INSERT INTO online_visitors VALUES('{$session_id}','{$time}')";
    $query = @mysql_query($sql) or die("Error");
    }
}
</code></pre>
 ]]></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/453486/create-visitor-counter-using-sessions</guid>
		</item>
				<item>
			<title>Display questions answers and Total score</title>
			<link>http://www.daniweb.com/web-development/php/threads/453485/display-questions-answers-and-total-score</link>
			<pubDate>Sun, 28 Apr 2013 05:26:21 +0000</pubDate>
			<description>Having a text file: $string = '1) The most important feature of spiral model is: requirement analysis. risk management. quality management. configuration management 2) The worst type of coupling is: Data coupling. control coupling. stamp coupling. content coupling 3) One of the fault base testing techniques is: unit testing. beta ...</description>
			<content:encoded><![CDATA[ <p>Having a text file:</p>

<pre><code>$string = 
'1) The most important feature of spiral model is: requirement analysis. risk management. quality management. configuration management 2)   The worst type of coupling is: Data coupling. control coupling. stamp coupling. content coupling 3) One of the fault base testing techniques is: unit testing. beta testing. Stress testing. mutation testing 4)    A fault simulation testing technique is: Mutation testing. Stress testing. Black box testing. White box testing. 5) RS is also known as specification of: White box testing. Stress testing. Integrated testing. Black box testing 6)   Which of these terms is a level name in the Capability Maturity Model?: Ad hoc. Repeatable. Reusable. Organized 7)  FP-based estimation techniques require problem decomposition based on?: information domain values. project schedule. software functions. process activities 8)  What types of models are created during software requirements analysis?: Functional and behavioral. Algorithmic and data structure. Architectural and structural. Usability and reliability 9)  Which of the following is not an attribute of software engineering: Efficiency. Scalability. Dependability. Usability'  
</code></pre>

<p>And a code that reads the question and answers text file and put in an html form format:</p>

<pre><code>&lt;html&gt;
    &lt;head&gt;
    &lt;style&gt;
#text_disabled{
border:0;
font-size:10pt;
color:black;
}
&lt;/style&gt;
    &lt;title&gt;Question and Answer Read From Text File&lt;/title&gt;
    &lt;/head&gt;
    &lt;body&gt;
        &lt;form action="processor.php" method="POST" align="center"&gt;
        &lt;b&gt;&lt;u&gt; QUESTIONS AND ANSWERS QUIZ&lt;/u&gt;&lt;/b&gt; &lt;br /&gt;&lt;br /&gt;
&lt;?php
$openFile = fopen("questionandanswers.txt", "r") or exit ("unable to open the text       file");
$string = fread($openFile, filesize("questionandanswers.txt"));

//Regex to get from the first number to the string's end, so we ignore the Number Question... bit;
preg_match('/\d.*/', $string, $match);

//We get all the strings starting with a number until it finds another number (which will be the beginning of another question;
preg_match_all('/\d\D*/', $match[0], $results);

$qas = array(); // We prepare an array that will store the questions/answers
foreach($results[0] as $result)
{
    //Separating the question from the string with all the answers.
    list($question, $all_answers) = explode(':', $result);

    //Separating the different answers
    $answers_array = explode('.', $all_answers);

    //Storing the question and the array with all the answers into the previously prepared array;
    $qas[] = array('question' =&gt; $question, 'answers' =&gt; $answers_array);
}

//Looping through the array and outputting all the info into a form;
foreach($qas as $k=&gt;$v)
{
echo "&lt;input id='text_disabled' style='width:40%' type='text' value='".$v['question']."' name='questions[]' disabled&gt;";
echo "&lt;select name='selected_answers[]'&gt;";
foreach($v['answers'] as $answer){
echo "&lt;option value='".$answer."'&gt;".$answer."&lt;/option&gt;";
}
echo "&lt;/select&gt;";
echo "&lt;br/&gt;&lt;br/&gt;";
}
?&gt;
&lt;input type="submit" value="Submit Answers"&gt;&amp;nbsp &lt;input type="reset" value ="Clear Answers"&gt;
&lt;/form&gt;
    &lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>Upon submission I am trying to compute the total marks scored after undertaking the test, plus diplaying the answered questions and if possible the other answers too... This is the furthest I have gone but it seems to be not working, Kindly assist me to get this right. Thank you.<br />
These are the codes:</p>

<pre><code>&lt;pre&gt;
&lt;?php
print_r($_POST[question])
$answers = $_POST['selected_answers'];
$total=0;
//Question one
if ($answers[0]=="risk management")
{
$total++;
}
else
{
print_r($answers[0]);
}
echo '&lt;br /&gt;';
//second question
if ($answers[1]=="Data coupling")
{
$total++;
}
else
{
print_r($answers[1]);
}

echo '&lt;br /&gt;';
//third question
if ($answers[2]=="Unit testing")
{
$total++;
}
else
{
print_r($answers[2]);
}

echo '&lt;br /&gt;';
//fourth question

if ($answers[3]=="Mutation testing")
{
$total++;
}
else
{
print_r($answers[3]);
}

echo '&lt;br /&gt;';
//fifth question

if ($answers[4]=="white box testing")
{
$total++;
}
else
{
print_r($answers[4]);
}
echo '&lt;br /&gt;';
//sixth question

if ($answers[5]=="Ad hoc")
{
$total++;
}
else
{
print_r($answers[5]);
}
echo '&lt;br /&gt;';
//seventh question
if ($answers[6]=="information domain values")
{
$total++;
}
else
{
print_r($answers[6]);
}

echo '&lt;br /&gt;';
//eigth question

if ($answers[7]=="Functional and behavioral")
{
$total++;
}
else
{
print_r($answers[7]);
}

echo '&lt;br /&gt;';
//nineth question

if ($answers[8]=="Efficiency")
{
$total++;
}
else
{
print_r($answers[8]);
}

echo '&lt;br /&gt;';
echo '&lt;br /&gt;';
//code to generate the total score 
    echo "&lt;b&gt;Total Outcome = $total &lt;/b&gt;";
?&gt;
&lt;/pre&gt;
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>ferdinandmucos</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/453485/display-questions-answers-and-total-score</guid>
		</item>
				<item>
			<title>Session hijacking</title>
			<link>http://www.daniweb.com/web-development/php/threads/453434/session-hijacking</link>
			<pubDate>Sat, 27 Apr 2013 08:32:27 +0000</pubDate>
			<description>Hello guys today when i checked my script I noticed my sessions are not protected, when user log in his **username** stored in session variable lets call it $_SESSION['user'], and I use this session variable in many function ex. when uploading a file the name of user taken from session ...</description>
			<content:encoded><![CDATA[ <p>Hello guys<br />
today when i checked my script I noticed my sessions are not protected,<br />
when user log in his <strong>username</strong> stored in session variable lets call it $_SESSION['user'], and I use this session variable in many function<br />
ex. when uploading a file the name of user taken from session var., when check this is a user or admin use the session var.</p>

<pre><code>check_admin ($SESSION['user']);
function check_admin($var) {
//SQL search for $var in TABLE WHERE is admin = 1
// IF success go to admin panel
// else go to login page 
}
</code></pre>

<p>so I thought if someone create a session with the same name of mine $_SESSION['user'] and entered the admin control panel he will get acces I think, because I check the name of admin only,<br />
how can I protect session so only the one with username and password can enter the script.</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/453434/session-hijacking</guid>
		</item>
				<item>
			<title>replace character referring to another character sequence in the array</title>
			<link>http://www.daniweb.com/web-development/php/threads/453419/replace-character-referring-to-another-character-sequence-in-the-array</link>
			<pubDate>Sat, 27 Apr 2013 02:54:32 +0000</pubDate>
			<description>Assuming i have $a='1024,1025,0000|1020,0000|'; $b='1024,1025,0000,1020,0000,'; i want replace commas (,) in $b with (|) so that $b is equal to $a like this $b='1024,1025,0000|1020,0000|'; if i use $ob=str_replace(&quot;0000,&quot;,&quot;0000|&quot;,$b); echo $ob; output works : 1024,1025,0000|1020,0000| But, how to make it with PHP where did i put that this refers to the ...</description>
			<content:encoded><![CDATA[ <p>Assuming i have</p>

<pre><code>$a='1024,1025,0000|1020,0000|';
$b='1024,1025,0000,1020,0000,';
</code></pre>

<p>i want replace commas (,) in $b with (|) so that $b is equal to $a like this</p>

<pre><code>$b='1024,1025,0000|1020,0000|';
</code></pre>

<p>if i use</p>

<pre><code>$ob=str_replace("0000,","0000|",$b);
echo $ob;
</code></pre>

<p>output works :</p>

<pre><code>1024,1025,0000|1020,0000|
</code></pre>

<p>But, how to make it with PHP where did i put that this refers to the $a and what if it does not always 0000, with other purposes may be i want replace character referring to another character sequence in the array, so that $b is equal to $a, other sample :</p>

<p>eg :</p>

<pre><code>$a='1024,1025,1234|1020,0000|';
$b='1024,1025,1234,1020,0000,';
</code></pre>

<p>output:</p>

<pre><code>$b='1024,1025,1234|1020,0000|';
</code></pre>

<p>thanks to your help.</p>

<p>regards,</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>ivanichi</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/453419/replace-character-referring-to-another-character-sequence-in-the-array</guid>
		</item>
				<item>
			<title>pritaeas Configurable Class</title>
			<link>http://www.daniweb.com/web-development/php/threads/453398/pritaeas-configurable-class</link>
			<pubDate>Fri, 26 Apr 2013 15:28:42 +0000</pubDate>
			<description>Hi All, I am using pritaeas found here: http://www.daniweb.com/web-development/php/code/430455/configurable-table-class I am pulling in the data and my brain has taken a vacation. I am using $arr = $dsn-&gt;getRecord('memeber', array('user_id' =&gt; 2)); But cannot for the life of me pull the data out. I get duplication as well from the data: ...</description>
			<content:encoded><![CDATA[ <p>Hi All,</p>

<p>I am using pritaeas found here:<br />
<a href="http://www.daniweb.com/web-development/php/code/430455/configurable-table-class" rel="nofollow">http://www.daniweb.com/web-development/php/code/430455/configurable-table-class</a></p>

<p>I am pulling in the data and my brain has taken a vacation.</p>

<p>I am using</p>

<pre><code>$arr = $dsn-&gt;getRecord('memeber', array('user_id' =&gt; 2));
</code></pre>

<p>But cannot for the life of me pull the data out.</p>

<p>I get duplication as well from the data:</p>

<pre><code>Array ( [0] =&gt; Array ( [user_id] =&gt; 2 [0] =&gt; 2 [loginName] =&gt; UserName [1] =&gt; UserName [password] =&gt; 30c2927b75d50c71550145ea7aebded6 [2] =&gt; 30c2927b75d50c71550145ea7aebded6 [email] =&gt; email@hotmail.co.uk [3] =&gt; email@hotmail.co.uk ) ) 
</code></pre>

<p>Can someone put me straight on this :)</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>Squidge</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/453398/pritaeas-configurable-class</guid>
		</item>
				<item>
			<title>How to Preset or Pre-Attach a File in PHP File Upload</title>
			<link>http://www.daniweb.com/web-development/php/threads/453357/how-to-preset-or-pre-attach-a-file-in-php-file-upload</link>
			<pubDate>Fri, 26 Apr 2013 06:24:42 +0000</pubDate>
			<description>Hello Everyone, I need your help, can you please tell me how to create a text field for file upload with HTML ? I presently have this code in my form for file upload to the webserver; `&lt;input name=&quot;userfile&quot; type=&quot;file&quot; size=&quot;50&quot;&gt;`, this allows someone to browse file from their computer ...</description>
			<content:encoded><![CDATA[ <p>Hello Everyone,</p>

<p>I need your help, can you please tell me how to create a text field for file upload with HTML ?</p>

<p>I presently have this code in my form for file upload to the webserver;<br /><code>&lt;input name="userfile" type="file" size="50"&gt;</code>, this allows someone to browse file from their computer to upload a file. How ever this is not what I want.</p>

<p>What I want is a form field that allows me to preset a file that can be uploaded to the server.</p>

<p>So far this is what I have got <code>&lt;input name="userfile" type="file" size="50" value="a.html"&gt;</code> adding value="a.html" to the field. But it's not working.</p>

<p>Can you guys please help me out? thanks in advance.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>Angle90</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/453357/how-to-preset-or-pre-attach-a-file-in-php-file-upload</guid>
		</item>
				<item>
			<title>Multiplemysql records from form</title>
			<link>http://www.daniweb.com/web-development/php/threads/453335/multiplemysql-records-from-form</link>
			<pubDate>Thu, 25 Apr 2013 19:23:36 +0000</pubDate>
			<description>Hi, I need help here. I have a for with multiple text inputs. input1 is link, input2 is description. This is repeated a number of time. Each link and description is one record, but I cant igure out how to add them to mysql as such. If I fill in ...</description>
			<content:encoded><![CDATA[ <p>Hi, I need help here.<br />
I have a for with multiple text inputs. input1 is link, input2 is description.<br />
This is repeated a number of time.</p>

<p>Each link and description is one record, but I cant igure out how to add them to mysql as such.<br />
If I fill in 2 link/desription it adds 4  records to mysql so I have 2 of each!</p>

<p>Can anyone help me out her?</p>

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

<pre><code>&lt;form class="form1" action="linksaddform.php" method="post" enctype="multipart/form-data" name="links_upload_form" id="links_upload_form" style="margin-bottom:0px;"&gt;
                     &lt;p&gt;&lt;span class='text'&gt;&lt;b&gt;Link&lt;/b&gt;&lt;/span&gt; &lt;input type=text name="alink[0]"&gt;
                     &lt;span class='text'&gt;&lt;b&gt;Description&lt;/b&gt;&lt;/span&gt; &lt;input type=text name="aname[0]"&gt;&lt;br /&gt;
                     &lt;span class='text'&gt;&lt;b&gt;Link&lt;/b&gt;&lt;/span&gt; &lt;input type=text name="alink[1]"&gt;
                     &lt;span class='text'&gt;&lt;b&gt;Description&lt;/b&gt;&lt;/span&gt; &lt;input type=text name="aname[1]"&gt;&lt;br /&gt;
                     &lt;span class='text'&gt;&lt;b&gt;Link&lt;/b&gt;&lt;/span&gt; &lt;input type=text name="alink[2]"&gt;
                     &lt;span class='text'&gt;&lt;b&gt;Description&lt;/b&gt;&lt;/span&gt; &lt;input type=text name="aname[2]"&gt;&lt;br /&gt;
                     &lt;span class='text'&gt;&lt;b&gt;Link&lt;/b&gt;&lt;/span&gt; &lt;input type=text name="alink[3]"&gt;
                     &lt;span class='text'&gt;&lt;b&gt;Description&lt;/b&gt;&lt;/span&gt; &lt;input type=text name="aname[3]"&gt;&lt;br /&gt;
                     &lt;span class='text'&gt;&lt;b&gt;Link&lt;/b&gt;&lt;/span&gt; &lt;input type=text name="alink[4]"&gt;
                     &lt;span class='text'&gt;&lt;b&gt;Description&lt;/b&gt;&lt;/span&gt; &lt;input type=text name="aname[4]"&gt;&lt;br /&gt;
                     &lt;span class='text'&gt;&lt;b&gt;Link&lt;/b&gt;&lt;/span&gt; &lt;input type=text name="alink[5]"&gt;
                     &lt;span class='text'&gt;&lt;b&gt;Description&lt;/b&gt;&lt;/span&gt; &lt;input type=text name="aname[5]"&gt;&lt;br /&gt;
                     &lt;span class='text'&gt;&lt;b&gt;Link&lt;/b&gt;&lt;/span&gt; &lt;input type=text name="alink[6]"&gt;
                     &lt;span class='text'&gt;&lt;b&gt;Description&lt;/b&gt;&lt;/span&gt; &lt;input type=text name="aname[6]"&gt;&lt;br /&gt;
                     &lt;span class='text'&gt;&lt;b&gt;Link&lt;/b&gt;&lt;/span&gt; &lt;input type=text name="alink[7]"&gt;
                     &lt;span class='text'&gt;&lt;b&gt;Description&lt;/b&gt;&lt;/span&gt; &lt;input type=text name="aname[7]"&gt;&lt;br /&gt;
                     &lt;span class='text'&gt;&lt;b&gt;Link&lt;/b&gt;&lt;/span&gt; &lt;input type=text name="alink[8]"&gt;
                     &lt;span class='text'&gt;&lt;b&gt;Description&lt;/b&gt;&lt;/span&gt; &lt;input type=text name="aname[8]"&gt;&lt;/p&gt;
                     &lt;input type="submit" name="submit" value="Upload Links" /&gt;       
                     &lt;input name="submitted_form" type="hidden" id="submitted_form" value="links_upload_form" /&gt;
                  &lt;/form&gt;
                  &lt;?php
                  include '../inc/connect.php';

                       if (isset($_POST['submit'])){  
                          foreach($_REQUEST['alink'] as $alink){
                             if (($alink != ''){
                                foreach($_REQUEST['aname'] as $aname ){
                                   if ($aname != ''){
                                      mysql_query("INSERT INTO links  VALUES ('', '$alink', '$aname')");
                                   }
                                 }
                             }
                           }
                        }
                    ?&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/453335/multiplemysql-records-from-form</guid>
		</item>
				<item>
			<title>Adding multiple records in mysql from form</title>
			<link>http://www.daniweb.com/web-development/php/threads/453311/adding-multiple-records-in-mysql-from-form</link>
			<pubDate>Thu, 25 Apr 2013 13:28:32 +0000</pubDate>
			<description>I have an html form that has 10 text field for trhe user too enter dates into. When the user clicks the submit button each text field should be added as a new record to a mysql table. The way I have it now if only 2 are filled in, ...</description>
			<content:encoded><![CDATA[ <p>I have an html form that has 10 text field for trhe user too enter dates into. When the user clicks the submit button each text field should be added as a new record to a mysql table.<br />
The way I have it now if only 2 are filled in, rateher than making only 2 entries with the post data, it makes 20: the 2 that should be there and 8 empty ones, then repeats this, making 20.<br />
Can anyone offer assistance?</p>

<p>Here is my code as it stands.</p>

<pre><code>&lt;form class='form1' action='appointmentaddform.php' method='post' enctype='multipart/form-data' name='add_news-form' id='add_news_form'&gt;
                     &lt;p&gt;&lt;b&gt;&lt;span class='text'&gt;Date + Time&lt;span&gt;&lt;/b&gt; &lt;input type=text size='50' name='adate[0]' /&gt;&lt;br /&gt;
                     &lt;b&gt;&lt;span class='text'&gt;Date + Time&lt;span&gt;&lt;/b&gt; &lt;input type=text size='50' name='adate[1]' /&gt;&lt;br /&gt;
                     &lt;b&gt;&lt;span class='text'&gt;Date + Time&lt;span&gt;&lt;/b&gt; &lt;input type=text size='50' name='adate[2]' /&gt;&lt;br /&gt;
                     &lt;b&gt;&lt;span class='text'&gt;Date + Time&lt;span&gt;&lt;/b&gt; &lt;input type=text size='50' name='adate[3]' /&gt;&lt;br /&gt;
                     &lt;b&gt;&lt;span class='text'&gt;Date + Time&lt;span&gt;&lt;/b&gt; &lt;input type=text size='50' name='adate[4]' /&gt;&lt;br /&gt;
                     &lt;b&gt;&lt;span class='text'&gt;Date + Time&lt;span&gt;&lt;/b&gt; &lt;input type=text size='50' name='adate[5]' /&gt;&lt;br /&gt;
                     &lt;b&gt;&lt;span class='text'&gt;Date + Time&lt;span&gt;&lt;/b&gt; &lt;input type=text size='50' name='adate[6]' /&gt;&lt;br /&gt;
                     &lt;b&gt;&lt;span class='text'&gt;Date + Time&lt;span&gt;&lt;/b&gt; &lt;input type=text size='50' name='adate[7]' /&gt;&lt;br /&gt;
                     &lt;b&gt;&lt;span class='text'&gt;Date + Time&lt;span&gt;&lt;/b&gt; &lt;input type=text size='50' name='adate[8]' /&gt;&lt;br /&gt;
                     &lt;b&gt;&lt;span class='text'&gt;Date + Time&lt;span&gt;&lt;/b&gt; &lt;input type=text size='50' name='adate[9]' /&gt;&lt;/p&gt;
                     &lt;br /&gt;
                     &lt;input type='submit' id='submit' name='submit' value='Add Appointments' /&gt;
                     &lt;input type='hidden' value='new' /&gt;
                  &lt;/form&gt;
                  &lt;?php
                   include '../inc/connect.php';

                       if (isset($_POST['submit'])){
                          while(!empty($_REQUEST['adate'])){                       
                          foreach($_REQUEST['adate'] as $adate ){
                             mysql_query("INSERT INTO appointments  VALUES ('', '$adate')");
                         }
                         }
                         }
                         ?&gt;
</code></pre>

<p>Thanks</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/453311/adding-multiple-records-in-mysql-from-form</guid>
		</item>
				<item>
			<title>Display Error</title>
			<link>http://www.daniweb.com/web-development/php/threads/453299/display-error</link>
			<pubDate>Thu, 25 Apr 2013 10:29:51 +0000</pubDate>
			<description>I have this text file that contain questions and their respective four multiple answers, when I try to display them in html form, the diplay only contains three multiple answers and not four. this are the codes: Text file: $string = 1) The most important feature of spiral model is: ...</description>
			<content:encoded><![CDATA[ <p>I have this text file that contain questions and their respective four multiple answers, when I try to display them in html form, the diplay only contains three multiple answers and not four. this are the codes:<br />
Text file:</p>

<pre><code>$string = 
1)  The most important feature of spiral model is: requirement analysis. risk management. quality management. configuration management 2)   The worst type of coupling is: Data coupling. control coupling. stamp coupling. content coupling 3) One of the fault base testing techniques is: unit testing. beta testing. Stress testing. mutation testing 4)    A fault simulation testing technique is: Mutation testing. Stress testing. Black box testing. White box testing 5)  RS is also known as specification of: White box testing. Stress testing. Integrated testing. Black box testing 6)   Which of these terms is a level name in the Capability Maturity Model?: Ad hoc. Repeatable. Reusable. Organized 7)  FP-based estimation techniques require problem decomposition based on?: information domain values. project schedule. software functions. process activities 8)  What types of models are created during software requirements analysis?: Functional and behavioral. Algorithmic and data structure. Architectural and structural. Usability and reliability 9)  Which of the following is not an attribute of software engineering: Efficiency. Scalability. Dependability. Usability   
</code></pre>

<p>and the code that display them in a form format:</p>

<pre><code>&lt;html&gt;
    &lt;head&gt;
    &lt;style&gt;
#text_disabled{
border:0;
font-size:10pt;
color:black;
}
&lt;/style&gt;
    &lt;title&gt;Question and Answer Read From Text File&lt;/title&gt;
    &lt;/head&gt;
    &lt;body&gt;
        &lt;form action="processor.php" method="POST" align="center"&gt;
        &lt;b&gt;&lt;u&gt; QUESTIONS AND ANSWERS QUIZ&lt;/u&gt;&lt;/b&gt; &lt;br /&gt;&lt;br /&gt;
&lt;?php
$openFile = fopen("questionandanswers.txt", "r") or exit ("unable to open the text       file");
$string = fread($openFile, filesize("questionandanswers.txt"));

//Regex to get from the first number to the string's end, so we ignore the Number Question... bit;
preg_match('/\d.*/', $string, $match);

//We get all the strings starting with a number until it finds another number (which will be the beginning of another question;
preg_match_all('/\d\D*/', $match[0], $results);

$qas = array(); // We prepare an array with all the questions/answers
foreach($results[0] as $result){
    //Separating the question from the string with all the answers.
    list($question, $all_answers) = explode(':', $result);

    //Separating the different answers
    $answers_array = explode('.', $all_answers);

    //Stuffing the question and the array with all the answers into the previously prepared array;
    $qas[] = array('question' =&gt; $question, 'answers' =&gt; $answers_array);
}

//Looping through the array and outputting all the info into a form;
foreach($qas as $k=&gt;$v)
{
echo "&lt;input id='text_disabled' style='width:40%' type='text' value='".$v['question']."' name='questions[]' disabled&gt;";
echo "&lt;select name='selected_answers[]&gt;";
foreach($v['answers'] as $answer){
echo "&lt;option value='".$answer."'&gt;".$answer."&lt;/option&gt;";
}
echo "&lt;/select&gt;";
echo "&lt;br/&gt;&lt;br/&gt;";
}
?&gt;
&lt;input type="submit" value="Submit Answers"&gt;  &lt;input type="reset" value ="Clear Answers"&gt;
&lt;/form&gt;
    &lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>Where could the problem be in my code?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>ferdinandmucos</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/453299/display-error</guid>
		</item>
				<item>
			<title>preg_replace - change one word from some of the same words</title>
			<link>http://www.daniweb.com/web-development/php/threads/453268/preg_replace-change-one-word-from-some-of-the-same-words</link>
			<pubDate>Thu, 25 Apr 2013 04:03:47 +0000</pubDate>
			<description>i want change one word from some of the same words with respect to the position of (the first second or third) example : $string = &quot;He had had to have had it.&quot;; echo preg_replace('/had/', 'SSS', $string, 1); output : He SSS had to have had it. i want --&gt;: ...</description>
			<content:encoded><![CDATA[ <p>i want change one word from some of the same words with respect to the position of (the first second or third)<br />
example :</p>

<pre><code>$string = "He had had to have had it.";
echo preg_replace('/had/', 'SSS', $string, 1);
</code></pre>

<p>output :</p>

<pre><code>He SSS had to have had it.
</code></pre>

<p>i want<br />
--&gt;: He SSS had to have had it<br />
Or : He had SSS to have had it<br />
Or : He had had to have SSS it</p>

<p>in the case of (my syntax), 'had' is replaced is the first.<br />
if you give me idea, i want syntax should not be reading from the right or left, because it must be ensured where the sequence is replaced from the same word (replace words in a certain order, if I had the same 5 words, then I can easily replace the third word, etc) , what "preg_replace" can do it ? or any idea ?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>ivanichi</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/453268/preg_replace-change-one-word-from-some-of-the-same-words</guid>
		</item>
				<item>
			<title>Help with date formatting</title>
			<link>http://www.daniweb.com/web-development/php/threads/453258/help-with-date-formatting</link>
			<pubDate>Thu, 25 Apr 2013 01:08:49 +0000</pubDate>
			<description>Hey everyone, Sorry if these files seem familar. I have an issue with a certain date that won't change along with the rest. For example: &quot;Sun., Sep 16th, 2012 6: 26 PM&quot; that's the way the code is supposed to read but there is one section that won't change and ...</description>
			<content:encoded><![CDATA[ <p>Hey everyone,</p>

<p>Sorry if these files seem familar. I have an issue with a certain date that won't change along with the rest. For example: "Sun., Sep 16th, 2012 6: 26 PM" that's the way the code is supposed to read but there is one section that won't change and I can't seem to figure out what's wrong. I've looked and looked over my code files and can't figure it out. Help! and Thanks in advance!</p>

<pre><code>///this is the line of code where the error starts.////
&lt;p&gt;By &lt;?php echo $post['user']; ?&gt; on &lt;?php echo $post['date']; ?&gt;

///Here is the file in PHP with sql that determines the date.////
&lt;?php

//checks if the given post id is in the table
function valid_pid($pid) {
    $pid = (int)$pid;

    $total = mysql_query("SELECT COUNT(`post_id`) FROM `posts` WHERE `post_id` = {$pid}");
    $total = mysql_result($total, 0);

    if ($total != 1) {
        return false;
    }else{
        return true;
    }
}

//gets a summary of all blog posts
function get_posts() {
    $sql = "SELECT
                `posts`.`post_id` AS `id`,
                `posts`.`post_title` AS `title`,
                LEFT(`posts`.`post_body`, 512) AS `preview`,
                `posts`.`post_user` AS `user`,
                DATE_FORMAT(`posts`.`post_date`, '%a., %b %D, %Y %l: %i %p') AS `date`,
                `comments`.`total_comments`,
                DATE_FORMAT(`comments`.`last_comment`, '%a., %b %D, %Y %l: %i %p') AS `last_comment`
            FROM `posts`
            LEFT JOIN(
                SELECT
                    `post_id`,
                    COUNT(`comment_id`) AS `total_comments`,
                    MAX(`comment_date`) AS `last_comment`
                FROM `comments`
                GROUP BY `post_id`
            ) AS `comments`
            ON `posts`.`post_id` = `comments`.`post_id`
            ORDER BY `posts`.`post_date` DESC";

    $posts = mysql_query($sql);

 $rows = array();
        while (($row = mysql_fetch_assoc($posts)) !== false) {
                $rows[] = array(
                        'id'                       =&gt; $row['id'],
                        'title'                   =&gt; $row['title'],
                        'preview'             =&gt; $row['preview'],
                        'user'                   =&gt; $row['user'],
                        'date'                   =&gt; $row['date'],
                        'total_comments' =&gt; ($row['total_comments'] === null) ? 0 : $row['total_comments'],
                        'last_comment'     =&gt; ($row['last_comment'] === null) ? 'none' : $row['last_comment']
                );
    }

    return $rows;
}

//gets a single post from the table
function get_post($pid) {
    $pid = (int)$pid;

    $sql = "SELECT
                `post_title` AS `title`,
                `post_body` AS `body`,
                `post_user` AS `user`,
                `post_date` AS `date`
            FROM `posts`
            WHERE `post_id` = {$pid}";

    $post = mysql_query($sql);
    $post = mysql_fetch_assoc($post);

    $post['comments'] = get_comments($pid);

    return $post;
}

//adds a new blog entry
function add_post($name, $title, $body) {
    $name = mysql_real_escape_string(htmlentities($name));
    $title = mysql_real_escape_string(htmlentities($title));
    $body = mysql_real_escape_string(nl2br(htmlentities($body)));

    mysql_query("INSERT INTO `posts` (`post_user`, `post_title`, `post_body`, `post_date`) VALUES ('{$name}', '{$title}', '{$body}', NOW())");
}

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

<p>Thanks!<br />
-GENEH23</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/453258/help-with-date-formatting</guid>
		</item>
				<item>
			<title>SSL Implementation with WordPress</title>
			<link>http://www.daniweb.com/web-development/php/threads/453247/ssl-implementation-with-wordpress</link>
			<pubDate>Wed, 24 Apr 2013 20:24:40 +0000</pubDate>
			<description>A client of mine wants to implement SSL on their site. They have a number of forms which communicate sensitive/personal information, and want to send the data over a secure channel. I've worked with sites that have SSL certificates already, but never actually implemented one myself. The site runs on ...</description>
			<content:encoded><![CDATA[ <p>A client of mine wants to implement SSL on their site. They have a number of forms which communicate sensitive/personal information, and want to send the data over a secure channel. I've worked with sites that have SSL certificates already, but never actually implemented one myself. The site runs on WordPress, using a custom theme I created. To the questions:</p>

<ol><li>Their head of IT says they have a UCC SSL. Is this appropriate for the task? I once purchased an SSL for Magento Go, and I believe it was called an EV SSL, which I imagine is not the same. A quick Google search also seemed to associate UCC with MS servers, not Apache, but I didn't get to dig very deep.</li>
<li>They are hosted on GoDaddy. I imagine GD probably offers SSL solutions. Is this worth it? Would it be cheaper/better to get an SSL elsewhere and use it? Is that even possible?</li>
<li>Most importantly, how do I use the SSL on WP once it's set up? Do I just have to redirect the form and processing pages to <code>https://</code>, or is there something else that needs to be done?</li>
</ol>

<p>Sorry for the wordiness. Any advice/help is much appreciated.<br />
- EF</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>EvolutionFallen</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/453247/ssl-implementation-with-wordpress</guid>
		</item>
				<item>
			<title>$_SESSION</title>
			<link>http://www.daniweb.com/web-development/php/threads/453218/_session</link>
			<pubDate>Wed, 24 Apr 2013 14:56:41 +0000</pubDate>
			<description>Hi, my problem is that I can't insert the value of $branch to my database, because it returns a null value. I'm still new to PHP and only started using it a couple of days ago, I still don't get much of the functions. Here's my whole code: &lt;?php session_start(); ...</description>
			<content:encoded><![CDATA[ <p>Hi, my problem is that I can't insert the value of $branch to my database, because it returns a null value.<br />
I'm still new to PHP and only started using it a couple of days ago, I still don't get much of the functions.</p>

<p>Here's my whole code:</p>

<pre><code>&lt;?php
session_start();
$user = $_SESSION["login_User"];


$result = mysql_query("SELECT * FROM tblaccount WHERE Username='$user'");
        while($row = mysql_fetch_assoc($result))
        {

    //$encodr=$row['FirstName'] . " " . $row['LastName'];
        $branch=$row['Branch']; 
        }


    include "configdb.php";
    $prodCode=$_REQUEST['txtProdCode'];
    $brand=$_REQUEST['txtBrand'];
    $prodNa=$_REQUEST['txtProdNa'];
    $cat=$_REQUEST['optCat'];
    $qty=$_REQUEST['txtQty'];
    $unit=$_REQUEST['optUnit'];
    $price=$_REQUEST['txtPrice'];
    $optSupp=$_REQUEST['optSupp'];
    $merchant=$_REQUEST['txtMerchant'];
    $img=$_REQUEST['imglocation'];
    $dat=date("F d, Y");
    $b = time (); 
    $tim= date("g:i:s A", $b);




    $result = mysql_query("SELECT * FROM tblproducts WHERE ProdCode='$prodCode' AND Branch='$branch'");
        $count=mysql_num_rows($result);

        if($count &gt; 0)
        { header('Location: prodAddErr.php'); 
          $msgs = "There is already an existing record!"; 
        }
        else
        {   
            $query="INSERT INTO tblproducts(ProdCode,Brand,ProductName,Category,Quantity,Unit,
            Price,Branch,Merchant,Supplier,DateStored,TimeStored,Encoder,picture) 
            VALUES('$prodCode','$brand','$prodNa','$cat','$qty','$unit','$price','$branch','$merchant',
            '$optSupp','$dat','$tim','$user','$img')";

            $result = mysql_query($query) or die ("Cannot Execute Query!");
            header('Location: prodAdded.php');
        }

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

<p>and why is it that when I do this code:</p>

<pre><code>&lt;?php
session_start();
$user = $_SESSION["login_User"];

$connect = mysql_connect("localhost","root","") or die("Couldn't connect to database!");
    mysql_select_db("inventory") or die("Couldn't find database!!");
        $result = mysql_query("SELECT * FROM tblaccount WHERE Username='$user'");
        while($row = mysql_fetch_assoc($result))
    {
        echo $row['FirstName'];
        print " ";
        echo $row['LastName'];
        print "&lt;br/&gt; ";
        echo $row['Branch'];
    }
            ?&gt;
</code></pre>

<p>I get the desired output i want. It really prints the record under those fieldnames, so why is it that it doesn't work when I pass the value to another variable?</p>

<p>thanks in advance for helping me :)</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>Ashenvale</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/453218/_session</guid>
		</item>
				<item>
			<title>Mailer doesnt want to send emails to all addresses?!</title>
			<link>http://www.daniweb.com/web-development/php/threads/453214/mailer-doesnt-want-to-send-emails-to-all-addresses</link>
			<pubDate>Wed, 24 Apr 2013 14:26:06 +0000</pubDate>
			<description>I am developing an application for a client. What i need is, send updates with changed records to clients where the email that needs to be used is extracted from the database. What is weird is that i cant send it to all email addresses... Note that i dont have ...</description>
			<content:encoded><![CDATA[ <p>I am developing an application for a client. What i need is, send updates with changed records to clients where the email that needs to be used is extracted from the database. What is weird is that i cant send it to all email addresses... Note that i dont have problems that emails are not delivered but it doesnt want to send it when i click send button... If i use lets say my gmail addres or couple of .com domain addresses it sends but to some other .com or .areo it doesnt... So im thinking, if it delivers to some addresses without anny problems, the script should be ok? Here is the code i use</p>

<pre><code>    global $dal;

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

    $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 cellpadding='5' rules='all' style='border:1px solid #cccccc;' class='email'&gt;&lt;tbody&gt;
  ...
    &lt;tr&gt;&lt;td&gt;Last Update&lt;/td&gt;&lt;td&gt;" . $datatmp['timestamp'] . "&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
    &lt;/tbody&gt;&lt;/table&gt;


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






    // send the email


    $subject="STATUS UPDATE";

    $arr = runner_mail(array('to' =&gt; $datatmp['client_email'], '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>what else could be the problem?</p>

<p>Also, i need to update date and time in the database after email is sent. But im already using timestamp for recording changes when record is edited so i cant use second one. tried to set last_email_sent=now() but it doesnt work...</p>

<p>Anny ideas for anny of my problems?</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/453214/mailer-doesnt-want-to-send-emails-to-all-addresses</guid>
		</item>
				<item>
			<title>No file extention in email attachments</title>
			<link>http://www.daniweb.com/web-development/php/threads/453204/no-file-extention-in-email-attachments</link>
			<pubDate>Wed, 24 Apr 2013 12:27:33 +0000</pubDate>
			<description>I am sending email with attachments.. but I did not getting any extention in the email.. all the attachments having name **noname** without extention, if I attach mutiple files then the attachmment also have only one file named **noname** without extention too.. &lt;?php if(isset($_POST['send'])) { include('db.php'); $strTo = $_POST[&quot;email&quot;]; $strSubject ...</description>
			<content:encoded><![CDATA[ <p>I am sending email with attachments.. but I did not getting any extention in the email.. all the attachments having name <strong>noname</strong> without extention, if I attach mutiple files then the attachmment also have only one file named <strong>noname</strong> without extention too..</p>

<pre><code>&lt;?php
if(isset($_POST['send']))
{
include('db.php');

$strTo = $_POST["email"];
$strSubject = stripslashes($_POST["subject"]);
$strMessage = stripslashes($_POST["message"]);
$from = '******@gmail.com'; 
//*** Uniq id Session ***//
$strSid = md5(uniqid(time()));

$strHeader = "";
$strHeader .= "From: $from\r\n" . "MIME-Version: 1.0\r\n" . "Content-Type: multipart/mixed;\r\n"; 
$strHeader .= "Cc: {$_POST['cc']}\r\n";
$strHeader .= "Bcc: {$_POST['bcc']}\r\n";

$strHeader .= "MIME-Version: 1.0\n";
$strHeader .= "Content-Type: multipart/mixed; boundary=\"".$strSid."\"\n\n";
$strHeader .= "This is a multi-part message in MIME format.\n";

$strHeader .= "--".$strSid."\n";
$strHeader .= 'Content-Type: text/html; charset=iso-8859-1'.$eol;
$strHeader .= "Content-Transfer-Encoding: 7bit\n\n";
$strHeader .= $strMessage."\n\n";

//*** Attachment ***//
for($i=0;$i&lt;count($_FILES["fileAttach"]["name"]);$i++)
{
if($_FILES["fileAttach"]["name"][$i] != "")
{
$strFilesName = $_FILES["fileAttach"]["name"][$i];
$strContent = chunk_split(base64_encode(file_get_contents($_FILES["fileAttach"]["tmp_name"][$i])));
$strHeader .= "--".$strSid."\n";
$strHeader .= "Content-Type: application/octet-stream; name=\"".$strFilesName."\"\n";
$strHeader .= "Content-Transfer-Encoding: base64\n";
$strHeader .= "Content-Disposition: attachment; filename=\"".$strFilesName."\"\n\n";
$strHeader .= $strContent."\n\n";
}
}

$flgSend = @mail($strTo,$strSubject,null,$strHeader); // @ = No Show Error //

if($flgSend)
{
    header("Location: ".$_SERVER['PHP_SELF']."?id=".$_REQUEST['id']."&amp;msg=Message Send"); 
}
else
{
    header("Location: ".$_SERVER['PHP_SELF']."?id=".$_REQUEST['id']."&amp;msg=Message Not Send"); 
}
}
?&gt;
</code></pre>

<p>I got the below code from the web..</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>abhi10kumar</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/453204/no-file-extention-in-email-attachments</guid>
		</item>
				<item>
			<title>assistance with clean up</title>
			<link>http://www.daniweb.com/web-development/php/threads/453141/assistance-with-clean-up</link>
			<pubDate>Tue, 23 Apr 2013 18:14:03 +0000</pubDate>
			<description>Evening all. I am goign through my Image upload script and found it looks messy, would you recommend an cleaner way of doing this: move_uploaded_file($_FILES['file']['tmp_name'], 'photos/' . $_FILES['file']['name']); try { $fileName = $_FILES['file']['name']; $resizeObj = new resize('photos/' . $fileName); // *** Resize options: exact, portrait, landscape, auto, crop $resizeObj-&gt;resizeImage(225, 150, ...</description>
			<content:encoded><![CDATA[ <p>Evening all.</p>

<p>I am goign through my Image upload script and found it looks messy, would you recommend an cleaner way of doing this:</p>

<pre><code>    move_uploaded_file($_FILES['file']['tmp_name'], 'photos/' . $_FILES['file']['name']);
    try {
        $fileName = $_FILES['file']['name'];
        $resizeObj = new resize('photos/' . $fileName);

// *** Resize options: exact, portrait, landscape, auto, crop
        $resizeObj-&gt;resizeImage(225, 150, 'auto');
        $extension = strtolower(strrchr($fileName, '.')); // extract file extension
        $clean = str_replace($extension, '', $fileName); // replace file extension with nothing -&gt; removes

        $resizeObj-&gt;saveImage('photos/' . $clean . '.png', 100);
        unlink('photos/' . $fileName);
    } catch (Exception $e) {
        echo 'Error ' . $e-&gt;getMessage() . "\n";
    }
</code></pre>

<p>I have tried parsing the <code>$_FILES['file']['name']</code> directly into the <code>resize</code> class but this does do anything, hence i save the original -&gt; modify the size -&gt; strip the extension -&gt; save as png -&gt; delet original</p>

<p>Any input is greatly appreciated.</p>

<p>Squidge</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>Squidge</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/453141/assistance-with-clean-up</guid>
		</item>
				<item>
			<title>Connect to MSSQL using sqlsrv_connect</title>
			<link>http://www.daniweb.com/web-development/php/threads/453124/connect-to-mssql-using-sqlsrv_connect</link>
			<pubDate>Tue, 23 Apr 2013 13:31:46 +0000</pubDate>
			<description>Hi Guys, I have a problem using the sqlsrv_connect function (in that it's failing!). I have been using mssql_connect on a server with an older verison of PHP where my connect string worked fine. But putting the information into the sqlsrv_connect doesn't let it connect. Here's my code that I ...</description>
			<content:encoded><![CDATA[ <p>Hi Guys,</p>

<p>I have a problem using the sqlsrv_connect function (in that it's failing!). I have been using mssql_connect on a server with an older verison of PHP where my connect string worked fine. But putting the information into the sqlsrv_connect doesn't let it connect.</p>

<p>Here's my code that I used on my old script:</p>

<pre><code>$server = "serverIP,serverPort";
$user = "user";
$pass = "password";
$db = "db";

$conn = mssql_connect($server, $user, $pass) or die("Couldn't connect to SQL Server");
</code></pre>

<p>And that worked fine. I then use this on the new server:</p>

<pre><code>$server = "serverIP,serverPort";
$user = "user";
$pass = "pass";
$db = "db";
$connInfo = array("Database"=&gt;$db, "UID"=&gt;$user, "PWD"=&gt;$pass);

$conn = sqlsrv_connect($server, $connInfo) or die("Couldn't connect to SQL Server");
</code></pre>

<p>And it comes up saying it couldn't connect. I'm not sure whether I need to change my server variable maybe? (Although the database is still on the same server, so not sure why that would be different) but everything I've read has said something about using serverName/InstanceName. I'm not sure what this is though.</p>

<p>Any help would be greatly appreciated.</p>

<p>Thanks in advance :)</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>Wolxhound90</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/453124/connect-to-mssql-using-sqlsrv_connect</guid>
		</item>
				<item>
			<title>Please Help With Code???</title>
			<link>http://www.daniweb.com/web-development/php/threads/453068/please-help-with-code</link>
			<pubDate>Tue, 23 Apr 2013 03:09:00 +0000</pubDate>
			<description>Hi guys, basically, I've been stuck on this problem FOREVER! *When I open the webpage, I get this error.* Parse error: syntax error, unexpected '&amp;&amp;' (T_BOOLEAN_AND) in C:\Program Files (x86)\EasyPHP-12.1\www\Creative Landscapes\functions.php on line 83 **Line 83:** `else if (isset($_POST['submit'] &amp;&amp; empty($_POST['username']) or empty($_POST['password']){`</description>
			<content:encoded><![CDATA[ <p>Hi guys, basically, I've been stuck on this problem FOREVER!</p>

<p><em>When I open the webpage, I get this error.</em></p>

<p>Parse error: syntax error, unexpected '&amp;&amp;' (T_BOOLEAN_AND) in C:\Program Files (x86)\EasyPHP-12.1\www\Creative Landscapes\functions.php on line 83</p>

<p><strong>Line 83:</strong></p>

<p><code>else if (isset($_POST['submit'] &amp;&amp; empty($_POST['username']) or empty($_POST['password']){</code></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/453068/please-help-with-code</guid>
		</item>
				<item>
			<title>strpos - skip certain characters</title>
			<link>http://www.daniweb.com/web-development/php/threads/453064/strpos-skip-certain-characters</link>
			<pubDate>Tue, 23 Apr 2013 00:33:18 +0000</pubDate>
			<description> $char = '3'; $string = '101131110|101131110|'; $positions = array(); $pos = -1; while (($pos = strpos($string, $char, $pos+1)) !== false) { $positions[] = $pos+1; } $result = implode(',', $positions); print_r($result); The position of '3' in our string was 5,15 I want to get a second position of '3' in position ...</description>
			<content:encoded><![CDATA[ <pre><code>$char   = '3';
$string = '101131110|101131110|';

$positions = array();
$pos = -1;
while (($pos = strpos($string, $char, $pos+1)) !== false) {
    $positions[] = $pos+1; 
}

$result = implode(',', $positions);
print_r($result);
</code></pre>

<p>The position of '3' in our string was 5,15<br />
I want to get a second position of '3' in position 14 instead of 15, I had to pass this character "|"<br />
anybody help me. thanks.</p>

<p>regards,<br />
ivanichi</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>ivanichi</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/453064/strpos-skip-certain-characters</guid>
		</item>
				<item>
			<title>PHP Post with http inside</title>
			<link>http://www.daniweb.com/web-development/php/threads/453037/php-post-with-http-inside</link>
			<pubDate>Mon, 22 Apr 2013 14:59:20 +0000</pubDate>
			<description>Hey all, i've a form with a textinput for links, but at submit, it won't send any links started with http. for example: &lt;form acion=&quot;result.php&quot; method=&quot;post&quot;&gt; &lt;input type=&quot;text&quot; name=&quot;link&quot; /&gt; &lt;input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;submit&quot; &lt;/form&gt; &lt;?php //---Result.php: echo $_POST['link']; // if links start with http:// it won't be there ?&gt; ...</description>
			<content:encoded><![CDATA[ <p>Hey all,</p>

<p>i've a form with a textinput for links,<br />
but at submit, it won't send any links started with http.</p>

<p>for example:</p>

<pre><code>&lt;form acion="result.php" method="post"&gt;
    &lt;input type="text" name="link" /&gt;
    &lt;input type="submit" name="submit" value="submit"
&lt;/form&gt;

&lt;?php

//---Result.php:
echo $_POST['link'];
// if links start with http:// it won't be there

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

<p>Any tips?</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/453037/php-post-with-http-inside</guid>
		</item>
				<item>
			<title>Database Insertion error</title>
			<link>http://www.daniweb.com/web-development/php/threads/453024/database-insertion-error</link>
			<pubDate>Mon, 22 Apr 2013 12:42:36 +0000</pubDate>
			<description>Hi, I have the following tables **tbl_user** - id, username, password **tbl_userprofile** - id, userid, name, surname, gender, nationality,address, mobile, department, email, question, answer. userid is a foreign key in **tbl_userprofile** referencing id in **tbl_user** I'm trying insert a new user into **tbl_userprofile**. But i'm not sure how to go ...</description>
			<content:encoded><![CDATA[ <p>Hi,<br />
I have the following tables<br /><strong>tbl_user</strong> - id, username, password<br /><strong>tbl_userprofile</strong> - id, userid, name, surname, gender, nationality,address, mobile, department, email, question, answer.<br />
userid is a foreign key in <strong>tbl_userprofile</strong> referencing id in <strong>tbl_user</strong><br />
I'm trying insert a new user into <strong>tbl_userprofile</strong>. But i'm not sure how to go about it because of the foreign key constraint. Here's my code.</p>

<pre><code>$name = "";
$surname = "";
$address = "";
$nationality = "";
$gender = "";
$email = "";
$department = "";
$mobile = "";
$question = "";
$answer = "";
$errorMessage = "";

//check if form was submitted
if($_SERVER['REQUEST_METHOD'] == 'POST'){
    $name = $_POST['firstname'];
    $surname = $_POST['lastname'];
    $email = $_POST['email'];
    $address = $_POST['address'];
    $mobile = $_POST['telno'];
    $question = $_POST['question'];
    $answer = $_POST['answer'];
    $nationality = $_POST['nationality'];
    $department = $_POST['department'];
    $gender = $_POST['gender'];

    $username = "root";
    $password = "root";
    $database = "db";
    $server = "host";

    $db_handler = mysql_connect($server, $username, $password);
    $db_found = mysql_select_db($database,$db_handler);

    if($db_found){
        $SQL = "INSERT INTO tbl_userprofile (userid, name, surname, gender, nationality, address, mobile, department, email, question, answer) VALUES 
    ('$name','$surname','$gender','$nationality','$address','$mobile','$department','$email','$question','$answer')";

        $result = mysql_query($SQL);

        mysql_close($db_handler);

        if($result){

        header("Location:index.php");
        }
        else{
            $errorMessage = "ERROR". mysql_error();
        }

    }

    else{
        $errorMessage = "Database Not Found";

    }
}
</code></pre>

<p>I know my $SQL query is incomplete. How do i construct it? 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/453024/database-insertion-error</guid>
		</item>
				<item>
			<title>Magento Amazon Payment</title>
			<link>http://www.daniweb.com/web-development/php/threads/453018/magento-amazon-payment</link>
			<pubDate>Mon, 22 Apr 2013 10:35:12 +0000</pubDate>
			<description>Please tell me if Amazon Payment Gateway Module code for Magento is available or not.Like Paypal Module code is available. i want to check its observer and model file etc.</description>
			<content:encoded><![CDATA[ <p>Please tell me if Amazon Payment Gateway Module code for Magento is  available or not.Like Paypal Module code is available.</p>

<p>i want to check its observer and model file etc.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>ankit.4aug</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/453018/magento-amazon-payment</guid>
		</item>
				<item>
			<title>combine multiple results into one</title>
			<link>http://www.daniweb.com/web-development/php/threads/453015/combine-multiple-results-into-one</link>
			<pubDate>Mon, 22 Apr 2013 10:26:54 +0000</pubDate>
			<description>hey there I don't know if this mentioned earlier but I want to do this sql statment $sql1 = &quot;SELECT product FROM products WHERE cat = 2&quot;; $sql2 = &quot;SELECT product FROM products WHERE cat = 3&quot;; $sql3 = &quot;SELECT product FROM products WHERE cat = 4&quot;; I want these ...</description>
			<content:encoded><![CDATA[ <p>hey there I don't know if this mentioned earlier but I want to do this sql statment</p>

<pre><code>$sql1 = "SELECT product FROM products WHERE cat = 2";
$sql2 = "SELECT product FROM products WHERE cat = 3";
$sql3 = "SELECT product FROM products WHERE cat = 4";
</code></pre>

<p>I want these three $sql combined into one so its give me the products from 3 catgeories.<br />
is good to use CONCAT of INNER JOIN ?</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/453015/combine-multiple-results-into-one</guid>
		</item>
				<item>
			<title>Put arrays into form processing format</title>
			<link>http://www.daniweb.com/web-development/php/threads/452995/put-arrays-into-form-processing-format</link>
			<pubDate>Mon, 22 Apr 2013 04:52:19 +0000</pubDate>
			<description>I have a text file: $string = '1 The most important feature of spiral model is: requirement analysis. risk management. quality management. configuration management 2 The worst type of coupling is: Data coupling. control coupling. stamp coupling. content coupling 3 One of the fault base testing techniques is: unit testing. ...</description>
			<content:encoded><![CDATA[ <p>I have a text file:<br />
$string =<br />
'1 The most important feature of spiral model is: requirement analysis. risk management. quality management. configuration management 2 The worst type of coupling is: Data coupling. control coupling. stamp coupling. content coupling 3 One of the fault base testing techniques is: unit testing. beta testing. Stress testing. mutation testing 4 A fault simulation testing technique is: Mutation testing. Stress testing. Black box testing. White box testing 5 RS is also known as: specification of White box testing. Stress testing. Integrated testing. Black box testing 6 what is you name: Collins. Achieng. Ogwethi. Kamanda';</p>

<p>and a php code that reads from the text file and put the values into arrays;</p>

<pre><code>&lt;html&gt;
    &lt;head&gt;
    &lt;title&gt;read&lt;/title&gt;
    &lt;/head&gt;
    &lt;body&gt;
        &lt;b&gt;&lt;u&gt; QUESTIONS AND ANSWERS QUIZ&lt;/u&gt;&lt;/b&gt; &lt;br /&gt;&lt;&gt;
&lt;?php
$openFile = fopen("questionandanswers.txt", "r") or exit ("unable to open the text       file");
$string = fread($openFile, filesize("questionandanswers.txt"));

//Regex to get from the first number to the string's end, so we ignore the Number Question... bit;
preg_match('/\d.*/', $string, $match);

//We get all the strings starting with a number until it finds another number (which will be the beginning of another question;
preg_match_all('/\d\D*/', $match[0], $results);

$qas = array(); // We prepare an array with all the questions/answers
foreach($results[0] as $result){
    //Separating the answer from the string with all the answers.
    list($question, $all_answers) = explode(':', $result);

    //Separating the different answers
    $answers_array = explode('.', $all_answers);

    //Stuffing the question and the array with all the answers into the previously prepared array;
    $qas[] = array('question' =&gt; $question, 'answers' =&gt; $answers_array);
}

//Looping through the array and outputting all the info into a form;
foreach($qas as $k =&gt; $v){
    echo "&lt;label&gt;{$v['question']}&lt;/label&gt;&lt;br/&gt;";
    echo "&lt;select&gt;";

    //we loop through $v['answers'] because its an array within the array with all the answers.
    foreach($v['answers'] as $answer){
        echo "&lt;option&gt;$answer&lt;/option&gt;";//the output
    }
    echo "&lt;/select&gt;";
    echo "&lt;br/&gt;&lt;br/&gt;";
}

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

<p>I want to be able to put the selected individual answer in such a manner that they can be posted to a php script for processsing e.g $_POST  = "";.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>ferdinandmucos</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/452995/put-arrays-into-form-processing-format</guid>
		</item>
				<item>
			<title>PHP: Howto implement a forum like Private Message?</title>
			<link>http://www.daniweb.com/web-development/php/threads/452984/php-howto-implement-a-forum-like-private-message</link>
			<pubDate>Sun, 21 Apr 2013 23:50:37 +0000</pubDate>
			<description>I am thinking to implement a forum like Private Message into my website for those who are a registered member. (&lt;100 Member anyway) So Member A can send a message to Member B. Member B will have a notification popup within some seconds saying that he received a new message ...</description>
			<content:encoded><![CDATA[ <p>I am thinking to implement a forum like Private Message into my website for those who are a registered member. (&lt;100 Member anyway)</p>

<p>So Member A can send a message to Member B.<br />
Member B will have a notification popup within some seconds saying that he received a new message (without reloading the page is preferable. aka Facebook style).<br />
Member can check all messages that he sent or received.</p>

<p>Anyone can point me a direction?</p>

<p>I am thinking to use a normal techinque like mysql + php, insert the message to the mysql and then send a singal to trigger the alert to the target user.</p>

<p>1.Member A send the message<br />
2.mysql recevied &gt; php send a singal to the target user (Member B in this case)<br />
3.Member B's browser received the singal<br />
4.popup a noticfication on his browser<br />
5.if Member B didnt check the message than it will popup again on his next login<br />
6.Member can view their messages list and open those old messages.</p>

<p>I am stuck at #3 at the moment. I think I need to use jquery to trigger the event like #3? Can someone please point me a direction?</p>

<p>thanks</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>yy886</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/452984/php-howto-implement-a-forum-like-private-message</guid>
		</item>
				<item>
			<title>split words and numbers</title>
			<link>http://www.daniweb.com/web-development/php/threads/452935/split-words-and-numbers</link>
			<pubDate>Sat, 20 Apr 2013 20:58:33 +0000</pubDate>
			<description>Hi I'm not sure what to used to split numbers and letter from words. So far I try **preg_split()** function and also **mb_split()** function both gave me **No ending delimiter ^** There is **^** (**caret**). For example my data is from my database and it's not an array and it ...</description>
			<content:encoded><![CDATA[ <p>Hi</p>

<p>I'm not sure what to used to split numbers and letter from words.</p>

<p>So far I try <strong>preg_split()</strong> function and also <strong>mb_split()</strong> function both gave me <strong>No ending delimiter ^</strong></p>

<p>There is <strong>^</strong> (<strong>caret</strong>).</p>

<p>For example my data is from my database and it's not an array and it nothing to do with any password or security.</p>

<p>It's an example:</p>

<p>I echo out:</p>

<pre><code>&lt;?php echo $numbers; ?&gt;^&lt;?php echo $words; ?&gt;
</code></pre>

<p>Then the result is</p>

<pre><code> 123^ABC
</code></pre>

<p>How do I separate <strong>123^ABC</strong> and echo out <strong>$word</strong> &amp; <strong>$number</strong> individually on a different page.</p>

<p>I am using <strong>list()</strong> function:</p>

<pre><code>list($number, $word)=preg_split('^', $word)

echo '$number'; // 123
echo '$word'; // ABC 

list($number, $word)=mb_split('^', $number)

echo '$number'; // 123
echo '$word'; // ABC 
</code></pre>

<p>Any Suggestions and explanations will help. I appreciate it. Thanks!</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>LastMitch</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/452935/split-words-and-numbers</guid>
		</item>
				<item>
			<title>Error with php sessions</title>
			<link>http://www.daniweb.com/web-development/php/threads/452905/error-with-php-sessions</link>
			<pubDate>Sat, 20 Apr 2013 10:33:17 +0000</pubDate>
			<description> This is my first PHP script, to add a user to my website but i keep getting these errors Cannot send session cache limiter - headers already sent Cannot modify header information - headers already sent mysql_num_rows expects parameter 1 to be resource boolean given I have a basic understanding ...</description>
			<content:encoded><![CDATA[ <p>This is my first PHP script, to add a user to my website but i keep getting these errors</p>

<p>Cannot send session cache limiter - headers already sent<br />
Cannot modify header information - headers already sent<br />
mysql_num_rows expects parameter 1 to be resource boolean given</p>

<p>I have a basic understanding of what these error messages mean but i just can't place them in my script.<br />
Here's the entire code for the page:</p>

<pre><code>&lt;?php
$username = "";
$password = "";
$errorMessage = "";
$num_rows = 0;
if($_SERVER['REQUEST_METHOD'] == 'POST')
{
//get data from forms
$username = $_POST['newusername'];
$password = $_POST['newpassword'];
//check for unwanted tags
$username = htmlspecialchars($username);
$password = htmlspecialchars($password);
//get length of username and passowrd
$ulength = strlen($username);
$plength = strlen($password);
//Validate user lengths against required lengths and print apporpriate error messages
if($ulength &lt;= 20){
$errorMessage = "";
}
else {
$errorMessage = $errorMessage. "User name must contain at most 20 characters". "&lt;br/&gt;";
}
if($plength &lt;= 16){
$errorMessage = "";
}
else{
$errorMessage = $errorMessage. "Password must contain at most 16 characters". "&lt;br/&gt;";
}
//if there are no errors then connect to database
if($errorMessage == ""){
$uname = "root";
$pword = "root";
$database = "emusalesdb";
$server = "localhost";
$db_handle = mysql_connect($server, $uname, $pword);
$db_found = mysql_select_db($database,$db_handle);
if($db_found){
//insert injection prevention code here
//check if username already exists
$SQL = "SELECT * FROM tbl_user WHERE username = $username";
$result = mysql_query($SQL);
$num_rows = mysql_num_rows($result);//error here
if($num_rows &gt; 0){
$errorMessage = "Username already exists";
}
else{
$SQL = "INSERT INTO tbl_user (username, password) VALUES ($username, md5($password))";
$result = mysql_query($SQL);
mysql_close($db_handle);
session_start();//error here
$_SESSION['login'] = "1";
header("Location: register_page.php");//error here
}
}
else{
$errorMessage = "Database not found";
}
}
}
?&gt;
&lt;head&gt;
&lt;title&gt; Login - Register&lt;/title&gt;
&lt;/head&gt;
&lt;!-- BEGIN body --&gt;
&lt;body&gt;
&lt;!-- BEGIN #main --&gt;
&lt;div id="main"&gt;
&lt;!-- BEGIN .content --&gt;
&lt;div class="content"&gt;

&lt;div class="login_right"&gt;
&lt;div class="registerlogo"&gt;&lt;/div&gt;
&lt;div class="question1 ha" style="margin-top:5px;"&gt;Register&lt;/div&gt;
&lt;div class="question2 ha" style="margin-top:5px;"&gt;Now&lt;/div&gt;
&lt;div class="login_text2"&gt;Dont have an account? Register NOW it only takes a few minutes&lt;/div&gt;

//This is the form i'm working with
&lt;form action= "login-register-page.php" method="POST"&gt;
&lt;input type="text" placeholder="Username" name="newusername" value="&lt;?php print $username;?&gt;" class="register_name"/&gt;
&lt;br /&gt;
&lt;input type="password" placeholder="Password" name="newpassword" value="&lt;?php print $password;?&gt;" class="register_password"/&gt;
&lt;br /&gt;
&lt;input value="Register" name="submitregister" class="register_account" type="submit"/&gt;
&lt;/form&gt;
&lt;?php print $errorMessage;?&gt;
&lt;/div&gt;

&lt;!-- END .content --&gt;
&lt;/div&gt;

&lt;!-- END #main --&gt;
&lt;/div&gt;
&lt;!-- END body --&gt;
&lt;/body&gt;
&lt;!-- END html --&gt;
&lt;/html&gt;
</code></pre>
 ]]></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/452905/error-with-php-sessions</guid>
		</item>
				<item>
			<title>Populating Dropdown LIst options from MySQL table.</title>
			<link>http://www.daniweb.com/web-development/php/threads/452892/populating-dropdown-list-options-from-mysql-table</link>
			<pubDate>Sat, 20 Apr 2013 07:41:52 +0000</pubDate>
			<description>Hello. Please guide me about how to get the options of select tab from mYSQL table. Where to insert php code and how to? Have a look on the code. &lt;td&gt;&lt;select name=&quot;tby&quot; size=&quot;1&quot;&gt; &lt;/select&gt;&lt;/td&gt; &lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td colspan=&quot;4&quot;&gt;&lt;label&gt;Issue/ Tests : &lt;textarea name=&quot;issue&quot; wrap=&quot;physical&quot;&gt;&lt;/textarea&gt; &lt;/label&gt;&lt;/td&gt; Regards. Aamir Karim.</description>
			<content:encoded><![CDATA[ <p>Hello.<br />
Please guide me about how to get the options of select tab from mYSQL table.<br />
Where to insert php code and how to?</p>

<p>Have a look on the code.</p>

<pre><code>&lt;td&gt;&lt;select name="tby" size="1"&gt;
              &lt;/select&gt;&lt;/td&gt;
              &lt;td colspan="2"&gt;&amp;nbsp;&lt;/td&gt;
            &lt;/tr&gt;
            &lt;tr&gt;
              &lt;td colspan="4"&gt;&lt;label&gt;Issue/ Tests :
                  &lt;textarea name="issue" wrap="physical"&gt;&lt;/textarea&gt;
              &lt;/label&gt;&lt;/td&gt;
</code></pre>

<p>Regards.<br />
Aamir Karim.</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/452892/populating-dropdown-list-options-from-mysql-table</guid>
		</item>
				<item>
			<title> How to prevent Undefined offset: 1 </title>
			<link>http://www.daniweb.com/web-development/php/threads/452877/-how-to-prevent-undefined-offset-1-</link>
			<pubDate>Sat, 20 Apr 2013 02:19:34 +0000</pubDate>
			<description>Hi I'm trying figure why I'm getting this error **Undefined offset: 1**. I'm practicing with **list()** function and with a **explode()** function. When I ran the code it kept mention this error: Undefined offset: 1 The line is this: list($bagsize, $candyprice)=explode(&quot;#&quot;, $_GET[&quot;size&quot;]); The list is not an array. It's on ...</description>
			<content:encoded><![CDATA[ <p>Hi</p>

<p>I'm trying figure why I'm getting this error <strong>Undefined offset: 1</strong>.</p>

<p>I'm practicing with <strong>list()</strong> function and with a <strong>explode()</strong> function.</p>

<p>When I ran the code it kept mention this error:</p>

<pre><code>Undefined offset: 1 
</code></pre>

<p>The line is this:</p>

<pre><code>list($bagsize, $candyprice)=explode("#", $_GET["size"]);
</code></pre>

<p>The list is not an array. It's on the database:</p>

<pre><code>$bagsize = $_GET["size"]);
$candyprice = $_GET["price"]);
</code></pre>

<p>But the thing is that I don't understand why is it <strong>offset</strong>.</p>

<p>I google it and read a few threads and find out it varies.</p>

<p>I just want to prevent this error from happening again.</p>

<p>Any Suggestions and explanations will help. I appreciate it. Thanks!</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>LastMitch</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/452877/-how-to-prevent-undefined-offset-1-</guid>
		</item>
				<item>
			<title>Adding textFiled to row in function</title>
			<link>http://www.daniweb.com/web-development/php/threads/452841/adding-textfiled-to-row-in-function</link>
			<pubDate>Fri, 19 Apr 2013 12:57:25 +0000</pubDate>
			<description>Hello. I have a user defined function in start of an Html page. I want to add textfields in the innerHtml. Please guide me what should I do. When I enter string in the innerHtml on line 10 and 11, It show &quot;New&quot; in the cells. BUt i am adding ...</description>
			<content:encoded><![CDATA[ <p>Hello.<br />
I have a user defined function in start of an Html page. I want to add textfields in the innerHtml. Please guide me what should I do. When I enter string in the innerHtml on line 10 and 11, It show "New" in the cells. BUt i am adding textfileds instead of "New", Nothing happens.</p>

<p>Here is the code</p>

<pre><code>&lt;html&gt;
&lt;head&gt;
&lt;script&gt;
function displayResult()
{
var table=document.getElementById("myTable");
var row=table.insertRow(0);
var cell1=row.insertCell(0);
var cell2=row.insertCell(1);
cell1.innerHTML="New";
cell2.innerHTML="New";
}
&lt;/script&gt;
&lt;/head&gt;
</code></pre>

<p>Need Guidance.</p>

<p>Regards.</p>

<p>Aamir Karim.</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/452841/adding-textfiled-to-row-in-function</guid>
		</item>
				<item>
			<title>Basic Starter Question </title>
			<link>http://www.daniweb.com/web-development/php/threads/452807/basic-starter-question-</link>
			<pubDate>Fri, 19 Apr 2013 01:32:59 +0000</pubDate>
			<description>Hi all this should be an easy one, Trying to move an input from text box1 to text box2 and return back to page1. page 1 reads, &lt;HTML&gt;&lt;HEAD&gt;&lt;TITLE&gt;php scenario move text &lt;/TITLE&gt;&lt;META content=&quot;text/html; charset=utf-8&quot; http-equiv=Content-Type&gt;&lt;META name=GENERATOR content=&quot;MSHTML 9.00.8112.16457&quot;&gt;&lt;STYLE type=text/css&gt;BODY { FONT-FAMILY: verdana, arial, sans-serif }&lt;/STYLE&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;FORM method=post action=2.php&gt; &lt;TABLE border=1 ...</description>
			<content:encoded><![CDATA[ <p>Hi all this should be an easy one,</p>

<p>Trying to move an input from text box1 to text box2 and return back to page1.</p>

<p>page 1 reads,</p>

<pre><code>&lt;HTML&gt;&lt;HEAD&gt;&lt;TITLE&gt;php scenario move text &lt;/TITLE&gt;&lt;META content="text/html; charset=utf-8" http-equiv=Content-Type&gt;&lt;META name=GENERATOR content="MSHTML 9.00.8112.16457"&gt;&lt;STYLE type=text/css&gt;BODY {
    FONT-FAMILY: verdana, arial, sans-serif
}&lt;/STYLE&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;
&lt;/P&gt;&lt;P&gt;&lt;FORM method=post action=2.php&gt;
&lt;TABLE border=1 cellSpacing=2 cellPadding=1 width=100&gt;
&lt;TBODY&gt;&lt;TR&gt;&lt;TD valign=center align=center&gt;
&lt;INPUT name=box1 value="Text Field"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD valign=center align=center&gt;
&lt;INPUT value="Submit Query" type=submit&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD valign=center align=center&gt;
&lt;INPUT name=box2 value="Text Field"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD valign=center align=center&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR&gt;&lt;/FORM&gt;
&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;
</code></pre>

<p>2.php reads</p>

<pre><code>&lt;?php

  box2 = text_box1 ;
   1.php;

   ?&gt;
&lt;HTML&gt;&lt;HEAD&gt;
&lt;META name=GENERATOR content="MSHTML 9.00.8112.16457"&gt;&lt;/HEAD&gt;
&lt;BODY&gt;&lt;/BODY&gt;&lt;/HTML&gt;
</code></pre>

<p>I know this is basic however it may help someone.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>Kniggles</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/452807/basic-starter-question-</guid>
		</item>
				<item>
			<title> Function ereg() is deprecated  Error in wamp server 2.2</title>
			<link>http://www.daniweb.com/web-development/php/threads/452743/-function-ereg-is-deprecated-error-in-wamp-server-2.2</link>
			<pubDate>Thu, 18 Apr 2013 06:25:57 +0000</pubDate>
			<description>Last Day I have installed wamp server 2.2 and I was using wamp server 2.0c till then. I have a strange problem, when i start wampserver and try to load pages on browser it shows the error &gt; Deprecated: Function ereg() is deprecated http://tinypic.com/r/206g8is/6 Please help me , thanks in ...</description>
			<content:encoded><![CDATA[ <p>Last Day I have installed wamp server 2.2 and I was using wamp server 2.0c till then. I have a strange problem,<br />
when i start wampserver and try to load pages on browser it shows the error</p>

<blockquote>
  <p>Deprecated: Function ereg() is deprecated</p>
</blockquote>

<p><a href="http://tinypic.com/r/206g8is/6" rel="nofollow">http://tinypic.com/r/206g8is/6</a></p>

<p>Please help me , thanks in advance.</p>

<p>[ The error show for the<a href="http://innovationsdesign.net/wb_2.7/pages/tech-resources/downloads/libmail.php" rel="nofollow"> libmail include file</a> ]</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/web-development/php/17">PHP</category>
			<dc:creator>jithinjohny</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/web-development/php/threads/452743/-function-ereg-is-deprecated-error-in-wamp-server-2.2</guid>
		</item>
			</channel>
</rss>