Hi all,
I have a situation wherein I have several HTML documents that use a hidden input on a form.
The html looks similar:
<input type="hidden" name="_redirect" value="https://myvendorsite.com/purchase?sid=XXXXXX&quantity=1&product_id=XX">
If I want the transaction to be a "DEMO" transaction I have to append "&demo=Y" to the end of the above redirect IE:
<input type="hidden" name="_redirect" value="https://www.2checkout.com/2co/buyer/purchase?sid=471725&quantity=1&product_id=14&demo=Y">
Now, what I would like to do is to have a file residing in the same directory that I can modify to change the &demo=Y to an empty string.
Thinking along the lines of a php file called demoy.php with the following lines:
<?php
$demo = '&demo=Y';
?>
This way when I want to put my store in demo mode, all I have to do is edit demoy.php and add the line $demo = '&demo=Y'; and if I do not want the store in demo mode I would change the line to $demo = ''; (an empty string)
Then in the HTML code something on the order of:
<input type="hidden" name="_redirect" value="https://myvendorsite.com/purchase?sid=XXXXXX&quantity=1&product_id=XX<?php include 'demoy.php';=$demo;?>">
thus completing the line:
<input type="hidden" name="_redirect" value="https://myvendorsite.com/purchase?sid=XXXXXX&quantity=1&product_id=XX&demo=Y">
when the demoy.php has the $demo variable set to '&demo=Y'
Is that how it should be done, or is there a better way?
Thanks
Eagle