azunoman Posted November 17, 2008 Share Posted November 17, 2008 $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... Link to comment https://forums.phpfreaks.com/topic/133097-coding-helpvalues-in-a-fucntion-call-how-many-is-to-many/ Share on other sites More sharing options...
cooldude832 Posted November 17, 2008 Share Posted November 17, 2008 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 Link to comment https://forums.phpfreaks.com/topic/133097-coding-helpvalues-in-a-fucntion-call-how-many-is-to-many/#findComment-692140 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.