cwarn23 387 Occupation: Genius Team Colleague Featured Poster

For crying out loud just use the following

<?php require_once('Connections/vendorshomepages.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

mysql_select_db($database_vendorshomepages, $vendorshomepages);
$query_Parent = "SELECT * FROM categories";
$Parent = mysql_query($query_Parent, $vendorshomepages) or die(mysql_error());
$row_Parent = mysql_fetch_assoc($Parent);
$totalRows_Parent = mysql_num_rows($Parent);

mysql_select_db($database_vendorshomepages, $vendorshomepages);
$query_Child = "SELECT * FROM companies";
$Child = mysql_query($query_Child, $vendorshomepages) or die(mysql_error());
$row_Child = mysql_fetch_assoc($Child);
$totalRows_Child = mysql_num_rows($Child);


<?php
if ($row_Child)     {
  echo "<SC" . "RIPT>\n";
  echo "var WAJA = new Array();\n";

  $oldmainid = 0;
  $newmainid = $row_Child["comp_cat_id"];
  if ($oldmainid == $newmainid)    {
    $oldmainid = "";
  }
  $n = 0;
  while ($row_Child)     {
    if ($oldmainid != $newmainid)     {
      echo "WAJA[".$n."] = new Array();\n";
      echo "WAJA[".$n."][0] = '".WA_DD_Replace($newmainid)."';\n";
      $m = 1;
    }

    echo "WAJA[".$n."][".$m."] = new Array();\n";
    echo "WAJA[".$n."][".$m."][0] = "."'".WA_DD_Replace($row_Child["comp_id"])."'".";\n";
    echo "WAJA[".$n."][".$m."][1] = "."'".WA_DD_Replace($row_Child["comp_name"])."'".";\n";

    $m++;
    if ($oldmainid == 0)      {
      $oldmainid = $newmainid;
    }
    $oldmainid = $newmainid;
    $row_Child = mysql_fetch_assoc($Child);
    if ($row_Child)     {
      $newmainid = $row_Child["comp_cat_id"];
    } …
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

And also network speeds are a big issue in many areas. IMO the Rudd government needs to be more active on the new network roll out as it has already been at least a year with no word about it.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Google is your friend.
I would suggest using preg_match_all to retrieve the data then display the data in the proper formatting with loops.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

i have initially tried that but the problem that i am having with that is that is is only storing the current value. it is not storing the other values when the loop runs another time. ie. when i get a result in $row1 in the first loop it is stored in the array however in the next time it loops the array only contain one value and that value will now be the second course

Try to copy and past my code because I used the [] operator which makes a big difference. That is where your problem would have been.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster
<?php


$hostname = "localhost";
$username = "root";
$password = "hayden";
$database = "ecng3020";



$con = mysql_connect("$hostname","$username","$password");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
  mysql_select_db("$database", $con);
  
  $q="SELECT * FROM rules Where type ='course_option'  ";
  if ($result_2=mysql_query($q))
  {
  	echo"nice";
  }
  else
  {
  	echo"shit";
  }
  $first=array();
	while($row = mysql_fetch_assoc($result_2))
	{
			extract($row);
			echo "<p>$parameters</p>";
			$e=explode(",",$parameters);
			print_r($e);
			foreach ($e AS $val) {
			$w="SELECT * FROM student_courses WHERE course_status='pass' AND course_code='".mysql_real_escape_string($val)."' AND id_no=806000169";
			
			if ($result1=mysql_query($w))
			  {
				echo "nice";
			  }
			  else
			  {
				echo "shit";
			  }
			  while($row1 = mysql_fetch_assoc($result1))
			  {
			  	extract($row1);
                $first[]=$course_code;
				echo "<p>$course_status</p>";
			  }
            }
		
	}
    print_r($first);
	
?>
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Why don't you use the paypal cart cms or if you want it custom made then perhaps download a pre-made cart and see how they did it. But as for how to insert the item simply use the mysql_query("INSERT INTO `table` SET `column`='value', `another`='value2'"); Also you will need to send the user a cookie for identification.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Just realized two days ago that I can eat ice cream outdoors and have it not melt on me, but this superpower works only in the winter... :P

Don't the mosquitoes bite you because there are a lot of mosquitoes where I live unless I turn off the lights in which case I can't see what I'm eating/drinking. Nice idea though. Will try it some day.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

where exactly do i need to put that script? Because its not working.

I re-inserted mysql_free_result()

The thing is the url in the browser never changes.

If you add or die(mysql_error()); after the mysql_query() then it will show the true error.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Perhaps the following?

<?php


$hostname = "localhost";
$username = "root";
$password = "hayden";
$database = "ecng3020";



$con = mysql_connect("$hostname","$username","$password");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
  mysql_select_db("$database", $con);
  
  $q="SELECT * FROM rules Where type ='course_option'  ";
  if ($result_2=mysql_query($q))
  {
  	echo"nice";
  }
  else
  {
  	echo"shit";
  }
											
	while($row = mysql_fetch_assoc($result_2))
	{
			extract($row);
			echo "<p>$parameters</p>";
			$e=explode(",",$parameters);
			print_r($e);
			foreach ($e AS $val) {
			$w="SELECT * FROM student_courses WHERE course_status='pass' AND course_code='".mysql_real_escape_string($val)."' AND id_no=806000169";
			
			if ($result1=mysql_query($w))
			  {
				echo "nice";
			  }
			  else
			  {
				echo "shit";
			  }
			  while($row1 = mysql_fetch_assoc($result1))
			  {
			  	extract($row1);
				echo "<p>$course_status</p>";
			  }
            }
		
	}
	
?>
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

on line 47 change to

extract($row1);

That will solve your first problem and could you mention the value you would like to store in the array (eg. $course_status).

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I'm drinking ice cream and eating water. lol

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Here is an interesting update to the story:
http://www.nytimes.com/2010/02/16/science/16archeo.html?ref=science

I read the story and sounds like maybe a bunch of apes mastered technology before humans wiped them out. lol But yea, I'm sure before humans or the bacteria that made humans existed there would have been another civilization around and my bets are they came to earth where they faced extinction. That or they went to Pegasus where the US Airforce used an ancient device to go to Pegasus and bring Atlantis back to earth.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Well generally that error is a problem with the sql syntax. Could you add after mysql_query() the term " or die(mysql_error());" So it would be like

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

That usually picks out the obvious errors and make sure the mysql variable is a valid result. For example if you assign $result a string or integer then it will nolonger be a valid mysql query. So let us know of the result with the above modification if there are any additional errors reported.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Then Perhaps you could try deleting the lines with the function mysql_free_result(). I have heard that it uses more cpu to free the result instead of ignoring the result.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

It means you have an error in your mysql syntax. Try in addition the following

<?php
mysql_free_result($Parent) or die(mysql_error());
 
mysql_free_result($Child) or die(mysql_error());
?>
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

The action= only works in the <form> tag and would be as follows

action="<?php echo $row_Child['comp_url']; ?>">
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Do you mean to suggest problems? My guess of 1 big problem would be network connectivity for wifi.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I have been googling around but can't seem to answer this question. Where do I find the windows drivers (c++) for the macbook built-in webcam. Does anybody know where I can find c++ drivers for the macbook built-in webcam? Basically I need to be able to write software that can see what the camera sees.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Cleaverbot told me that he is not a bot but instead a human. What bot would think their human? It could say at least it is an alien from area 51.

I'm not a bot.
Then who are you?
I am a human.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Mhh! as I was reading the post the same question came to my mind. Why would it be needed not only in PHP but also in other language like C++? Don't get mad at me cwarn (remember SHA1 cracker?)
That infamous gOtO ;)

The reason I used the goto tag in c++ is because I was too lazy to make an infinit loop. But yes there are methods to use in any language which posses loops. I believe the goto tag was originally used before loops had been invented. But when new/current languages came out with the loop mechanism there was no need to use the goto unless your lazy or unexperienced.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

It means you don't have the latest version of php. The goto element is only available in the latest release (5.3) but I wouldn't recommend it due to incompatibility bugs. Instead try using loops and if statements such as the following:

<?php
if (false) {
echo 'Foo';
}
echo 'Bar';
?>
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

The main problem is the massive amount of data.
The same thing happens in some areas of physics where the amount of data generated in a single experiment can run into the petabytes.

Indeed. I wish they would invent those 256 petabite hardrives sooner with 512TB of ram. But soon I believe there is a hard drive that can hold something like 12TB on a cd size disk. Still in development but in another 2 years will be ready for public use with the new replacement of blueray. Imagine that. A dvd that can hold 12TB of video (not GB but TB). So in the near future there will be no problem with space as the disk space technology is growing faster than cpu technology. Just thought I would share that.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

If you want to disable any ads then I would suggest becomming a sponsor by clicking the donate button at the top and you will receive an option to turn off ads. I myself haven't disabled the ads but being a sponsor I always have the option to disable at request.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Yes and for a medical scientest to do something like calculate the genitic makup of a couples future child that would require huge amounts of cpu as there are billions of dna protines to calculate. So with everything being theoratically possible but the cache is you allways need relavent cpu. And in most cases you need more cpu than what anybody has access to. So in this case to do something like to monitor all of a humans organtic systems to make sure everything is normal then huge cpu can be required as many calculations need to be performed to calculate what is normal for that person. For example, a persons normal weight is factored by age, height and current weight. But more technical organic components require deeper calculations.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Also on line 10 you need to change to the } type bracket.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Many people have had this problem and it is because google doesn't like bots reading it's search engine page. Instead I would suggest reading up on the google search api. This is an ajax/javascript api for retrieving results from any of the google services which will avoid this error. Also not that ajax can easily be converted to php.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I just checked the links and the camera on the lego robot doesn't appear to have any programming interface. In otherwords it is just showing the user via network what is in front of the robot instead of the robot processing that data. But I want the robot to be able to process the images from the film taken by the robot. I also saw the other page and there was 1 robot that looked interesting but it appears as if they are pre-programmed where although I don't mind hardware interface being pre-programmed, I need to be able to add an Artificial Intelligence to the robot as well as a sensory (wi-fi) for the robot to be able to communicate with replica model types and to the master computer. Just thought I would express that and although I like the looks of the Microsoft Robotics studio I can't find a model the right size to do the job. When I say the right size I mean the robot I am making should be at the most 25cm tall. The ones I was finding were like 1.5 meters tall and $9,000+. Any ideas on products simular to lego robotics?

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I saw that one and the only problem with it is that Lego mindstorms doesn't include a camera that can film the surroundings and process that film into data. Also I just realized a microphone+speakers on the robot would be good too.

Lego mindstorms

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I have completed the script and is as follows:

<?php
session_start();
$dbhost = 'localhost';
$dbname = 'mydatabase';
$dbuser = 'root';
$dbpasswd = '';
$link_id = mysql_connect($dbhost, $dbuser, $dbpasswd);
mysql_select_db($dbname, $link_id);

$fl = "common.php";
$f = file_get_contents($fl);

$sql = mysql_query("SELECT langkey,cy,en FROM pl_terms2 WHERE filename = '$fl'");
$f = str_replace(array("\t",'  ','  ','  '),array(' ',' ',' ',' '),$f);
while($d = mysql_fetch_assoc($sql)){
   $key = $d['langkey'];
   $cy = $d['cy'];
   $en = $d['en'];
   $f=str_replace(' \''.$key.'\' => \''.$en.'\',',"    '".$key.'\''.str_repeat(' ',(40-strlen($key))).'=> \''.$cy.'\',',$f);
}

$f = str_replace("\r\n","\n",$f);
file_put_contents($fl,$f);
?>
diafol commented: To the rescue once again! +5
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

lol, good to see people have a sense of humor but still doesn't answer my question. I especially like the response a computer on wheels. Now how would I make that I'm thinking. I discovered that Microsoft has their own robotics studio but does anybody know of robotic hardware that can link in with the microsoft robotics software which also matches my requirements? Thanks.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Where can I find software and physical parts for making miniature robots. C++/visualbasic or similar languages are preferred. The tools I require is the software to create the script which will be transfered to the robot, wifi capability, 1 video camera linked to the software inbuild (which can rotate 180 degrees left-right), three wheels (2 at back 1 at front) or similar wheel setup so the robot can move around the room. It needs to include basic speakers too and a battery power supply. Also the robot needs a cpu of around 3GHz single core.

Does anybody know where I can get such equipment?

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Well could you post as an attachment a sample text file this script may read. Then I may be able to do a better regex for you.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

... and dont have solution yet.

Easy. If you find typing difficult then what about talking. Get one of those voice recognition kits where you can speak to the computer and the computer will automatically display the words. I'm sure that would be a lot easier than typing.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

It appears to be secure and with a few tweaks could be more secure than sha1. But I would recommend doing more than just adding the numbers on line 20. Perhaps using a binary operator would be better.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Then it means you have "error=<something>" in the url. Try removing that then the problem should be solved.

Doesn't work.

if (!isset($_GET['error'])) {
 mysql_query($itemsql); 
 $itemid = mysql_insert_id();	
} 
// Nor does this work 
if (!isset($_GET['error'])) {
 mysql_query($itemsql); 	
}
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Try the following - it will only replace the first instance of that key

$key='THIS_KEY';
$value='New value';
preg_replace("@'$key'.*=>.*\n@Us","'$key' => '$value'\n",$file_input,1);

As for replacing the second instance of the key, how do you plan to identify the second key or in other words separate the first key from the second. It's like having two variables with the same name.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

After many weeks of studying and attempting to reverse the sha1 algorithm I have come to the following conclusion:

The Sha1 algorithm cannot be reversed due to the use of it's binary operators. If the binary operators were all reversible then the sha1 would too be reversible.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Seems to work very well, although a few niggles with certain key-value lines. Won't mark as solved quite yet, but pretty close.

Could you give examples of the keys that won't work. Perhaps I could fix that for you.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

On what line in your script is your mysql_query('INSERT...'); That is where the problem lies. Around that mysql query you should have the following

if (!isset($_GET['error'])) {
mysql_query('INSERT...');
}
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Could you post the file with your insert mysql querys because at the moment it is like if I'm blindfolded not being able to see the related code. I suspect you will need to add an if statement around your mysql query.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Try the following

if(isset($adres) || $adres == "")  
{                  		
 header("Location: " . $config_basedir . "/newitem.php?   error=adres"); 
}
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

The following is an example of how to use my example.

$key='THIS_KEY';
$value='New value';
preg_replace("@'$key'.*=>.*\n@Us","'$key' => '$value'\n",$file_input);
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

The only thing is I need to find C without editing the first loop. Yes it is kinda tricky but basically on the beginning of the second loop I have $a, $b, $c, $tmp from the last loop round and somehow I need to use those four variables to retrieve all 80 values of random number. And remember the $tmp contains the previous value of $tmp plus the random number and $c which is $tmp from 2 rounds ago.

Are you looking like this
'C' value of first loop = 'C' value of second loop

Then try this code...

<?php
$a=1;
$b=47;
$c=88;
$tmp=23;
for($i=0;$i<80;$i++) {
$random_number=floor(mt_rand(0,1000));
//echo $random_number.'<br>';
$tmp=($tmp+$c+$random_number)*0.5;
$c=$b;
echo 'My C Value from First loop: '.$c.'<br />';
$cdata[] = $c;
$b=$a;
$a=$tmp;
}
 
 
//Now to reverse
echo '<hr>';
 
 
$tmp=$a;

for ($i=0;$i<80;$i++) {
$a=$b;
$b=$c;
echo 'My C Value from Second Loop : '.$cdata[$i].'<br />';
//$c=(unknown);
//$random_number=(($tmp-$c)-$a)*2;
//$tmp=($tmp-(($random_number*0.5)+$c+$a))*2;
//echo $random_number.'<br>';
}
?>
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Hi, could you post what error messages are appearing. That way we can correct it for you. Also what exactly is the problem.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Do you mean when you input empty strings or strings only containing spaces then it should pass. Then I would suggest using the isset() function instead of the empty() function at problem areas.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

What is amazing is that you watched that show!

Good one. lol Yea and unfortunately those in the Pegasus galaxy have to suffer by the wraith as an ending of the Atlantis series. At least the replicators were destroyed. If only MGM productions would make a 6th series with a better ending. That would be great.
Anyways back on topic atlantis must be out there somewhere. Perhaps a city created by sea creatures so deep that we can't find it. Or even a city that was created before earth had water. There are so many ways a city could end up under water that it is more likely that Atlantis exists than vice versa.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

If you want to encrypt it on client side then I would suggest using something like SHA256 in Javascript. I'm sure there are some open source ones as I have seen SHA1 in Javascript. Google is your friend.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Well there are two reasons as to why the mail function gets its mail stuck in spam. One is that the mail function does not function on the smtp protocol like other alternative functions. Another reason is spamming keywords are used and that the email from may not be a valid email address. Also when deciding the email from, make sure it is not only valid but not part of gmail, hotmail, yahoomail or any other public service as many spamming filters double check those types of from addresses. By saying double check I mean the mail needs to go though additional filtering layers and if it is from hotmail to hotmail for example it will be blocked completely. So my recommendation, make the email worded so it doesn't appear to filters as advertisement and when including links show the full url instead of a link title. And never put links in the subject of the email as that can be filtered too.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

@saiprem - Yes that is exactly what I want my second loop to retrieve. All those values of "C value before" is what the second loop needs to retrieve. But the ultimate goal is to get all 80 values of random_number without changing the first loop. Can anybody help me there?

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

So did you test the new version?

No but this is a simplified version of a bigger problem I am having with loops. I cut out everything except the main problem. So do you have an answer of how to get $c?