Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    PHP




Force Https


I want to make sure people are on the secure version of a page (https). If a person is on the regular http, how can I force them to go to https?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Redirect From Http To Https And Then Back To Https To Http
I need help with redirect from http to https when I user click on register.php and abter he completes the form I want to redirect back to http.

How Do You Force A Download?
Hello, how do I force a file to be downloaded instead of displaying it? I have PHP and HTML files that I don't want to be displayed but downloaded. How would I do this?

Trying To Force A Login
I have an include file that I use to secure pages with a login. When I check the password, Im also trying to check the login date While testing, Im setting the time difference to less than 10 seconds. So the idea is that when i login, then come back to a protected page more than 10 seconds later, I should be forced to login again. However, im not getting forced to login after a 10 second wait. Code:

$sQuery = "Select iUser From Table Where sGUID = '$sGUID' and TIMEDIFF($login_date,LogInDate) < &#3900;:00:10'";
. . .
//so if no returned records...
header('Location: Login.php');

Force PHP CLI To Stay In RAM?
I have a couple of command-line PHP scripts that are often called, and
I was wondering if it were possible to have the PHP interpreter remain
in RAM instead of being removed after the scipts end?

Force Reload
Is there any way I can force my php scripts to reload everytime they are used ?

Force A Download
i know that when i place a .zip, or .exe in my web directory, the  browser automatically asled the user to download the file. however i want to place a PDF into my site, and only make it available as a download, becauase i know that especially with IE and Firefox, it reads it within the browser instead.

how can i have the file a download, instead of read?

Force Post?
I'm wondering if there's a way to force a post from one page to another, without the user having to send it in a form.

If not, how do you make a textbox in a form automatically conain a variable in it (the post from the last page)?

Zip Files, Then Force Download
Is there any examples or scripts that already will do this?

I need to zip an arbitrary amount of files, say maybe a $files array full of path names to the files filled dynamically from database based on an id number...

then i need it to automatically force a download of the zip file to the browser, then automatically delete the zip file when its finished...

Force A Number To Have 2 Decimals
I have a query, and one of the results is a number that I want to forcefully have rounded to 2 decimal places. I couldn't find a good search query to find this if it's been asked before How can I achieve it, so it's like 1.00 or 187.25

$_REQUEST With Force Download
Im using this code forom the code snipits bit of the forum, but cant work out how to enter the file name?

I tried$file = $_REQUEST['/var/www/html/file.mp3']
but it gave me the error: QuoteNotice: Undefined index: /var/www/vhosts/qrecords.co.uk/httpdocs/PumpUpThePirates.mp3 in /var/www/html/file.mp3 on line 2
Code:

Force A Page To Be Re-validated?
I'm trying to force a page to be re-validated every time someone views it, even when they click the back button. I'm currently using:

header("Expires: " . gmdate("D, d M Y H:i:s", strtotime("-1 year")) . " GMT");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Pragma: no-cache");

However, my pages still seem to display without the server being called when the back button is pressed.

Can anyone suggest the correct headers/code I can use to force the server to be re-called when the back button is pressed?

Force Download .adr File
I have a .adr file (Opera bookmarks) that I want users of my website to download. The problem is that when I open it in my browser, it shows up just like a .css or .txt file, but I want to automatically start to download the file. I know there is a way to do that in php, but I don't know how.

Force PHP Redirect Instead Of Displaying CGI Error
I am sure I found the answer before on here but I cant for the life of me find it now. I need to change the way one site in iis works when someone tries and goes to a non-existant php page, instead of displaying:

CGI Error
The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:

How To Force A Download Of An Html File
I'm making a poll management system, and when the administrator creates a new poll I want an html file (containing the actual voting form) to be automatically forced to download via the save as dialog. How is this done? Secondly, I would prefer it not to have to be written to the server first. I just want to dump all of the text in a string variable to the save dialog.

Force Browser Download Of Content
Ok, this isn't a "How do i force the browser to download my file..." question.

