cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I couldn't help but notice that my poop looked like an Elephant. Perhaps this is the matrix.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Rest In Bits Steve,
Now that Steve is out of the way, there is nothing stopping Microsoft taking over Apple. ;)

pseudorandom21 commented: =D We would all love that ! +0
jingda commented: Nope, you are wrong:) +0
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Do you mean like the following:

foreach($_POST['urls'] as $url) {
foreach ($_POST['names'] as $name ) {

//insert code here

}}

However be sure that $_POST and $_POST are both arrays.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Hi,

This is a great post. I wanted to ask you a few questions about the security. I use a very similiar login method on one of my websites and i have read alot about this topic and many other tutorials suggest using sessions with hash, salt, session id, ip, timestamp ect. Do you think that your example is secure? I dont really want to go to the extremes suggested in many other tutorials becuase i dont store sensitive information.

Well in regards to security this tutorial was designed to be simple and easy to use but as per security, it is not your most secure option. The reason being is if the apache service fails then somebody may be able to gain access to the passwords however this tutorial is to gain knowledge of the basic concepts of how to create a login system. To keep it simple I have removed hashes from the tutorial because it would cause a lot of confusion for noobies but I will give the following example of how to create a hash for a password which will automatically salt the password and make it a secure hash.

<?php
function securehash($string) {
return sha1(substr(sha1($string),13,-13).$string.md5($string));
}

Then you can use the securehash function to hash all of your passwords and will automatically create the salts. But if I had of used the securehash() function in the above tutorial it would have made it a lot more difficult to enter in the passwords into the array …

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

And it can also depend on the pitch of the voice. ;)

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

According to my knowledge,Google provides relevant information for your search.I think 90 percent of internet users use Google as the best browser.

I think you might be mixing statistics there to save the old Chrome stone.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

http://www.urbandictionary.com/define.php?term=psh

And by the way, if you can figure this out:

01010101
10001001 11100101
00110001 11000000
11001001
11000011

Free rep. Here's a cheat sheet: http://ref.x86asm.net/coder32.html

According to your reference it seems to be the following although it appears some integers are missing from the original binary sequence as the below translation makes invalid syntax due to the missing integers from the source.

PUSH
MOV IN
XOR ROL
LEAVE
RETN
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Try the following:

<?php

define('SMALL', 0);
define('BIG',   1);

class ClientInfo {

	var $flag_dirs = array(SMALL => 'assets/flags/small', BIG => 'assets/flags/big'); 
	var $flag_ext  = 'png'; 

	function getctrybycode($code) {
		$countryArray = array();
		$input = "includes/countries.dat";
		$fd = fopen($input,"r") or die("Error: cannot open $input!");
		while ($buffer = fgets($fd,4096))
		{
			$buffer = preg_replace("/\n/","",$buffer);   //chomp()
			$pieces = explode(",",$buffer);
			$countryCode = $pieces[0]; $countryName = $pieces[1];
			$countryArray[$countryCode] = $countryName;
		}
		fclose($fd);
		return $countryArray[$code];
	}


	function getctrybyhost($hostname) {

		return($this->getctrybycode($this->getctrycodebyhost($hostname)));
	}

	function getctrycodebyhost($hostname) {
		return(substr(strrchr($hostname,'.'),1));
	}

	function MaskOtherIP($IP) {

		if($IP==getenv("REMOTE_ADDR"))
			    return($IP);

				 $IP=strtr($IP,"0123456789","##########");
				 return($IP);
	}

	function getClientIP() {
		$IP = getenv('REMOTE_ADDR');
		return $IP;
	}

	function getClientHostname()
	{
		$error = 0;
		$IP = $this->getClientIP();
		$hostname = gethostbyaddr($IP);

	   if(!strcmp($hostname,$IP)) $error = 1;		// if failure, gethostbyaddr() returns the IP
		if (!$error) //if no error
		{
			return $hostname;
		}			
		//else
		return "";
	}

	function getClientCountry()
	{
		$error = 0;
		$hostname = $this->getClientHostname();
		if (!strcmp($hostname,"")) $error = 1;
		if (!$error)
		{
			$country = $this->getctrybyhost($hostname);
			return $country;
		}
		//else
      return "";
	}

	function getClientFlag($size)
	{
		$error = 0;
		$hostname = $this->getClientHostname();
		if (!strcmp($hostname,"")) $error = 1;
		if (!$error)
		{
			$country_code = strtolower($this->getctrycodebyhost($hostname));
			$file_name = $this->flag_dirs[$size] . '/' . $country_code . '.' . $this->flag_ext;
			if (is_readable($file_name))
			{
				return $file_name;
			}
		}
		//else
      return "";
	}

