Category : post

I’m not very good with PHP but I’m editing on a code and I received this message: Fatal error: Uncaught PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘$id’ in ‘where clause’ in C:xampphtdocst3GetDataLeft.php:42 19:46:24.779 -> Stack trace: 19:46:24.779 -> #0 C:xampphtdocst3GetDataLeft.php(42): PDOStatement->execute(Array) 19:46:24.827 -> #1 {main} 19:46:24.860 -> thrown in C:xampphtdocst3GetDataLeft.php on line 42 ..

Read more

I have a string that I would like to pass from JS to PHP via a hidden input, but the POST form does not return anything at arrival (I checked it with a var_dump($_POST)), which never happened to me at all. Here is my HTML code: <form action=” id=’hash-form’> <input type=’hidden’ id=’hash’ name=’hash’/> </form> Here ..

Read more

I’m need to execute a REST API POST request with PHP. The URL post parameters looks like this and works fine when executed as such: https://example.com.json?userid=MYUSER&key=MYKEY&order=000000&server=ns1.example.com&server=ns2.example.net&server=ns3.example.net I use the following PHP array with success before without any issues for passing unique values to the same API in my PHP Curl Request: $data = array( ‘userid’ ..

Read more

I’m using URL hashes to request data from my database, such as "url.com/content/book.html#132" in this format: $(document).ready(function(){ var number = window.location.hash.substr(1); $.ajax({ type:’POST’, url:’./db/db.php’, dataType: "json", data:{number:number}, success:function(data){ if(data.status == ‘ok’){ $(‘#title’).text(data.result.title); $(‘#author’).text(data.result.author); $(‘#genre’).text(data.result.genre); etc… } } }); }); and in PHP: <?php if(!empty($_POST[‘number’])){ $data = array(); //database details $dbHost = ‘******’; $dbUsername = ‘******’; ..

Read more

I have a code that does HTTP post to a remote server with a set of parameters as shown belo.w http://localhost:8085/setValue.php?ip=192.168.21.45&port=8089&version=1.0.0&area_id=9999&area_name="AreaName" Is the above HTTP POST equivalent to the one below. http://localhost:8085/setValue.php?ip=192.168.21.45&port=8089&area_id=9999&area_name="AreaName"&version=1.0.0 or are they different. The values that are passed are identical, only the order of parameters have been changed. Sourc..

Read more

Hello I’m trying to convert this to php: curl -X POST https://petroapp-price.petro.gob.ve/price/ -H ‘Content-Type: application/json’ -H ‘Host: api-price.petro.dom’ -d ‘ { coins: [    "BTC",    "PTR"   ], fiats: [    "USD",    "MEXP"  ] } ‘ But I don’t know where to start, somebody can give me a hint? I want to show some cryptocoins prices on my website ..

Read more

Need a little assistance in using php to access blob data sent from javascript post. Here is the method I used to attach blob to formdata – var formData = new FormData(); formData.append(‘jsonData’, new Blob([JSON.stringify( {"action":"readString", "details":{"string":"string1"} }) ], {type:’application/json’}) ); Previously I only used $_POST method, but I am having no luck when sending ..

Read more

<!DOCTYPE html> <html lang="en" dir="ltr"> <head> <meta charset="utf-8"> <title></title> </head> <body> <h3>MAD LIBS</h3> <?php if (isset($_POST[‘submit’])) { $color = $_POST[‘color’]; $pluralNoun = $_POST[‘pluralNoun’]; $celebrity = $_POST[‘celebrity’]; } echo "Roses are " . $color; echo $pluralNoun . " are Blue"; echo "I love " . $celebrity; ?> <form action="site.php" method="post"> Color: <input type="text" name="color"> <br> Plural ..

Read more