This is a bit different because what i want to give the user isn't a file.

I want to provide a copy of a database table as a CSV file.

(force) Delete A Session File, How?
I dunno if this is meant for here or apache anyway.. my script uses sessions... if the person logsout.. the session is closed and the session file is deleted.. if the person just shuts down the browser the session file is not deleted and hence i've got hundreds of redundant session files.

Force 2 Decimal Places For Currency
How can I force a value to retain 2 decimal places (or atleast display them)? E.G. force $19.90 to be displayed as such, not $19.9

How Best To Avoid Brute-force Looping?
I have a style/php question. (I am a C hacker by background, and
thus everything is a loop... But PHP is different...)

I write out my array and read it back in. It comes in thus:

Array (
[currentField] => 103
[brgf1] => 0.000000
[brgt1] => 1.000000
[axa1] => 1
[brgf2] => 2.000000
[brgt2] => 2.000000
[axa2] => 2
[axb2] => 2
[axc2] => 2
[axd2] => 2
[brgf3] => 2.000000
[brgt3] => 3.000000
[axa3] => 2
[axb3] => 2
[axc3] => 2
[axd3] => 2

.....
.....
)

Basically each line consists of two bearings and 4 true/false switches.
The line number in the schedule is apended to the name of the field.

In my C mind, this calls for a loop, bruteforcing our way and appending
the counter to each name....

But I *know* there is a more elegant PHP way to do this. While it makes
sense in C, it just looks fugly in PHP....

As I use PHP to generate the field names, I can change those if it makes
things easier....

Force Download On Win2k Server
My win2k server has read write and execute permissions throughout the entire account and I can't really change it without removing those permissions throught the entire account, so what I need to do is force download an exe file, since just linking to it tries to execute it on the server. Is there some way in PHP or ASP that I can force it to download and not execute?

Any Way To Force Implict Variable Definition Etc?
A lot of languages you can force implict variable definition, where you must declare your variables at the top of the function/code before it's used. This way you create less bugs using the wrong variable name, which may not crop up until later on....

How Do I Force A FRESH RELOAD Of A Page
I've built a few php scripts, but since its reloading the same page I can't get it to refresh the page. I've implemented some expire meta tag...but is there anyway I can try and force it to refresh?

How Do You Force Received: Variable In Mail()?
I was able to change my Return-Path parameter
seen in the full headers of email sent with mail().

Now I still see my userID in the parameter as shown here seen in my full
headers of my email sent.

Received: (from userID@localhost) by mydomain.com

Is There A PHP Function To Force A Browser Refresh
I have an html page that gets updated about once a week. I would like to FORCE the browser (IE, Firefox, Netscape, or Opera) to REFRESH when the user opens the page to ensure they receive the latest update. Been searching around for some php code to add to the page to accomplish this without success. Can anyone give me a steer to how to accomplish this.

Create/force A New Session ID Different From The Existing One?
Is there a way to create/force a new session ID different from the existing one?

Force Header To Download File
I've created a document system that allows our company to upload files and create documents for internal use. I've completed the system except for the download system. When a user uploads a physical file say a .xls it's uploads outside of the home dir so it's not accessible via the web to anyone.

I'm trying to figure out the standard method for creating a download link for such a file. what it's the most common method for this? How can I cause the header or browser to call and then dowload the said file?

Php COPY Command... Any Way To Force Chmod 0660?
I want to copy my MySQL table via copy(oldtable, newtable) but I hear that the mode it sets is 0777.... Is there any way to force it to be anything else?

How Do You Force Return-Path: Variable In Mail()?
I am sending email using the mail() function on a hosted account. I am
trying to override the RETURN-PATH variable but it is not working. The
server keeps overriding the variable I put in.

Here's what I have:
.....
$headers = "From: me <me@mine.com>
"
$headers .= "Return-Path: me <me@mine.com>
";
.....

When I send one to myself and display full headers, it shows my
userID@myserver.com as the Return-Path.

