close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Https

Thread began 9/07/2010 8:50 pm by asnw0764437428 | Last modified 9/08/2010 3:20 am by Dave Buchholz | 937 views | 2 replies |

asnw0764437428

Https

Hope someone can guide me on this, much appreciated. And apologise for naming conventions I may use, as I am one of those who sadly works alone :)

I have an application form that when accessed from anywhere within the website the code below always makes sure that when the application page loads it is always under HTTPS
to go to an SSL secured page.

<?php
if ($_SERVER['HTTPS']!= 'on') {
// Redirect user to secure page
header("Location: https://www.domainname.co.uk/application.php");
exit;
}
?>

I want to be able if I click a link on the application page that it defers back to HTTP

I would suspect someone knows the answer to this.

Many thanks

Sign in to reply to this post

Miguel

You can use php sleep

php:
<?php
sleep
(10);//time to delay or defer the link before it loads..
header("Location:http://www.domainname.co.uk/linkpointed.php");
exit;
?>



Here is the reference to the sleep command in php function.sleep.php

Sign in to reply to this post

Dave BuchholzBeta Tester

this is the code I use to turn https on and off with an extra check to see if I am working on my local development server

Turn HTTPS off

<?php
if ($_SERVER['HTTP_HOST'] != 'site.local') // insert local hostname here
{
if (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on')
{
header("Location: http://".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']);
}
}
?>



Turn HTTPS on

<?php
if ($_SERVER['HTTP_HOST'] != 'site.local') // insert local hostname here
{
if (!isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) != 'on')
{
header("Location: https://".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']);
}
}
?>



Hope that helps

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...