I do not know why this simple PHP script is not working,
won my browser ' Page not loaded I am thinking that there is a flaw in the argument rather than syntax, but maybe someone can be told why I am wrong.
& lt; Html & gt; & Lt; Top & gt; & Lt; Title & gt; My encryption program & lt; / Title & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt ;? PHP $ ConvertedLetter = ""; $ Secret message = "Kiss my shiny metal ..."; $ MessageLegan = Stellen ($ secret message); $ Counter = 0; ($ Counter; $ message lang; $ counter ++) {$ LetterToEncrypt = substr ($ secret message, $ counter, 1); $ AsciiNumber = ord ($ LetterToEncrypt) + 3; $ Converters = $ converted + Chr ($ ASCINNumber); } Copy $ convertor; ? & Gt; & Lt; / Body & gt; & Lt; / Html & gt;
This should work for you:
& Lt ;; Php // ^^^ Good practice in lowercase $ ConvertedLetter = ""; $ Secret message = "Kiss my shiny metal ..."; $ MessageLegan = Stellen ($ secret message); {// ^^^^^^^^^^^^ ^^^^^^^^^^^^^ ($ counter = $; $ counter $ lang; $ countre ++) for {// ^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^ Loop // | | Start Variable // | Good practice control structure Lowercase $ LetterToEncrypt = $ SecretMessage [$ Counter]; // ^^^^^^^^^^^^^^^^^^^^^^^^ You can use an array $ AsciiNumber = ord ($ LetterToEncrypt) + 3 as a string; $ Convert liter = Chr ($ ASCInumber); // ^^ ^^^ The function name is written in the same case because it is defined //. Attach string} $ ConvertedLetter echo; ? & Gt;
Output:
Nlvv # P | #Vklq | # Phwdo111
For more information, see:
Side notes:
Only during staging, add to the top of your file (files), not in production:
Lt ;? Php ini_set ("display_errors", 1); Error_reporting (E_ALL); ? & Gt;
Before you make a mistake:
, no (but it is still a good practice that they are defined as writing in the same case) !
And some of the references that can help you solve such problems in the future or get at least one answer (turn it over ! Vvv)
Google is your best friend! (He will never lie to you, trust me: D)
Start searching for anything - this will help you get the fast answer!
No comments:
Post a Comment