Jump to content

All Activity

This stream auto-updates     

  1. Today
  2. From PHP to JavaScript with Node.js

    Hi! I'm Vincent from Matters. I am transitioning from PHP to JavaScript. I wanted to give back to the community so I wrote an article about it: https://blog.matters.tech/migrating-from-php-to-javascript-with-node-js-155534498b58 I hope it will be useful to some! Feedback warmly welcome https://twitter.com/cold_lestat
  3. preg_replace explanation

    Thank you so much - I understand it now after finally putting all the pieces together. I also figured out (from the link you provided) that the pattern string has to be enclosed by a delimiter, thus the two "/". Then the ending "i" mean case-insensitive alpha match. Just for anyone else that reads this post... It looks to me like someone could specialize just in regex coding! Thanks again.
  4. href="?value = ..."

    It's fine to use that style to refer to the current page. PHP's magic constants wouldn't help though, there's not one that refers to the current URL. You can build the URL from the $_SERVER array, but it's not necessary if you're just linking to the current page.
  5. Interlacing PHP and HTML without echo Statements

    The problem with using echo statements is that code editors will not highlight the HTML syntax. If you're building a template file, you usually have large amounts of HTML with small amounts of PHP. I personally do not like the BASIC style syntax even for templates. When you use curly braces, most code editors will show you where the current brace ends and allow you to show or hide the block of code. With proper formatting and indentation the code becomes easier to read. <?php if(isset($_GET['edit'])) { ?> <button type="submit" name="update">update</button> <?php } else { ?> <button type="submit" name="save">save</button> <?php } ?>
  6. href="?value = ..."

    Based on the aforesaid, it appears appears to be a dangerous short-cut. Would it be better to write the query, say with a PHP magical constant?
  7. Yesterday
  8. About FORMSPREE.

    Hello guys i recently used formspree to html form . To be more specified i used : <form action="https://formspree.io/your@email.com"method="POST"> This method worked fine on my html.Also asked for confirmation by email first! But i sent also via my mobile, asking me again confirmation. So should i have to confirm every new ip formspree detects or everytime someone applys a form?can i do anything on that?
  9. href="?value = ..."

    Yes! because the chances of it plucking any url or actually landing on a page called ?edit=whatever is pretty substantial.
  10. href="?value = ..."

    Just to clarify, if the link is a query string only and does not contain the rest of the URL, it uses the current URL of the page with the new query string.
  11. The CodexWorld DB Class

    It should be, it's kind of lazy to leave it out. It should be listed along with the visibility. They don't need to give it a value in that list, they can just specify the visibility.
  12. how to hide text in image using php mysql(file upload)

    Are you talking about steganography?
  13. preg_replace explanation

    If you want to understand the pattern syntax, check here: http://php.net/manual/en/pcre.pattern.php The pattern looks for one or more word characters, then a space, then one or more digits, then a comma and a space, then one or more digits. Each of those sub-patterns is captured because they have parentheses around them. It's not used in the replacement. This example is just to illustrate how you refer to a sub-pattern when you want to output a number after it. Because the replacement pattern has no spaces in it, and the spaces aren't part of what was captured.
  14. Multilingual Support

    Their content changes pretty frequently, I think that trying to keep up with multiple languages might get a bit expensive. There's always something like Google Translate to try and translate to a different language though.
  15. href="?value = ..."

    It doesn't have a plain reading. You use that question mark because it is a query string. From https://www.freeformatter.com/url-parser-query-string-splitter.html What's the 'query string' in a URL? The query contains extra information that is usually in the key-pair format. Each pair is usually separated by an ampersand & character. It follows the ? character. Examples: http://www.foo.bar/image.jpg?height=150&width=100 https://www.secured.com:443/resource.html?id=6e8bc430-9c3a-11d9-9669-0800200c9a66#some-heade
  16. href="?value = ..."

    it will reload the page with querystring '?edit=whatever' then php will read this using $_GET['edit']
  17. href="?value = ..."

    I recently stumbled on still another piece of code to which I am not accustomed <a href="?edit=<?php echo $row['obs']; ?>" onclick="return confirm('sure to edit !'); " >edit</a> How does one read the phrase ?edit= in plain English? Roddy
  18. Posting comments into a Mysql database?

    So what's your idea of coding a comment section? Before we can help you and eventually give you some code examples you need to show us some code too, we can't just give you the code without you doing something first because this way you won't learn to do it by yourself.
  19. Interlacing PHP and HTML without echo Statements

    If you are doing such coding use the : form and not { }, it will be much easier to understand the code when you mix them. <?php if(condition): ?> Html here <?php else: ?> Html here <?php endif; ?>
  20. Interlacing PHP and HTML without echo Statements

    Echo or escaping and entering by opening/closing php, are both valid, but i think separating php from html is much cleaner as you have it.
  21. Please consider the following two sets of code. Are they not identical in their functionality? BACKGROUND: I am troubled by the following set of code, for it intertwines PHP and HTML in a way that, for me, is neither intuitive, nor reasonable based on my limited knowledge of how PHP and HTML work. This said, it appears to work. <?php if(isset($_GET['edit'])) { ?> <button type="submit" name="update">update</button> <?php } else { ?> <button type="submit" name="save">save</button> <?php } ?> ANALYSIS: Had I written the code I would have felt compelled to enter the <button> elements as part of PHP echo statements. QUESTION: Is this proper coding technique? Roddy
  22. XML schema "all" element example is wrong

    Oh, I somehow found link to this forum but failed to notice their report error link. Reported. Thank you for your help.
  23. XML schema "all" element example is wrong

    Unfortunately this site has no connection with the administrators of w3shools.com, posting this error here, won't receive any attention to fix this error, but I suggest you go to 'About' page on W3schools.com then at bottom of page, click report error link.
  24. Hi all, please pardon me if i post to wrong section (it took me 3 days to even gain access this site). In your xsd tutorial, the Example 2 description is plain wrong, and it is confusing people. The faulty page is here: https://www.w3schools.com/xml/el_all.asp The error must be there for a long time, it even has its own post on stackoverflow https://stackoverflow.com/questions/5677154/how-do-i-make-items-optional-in-xsall Quote: "The example above indicates that the "firstname" and the "lastname" elements can appear in any order and each element CAN appear zero or one time!" To allow each subelement to be missing, the minOccurs attribute must be put to the subelements, not the xs:all itself. Please fix the embarassing error. :-)
  25. XML is text based data storage, it can be viewed just as well in editor such as Notepad++ properly indented and formatted. XML specific editors can do the same and much more, including importing data as xml, as well as styling with XSLT. To view in Notepad in a proper format such as indented etc, it would have to be formatted with required line break, tabbing that notepad will recognised to produce the required result.
  26. Hi dsonesuk, Thanks for your prompt reply. What do you say about the following statement that I found in another forum. Please give your views, I am not getting this point. ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- The XML file needs to be formatted (or viewed) with an XML editor or processed with an XML formatting tool, if you want to view it with Notepad. ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- What should I do to view xml file in notepad in xml format. Thanks in advance. Harish Pathak
  27. Div responsive background

    for any one who face the same problem - the easiest way is to simply use flex-box, works perfectly
  1. Load more activity