Jump to content

NEED date_default_timezone_set(); for php4


sKunKbad

Recommended Posts

I have a php4 script that uses

 

date_default_timezone_set('GMT');

 

and I need the php4 equivalent because I'm converting the script to php4.

 

Here is the script:

 

// Set the time zone:
date_default_timezone_set('GMT');

// Check for form submission.
if (isset($_POST['submitted'])) {

// Validate the credit card...

// Check the expiration date:
$year = (int) $_POST['cc_exp_year'];
$month = (int) $_POST['cc_exp_month'];

// Get the current date:
$today = getdate();

// Validate the expiration date:
if ( ($year > $today['year']) OR
( ($year == $today['year']) AND ($month >= $today['mon']) )
) {

	// Include the class definition:
	require ('Validate/Finance/CreditCard.php');

	// Create the object:
	$cc = new Validate_Finance_CreditCard();	

	// Validate the card number and type:
	if ($cc->number($_POST['cc_number'], $_POST['cc_type'])) {

		// Use XXX to process the order!!!
		// If payment goes through, complete the order!	
		echo '<p>Your order is complete (but not really).</p>';
		include_once ('./includes/footer.html');
		exit();

	} else { // Invalid card number or type.
		echo '<p class="error">Please enter a valid credit card number and type.</p>';
	}

} else { // Invalid date.
	echo '<p class="error">Please enter a valid expiration date.</p>';
}

} 

Link to comment
https://forums.phpfreaks.com/topic/77101-need-date_default_timezone_set-for-php4/
Share on other sites

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.