HFD Posted June 29, 2006 Share Posted June 29, 2006 Hey guys, I have made a script that translates between fictional language Al Bhed, and English. This used to work perfectly and I didn't run into any problems at all. However, now when I type in the phrase I want to translate and click Submit, the translated phrase doesn't appear. You can see what I mean by going to [a href=\"http://www.fflibrary.co.uk/ffx/albhedtranslator.php\" target=\"_blank\"]http://www.fflibrary.co.uk/ffx/albhedtranslator.php[/a]Here is my code[code]<?php$game = 'FFX';$title = 'Al Bhed Translator';include ("../header.php");echo '<center><h1>English to Al Bhed</h1> <br /><br />';echo '<form method="get">Enter the phrase you want converted: <input type="text" name="albhed"><input type="submit" value="Submit"></form>';$albhedlang = array("a" => "y", "b" => "p", "c" => "l", "d" => "t", "e" => "a", "f" => "v", "g" => "k", "h" => "r", "i" => "e", "j" => "z", "k" =>"g", "l" => "m", "m" => "s", "n" => "h", "o" => "u", "p" => "b", "q" => "x", "r" => "n", "s" => "c", "t" => "d", "u" => "i", "v" => "j", "w" => "f", "x"=>"q", "y" => "o", "z" => "w", "A" => "Y", "B" => "P", "C" => "L", "D" => "T", "E" => "A", "F" => "V", "G" => "K", "H" => "R", "I" => "E", "J" => "Z", "K" =>"G", "L" => "M", "M" => "S", "N" => "H", "O" => "U", "P" => "B", "Q" => "X", "R" => "N", "S" => "C", "T" => "D", "U" => "I", "V" => "J", "W" => "F", "X"=>"Q", "Y" => "O", "Z" => "W");$albhed = stripcslashes($albhed);echo '<div width="100%" style="border: 1px solid black; background-color: #FFFFFF;">';echo strtr($albhed,$albhedlang);echo '</div>';echo '<br /><br /><h1>Al Bhed to English</h1> <br /><br />';echo '<form method="get">Enter the phrase you want converted: <input type="text" name="albhed2"><input type="submit" value="Submit"></form>';$albhedlang2 = array("y" => "a", "p" => "b", "l" => "c", "t" => "d", "a" => "e", "v" => "f", "k" => "g", "r" => "h", "e" => "i", "z" => "j", "g" =>"k", "m" => "l", "s" => "m", "h" => "n", "u" => "o", "b" => "p", "x" => "q", "n" => "r", "c" => "s", "d" => "t", "i" => "u", "j" => "v", "f" => "w", "q"=>"x", "o" => "y", "w" => "z", "Y" => "A", "P" => "B", "L" => "C", "T" => "D", "A" => "E", "V" => "F", "K" => "G", "R" => "H", "E" => "I", "Z" => "J", "G" =>"K", "M" => "L", "S" => "M", "H" => "N", "U" => "O", "B" => "P", "X" => "Q", "N" => "R", "C" => "S", "D" => "T", "I" => "U", "J" => "V", "F" => "W", "Q"=>"X", "O" => "Y", "W" => "Z",);$albhed2 = stripcslashes($albhed2);echo '<div width="100%" style="border: 1px solid black; background-color: #FFFFFF;">';echo strtr($albhed2,$albhedlang2);echo '</div></center>';include("../footer.php");?> [/code]Can anybody help? :( Quote Link to comment https://forums.phpfreaks.com/topic/13234-not-echoing-anything-when-it-should/ Share on other sites More sharing options...
wildteen88 Posted June 29, 2006 Share Posted June 29, 2006 Change:stripcslashes($albhed]) to: stripcslashes($_GET['albhed'])And chnage:stripcslashes($albhed]2) to: stripcslashes($_GET['albhed2']) Quote Link to comment https://forums.phpfreaks.com/topic/13234-not-echoing-anything-when-it-should/#findComment-50944 Share on other sites More sharing options...
Buyocat Posted June 29, 2006 Share Posted June 29, 2006 The problem is you aren't getting the data from the form. So where you say...$albhed = stripcslashes($albhed); // $albhed = null...So try...$albhed = stripcslashes($_GET['albhed']); // this worked for meAlso remember to do this for the reverse translation. Quote Link to comment https://forums.phpfreaks.com/topic/13234-not-echoing-anything-when-it-should/#findComment-50946 Share on other sites More sharing options...
HFD Posted June 29, 2006 Author Share Posted June 29, 2006 Ahhh, thank you. All sorted now :) Quote Link to comment https://forums.phpfreaks.com/topic/13234-not-echoing-anything-when-it-should/#findComment-50947 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.