WWW-Authenticate: How To Force Password Login At Every Page Refresh ?
<!--
The following sample should authorize the user to log on the site.
This works once but after refreshing the browser, it does not prompt
again for login until all browser (IE 6) windows are closed and the
same page is opened.
I turned off all caching but still it does cache (as a refresh doen
not promt again).

How can I force the page to prompt for a password at every refresh

-->

<html>
<head>
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
<?php

$showall = false;
error_reporting (E_ERROR);

if (($PHP_AUTH_USER != "myname") || ($PHP_AUTH_PW != "mypass"))
{
header('WWW-Authenticate: Basic realm="Secure Login"');
header('HTTP/1.0 401 Unauthorized');
$showall = false;
}
else
{
error_reporting (E_ALL ^ E_NOTICE);
$showall = true;
}

if (!showall) {
echo "access denied";
} else {
?>

................

</head>
<body>

.................

<? } ?>

</body>
</html>

How To Allow Downloaded Files To Be Splitted When Using A Force-download Script ?
I suppose you all know force-download scripts. The problem is that
these scripts don't allow files to be splitted when downloading them
via a download manager.
I've found a solution to enable download resuming, but now, it remains
the splitting problem. Does anyone have any idea ?

Force-downloading / Octet-streaming Multiple Files At Once
as my methods of file distribution involve the cloaking of the source, i am using application/force-download via urls using get variable methods to give authenticated users the file... only thing is, i can't get more than one stream to happen simultaneously.  when i choose another file, the page perpetually loads until the first download has finished.   

Anyone know how to make this work in my favor?  I have considered ziping the files into one, and am seeking out a script for that to happen (can that be done on the fly?).  I would like to do both. 

Force User To Enter Characters Into A Form Field?
I have a form that our visitors need to use to sign up for our newsletter... Country is a required field on this form.. and I have it set up for PHP to check and make sure some thing was entered but what I am finding is that lot of visitors are just putting in several spaces. I have it validating to make sure something was put it in and to make sure that it wasnt just one space.. but if they enter multiple spaces the form processes. Is there any way or built in function that anyone knows about that will make sure that characters are entered and just not a series of spaces? or will I have to look to javascript for that?

PHP Value For HTTPS
I am installing a “CubeCart” (On a dedicated server), my cart and DB work fine however when I try to get cranked on the HTTPS/SSL. I create an endless loop
I did run a test

<?php
echo $_SERVER["HTTPS"];
// if return 0 my php environment doesn't give a value for
// $_SERVER["HTTPS"]
?>

It returned 0
Reason is that it looks like the server/php doesn't have a value for that variable then it will never detect it and CubeCart will go into a continious loop.

