Jump to content

cyberRobot

Moderators
  • Posts

    3,145
  • Joined

  • Last visited

  • Days Won

    37

Everything posted by cyberRobot

  1. Note that the mail() function returns true/false to indicate whether the message was accepted for delivery. If you haven't already, you'll want to check what the function is returning. It should be noted, however, that a true value doesn't mean the message was actually delivered. More information about mail() can be found here: https://www.php.net/manual/en/function.mail.php Also, it may help if enable all PHP errors/warnings to be shown. This can be accomplished by adding the code below to your PHP. Be sure to remove the code when you are done with the debugging process. <?php //REPORT ALL PHP ERRORS error_reporting(E_ALL); ini_set('display_errors', 1); ?>
  2. You should be able to temporarily add it anywhere in your PHP code. Note that you're only adding it for "debugging" purposes. It would be removed once you know what the value contains. More information about the function can be found here: https://www.php.net/manual/en/function.ini-get.php
  3. As ginerjm mentioned, you'll want to avoid letting the user supply the From address. Partly because your mail server isn't going to be authorized to send mail on behalf of email services like Gmail, Yahoo, etc. If you're interested in learning more, you could look up Email Spoofing. Side note: PHP has a built-in validator for email addresses. See the first example here: https://www.php.net/manual/en/filter.examples.validation.php
  4. I would switch to a multidimensional associative array for your data. For example, you could have something like this <?php $systems = array( array('ip'=>'192.168.9.254', 'name'=>'Item1'), array('ip'=>'192.168.9.205', 'name'=>'Item2'), //...remaining systems ); ?> That way all your data is in the same place. Then your loop could use the values like this: <?php foreach ($systems as $currSystem) { echo $currSystem['ip']; echo $currSystem['name']; } ?>
  5. The error is caused by the missing semi-colons after the lines defining $username and $age.
  6. Here's some more information about why it's not really used anymore: https://developers.google.com/search/blog/2009/09/google-does-not-use-keywords-meta-tag As for the limit, I'm not seeing anything here: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta/name Perhaps search engines imposed their own limits to avoid keyword stuffing.
  7. Did you try using the complete address, including the protocol? header("Location: http://www.rowledgecricketclub.com/"); Have you tried enabling all PHP errors/warnings? This would go at near the top of your PHP script, within the PHP tags. //REPORT ALL PHP ERRORS error_reporting(E_ALL); ini_set('display_errors', 1); Be sure to remove the above debugging code when you're done testing.
  8. Looking at the screenshot and your code, it seems like the following variable is the one you will use to determine which of the 3 images to display. $checkSqlRow["LEGIT"] Your screenshot suggests this variable will contain one of the following values: weet nie nee ja One option would be to test for those values in an if / elseif statements to determine which image to display. For example, if the green image is to be displayed for "ja" and red for "nee", you could do something like this: <?php $checkSqlRow["LEGIT"] = strtolower($checkSqlRow["LEGIT"]); //make sure the value is lower case before testing if($checkSqlRow["LEGIT"] == 'ja') { echo '<img src="green.gif">'; } elseif($checkSqlRow["LEGIT"] == 'nee') { echo '<img src="red.gif">'; } elseif($checkSqlRow["LEGIT"] == 'weet nie') { echo '<img src="yellow.gif">'; } ?> Note that the image names (and the path) will need to be adjusted to whatever you are using.
  9. Note that the original post was made a little over a year ago. Hopefully things have improved in Facebook to where adding the URL is all that needs to be done. However, it wasn't always that simple. Many times adding the URL was enough. Other times, we needed to resort to adding special meta tags to a page (or use the Facebook debugger) to hopefully get Facebook to show the desired content.
  10. Where are you stuck? Do you have something created to respond to the button click? If so, what does that code look like? It might also help to see the button related code to get a better idea of what you are trying to accomplish.
  11. If you haven't already, you might find what you need through a search engine like Google. I wouldn't be surprised if there's already a WordPress plug-in to help. https://www.google.com/search?q=wordpress+find+posts+without+thumbnails
  12. Have you considered using a CSS grid layout? A quick example can be found here: https://css-tricks.com/how-do-you-make-a-layout-with-pictures-down-one-side-of-a-page-matched-up-with-paragraphs-on-the-other-side/ A more in-depth description of grid layouts can be found here: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Grid_Layout/Basic_Concepts_of_Grid_Layout Side note: the <center> tag mentioned in an earlier post should be avoided since it has been deprecated (https://developer.mozilla.org/en-US/docs/Web/HTML/Element/center). CSS is usually the way to go when changing how something visually appears on the page.
  13. I switched from Perl to PHP in 2001. Of course, I keep forgetting it's been that long.
  14. The PHP manual is great place to learn how things work in PHP. Especially, if you have specific questions about how a built-in PHP function works. The manual can be found here: https://www.php.net/manual/ When it comes to learning WordPress, and it's built-in features, their developer documentation can be useful. https://codex.wordpress.org/Developer_Documentation At times, the above resources can be overwhelming (and potentially underwhelming). That's where I usually turn to Google and this forum.
  15. For future reference, if you're not interested in switching editors, you could also run your HTML code through W3C's Markup Validation form here: https://validator.w3.org/ Also note that you may want to review the documentation for the <label> tag. You'll either want to have the <label> tag surround both the label and the input field. If it's not around both, you'll need to use the "for" attribute to connect the <label> tag to the corresponding input's "id" attribute. More information can be found here: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/label There's an easy way to test most <label> tags to make sure they're working. If you have a label and a text input, for example, clicking the label will put the text prompt (aka flashing cursor) in the corresponding input field.
  16. So...where are you stuck? Do you have a process for converting the XML data into something that PHP can loop through? If not, you may want to try PHP's SimpleXML extension. More information can be found here: https://www.php.net/manual/en/book.simplexml.php As for the human-readable headings, you could try looping through the "Entity" elements, looking for the one where the "id" is equal to "1". Then go on to process and output the remaining "Entity" elements. If you have control over the XML code, it might be better to modify things so the headers are stored using unique tags. That way you can just grab them without needing to loop through all the "Entity" elements.
  17. If I'm reading everything correct, the "create" script is under todolist_demo > public_html > todo. The "create" script isn't able to find your db.php because the following line only goes up one level. include('../db.php'); Basically, you're telling "create" that db.php is in your public_html folder. You either need to use "../../db.php". Or I would actually recommend switching that line so it starts at the document root. I'm guessing "public_html" is your root folder. If that's the case, you could try the following: include $_SERVER['DOCUMENT_ROOT'] . '/../db.php';
  18. Good luck and welcome!
  19. In case you have control over how $matches is formatted, you could make this easier on yourself by changing the array to something like this: Array ( [0] => Array ( [sku] => 234567 [price] => $33.00 ) [1] => Array ( [sku] => 999888 [price] => $82.44 ) )
  20. You'll want to switch to PDO or MySQLi for working with the database. The mysql_ functions were removed from PHP in version 7.0. More information can be found in the warning box in the PHP manual here: https://www.php.net/manual/en/function.mysql-connect.php
  21. You could use a loop. For example, $mcptitles = array("Volvo", "BMW", "Toyota"); foreach($mcptitles as $mcptitle) { //your existing code here... } Note that I changed the name of variable that holds the array. That way it should hopefully work with your existing code. Also note that I didn't review your code since it sounds like it's working.
  22. I'm not sure why the first URL isn't working. I built a quick test script and that address worked fine for me. I even tried adding the call real_escape_string(), which I thought might be modifying the URL, but everything worked fine. The second "www.google.com" address didn't work for me. However, it worked fine once I added the protocol: https://www.google.com Side note: real_escape_string() is only designed to escape input for use in database queries. If you're looking to escape text for outputting to the screen, you'll want to look into htmlspecialchars() and htmlentities().
  23. When clicking one of the links, does the URL show the correct ID? If so, then the provided code is working fine. As Barand mentioned, we would need to see the code that processes the clicked ID to display the page. Hiding the ID from the URL will prevent people from doing things like bookmarking (or linking) to the pages being generated by the script. So I wouldn't recommend going this route.
  24. Either way works. Once the exit language construct executes, the script stops. It won't do anything with that next if construct when the "user" SESSION variable isn't set. So using else, in this case, is unnecessary. More information about how exit works can be found here: https://www.php.net/manual/en/function.exit.php With that said, if using "else" makes more sense to you...you might consider "elseif" if(!isset($_SESSION['user'])) { exit; } elseif($_SESSION['user'] !== 'SiteOwner') { exit; } And when you get to the stage of blocking multiple user types, you could potentially do something like this: if(!isset($_SESSION['user'])) { exit; } elseif(in_array($_SESSION['user'], array('SiteOwner', 'SiteAdmin'))) { exit; } Note that the above code is untested.
  25. Have you reviewed the information provided by Facebook here: https://developers.facebook.com/docs/sharing/webmasters/ Note that it looks like they have a debugging tool that you can use, under the Testing Your Markup section.
×
×
  • 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.