Jump to content

phppup

Members
  • Posts

    862
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by phppup

  1. I'm fiddling around on a W3 page in order to achieve a better understanding of current JS practices. Goal: if ANY of several paragraphs are clicked, send an alert message. //var a = document.querySelectorAll("p").addEventListener('click', fn); function fn(){ //var i;for (i = 0; i < a.length; i++) { //alert(this.innerHTML); //} alert(222); } I've managed to achieve success with querySelector to push out the alert for paragraph #1, but the querySelectorAll implementation seems to be causing me trouble. Insight and solutions to approaching this properly, please.
  2. Any other people have insight or opinions on this?
  3. I'm creating a form that will contain between 12 and 20 fields. After submitting and inserting into a db, a user can review a specific record (that uses SELECT * to repopulate the form's fields). At this point, data can be changed and empty fields can be completed. Here, the table will be updated. The presumably "easy way" would be to now UPDATE the entire record (and I'm sure that would work), but it occurs to me, that only fields that have been changed actually need to be updated. Is it more sensible and "proper" to only update fields that have changed? Or is it an unnecessary challenge? Is the overhead that is being reduced really worth the effort? Or is the overhead incurred by comparing values negating the savings? What is the best approach? I've seen articles indicating that JavaScript should do the comparison and then pass along the effected data. Any thoughts or suggestions? Thanks
  4. I have my PHP spitting out an HTML table that includes a button for editing at the end of each row echo "<td><form action='' method='POST' <button type='submit' name='startEdit' value=".$row['id']." onclick='myFunction();'>Edit</button></form></td>"; I want a confirmation to pop up before advancement to the editing form page function myFunction() { if(!confirm('Do you really want to do this?')) { return false; } } Obviously, if TRUE is the result, I want the page to advance, and for FALSE, I want the page to remain. I have not been able to achieve the desired result either by changing the ACTION to action="xyz.php" OR with JS window.location.href = 'http://www.w3schools.com'; Please tell me what I am missing?
  5. So this is on the CLIENT side? And therefore has nothing to do with server settings? [I guess I read too quickly. No wonder this is such an unreliable method... LOL]
  6. I did not, but I have no issues with viewing the <img src> when written directly into the HTML. Does the remote content setting handle the capability for exactly what I'm trying to accomplish? [of course it does, right... LOL]
  7. I'm trying to track an email message by adding an image to an email. (a very rough attempt to just get a result) <img alt="" src="http://yourwebsite.com/record.php width="1" height="1" border="0" /> My understanding being that when the email is opened, the script will be called, and then send the image to the email. However, the code seems to be ineffective in passing the image. My desktop email shows no image, and my cellphone image shows an error/no image symbol I've tried code as simple as header("Content-Type: image/gif"); readfile("blank.gif"); and as complex as //Full URI to the image $graphic_http = 'http://yourwebsite.com/blank.gif'; //Get the filesize of the image for headers $filesize = filesize( 'blank.gif' ); //Now actually output the image requested (intentionally disregarding if the database was affected) header( 'Pragma: public' ); header( 'Expires: 0' ); header( 'Cache-Control: must-revalidate, post-check=0, pre-check=0' ); header( 'Cache-Control: private',false ); header( 'Content-Disposition: attachment; filename="blank.gif"' ); header( 'Content-Transfer-Encoding: binary' ); header( 'Content-Length: '.$filesize ); readfile( $graphic_http ); with no success. What am I missing? PS: I've tried it at the top and the bottom (where I would want it) of my email message, but no joy.
  8. @maxxd I've found allot of ambiguity in the vague endorsements for being able to achieve a reliable count in this manner. But the "unreliable" crowd seems more consistent. That's why I created the post here for an honest dialogue. I, like you, considered the possibility that certain email providers might receive special treatment. However, that reality would strongly lean towards the topic of collusion and violations of Federal anti-trust statutes that would probably temper that behavior. Then again, I'm not gonna say it can't be happening. [But do you REALLY think a company would act unlawfully on the pristine roads of the internet highway?? *scratching my head*]
  9. @maxxd but how do THEY do it? If they are using a method that I can use in PHP, then I would assume they have all the same obstacles.
  10. I want to be able to distinguish between emails that the recipient ignored and emails that were opened. I've looked at code with a header item Disposition-Notification-To but indications are that this is easily turned off and therefore an unreliable choice. Other alternatives state that placing a .gif image in the email's body is effective. But some indicate that it, too, is often blocked by major email providers. Either way,I have not found a working example to test for myself. Additionally, I plan to use this primarily when sending an email to an address that is NOT maintained by Google or Yahoo etc. More likely to momandpop.com type domains (that may have a GoDaddy-ish hosting plan). Any helpful information would be great.
  11. I think there are methods available.
  12. I want to send an email via php (no problem) Now I want to get a confirmation when the email is opened. I've seen a few bits of code but nothing that seems very well defined. Any guidance or direction to valuable explanations or links would be great. Thanks.
  13. @ginerjm OK, yes. Not sure if it will "error" but it was a quick example of my thought process. Now I understand that you were pointing out my loopiness.
  14. @kicken Thanks for the help, but I wasn't as clear as I should have been. I'm not interested in the page loading speeds (at this time) I am only trying to determine how long each user remained on the specific page before advancing. This would let me know if a question was too complicated, or maybe randomly answered. Hypothetically, it would take more than 3 seconds to write 500 words versus cut & pasting. Likewise, if it took 20 minutes to add 3 + 3, then maybe you were distracted from the webpage, etc. Or, maybe my design or layout is not easy enough to follow.
  15. @ginerjm Care to explain why?
  16. I want to assemble a multi-page questionnaire/quiz whereby submitting page 1 will lead to page 2 etc. I have locked in the time that each page loads by using unset($_SESSION['start']); if($_SESSION['start'] == ""){ $_SESSION['start'] = time(); } at the top of each page However, I am having difficulty in getting the time at submission. I realize I can simply use the start time of page 2 as the submission time for page 1, but that would technically be incorrect, right? In actuality, a page would load (and the time recorded). A person would submit after any amount of expended time (and that would be recorded) Then there would be a gap before the next page loaded. How can I effectively obtain these events? Or am I unnecessarily overthinking this?
  17. @gizmola Thanks. And yes. Again, I haven't started to write the actual code, but that was my thought process (especially since so many of the tags fit such a similar format. I guess I've actually come quite a way (thanks to those that have helped me HERE). *i wonder if it's time to change my username???!?*
  18. @cyberRobotThanks for removing a heavy burden. *not sure what emoji would be appropriate* LOL
  19. OK, yes. @cyberRobotThat is in the realm of what I was planning
  20. I haven't begun to write the actual code yet. Only began to formulate the concept. How would echo implode($meta); work?
  21. @cyberRobot Yes, I do consider the description tag as one of the "usual." I discovered a meta for security and refresh that I am unfamiliar with and uncertain about. As for you saying Yes, that was me from way back when. I suppose I owe an apology to everyone that I effected. (although I never got too crazy and NEVER used irrelevant terms)
  22. @gizmola With all due respect, I don't think google is the ONLY search engine on earth. (Sorry, not a fan of theirs, but still fond of you. LOL) Are there any less popular meta tags that I should use (beyond the usual list) or recommended settings to be aware of?
  23. I'm not sure whether I'm becoming overindulgent or a real developer, so please advise me. I have several webpages for a new website. I am well acquainted with them and their content. As I began planning to publish these pages, I realized I could probably utilize an array to include meta data for bots and search engines. My thinking was something like: for ($I=0; $I<count($meta); $I++){ if ($page.I){ echo $meta[I] } } I'm concerned with the effectiveness of doing this. Will bots and crawlers see it as legitimate and valid the same as if each page had "hand written" meta data? Or will it flag it as illegitimate or miss it, thereby hurting the pages placement in search results? Not much more to provide since I'm asking the question BEFORE attempting the code. Thanks
  24. Get back to the withing script. Add the $gname association in the SAME loop and create $sql_2 to ADD a token. Don't forget to also call $sql_2 Gotta go for now.
  25. If the second UPDATE is to ADD, then it CANNOT be $sql_1 ALSO because you already have a variable of $sql_1. So, perhaps that should be variable $sql_add throughout the second UPDATE. Revert to the code that was working with the subtraction and then work out the kinks for the addition.
×
×
  • 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.