Возникла трабла - Visavi.net https://visavi.net/ RSS - Visavi.net https://visavi.net/assets/img/images/logo_small.png RSS - Visavi.net https://visavi.net/ [email protected] (admin) [email protected] (admin) Sun, 12 Jan 2025 03:00:39 +0300 <blockquote class="blockquote"><strong>kilo</strong> (3 Ноября 2011 / 17:44)<br> Хоть укажи этот 57 рядок <img src="https://visavi.net/uploads/stickers/smile.gif" alt="smile"> </blockquote> Та я неправильно метод класса внутри класса вызывал (не писал this). Спасибо. https://visavi.net/topics/26212/441618 Возникла трабла CROWS Thu, 03 Nov 2011 17:50:24 +0400 Сообщения https://visavi.net/topics/26212/441618 Хоть укажи этот 57 рядок <img src="https://visavi.net/uploads/stickers/smile.gif" alt="smile"> https://visavi.net/topics/26212/441617 Возникла трабла kilo Thu, 03 Nov 2011 17:44:53 +0400 Сообщения https://visavi.net/topics/26212/441617 Тю ты $this-&gt;searchFunction и $this-&gt;searchFunctionTwo ))) https://visavi.net/topics/26212/441616 Возникла трабла CROWS Thu, 03 Nov 2011 17:44:30 +0400 Сообщения https://visavi.net/topics/26212/441616 <strong>Fatal error: Call to undefined function searchFunctionTwo() in T:\home\virtual\site.ru\_vig.php on line 57</strong><br> <br> Функция searchFunctionTwo определена выше. В чем проблема? https://visavi.net/topics/26212/441613 Возникла трабла CROWS Thu, 03 Nov 2011 17:33:43 +0400 Сообщения https://visavi.net/topics/26212/441613 Привет форумчанам.<br> <br> &lt;?php<br> <br> <br> class Viginer {<br> <br> var $A1 = array (&quot;А&quot;,&quot;Б&quot;,&quot;В&quot;,&quot;Г&quot;,&quot;Д&quot;,&quot;Е&quot;,&quot;Ж&quot;,&quot;З&quot;,&quot;И&quot;,&quot;Й&quot;,&quot;К&quot;,&quot;Л&quot;,&quot;М&quot;,&quot;Н&quot;,&quot;О&quot;,&quot;П&quot;,&quot;Р&quot;,&quot;С&quot;,&quot;Т&quot;,&quot;У&quot;,&quot;Ф&quot;,&quot;Х&quot;,&quot;Ц&quot;,&quot;Ч&quot;,&quot;Ш&quot;,&quot;Щ&quot;,&quot;Ъ&quot;,&quot;Ы&quot;,&quot;Ь&quot;,&quot;Э&quot;,&quot;Ю&quot;,&quot;Я&quot;,&quot;#&quot;,&quot;0&quot;,&quot;1&quot;,&quot;2&quot;,&quot;3&quot;,&quot;4&quot;,&quot;5&quot;,&quot;6&quot;,&quot;7&quot;,&quot;8&quot;,&quot;9&quot;);<br> <br> var $message=&quot;&quot;;<br> var $key=&quot;&quot;;<br> var $table = array(array(),array());<br> var $code=&quot;&quot;;<br> var $decoding=&quot;&quot;;<br> <br> <br> function Viginer($mes, $k) {<br> $message = $mes;<br> $key = $k; <br> }<br> <br> <br> function tablele() {<br> echo &quot;Constructing Viginer table:&lt;br&gt;&quot;;<br> for ($i = 0; $i &lt; count($this-&gt;A1); $i++) {<br> for ($j = 0; $j &lt; count($this-&gt;A1); $j++) {<br> $table[$i][$j] = $this-&gt;A1[($j+$i)%count($this-&gt;A1)];<br> echo $table[$i][$j];<br> }<br> echo &#039;&lt;br&gt;&#039;;<br> }<br> }<br> <br> function searchFunction($sym, $ch) {<br> for ($i = 0; $i &lt; count($sym); $i++) {<br> if ($sym[$i] == $ch)<br> return $i;<br> }<br> return -1;<br> }<br> <br> function searchFunctionTwo($sym, $n, $ch) {<br> for ($i = 0; $i &lt; count($this-&gt;sym); $i++) {<br> if ($this-&gt;sym[$n][$i] == $this-&gt;ch)<br> return $i;<br> }<br> return -1;<br> }<br> <br> function encoding() {<br> for ($i = 0; $i &lt; strlen($this-&gt;message); $i++) {<br> $this-&gt;code += $this-&gt;table[searchFunction($this-&gt;A1, substr(strlen($i%$this-&gt;key), 1, $this-&gt;key))][searchFunction($this-&gt;A1, substr($i, 1, $this-&gt;message))];<br> }<br> echo &quot;Encrypting message: &quot;.$this-&gt;code;<br> }<br> <br> function decodingo() {<br> for ($i = 0; $i &lt; count($this-&gt;code); $i++) {<br> $this-&gt;decoding += $this-&gt;A1[searchFunctionTwo($this-&gt;table, searchFunction($this-&gt;A1, substr(strlen($i%$this-&gt;key), 1, $this-&gt;key)), substr($i, 1, $this-&gt;code))];<br> }<br> echo &quot;Decoded message: &quot;.$this-&gt;decoding;<br> }<br> <br> function alpha()<br> {<br> echo &quot;Alphabet:&quot;;<br> foreach($this-&gt;A1 as $alpha)<br> {<br> echo $alpha;<br> }<br> }<br> }<br> <br> <br> <br> $mes=&quot;Сообщенийо&quot;;<br> $key=&quot;Ключ&quot;;<br> <br> <br> $vig = new Viginer($mes, $key);<br> $vig-&gt;tablele();<br> $vig-&gt;encoding();<br> $vig-&gt;decodingo();<br> $vig-&gt;alpha();<br> <br> <br> <br> <br> <br> <br> ?&gt; https://visavi.net/topics/26212/441612 Возникла трабла CROWS Thu, 03 Nov 2011 17:33:03 +0400 Сообщения https://visavi.net/topics/26212/441612