cwarn23 387 Occupation: Genius Team Colleague Featured Poster

veedeoo is correct. A mysql statement my only contain one line even when it is conjoint like veedeoo did in his example. So in short mysql under the php api will not accept multiple line query's and will only accept single line query's. Fix that part of your code and you should be done.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

In general practise, arrays with mass insertation is a bad idea like you have done in line 3 where as the better idea is to fetch from the database as you need them.

Let's take for example your deploying a website like facebook and your using the above code for the contacts list. You will need to not only loop though but also to store in memory millions possibly even billions of users in memory causing the server to use terrabytes of memory just on the one little section of script. Not a good thing.

My recommendation is fetching directly from the database upon use and only store it inan array if your going to use every piece of information in that array later on. By saying every piece I don't mean just for filters but I mean for things like displaying on pages and such.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Try the following:

 $go=true
 while($row = mysqli_fetch_array($posts)) {
    $channel_name2 = $row['content'];
    $channel_name3 = $row['Posted_By'];
    $channel_name4 = $row['Date'];
    $channel_name5 = $row['id'];
    $channel_name6 = $row['type'];
    if ($go==true) {
      if ($channel_name6 = 'post') {
          $channel_name2 = $channel_name2;
        } else {
          $channel_name2 =  "<img src='/videobox/data/uploads/images/$channel_name2' height='200px' width='100px'>";
        }
    $go=false;
    } else {
    echo $channel_name2;
    }
 }
Jibran12345 commented: thanks for your help, but I fixed it differently :D +0
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I saw that this thread was still open so I thought I would enter in my opinions on this topic.
Tip 1:
When designing an authentication system you will want to keep all passwords and their associated hashes out of shared memory and away from public access. So for instance, lets say you were doing an object oriented design, the hashes may not be assigned to a global variable as that is what is called shared memory. Just a side know, recently there have been a few exploits with accessing shared memory so assume all shared memory is public.

Tip 2:
Hash a portion of the hashes as the salt and a hash of the hash as the string to be hashed
eg $hash=substr(sha2(sha1($password),0,8).substr(sha1(sha1($password)),18));
This will ensure that nobody can reverse the hash using a brute force database even with technology that exists in the next century which may be something like 256GHz 65,000 core and still they won't be able to crack your passwords because you used a custom hashing algorithm. On the other hand if you just do sha2('salt'.$pass) then in the next 10 years when quantum computers are due a simple loop though the first 2^256 combinations will result in finding your password and even with a sault a fast internet connection can do it on the live with the new network technology due in 10 years faster than fibreoptic by 1000 or so times the speed but is currently still under …

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Personally the tools I like to use are a pen, some paper, stapler and a piece of software called open project. If however your talking about web development tools then it would be Notepad++, Putty, Eclipse and Maven.
If your wondering why my web designing tools are so odd it's because I plot the initial design on paper which is then proceed with the main design and analysis in open project. The good thing about ploting the initial design on paper is that you can be talking to a client while away from your computer (eg on the phone) while plotting the requirements and initial design on paper. In most cases a case sanario would be done at this stage but I prefer to do an initial design along with the case sanario so there aren't any communication errors.

pritaeas commented: Pen and paper indeed. +14
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

It is also possible to use strvariable.equalsIgnoreCase(input) and it will compare the two strings while ignoring the difference between upper case and lower case letters. So in this method A==a and B==b etc. But besides that there isn't any other method that I am aware of.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I believe the IBM guess and go algorithm which was invented in either the 1980's or the 1990's was a successful square root algorithm which is quote simple actually. As simple as the logic is it can be a pain to code so I shall explain.

Basically you get the number which needs to be rooted and devide by 2. We will call this x. Then check if xx=original number. If fails then check if bigger or smaller than original number. If bigger than x=0.5 and check again or if smaller than x*=1.5

This process of checking and multiplying is repeated until the correct answer is found. It may not be efficient for large numbers but it sure is efficient for 32-bit which is what IBM was dealing with at the time. So if you're planning to make a square root function/method you may wont to take this sort of algorithm into consideration.

