Click here to Skip to main content
15,885,546 members
Home / Discussions / Web Development
   

Web Development

 
GeneralRe: not close sqlitedb in php is ok? Pin
Richard MacCutchan4-Jul-20 21:44
mveRichard MacCutchan4-Jul-20 21:44 
Questionweb development: php, MSQLI Pin
baalfire4-Jul-20 1:16
baalfire4-Jul-20 1:16 
AnswerRe: web development: php, MSQLI Pin
Richard MacCutchan4-Jul-20 3:36
mveRichard MacCutchan4-Jul-20 3:36 
AnswerRe: web development: php, MSQLI Pin
ellegonzalez26-Dec-20 5:45
ellegonzalez26-Dec-20 5:45 
Questionrestore real ip to access.log of xampp apache server registered in cloudflare Pin
Member 144909643-Jul-20 21:12
Member 144909643-Jul-20 21:12 
QuestionMessage Removed Pin
2-Jul-20 8:04
Saim Irfan2-Jul-20 8:04 
Questionwhat would you recommend me to use graphs in PHP+MySQL? Pin
Joan M18-Jun-20 9:49
professionalJoan M18-Jun-20 9:49 
Questionnode js express redirect from http to https Pin
Oscar K.13-Jun-20 1:45
Oscar K.13-Jun-20 1:45 
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?

JavaScript
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) });

QuestionPlotting points on interactive map Pin
StampedePress9-Jun-20 5:07
StampedePress9-Jun-20 5:07 
AnswerRe: Plotting points on interactive map Pin
Saim Irfan2-Jul-20 7:58
Saim Irfan2-Jul-20 7:58 
Questionweb development Pin
moustafa arabi6-Jun-20 3:39
moustafa arabi6-Jun-20 3:39 
AnswerRe: web development Pin
Mycroft Holmes6-Jun-20 12:07
professionalMycroft Holmes6-Jun-20 12:07 
QuestionHow to successfully Async download a pdf file to a client PC vb.net web application Pin
Amer Amer5-Jun-20 22:47
Amer Amer5-Jun-20 22:47 
AnswerRe: How to successfully Async download a pdf file to a client PC vb.net web application Pin
F-ES Sitecore6-Jun-20 2:40
professionalF-ES Sitecore6-Jun-20 2:40 
AnswerRe: How to successfully Async download a pdf file to a client PC vb.net web application Pin
Richard Deeming8-Jun-20 0:24
mveRichard Deeming8-Jun-20 0:24 
GeneralRe: How to successfully Async download a pdf file to a client PC vb.net web application Pin
Amer Amer8-Jun-20 4:11
Amer Amer8-Jun-20 4:11 
QuestionGoogle SignIn and regular account, using the same email Pin
jkirkerx2-Jun-20 12:53
professionaljkirkerx2-Jun-20 12:53 
QuestionWhere can passwords for webpages be stored, except in browser itself and Credentials Manager? Pin
arnold_w18-May-20 21:23
arnold_w18-May-20 21:23 
AnswerRe: Where can passwords for webpages be stored, except in browser itself and Credentials Manager? Pin
Richard Deeming19-May-20 0:22
mveRichard Deeming19-May-20 0:22 
GeneralRe: Where can passwords for webpages be stored, except in browser itself and Credentials Manager? Pin
arnold_w19-May-20 9:16
arnold_w19-May-20 9:16 
GeneralRe: Where can passwords for webpages be stored, except in browser itself and Credentials Manager? Pin
Richard Deeming19-May-20 9:25
mveRichard Deeming19-May-20 9:25 
QuestionPHP: Filtering a Wordpress admin post list by role Pin
TectonicEng17-May-20 4:30
TectonicEng17-May-20 4:30 
SuggestionRe: PHP: Filtering a Wordpress admin post list by role Pin
Richard MacCutchan17-May-20 5:44
mveRichard MacCutchan17-May-20 5:44 
QuestionPowershell timer question Pin
Member 144746071-May-20 10:31
Member 144746071-May-20 10:31 
QuestionWeb API Design Question Pin
Kevin Marois30-Apr-20 8:33
professionalKevin Marois30-Apr-20 8:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.