|
For those new to message boards please try to follow a few simple rules when posting your question.- Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
- Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
- Keep the subject line brief, but descriptive. eg "File Serialization problem"
- Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
- Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
- Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
- If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode "<" (and other HTML) characters when pasting" checkbox before pasting anything inside the PRE block, and make sure "Use HTML in this post" check box is checked.
- Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
- Please do not post links to your question into an unrelated forum such as the lounge. It will be deleted. Likewise, do not post the same question in more than one forum.
- Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
- If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
- No advertising or soliciting.
- We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
cheers,
Chris Maunder
The Code Project | Co-founder
Microsoft C++ MVP
|
|
|
|
|
Apologies for the shouting but this is important.
When answering a question please:
- Read the question carefully
- Understand that English isn't everyone's first language so be lenient of bad spelling and grammar
- If a question is poorly phrased then either ask for clarification, ignore it, or mark it down. Insults are not welcome
- If the question is inappropriate then click the 'vote to remove message' button
Insults, slap-downs and sarcasm aren't welcome. Let's work to help developers, not make them feel stupid.
cheers,
Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
|
|
|
|
|
I am making php page.
In my php page, exit() function calls in serveral places and i declared sqlite3::open() function in first line of php.
Closing db before each exit function makes code complex.
So i don't close sqlite db at the end is ok?
Please help me 
|
|
|
|
|
Member 14490964 wrote: In my php page, exit() function calls in serveral places You need to redesign your page.
|
|
|
|
|
|
Detail of what? We have no idea what your code does or why. It is up tp you to review it and figure out why you have all these exit calls, and why you are leaving open databases if the code terminates.
|
|
|
|
|
please sir, i am new in web application development. and i am in desprate need of PHP and MSQLI codes that can link my php page to a form in excel sheet and at after the form is filled, once i click the send button it sends the information to database.
|
|
|
|
|
|
I am using xampp apache server.
The server domain is registered in cloudflare.
All works well.
But cloudflare ip is saved in access.log
So I have done googling about restore real ip of cloudflare.
But I only found the way in linux apache server.
How can i resotore real ip in access.log of xampp server registered in cloudflare.
|
|
|
|
|
Does anyone know about some good articles/tutorials regarding the Rocket Framework of Rust. The documentation is good but reading someone's tutorial will help much more. I have looked at some articles, for eg Frogtok this article here. It seems to clear some concepts but it will be much better if I can look more. Thanks in advance 
|
|
|
|
|
This is called spamming and very much frowned upon.
Social Media - A platform that makes it easier for the crazies to find each other.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
Hi all,
I did a small database and web page to help me control the time I work for my customers...
Today I've thought on adding graph capabilities to perform reports.
Given this thing is coded using PHP, some jquery and used a MySQL database, what would you recommend me?
I'm searching for a good looking free graph library.
Thank you all!
|
|
|
|
|
I want to redirect from http to https using express framework.
It is my code and it works properly, but i am not sure is it right way to redirect from
http to https. Anybody knows is my solution right?
var fs = require('fs');
var https = require('https');
var config = require( ".\\config\\config.json");
var folder = __dirname + '\\SSLCERT\\';
var fkey = folder + 'privatekey.key';
var fcert = folder + 'certificate.crt';
var privateKey = fs.readFileSync(fkey, 'utf8');
var certificate = fs.readFileSync(fcert, 'utf8');
var credentials = {key: privateKey, cert: certificate};
var express = require('express');
var app = express();
var https_mode = false;
app.get('/', function (req, res) {
if (https_mode == false) {
res.redirect('https://localhost:' + config.port_https);
https_mode = true;
}
else{
res.send('Hello World!!!');
https_mode = false;
}
})
app.listen(config.port_http,()=> {
console.log('listening on ' + config.port_http);
});
var httpsServer = https.createServer(credentials, app);
httpsServer.listen(config.port_https, () => {
console.log('listening on ' + config.port_https) });
|
|
|
|
|
Hi All,
I have a thousand odd points of data, (city,state) describing the countries top high schools. I was wondering what an effective way to graph this would be.
I have the data in a PDF, so I'm currently working on scraping that into .CSV form.
Does the city/state location need to by long/latitude? I see a number of tools out there, just wondering what is the easiest to get started on a project like this.
My background is Linux Admin, some HTML and of course bash scripting. I would like to learn how to do this using golang if possible.
Thansk!
|
|
|
|
|
I think other people can give better answers but if all goes to hell, you can try with Python. Python has extensive libraries to help you in this regard.
|
|
|
|
|
if an airline booking tickets website is hard to do ?
and what is best website idea i can do it for a project?
|
|
|
|
|
moustafa arabi wrote: airline booking tickets website is hard to do ? Extremely unless you are only doing this as a learning exercise that will never go into production. It can be fascinating winkling out all the nuances required for passenger booking.
I found the best training method (besides working through a book or two) was to pick a hobby you or a friend knows and build a solution based on that. Then you have the domain knowledge available to you.
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
I don’t know if this question belongs to this forum.
I'm developing a website with vb.net web application using visual studio 2015 where a client is able to download a pdf file and I have considered 2 approaches as follows.
Dim sqlcom As New SqlCommand("select bookcontent,bookname from books where bookn=" & Page.RouteData.Values("bookn").ToString & "", conn)
Dim da As New SqlDataAdapter(sqlcom)
Dim ds As New DataTable
da.Fill(ds)
Dim filename As String = ds.Rows(0)("bookcontent").ToString
Dim fff As String = ds.Rows(0)("bookname").ToString
Dim fileInfo As FileInfo = New FileInfo(filename)
If fileInfo.Exists Then
Response.Clear()
Response.Buffer = True
Response.Charset = ""
Response.Cache.SetCacheability(HttpCacheability.NoCache)
Response.ContentType = "Application/pdf"
Response.ContentType = "application/ms-word"
Response.AddHeader("Content-Disposition", "inline; filename=""" & ds.Rows(0)("bookname").ToString & ".pdf" & """")
Response.AddHeader("Content-Length", fileInfo.Length.ToString())
Response.TransmitFile(filename)
Response.Flush()
HttpContext.Current.ApplicationInstance.CompleteRequest()
I'm having trouble with the first approach above because when downloaded start the website
Hang on until pdf file fully downloaded to client PC ,this is bad since website will be access
By thousand of users every day,so I want to make the download process asynchronous.
I use the .NET Framework WebClient class in the second approach:
Dim Client As New WebClient
Dim weburl As String= ....here is some procedure to get url
Client.DownloadFileAsync(New Uri(weburl), @"c:\myfile.pdf")
But the problem here is that a path must be set and I want clients to get the file in the default download folder according to the Internet browser they use and the download process not appear through browser user can't see downloading file progress .
I will very much appreciate any comment that points me in the direction to solve this issue.
Thanks a lot.
|
|
|
|
|
The second approach isn't going to work, your code is running on the server so when you download to c:\myfile.pdf it will download from the url to that path on the server and not the client's machine. It might appear to work when running the site locally, but that is only because the client and server are the same machine, when you host it remotely it'll stop working.
You'll need to stick with the first method but I wouldn't worry about it, just let IIS deal with the threading for you.
|
|
|
|
|
|
|
Amer Amer wrote: Dim sqlcom As New SqlCommand("select bookcontent,bookname from books where bookn=" & Page.RouteData.Values("bookn").ToString & "", conn) Your code is vulnerable to SQL Injection[^]. NEVER use string concatenation to build a SQL query. ALWAYS use a parameterized query.
Dim ds As New DataTable
Using sqlcom As New SqlCommand("select bookcontent,bookname from books where bookn = @bookn", conn)
sqlcom.Parameters.AddWithValue("@bookn", Page.RouteData.Values("bookn"))
Dim da As New SqlDataAdapter(sqlcom)
da.Fill(ds)
End Using
If ds.Rows.Count <> 0 Then
Dim filename As String = ds.Rows(0).Field(Of String)("bookcontent")
Dim fff As String = ds.Rows(0).Field(Of String)("bookname")
Dim fileInfo As FileInfo = New FileInfo(filename)
If fileInfo.Exists Then
Response.Clear()
Response.Cache.SetCacheability(HttpCacheability.NoCache)
Response.ContentType = "application/pdf"
Response.AddHeader("Content-Disposition", "inline; filename=""" & fff & ".pdf" & """")
Response.AddHeader("Content-Length", fileInfo.Length.ToString())
Response.TransmitFile(filename)
Response.Flush()
Context.ApplicationInstance.CompleteRequest()
Return
End If
End If Everything you wanted to know about SQL injection (but were afraid to ask) | Troy Hunt[^]
How can I explain SQL injection without technical jargon? | Information Security Stack Exchange[^]
Query Parameterization Cheat Sheet | OWASP[^]
As already mentioned, this is the only way to send the file to the user. IIS is pretty good at handling file transfers; requests from other users shouldn't be blocked whilst the file is downloading.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
thank for the support Its work, your code very useful and your advice is valuable.
modified 10-Jun-20 17:14pm.
|
|
|
|
|
I'm trying to decide here.
If I create an account on my Web App, using my email address [email protected], and then later I'm offered the opportunity to login to my Web App using Google SignIn; because I just wrote the code to add this feature, and elected to use it.
A:
Should I use googleUser's email address ([email protected]) as the account name, because I want to create an account to represent the user. But id the email is in use already, just update the login, and use the googleUser token to authenticate again, to AuthGuard.
Pro's:
I can login using either method to the same account.
Con's:
I can't really think of any, which is why I'm asking. Am I over looking something, perhaps someone's experience can say ... "No don't do that because ...".
B:
Use googleUsers first and last name, and sort of create a new account name from it that is unique.
Pro's:
I can't think of any
Con's:
EBay did this to me, and I ended up with 2 EBay accounts; didn't realize it for months, and really wish I just had the one.
Sounds like a dumb question, but wanted to ask before going into production mode.
If it ain't broke don't fix it
Discover my world at jkirkerx.com
|
|
|
|