Jump to content

Coding help.....values in a fucntion call How many is to many?


azunoman

Recommended Posts

		$ccFNAME = $_POST['ccFNAME'];
		$ccLNAME = $_POST['ccLNAME'];
		$ccType = $_POST['ccType'];
		$ccNum = $_POST['ccNum'];
		$ccCVV = $_POST['ccCVV'];
		$ccExpM = $_POST['ccExpM'];
		$ccExpY = $_POST['ccExpY'];
		$ccAddr1 = $_POST['ccAddr1'];
		$ccAddr2 = $_POST['ccAddr2'];
		$ccCity = $_POST['ccCity'];
		$ccState = $_POST['ccState'];
		$ccCountry = $_POST['ccCountry'];
		$ccZip = $_POST['ccZip'];
		$ccPhone = $_POST['ccPhone'];

	  $cc = new CCreditCard($ccFNAME,$ccLNAME, $ccType, $ccNum, $ccExpM, $ccExpY,$ccCVV,$ccAddr1,$ccAddr2,$ccCity,$ccState,$ccCountry,$ccZip,$ccPhone);

 

Most of you will see the problem right away...keeping the arguments straight when I call a function...is getting a bit unwieldy...and doubtless other bad coding habits...

 

should I just build an array from pots variables...and ?explode the array into the function call?...really just looking for a good code management help...

You are calling a class there not a function

 

 

what you should do is build into a class a function called

 

initialize_vars()

 

 

and then in there do all this $this->var = $_POST['var'];

 

 

and you should be good to go

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.