How to show visa info based on country selection in a travel form? Programming Web Development by eservices I’m working on a travel planning form that adjusts based on the selected nationality. For example, if someone picks a country like India, the form should display whether they need an electronic visa for places like Sri Lanka, and maybe show a short message or guide link. I’m using JavaScript to detect changes in a <select> dropdown and … Re: How to show visa info based on country selection in a travel form? Programming Web Development by Dani I have moved your post into the web development forum instead of the advertising/marketing forum where it was and tagged it appropriately. Can you please provide the Javascript code as well as PHP code that is buggy so that we can help diagnose this for you. For example, if the JSON response is empty, it is most likely because of a bug in the … Re: How to show visa info based on country selection in a travel form? Programming Web Development by Biiim I felt like some fun, so I just put together an example for you using CDN's and bootstrap 5. From what you are talking about you probably want to put some of that logic into the Javascript and not need to send a server request for each one, I usually do this kind of thing with javascript objects/arrays (eg `settings['GB']['visa_req'] = false;… Re: How to show visa info based on country selection in a travel form? Programming Web Development by groverharleen Hello, please use developer tool while working on HTML/PHP with AJAX. in the console you can easily track what was the POST/GET request made to PHP file and what is the responses shared by PHP file. try debugging response accordingly or if still you face any trouble, please do share screen shot of Header / Request / Response Tabs. i'll … Re: How to connect to the Pinterest API using PHP? Programming Web Development by geekinformatic Hey! If you're using the CakePHP framework, you can connect to the Pinterest API with cURL and OAuth integration. Just follow Pinterest’s API docs for endpoints and token handling. Re: Cannot run exe from asp.net Programming Web Development by lennyli > Why your approach isn’t working > What you're trying to do is mostly blocked by modern security rules — for good reasons. Here's the breakdown: > > Running a .exe on the server > You can technically make the server launch an .exe file like Notepad, but: > > It will run in the background on the server, not visibly on… getting error in json decode Programming Web Development by blueguy777 …=="") { echo "No output received"; } else { $arr_output = json_decode($output, true); if(isset($arr_output['msg'])) { $msg = $arr_output['msg']; $msg_text… Re: Json decode help need Programming Web Development by lps This problem is actually cause by the data is not in correct format. As the data provided is in {features: {forecast10day: 1 }} format while the json decode function accept {"features": {"forecast10day": 1}} JSON Programming Web Development by davy_yg Method saving: JSON on file “content.txt” Data Serving Method: 1. Get content for file “content.txt” every page load and put in on parameter. 2. JSON Decode the parameter. So the parameter will be array type. 3. Use desired data for that page. Hello can anyone help me understand the content in the quotation? … Json decode help need Programming Web Development by arafath077 ….com/api/ab3f1aefcf4033d4/forecast10day/q/CA/San_Francisco.json"); //$phparrya = json_decode($jsonstring); $array_json=json_decode($json, true); print_r($obj);` Re: Json decode help need Programming Web Development by Alberto Bucur … code: <?php $json = file_get_contents("San_Francisco.json"); $array_json=json_decode($json, true); //print_r($array_json); display_jsonarray($array_json); function display_jsonarray($array, $lvl_indent… Re: Json Decode Programming Web Development by Danny159 Ahhh I have a json in a json will that cause issues, if so how would you resolve it? Re: Json Decode Programming Web Development by blocblue Why would you need a JSON string inside another JSON string? Encode the entire data structure in one go. Re: Json Decode Programming Web Development by blocblue Use `var_dump` instead. This will allow you to determine whether `json_decode` is returning `null` because the JSON cannot be decoded. If you're pulling the data from a database, did you add slashes or anything when inserting? Re: JSON Programming Web Development by paulkd JSON is a data storage format. JavaScript is a scripting/programming language. The [website](http://www.json.org) explains it better but the format is "readable" and lightweight. Your text shows that content.txt will contain JSON encoded data. You can use whatever server (PHP, ColdFusion..) or client (JavaScript..) language to read the … Re: JSON to MySQL with PHP Programming Web Development by diafol you can use json_decode: [url]http://php.net/manual/en/function.json-decode.php[/… json file into a php string variable. 3. do a json_decode on the variable, ensuring that you choose the 'associative' parameter… to true [CODE]$my_arr = json_decode($var, true);[/CODE] Data is now in an array 4… Re: JSON , MYSQL and PHP Programming Web Development by jkon Storing a string in db from JSON decode has really no meaning at all. The only case I can think of that might have some reason is storing data that you don't know what you do with them but you don't want to loose them because might be precious to the application in near future (e.g. all the info data that sends facebook for the user when login). … Re: json to php Programming Web Development by jkon http://php.net/manual/en/function.json-decode.php Re: getting error in json decode Programming Web Development by pritaeas if($msg == "success") That's case sensitive, and should be: if ($msg == "SUCCESS") or: if (strtolower($msg) == "success") Re: getting error in json decode Programming Web Development by blueguy777 wow perfect! thanks pritaeas Re: Json decode help need Programming Web Development by diafol What data did you want to extract? The textforecast/forecast data array would be: $array_json['forecast']['txt_forecast']['forecastday'] For a 10 day forecast this contains 20 items - one daytime and one night for each day. It is number-indexed (0-19) The simpleforecast/forecast data array would be: $array_json['forecast']['txt_forecast… Re: Json decode help need Programming Web Development by arafath077 thanks u all..worked Json Decode Programming Web Development by Danny159 Hey guys, I am having some trouble with json_decode... I used json_encode to encode a string that is the … * FROM `changelog` WHERE `id` = '".$_GET['id']."'")); $newdata = json_decode($arraydata['newda'], true); $olddata = json_decode($arraydata['orig'], true); print_r($newdata); } Dan Re: Json Decode Programming Web Development by Danny159 Thanks for your reply, I added var_dunp and it returned NULL, I dont addslashes when inserting all I do it jason_encode: see below... $thedarray = json_encode($thedarray); mysql_query("INSERT INTO `changelog` (`date`,`newda`,`orig`,`status`) VALUES ('".time()."','$thedarray','$orgarray','1')"); Re: Json Decode Programming Web Development by ko ko var_dump($arraydata['newda']); How look like the above value before json_decode() function ? It contains any slash or escape ? Re: Json Decode Programming Web Development by Danny159 Its alright guys I sorted it... your right I needed to addslashes :) Thanks! Dan Re: JSON and databases Programming by overwraith … require other libraries to parse json. I believe PHP uses json_decode. Decode Plz Files please Decode Programming Web Development by reis02 Decode Please REMOVED Re: json to php Programming Web Development by lps Agree with @jkon, please use the json_decode() to decode the json format into array. Then from the array, manually assign them into another variable(if it really needed). json to mysql with php Programming Web Development by superlucile …')) echo 'OK'; $json=file_get_contents("php://input"); var_dump(json_decode($json)); $raw_json = json_decode($json,true); echo $raw_json["json"]; $var=$raw_json…