Is there a more efficient way of doing this? I am simply catching and assigning vars to a lot of $POST vars. this seem monotonous to any advise is greatly appreciated. thanks :) sorry aboout the title..wasn't sure how to title this one. lol

if(isset($_POST["submit"]) ){
	if(isset($_POST["est_num"]) ){$est_num= $_POST["est_num"];}
	if(isset($_POST["first_name"]) ){$first_name= $_POST["first_name"];}
	if(isset($_POST["last_name"]) ){$last_name= $_POST["last_name"];}
	if(isset($_POST["address"]) ){$address= $_POST["address"];}
	if(isset($_POST["address_2"]) ){$address_2= $_POST["address_2"];}
	if(isset($_POST["city"]) ){$city= $_POST["city"];}
	if(isset($_POST["state"]) ){$state= $_POST["state"];}
	if(isset($_POST["zip"]) ){$zip= $_POST["zip"];}
	if(isset($_POST["phone"]) ){$phone= $_POST["phone"];}


you may use the following codes:

//to retrieve all POST variables and value
foreach ($_POST as $key => $value){ 
	$$key = $value; 

simple thanks for that, very useful and simple. But i couldnt think of it.. ha ha Much appreciated. :)

No problem :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.