Jump to content

ohboyatoytruck

Members
  • Posts

    16
  • Joined

  • Last visited

ohboyatoytruck's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks to everyone who responded. I found a solution. $earlybirdexpiry = "2016-02-15 00:00:00"; $today = date("Y-m-d H:i:s"); if ($organisationsize == "Up to $3M" && $membershipyear = "2016" && $today < $earlybirdexpiry) { $membershipfees = "220"; } And Ive fixed the quotes spotted by Psycho (thanks)
  2. I want to add an earlybird price to our membership system which means prices will change after a certain date. Renewal date is the date that the member is renewing. $renewaldate = date ("d/m/Y"); Fees depend on organisation size, membership year and a comparison of the current date with the earlybird expiry date which is 15/2/16. if ($organisationsize == "Up to $3M" && $membershipyear = '2016' && $renewaldate >= "15/02/2016") { $membershipfees = "242"; } else if ($organisationsize == "Up to $3M" && $membershipyear = '2016' && $renewaldate < "15/02/2016") { $membershipfees = "220"; } etc. But Im not getting the earlybird price ($220) being echoed with the above. All advice gratefully received.
  3. Thanks for your kind response. I am bringing a developer in this week to look at the code but I wanted to see how bad the problem was beforehand. The company i represent is a charity/NGO and when we first developed this website in 2006 we had no budget and I cobbled together the registration system learning PHP as I went and getting the assistance of a series of consultants. Thanks again.
  4. Im a Filemaker Developer so its kind of my bread and butter.
  5. Thanks very much. I have attached the files but not included the related function files FX and PHPMailer which are used in conjunction with these files. http://www.iviking.org/FX.php/ https://github.com/PHPMailer/PHPMailer The file sequence is: Course_Details11.php Registration_Form11.php Check_Registration_Form11.php Process_Registration11.php Pay_by_Cheque11.php Pay_by_Direct_Deposit11.php registration files.zip
  6. It has just occurred to me that that variable $chosencost_1 is being used to populate the select with previously selected data - that is if the form is not validated (which is determined by the page that follows the web form), the browser is returned to the previous page (e.g. the webform) but any data that has already been entered or selected is displayed. So $chosencost_1 which is declared on the validation page, is being used to populate the select with whatever data was originally selected. However this means that issue of why the costs are reverting to $1.00 intermittently remains a mystery.
  7. The code was written for us by a consultant and has worked for the most part until this year. I would be grateful if you could tell me how the code needs to be amended. Essentially I just need all cost options that have been passed to the web form to be integrated into the select.
  8. The data is passed to the web form page from a previous page where the costs are found via a database search (FMFind) and then passed through the URL of the current page: <form id="Register1" action="Registration_Form11.php?cost=<?php echo $show_found_courseData['Course_Cost'][0]; ?>&membercost=<?php echo $show_found_courseData['Course_Cost_Members'][0]; ?>" method="post" name="Register"> Which leads to: $cost = ''; if (isset($_REQUEST['cost']) && is_numeric($_REQUEST['cost'])) { $cost = floatval($_REQUEST['cost']); } $membercost = ''; if (isset($_REQUEST['membercost']) && is_numeric($_REQUEST['membercost'])) { $membercost = floatval($_REQUEST['membercost']); }
  9. The following code is about 10 years old and has worked perfectly until recently. Over the last 12 months the select has been producing a value of 1 instead of the value of $cost or $membercost. However it only happens intermittently: 26 times out of 3000 registrations to be exact. One colleague has pointed out that $chosencost_1 is never declared which many be the issue. How can it be declared when it depends on the choice made by the select? $chosencost_1 is first declared on the page that follows the one with the web form. What's most baffling is why has this code worked fine in the past and only recently become a problem? Could it be a browser/OS issue? Or a PHP version issue? We are using v5.5.27. CODE The following variables are passed from a previous page (cost, member cost): $cost = ''; if (isset($_REQUEST['cost']) && is_numeric($_REQUEST['cost'])) { $cost = floatval($_REQUEST['cost']); } $membercost = ''; if (isset($_REQUEST['membercost']) && is_numeric($_REQUEST['membercost'])) { $membercost = floatval($_REQUEST['membercost']); } //etc etc there are many other cost options On this page which contains a web form, browsers use an html select to choose a course cost: <select name="choosecost1" size="1" value=""> <option value=""></option> <?php if ($cost !='') { ?> <option value="<?php echo $cost; ?>" <?php if($chosencost_1 == $cost) echo 'selected="selected"'; ?>='<?php if($chosencost_1 == $cost) echo 'selected="selected"'; ?>'>Cost:<?php echo '$' . number_format($cost, 2 , '.' , ' '); ?></option> <?php } ?> <?php if ($membercost !='') { ?> <option value="<?php echo $membercost; ?>" <?php if($chosencost_1 == $membercost) echo 'selected="selected"'; ?>='<?php if($chosencost_1 == $membercost) echo 'selected="selected"'; ?>'>Cost to Members:<?php echo '$' . number_format($membercost, 2 , '.' , ' '); ?></option> <?php } ?> <!--etc etc there are lots of other options--> </select> choosecost1 is passed to the next page where it becomes $chosencost_1 eg $chosencost_1 = $_POST['choosecost1'];
  10. Rest of the code is good but there are no other instances of apostrophes so not sure if that helps much.
  11. Yep the data is coming from the database but it looks fine in there and if I copy and paste it into Word it still looks fine. In the Export Data dialog in the database, there are character set options as follows: Windows (ANSI) ASCII (DOS) Macintosh Unicode (UTF-16) Unicode (UTF- <--- this is currently selected.
  12. Hi there, I am getting this in a PHP generated email: ACWA Member/Subscriber: Melody’s Children’s Service The line of code in the php is: $subject = "ACWA Member/Subscriber: $membername"; I have tried htmlentitiies, html_entity_decode, htmlspecialchars but nothing seems to work. I haven't used htmlentities anywhere else in the code for this variable. Any suggestions? All advice gratefully received.
  13. Im sorry but I don't know how to send a subscribe request to MAilchimp - the code in the link you provided is beyond me
×
×
  • 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.