8791 sujets

Développement web côté serveur, CMS

Bonjour à tous,

J'ai un problème avec str_replace:

<?php 
$before_adresse = $_POST['before_adresse'];
$search = $_POST['search'];
$after_adresse = $_POST['after_adresse'];
$space_adresse = $_POST['space_adresse'];
$http = "http://";
$toreplace = array("http://","https://");
$before_adresse = str_replace ($toreplace,"",$before_adresse);
$search = str_replace (' ',$space_adresse,$search);
$url = $before_adresse.$search.$after_adresse;
?>

<!-- <head>
<meta http-equiv="refresh" content="0;URL=<?php echo $http.$url; ?>">
</head> -->

<a href="<?php echo $http.$url; ?>"><?php echo $http.$url; ?></a>


Il me renvois ça :

https://https://www.facebook.com/search/results.php?q=c%5C%27est%2520meme%2520pas%2520drole


Merci de votre aide Smiley smile