PHP IF then redirect for OSCommerce

  • mossman65
  • Born
  • Born
  • mossman65
  • Posts: 3

Post 3+ Months Ago

Hello and thank you,

I am new to PHP and have successfully installed a version of osCommerce for my company.

We use Skipjack as our processor and the have limited options with the services. Our front desk uses their virtual point of sale to enter cards from phone orders. We are also using the account for our new online cart.

The issue:
If i change the response pages at the processors site to redirect to the OSC processing page to complete my web order, it breaks the Secretaries page so that she can see the transaction receipt or print it. If i use the processors default response page it charges the card but never completes the order in OSC because the variables aren't being passed through their page to update the admin section in OSC.

The Idea:
A IF statement at the top of my process.php page that looks for a "user defined" variable from the processor, or visa versa one from OSC's cart. Not sure which will work best.

if variable == user_defined_field then
got to OSC_process_page.pgp
else
got to processors_page
end if

Any help would be great!
Aaron
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8388
  • Loc: USA

Post 3+ Months Ago

PHP Code: [ Select ]
<?php
if($variable == $_POST['user_defined_field'])
{
     header("LOCATION: OSC_process_page.php");
}
else
{
     header("LOCATION: processors_page.php");
}
  1. <?php
  2. if($variable == $_POST['user_defined_field'])
  3. {
  4.      header("LOCATION: OSC_process_page.php");
  5. }
  6. else
  7. {
  8.      header("LOCATION: processors_page.php");
  9. }
  • mossman65
  • Born
  • Born
  • mossman65
  • Posts: 3

Post 3+ Months Ago

Thank you for your reply!

I insert the following:

///// REDIRECT ON CHECKOUT /////

if($variable == $_POST['transactionamount'])
{
header("LOCATION:buy_online/catalog/checkout_process.php");
}
else
{
header("LOCATION: VPOSWebResponse.asp");
}

//// END REDIRECT ////

It results into to many redirects and errors out.

I placed it at the top of my checkout page, should i set/param "transactionamount" to null?

Thanks!
Aaron
  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8388
  • Loc: USA

Post 3+ Months Ago

What does the $variable hold?

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 163 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.