mKorbel commented: interesting +10
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Hi,

Try this,

<?php
## define your url
## change comments tags to the proper syntax as recommended by php.net.
## unless you are a developer, you can give reason why these ## are valid.
## even if the rest of the world would argue that it is wrong, 
## it does not mean it is not valid. 

$url = "http://www.daniweb.com/web-development/php/threads/256243";
echo '<img src="http://open.thumbshots.org/image.aspx?url='.$url.'" width = "150" height = "150" />';
	
?>

That's exactly what I proposed and took this many posts to work that out.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Bill Gates money:
[attach]22940[/attach]
Michael Jordan:
[attach]22938[/attach]

I don't see any resemblance.

I see some resemblance there. Make Michael Jordan white than add some glasses on his face and you got yourself a very fit Bill Gates.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Does my computer count as a pet because it sure is as smart as one?

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Perhaps you should install a few of them on localhost and see what they look like and pick the one that looks best for the job.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

No wonder why. You php configuration is limited to 13M of data. Your excel file is probably 5 or 10M. I would link you to some recourses on how to fix it but again happygeek has told me not to do so. So I can only say what the problem is and not give paragraphs of detailed descriptions on things that cause the problem and how to solve it along with side effects on some servers as well as warnings as per usage.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

You know you are old when your mobile phone is more powerful then your first computer.
http://www.daniweb.com/community-center/geeks-lounge/threads/251691/1262726#post1262726

That is a memorable quote from another thread I posted in. Love the times :)

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

You've got it backwards. The future technology is the current magic. Corollary to Arthur C Clark's law.

Then perhaps in the next 20 or 30 years we could see in the market a Wand powered by a Zero Point Module the size of a tiny battery and is able to do all of the tricks shown in the harry potter films using quantum mechanics. Now that would be cool. :)

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Is it possible to get a Nvidia quadro 6000 graphics card then put a sheet of laminated plastic on top of it with some eggs on top of the laminated sheet to cook my eggs for free? Also could I cook my bacon the same way? I was just wondering because it would be a cheap way of cooking bacon and eggs in the morning.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

You need the following just after the body tag.

<a name="Top"></a>
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Then get someone else with a better speaking voice to do the talking.

Or would you recommend that I wear tight underwear while doing the tutorials?

~s.o.s~ commented: Yeah right, just don't forget the sprinkling of red ants. ;-) +0
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Try the following:

<form method="post" action="Search.php">
            <table id="search">
                <tr>
                    <td>
                        Search:  <input type="text" name="search" id="search" placeholder="Search for friends"/><td><input type="image" src="graphics/search.png" id="submit"/></td>
                    </td>
                </tr>
            <table>
        </form>

That is how you have a submit button which is an image button.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Try the following:

<?php
$x=5;
session_start();
echo $x;
$_SESSION['y']=$x;

