I am trying to figure out how to add s after HTTP once a user checks a box in the html form.
I have in my PHP,
$url = 'http://google.com'; if(!isset($_POST['https'])) { //something here }
So basically, when the user checks a box with the name="https" i want to add s to $url's http making it https://google.com.
I have little knowledge on PHP and if someone can explain to me how to go about doing this, this would be really helpful! thanks.
$count = 1; $url = str_replace("http://", "https://", $url, $count);
$url = preg_replace("/^http:/i", "https:", $url);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With