15,890,512 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Member 10390715 (Top 78 by date)
Member 10390715
13-Mar-17 3:36am
View
Thanks you. And this is my solve. I enable SSH by root user.
open sshd configuration file /etc/ssh/sshd_config and change line:
FROM:
PermitRootLogin prohibit-password
TO:
PermitRootLogin yes
And I don't need use "sudo"
Member 10390715
2-Mar-17 3:56am
View
Ok, I understand. But now I have edit sudoers file to
apache ALL=(root) NOPASSWD: /usr/local/bin/reboot.sh
And enter browers http://192.168.0.203/IPU-GUI/website2/reboot.php.
But it still not work. :(
Member 10390715
2-Mar-17 3:37am
View
But when I run echo "$USER" > /tmp/www_script_user.txt in command line windows ====> resutl is root.
How can I switch user, and run PHP with apache user?
Member 10390715
2-Mar-17 3:30am
View
I don't know but here :(
[root@IPU ~]# ps -aux|grep apache
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.7/FAQ
apache 2625 0.0 0.6 66364 6444 ? S 22:28 0:00 /usr/sbin/httpd
apache 2626 0.0 0.6 66364 6444 ? S 22:28 0:00 /usr/sbin/httpd
apache 2627 0.0 0.6 66364 6444 ? S 22:28 0:00 /usr/sbin/httpd
apache 2628 0.0 0.6 66364 6444 ? S 22:28 0:00 /usr/sbin/httpd
apache 2629 0.0 0.6 66364 6444 ? S 22:28 0:00 /usr/sbin/httpd
apache 2630 0.0 0.4 66364 4956 ? S 22:28 0:00 /usr/sbin/httpd
apache 2631 0.0 0.6 66364 6444 ? S 22:28 0:00 /usr/sbin/httpd
apache 2632 0.0 0.4 66364 4956 ? S 22:28 0:00 /usr/sbin/httpd
root 3268 0.0 0.0 4028 700 pts/0 S+ 22:32 0:00 grep apache
Member 10390715
2-Mar-17 3:29am
View
Deleted
file:///C:/Users/Napoleon/Desktop/Capture.JPG
Member 10390715
2-Mar-17 2:53am
View
Hi, I use this:
echo "$USER" > /tmp/www_script_user.txt and result is root
Member 10390715
1-Mar-17 4:50am
View
But How can I find PHP script user?
Member 10390715
28-Feb-17 1:16am
View
Thanks Darren
Member 10390715
7-Feb-17 21:08pm
View
I found some library as Bouncy Castle and Spongy Castle.
How about this?
Member 10390715
7-Sep-15 21:22pm
View
Thanks for help. I must learn more and more
Member 10390715
7-Sep-15 21:12pm
View
Thanks for your help!
Member 10390715
31-Jul-15 4:50am
View
yes. I just want list table name in one database. How can I fix it?
Member 10390715
31-Jul-15 2:48am
View
Hello, I use this query:
SELECT table_name FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME LIKE '%nh%'
And mysql return me the result I want.
Now I make a fuction in C# like this to get table name return into combobox. But it not work.
What wrong with it?
<pre lang="c#">
string myConnection = "Server=localhost;Database=data;Port=3306;User ID=root;Password=;Charset=utf8";
string query = "SELECT table_name FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME LIKE '%nh%'";
conDatabase = new MySqlConnection(myConnection);
MySqlCommand cmdDataBase = new MySqlCommand(query, conDatabase);
MySqlDataReader myReader;
try
{
conDatabase.Open();
myReader = cmdDataBase.ExecuteReader();
cb_data_name.Items.Clear();
if (myReader.HasRows == true)
{
while (myReader.Read())
{
cb_chon.Items.Add((string)myReader[0]);
}
}
}
catch
{
}
</pre>
Member 10390715
31-Jul-15 2:16am
View
Yes. I want to list table name in mysql database
Member 10390715
29-Jul-15 2:20am
View
Your code dose not work. I click "yes" many time but it still question me "Sure?"
Member 10390715
29-Jul-15 0:12am
View
thank for your help
Member 10390715
8-Jun-15 6:05am
View
Thanks for your help, I forget "header('Content-type: application/json');" in my PHP code.
Member 10390715
28-May-15 21:48pm
View
thanks for your help
Member 10390715
28-May-15 5:47am
View
I don't know jQuery, so I have solution like this. Thanks for your help
function changeValue()
{
var newVal = document.getElementById('txtText').value;
//document.getElementById("myVideo").innerHTML = '';
document.getElementById("myVideo").innerHTML = '';
//document.write(newVal+".mp4");
myVideo.load();
myVideo.play();
}
Member 10390715
24-Feb-15 1:51am
View
Thank you for your comment.
Member 10390715
24-Feb-15 0:44am
View
Yes. I want to find ang draw the contour around object in my java application. I found the source code can do it, but opencv use for C++. I don't know how to use it in java. I tried to use it in java.
Member 10390715
24-Feb-15 0:39am
View
Thanks for your comment
Member 10390715
16-Feb-15 4:17am
View
Thank you for your help. I will try it.
Member 10390715
16-Feb-15 1:20am
View
Thank. Both of address exists.I still use both address.
As to security, I use "abc@gmail.com" and "xyz@gmai.com" for example.
Member 10390715
15-Feb-15 23:51pm
View
No, it is silent.
Member 10390715
13-Feb-15 2:49am
View
Thank you. I format in "d/MM/yyyy".
For example,I add date to database is "13/2/2015" and I want retrieve this value in textfile when I click mouse in table. But when I use this code:
Date add2 = rs.getDate("Date");
txt_date.setDate(add2);
I only receive date is 1/1/1970. I don't know how to fix it.
Member 10390715
4-Dec-14 11:00am
View
Hehehe, maybe, I just learned PHP by myself about 2 months. There are many things I do not know. I will check and answer you. Thanks.
Good night.
Member 10390715
4-Dec-14 10:55am
View
I'm very excited. I will check and answer you tomorrow. Good night.
Member 10390715
4-Dec-14 10:52am
View
No, it does not add to the database mysql. For example, first my image store in disk D. When I upload, It appear on wamp/www/nhan_vien. And I think in another PC, It not work.I'm not sure, but I think so.
Member 10390715
4-Dec-14 10:46am
View
Really? I will try it. I answer you tomorrow.
Member 10390715
4-Dec-14 10:43am
View
No,This code is only use with the same PC running wampserver. I want upload image to nhan_vien from another PC.
Member 10390715
4-Dec-14 10:39am
View
yes.
Member 10390715
4-Dec-14 10:37am
View
Yeah, but It also works :). I will remember this.
Member 10390715
4-Dec-14 10:31am
View
"nhan_vien" is a folder I store image. It is wamp/www/nhan_vien. This code is only use with the same machine running wampserver.
Member 10390715
4-Dec-14 10:23am
View
I mysql, I set default Hinh = null and if I don't add image to Hinh, it not error.
Member 10390715
4-Dec-14 10:20am
View
Here is my code:
<pre lang="PHP">
<!--?php<br /-->
if($_POST["Card_ID"] !="" && $_POST["Ten"] != "")
//if(isset($_POST["Card_ID"]) && isset($_POST["Ten"]))
{
$Card_ID = $_POST["Card_ID"];
$Ma_nv = $_POST["Ma_nv"];
$Ten = $_POST["Ten"];
$Phong_ban = $_POST["Phong_ban"];
$Chuc_vu = $_POST["Chuc_vu"];
$Hinh ="";
//kiem tra hình xem đúng không
if($_FILES["file"]["error"] >0)
{
echo "Error: ". $_FILES["file"]["error"]."<br />";
exit;
}
//neu dung upload
else
{
move_uploaded_file($_FILES["file"]["tmp_name"],"nhan_vien/".$_FILES["file"]["name"]);
$luutru = "Lưu trữ tại: "."nhan_vien/".$_FILES["file"]["name"];
$Hinh = $_FILES["file"]["name"];
}
$sql = "INSERT INTO tt_nhanvien VALUES ( '$Card_ID','$Ma_nv','$Ten', '$Phong_ban', '$Chuc_vu','$Hinh')";
$result = mysql_query($sql,$db);
</pre>
Member 10390715
4-Dec-14 10:14am
View
Deleted
Here is my code:
<pre lang="PHP">
0)
{
//echo "Error: ". $_FILES["file"]["error"]."<br />";
//exit;
}
//neu dung upload
else
{
move_uploaded_file($_FILES["file"]["tmp_name"],"nhan_vien/".$_FILES["file"]["name"]);
$luutru = "Lưu trữ tại: "."nhan_vien/".$_FILES["file"]["name"];
$Hinh = $_FILES["file"]["name"];
}
$sql = "INSERT INTO tt_nhanvien VALUES ( '$Card_ID','$Ma_nv','$Ten', '$Phong_ban', '$Chuc_vu','$Hinh')";
$result = mysql_query($sql,$db);
if($result)
{
echo "<p align='center'>
Thêm thông tin thành công!
</p>";
// nếu thêm thông tin thành công thì in ra thông tin chi tiết
$sql= "SELECT * FROM tt_nhanvien WHERE Ten LIKE '$Ten'"; // chỉ chọn đúng tên laptop request
$result = mysql_query($sql);
//xuat dữ liệu
if(mysql_num_rows($result)<>0)
{
echo "<table width='800' border='1' align='center'cellpadding='0' cellspacing='0' border='1' style='border-collapse:collapse #FF6600'>";
while($row = mysql_fetch_row($result))
{
$Card_ID= $row[0];
$Ma_nv = $row[1];
$Ten = $row[2];
$Phong_ban = $row[3];
$Chuc_vu = $row[4];
$Hinh = "nhan_vien/".$row[5];
$Hinh = "<img src ='$Hinh' alt='$Ten'>";
echo "<tr><td align='center' colspan='2' bgcolor='#FFEEE6' >
$Ten</td></tr>";
echo"<tr>";
echo"<td align='center' valign='middle'>$Hinh</td>";
echo "<td>";
echo "<table align='center'";
echo "<td>
Card ID:
$Card_ID</td></tr>";
echo "<tr><td>
Mã nhân viên:
$Ma_nv</td></tr>";
echo "<tr><td>
Tên:
$Ten</td></tr>";
echo "<tr><td>
Phòng ban:
$Phong_ban</td></tr>";
echo "<tr><td>
Chức vụ:
$Chức vụ</td></tr>";
echo "</table>";
echo "</td>";
echo "<tr align='right'><td>
Quay về trang menu
</td></tr>";
echo "</tr>";
}
echo "</table>";
}
}
}
else
{
echo "<p align='center'>
MỜI BẠN NHẬP THÔNG TIN!
</p>";
echo "<p align='center'><td>
Quay về trang menu
</td></tr>";
}
?>
</pre>
Member 10390715
4-Dec-14 10:13am
View
You guide me "How to convert longblob to image in php?". Do you remember?
Member 10390715
4-Dec-14 9:58am
View
No.
For example, I use mini computer Raspberry Pi (192.168.1.7) as a webserver. I connect my laptop (192.168.1.4) directly Raspberry Pi. Then I open browser type 192.168.1.7, it will send me webpage from webserver. I also make a php webpage to add data to mysql. With the image, I add the name of the image to mysql. Then I use USB copy image from my laptop to Raspberry Pi store it in folder /www/ on wamp server. I'll display image by name, like this:
<pre lang="PHP">
....
$Hinh = "www/".$row[5];
$Hinh = "<img src = '$Hinh' alt='$Ten'>";
echo $Hinh;
</pre>
But I do not like this. I don't like use USB to copy. I want to make a webpage like registration page. I can upload my avartar to this page.
But I don't know.
Sorry if my english is not good.
Member 10390715
4-Dec-14 9:30am
View
Now, I not really too necessary. Because, earlier I can't convert binary become image and I try to copy image to /www/ folder automatic.
I can write code upload to server, but in the same PC.If you know, I willing to learn. Thanks
Member 10390715
4-Dec-14 9:17am
View
Deleted
Now, I not really too necessary. Because, earlier I can't convert binary become image and I try to copy image to /www/ folder automatic.
I can write code upload to server, but in the same PC.If you know, I willing to learn. Thanks
Member 10390715
4-Dec-14 9:05am
View
You're very nice. Thank you very much!
Member 10390715
30-Nov-14 6:18am
View
Thanks for your help
Member 10390715
30-Nov-14 6:17am
View
ok it work well, thanks for your help.
Member 10390715
14-Nov-14 2:43am
View
ok, I understand you. Thanks for your help
Member 10390715
14-Nov-14 2:33am
View
Thanks.Because, first I make a table with name "192.168.1.7" and write code, I have error near the name "192.168.1.7". Then I make the same table with name "tt_control" and use this code to check what wrong, It work well.It makes me hard to understand!
Member 10390715
13-Nov-14 11:40am
View
I try with your comment but it is still error.
Member 10390715
13-Nov-14 3:12am
View
thanks you, I try it
Member 10390715
10-Nov-14 4:25am
View
Deleted
I have 2 subroutine:
def connect_remote():
try:
db=MySQLdb.connect("192.168.137.1","root_a","","luan_van")
return 1
except MySQLdb.OperationalError, e:
if e[0] ==2003:
return 0 #this code uses to check connection alive
Member 10390715
10-Nov-14 4:15am
View
Thank you
Member 10390715
22-Oct-14 6:45am
View
Thanks, I will see it :D
Member 10390715
4-Oct-14 9:01am
View
thank for your help.
Member 10390715
3-Oct-14 12:17pm
View
sorry, Should I change mysql database address (in Laptop have IP 192.168.1.10)?
How do you change MYSQL's localhost to your IPAddress?
Can you show me?
Member 10390715
3-Oct-14 12:11pm
View
thanks, I will try it
Member 10390715
3-Oct-14 12:11pm
View
thanks, I will try it
Member 10390715
2-Oct-14 9:19am
View
ok
Member 10390715
29-Sep-14 12:40pm
View
Thank for your help.
Member 10390715
28-Sep-14 23:28pm
View
thank you
Member 10390715
15-Sep-14 12:42pm
View
Thanks, for your help. Because I try to read RFID tag and compare with database store in SD card using arduino so try read SD card first.
Member 10390715
3-Sep-14 4:14am
View
Thanks, I was successful. hehe
Member 10390715
3-Sep-14 2:33am
View
private void btn_show_Click(object sender, EventArgs e)
{
Khach = new TcpClient();
Khach.Connect(IPAddress.Parse(IP), PORT);
while (true)
{
try
{
byte[] imgg = new byte[1024];
MemoryStream ms = new MemoryStream(imgg);
pictureBox1.Image = System.Drawing.Image.FromStream(ms);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}
Right here, I try to receive image bytes through socket and display it in picturebox
Member 10390715
2-Sep-14 13:20pm
View
Yeah, I will be write after I finished thesis. Now now I'm busy. Hehehe
Member 10390715
2-Sep-14 12:01pm
View
My code so long, if you interest, give me your mail.
Member 10390715
2-Sep-14 11:58am
View
Thanks
Member 10390715
2-Sep-14 11:55am
View
Deleted
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.IO;
using System.IO.Ports;
using System.Threading.Tasks;
using System.Media;
using Emgu.CV;
using Emgu.CV.Structure;
using Emgu.CV.UI;
using Emgu.CV.CvEnum;
using Emgu.CV.GPU;
namespace GUI
{
public partial class Form2 : Form
{
//frmchinh frm_chinh;
int intlen = 0;// timer 1
int[] khoa = new int[50];//RFID
int i = 0;// RFID
private Capture capture; //takes images from camera as image frames
private bool captureInProgress;
private bool flat = true; // rfid
public Form2()
{
InitializeComponent();
load_table();//load table tự động
timer1.Start();
open_camera();
Application.Idle += send_always;// goi event lien tuc
}
private void btn_save_Click(object sender, EventArgs e)
{
try
{
//chụp ảnh bằng webcam
capture_anh();
// chuyển ảnh thành byte
byte[] imageBt = null;
FileStream fstream = new FileStream("E:\\DAMH2.jpg", FileMode.Open, FileAccess.Read);
BinaryReader br = new BinaryReader(fstream);
imageBt = br.ReadBytes((int)fstream.Length);
txt_datevao.Text = dateTimePicker1.Value.ToString();
// kết nối cơ sở dữ liệu
string constring = "Data Source=DELL-PC;Initial Catalog=GUI ;Integrated Security=True";
string Query = "insert into tbl_thongtin(CardID,BienSoXe,ThoiGianVao,Image) values(' " + this.txt_ID.Text + " ',' " + this.txt_soxe.Text + " ',@date,@image);";
SqlConnection conDataBase = new SqlConnection(constring);
SqlCommand cmdDataBase = new SqlCommand(Query, conDataBase);
SqlDataReader myReader;
cmdDataBase.Parameters.AddWithValue("@date", DateTime.Now);
cmdDataBase.Parameters.AddWithValue("@image", imageBt);
try
{
conDataBase.Open();
myReader = cmdDataBase.ExecuteReader();
MessageBox.Show("SAVE");
while (myReader.Read())
{
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
load_table();
show_data(txt_ID.Text);
}
catch
{
MessageBox.Show("KHÔNG PHÁT HIỆN BIỂN SỐ");
}
}
private void btn_delete_Click(object sender, EventArgs e)
{
string constring = "Data Source=DELL-PC;Initial Catalog=GUI;Integrated Security=True";
string Query = "delete from tbl_thongtin where CardID=' " + this.txt_ID.Text + " ';";
SqlConnection conDataBase = new SqlConnection(constring);
SqlCommand cmdDataBase = new SqlCommand(Query, conDataBase);
SqlDataReader myReader;
try
{
conDataBase.Open();
myReader = cmdDataBase.ExecuteReader();
MessageBox.Show("DELETE");
while (myReader.Read())
{
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
load_table();
txt_ID.Text = "";
}
private void btn_update_Click(object sender, EventArgs e)
{
byte[] imageBt = null;
FileStream fstream = new FileStream("E:\\DAMH2.jpg", FileMode.Open, FileAccess.Read);
BinaryReader br = new BinaryRea
Member 10390715
2-Sep-14 2:03am
View
thanks you, I will try it :)
Member 10390715
1-Sep-14 9:57am
View
Thanks, I will try!
Member 10390715
1-Sep-14 5:06am
View
ok, sorry and thanks, I will see it
Member 10390715
1-Sep-14 3:49am
View
My thesis is "Smart parking using process Images and RFID technology". Thanks!
Member 10390715
1-Sep-14 3:48am
View
Sorry, I don't know. My thesis is "Smart parking using process Images and RFID technology". I have done about 90%. I have recognized the vehicle number plate from photos, separating each character, read RFID tag.... I just do not know how to convert from character image to text characters to store in the database. Only this.
My major is telecom not IT, my C# skill is not good enough. Thanks!
Member 10390715
27-Aug-14 9:13am
View
Thanks, I will try it.
Member 10390715
26-Aug-14 12:36pm
View
thanks
Member 10390715
26-Aug-14 10:40am
View
but I don't know, how to make it. Can you tell me?
Member 10390715
26-Aug-14 10:27am
View
thanks
Member 10390715
26-Aug-14 9:36am
View
FileStream fs = File.Create("1.jpg");
fs.Write(buffer, 0, buffer.Length);
if i have this code, image will be save, but it send only one time because repeat name 1.jpg in folder. But if i don't have this code, it won't save image. How can i fix it?
Member 10390715
14-Jun-14 4:00am
View
Thanks you,but what command I send data to serialport?
serialPort1.Write("string text only")?
Member 10390715
16-May-14 11:15am
View
ok thanks
Member 10390715
16-May-14 11:04am
View
Can you give me link to download new tesseractengine3.dll, I search in google but another is same error
Show More