$string = '<?php 
session_start(); 
$x=$_SESSION[\'y\'];
echo $x;?> ';
$fp = fopen("6.php", "w");
fwrite($fp, $string);
fclose($fp);
?>
aaloo commented: he really undrestood my problem very fast +0
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Try the following:

<?php
$string='Phone 111 (111) 1112 to get this for 75% off - Call Now. Offer open to 5pm only full price after 5.';
preg_match_all('@[^a-zA-Z]{7,}@is',$string,$matches);
$matches=$matches[0];
foreach ($matches AS $key=>$match) {
$matches[$key]=preg_replace('@[^0-9]@s','',$match);
}
echo '<xmp>';
print_r($matches);
echo '</xmp>';
?>
jonesa01 commented: Perfect it was exactly what I was looking for! +1
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Try the following:

if(mysql_num_rows($result)>0){
    $user = mysql_fetch_assoc($result);
    echo '<h1>Welcome, ';
    echo $user['Name'];
    echo '</h1>';  
}else{
    header("location:login.html?msg=$msg");
}

And on login.html you will need to place the javascript message instead of the page with the header redirect.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Hi, I'm creating a tutorial + repository website where the tutorials are free for the public to look at but the repository is not. However I am developing a login system that I want to sync with daniwebs login system. I have developed a curl system where the user can enter in their password to my site and curl will check if it can log into daniweb but before I go ahead and use it, is there an api for daniweb to check if an account is valid? All I need to know is if the input username and password is valid and if it is valid then how many posts the user has and how many posts per day the user has. I'm not sure if daniweb already has such an api in existence so I thought I would ask.

Thankyou.

Rashakil Fol commented: I am adding positive reputation for this post to undermine the reputation system. +0
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Well it is possible to do if statements in regex like the following:

RewriteRule ^/?([\w]+)/(([\w]+)/(([\w]+)/(([\w]+)/(([\w]+)/(([\w]+)/(([\w]+)/|)|)|)|)|)|)$ index.php?a=$1&b=$3&c=$5&d=$7&e=$9&f=$11&g=$13

And in that regex up the 7 forward slashes may be used with [\w]+ between them. It will dynamically match from 1 forward slash to 7 foward slashes. But keep in mind for it to work you will need it to match [\w]+.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

It is possible that you have invalid parameters in your .htaccess file so try following the tutorial at the following link then copy and paste the code.
http://www.password-protection.com/
If however the tutorial is hard to follow or doesn't work then you may find using cpanel or your web administrative panel an easier alternative as some administrative panels that your web host provide such as cpanel will allow all of this code to be generated and placed automatically by the click of a few buttons.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Use the following:

<?php
$timestamp='1318245850';
if (mktime(0,0,0)<$timestamp) {
echo $timestamp.' is today.';
} else {
echo $timestamp.' is not today.';
}
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I would have to disagree with everybody and say Python is the future. It can handle big numbers and can do multi threading along with its many capabilities from its extensive work over the many years. In case your wondering who uses Python, well google uses Python on their web servers in addition to their google go language and people in the stock market use python to process large numbers. So clearly Python is creeping up on php and will eventually dominate the web as the number one server side language. Especially with its file extension only has two letters (.py) instead of three like .php or .asp or .aspx so this is a great advantage to Python when it comes to clean url's.

sergent commented: Who says you disagree with everyone? I agree with you! And of course, the length of python extension is it's greatest strength :D +0
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I think I might have found a library. It's called JPCT. I'm starting to learn what it can and can't do but if you can suggest any other engines then you are more than welcome. :)

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I started my first programming language (HTML) when I was in grade 5. It wasn't any school project or anything but I just loved to tamper with the source of different websites. Then near the end of grade 5 I got a manual on html where I started to learn html fluently. By the end of grade 6 I had learnt html fluently and had started on Javascript. I received as a birthday present a CD with 10,000 Javascript codes that I could fiddle around with and I did indeed. It was by the time I was in mid grade 8 before I got a good understanding of Javascript but didn't do much programming between grades 8 and 10a. Yes I repeated a year. 10a. From grades 9 to 10a I learn't a programming language called gml (Gamemaker Language) which taut me the concepts of loops, if statements and algorithms. I loved my algorithms. So by the time I was in 10b (second attempt at grade 10) I learnt PHP then C++ and before I knew it I was starting to learn every language in existence. As per today, I like to teach others like on daniweb and on occasion learn a bit about circuitry. And yes I still love my algorithms.

Justinedeleon commented: +1 internets that is very motivating. haha your a cool dude +0
cwarn23 387 Occupation: Genius Team Colleague Featured Poster
<?php
include('variables.php');
die('Steve Jobs');
sleep($tenyears);
die('Bill Gates');
exit;
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

The way people are going on about you'd think Steve Jobs was their mother and tables and mp3 players had never existed before the iPod and iPad. i'm not a fan of Apple only the iPod (nano because it's lasted 5 years and i got it cheap) but the company is bigger than one man and similar technology to that released by Apple would more than likely have been released eventualy through natural progression.

How ever Apply (and Steve Jobs) have played a massive part in the advancement of technology. it's not nice to here that anyone has died and should be good to see what Apple go on to do in the future.

Just remember when we're all flying around on hoverboards the idea came from Back to the future in the 80's !

No I invented the hoverboard. You see in the year 2015 Dani unleashes a program called skynet making machines able to think for themselves and code their own way out of problems. Then in the year 2017 this machine is exposed as a optional component on Folding@Home where skynet rapidly builds up a database and scans the internet to download and document all content in existence. At the end of the year 2019 the first humanoid realeased from Stanford university as a commercial product is up for sale and Dani buy's one and programs in the newly created skynet into this humanoid. October 2020 Dani goes on a birthday party leaving the humaniod home and …

ChrisHunter commented: Amazing reply ! +0
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

In 23 minutes the title of this thread will be obsolete.

This thread is officially obsolete. Time to update your firmware and reboot from the behind. Those who use windows are fortunate enough to not get a blue window screen of death where as mac users crash their car due to loss of sight. lol :)

sergent commented: lol +0
cwarn23 387 Occupation: Genius Team Colleague Featured Poster
<?php	// start JSON decode

	$json = json_decode(file_get_contents('http://graph.facebook.com/131822850253006'));

	// define event array

	$event1 = array(
	'id' => $json->id,
	'owner_name' => $json->owner->name,
	'owner_cat' => $json->owner->category,
	'owner_id' => $json->owner->id,
	'event_name' => $json->name,
	'event_description' => $json->description,
	'start_time' => $json->start_time,
	'end_time' => $json->end_time,
	'location' => $json->location,
	'venue_street' => $json->venue->street,
	'venue_city' => $json->venue->city,
	'venue_state' => $json->venue->state,
	'venue_zip' => $json->venue->zip,
	'venue_country' => $json->venue->country,
	'venue_lat' => $json->venue->latitude,
	'venue_long' => $json->venue->longitude,
	'venue_id' => $json->venue->id,
	'privacy' => $json->privacy,
	'updated_time' => $json->updated_time,
	);



$event2 = '"'.implode(array(
	$event1['id'],
	$event1['owner_name'],
	$event1['owner_cat'],
	$event1['owner_id'],
	$event1['event_name'],
	$event1['event_description'],
	$event1['start_time'],
	$event1['end_time'],
	$event1['location'],
	$event1['venue_street'],
	$event1['venue_city'],
	$event1['venue_state'],
	$event1['venue_zip'],
	$event1['venue_country'],
	$event1['venue_lat'],
	$event1['venue_long'],
	$event1['venue_id'],
	$event1['privacy'],
	$event1['updated_time']
	),'","').'"';


	// connect to database

	$database_connect = mysql_select_db('MY DATABASE', $connect);
	if (!$database_connect)
 	{
	die('Could not connect - database connection failed: ' . mysql_error());
	}


// Insert $event array into database

	$db_insert = mysql_query("INSERT INTO events (id, owner_name, owner_cat, owner_id, event_name, event_description, start_time, end_time, location, venue_street, venue_city, venue_state, venue_zip, venue_country, venue_lat, venue_long, venue_id, privacy, updated_time)
	VALUES ($event2)");

	if (!$db_insert)
	{
	die('Could not connect - event data insert failed: ' . mysql_error());
	}
JamesPublic commented: Your solution works perfectly cwarn - thank you, I'm off to read more about the implode function! :) +0
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

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

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

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

I've just submitted a redirect tutorial and am waiting for staff writers to approve. Soon I'll have dinner and start on the next tutorial.

pritaeas commented: Go cwarn23 ! +14
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

In php/html/javascript there are two different ways you may redirect a user to another page however there are a few things to consider before choosing with method to use. As you should know by now php has the ability to send html and javascript to the web browser and php can contribute to html and javascript functionality by generating scripts on the fly. So first I shall demonstrate php's ability to generate scripts on the fly.

#method 1

<?php
$page='http://www.google.com/';
// $page=''; //will disable redirect
// some massave code above here
?>
<head>
<title>A test page</title>
<?php
if (strlen($page)>0) {
echo <<< DATA
<meta http-equiv="refresh" content="0;url={$page}">
<script>
window.location="{$page}";
</script>
DATA;
}
?>
</head>

Now in the above script you will see that it uses client side scripting for the redirect. In this case it uses both the meta redirect and javascript redirect so that it if javascript is disabled the browser can meta redirect or if meta redirect is disabled then the browser can javascript redirect. So if you want client side redirect that is the basic way to go about it keeping in mind client side redirecting isn't always the best option. Keep in mind that with client side redirecting, you are not guaranteed to make the user redirect. In some cases both javascript and meta redirect will be disabled. Luckily php has it's own solution. So lets see what php has installed for us.

#method 2

<?php
$page='http://www.google.com/';
// $page=''; //will disable …
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Please post a list of ideas for tutorials that can be written for the php section. Please bear in mind the tutorials are to be kept relatively small so don't ask for something that may take pages upon pages of text to explain. Thanks.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Hi, in this news you will see how in the past few years there has been some controversy over a bug or more commonly known as a feature which appears it may be removed as of php 5.4.0. According to the features list of php 5.4.0 beta there is the following quote.

- Removed features:
. Removed magic_quotes_gpc, magic_quotes_runtime and magic_quotes_sybase
ini options. get_magic_quotes_gpc, get_magic_quotes_runtime are kept
but always return false, set_magic_quotes_runtime raises an
E_CORE_ERROR. (Pierrick, Pierre)

Now some users will have a good idea what this is but most won’t have a clue as most don’t dig into the closed in corners of php. For non php experts magic quotes is used for $_POST to add a backslash to each quote whenever a form is posted with method=post. But this only applies within a certain range of php versions and can be disable in the php.ini making a task to check if the backslashes exists of not. Fortunately two functions had existed until php 5.4.0 and they are in the following code.

<?php
class httppost {
    public $value;
    function stripslashes($value) {
        $value = is_array($value) ? array_map(array($this,'stripslashes'), $value) : stripslashes($value);
        return $value;
        }
    function __construct($in) {
    if(get_magic_quotes_gpc()) {
        //magic quotes enabled
        $this->value=$this->stripslashes($in);
        } else {
        $this->value=$in;
        }
    }
}

////////////////////////////////////////////////////
if (isset($_POST)) {
$post=new httppost($_POST);
echo htmlentities($post->value[‘item_name’]);
}
?>

However as of php 5.4.0 all you need to do is the below to get the same result as of php 5.4.0.

<?php
if (isset($_POST)) {
echo …
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Basic math is of course simple, but got myself mystified sometimes with exponentiation (shame on me, and I got stipend of best mathematical science student in my graduation year 1984 in my town):

-1**0.5 is valid formula (-1^0.5 some languages).

In c++ that would result in a compilation error as one is an int and the other is a double. Haha solved it (Answer: invalid input) lol :)

skilly commented: i do believe +0
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

$_GET is to get a variable from the url or a form method="GET" request like the previous post suggests.
$_POST get's a method="POST" request and is designed so that people can't read this data without a special addon or script which many people do for hacking reasons.
$_REQUEST is both $_GET and $_POST combined into the same array so it is the same as the following:

$_REQUEST=array_merge($_POST,$_GET);
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Warning: This method requires nerd gparted experience.

I have dealt with similar circumstances before and will explain how I went about doing it. For my method you will require an external harddrive or a giant flash drive. To do this you need to buy or download a linux disk which comes with the gparted software preinstalled. To download it simply find a linux iso image (any linux variation with gparted part of the package bundle) then burn that iso image to a cd. After that insert the cd into the cd-rom drive and reboot the computer. When the computer reboots you will see a new menu. From this menu you will want to boot from the cd. After booting from the cd, open gparted and format the external harddrive or flash drive as the same file system as what the drive you are going to copy too is and during the process give it the label temp. After that you may close gparted and open the linux equivelent of explorer. Now copy all of your files from the drive your going to copy too to this external harddrive or flash drive (remember all of this is in linux and non of this will be in windows). Now in gparted check the two internal drives and write on a piece of paper every piece of information gparted can report about their file systems, partitoning, boot sectors etc. You will need to program all of that information back in later. After …

jingda commented: Welcome to the hardware community;) +11
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Wow when did this topic turn into an explosion in the middle of New York. This happens every time somebody asks what is the best programming language on any forum on any website anywhere on the internet. It's like people treat their favourite language like their personal adopted baby. I can't believe how people aren't open to the opinions to others and aren't able to vote on the facts that are presented. Seriously where above has somebody voted on a weather one of the facts presented are true or not instead of saying it must be false because theirs are true. All I can say is same on you for making a great topic turn into a disaster thread.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Making sites is nice and fun but what if you don't want everybody too see something like an admin panel or maybe a special button. Well this tutorial helps you understand how to add a password to a php site in a simple manner. There are two techniques you can use. One is to use a database which allows you to have a group of users who may access the site. Another technique is to have pre defined variables that check if the values match the value of the variable. In this tutorial you will get to know the basics while following the method of entering users into a php file. Please note all passwords should be hashed but this is a tutorial and I kept it as simple as possible.

To use a variable stored in your site configuration file (eg config.php if you have one) you simply do the following:

<?php //config.php
$users[0]['name']='cwarn23';
$users[0]['password']='password';
$users[1]['name']='root';
$users[1]['password']='drowssap';
?>

Now you will notice that there is an array of users that may use the site along with their passwords. Normally for security reasons the password would be salted on both sides of the string. Then hashed, then substr() then finally rehashed. Note you should never use crc32 or crc32b as a hashing algorithm but for now lets see how to check if the user has loged in. To do that we need a html form. So lets make one.

<form method="post" action="">
Username: <input type="text" name="user" /><br />
Password: …
happygeek commented: thanks for the tutorial +12
scarcella commented: Very well written! +3
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Please refer to the computer language family tree. It clearly shows Assembly is the ultimate language with no previous generation to it. It is like god/jesus of programming which gave birth to children/languages which gave birth to even more children/languages. So if you want true efficiency then use Assembly and not the mutant offspring. May not be pretty but it works.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

PHP is a nice language with features a wide range of automated features for memory but when it comes to mass processing for things like calculating pi or processing a database that's a couple dozen Gigabytes then you may run into a few troubles if things aren't done correctly. This of course only happens depending on what operating system you have and what updates you have done along with settings you have set but those pieces of information are a bit puzzling as some web servers have this problem while others don’t.

So this feature I'm going to talk about makes it impossible to process no more information than the amount of ram you have. So lets examine the code below and detect the bug in the following PHP code.

<?php
$b=pow(2,20);
for ($i=0;$i<1024;$i++) {
$a=bcpow('10',$b);
}
?>

Now if you examine that code it is a straight forward loop that does nothing. But it has great importance and I shall show you why. On the first line is the PHP opening tag as normal. Then second line is a variable assigned a number which is equivalent to 1MB in bytes. This will be used later. Then next line down is a loop and inside that loop is the assignment of a variable. Now it is the assignment of this variable that is interesting. The variable is assigned 1MB of data there by because the other variables are numbers the Ram usage should be about 1MB. However with that …

happygeek commented: thanks for the tutorial +12
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I would have to say Assembly, C, Python and SQL. If you can learn those four languages completely and fluently than you can solve just about any computer software issue weather it's to do with servers or linux or windows software etc.

sergent commented: Assembly! +0
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Try the following on lines 16 to 21 as refered to my previous code

if ($middlename) {
echo "Middle Name : ". $this -> middlename;
} else {
echo "Middle name, what is that? ";
}

I just realized the brackets in that section are all messed up for all of our sample codes.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

THANKYOU SO MUCH!!!
You have solved two problems in one reply.
One problem was I was starting to get a long list of files which you stated could be put into a .jar file and the other was that Java refused to load the main class which after implementing the .jar file it seem to fix itself. Thankyou so much as it has saved me so many troubles. :)

kvprajapati commented: I'm glad you got it working. +14