
nitiphone2021
Members-
Posts
85 -
Joined
-
Last visited
Everything posted by nitiphone2021
-
Dear all, According to I create a website and I try to copy the URL to facebook for sharing but when post it. the post not show information about the website. I add meta but still not work.
-
Dear all, Accoring to I created a soap API for sending SMS but timeout I found the server not reply. so I would like to protect the timeout case like retry or something. $requestmsg = array('msg'=>$msg); /* SEND SOAP API */ $result = $client->SendSMS($requestmsg); /* RESPONSE FROM SOAP API*/
-
PHP Version 5.6.40, internal error for connect mysql
nitiphone2021 replied to nitiphone2021's topic in PHP Coding Help
the main target is I have a old software would like to use it and when I install. I got a error message about Fatal error: Call to undefined function mysql_query() in /home/newlinkbdbcom/public_html/cake/libs/model/datasources/dbo/dbo_mysql.php on line 613 so that's why i created a new test file for create a sample connect to test service can work -
PHP Version 5.6.40, internal error for connect mysql
nitiphone2021 replied to nitiphone2021's topic in PHP Coding Help
Fatal error: Call to undefined function mysql_connect() in /home/newlinkbdbcom/public_html/app/webroot/test.php on line 5 $link = mysql_connect('localhost:3306', 'user', 'password','dbname'); still error again. it's about mysql driver or sometime? -
PHP Version 5.6.40, internal error for connect mysql
nitiphone2021 posted a topic in PHP Coding Help
According to I have a project need to use PHP 5.6.40 connect to mysql version 5.7.34 This URL for phpinfo() http://newlink.bdb.com.la/app/webroot/test.php when I try to connect it by below coding $servername = "localhost"; $username = "user"; $password = "pass"; $db_database = 'db_unelr'; $db_port = '3306'; // Create connection $conn = mysqli_connect($servername, $username, $password,$db_database,$db_port); // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } echo "Connected successfully"; it's show 500 internal error. what should I check and fix this problem? it's private host, so I can run linux command to check -
Warning: Illegal string offset 'file' in /var/www/html/NlLaosF/cake/libs/debugger.php on line 632 Warning: Illegal string offset 'line' in /var/www/html/NlLaosF/cake/libs/debugger.php on line 632 Strict Standards: Non-static method Configure::read() should not be called statically in /var/www/html/NlLaosF/cake/basics.php on line 213 Strict Standards: Non-static method Configure::getInstance() should not be called statically in /var/www/html/NlLaosF/cake/libs/configure.php on line 156 Warning (2): fopen(../../app/webroot/lang/lang_en.php) [function.fopen]: failed to open stream: No such file or directory [APP/app_controller.php, line ??] Warning: Illegal string offset 'file' in /var/www/html/NlLaosF/cake/libs/debugger.php on line 632 Warning: Illegal string offset 'line' in /var/www/html/NlLaosF/cake/libs/debugger.php on line 632 Warning (2): fwrite() expects parameter 1 to be resource, boolean given [APP/app_controller.php, line ??] Warning: Illegal string offset 'file' in /var/www/html/NlLaosF/cake/libs/debugger.php on line 632 Warning: Illegal string offset 'line' in /var/www/html/NlLaosF/cake/libs/debugger.php on line 632 Warning (2): fclose() expects parameter 1 to be resource, boolean given [APP/app_controller.php, line ??] Warning (2): require_once(../../app/webroot/lang/lang_en.php) [function.require-once]: failed to open stream: No such file or directory [APP/app_controller.php, line ??] Fatal error: require_once() [function.require]: Failed opening required '../../app/webroot/lang/lang_en.php' (include_path='.:/usr/share/php:/var/www/html/NlLaosF:/var/www/html/NlLaosF/app/') in /var/www/html/NlLaosF/app/app_controller.php on line 0 This is the error message
-
Hi all friends, As I want to install old cakePHP project from v1.3.11 in my virtualBox but when I run it fail Do you have any idea how this error message? I am not the writer of the project but I need to reinstall it this is the requirement for the project Ubuntu 16.04.7 LTS Apache/2.4.18 PHP 5.6.40-47+ubuntu16.04.1+deb.sury.org+1 mysql 5.7.33 phpmyadmin 4.5.4
-
Now I can exec the command. my point is 1. exec command not allow on php.ini 2. on PHP can't call java command by "java" need to put full location 3. path of jar file, my PHP file and java file in the path but I can't call it like javafile.jar need to put full path. `exec("/usr/bin/java -jar /home/public_html/believe.com/CoVaF/func/encrypt.jar ` Thank you all for support
-
Updated!!!!! Updated!! Now I can execute java command like java -version but can't execute jar file echo exec("/usr/bin/java -version 2>&1",$output); // Output work echo "<br>"; echo exec("/usr/bin/java -jar encrypt.jar ".$data." ".$privateKey . " 2>&1",$key); Result: OpenJDK 64-Bit Server VM (build 25.292-b10, mixed mode) Error: Unable to access jarfile encrypt.jarArray ( [0] => Error: Unable to access jarfile encrypt.jar ) In the same command, I can run it on my laptop can work properly the file encrypt.jar permission is 777
-
[root@host ~]# java -version openjdk version "1.8.0_292" OpenJDK Runtime Environment (build 1.8.0_292-b10) OpenJDK 64-Bit Server VM (build 25.292-b10, mixed mode) [root@host ~]# [root@host ~]# [root@host ~]# [root@host ~]# /usr/bin/java -version openjdk version "1.8.0_292" OpenJDK Runtime Environment (build 1.8.0_292-b10) OpenJDK 64-Bit Server VM (build 25.292-b10, mixed mode) [root@host ~]#
-
Now I enable it but seem I can't run only java echo "linux = '" . exec("ls -l") . "'"; echo "<br>java = '" . exec("/usr/bin/java -version") . "'"; Linux command can work but java not work [root@host ~]# which java /usr/bin/java [root@host ~]# I tried like this but not work
-
Warning: shell_exec() has been disabled for security reasons in /home/cp227590/public_html/bdb.com.la/phpinfo.php on line 8 Error message
-
yes, I run only easy command but still not work <?php // Use ls command to shell_exec // function $output = shell_exec('ls'); // Display the list of all file // and directory echo "HERE = " . $output; ?>
-
yes, I reading on PHP document. seem I need to enable exec command? How to enable it? like PHP extension?
-
Hi all. I tried to execute command below ` echo '<br/>'.$data. " >=> " . exec("java -jar encrypt.jar ".$data." ".$privateKey, $key);` it's look like we run `java -jar encrypt.jar 192.168.101.1BBB10052 ssdsds` I can run this command on the server by ssh but when I use PHP code, it's nothing. so I need to enale the exec function or different command on this version?
-
[root@host ~]# yum search php | grep -i soap alt-php-internal-soap.x86_64 : A module for PHP applications that use the SOAP alt-php71-soap.x86_64 : A module for PHP applications that use the SOAP protocol alt-php73-soap.x86_64 : A module for PHP applications that use the SOAP protocol alt-php74-imunify-soap.x86_64 : A module for PHP applications that use the SOAP alt-php74-soap.x86_64 : A module for PHP applications that use the SOAP protocol cpanel-php73-SOAP.noarch : PEAR: SOAP Client/Server for PHP ea-php54-php-soap.x86_64 : A module for PHP applications that use the SOAP ea-php55-php-soap.x86_64 : A module for PHP applications that use the SOAP ea-php56-php-soap.x86_64 : A module for PHP applications that use the SOAP ea-php70-php-soap.x86_64 : A module for PHP applications that use the SOAP ea-php71-php-soap.x86_64 : A module for PHP applications that use the SOAP ea-php72-php-soap.x86_64 : A module for PHP applications that use the SOAP ea-php73-php-soap.x86_64 : A module for PHP applications that use the SOAP ea-php74-php-soap.x86_64 : A module for PHP applications that use the SOAP ea-php80-php-soap.x86_64 : A module for PHP applications that use the SOAP [root@host ~]# This one is my PHP coding for sending SOAP. Any library or file for using soap without installing? <?php $operator = "http://ltcservice.laotel.com:5577/Services.asmx?WSDL"; $privateKey = "B**************p"; $headerSMS = "TEST"; // TEST $userid = "BDX"; $txtTel ="2********6"; $newRegCode_exp = rand(); $messageBody = "Test SMS"; //$serverIP = $_SERVER['REMOTE_ADDR']; $serverIP = "172.28.17.61"; $trans_id = "BDX".rand(); //$trans_id = "123456"; $data = $serverIP.$trans_id; $messageBody = $serverIP.$trans_id; echo '<br/>'.$data. " >=> " . exec("java -jar encrypt.jar ".$data." ".$privateKey, $key); echo '<br/>'.$key[1]. " >=> " . exec("java -jar decrypt.jar ".$key[1]." ".$privateKey, $output); echo '<br/> encrypt result >=> '.$key[0]; if($key[0]=="OK"){ $header = array('userid' => $userid, 'trans_id' => $trans_id, 'key' => $key[1], ); echo '<br/>'; //print_r($header); $client = new SoapClient($operator); $msg = array( 'msisdn' => $txtTel, 'message' => $messageBody, 'headerSMS' => $headerSMS, 'header' => $header, ); $requestmsg = array('msg'=>$msg); echo '<br/>'; print_r($msg); $data = $client->SendSMS($requestmsg); echo '<br/>'; print_r($data); } ?>
-
[root@host ~]# cat /etc/*-release CentOS Linux release 7.9.2009 (Core) NAME="CentOS Linux" VERSION="7 (Core)" ID="centos" ID_LIKE="rhel fedora" VERSION_ID="7" PRETTY_NAME="CentOS Linux 7 (Core)" ANSI_COLOR="0;31" CPE_NAME="cpe:/o:centos:centos:7" HOME_URL="https://www.centos.org/" BUG_REPORT_URL="https://bugs.centos.org/" CENTOS_MANTISBT_PROJECT="CentOS-7" CENTOS_MANTISBT_PROJECT_VERSION="7" REDHAT_SUPPORT_PRODUCT="centos" REDHAT_SUPPORT_PRODUCT_VERSION="7" CentOS Linux release 7.9.2009 (Core) CentOS Linux release 7.9.2009 (Core) [root@host ~]# ^C [root@host ~]# sudo apt-get install php-soap sudo: apt-get: command not found [root@host ~]# sudo yum install php-soap Loaded plugins: fastestmirror, langpacks, universal-hooks Loading mirror speeds from cached hostfile epel/x86_64/metalink | 5.1 kB 00:00:00 epel-debuginfo/x86_64/metalink | 4.6 kB 00:00:00 epel-source/x86_64/metalink | 5.1 kB 00:00:00 * EA4: 203.174.85.202 * cpanel-addons-production-feed: 203.174.85.202 * cpanel-plugins: 203.174.85.202 * base: mirrors.thzhost.com * epel: mirrors.thzhost.com * epel-debuginfo: mirrors.bestthaihost.com * epel-source: mirrors.thzhost.com * extras: mirror2.totbb.net * updates: mirror2.totbb.net EA4 | 2.9 kB 00:00:00 cpanel-addons-production-feed | 2.9 kB 00:00:00 cpanel-plugins | 2.9 kB 00:00:00 base | 3.6 kB 00:00:00 epel | 4.7 kB 00:00:00 epel-debuginfo | 3.0 kB 00:00:00 epel-source | 3.5 kB 00:00:00 extras | 2.9 kB 00:00:00 imunify360 | 2.7 kB 00:00:00 imunify360-rollout-1 | 3.0 kB 00:00:00 imunify360-rollout-2 | 3.0 kB 00:00:00 imunify360-rollout-3 | 3.0 kB 00:00:00 imunify360-rollout-4 | 3.0 kB 00:00:00 mysql-connectors-community | 2.6 kB 00:00:00 mysql-tools-community | 2.6 kB 00:00:00 mysql57-community | 2.6 kB 00:00:00 updates | 2.9 kB 00:00:00 wp-toolkit-cpanel | 2.9 kB 00:00:00 wp-toolkit-thirdparties | 2.9 kB 00:00:00 (1/5): epel/x86_64/updateinfo | 1.0 MB 00:00:00 (2/5): epel-debuginfo/x86_64/primary_db | 890 kB 00:00:00 (3/5): epel-source/x86_64/updateinfo | 1.0 MB 00:00:00 (4/5): epel/x86_64/primary_db | 6.9 MB 00:00:00 (5/5): epel-source/x86_64/primary_db | 2.5 MB 00:00:00 No package php-soap available. Error: Nothing to do [root@host ~]# ^C [root@host ~]#
-
Dear All. Now I am trying to send Soap to server by PHP code I install composer and require soapclient but on my PHP code is fail This is my command for composer composer require phpro/soap-client This is PHP code file name testSendSMS.php require_once 'vendor/autoload.php'; $operator = "http://ltcservice..com:5577/Services.asmx?WSDL"; $privateKey = "BDX89Cxfpp"; $headerSMS = "TEST"; // TEST $userid = "BDX"; $txtTel ="2059545445659"; $newRegCode_exp = rand(); $messageBody = "Test SMS"; //$serverIP = $_SERVER['REMOTE_ADDR']; $serverIP = "172.28.17.61"; $trans_id = "BDX".rand(); //$trans_id = "123456"; $data = $serverIP.$trans_id; $messageBody = $serverIP.$trans_id; echo '<br/>'.$data. " >=> " . exec("java -jar encrypt.jar ".$data." ".$privateKey, $key); echo '<br/>'.$key[1]. " >=> " . exec("java -jar decrypt.jar ".$key[1]." ".$privateKey, $output); echo '<br/> encrypt result >=> '.$key[0]; if($key[0]=="OK"){ $header = array('userid' => $userid, 'trans_id' => $trans_id, 'key' => $key[1], ); echo '<br/>'; print_r($header); $client = new SoapClient($operator); $msg = array( 'msisdn' => $txtTel, 'message' => $messageBody, 'headerSMS' => $headerSMS, 'header' => $header, ); $requestmsg = array('msg'=>$msg); echo '<br/>'; print_r($msg); $data = $client->SendSMS($requestmsg); echo '<br/>'; print_r($data); } Error Fatal error: Uncaught Error: Class 'SoapClient' not found in C:\xampp\htdocs\sms\SEND_SMS\testSendSMS.php:27 Stack trace: #0 {main} thrown in C:\xampp\htdocs\sms\SEND_SMS\testSendSMS.php on line 27
-
Hi, I buy a private hosting for my website and they give me WHM and Cpanel. So on terminal I checked and server installed Composer. but I don't know how to use it. My question is How can I use composer for my website?
-
I have a chat system, admin and guest chat. on Admin. After Login I created javascript to send ajax every 5 seconds to server to update status online on guest also. My problem is admin login on chrome and they go to another software or do another work but still login to chrome. sometimes I found javascript or ajax not send to server setInterval(function () { fetch_user(); update_chat_history_data(); }, 5000); Any way I can update admin status after they login and go another software or interface
-
Dear All, I would like to create a json a below format { "data": [ { "datetime": "2021-05-12", "history": [ { "name": "ABC", "feel": 1, "cough": 0, "fever": 1, "headache": 1, "tired": 0, "appetite": 0, }, { "name": "DEF", "feel": 1, "cough": 0, "fever": 1, "headache": 1, "tired": 0, "appetite": 0, } ] }, { "datetime": "2021-05-13", "history": [ { "name": "ABC", "feel": 1, "cough": 0, "fever": 1, "headache": 1, "tired": 0, "appetite": 0, }, { "name": "DEF", "feel": 1, "cough": 0, "fever": 1, "headache": 1, "tired": 0, "appetite": 0, } ] }, { "datetime": "2021-05-14", "history": [ { "name": "ABC", "feel": 1, "cough": 0, "fever": 1, "headache": 1, "tired": 0, "appetite": 0, }, { "name": "DEF", "feel": 1, "cough": 0, "fever": 1, "headache": 1, "tired": 0, "appetite": 0, } ] } ] } But I need to select database 2 time because information need to group by date so my PHP like below $myArray = array(); $stmt = $conn->prepare("SELECT survay_date FROM tb_feedback WHERE app_ID = ? GROUP BY CAST(survay_date AS DATE) ORDER BY survay_date DESC"); $stmt->bind_param("s", $data->{'app_id'}); $stmt->execute(); $res = $stmt->get_result(); if($res->num_rows==0){ header('Content-Type: application/json'); $json = array(); $myArray['data'] = $json; echo json_encode($myArray);die(); } while($row = $res->fetch_array(MYSQLI_ASSOC)) { $myArray['data'][] = array_push($row,array("A","B")); $statement = $conn->prepare("SELECT tb_register.firstname,tb_feedback.feel,tb_feedback.cough,tb_feedback.fever,tb_feedback.headache,tb_feedback.tired,tb_feedback.appetite,tb_feedback.swelling FROM tb_feedback INNER JOIN tb_register ON tb_register.id = tb_feedback.user_id WHERE tb_feedback.app_ID = ? AND tb_feedback.survay_date = ?"); $statement->bind_param("s", $data->{'app_id'}); $statement->bind_param("s", $row['survay_date']); $statement->execute(); $result = $statement->get_result(); while($infor = $result->fetch_array(MYSQLI_ASSOC)) { $myArray['data'][] = $infor; } } header('Content-Type: application/json'); echo json_encode($myArray); So, How can I create the json format like that?
-
PHP, create json from inner join table
nitiphone2021 replied to nitiphone2021's topic in PHP Coding Help
Yes, but how we create the query to be the json format like my target? -
Dear All, As I would like to create json as below format { "data": [ { "title": "After getting a COVID-19 Vaccine", "content": [ { "list": "You may have some side effects, which are normal signs that your body is building protection." }, { "list": "Following symptoms can take place, and it usually resolves within 2 to 3 days." }, { "list": "Common Side Effects pain, redness, swelling, warmth, nausea, muscle pain, tiredness, headache" } ] }, { "title": "After getting a COVID-19 Vaccine", "content": [ { "list": "You may have some side effects, which are normal signs that your body is building protection." }, { "list": "Following symptoms can take place, and it usually resolves within 2 to 3 days." }, { "list": "Common Side Effects pain, redness, swelling, warmth, nausea, muscle pain, tiredness, headache" } ] } ] } The information is from mysql select command: SELECT (tb_helpinfo.title_eng) as title,(tb_helpdetail.content_eng) as content FROM tb_helpinfo INNER JOIN tb_helpdetail ON tb_helpinfo.id = tb_helpdetail.helpinfo_id How could I make json like that from mysql information?