	function getClientFlagHTML($size)
	{
		$error = 0;
		$flag = $this->getClientFlag($size);
		if (!strcmp($flag,"")) $error = 1;
		if (!$error)
		{
			return '<img src="' . $flag . '">';
		}
		//else
      return "";
	}
};
phoenix416 commented: Thanks! +0
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Psh, did it in binary.

Could you give a link to the language Psh or at least what is stands for?

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

>>Assembly was one of the founders of what we today know as programming

Wrong. According to this wiki article programming originated in ancient Greece over 1,200 years ago, although I think China may have developed it earlier then that.

However the Greeks did not use interpreters to run binary processors with a data flow of electrons did they now? Also notice the part where I said "what we today know as programming". So the earliest system which can be referred to by these specifications is punch cards and before that does not fall into the category unless you can think of any other methods of programming that in simple would fall in to all of the below categories.

  • Is digital
  • Can be fed through a Central Processor Unit of some sort
  • Can perform basic math operations

Unless it falls into those categories it simply isn't a founder of programming that we still use today in our every day code. For example, we still use punch card code in our every day life as all high level languages are written in low level languages which are written in punch cards. :)

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

You have said it all. Since they can be seen on other sites and very popular ones like youtube, i think its better we direct resources to things that wont have negative effects or counter the effort or purpose for which it was made. Giving links to such videos, articles, and other web pages as we do in our post would serve the members enough. Besides, Dani already mentioned that there's a way videos can be embedded so we can make good use of that.

So how do we embed these video's?

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Punch cards and assembly, what's that - some new fangled wizardry?

01010101
10001001 11100101
00110011 11000000
11001001
11000011

Assembly was one of the founders of what we today know as programming as it made programming a lot easier by typing in syntax. Before assembly it was all done digitally with no strings and no text. I think before Assembly there might have been a language where you could type just hexadecimals with something like 16 digits to a row and the computer would translate that to binary which would then be executed. The syntax as I recall from a book many years ago was as follows:

AC345FE5902FACB0
93674A38433229AC
BEFD3209835DEA1B
3C537A98F586B4BE

Now that is traditional programming before Assembly. The syntax may vary as there may be spaces and other new lines but it was all hexadecimal. But before you could even type your code into a computer it was one persons job to just sit at a desk and punch holes into paper to indicate ones and zeros and the paper would be fed into a computer. Then the computer would read where the holes are in the paper and write your program based on that. But all of todays code is based on layers ontop of layers which the source lead to one man who in the 1980's punched holes in paper. That's right. Even Windows, Linux, Mac. They all have been based on punch cards and over time instead of reinventing new ways to type ones and zeros into a …

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I've been doing a lot of work on caching things behind the scenes, and coupled with the significant decrease in traffic, pretty much had no other choice than to get rid of two of our servers. That went well. Unfortunately, the employee at the hosting company decided to accidentally pull the plug on our SAN in the process, and it took 40 minutes to get all of our servers back online.

Perhaps you could donate their idle time to Folding@Home like I did with my vps. Then when it's newsletter time boom we have cpu available.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I thought windows was written in c though, not basic.

Well I know for a fact Windows 98 SE and all previous versions including dos were written in Basic.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

$_SESSION = $result;

and don't forget to put the following at the start of each page with the $_SESSION variable.

<?php session_start(); //nothing before here - line 1
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

It's obviously a joke. :icon_rolleyes:

No, Assembly is only effective on linux because in Windows, Assembly is normally compiled in high/medium level languages such as C which are then written in the low level language of Assembly which then brings the following family tree.\

Punch cards
to
Assembly
to
BCPL/Bon
to
B
to
C
to
Assembly & C++
           from C++ to Assembly again

As you can see there is a wide variety of ways Assembly can be written but there is only one true way and that is via Punch cards. And unfortunately Assembly on windows is not written in punch cards but rather in C and/or C++. However Assembly on Linux/Unix is written in Punch cards dating back to the days of the origin of Unix. Believe it or not Windows origin is Basic. Not Visual Basic but just plain Basic which is another medium/high level language there by slowing down performance unlike Linux which has Assembly and C. So because Unix was originally written in the low level language Assembly which was designed by punch cards along with its preprocessor C, that is what makes Linux & Unix the only operating systems capable of executing Assembly code effectively.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

At the position you want that text to display add the following:

echo htmlentities($_POST['username']);
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