HTTPS
Are there any tutorials/cookbooks on getting https to work? I've been
through the openssl-php doc page, and seem to have all the dll's in the
right place (at least, when I enable the openssl extension in the php.ini,
I don't get any complaints). Looking at the openssl.org howto's, it looks
like there should be an openssl binary around somewhere to create keys.
Does that come with PHP or just with openssl? (Downloading openssl is
easy, but if there's a copy with php that I missed, I'd rather use one that
was compiled with it).

Right now, if I do https://mywebsite, I get page can not be displayed -
server not found or dns error (i actually use the IP, so I can pretty much
rule out a dns error, and the server is there and works with http.)

Https
How does one use this? Is it simply setting a variable or calling a function
or is it completely different from http(i.e., is it transparent? Do I need
to do anything significantly different than what I do in http?)

Now what are the cons of using it rather than http? Right now I'm using http
but wondering if I should use https for any reasons or not.

What Is HTTPs
I have a PHP program that runs on Apache and connects to MySQL. The network administrator told me that they will block HTTP and allow HTTPS, will that cause a problem with my application?

The administrator will install the certificates, do I need to change the code? The database is hosted on the same server too.

HTTPS
I have read in a couple of places that a form on a page under the HTTP layer will still encrypt data before sending if the action of that form points to HTTPS.  My question is 'Is this true?'.

Surely the client and the server need to exchange the public and private keys before any encryption can take place or does the client and server set up the keys first and then send the data?

Http Or Https ??
What variable might i be able to extract the http:// or https:// from to detect which type it is?

On my server i have $_SERVER['SCRIPT_URI'] which contains htis but my friend does not have this variable on his server.

Posting XML Using HTTPS
I need to post an xml string to another server using HTTPS (secure Socket Layer) protocol. On another server i need to get this data and extract it from binary to a string again. does anybody knows where i can find some information (articles) on this topic?

PHP As Https Client
We are just getting started on a project that involves our host
Windows/Apache2.2/PHP5 server communicating with a second server using
the https://username:password@xxx protocol.

I'm new to PHP. Can someone tell me what is going to be involved in
doing this?

$_POST And Https?
I have a script that displays and accepts form data. It has been working fine in my sandbox. When I move the script to the production area (same server, same version PHP, etc.) which is https, the form stops working.

I put in a print_r($_POST); on both locations of the script. The one in the original location has values in the $_POST after form submission. The one in the https location has no values in the $_POST after form submission. I diff'd the files. They are identical.

REMOTE_ADDR Via HTTPS
I am having a small problem with a script that has to be requested via
https.

When I execute this normally I get my IP address printed on the
screen:

<?php
echo getenv('REMOTE_ADDR');
?>

However the same script executed over https gives me a completetly
different address.

How to I read the clients IP address via https?

PHP, SOAP And HTTPS
I am creating a webservice in PHP, but the results that the web service returns is confidential - what is the most secure way to ensure the data being returned is secure? My thinking is the following:

* Encrypt the data myself in the actual webservice
* The webservice must reside in a secure area and be accessed via HTTPS

Is there anything else I could use - any better ideas?

Upload On Https
I am trying to upload some files on a secure connection. The code
works perfectly when executed on http but errors out on https. I am
using move_uploaded_files to transfer the files. The directory to
which I am uploading is on http (contains images).

Header() With Https
if there is a clean way of using https with header() in PHP ? I am
using statements like header("Location: script.php?arg1=argvalue") to
transfer control in my application.

Https And Move_uploaded_file
I have a php script under https directory that is trying to move a local file from the desktop to an https directory using move_uploaded_file. It does not work....but if i move it to a http directory...it works just fine. I wanted the https so that i could easily force a password.

The error is simply a warning that it cannot write the file...php does not give any other hints. The prompts come up correctly and lets you run the script...but then nothing but the error. Any ideas or am I missing something about https and move_uploaded_file?

HTTPS Authentication
On my current project i have requirement to do HTTPS user authentication.
'Till now i 've been doing authentication using sessions and checking login
and pass against MySql. Can you give me some info on authenticating users
via HTTPS, what are the requirements, can i use my existing scripts etc.

Authentication Using PHP And Https://
let me say that I'm not handling top secret information (no financial/cc info of any kind) in any of my sites. I don't have many resources for development, but at the same time, I need be reasonably secure in my http transactions. In my research, I have found many potential PHP security issues, most of which I don't have the resources to address. If I can eliminate most threats, I'm ok with that.

I'd like to run this scenario past you and get opinions on any glaring security problems that I'm missing. I have used MD5 encryption for all of my usernames and passwords in my mysql database.

My login page passes the form fields (username, password) to an https:// page, that decrypts the password and checks it against the database. If they're authorized, voila! If not, the script stops and 'access denied'.

I'm aware that simply encrypting & decrypting using any algorithm is irrelevant if outside https since passwords are passed in plain text over http.

Http To Https
i have a page which is a application form and should be in https. it also works with http. is there any script to redirect the page to https when the request is from http?... the server is IIS. i want only that page to be in https and dont want the whole site in https.


Copyright © 2005-08 www.BigResource.com, All rights reserved