我该如何阻止https

I have a website that can be accessed both with http and https. The website has a form that brings the user to another site on another server. So when I use https and the form is submitted, I get a warning that the data are being sent insecurely.

The second server does not support https, so I figured that the fastest and easiest is to prevent the first website from being accessed through https.

Is there a way to do that (with PHP for example)?

All you have to do in this case is check the HTTPS status on your form page, and redirect to HTTP if necessary:

if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') {
    header('Location: http://' . $_SERVER["SERVER_NAME"] . $_SERVER['REQUEST_URI']);
}

You can use mod_rewrite:

RewriteEngine On
RewriteCond %{HTTPS} on
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI}

(This goes into your .htaccess file)