where about's is the file located in relation to the php script. Could you post here the path to the c.txt file and the path to the script which is running. Then I can provide some parameters for the file_get_contents() function. By paths I mean like when your browsing ftp.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Perhaps this could be a file permissions problem. Could you please post your code.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Line 41 should be as follows:

$sql="SELECT * FROM $tbl_name WHERE username='$username' and password='$password'";
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

You also didn't assign the class correctly. Try replacing with the following.

$user=new Connect(); //add the two brackets
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Tutorials cannot simply be given 'official' DaniWeb tutorial status without first being peer reviewed to ensure they are accurate/error free, not to mention grammatically correct. While I can handle the spell checking and grammar side of a PHP tutorial I am not able to peer review them from the coding perspective. There is a discussion going on at the moment about who is best suited to do this.

Tutorials will never appear immediately with DaniWeb approved status for the reasons given above I'm afraid. Patience is, as they say, a virtue.

Ok, so we are waiting for who is most qualified for reviewing php tutorials to be put forward I get from that text. It would be nice if we could be updated every once in a while.

There is a discussion going on at the moment about who is best suited to do this.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

The difference is that when you have multiple classes, you may access $variable which is in class Hello from another class. It is essentially saying why do you need to use global $variable; in a function when you can input it but this is the oop equivelent for when dealing with objects

static $variable;

. For more information you can read the specific page with talks about this at http://php.net/manual/en/language.oop5.static.php and has a few good examples at the top.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Mods, it has been over 3 days and still none of my tutorials have been approved. What's going on peoples. Is this what I am to expect whenever I post another tutorial?

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Can somebody give me instructions on how to install and configure this on my vps?

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

To be smart you have to be dumb.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I just came home and went to sign on to daniweb.com and 404 page not found. I thought WTF. I know the website exists. But now I see it is back online have you don't any changes dani? I see the "Solved:" prefix is now green but what else have I missed. A cpu upgrade? Please keep us posted. Thanks.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Now, how to figure 3.75 degrees.

That can be determined by one of those circular rulers that show the number of degrees.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Simple. Only takes one candle.
Stand one candle up but don't light it and wait until the shadow has rotated 3.75 degrees anti-clockwise provided the room has a window. After the shadow has rotated the full 3.75 degrees then 15mins of daylight has passed. If you want 45mins then you will need to wait for it to rotate 11.25 degrees anti-clockwise. You can do that with any object and not just a candle. Now that's what I call a macgysmo aka Macgyver. I miss you Macgyver.

PS
If the room doesn't have a window use a candle to burn a hole in the wall to make a window.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

It usually means you have provided invalid username and password into mysql_connect(). This may be because the user does not exist or the mysql server is currently down but when in doubt copy and paste the login details you last used for another site of yours on the same server (eg your master login).

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Do you mean this?

$upgrade_user = mysql_query("SELECT * FROM user_info WHERE id='$id'");
while($row = mysql_fetch_array($upgrade_user)){
	$real_balance = $row["$balance"];
	$real_rank = $row["$rank"];

echo $real_balance;

if($real_rank == 'merchant' && $real_balance > 500){
	$n1x = '<a href="upgrades_info.php?userid=$id&rank=noble"><img src="images/noble.jpg" width="170" height="200" /></a>';
}
else
{
	$n1x = '<img src="images/noblex.jpg" width="170" height="200" />';
}

}

Or this?

$upgrade_user = mysql_query("SELECT * FROM user_info WHERE id='$id'");
$row = mysql_fetch_array($upgrade_user);
$real_balance = $row["$balance"];
$real_rank = $row["$rank"];


echo $real_balance;

if($real_rank == 'merchant' && $real_balance > 500){
	$n1x = '<a href="upgrades_info.php?userid=$id&rank=noble"><img src="images/noble.jpg" width="170" height="200" /></a>';
}
else
{
	$n1x = '<img src="images/noblex.jpg" width="170" height="200" />';
}
cwarn23 387 Occupation: Genius Team Colleague Featured Poster
<?php
if(basename($_SERVER['SCRIPT_NAME']) == 'index.php'){
include ('index-header.php');
} else {
include ('page-header.php');
}
?>
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Hi, as floored as the text tutorials are right now for submitting them. I thought I would put out there the idea of video tutorials. It would be exciting to see them out there.

Thanks
cwarn23.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Happiness lies in yourself.

Not in my life lol.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Since how this is a computer geek forum and computers can easily solve math then what about algebra. I shall post an algebra equation and see how you's can solve that XD

a=something
b=something
print (((((pow(a,pow(3,b))*b)|(a*a))>>100000)+pow(a,b))/2)

I have the answer so what does A equal and B equal if the answer of the formula is 12464273528384 . I'm sure you all learn't this at school and collage. :)

