-
Posts
179 -
Joined
-
Last visited
About brainonastick
- Birthday 11/06/1970
Profile Information
-
Gender
Not Telling
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
brainonastick's Achievements
-
Im trying to create a link from one page to another that passes a Member ID value as follows: http://acwa2djszbbyvu.devcloud.acquia-sites.com/Pages/acwaBoardBallotPaper2015.php?username=100000 But Im getting: Fatal error: Cannot use object of type FX_Error as array in /mnt/gfs/acwa2djszbbyvu/sites/default/files/subsites/Pages/acwaBoardBallotPaper2015.php on line 47 The PHP in the destination page is as follows: <?php //session_start(); include_once('FX/FX.php'); include_once('FX/server_data.php'); ini_set('display_errors', 1); //var_dump($ballotData); error_reporting(E_ALL); //exit(); //ini_set('display_errors', 'On'); //print_r($errors); //define('DEBUG', true); //echo 'Hallo World'; //print_r($_POST); /* * cb_checked * Checks to see if the value validates against a previously checked option * * @param string $value * @return boolean */ function cb_checked($value) { $return = (false !== strpos(strtolower($value), 'Yes')) ? ' checked="checked"' : ''; return $return; } function rb_checked($value, $check) { $return = (false !== strpos(strtolower($value), $check)) ? ' checked="checked"' : ''; return $return; } $username = $_REQUEST['username']; $groupSize='1'; $ballot=new FX($serverIP, $webCompanionPort, $dataSourceType); $ballot->SetDBData('Membership_on_Web','Voting_Online'); $ballot->SetDBPassword('$webPW','$webUN'); $ballot->AddDBParam('Member_ID', $username, 'eq'); $ballotResult=$ballot->FMFind(); $returnedCount=$ballotResult['foundCount']; //THIS IS LINE 47 echo $ballotResult['errorCode']; foreach($ballotResult['data'] as $key=>$ballotData); $ballotData = current($ballotResult['data']); if($returnedCount != 1){ exit("Membership could not be validated.\n"); } $searchVariable=explode('.',$key); $currentRecord=$searchVariable[0]; //etc. ?> What am I doing wrong? I know passing values in URLs is not best practice but I just want to get the page to load any old how per the time being.
-
Redirect based on course capacity
brainonastick replied to brainonastick's topic in Other Internet Technologies
Thanks Webko - remind me to get new glasses asap. -
The following course is now full and when users search on our website they end up here: http://www.acwa.asn.au/Pages/coursedetailswl.php?recid=8897 However some staff paste the basic course detail URL into promotional flyers etc like this: http://www.acwa.asn.au/Pages/coursedetails.php?recid=8897 There is code (below) which redirects the user to the first URL if the course is full 9and to some other pages for other reasons) The below code used to work fine but is breaking now for some reason. I need any user who accesses the second link above to be redirected to the first. <?php //ini_set('display_errors', 1); //var_dump($user_data); //error_reporting(E_ALL); //exit(); //ini_set('display_errors', 'On'); //print_r($errors); //define('DEBUG', true); //print_r($_POST); include_once('FX/FX.php'); include_once('FX/server_data.php'); $recid = $_REQUEST['recid']; $coursecapacity = $_REQUEST['coursecapacity']; $groupSize='1'; $show_found_course=new FX($serverIP,$webCompanionPort,$dataSourceType); $show_found_course->SetDBData('Course Information','Course Information', $groupSize); $show_found_course->SetDBPassword($webPW,$webUN); $show_found_course->AddDBParam('-recid', $recid); $show_found_courseResult=$show_found_course->FMFind(); //echo $show_found_courseResult['errorCode']; foreach($show_found_courseResult['data'] as $key=>$show_found_courseData); if($show_found_courseData['Course_Capacity'][0] != "Space Available" && $show_found_courseData['Course_Capacity'][0] != "Filling Fast" && $show_found_courseData['Course_Capacity'][0] != "Course Capacity Not Applicable" && $coursecapacity != "Spac" && $coursecapacity != "Fill" && $coursecapacity != "Cour" ){ $currentRecord = $recid; $course_URL = ""; if ($Course_SearchData['Course_Capacity'][0] == 'Course Finished') $course_URL = "coursedetailsonly.php?recid=$currentRecord"; else if ($Course_SearchData['Course_Capacity'][0] == 'Course Has Started') $course_URL = "coursedetailsonly.php?recid=$currentRecord"; else if ($coursecapacity == 'Cour') $course_URL = "coursedetailsonly.php?recid=$currentRecord"; else if ($Course_SearchData['Cancelled'][0] == 'X') $course_URL = "coursedetailsonly.php?recid=$currentRecord"; else if ($Course_SearchData['Cancelled'][0] == 'X') $course_URL = "coursedetailsonly.php?recid=$currentRecord"; else if ($Course_SearchData['Rescheduled'][0] == 'X') $course_URL = "coursedetailsrs.php?recid=$currentRecord"; else if ($coursecapacity == 'Full') $course_URL = "coursedetailswl.php?recid=$currentRecord"; else if ($Course_SearchData['Course_Capacity'][0] == 'Full/Join Waiting List') $course_URL = "coursedetailswl.php?recid=$currentRecord"; else if ($Course_SearchData['Registration_Code'][0] == 'PAYFREE') $course_URL = "coursedetailspof.php?recid=$currentRecord"; else if ($Course_SearchData['Registration_Code'][0] == 'PAYFTNFREE') $course_URL = "coursedetailsptf.php?recid=$currentRecord"; else if ($Course_SearchData['Registration_Code'][0] == 'ALLFREE') $course_URL = "coursedetailsfree.php?recid=$currentRecord"; else if ($Course_SearchData['Special_Course_1'][0] == 'FORUM1') $course_URL = "coursedetailsforum.php?recid=$currentRecord"; else if ($Course_SearchData['Special_Course_1'][0] == 'FORUM2') $course_URL = "oursedetailsforum.php?recid=$currentRecord"; else if ($Course_SearchData['Special_Course_1'][0] == 'YSD') $course_URL = "coursedetailsonly.php?recid=$currentRecord"; header("Location: {$course_URL}"); exit(); } if ($show_found_courseData['Special_Times'][0] != '') { $times = $show_found_courseData['Special_Times'][0]; } else if ($show_found_courseData['Special_Times'][0] == '') { $times = $show_found_courseData['Starting_Time'][0] . ' to ' . $show_found_courseData['Finishing_Time'][0]; } ?>
-
Saving a web page as a PDF
brainonastick replied to brainonastick's topic in Other Internet Technologies
Thanks Webko. -
We have a certificate of attendance built in PHP/HTML which we ask customers to print or save as PDF. A lot of them are having difficulty with this. its easy for Mac users with the Save as PDF option but PC users are having issues depending on what software they have. Is there a way to convert a web page into PDF so that it maybe downloads to the clients file system. Ive seen a few different options on google - some free, some not - but am not sure which is the best way to go.
-
Drop down lists won't retain previous data
brainonastick replied to brainonastick's topic in Other Internet Technologies
It's now showing selected data when the page is returned to during a submission process but it doesn't display existing data from the database from a previous submission. -
I have a survey page that uses FMFind to find an existing record which is then updated by new survey data for comparison. http://www.acwa.asn.au/Pages/djppostcourseevaluation.php?recid=20989 The drop-down lists don't display previous data. For example: // variables extracted from database by FMFind $djpenjoy = $findnewevaluationData['djpenjoy'][0]; //isset code if (isset($_REQUEST['djpenjoy'])) $djpenjoy = $_REQUEST['djpenjoy']; //select code<select name="djpenjoy" size="1"> <?php $enjoyoptions = array('' => '', 'Not at all' => 'Not at all', 'Somewhat' => 'Somewhat', 'Almost all' => 'Almost all', 'Very much' => 'Very much'); $selected = ''; if (isset($_REQUEST['djpenjoy']) && in_array($_REQUEST['djpenjoy'], $enjoyoptions)) { // If someone has selected an option (i.e. previously submitted the form) then change the default value $selected = $_REQUEST['djpenjoy']; } // Loop through each option in $opts adding it as an option to the select. If the key from the array matches the selected (default) value then mark the item as selected foreach ($enjoyoptions as $k => $v) { echo '<option value="' . htmlentities($k, ENT_QUOTES) . '"'; if ($k == $selected) { echo ' selected="selected"'; } echo '>' . htmlentities($v, ENT_QUOTES) . '</option>'; } ?> </select> What am I missing?
-
We have a multiple registration system which worked fine on our in-house web server but we have now moved it to an external host and the web pages are not talking to the database. I need someone to come and sit with me to do some debugging. It may be only a couple of hours. Please let me know if you are interested.
-
I have a table that iterates search results from FMFind and this is pretty standard and works well. But I want to have a heading above the table which echoes the name of a course. I have used this code in the past and it has worked fine but in a page Im working with atm it won't echo: <p>The dates and venues for the course: <?php echo $Course_SearchData['Course_Name'][0]; ?> are as follows:</p> Is there anything wrong with the above code? I know the Course_Name is a variable which appears in all iterated records but this hasn't been an issue before. All advice gratefully received.
-
Running FX.php with Drupal on Acquia
brainonastick replied to brainonastick's topic in Other Internet Technologies
Thanks ggt667, Do I put the above code into the server_data.php file? And do I leave var $dataServerVersion =7? We are using v13 atm and going to 14 shortly. -
Running FX.php with Drupal on Acquia
brainonastick replied to brainonastick's topic in Other Internet Technologies
Hi Webko, I learned basic PHP from FMWebschools manual (2006) and they used to add the .fp7 extension when calling the database. I think we're a step closer to getting the database to respond. The only error now is: Notice: Undefined variable: key in /mnt/gfs/acwa2djszbbyvu/sites/default/files/subsites/Pages/showfoundcourses.php on line 138802 Heres the code where the error is pointing to: 131 $Course_Search->FMSkipRecords($skipSize); 133 $Course_SearchResult=$Course_Search->FMFind(); 134 $returnedCount=$Course_SearchResult['foundCount']; 136 foreach($Course_SearchResult['data'] as $key=>$Course_SearchData); 138 $searchVariable=explode('.', $key); 139 $currentRecord=$searchVariable[0]; 141 echo $Course_SearchResult['errorCode']; But we have an issue with the databases not appearing on the test server after being shared to them so I will sort this out and see how we go from there. Thanks again. -
Running FX.php with Drupal on Acquia
brainonastick replied to brainonastick's topic in Other Internet Technologies
Thank you again Webko your being so generous with your time - we are now sorting out some server issues. One thing - when Filemaker changed file extensions to .fmp12 we dropped the file extension from the SetDBData and used $dataSourceType instead of 'FMPro7' in new FX, e.g.: $Course_Search=new FX($serverIP, $webCompanionPort, $dataSourceType //not 'FMPro 7'); $Course_Search->SetDBData('Course Information' //not .fmp12,'Course Information Search', $groupSize); $Course_Search->SetDBPassword($webPW,$webUN); I assume this is OK - it works in our current set up. -
Running FX.php with Drupal on Acquia
brainonastick replied to brainonastick's topic in Other Internet Technologies
Hi Webko Ive messaged you my full reply as Ive sent the server_data.php file which as security data. Also is it worth me digging out the phpinfo.php file on Acquia to see if theres any bad settings for PHP?