Jump to content

iwato

Members
  • Content count

    1,049
  • Joined

  • Last visited

Everything posted by iwato

  1. BACKGROUND: Working with Matomo has compelled me to dig deeper into the way that information gets passed over the internet. Up until now I have assumed that I can pass just about anything in a query string. In fact, this is exactly what I have been doing. What I am beginning to realize is that the PHP $_POST and $_GET variables have been doing work of which I was not aware. I have come to this conclusion with my new encounter of the encodeURI(), encodeURIComponent(), decodeURI(), and decodeURIComponent() functions. Indeed, I have read that no information can be passed in an HTTPRequest that is not in ASCII format. Is this true? QUESTION: Is it true that when working with PHP the values of PHP HTTPRequests are automatically URL encoded and URL decoded, and that when working with Javascript the same values must be manually encoded and decoded? Roddy
  2. Please find below the Javascript insertion <script> tag that Matomo uses to track user behavior on a webpage. <!-- Matomo --> <script type="text/javascript"> var _paq = _paq || []; _paq.push(['trackPageView']); _paq.push(['enableLinkTracking']); (function() { var u="//{$PIWIK_URL}/"; _paq.push(['setTrackerUrl', u+'piwik.php']); _paq.push(['setSiteId', {$IDSITE}]); var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s); })(); </script> <!-- End Matomo Code --> I would like to clarify the meaning of the final line of the above function -- namely, g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s); QUESTION ONE: Can the script attributes async and defer work indepedently of each another? What is the purpose of each and does their role change when they are imlpemented together? QUESTION TWO: Given the statement s=d.getElementsByTagName('script')[0]; does the statement s.parentNode.insertBefore(g,s); read: "Find the parent node of s and prepend g before s where s is the first node of all script nodes within the document including the node containing this function"?
  3. Matomo: async, defer, and insertBefore()

    JSG: But, you have set aside the very thing that I was trying to understand -- the jQuery ready( ) function. If I have understood this function correctly, it allows the Javascript contained within the function to be read as the rest of the page is being downloaded, but does not permit what is read to be executed until the rest of the page has been completed. My question, then: does the jQuery ready() function also insure that the Javascript thus read and loaded execute in the order that it is entered into the ready function? Roddy
  4. var a = a || [ ];

    BACKGROUND: Earlier I posted a script from Matomo that serves as a counter for page hits and various other bits of information gleaned from a user's behavior on a webpage that bears the script. Although I now understand what the code does, I would like to understand its purpose. In particular, I would like to understand the probable reason for assigning to a variable another variable with the same name. The full code is given as: <!-- Matomo --> <script type="text/javascript"> var _paq = _paq || []; _paq.push(['trackPageView']); _paq.push(['enableLinkTracking']); (function() { var u="//{$PIWIK_URL}/"; _paq.push(['setTrackerUrl', u+'piwik.php']); _paq.push(['setSiteId', {$IDSITE}]); var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s); })(); </script> <!-- End Matomo Code --> The code of interest is var _paq = _paq || []; I find this piece of code problematic for three reasons: It assumes that this variable could already exist, but I have no idea where it could come from. It it does already exist what happens to the pre-existent with the same name. How does it know which value to choose? Is there a latent selection mechanism that tells the assignment operator to choose the second value when the first is undefined? Please advise. Roddy
  5. var a = a || [ ];

    Revisiting the Matomo insert <!-- Matomo --> <script type="text/javascript"> var _paq = _paq || []; _paq.push(['trackPageView']); _paq.push(['enableLinkTracking']); (function() { var u="//{$PIWIK_URL}/"; _paq.push(['setTrackerUrl', u+'piwik.php']); _paq.push(['setSiteId', {$IDSITE}]); var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s); })(); </script> <!-- End Matomo Code --> If what you said is true, then the following statement would be true would it not? STATEMENT: Were the same script to be entered twice on the same page, then the contents of the first completed _paq array would be passed onto the _paq array of the second entry and everything would be counted twice.
  6. Matomo: async, defer, and insertBefore()

    Whether it is true or not, I have understood well what you explained. Under the assumption that what you have stated is true, could it not then be said that the jQuery ready( ) function behaves as if each line of script contained within the function were assigned its own script tag and defer attribute? Roddy
  7. Array cloning

    Ingolme: I do not understand your reply. In the second example. If I change a, so too will b change, because the value of a.slice(0) is determined by the value of a. in the first example. can I not assign a new value to b without affecting the value of a? Roddy
  8. Matomo: async, defer, and insertBefore()

    OK. I have read through the MDN reference that you provided regarding the async and defer attributes. Comparing this reference against your statement and my own reflection it appears that Javascript and HTML are treated separately by a browser. This said, if no special action is taken Javascript will always be executed in the moment that it is read along with the other HTML tags in the document. Further, if I have understood correctly, there are three ways to introduce Javascript into a webpage: one, it is executed in the order that it is read along with other HTML tags; two, although read in the order in which it appears amont other HTML tags it need not need be executed at the time it is read; and three, although read in the order in which it appears among other HTML tags, it is not executed until all of the HTML tags have been loaded, and when read, it is read in the order in which it was introduced among the other HTML tags. In other words, 1) Javascript is synchronous when it is executed in the order that it appears along with the other HTML tags. 2) Javascript is asynchronous when the browser is not compelled to execute in the order that it appears among the other HTML tags 3) When the defer attribute is indicated and is assigned the value true, the corresponding script is treated as if it were contained in a jQuery ready() method and not executed until all other HTML tags have been read. QUESTION: Is the above a proper understanding of the relationship between HTML, Javascript, and browser behavior? Roddy
  9. Understanding Matomo

    Although by no means fully recovered from a recent machine failure, I am back on the road in a much weakened condition. Please consider the following piece of code and correct me where my interpretation of the code is in error. <!-- Matomo --> <script type="text/javascript"> var _paq = _paq || []; _paq.push(['trackPageView']); _paq.push(['enableLinkTracking']); (function() { var u="//{$PIWIK_URL}/"; _paq.push(['setTrackerUrl', u+'piwik.php']); _paq.push(['setSiteId', {$IDSITE}]); var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s); })(); </script> <!-- End Matomo Code --> My interpretation of same var _paq = _paq || []; _paq is an array that is initialized as empty or some preassigned value. _paq.push(['trackPageView']); Add a new element to _paq whose key-value pair is 'trackPageView' : undefined var u="//{$PIWIK_URL}/"; Create a variable called called u and assign to it the following string "// + some.domain.name + /". _paq.push(['setTrackerUrl', u+'piwik.php']); Add a new element to _paq whose key-value pair is 'setTrackerUrl' and u + piwik.php, respectively. var d=document, g=d.createElement('script'),s=d.getElementsByTagName('script')[0]; Create three variables named d, g and s whose values are d: the DOM document g: the name of a newly created element called 'script' s: an empty index array called 'script' g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s); The resulting script tag should appear as follows: <script text='javascript' async='true' defer='true' src= 'u + piwik.js'></script> function()(); Run the function upon loading the document in which it is contained. Roddy
  10. Error 500 - Probable Causes

    BACKGROUND: The following code was copied from the Grammar Captive mainpage where it performs just as it was designed to perform. Sadly, however, it fails on my local test server. The error log to which the file points indicates nothing and the data is properly entered into the data base. Further, although the PHPMailerAutoload.php class loads properly, the mail does not get sent and message is produced. Finally, the Javascript Console claims the following: "Failed to load resource: the server responded with a status of 500 (Internal Server Error)". And, the resource that it names is the very same listed below. I checked the confirmation_mail.php file and discovered that two of the links were not using secure protocol and adjusted these. Now, it worked before I upgraded to PHP 5.6.3, but for some reason it does not work now. <?php ini_set('display_errors', 0); ini_set('error_log', '../../../error.log'); ini_set('log_errors', 1); error_reporting(E_ALL); require_once './php_mailer/PHPMailerAutoload.php'; $name = $email = $location = $language_level = $language = $personal = $msg = '' ; if ($_SERVER['REQUEST_METHOD'] == 'POST') { if (!empty($_POST['name']) && !empty($_POST['email']) && !empty($_POST['location']) && !empty($_POST['language']) && !empty($_POST['language_level']) && isset($_POST['personal'])) { $name = filter_var($_POST['name'], FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_LOW); $email = filter_var($_POST['email'], FILTER_VALIDATE_EMAIL, FILTER_SANITIZE_EMAIL); $location = filter_var($_POST['location'], FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_LOW); $language_level = filter_var($_POST['language_level'], FILTER_SANITIZE_NUMBER_INT, FILTER_VALIDATE_INT); $language = filter_var($_POST['language'], FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_LOW); $personal = filter_var($_POST['personal'], FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_LOW); include_once('./classes/class.lunarpages.php'); $lunarpages = new Lunarpages(); $mysqli_obj = $lunarpages->get_mysqli_obj(); function random_password() { $alphabet = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!_!_!_!_!_!_!_'; $pass = array(); $alphaLength = strlen($alphabet) - 1; for ($i = 0; $i < 8; $i++) { $n = rand(0, $alphaLength); $pass[] = $alphabet[$n]; } return implode($pass); } $password = random_password(); $hash = password_hash($password, PASSWORD_DEFAULT); $active = 0; $newsletter = 1; $webinar = 1; $tbl_name = 'thege0_grammarcaptive.captive_roster'; $sql_1 = "INSERT INTO $tbl_name (user_name, language, email_address, location, language_level, personal, psw_hash, active, newsletter, webinar) VALUES ('" . $name . "','" . $language . "','" . $email . "','" . $location . "','" . $language_level . "','" . $personal . "','" . $hash . "','" . $active . "','" . $newsletter . "','" . $webinar . "')"; $mysqli_obj->query($sql_1); $mail = new PHPMailer; $mail->CharSet = 'UTF-8'; $mail->isSMTP(); $mail->SMTPDebug = 0; $mail->Debugoutput = 'html'; $mail->Host = "baha.lunarbreeze.com"; $mail->Port = 587; $mail->SMTPAuth = true; $mail->Username = "webinar@grammarcaptive.com"; $mail->Password = "..."; $mail->setFrom('webiniar@grammarcaptive.com', 'Grammar Captive'); $mail->addReplyTo('admin@grammarcaptive.com', 'Grammar Captive Administration'); $mail->addAddress($email, $name); $mail->Subject = 'Account Verification'; $html_message = file_get_contents('../../confirmation_mail.php'); $html_message = str_replace('%name%', $name, $html_message); $html_message = str_replace('%email%', $email, $html_message); $html_message = str_replace('%hash%', $hash, $html_message); $html_message = str_replace('%language%', $language, $html_message); $mail->msgHTML($html_message); $alt_message = "Congratulations, $name! You have successfully created a Grammar Captive account./n/r Please click on the link below to verify that you are the owner of the account and to receive your first edition of Seven Gates, the Grammar Captive weekly newsletter. You will be notified by email as soon as a date and time have been set for your first free webinar./n/r http://www.grammarcaptive.com/_utilities/php/email_verify.php?name=$name&email=$email&hash=$hash&language=$language&letter_no=1"; $mail->AltBody = $alt_message; if (!$mail->send()) { $msg = $mail->ErrorInfo; } else { $msg = "<h1 style = 'text-align: center;color: #4E7F4E;font-size: 3em;font-weight: bold;font-family: Bradley Hand, cursive;margin: -1em, auto;vertical-align: bottom;'>Free Webinar</h1><p style='text-align: center; margin-top: -1.2em; font-size: 0.9em;'>Including the first edition of the Seven Gates weekly newsletter!</p><h2>Congratulations, <span style='font-family: Bradley Hand, cursive;font-size:1.4em;color:#4E7F4E;'>$name</span>!</h2><p style='text-align:left;'>Your information has been securely sent using SMTP protocol and a TSL/SSL security layer.</p><p>Please look for a verification email in your email inbox and click on the link provided. This will insure that you are the person who submitted the data.</p><p>You will receive an email in your inbox as soon as a date and time for the free webinar has been scheduled.</p><p>Episode No. 1 of the Seven Gates newsletter will arrive in your email inbox after you have confirmed your identity.</p><p><span style='color:#4E7F4E;font-weight:bold;'>CAUTION: </span>Sometimes the verification mail will be redirected to a user's junk box. Do not treat it as junk, for without verification no newsletter can be received!</p><p>In addition, you may have to adjust your email software to insure that future email from Grammar Captive arrives in your inbox.</p><p style='text-align:left;'><span style='color:#4E7F4E;font-weight:bold;'>SECURE STORAGE:</span> Your information is stored on the Lunarpages webserver in Orange, California. If you have any questions about the safety of your data, please read under the headings <em>Other/Internet Security</em> and <em>Other/Legal Privacy</em> in the Grammar Captive navigation bar on your left. Alternatively, you may email the Grammar Captive webmaster at <a href='mailto:admin@grammarcaptive.com?subject=Grammar%20Captive%20Webmaster%20-%20Question%20About%20Internet%20Security' title='The Grammar Captive webmaster' target='_blank'>admin@grammarcaptive.com</a>.</p><p>Thank you for your cooperation!</p>"; } echo $msg; } } ?> Any ideas? Roddy
  11. Error 500 - Probable Causes

    The absence of error messages appears to have been created by improper coding errors of the like that creates a blank screen in PHP when you miss a comma, semi-colon, or quotation mark. The past two weeks have been a very painful learning experience for me, as it came just as I am approaching the peak of my first phase of site development. I have staked out a very mountainous range to climb, and it hurt to be so close and unable to reach my first peak on schedule. I unwisely allowed my hope to overshadow my past experience of disappointment, and was brutally frustrated as a result. In any case, a long trek around the first peak has allowed me to regain my strength and upward orientation, and I am back into climbing mode. Thank you, everyone for your effort. I apologize for putting you through my frustration. Hopefully I have learned well from my errors. Roddy
  12. Thank you, Dsonesuk, for your advice regarding a proper approach to take in remedying my problem of digital toilet paper. For the moment, however, I have solved the problem by rethinking how the paper functions in a smartphone environment where most people are likely to view Grammar Captive, anyway. The cost of implementation simply does not match the benefit of outcome at this early stage of development. I must move on toward production, and performance measurement must take priority over site appearance at this time. Roddy
  13. REQUEST: Please compare the results in the middle panel of the following two actions: ACTION ONE: Click on the phrase Weekly Podcasts under the heading Products in the navigation bar of the Grammar Captive mainpage. Scroll to the bottom of the page and view how the middle panel exceeds the height of the navigation bar and side panel. ACTION TWO: While on the same page with the same panel open click on the phrase Click and Listen. This will bring you to a different document in the same window. Notice that the middle panel does not exceed the height of the navigation bar and side panel. Also, note that the panel's scroll functionality is well in place. Now return to the Grammar Captive mainpage and perform the following: Find the phrase Q&A under the heading Search Grammar Captive in the navigation bar and click on it. Notice the absence of a border around the middle panel. Enter the word Frage in the search box and click on the Search button. (Do not hit the ENTER/RETURN key, else you will be blown away) Notice that middle content is now enclosed in a border and that the height of the content is nearly that of the navigation bar and side panel. (I acknowledge that there are some problems with the CSS, and I believe that I know how to fix them.) Click on the phrase The Answer ... wherever you would like and notice that the content of the middle panel fill below either of the two side panels. Click on the phrase Click and Read below the answer on watch the role of digital toilet paper unravel. It is this phenomenon that I am seeking to prevent with the introduction of scroll functionality. The Javascript that works for ACTION TWO on the Podcast hostpage refuses to work on the Grammar Captive mainpage. if (status === 'success') { var aside_height = $('aside').height(); $('#main').css('min-height', aside_height); $('#pagn').show(); } This, no matter the placement or alteration. Adding the property-value pair 'overflow-y' : 'scroll' achieves nothing. $('#main').css({'min-height':aside_height,'overflow-y':'scroll'}); Any ideas? Roddy
  14. Class Variable Declaration

    Unfortunately, the following did not work. $sql = "SELECT letter_no, letter_title, letter_abstract FROM sevengates_letter WHERE letter_no = ?"; $mysqli_stmt = $this->mysqli_obj->stmt_init(); $mysqli_stmt->prepare($sql); $mysqli_stmt->bind_param('i', $next_letter_no); $mysqli_stmt->execute(); $result = $mysqli_stmt->get_result(); $return = $result->fetch_all(MYSQLI_ASSOC); I have set it aside, however, for future consideration. I simple have no more time, if I am to meet my spring deadline for the commencement of podcast production. I have only two major tasks left -- both of which I suspect will be far smaller than they appear daunting. Thanks to you and others I now feel confident that I will be able to avoid many of the pitfalls into which I have fallen along the way. Have a great week! Roddy
  15. Class Variable Declaration

    BACKGROUND: I am now running with PHP 5.5.38, and things are nearly back to normal. My error messages have returned, and things that once worked, now function well again. This said, I wish to make good on the pain and disappointment that I suffered and am requesting your help to do so. REQUEST: Please find below a PHP class that I created in order to gather data from my database. It works fine in my current PHP environment and produces the expected results. It has been upgraded to handle multiple languages and editions of the same letter number. In addition, I have included a list of suspect variables -- namely, variables whose undeclared status may have been a source of difficulty while running in my previous PHP 5.6.33 environment. class Newsletter { public $letter_no; public $letter_lang; public $mysqli_obj; public $letter_ed; public $pc_total; public $podcasts; public function __construct($letter_no, $letter_lang, $mysqli_obj, $letter_ed = 1) { $this->letter_no = $letter_no; $this->letter_lang = $letter_lang; $this->mysqli_obj = $mysqli_obj; $this->letter_ed = $letter_ed; } public function get_letter_data() { $sql = "SELECT letter.*, qa.* FROM sevengates_letter AS letter JOIN sevengates_qa AS qa ON letter.letter_no = qa.letter_no WHERE letter.letter_no = ? AND letter.letter_lang = ? ORDER BY letter.letter_ed DESC"; $mysqli_stmt = $this->mysqli_obj->stmt_init(); $mysqli_stmt->prepare($sql); $mysqli_stmt->bind_param('is', $this->letter_no, $this->letter_lang); $mysqli_stmt->execute(); $meta = $mysqli_stmt->result_metadata(); while ($field = $meta->fetch_field()) { $params[] = &$row[$field->name]; } call_user_func_array(array($mysqli_stmt, 'bind_result'), $params); while ($mysqli_stmt->fetch()) { foreach($row as $key => $val) { $c[$key] = $val; } $prelim_result[] = $c; } foreach ($prelim_result as $arr) { foreach ($arr as $name => $value){ $letter_results[$name] = $value; } } return $letter_results; } public function get_nextletter_data() { $next_letter_no = $this->letter_no + 1; $sql = "SELECT letter_no, letter_title, letter_abstract FROM sevengates_letter WHERE letter_no = ?"; $mysqli_stmt = $this->mysqli_obj->stmt_init(); $mysqli_stmt->prepare($sql); $mysqli_stmt->bind_param('i', $next_letter_no); $mysqli_stmt->execute(); $meta = $mysqli_stmt->result_metadata(); while ($field = $meta->fetch_field()) { $params[] = &$row[$field->name]; } call_user_func_array(array($mysqli_stmt, 'bind_result'), $params); while ($mysqli_stmt->fetch()) { foreach($row as $key => $val) { $c[$key] = $val; } $prelim_result[] = $c; } $mysqli_stmt->free_result(); foreach ($prelim_result as $arr) { foreach ($arr as $name => $value){ $nextletter_results[$name] = $value; } } return $nextletter_results; } public function get_podcasts() { $sql = "SELECT podcast_ref FROM sevengates_podref WHERE letter_no = ?"; $mysqli_stmt = $this->mysqli_obj->stmt_init(); $mysqli_stmt->prepare($sql); $mysqli_stmt->bind_param('i', $this->letter_no); $mysqli_stmt->execute(); $meta = $mysqli_stmt->result_metadata(); while ($field = $meta->fetch_field()) { $params[] = &$row[$field->name]; } call_user_func_array(array($mysqli_stmt, 'bind_result'), $params); while ($mysqli_stmt->fetch()) { foreach($row as $key => $val) { $c[$key] = $val; } $prelim_result[] = $c; } $i = 1; foreach ($prelim_result as $arr) { foreach ($arr as $name => $value) { $name = $name . '_' . $i; $podcasts[$name] = $value; } $i++; } $this->pc_total = count($podcasts); return $podcasts; } public function get_podcasts_data($podcasts) { $this->podcasts = $podcasts; $prelim_result = []; $c = []; $row = []; $podcast_results = []; foreach ($podcasts as $name => $value) { $params = []; $mysqli_stmt = $this->mysqli_obj->stmt_init(); $sql = "SELECT item_podtype, podcast_no_item, item_title, item_description, item_guid FROM rss2_podcast_item WHERE podcast_no_item = ?"; $mysqli_stmt->prepare($sql); $mysqli_stmt->bind_param('i', $value); $mysqli_stmt->execute(); $meta = $mysqli_stmt->result_metadata(); while ($field = $meta->fetch_field()) { $params[] = &$row[$field->name]; } call_user_func_array(array($mysqli_stmt, 'bind_result'), $params); while ($mysqli_stmt->fetch()) { foreach($row as $key => $val) { $c[$key] = $val; } } $prelim_result[] = $c; $mysqli_stmt->free_result(); } foreach ($prelim_result as $arr) { foreach ($arr as $name => $value){ $pc_result[$name] = $value; } $podcast_results[] = $pc_result; } return $podcast_results; } public function get_pc_total() { return $this->pc_total; } } LIST OF SUSPECT VARIABLES $params = []; $prelim_result = []; $c = []; $letter_results = []; $next_letter_results = []; $row = []; $podcast_results = []; DISCUSSION I feel fairly comfortable with handling certain kinds of variables, but very uncomfortable handling others. In fact, I am not at all sure why the above class works, as it took a lot of guess work to make it function. Guess work is inefficient. QUESTION: How does one properly declare class variables that are not related to the arguments of the constructor function? Please provide examples from the list and code provided. Roddy
  16. Class Variable Declaration

    JSG: I have never used the fetch_all( ) method in this context -- only the fetch_assoc( ) method --, and it does not work in the context provided. Roddy
  17. Class Variable Declaration

    JSG: For someone who is always asking for code, you are very reluctant to provide it. A simple example in the context of the class provided would be extremely helpful. Roddy
  18. Class Variable Declaration

    JSG: Please select one of any of the provided class functions that contain "ordinary variables" and show me how you would declare them in the context of the class provided. davej: Why would you make the private and not public?
  19. No access to CSS

    Submit a CSS stylesheet with your work and insure that it is specific to the HTML elements of your document. Roddy
  20. You might wish to begin here. In regard to your button, you might try floating it or placing the entire bar in a flex box. Button and forms have a mind of their own. Roddy p.s. If you find my entry helpful, hover over the heart and click on the trophy.
  21. Please ignore this question. The problem has been resolved. Roddy
  22. DILEMMA: My goal is to style the body of a newsletter template. Although I am able to get the formatting into the database and -table, I am unable to retrieve it for insertion in the newsletter's template. Please find below an example of the way in which the value string of only one of the several SQL INSERT statements is created. The string that results is later combined with a name string and other elements of a valid INSERT statement. EXAMPLE OF THE WAY THE INSERTED VALUE IS FORMATTED include_once('../_utilities/php/classes/class.lunarpages.php'); $lunarpages = new Lunarpages(); $mysqli_obj = $lunarpages->get_mysqli_obj(); var_dump($mysqli_obj); $sql_letter_val = "('"; $substr_start = 0; $substr_length = 8; foreach ($newsvar_names as $name => $value) { if (substr($name, $substr_start, $substr_length) == '$letter_') { $sql_letter_val .= $mysqli_obj->real_escape_string($value) . "', '"; } } WHAT APPEARS IN THE DATA TABLE AFTER INSERTION <h1>ようこそ!</h1> <p>「<span style='font-family:Bradley Hand, cursive;font-size:1.8em;'>Seven Gates</span>」と言うのは文法キャプチッブのオンラインニューズレターです。</p> <p>このニューズレターの初版は文法キャプチッブの紹介としてニューズレターの構成及び文法キャプチッブの本質をユーザー達にその母語で説明しています。第二版のニューズレター以降のニューズレターは英語で書いてあるものです。もしニューズレターの初版を英語でも読んだ方が好いとすれば、ウェブ型の変形が<a href='https://www.grammarcaptive.com/?newsletter=1' title='Seven Gates - Edition No. 1' target='_blank'>ここに</a>見付かります。</p> THE RETRIEVAL CODE public function get_letter_data() { $sql = "SELECT letter.*, qa.qa_question, qa.qa_answer FROM sevengates_letter AS letter JOIN sevengates_qa AS qa ON qa.letter_no = letter.letter_no WHERE letter.letter_no =?"; $mysqli_stmt = $this->mysqli_obj->stmt_init(); $mysqli_stmt->prepare($sql); $mysqli_stmt->bind_param('i', $this->letter_no); $mysqli_stmt->execute(); $meta = $mysqli_stmt->result_metadata(); while ($field = $meta->fetch_field()) { $params[] = &$row[$field->name]; } call_user_func_array(array($mysqli_stmt, 'bind_result'), $params); while ($mysqli_stmt->fetch()) { foreach($row as $key => $val) { $c[$key] = $val; } $prelim_result[] = $c; } foreach ($prelim_result as $arr) { foreach ($arr as $name => $value){ $letter_results[$name] = $value; } } return $letter_results; } WHAT IS RETRIEVED and APPEARS IN THE NEWSLETTER ようこそ! DISCUSSION: Everything after the <h1> element has been omitted. QUESTION: What must I do to get everything after ようそう!to appear? Roddy
  23. Error 500 - Probable Causes

    I have just received a copy of the stock php.ini file that Lunarpages (my web host server) is using. Hopefully, it will lend a clue into what is going on and how to adjust for it. Roddy
  24. Php.ini file?

    You may or may not have access to it depending on the nature of your account. I suggest that you contact your host. If you do not have access to the file, there is a good chance that you can change the setting of interest dynamically. Further, if it is a setting that you wish to use repeatedly, then you should follow Dsonesuk's suggestion below. Another way to discover the location of the file and thus avoid having to contact your host is to run the phpinfo( ) function on your host server. This will tell you everything that you can know about the PHP processor running on your host's server. Roddy p.s. If you find my answer helpful, then hover over the heart, find the trophy, and click. Thanks after the fact, is better than than thanks before it.
  25. Error 500 - Probable Causes

    Dsonesuk: What version of PHP are you using? INGOLME: Please find attached your requested information for the HTTPRequest error code 500 Roddy firefox_network_results.tiff
×