Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.