Hi !
i have hard time to get my php code, that i insert into wordpress site to get work. This is the code that i have inserted into Wordpress post using "Insert PHP" plugin:
[button style="btn-primary" url="" size="" block="false" target="_self"] Buscar [/button]
[insert_php]
$keyword = "doctor";
if( isset($_POST['key']) ) {
$keyword = $_POST['key'];
echo "nEntered keyword: $keyword";
//print $keyword;
if( $keyword == "" ){
echo "Please enter a keyword.";
exit;
}
$url = "http://webservices.myskillsmyfuture.org/Occupation.svc/occupationsbykeyword/userid/vWmZxue3MavGrMk/keyword/".$keyword."/limit/20 simplexml_load_file($url);
$json = json_encode($xml);
$jsonIterator = new RecursiveIteratorIterator(
new RecursiveArrayIterator(json_decode($json, TRUE)),
RecursiveIteratorIterator::SELF_FIRST);
echo "nn
Search Results:
nn";
foreach ($jsonIterator as $key => $val) {
if($key != "ErrorMessage" && $key != "ErrorNumber") {
if(is_array($val)) {
// echo "$key:n";
} else {
if( $key == "AcinetUrl" ) {
$val = "$val";
}
echo "$key: $val";
}
echo "n";
}
}
}
// This is for 4th URL | Find occupation titles by keyword[/insert_php]
This code now work when i press the button inserted via Visual Composer:
[button style="btn-primary" url="" size="" block="false" target="_self"] Buscar[/button]
How to resolve this? Thanks