Still no answers to my equation?
G' Computer Gurus are so reliant on computers solving math problems for them and when it comes to algebra then they don't have a hope at all.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

It means you need to contact your web host and tell them that mysql needs the my.cnf file repairing unless you own a dedicated server, vps, xampp or wamp in which case it will be more difficult. Usually this error indicates that mysql hasn't had a correct installation and in fact I just fixed this devil of an error recently and turned out to be a permissions problem on linux as the directory needed permissions. In addition I had to dig deep into the system to change a system file to change the path of the mysql socket location in addition to the one specified in the my.cnf file. So if this is happpening on your shared web hosting account then please file a support ticket and they should get right on it.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Hi,
At the moment I am stuck with a problem where I have googled and googled and yet still can't find software that does what I want. Basically all I want is to be able to take images of an object from all different angles or even do lets say 20 images of the insides of a room (16 megapixels) then put those images into a program that can convert it into a 3d model ready for rendering in 3d rendering software. I already have the 3d rendering software but what I can't find is the software that will convert potentially hundreds of images into a single 3d model. The system requirements may be as follows:

3.2 GHz i7 4 core 8 threads
12GB ram
Ubuntu latest release or Windows 7 home premium
Virtually Zero Graphics
1TB of harddrive available.

Anyways can somebody point me in the right direction because I don't want to spend years recreating entire buildings on the mass production and this would be a lot easier?

Thanks.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

cwarn23, you must be good at playing tricks. That dude must be lucky you're not the one he's playing game with.

Indeed :)

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

It executes a hidden task that del stores on the computer which a trained it consultant can use to speed up the computer so he gets paid more. And you would say "But I have discovered this hidden code it consultants use as I had a hidden webcam in the room while my techie was at my house/apartment. It was fun watching the techie just perform this one simple task to fix all the problems with my computer".

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

for someone who could write such a script, i guess he would be knowledgeable enough to know the implications

Unless he had a false knowledge. del could stand for dell computers ;)

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

What you could do is send him an email and tell your friend to type the following into start->run or on windows 7 the search box on the start menu.

del *

Maybe you could tell him that it will double his cpu and make is computer faster but will be interesting to see how that will work out.

PS
If he is using Linux then /dev/null is a great secure folder to save stuff to *cough* will delete files *cough*.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

But hey, money does grow on trees. It's called weed. :)

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

My dear i want to connect with Sql server not with Mysql...

In that case replace localhost with the ip of the sql server's ip address and on the sql server admin panel allow remote sql then you should be able to perform remote sql tasks. If you need a hand enabling remote sql on your sql server then please describe what control panel you use, what php version your using and mysql version.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster
<?php
$user='cwarn23';
$password='password';
$database_name='cwarn_phpbb';
mysql_connect('localhost',$user,$password);
mysql_select_db($database_name);
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Since how this is a computer geek forum and computers can easily solve math then what about algebra. I shall post an algebra equation and see how you's can solve that XD

a=something
b=something
print (((((pow(a,pow(3,b))*b)|(a*a))>>100000)+pow(a,b))/2)

I have the answer so what does A equal and B equal if the answer of the formula is 12464273528384 . I'm sure you all learn't this at school and collage. :)

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I use the following on both of my dual monitors
internet marine cables
That way I know the quickest and least used routs for when I select a free mirror from another country. :)

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Do you mean something like this:

while ($row=mysql_fetch_assoc($result)) {
echo $row['column'];
echo "\n"; //must be double quote
}
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Im still using c programming :D for the embedded system

Yer, well while you's are learning the different variations of C I have been skimming the manuals of Assembly. Assembly is a very lengthy language but good code is lengthy unlike other languages such as c#, ruby, java, visual basic, coke etc. Yes the drink has its own language. But of course Assembly is only effective on Linux. If you want effective code on windows you should use C or Fortran or Basic (not Visual Basic).

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Hi cwarn,
is there any chance I can read your tutorial?
Thanks

Just a few moments ago the tutorials have been moved from the Editorial to the php category and will in the next few days be in the Tutorials category. So to view a tutorial on how to create a login system without databases then click here. Keep in mind that tutorial is there to teach you the basics of a login system and how it should work. If you want a mass production login system like for a forum then you will probably want to insert the passwords into a mysql database and double hash the passwords with salts along with the inner hash being substr().

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

So it appears there are no mods online to review them. That's a first :(. Mods, *cough* Nick *cough* when you's get the email for this thread reply can someone please review the tutorials which have been moved to the php forum. I hope it takes less time in the php forum than it did in the Editorial. ;)