Jump to content

gw1500se

Members
  • Posts

    1,029
  • Joined

  • Last visited

  • Days Won

    16

Everything posted by gw1500se

  1. That is a JSON string. Cereal will do what you want in c++.
  2. You can't. You need to take the output from the PHP script and process it into an array in c++. What format did you choose to return in the PHP script? If JSON then you need to use c++ json decode to convert it to an array.
  3. How about making your script readable? Use the code icon (<>) and select PHP.
  4. "http://localhost//Download//info.txt" needs to be the PHP script that returns any files ready for download. You did not post the code where you read the result from the curl_easy_perform.
  5. Your questions seem to be going in circles. Lets back up and and tell us how you are using curl in your c++ program. I assume you are using the c++ curl library, right?
  6. Echo means that information, as a string, will be collected by the issuing curl command. That is the whole point of curl get. The format you use (JSON, XML, comma delimited) is up to you when you echo the names.
  7. When your client contacts the server, have the PHP script return the names of any files that are ready to download. Then have the client request the download of those files.
  8. This is a help forum not a free coding forum, if that is what you are asking. You need to do the work and if you have problems, show what you did, what you expect and what is wrong. A summary of what you want is to write a PHP script that is launched by the client via curl. That script would then check the directory for a file(s) and if present start the download. Once complete the client would confirm the successful download and have the PHP script delete the file.
  9. You will need to turn your thinking around. You need the client to periodically query the server and have the server tell the client if there is a file to download. Then the client can download the file from the server and when complete the server can delete the file.
  10. You need to learn to use these functions. Notice how unreadable your output is. If you RTFM you would see that var_dump outputs a structured format. Try again with: echo "<pre>"; var_dump($return); echo "</pre>";
  11. Do a 'var_dump($return)' to see exactly how the decode structures the return array. From that you will see what your error is. As a hint, your foreach statement should look more like: foreach ($return as $key=>$val) {
  12. First please use the code icon (<>) and select PHP so it formats your code to make is easier to read. Second you probably should be using PHPMailer for your email. It is much easier to use and gives you better control. Finally to debug this you need to make sure you have errors enabled but your insert does not contain the field 'id'. Where do you add that to the record?
  13. I think you are asking for a singleton class: class MyFetchController { $inst=null; // private constructor so it cannot be instantiated externally private function__contruct() { // initialzation code here as needed } public function Instance() { if ($inst==null) { $inst=new MyFetchController(); } return $inst; } } Any time you want that class call 'Instance' and you will always get the same instance.
  14. Start with a flow chart and develop a database schema.
  15. https://www.php.net/manual/en/mysqli.multi-query.php
  16. Try this: $queryString="SELECT cat_id, subcat_id, subcategory_title, subcategory_desc FROM categories, subcategories WHERE ($parent_id = categories.cat_id) AND ($parent_id = subcategories.parent_id"; echo $queryString; $select = mysqli_query($con,$queryString); Look at the echo'ed string to find the syntax error.
  17. Do you not know how to send and email or do you not know how to tell when the paypal API returns successful payment?
  18. You don't say what the error is but that is a different problem. Start an new thread on the MySQL forum.
  19. try this: include("/home2/csi/public_html/resources/con.php");
  20. You need to determine where that file is relative to the httpd root. Require and Require_once does the same thing as include. If the path is wrong, it is wrong.
  21. It should show the absolute path (I'm guessing from the name). It should be something like '/var/www/html'. The solution is to not use absolute path but rather relative. Try: include("resources/con.php");
  22. So it is now clear that ABSPATH is not being substituted the way you expect. How is it defined and where? I don't normally use constants but somewhere you must have a "define('ABSPATH',<whatever>);" but is not executed before that include.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.