Advertisement
Guest User

Untitled

a guest
Apr 18th, 2014
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title>Word meanings</title>
  4. <?php
  5. mysql_connect("localhost", "root", "radhika");
  6. mysql_select_db("dictionary");
  7. if(isset($_POST['Submit1']))
  8. {
  9.  
  10. $req=$_REQUEST['word'];
  11. $strSQL = "SELECT * FROM dict WHERE word='$req'";
  12. $rs = mysql_query($strSQL);
  13. while($row = mysql_fetch_array($rs))
  14. {
  15. $x=$row["word"];
  16. $y=$row["meaning"];
  17. $z=$row["synonym"];
  18. echo "<b>Word</b>: " . $x ."<br/>" ;
  19. echo "<b>Meaning</b>: " . $y ."<br/>" ;
  20. echo "<b>Synonym</b>: " . $z ."<br/>" ;
  21. }
  22. }
  23. mysql_close();
  24. ?>
  25.  
  26. </head>
  27. <body>
  28. <form name="form1" action="lastry.php" method="POST">
  29. <input type="text" name="word" value="<?php echo isset($_POST['word'])?$_POST['word']:''?>"x-webkit-speech/>
  30. <Input Type ="Submit" Name ="Submit1" Value ="submit">
  31. </form>
  32. <?php if($_POST)
  33. {
  34. ?>
  35.  
  36. <audio controls="controls" autoplay="autoplay">
  37. <source src="<?php echo "http://tts-api.com/tts.mp3?q=$z";?>" type="audio/mp3" />
  38. </audio>
  39. <?php }?>
  40. </body>
  41. </html>
  42.  
  43. urlencode($z)
  44.  
  45. http://tts-api.com/tts.mp3?q=<?php echo urlencode($y);?>&type="audio/mp3" />
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement