-
Posts
1,029 -
Joined
-
Last visited
-
Days Won
16
Everything posted by gw1500se
-
upload files from php server to c++ client using curl
gw1500se replied to jazz15's topic in PHP Coding Help
That is a JSON string. Cereal will do what you want in c++. -
upload files from php server to c++ client using curl
gw1500se replied to jazz15's topic in PHP Coding Help
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. -
CURL PHP Crawler Returns Access Denied Error
gw1500se replied to Geoffism00's topic in PHP Coding Help
How about making your script readable? Use the code icon (<>) and select PHP. -
upload files from php server to c++ client using curl
gw1500se replied to jazz15's topic in PHP Coding Help
"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. -
upload files from php server to c++ client using curl
gw1500se replied to jazz15's topic in PHP Coding Help
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? -
upload files from php server to c++ client using curl
gw1500se replied to jazz15's topic in PHP Coding Help
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. -
upload files from php server to c++ client using curl
gw1500se replied to jazz15's topic in PHP Coding Help
You're kidding, right? Try 'echo'. -
upload files from php server to c++ client using curl
gw1500se replied to jazz15's topic in PHP Coding Help
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. -
upload files from php server to c++ client using curl
gw1500se replied to jazz15's topic in PHP Coding Help
So what are you asking of us? -
upload files from php server to c++ client using curl
gw1500se replied to jazz15's topic in PHP Coding Help
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. -
upload files from php server to c++ client using curl
gw1500se replied to jazz15's topic in PHP Coding Help
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. -
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>";
-
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) {
-
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?
-
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.
-
BUILDING A TRANSCRIPT SYSTEM USING PHP/MYSQL
gw1500se replied to JophusEdumadze's topic in PHP Coding Help
Start with a flow chart and develop a database schema. -
https://www.php.net/manual/en/mysqli.multi-query.php
-
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.
-
When you do echo $query and post that.
-
You don't say what the error is but that is a different problem. Start an new thread on the MySQL forum.
-
try this: include("/home2/csi/public_html/resources/con.php");
-
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.
-
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");
-
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.