Jump to content

iwato

Members
  • Content Count

    1,506
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by iwato

  1. Thank you, Synook, for both the references and useful overview.I still have yet to understand why the Resource id always begins at 3, however. The same phenomenon occurs no matter the file or PHP script. Always, the first file opened using the fopen() function is labeled Resource id #3. Each subsequently opened file within the same PHP script is named incrementally one digit higher.Perhaps it has something to do with the way PHP is installed in my webserver. Could it be, for example, that each time PHP is initialized it creates two resources of which I am not aware?Roddy
  2. QUESTION: Does the return value of the fopen( ) function differ from platform to platform? I was expecting something entirely different from the output indicated below. Not only does the counting begin at some value other than one, but nothing is said about the content of the file.I am working in a MacOS 10.5 environment. <?php $file1 = fopen("../../../images/projectEmblem.png", "rb"); echo $file1 . "<br />"; $file2 = fopen("../../../forms/checkBox.html", "r"); echo $file2 . "<br />"; $file3 = fopen("../../date_function/dateFunctions.php", "r"); echo $file3;?> When this
  3. Since the div is the container for what is being dragged around is there some reason why you cannot set the dimension of the div tag? Say,<style type="text/css">div.dragable {max-height: 5em;max-width: 20em;}</style><div class="draggable">Roddy
  4. iwato

    A Problem of Scope?

    Yes, your suggested modification worked.I am slowly learning that PHP is not ActionScript.Great job! Thanks.Roddy
  5. iwato

    A Problem of Scope?

    Please consider the following two blocks of independently run code and explain why the first block works and the second does not.BLOCK ONE <?php $selectedCountry = $_GET['countrylist']; $selectedCities = $_GET['citylist']; $numberOfSelectedCities = count($selectedCities); echo $selectedCities[1];?> BLOCK TWO <?php $selectedCountry = $_GET['countrylist']; $selectedCities = $_GET['citylist']; $numberOfSelectedCities = count($selectedCities); function writeCities() { echo $selectedCities[1]; } writeCities();?> For the second block of code PHP responds with an error telling me
  6. Is it not because because you are concatenating string literals and variables in both instances?Frankly I see no difference between the two examples that you provide. In both cases what is contained in quotation marks becomes a fixed part of the HTML document, and what is preceded by a dollar sign is a PHP variable whose value changes according to some statement written in PHP.Roddy
  7. Yes, this is all it took! Great help, Synook!I was beginning to wonder, if I would have to write some sort of regular expression to do the job. Then too, I kept thinking that the developers of PHP would have made things simpler.Many thanks!Roddy
  8. QUESTION: How do you parse the $_GET string of a Form element containing <input> tags with the same name attribute, but different value attributes?BACKGROUND: The following code creates a $_GET string with two name attributes called "country" and "other". Although I am able to write code that captures the last value of the "country" name attribute and the only value of the "other" name attribute, I am unable to capture multiple values of the "country" name attribute when more than one checkbox is checked. <form action="checkBox.php" method="get"> <input type="checkbox" name
  9. iwato

    Nested Php Commands

    The time will surely come for both.Many thanks!
  10. iwato

    Nested Php Commands

    Thanks, I have just looked at HEREDOC, but it does not solve the problem of quick visual recognition of nested-like PHP constructs similar to the example provided by boen_robot that I was able to make work, by the way: The GENA Project
  11. iwato

    Nested Php Commands

    This was extremely helpful and easily applied. That PHP code can be stopped and restarted is both neat and cumbersome: neat, because it is easy to apply; and cumbersome, because it is difficult to read. In any case, this appears to be the nature of the beast, and I must make do.Many thanks. I am now off to a much better start.Roddy
  12. iwato

    Nested Php Commands

    I know that the SWITCH command is probably not recommended in PHP for the same reason that it is not recommended in Javascript; nevertheless, by working with the SWITCH command I can resolve a more fundamental problem that I am having -- namely, nested PHP commands. So, please bear with me.How does one rewrite the following code so that it works?<?PHP switch ($variable) { case 'A' : <p>blah, blah, blah</p> <?PHP doTheA_Thing; ?>; break; case 'B' : <p>blah, blah, blah</p>; <?PHP doTheB_Thing; ?>; break; cas
  13. QUESTION ONE: Is it possible for the author of a webpage to dictate to the viewer whether a new page opens in a new tab or window?QUESTION TWO: Is there some way to detect how a viewer opens a hyperlinked page -- in new tab, the same tab, or a different window?BACKGROUND: I have designed my pages in a way that distinguishes between pages contained within the same domain and those that are not. As a result of this design, I want to be able to force my users to open hyperlinked pages that are not in my domain in either a new window or new tab. Within the industry new tabs are generally pref
  14. QUESTION ONE: Is it possible for the author of a webpage to dictate to the viewer whether a new page opens in a new tab or window?QUESTION TWO: Is there some way to detect how a viewer opens a hyperlinked page -- in new tab, the same tab, or a different window?BACKGROUND: I have designed my pages in a way that distinguishes between pages contained within the same domain and those that are not. As a result of this design, I want to be able to force my users to open hyperlinked pages that are not in my domain in either a new window or new tab. Within the industry new tabs are generally pref
  15. This would make me a "bad programmer", and I am a little embarrassed. I would like to think of myself as a "good" beginner.A while back I created a mini program that sniffs only for the browsers and minimum versions for which I test my webpages -- not because I do not agree with the above statement; rather, because I do not know what features my browsers require or do not require to run my pages.Although I do not deny entry to my pages with different browsers, I do slow entry and encourage my viewers to use the browsers for which my pages were tested. Of course, I am not running a commercial
  16. No problem, and the rest was just as easy with your terrific explanations! I am now confident that I can pass information from page to page -- well, at least until I stumble on my next unknown. Many thanks, Ingolme.Roddy
  17. I am happy to learn that the world has not given up on client-side interactivity in same way that I have given up on Microsoft's Internet Explorer, but are you suggesting that recent versions of Safari and Opera do not acknowledge DOM storage?I can encourage my viewers to avoid Microsoft, but to tell them that the only browser they can use is Firefox would likely be demanding too much.Roddy
  18. Thank you for responding, Ingolme.I tried what you suggested, but ran into difficulty.1) If I assign as page.html the previous page, the next page does not read the code.2) If I assign as page.html the next page, the code is read by the next page, but the previous page never appears.My objective requires that both pages, the previous page and the next page, can be viewed.Also, I do not understand the meaning of the expression w(1) in the statement qS = w(1).split('&'). Surely, the brackets refer to the element of an array called w, but what does it indicate when you add the expression (1
  19. QUESTION ONE: Is there a standard method for passing variable values from one-page to the next in a client-side environment?QUESTION TWO: If so, what is it?QUESTION THREE: Can more that one variable value be passed at the same time?Roddy
  20. iwato

    The Exec Method

    This is easily understood and correct. Thanks. This is also easily understood, but will take additional code to correct. I will make an effort. Thanks, again. Even before I wrote, I saw this as a potential problem and tried to convert my recovered match with the String() method. As there were other errors, however, it made no difference. Thank you for confirming still another probable source of error. You have been a great help! What would W3Schools be worth, if it were not for people like you? A very special person. Many thanks!Roddy
  21. The following code snippet fails, and I cannot understand why. The purpose of the code is to match the filename described by the RegExp called fileName against the URL defined by docURL. If a match is found it is supposed to alert the value of the matched filename. <script type="text/javascript">function matchFilename() { var docURL = location.href; var fileName = new RegExp("js_filenameCapture.html"); var matchedName = fileName.exec(docURL); if (matchedName == fileName) { alert(matchedName); }}matchFilename();</script> Can you discover what is wrong?
  22. Thank you for responding, justsomeguy. You were correct. The script window.location.href returns the entire URL. As a result, I looked for a different way of identifying the file uniquely that would be independent of the files relative or absolute location. I decided on the document.title property. Well, at least, for the moment, as I have stumbled on a new problem that I will post as another topic.Thanks.Roddy
  23. QUESTION: The following code is intended to discover the presence or absence of the document "functionality.html". If the document is discovered the jQuery statement $(this).getBrowserInformation(); is not suppose to run. If the page is absent the statement $(this).getBrowserInformation(); is suppose to run.What happens is that the statement $(this).getBrowserInformation(); always runs. Can you suggest the source of failure and a possible correction? <script type="text/javascript"> $(document).ready(function() { function optionalScript() { var winloc = window.location.href; if
  24. This is my posting error. Please accept my apology for the confusion. Unfortunately not. What follows is what I finally settled for. Please notice the complete absence of HTML code. Does the inability of the citation object to accept HTML code not probably lie in how the html key in the state0 object is defined?function citationPrompt() { var pageTitle = document.title; var citationDate = new Date(); var pageReference = this.location.href; var citation = new Object(); citation = {pageCitation: 'Hashimori Iwato. 2000. Imagine: Bridging Japan\'s Historical Gap. ' + pageTitle + '. <' + pag
  25. QUESTION: Can you point me toward likely sources of error in the 1st subset of code?CODE DESCRIPTION: Please find below a single troublesome block of code and two subsets of code extracted from the original troublesome block. The first subset is identical with a portion of the code found in the original block and is unworkable. The second subset of code is nearly identical with a portion of the original code and works. These two subsets of the original code are provided to help you focus on the true source of my difficulty.The PROBLEM: The variable citation is a reference for an Object w
×
×
  • Create New...