Created
August 29, 2013 08:07
-
-
Save phpfiddle/6375408 to your computer and use it in GitHub Desktop.
nil no description
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php function get_json_format($results){ | |
//Format and return the result from the given json data | |
} | |
?> | |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<title></title> | |
</head> | |
<body> | |
<?php | |
if(isset($_POST['query'])){ | |
$results = json_decode(file_get_contents('http://sugg.in.search.yahoo.com/gossip-in/?output=json&l=1&command='.$_POST['query'])); | |
$query_result = get_json_format($results); | |
?> | |
<table> | |
<tr><th>key</th><th>Mark</th></tr> | |
<?php | |
// Display the result data | |
?> | |
</table> | |
<?php | |
} else{ | |
?> | |
<h3>My form</h3> | |
<form method="post"> | |
<label>Search Text</label> <input type="text" value="" size="30" maxlength="100" name="query" /><br /><br /> | |
<button id="mysubmit" type="submit">Submit</button><br /><br /> | |
</form> | |
<?php | |
} | |
?> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment