Jump to content

wkilc

Members
  • Posts

    130
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

wkilc's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. Thank you. I took ginerjm's advice from his signature and enabled ALL errors and found that while it worked in PHP 7.4 there were deprecated issues... I will start there. Deprecated: Non-static method Action::isAvailable() should not be called statically... Deprecated: Non-static method Action::Factory() should not be called statically... ...both appear 7 or 8 times, always point to the same line. The former: if (Action::isAvailable($var['name'])) { This is the latter one: $action = Action::Factory($action_data['name']); I actually hired a Freelancer to try to fix the scripts a few days ago but we were not able to. Although, from what I've learned from this thread, along with all those new warnings from 7.4 and I think we'd have a better chance if we have another go at it.
  2. Thank so much! That does indeed squash the error... but now with PHP 8, the form outputs simply: default_page_content default_page_footer rather than the HTML form template that loads when processing with PHP 7.4.
  3. I don't know enough to follow these suggestions. I am sorry. In the main index.php file for this script, it has: /** * Path definitions */ define('PLUGINS_DIR', './plugins/'); define('CLASSES_DIR', './classes/'); define('CONFIG_FILE', './ptd_config.php'); define('ATTACHMENT_DIR', './attachments/'); define('LANGUAGE_DIR', './lang/'); define('TMP_DIR', './tmp/'); /** * Default language definition */ define('DEFAULT_LANG', 'en'); /** * Loading common classes */ require_once(PLUGINS_DIR . 'common.php'); require_once(CLASSES_DIR . 'error.class.php'); require_once(CLASSES_DIR . 'file.class.php'); require_once(CLASSES_DIR . 'config.class.php'); require_once(CLASSES_DIR . 'lang.class.php'); require_once(CLASSES_DIR . 'request.class.php'); require_once(CLASSES_DIR . 'response.class.php'); require_once(CLASSES_DIR . 'action.class.php'); require_once(CLASSES_DIR . 'validator.class.php'); require_once(CLASSES_DIR . 'executor.class.php'); require_once(CLASSES_DIR . 'outputer.class.php'); require_once(CLASSES_DIR . 'parser.class.php'); require_once(CLASSES_DIR . 'formerror.class.php'); /** * Main classes construction */ $lang = new Lang(); $config = new Config(); $formError = new FormError(); $request = new Request(); $response = new Response(); if (isset($_POST['fpp_reset'])) { $request->data['fpp_form'] = trim($_POST['fpp_form']); $request->data['fpp_output'] = 1; } /** * Checking writable dirs */ if (!is_writable(ATTACHMENT_DIR)){ $e = new Error($lang->getValue('err_dir_not_writable', ATTACHMENT_DIR)); } if (!is_writable(TMP_DIR)){ $e = new Error($lang->getValue('err_dir_not_writable', TMP_DIR)); } Is this where the changes need to be made?
  4. Thank you. Like this? __construct() { $this->response->setContent($content)); } Here's the rest of the outputter file: function Outputer(){ global $response; $this->response = $response; $this->setType(ACTION_TYPE_OUTPUTER); return true; } /** * Does contents output * * @param string $content * @return void */ function output($content, $isError = false){ if ($isError){ $request = $this->getRequestData(); $this->response->setOuputOffset($request['fpp_output']); } $this->response->setContent($content); $this->response->printOut(); } function redirect($url){ if (function_exists('ob_start')){ ob_start(); ob_clean(); } header('Location: ' . $url); exit(); } /** * Shows default page * * @return void */ function showDefaultPage(){ global $lang; $lang = new Lang(); $content = ''; $content .= '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"'."\n"; $content .= '"http://www.w3.org/TR/html4/loose.dtd">'."\n"; $content .= '<html>'; $content .= '<head>'; $content .= '<title>' . $lang->getValue('default_page_title') . '</title>'; $content .= '</head>'; $content .= '<body bgcolor="#FFFFFF" text="#000000" link="navy" vlink="navy" alink="red" style="font-family: verdana, arial, sans-serif; font-size: 8;">'; $content .= '<center><table border="0" cellpadding="0" cellspacing="0" width="600" style="font-family: verdana, arial, sans-serif; font-size: 12;">'; $content .= '<tr><td>'; $content .= '<p align="center">' . $lang->getValue('default_page_content') . '</p>'; $content .= '<p align="center">' . $lang->getValue('default_page_footer') . '</td>'; $content .= '</tr>'; $content .= '</table>'; $content .= '</center>'; $content .= '</body>'; $content .= '</html>'; $this->output($content); } }
  5. Thank you. Forgive me for asking, but could you possibly show me where in my code to add construct() so I could try it out? Or have I not posted enough to go there?
  6. Thank you. My problem is I have don't know how to remedy that. I tried: $this->response=new response(); That removes in fact removes the error, but then the form data won't get outputted to the HTML template.
  7. Hello. Despite being at this for a while, I am in reality a grade-school teacher and a PHP novice. I have a third-party PHP form mail script that I purchased years back. The company is in the Ukraine and appears to no longer be in business. (God Bless.) Anyway, the script always appeared to work perfectly with PHP 7.4. I set my site to 8.1 to test it out... saw a few minor warnings that even I could pretty easily remedy. However, there's one that has me stumped. Fatal error: Uncaught Error: Call to a member function setContent() on null in /home/www/www/fp/classes/outputer.class.php:53 Stack trace: #0 /home/www/www/fp/classes/outputer.class.php(92): Outputer->output('<!DOCTYPE HTML ...') #1 /home/www/fp/ptd.php(93): Outputer->showDefaultPage() #2 {main} thrown in /home/www/www/fp/classes/outputer.class.php on line 53 I believe that this is the part of the form that processes form data and then outputs it to a HTML page template to show the results of the submission. Line 53: $this->response->setContent($content); Line 93: $this->output($content); The code surrounding line 53: function output($content, $isError = false){ if ($isError){ $request = $this->getRequestData(); $this->response->setOuputOffset($request['fpp_output']); } $this->response->setContent($content); $this->response->printOut(); } function redirect($url){ if (function_exists('ob_start')){ ob_start(); ob_clean(); } header('Location: ' . $url); exit(); } /** * Shows default page I've been researching this and I realize this is likely a result of a value of "null" coming up... but everything I've tried to remedy doesn't help. Again, rolling site back to 7.4 and everything works as it should, no errors or warnings. Many thanks for any guidance you can provide.
  8. Got it! I had to initialize $XXX = 1 outside the loop. Thank you.
  9. Hi, I am trying to modify some code to add a simple number increment to my results. There are tutorials galore, but the problem is the way the original code is set-up this way: { $XXX = 1; $op1 .= '<table>'; $op1 .= '<tr><td><input type="text" name="School'.$XXX.'" /></td> <td><input type="text" name="Student'.$XXX.'" /></td> <td><input type="text" name="Class'.$XXX.'" /></td> </tr>'; $XXX++; } $op1 .= '</table>'; } <?= $op1; ?> This is the result: <table> <tr><td><input type="text" name=School1"></td> <td><input type="text" name=Student1"></td> <td><input type="text" name=Class1"></td> </tr> <tr><td><input type="text" name=School1"></td> <td><input type="text" name=Student1"></td> <td><input type="text" name=Class1"></td> </tr> <tr><td><input type="text" name=School1"></td> <td><input type="text" name=Student1"></td> <td><input type="text" name=Class1"></td> </tr> </table> I tried: <td><input type="text" name="School'.$XXX++.'" /> but this returns: <table> <tr><td><input type="text" name=School1"></td> <td><input type="text" name=Student2"></td> <td><input type="text" name=Class3"></td> </tr> <tr><td><input type="text" name=School1"></td> <td><input type="text" name=Student2"></td> <td><input type="text" name=Class3"></td> </tr> <tr><td><input type="text" name=School1"></td> <td><input type="text" name=Student2"></td> <td><input type="text" name=Class3"></td> </tr> </table> I am looking for: <table> <tr><td><input type="text" name=School1"></td> <td><input type="text" name=Student1"></td> <td><input type="text" name=Class1"></td> </tr> <tr><td><input type="text" name=School2"></td> <td><input type="text" name=Student2"></td> <td><input type="text" name=Class2"></td> </tr> <tr><td><input type="text" name=School3"></td> <td><input type="text" name=Student3"></td> <td><input type="text" name=Class3"></td> </tr> </table> Apologies if I am not explaining this correctly or if I did not post enough info. Thanks in advance.
  10. I am editing a script that pulls values from a database to populate a pulldown menu: if($_GET['car'] == $row['car'] ){ echo "selected=\"selected\""; } print " value=\"$page_name&car=" . $row['car'] . "\">" . $row['car'] . "</option>\n"; } print "</select>"; This works great, except some of the "car" values in my table are empty... so I get one row in my pulldown menu that's empty: <option selected="selected" value="/list.php?car="></option> <option value="/list.php?car=Honda">Honda</option> <option value="/list.php?car=Hyundai">Hyundai</option> etc... How can I tell it to not print an "empty" result in my pull down? My apologies if I am not explaining this well. Thank you.
  11. That's very helpful, thank you. Sadly the database is something I have to download/import a couple times per week from another organization... and it is not practical to change the structure.
  12. Thank you. The database itself cannot be re-written, I don't think. Users have TWO potential addresses in their profile. A primary and a secondary. EITHER one can be a school/work address. (Some use the home address as primary, school as secondary, others vice versa.) I wanted my page to display (and filter using the form) the names of the schools, whether is it listed in the primary OR the secondary address. If the primary address is a home address, "School1" is empty. The secondary address is a home address "School2" is empty. In no case will they both be populated, I do believe. Point taken. I will hire someone to help with code. Thanks again.
  13. Hi all, I have a chunk of code that is used to create a pull-down menu that retrieves a list of school names: <? //remove any old school from query $tmp = array(); foreach ($_GET as $fld => $val) if (($fld != 'sn_School2')&&($fld != 'start')) $tmp[] = $fld . '=' . $val; $page_name = $_SERVER['SCRIPT_NAME'] . '?' . implode('&',$tmp); ?> <form name="form2" action="" class="tight"> <?php $result = @mysql_query("select distinct sn_School2 from user_info ORDER BY sn_School2 ASC"); if (mysql_num_rows($result) > 0) { print "<select name=\"link\" onchange=\"openURL2()\" style=\"width: 18.0em;\">"; ?>"; ?> <option <?php if(empty($_GET['sn_School2'])){ echo "selected=\"selected\""; } ?> value="<? echo "$page_name" ?>">DISPLAY ALL SCHOOLS</option> <?php while ($row = mysql_fetch_array($result)) { if(empty($row['sn_School2'])) continue; //added print "<option "; if($_GET['sn_School2'] == $row['sn_School2'] ){ echo "selected=\"selected\""; } print " value=\"$page_name&sn_School2=" . $row['sn_School2'] . "\">" . $row['sn_School2'] . "</option>\n"; } print "</select>"; } ?> </form> I didn't write it.... it sorta confuses me, but it works. It gives me a nice pull down populated by all the school names in School2. I want to add values from another column, called "School1". The way the database is set-up is that some folks have a value in "School1", while others have it listed in "School2". How can I make my pull-down and my query check both 'School1' and 'School2'? I am thinking I can't, because the query in the URL currently says "www.mysite.com?School2=Hogwarts". I'm a noob... but I think the trick might to create and array, no? Thanks.
  14. Hi all, I am a PHP novice. I use a script on my site to display multiple table rows with alternating colors and what I believe is called "pagation". (Takes 1,500 rows and displays only 25 or 50 or 100...) Anyway... my host is moving to PHP 5.5 at the end of the month, and when I tested it, it was all good, except for the ability to sort. I think it's this that is the problem: function pparams($sort) {global $sponsor, $school, $student, $instrument, $room, $time;} if (!$sort) $sort = "time"; This is because "register globals" is not supported with 5.5. Any suggestions on how to make it work? Thanks.
  15. If I query my database: www.mydomain.com/index.php?room=M210 I get both room M201 and M210B in my results. I know enough to know that is a result of: and (allstate_schedule.room LIKE '$room%') So I change it to this: and (allstate_schedule.room LIKE '$room') Now the query works correctly: www.mydomain.com/index.php?room=M210 But if I pull up an unfiltered list: www.mydomain.com/index.php ... I get my "No records found matching:" here is my code: $query = "SELECT allstate_schedule.sponsor,allstate_schedule.school,allstate_schedule.student,allstate_schedule.instrument,allstate_schedule.school,allstate_schedule.room,allstate_schedule.time from allstate_schedule WHERE ((allstate_schedule.sponsor LIKE '$sponsor%') and (allstate_schedule.student LIKE '%$student%') and (allstate_schedule.instrument LIKE '$instrument%') and (allstate_schedule.school LIKE '$school%') and (allstate_schedule.room LIKE '$room%') and (allstate_schedule.time LIKE '$time%')) ORDER BY allstate_schedule.$sort LIMIT $eu, $limit "; $resultt = mysql_query($query); // Determine the number of employees $number = mysql_num_rows($resultt); if ($number == 0) { print "<b>No records found matching</b>:"; $sponsor = $sponsor; $school = $school; $room = $room; $student = $student;
×
×
  • 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.