Jump to content

iwato

Members
  • Posts

    1,506
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by iwato

  1. My goal is to use the same page with directives from two different sources (triggers): one from the verification page that is on the server, and one from a form that is situated locally. A receiving $_POST variable on the generator page would not care from which source the request was made. Is it more understandable now? Roddy
  2. BACKGROUND: I have a PHP generator that creates a newsletter from an HTML template with data obtained from a MySQL database. My current plan is to include with the generator an automated mailing function using PHPMailer. I intend to use this generator to consummate to kinds of mailing functions -- mass and individual. The individual mailing: when a user opens an account he automatically receives an automatically generated newsletter with information designed for first users. In this newsletter he has the option of subscribing on a more permanent basis or declining further receipt of future newsletters. TWO TRIGGERS: The code that triggers the mailing of the first newsletter will come from the user and must be automated. The code that triggers a mass mailing to all subscribers must come from me and must be manual. This latter trigger can be resolved easily with a simple link and attached query statement. It is the automated trigger coming directly from the user that is problematic. THE DILEMMA: When the user applies for an account, he receives a verification email with a link to a PHP processor that matches the hash that he received in the email with the one created and inserted into a database when he signed up for the account. It is this PHP processor that must provide the information to the newsletter generator and trigger the new account holder's first mailing of the newsletter. The trigger must be automated. QUESTION: Although it is relatively easy to write Javascript that automatically triggers an HTTPRequest object to the newsletter generator, I am having trouble finding a simple PHP routine that will do the same. Have you any suggestions? Roddy
  3. Thank you, and have a great New Year! Roddy
  4. Could I reword the above statement to read, "When coding (positive) it is not what is coming in that must be sanitized; rather, what is being sent out. When hacking (negative) it is what is going in that counts." Please allow me now to restate my two questions. QUESTION ONE: When would you use the real_escape_string( ) function? QUESTION TWO: When would you use the PHP filter_var( ) WITH sanitization?
  5. Now I am confused. What makes printing an HTML page so very different from processing data? Is it because Javascript cannot run, but in a browser context? Also, why not just sanitize when the data comes in. In this way, you can be sure that whatever goes out will be clean. Roddy
  6. This I do. I am referring to the first receipt of the $_GET superglobal -- at the point where I am likely to take information from the variables contained within and seek to process it before uploading it to the database. Roddy
  7. Merry Christmas to those at W3Schools who maintain tradition no matter their philosophical or theological persuasion. Roddy 🎄
  8. BACKGROUND: It appears that there are few problems in web development that do not have multiple solutions. My problem is to decide which solution best suits my needs. I have a confirmation email that sends a name, hash, and email address via an HTTP REQUEST using the $_GET superglobal to a PHP file that matches the hash with an entry in a newsletter roster table. If the match succeeds the value of the status variable is changed from 0 to 1. Before the hash is sent to the roster table it is sanitized using the MySQLi real_escape_string( ) function. Elsewhere on my website I use the PHP filter_var( ) function with parameter values that vary with the nature of the data being sent. QUESTION ONE: In the above instance which PHP function would be more secure. And, why? QUESTION TWO: In general which function is preferred? And, why? Roddy
  9. Yes, you are right. I simply forgot to upload a block of files whose prefix I had changed on my test server, but failed to upload to my host server. Thanks! I simply could not bear the thought of having to do everything all over again. I feel so relieved. Have a great weekend! Roddy
  10. BACKGROUND: Sometimes I believe that I will never launch my project. The reason for this doubt is clear. Each time that I believe that I have got everything right, I make a small change that i am told will make everything better, and I finish by having to redo much of what I have already done simply to make it work as it did before with the new feature. What keeps me going on the other hand is that I have always somehow been able to overcome each of these sorts of major hurdles. No wonder it has taken me 14 months just to be able to get where I have gotten. DILEMMA: In order to observe the issue that I am having you are requested to follow the steps below. Mind you, the result of the experiment appears to be the same no matter the browser. I have tried it with Chrome, Safari, and Firefox. Step 1: Using the http:// protocol open to the following splash page: http://www.grammarcaptive.com Step 2: Click on the Freeman. This should open to a page with two preceding splash pages Step 3: When the 2nd splash page opens, you should see what appears to be a frame with a series of frames in which each frame is still another set of frames. _______ Step 4: Using the https:// protocol open to the following splash page: https://www.grammarcaptive.com. Step 5: Click on the Freeman. This should open to a page with two preceding splash pages. Step 6: When the 2nd splash page opens, however, the nested sets of frames have disappeared. _______ DISCUSSION: Now, I have made what I believe to be a fairly thorough check for the presence of the https:// prefix on all pages that refer to a link containing Javascript that might influence the behavior of the splash pages in question. I suspect that by having changed the prefix from http:// to https:// that I have, at least for some pages, introduced new code that is no longer compatible with the Javascript code that I am using. My Javascript console tells me that the jQuery variable is missing. Any ideas? Roddy
  11. Thank you for your help. I was finally able to resolve the issue by adding the following code to my httpd.conf file. AddType application/x-httpd-php .php .phtml .html Roddy
  12. OK. I have changed the directives setting from the above to the following: AddType text/html .php AddHandler application/x-httpd-php55 .html .htm but still the desired effect is not achieved, but for the fact that my Javascript fails. Indeed, the purpose of the PHP script is to signal to Javascript to ignore a specific Javascript procedure, not Javascript in its entirety.
  13. So, if I change the phrase AddType application/x-httpd-ea-php56 .php .html to read AddType application/x-httpd-ea-php55 .php .html to better reflect my test server's version of PHP -- namely, PHP 5.5.38 --, then there is some chance that I will be able to achieve a result similar to that of my web host server. Roddy
  14. The following code was inserted into the root folder of my www.grammarcaptive.com site in the form of an .htaccess control file. It was also inserted into my test server in an identical location. Although it appears to work well on the remote server, it fails on the local test server. Only the paths leading up to the sites' root folders appear to be different. THE CODE <IfModule mime_module> AddType application/x-httpd-ea-php56 .php .html </IfModule> REMOTE SERVER PATH public_html/grammarcaptive.com/.htaccess LOCAL TEST SERVER PATH ../../Sites/grammarcaptive.com/.htaccess QUESTION: Could the above path differences be at cause, or might there be an APACHE directive of some sort getting in the way? If so, what directive is it likely to be, and where should I look for it?
  15. You appear to have two choices: 1) Redefine your method as static -- namely, public static function select() {...} 2) Access your method via a Crud object. $crud_obj = new Crud(); $crud_obj->select(...);
  16. iwato

    Thank You!

    I just want to wish everyone a great weekend! If you are wondering why, then have a look at the fruit of your answers to my queries. Roddy
  17. JSG: Sure there is, and please correct me, if I am wrong. Although it is nearly always possible to know what websites an individual has visited or is visiting, once a secure connection has been established it is "Oh, so difficult" to know what the person is viewing or doing on the website. This greatly deters the kind of mass accumulation of data sought by governments and others around the world. Roddy
  18. BACKGROUND: I have an AJAX call that pulls in an HTML file. The file is a template that is populated with variables whose values are obtained from a MySQL database before the template is called. One of the values that I obtain from the database is important to a script associated with the AJAX call. This value should not appear, however, in the browser window when the AJAX call has been completed. Now, I could easily hide the value of this variable with the CSS display property, but would it still be available to the aforementioned script? QUESTION: Is a hidden element still available for processing by other elements and script? Roddy
  19. It might also be the length of the entry. The accordion entries are built with <li> elements. The default nature of a <li> element is that of a block. It may be that whatever is contained in the block exceeds the width of the block. Is autowrap turned on? Have you tried using shorter entries? I do not believe that the number of entries is causing the problem. Roddy
  20. Thank you for your suggestions. The following decidedly works, but I am not sure why. <div style='text-align:center;'> <h1 id='click_listen'>Click and Listen</h1> <!-- The jPlayer div must not be hidden. Keep it at the root of the body element to avoid any such problems. --> <div id="jquery_jplayer_1" class="cp-jplayer"></div> <!-- The container for the interface can go where you want to display it. Show and hide it as you need. --> <div id="cp_container_1" class="cp-container" style='display:inline-block;margin: 0 auto;text-align: center;'> <div class="cp-buffer-holder"> <!-- .cp-gt50 only needed when buffer is > than 50% --> <div class="cp-buffer-1"></div> <div class="cp-buffer-2"></div> </div> <div class="cp-progress-holder"> <!-- .cp-gt50 only needed when progress is > than 50% --> <div class="cp-progress-1"></div> <div class="cp-progress-2"></div> </div> <div class="cp-circle-control"></div> <ul class="cp-controls"> <li><a class="cp-play" tabindex="1">play</a></li> <li><a class="cp-pause" style="display:none;" tabindex="1">pause</a></li> <!-- Needs the inline style here, or jQuery.show() uses display:inline instead of display:block --> </ul> </div><!-- end div#cp_container_1 --> <p style="font-family:'Bradley Hand', cursive;font-size:1.6em;">Did you learn from it?<br />Did you like it?</p> <div id='share'></div> <p style="font-family:'Bradley Hand', cursive;font-size:1.6em;">Now, teach and share it!</p> </div> Is it because the <div> tag into which it is being inserted is itself being treated as text? Roddy
  21. What is inside the click function was supplied by jPlayer. Everything else was written by me and is not yet complete. Surely this is not the source of the centering problem, however. Roddy
  22. BACKGROUND: What I thought would be an easy task through the use of a <div> wrapper has proven very difficult, if not impossible. Whoever built this nifty GUI either knows a lot more than I about positioning and placement, or they built this widget totally oblivious to potential user implementation. Please understand that I have gone through a lot of trouble to get it to work, am loathe to abandon it at such a late stage, but definitely will abandon it, if I cannot learn to place it at my will. DILEMMA and QUESTION: I would very much like to center the audio player displayed on the following page, but cannot seem to accomplish the task. Have you any suggestions short of rebuilding the entire graphical interface pixel by pixel? VIEWING STEPS: Step One: Open to Sender Proxy and click on the link entitled Proxy Link in the bottom-left corner. Step Two: When the page open click on the words Click and Listen. The image that appears is what I would like to center beneath the words Click and Listen. The pages necessary to understand the structural and formatting aspects are provided below: SOURCE PAGES: The Template: http://www.grammarcaptive.com/podcasting/template/template.html You must open the page in source code to make any sense of it. The portion of this page that forms the template begin and ends with the following two <div> tags: Start Tag: <div id='podcast_insert'> End Tag: </section><!-- end section_summary --> The CSS: http://www.grammarcaptive.com/_utilities/lbrary/jPlayer-2.9.2/lib/circle-player/skin/circle.player.css The Javascript: http://www.grammarcaptive.com/_utilities/lbrary/jPlayer-2.9.2/lib/circle-player/js/circle.player.js I offer this Javascript only for the sake of completeness. As a well-formatted jQuery product, the CSS is truly a separate issue. HOST PAGE JAVASCRIPT USED to INITIALIZE the PLAYER <script> $("#click_listen").mouseenter(function() { $(this).css({'cursor':'pointer','color':'#5a4149'}); $(this).click(function(){ $("#cp_container_1").show(); var myCirclePlayer = new CirclePlayer("#jquery_jplayer_1", { m4a: "http://www.jplayer.org/audio/m4a/Miaow-07-Bubble.m4a", oga: "http://www.jplayer.org/audio/ogg/Miaow-07-Bubble.ogg" }, { cssSelectorAncestor: "#cp_container_1", swfPath: "_utilities/library/jPlayer-2.9.2/dist/jplayer/", wmode: "window", keyEnabled: true }); }); }) .mouseout(function() { $(this).css({'cursor':'none','color':'#fff'}); }); </script> Roddy
  23. It appears from the condition of the above if statement that stylesheet is a built-in property of the returned data object. Is this true? Roddy
  24. No CMS. So, likely many bad, but innovative things. This said, I think I get the idea. I need to experiment a little. Roddy
  25. Alright, please allow me to return to your original suggestion. The procedure that i use for creating the Click and listen panels inserted into the podcast host page, is somewhat complex. Step One: I create an HTML file that forms the basic structure of the page. It is minimally formatted, and all styling is either inline or uses a scoped <style> tag. Step Two: I then set the starting and ending points of that portion of the HTML file that I would like to include in my template, read the file using the get_file_contents() method, and extract that portion of the file defined by the starting and ending points. What is read contains the inline CSS and the scoped <style> tag. Step Three: The result is then combined with data obtained from a MySQL data base and inserted into the host page via an AJAX call of HTML data type. As you have intimated, I would prefer to use a CSS style sheet that would allow better manageability of insert, but I do not know where to place it. There are only two <head> elements in the entire procedure. The <head> element of the host page into which the Click and Listen panel is inserted and the <head> element of the HTML page from which only a portion is used in the insert. This latter <head> tag is useless in the page that hosts the insert. It is in the <head> that I am accustomed to placing the <link> tags that contain CSS stylesheets. THE DIFFICULTY: I am troubled by the fact that the insert is introduced into the host page only after the <head> element of the host page has been read by the browser. QUESTION: Will a style sheet already loaded into the host page be applied to new HTML entered via AJAX? Roddy
×
×
  • Create New...