Jump to content

iwato

Members
  • Posts

    1,506
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by iwato

  1. Are you saying then that the object, because it is an object is global in nature, and that, if created outside of the function, the same object can be accessed either in or outside of the function?
  2. Not really. In both cases it is documentation. Although it may be more likely that documentation included with the code is more current than documentation that is external to the code, either could be neglected with regard to an update of the code. Still, there is no sample code, and the implementation of htcacheclear on the UNIX terminal is unclear.
  3. iwato

    Issues comments

    Dsonesuk: I am still a little confused by this statement The condition is true when AJAX is absent, but false when it is present. So, if AJAX is present, ajax_comment.php' will be called, and if AJAX is absent config.php is called. As we do not know what is contained in config.php, it is difficult to know why there would be two different PHP pages to process the same code. Does this make sense to you? Loois: Could you show us config.php? JSG: OK. I appear to understand that sanitization, perhaps not validation, should always take place on the server side. And, in the event that the user has turned Javascript off, one would also want to sanitize on the server-side. What I am unclear about is the nature of the manipulation of the Javascript. Can the user actually rewrite the author's Javascript? Or, is it that the user submits his own Javascript as input data that takes advantage of the Javascript that the author has written?
  4. iwato

    Issues comments

    OK. The advantage of using AJAX is to prevent having to reload the page each time the form is submitted, and the advantage of using PHP is to insure that the submitted data is sanitized and validated. Are implying with this that it is not possible to use Javascript for the purpose of sanitization and validation? If I have understood correctly, AJAX serves only as an intermediary between the form page and the PHP page. In other words, the PHP page should be written, as if the AJAX did not exist, and the AJAX should always refer to the PHP page via the following piece of code $.ajax({ url: 'ajax_comment.php', What is more, the PHP code should only be included in the page, if the following condition is satisfied. !isset( $_SERVER['HTTP_X_REQUESTED_WITH'] ) Thus, it was wrong for Loois to have included the following code at the bottom of his form page include ("jquery.js"); Under the assumption that all of the above is correct, why is the following code not entered at the top of the form page? include ("jquery.js"); My very best, Roddy
  5. Yes. In other words, it is telling me that it is there, but that I am not employing it properly.
  6. iwato

    Issues comments

    So, why use AJAX at all? Since AJAX depends on Javascript being turned on or off, and since this decision is made by the user-client, why not use PHP whose functioning is determined solely by the host-server?
  7. Got it! Security is number one. Roddy
  8. Never mind unless, of course, you know something about array mapping that I do not and would like to teach me. Certainly I am willing to learn. For the moment, I have resolved the problem using the array_combine( ) method. Roddy
  9. iwato

    Issues comments

    OK. Thank you for the correction, Dsonesuk. I have never used AJAX and looked only for what was different from what I use -- namely, PHP. Upon a more careful reading I now see the statement include ("ajax_comment.php"); If I have further understood, you find the following statement to be ill-conceived, if (isset( $_SERVER['HTTP_X_REQUESTED_WITH'] )):include('../config.php'); and give as a reason that the PHP will only be used, if the Javascript succeeds. So, if Loois were to write, if (!isset( $_SERVER['HTTP_X_REQUESTED_WITH'] )):include('../config.php'); would this fix his problem.
  10. I would like to preserve the keys to the associative input array ($varnames) and replace the values with those of $_POST. This function replaces the both the keys and values and returns an index array with the $_POST values. function replace_value($a, $b) { $a = $b; return $a; }; $varnames = array_map(replace_value, $varnames, $_POST); print_r($varnames); Any suggestions? Roddy
  11. iwato

    Issues comments

    There is no action attribute in the following line of code <form id="form" method="post"> You must enter an URL for ajax_comment.php as the value of your action attribute in the above <form> element. <form id="form" method="post" action='pathto/ajax_comment.php'> Replace the word "pathto" with whatever is necessary to connect the document that contains your form with the document that processes your $_POST variable -- namely, ajax_comment.php.
  12. I know well what the page says. What I do not know is how to implement it. There are no sample commands, and what I have tried does not work. $ sudo htcacheclean //Any option written after this fails. $ sudo apachectl htcacheclean //Any option write after this fails. What I obtain from these trials is simply a list of htcacheclean options. The list is similar, but not the same as what are provided in the Apache source document. Still, no sample code. Roddy
  13. It seems that way, does it not? Now, I do not claim to know everything that a web server can know, but I do know that certain kinds of information can be obtained once a connection has been established. Roddy
  14. iwato

    Issues comments

    Please post the contents of the file comments.php. Show us what you have done, what does not work.
  15. iwato

    Issues comments

    <form method="post" name="form_name" id="form_name" action="https://www.w3schools.com/comment.php"> <fieldset> <legend>Title</legend> <p>A brief explanation about what you would like to see entered.</p> <textarea name="comment" form="form_name" maxlength='400' rows="8" placeholder='Character Limit: 400'></textarea> </fieldset> <input type="submit" value="Submit comment"> </form> In addition you must decide what you want to do with the comments and how to process them one they are received via the post ($_POST) method at comment.php. Roddy
  16. I am not there yet. OK. This is what I needed to know. As ever, thank you, for your wonderful help.
  17. Hi Ingolme, I was not clear. I want to know where the superglobal is stored? And, for how long I can use it and its contents after it has been sent. Based upon your response I should probably ask, if there is a way to pass a superglobal in such a way that it is permanently stored, and then accessible from any file with a get_file_contents( ) method. Roddy
  18. QUESTION: When a variable is passed via a super global from one file to another what happens to the variable that is passed? Where is it stored? What is its half-life? Roddy
  19. BACKGROUND: I have recently discovered a file on my test server that opens to the wrong file. Not only does this same phenomenon appear in different browsers, but clearing the browsers' cache and rebooting the computer does not help. It has been suggested by two of my colleagues that the problem lies with the Apache cache. Although I have discovered something called htcacheclean on the Apache website, nowhere have I been able to find instructions about how to implement this instruction properly. i want simply to clean one URL from the cache, but am baffled about how to implement what I have already learned. QUESTION ONE: Is it not possible to run htcacheclean from the UNIX terminal? QUESTION ONE: Whether it is possible or not, how does one go about doing it? Source: htcacheclean
  20. Based upon your suggestion JSG I do not believe that you have understood the problem. I have no trouble accessing files that are not linked to my site's index page. If I have understood my web host properly correctly, they are claiming simply that the files just described are not visible to others.
  21. I have finally completed my other project and am ready to return to this one. In the interim I was able to discuss the matter with my web host and was told the following: The Apache server settings permit only those files that are linked to the my site's index page -- either directly or indirectly through other pages that are linked to the index page -- are visible. This is to say that all unlinked pages result in the 404 error code. This suggests that I can place a file on my site that processes $_POST variables that I send to it from my local server without fear of manipulation from third parties. Please allow me to state clearly my intention and then comment on it with reflection on our previous discussion and any new security issues that come to mind. 1) I have created a form that on my local server that draws data from my local server. 2) This data will be sent to a page on my web host via a $_POST variable. 3) The page to which it is sent will process the received $_POST variable and send the results to my accounts database via SMTP. 4) Another page on my web host will take a portion of the same data from the database via SMTP, complete the template, and distributes the completed template via email to my websites subscribers. Roddy
  22. I do not use a CMS, but am still a little unclear about what you mean when you write "and have your server send the correct content-type type header of application/rss+xml" Also, I do not know, if I have asked this question before, but certainly I am still in doubt. The use of RSS and XML terminology is often undefined or loosely applied, and it has created enormous confusion for me. So, please be further patient. QUESTION: Where does the XML/RSS file containing the <channel> and <item> elements go? 1) Anywhere, so long as the file's elements point to the proper folders and files. 2) In the folder with the items that are the content of the RSS feed. 3) Any of several preferred locations, and it is good practice, but not necessary that the file and the content to which its elements point are in the same folder. Roddy
  23. I have never looked for the presence of an RSS feed in my browser window before, but any form of additional, positive, free advertisement cannot hurt. Still, I am not sure that you have answered my question. So, please let me try again. If the <link> element that you just described were present on my webpage and the user typed the following in his browser search window http://www.grammarcaptive.com/feed the feed link and, of course, the path to it would be revealed automatically. Is this true?
  24. I am not very fond of the link that you provided, as I find it both confusing and incomplete. It is, however, where I began my own investigation several weeks ago. Since then, I have been using what appears to me to be a better resource. OK. I believe that I have finally sorted the elements out. 1) <link> (channel) - Points to the folder containing the items targeted in each <item> element. 2a) <link> (item) and <emclosure> (item - Point to the most recent feed <item>, or alternatively 2b) <link> (item) - Points to the most recent feed item, and <enclosure> (item) points to a media file that accompanies the feed item. 3) <link> (image) - Points to the webpage that provides a description of the channel as well as access to the individual items. 4) <url> (image) - Points to the image itself. 4) <source> (item) - Points to the xml file that contains the actual feed -- namely, itself. During my research I read that feeds for a website are typically found by entering the website's domain name followed by a feed folder. Surely this path is not automatically generated. Surely, this folder must be created by the webpage's host. What exactly goes into this folder. Is it the xml feed page, the podcasts, or both? Are you familiar with this "common" practice? Roddy
×
×
  • Create New...