cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I have nearly completed the code but still got one problem. In myfunction I have the following line:

resultbox->AppendText(std2sys("asdfasdf\n"));

However the resultbox (richtextbox) cannot be found due to the function being outside the Form1 class. Does anybody know how I can append to this field outside its class? Thanks.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I just found on the net the following code which I will try and embed and I'll let you know how it goes.

#include <process.h>    /* _beginthread, _endthread */
#include <Windows.h>
#include <iostream>
using std::cout;
 
typedef struct ST{ 
    int num; 
	int i;
    char* buf; 
}threadparam; 

void MyThread( threadparam* param )
{
	int i = (param)->i;
	int j = (param)->num;
    cout << "Hello World from " << i << " - " << j << '\n';
}

 
int main()
{
    for(int i = 0; i < 5; i++)
    {
		threadparam st;
		st.num = 6000;
		st.i = i;
        _beginthread((void(*)(void*))MyThread, 0,(void*)&st);
 
        /* Wait one second between loops. */
        Sleep( 1000L );
    }
}
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Here is a simple example. The only reason it includes windows.h is because it uses the win32 api function Sleep() It will become more complicated if each of the threads must access the same global variable or common function. In that cast the threads have to be synchronized to avoid clashes while reading or writing at the same time.

#include <process.h>    /* _beginthread, _endthread */
#include <Windows.h>
#include <iostream>
using std::cout;

void MyThread( void *dummy );


int main()
{
    for(int i = 0; i < 5; i++)
    {
        _beginthread( MyThread, 0, (void *) (&i)  );

        /* Wait one second between loops. */
        Sleep( 1000L );
    }
}

void MyThread( void *param )
{
    int i = *(int *)param;
    cout << "Hello World from " << i << '\n';
}

That code looks good an all but I still have one question. How do I pass multiple parameters to the MyThread function? In my first post the function is defined as follows:

void myfunction(std::map <unsigned int, std::string> list,unsigned int count, 0, 4);

So could you please modify your code to allow these additional parameters as I don't have a clue.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Hi, I'm writing a large program but require Multithreading for this software. I've searched the web for just over an hour and now is just after midnight but still can't find anything simple. The only thing I saw that came close to what I need was at http://www.computersciencelab.com/MultithreadingTut1.htm but I can't even get that code to work. Basically I have 4 functions (same function but different parameters) and need each function to go into it's own thread making a total of 5 threads (5th thread being the GUI/main() function. The code I have for these functions are as follows:

myfunction(list,count,0,4);
myfunction(list,count,1,4);
myfunction(list,count,2,4);
myfunction(list,count,3,4);

So can somebody point me in the right direction as to how to get each of those functions to go into their own thread simultaneously and preferably with a lower priority than that of the GUI. Also the GUI is done in Microsoft Visual C++ 2008 with the CLR interface.
Any help is greatly appreciated and I'll check this topic in the morning when I wake up as it is now 12:42 at night. Thanks for any information/code provided. :)

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

made the pants fall down

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

were twice his size and

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

garbage dump at the

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

cwarn, what's your super-geek power?

I asked my msn contacts and they say Gettin' the girls' but IMO I believe the power is (((2^1023)-1)+(2^1023)) which is the same as (2^1024)-1 if you got the correct bit rate and cpu to calculate. That's my brain cpu power. With this power I have been able to write rather complicated programs with the longest variable name been 7 characters short int which can do pretty good things like a bot that scans the web and deciphers web pages from images and movies. But with great power comes great responsibility. In this case it means to make sure everybody benefits and not just the one who started it. So as the guy from lord of the rings would say, the one geek to change them all. Hope that explains it.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Try adding this to your html form and your code should then work.

<input type="hidden" name="finish" value="true">
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

deleted itself and went

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I guess I'll be the first to say this and I'll say:
"I'm a super geek!"

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I want to know if I am on the right track.

Hi,
From the code snippet you have sent it appears you are on the right track but just keep in mind that regex otherwise known as the preg_ functions take up a lot of cpu. So in that code snippet the only suggestion I would make is to replace the last preg_replace with a loop ("for loop" probably) that finds the entries and replaces the entries by appending to a new string as it comes across each character. But other than that great job. :)

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Try something along the lines of the following:

<?php
$_COOKIE['visits']=(isset($_COOKIE['visits']))?$_COOKIE['visits']++:1;
setcookie('visits',$_COOKIE['visits'],time()+3600*24*365);
if (isset($_GET["firstname"]) && $_GET["lastname"]) { #if data is set
   if (!empty($_GET["firstname"]) && !empty($_GET["lastname"]) {
      $Fname= $_GET["firstname"];
      $Lname= $_GET["lastname"];
      $User= $Fname . " " ."$Lname". ;
         /* Set cookie to last 1 year */
         setcookie("username", $User, time()+(60*60*24*365));
         //if (isset($_COOKIE[['username']))
            //echo "Welcome " . $_COOKIE["Username"] !<br />";
   }
#eof if value entered
   else {
        echo "No empty fields allowed <br />";
        header('location: welcome.html');
      }
 } #eof is set
 #data is not set
 else
 {
  echo "You must supply both Firstname and lastname <br />";
  header('location: welcome.html');
 }
 //print_r($_COOKIE);
  
/*else
  echo "Welcome guest!<br />";
   // A way to view all cookies  */

?>
<html>
<head>
<title> Title </title>
</head>
<body>
<?php
if ($visits > 1) {
  echo("This is visit number $visits.");
} else { // First visit
  echo('Welcome to my Website! Click here for a tour!');
}
?>
</body>
</html>
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

In some way I would disagree with gizgiz, because MD5 hash can be unhashed, for example, by using http://www.md5-online.com/ project.

If security is primar - I would suggest using salt. Even better, if there is unique salt value for every user.

Agreed and perhaps this function is the best hashing function of them all.

function truehash($hashzzz) {
return hash('sha256',substr(hash('whirlpool',$hashzzz),3,-3));
}

With the above function, there is no way that anybody can use any current brute force data available on the internet to reverse it and because it uses 2 hash functions it uses twice the cpu to brute force it. Also with the substr function, even if the whirlpool and sha256 functions are cracked via algorithm, the substr would make it impossible to even then reverse it.

As for how to use this hash function you simply insert into the users database their password as a hash (eg. truehash();) and use the following example to check if the user has valid details.

<?php
$user = 'bill gates';
$password='3.14159265';
//above are what would normally be $_POST variables
function truehash($hashzzz) {
return hash('sha256',substr(hash('whirlpool',$hashzzz),3,-3));
}
$r=mysql_query('SELECT * FROM users WHERE user="'.mysql_real_escape_string($user).'" AND password="'.truehash($password).'"');
if (mysql_num_rows($r)>0) {
echo 'user is in the database';
} else {
echo 'Access denied!';
}
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Here its..... 00:19 and nobody know where i am :D

I checked my world time clock and it says you would be in Iraq. Am I right?

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Also not sure if this works when using the variable in a function(). Which is basicly what function.php is for. Would i need to add the variable into the function foo($variable)?

Yes that is exactly what you need to do. For example:

<?php $variable='test';
include('second.php');
foo($variable);
function foo($test) {
echo $test;
}
foo($variable);
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Try the following.

Index.php

<?php
$variable='this is a test.';
include('function.php');

And Function.php

<?php echo $variable; ?>
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Put this into your html form to allow the user to upload more than the browser can normally handle.

<input type="hidden" name="MAX_FILE_SIZE" value="60000000" />
<input type="file" name="video">
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Try this:

<?php session_start();
 
      if(isset($_GET['finish']))
      {
      	$_SESSION=array();
      }
      else
      {
         $_SESSION['number'] = $_GET['number'];
 
         if (!isset($_SESSION['count']))
         {
      	   $_SESSION['count'] = 0;
         }
         else
         {
      	   $_SESSION['count'] ++ ;
         }
         $counter = $_SESSION['count'];
 
 
?>
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Try the following:

<?php session_start();
      $_SESSION['number'] = $_GET['number'];
      if (!isset($_SESSION['count']))
      {
      	$_SESSION['count'] = 0;
      }
      else
      {
      	$_SESSION['count']++;
      }
$counter = $_SESSION['count'];

But be sure to delete cookies before testing so you have a fresh start and new sessions.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

PS. I have had this working on another site put was using the form function POST instead of GET. Would that make a difference?

Let me be the first to say welcome to daniweb. Also I would like to give you some credit as a first time poster as it is little comments like that which makes our lives so much easier.
The answer of the question lays in when you changed the data submission method from get to post. When changing this piece of html code you will need to adjust the php code accordingly. Why? Because when the method get is used, the data will be stored in the $_GET array. However when the post method is used, the data will be stored in the $_POST array. And because you changed from get to post you need to change $_GET to $_POST. Below is the corrected version of the code you have posted.

$submit = $_POST['Submit'];
$id = $_POST['Id'];                       
echo getuser($submit, $id);

A very simple problem and also note that the names inside the quotes are case sensitive.

kvprajapati commented: (: +11
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

To be honest, simply doing www.domainname.com/username/ would be much simpler.

I beg to differ and say it's just as simple to get a subdomain for the user as it is for a subdirectory. I just happened to come across this issue a couple of years ago and already know the answer provided you use cpanel. In cpanel delete all of the subdomains for the domain your going to use for this project then create a subdomain called '*' (without the quotes). So just a * is the subdomain. Then point the subdomain to a directory which will process all of the subdomains. In that directory you should have a brand new blank index.php ready to create. Now with that one subdomain, any subdomain you enter will point to that index.php file. All you need to do is find out what the subdomain is and fetch relative content from the database. To make things easier, php stores the domain information in $_SERVER; Or at least one of those $_SERVER variables. So using that variable you can substr() to your subdomain and find out from the database which user owns the subdomain and which content should be displayed for that subdomain.

So that's a brief overview of how it works and any questions just post away.

showman13 commented: This is EXACTLY the kind of response I was looking for... thank you +0
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

It means that the 'price' column does not exist. Keep in mind php is case sensitive so make sure that it's not 'Price' or 'PRICE' or something else other than 'price'. You can always do print_r($row2) to find out what it is.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Here is 2 examples of how to do it in the one script. Just delete the Option A section or the Option B section to view each example individually. As they both share the code at the top.

<?php
$items=array('apple','apple','poison','fruit','fruit','banana','veg','veg','veg','strawberry');
$count=array();
foreach($items AS $val) {
    if (!isset($count[$val])) {
        $count[$val]=1;
        } else {
        $count[$val]++;
        }
    }

    
    
    
    
//Above is required for both of below
////////////////////////////////////////////////
//Option A
    
foreach ($items as $product ) {
echo $product;
?><input type="text" size="2" value="<?php  
//display quantity here
echo $count[$product];
  ?>" name="quantity" /><?php
}

echo '<hr>';////////////////////////////////////
//Option B
foreach ($count as $product=>$counts ) {
echo $product;
?><input type="text" size="2" value="<?php  
//display quantity here
echo $counts;
  ?>" name="quantity" /><?php
}
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I think what you are after is the str_split(), unset(), and implode() functions. Below is an example of how I would do it.

<?php
function parts($string) {
    $tmp=str_split($string,3);
    $a=$tmp[0];
    unset($tmp[0]);
    $b=implode('',$tmp);
    return array($a,$b);
    }
///////////////////////////////////////
//Do Not Edit Above

$data = parts(1234567890);
echo $data[0];
echo '<br>';
echo $data[1];
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

This error usually means the username and password specified are either invalid or have insufficient permissions to the database.

So perhaps try your regular cpanel details in the mysql_connect() function as that gives you full permissions associated to your cpanel account provided your using cpanel. If your not using cpanel then use the details your host has provided when setting up the hosting account although the password may have changed since depending on how much you have changed the settings. If however your using something like wampp or xampp then I would suggest using the root username and password.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

That is what I like to call cybercrap or cyberjunk. It's the sort of thing that should be displayed in the Mosaic browser within a museum.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Ignoring moore's law, i think we are looking at 3.4 Terahertz, 128 cores, 4 Tb of RAM, 34 yottabyte HDD sitting on PATA 7 (300gb/s), not forgetting ATI Eyefinity version 56 (64 monitors).

By any chance would that be 64 one inch monitors. Because I can't see how I would be able to look at 64 twenty four inch monitors without standing back 32 meters. Then I would need a very long cable on my mouse and keyboard if I have one.

4TB of RAM... So much brute force hashing I could do with that. Doesn't compare with my puny 12GB of RAM for my current computer. And 34 yottabytes (10^15 GB) imagine how much porn people would be able to download to their computer. As for how I would fill my hard drive, I would download the internet as to internet is only about 2 yottabytes as of today (2010). The only thing is I would need a yottabit internet connection which means just after the NBN (National Broadband Network) lays the fiber optic cables they will probably have to lay out some new cables in 2020 to replace fiber optics with a yottabit connection to the average home user.

I wonder what the graphics would be like. 1TB of Graphics? My models would be able to render top university quality on the fly live. That would be soo coool! Then I could make games with brute force 3d lighting rendering effects. I wish somebody could just …

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

all window OS are better then others but apple OS is also good

So your saying Windows 3.11 is better than Ubuntu 10 because you said all windows OS's. If that is the case then what about Windows 3.11 makes it better to Unix/Linux or even MacOSX.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Hi, I thought I would ask "what do you think the average computer will be like in 2020?". I have read about Moors Law which says we should have 25.6GHz 32 core cpu with over 256GB of ram. But is this totally correct or are we expected to see more with some technological breakthroughs. If your interested post your guess of what your computer specs will be like in 2020.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I thought I would update my opinions as I have now seen the release of Windows 7 (Release of the hounds) and have seen what it looks like. My opinion. Garbage. Too much like the Mac OS X Interface where you have gadgets and widgets and all of that other junkware embedded into the OS. The fact that I can't see my programs on the task bar and that I have to hover over these mystery icons to find out where they are makes Windows 7 terribly hard to use in comparison to XP and 98 SE. The only reason why I ever have had Windows 7 installed is for testing in a virtual box and dual booting with Ubuntu so I get support from a technician for my expansive hardware (i7 8 core 3.2GHz & 12GB ram).

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Try the following:

if (!is_file($template_file)) { $template_file = $this->get_default_template(); }
    // Look whats the current post
    if (is_object($GLOBALS['post'])) { $this->the_current_post = $GLOBALS['post']; }
    
    // Use the template
    ob_start();

Also don't forget that php is case sensitive.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

That code is correct but keep note that the first code snippet function only returns a single row. Then loops through the columns of that row in the second code snippet and the third function is a dynamic function which it's name is $get_query as pre-defined.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Try just the following and report back here any errors.

$product = new Categories(DB_SERVER, DB_USER, DB_PASS, DB_NAME);
    $product->setCategoryName($categoryName);
    $product->setTableName("$tableValue");
    $product->readKeyArray($keyArray, $valueArray);    
    $product->enterCategoryInDB();
    $product->getCategoryID();

I do not believe that the "try" and "catch" statements are valid php.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

The mysql_fetch_assoc() error can also be due to an invalid mysql_query() syntax input. So try doing mysql_query($sql) or die(mysql_error()); so that you get debugging information. Then tell us what additional errors it reports back.
Also don't forget to use mysql_real_escape_string().

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

The following function is fool proof and fully past, current and future attack resistant.

function truehash($input) {
return hash('sha1',substr(hash('sha1',$input),4,-4));
}
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Try the following

mysql_query('SELECT * FROM `table` GROUP BY `title`');

That will remove any duplicates from the title column when selecting. Keep in mind it does not delete the data but instead just filters it for the query.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Is this a php or javascript question because aren't the try and catch statements part of the javascript language. If that is the case then perhaps you are posting in the wrong section. Also could you please send some code to explain your question.
From what I can understand in your context if you are wanting to display or execute data inside the <td></td> tags then yes you would place the javascript between the <td></td> tags. Otherwise please explain further with code samples.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

These articles contradict what you are saying:
article1
article2

I have a core-duo and Win 7 (Home Premium) and it uses both cores (I have a gadget that tracks usage of everything). Don't know if there is a limit on the number of cores that it will support but it is at least two.

I have just checked those links and still it proves my point with one exception. That is Windows Home Premium supports 2 cores instead of 1 while Home basic and Starter editions support only 1 core. But still that does not allow Windows 7 to read all my 5 cores. Note the difference between cores and threads. There are usually 2 threads in a core but in my case it is one thread in each of the 5 cores. So if for example you have a 2 core processor with two threads then windows will read 4 cores when it is actually 2 cores with two threads each. But anything beyond the 2 cores 2 threads windows will not recognize. And as I said I had 5 cores and 1 thread per core.
http://en.wikipedia.org/wiki/Windows_7_editions#Comparison_chart

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Hi, I just upgraded from Windows XP to Windows 7 Home Premium in my virtual box so that the operating system could recognize all of the cpu. My Virtual box setup is a 5 core 1 thread per core setup and XP Pro only sees 2 cores (dual core). Then I upgrade to Windows 7 Home Premium and discover I now have 1 core. So I read up about it on the net and discovered Home premium does not support multiple cores. Only multiple threads but I have just the one thread. Then I find out if you want 2 cores to be recognized with it's associated threads then Windows 7 Professional or Ultimate will do the job. But I don't have 2 cores. I have 5 cores each with 1 thread. So when will Microsoft be serious and remove the limitation so that up to 255 cores can be recognized like Linux can. In the end I had to switch to Linux and use the wine emulator for my software. I believe that the 64 bit version of Windows Vista & 7 are really screwed because they are by far more limited then what they should be. For example. The theoretical limitation of 64 bit ram is 2^64 bytes which in gigabytes is ((2^64)/(1024^4)) = about 167771450GB RAM. However Microsoft limits this to 8GB in Windows 7 Home basic and 192GB in Ultimate edition.
The bottom line here is "Is Microsoft trying to force us to upgrade to …

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Hi Ancient Dragan. I have just checked your script and can't see how it displays the data from the table. Is there meant to be more code after the sqlite3_exec function? Also I though I would ask is it possible to replace the callback function with just the integer 0 as I have been doing or is there something special with the callback function?

Thanks.
cwarn23

int callback(void *NotUsed, int argc, char **argv, char **azColName){
  int i;
  for(i=0; i<argc; i++){
    printf("%s = ",azColName[i]);
    if( argv[i] )
        printf(argv[i]);
    else
        printf("NULL");
     printf("\n");
  }
  return 0;
}

void display(sqlite3* db, char* tbname)
{
    char* db_err = 0;
    char select[255] = {0};
    if( strlen(tbname) == 0)
    {
        GetTablename(tbname);
        if( tbname[0] == '\0' )
            return;
    }
    if( strlen(tbname) > 0)
    {
        sprintf(select, "select * from %s;", tbname);
        sqlite3_exec(db, select, callback, 0, &db_err);
        dsperr(&db_err);
    }

}
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Hi, I have just started out with sqlite in c but I can't seem to return the results of the select statements. There are so many functions that I don't know what to use as none of them make any sense. So can anybody give me an example of how to select from a sqlite database using the sqlite c api. Thanks.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I'm impressed with vijayan121 post. At the moment where I am it's dark and getting late but tomorrow afternoon I'll examine all of that code as it looks like it solves the question. And if I have any further questions I'll post them here but if I don't find any I'll shortly close this thread. Thanks for that code and great explanation.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I just tried you functions and after correcting the out of range bug I found that they return 0000 or "". But the function that needs tweaking is bin_and_convert() and to make it more clearer it is basically a simple math problem which the function solves. The math problem is ((20+x) & 1234)=1000 as an example. Now what I need to do is find the value of x. I have a function that sorta does the job (bin_and_convert()) but that function needs to get both the highest possible value of x and the lowest possible value of x as x can be multiple values. Can anybody fix my function bin_and_convert() to do this?

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Hi,
I have been working on a way to reverse bitwise Xand with c++. I have managed to do most of it but can anybody tweak this script I made so it works to its full potential. At the moment this script tries to return the variable x from ((12 + x ) & 1456). I have managed to make this script return a value of x but I wan't a specific possible value of x. That is the highest possible value of x and the lowest possible value of x. These two values could be separated by a bool input in the function to determine the output (highest/lowest) but does anybody know how to do this? My code is as follows and this is a project I have come up with by myself.

#include<string.h>   
#include<malloc.h>   
#include<math.h>   
#include<stdlib.h>   
#include<iostream>
#include <sstream>

unsigned long int bin2dec(std::string bin)
{
  unsigned long int result=0;
  for(unsigned int i=0;i<bin.length();i++)
  {
    //if((bin[i]!='0')&&(bin[i]!='1'))
    //  return -1;
    result=result*2+(bin[i]-'0');
    //if(result<=0) return -1;
  }
  return result;
}

std::string dec2bin (unsigned long int n) {
unsigned int i,j,b[100];
std::string result=""; 
i=0; 

while(n>0) 
{
std::stringstream out;
out << (n%2);
result=out.str()+result; 
n=n/2; 
//i++; 
} 
/*printf("\n\nBinary Equivalent:"); 
j=i-1; 
for(i=j;j>=0;j--) 
printf("%d",b[j]);*/
return result;
}



unsigned long int bin_and_convert(unsigned long int greater_than, unsigned long int right, unsigned long int total_equals) {
	std::string lenstr = dec2bin(greater_than);
	unsigned int len = lenstr.length();
	len--;
	std::string subject = dec2bin(total_equals);
	std::string subj = subject;
	std::string tmp;
	subj=subject;
	int num,numb;
	num=0;
	numb=0;
	std::string str;
	str="";
	for (unsigned int m=1;m<=subject.length();m++) { …
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

At the moment I'm eating /root/ of a carrot and working my way down.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Have no idea WHERE you saw this but Vista always WAS and STILL is supported until April 2012 by Microsoft as long as SP 2 is installed. Same goes for XP, as long as SP3 is installed it also has support until April 2014.

You are also wrong about Internet Explorer. It is FULLY COMPATIBLE with Vista. It is part of the operating system.
You need to check your facts before posting 100% inaccurate information.

I just did a google search and looks like windows Vista is supported until 2011. And I never said Internet Explorer was incompatible but is said Internet Explorer might be incompatible. Big difference. The same is true if you have the wrong version installed. Eg. In Europe some of Microsofts Operating Systems do not come with Internet Explorer leaving human error for installation. But I'm not sure if that is Vista inclusive.
And as for XP. Did I mention anything about XP? I agree with you about the XP part as I never mentioned anything about XP.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

OK, tried that too... but nada

print_r($structure);  // prints the entire array with values
  echo "<br>\n";
  // $cntFields = 9
  for ($i=0; $i<$cntFields; $i++) {
    print_r($structure[$i]);    // prints nothing
    $a = $structure[$i]['0'];
    $b = $structure[$i]['1'];
    echo "Field = $a / Value = $b<br>\n";  // Field = / Value =
  }

It looks like your array design is wrong. As you have populated the array you have overridden the old values of the array. Could you please post the section of script that generates the array.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Was reading the documentation and found your bug. Try the following as I have fully corrected your original problem.

session_start();
$username="thorby68@live.co.uk";
setcookie('sb_cookie', $username,  time()+10000, '/');
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Perhaps try renaming the cookie so that it only contains letters and numbers. I have created a debugger script so try the following:

file 1

session_start();
$username="thorby68@live.co.uk";
setcookie('sbcookie', $username,  time()+10000);

file 2

session_start();
if (isset($_COOKIE['sbcookie'])) {
if (!empty($_COOKIE['sbcookie'])) {
echo $_COOKIE['sbcookie'];
} else {
echo '<i>This cookie has been emptied or not transfered properly</i>';
}
} else {
echo '<i>This cookie does not exist as far as php can see</i>';
}