How to share a link with GET variables on facebook or whatsapp

0

How to share the current link (with its get parameters) with the whatsapp app making me recognize all the variables.

This is what happens: I can not share more than one variable with whatsapp because it adds these special characters:

link (ESE amp is what cuts the link)

and it adds everything that is after HELLO, this causes that they do not load all the variables correctly leaving echos empties.

Code:

<div id="formulario">
	<form action="procesar.php" method="get">
		<p>Nombre: <input type="text" name="nombre"></p>
		<p>Asunto: <input type="text" name="asunto"></p>
		<p><input type="submit" value="enviar" name=""></p>

Code:

<?php




$nombre= $_GET['nombre'];
$asunto= $_GET['asunto'];

function url_completa($forwarded_host = false) {

$ssl   = !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on';

$proto = strtolower($_SERVER['SERVER_PROTOCOL']);

$proto = substr($proto, 0, strpos($proto, '/')) . ($ssl ? 's' : '' );

if ($forwarded_host && isset($_SERVER['HTTP_X_FORWARDED_HOST'])) {

$host = $_SERVER['HTTP_X_FORWARDED_HOST'];

} else {

if (isset($_SERVER['HTTP_HOST'])) {

$host = $_SERVER['HTTP_HOST'];

} else {

$port = $_SERVER['SERVER_PORT'];

$port = ((!$ssl && $port=='80') || ($ssl && $port=='443' )) ? '' : ':' . $port;

$host = $_SERVER['SERVER_NAME'] . $port;

}

}

$request = $_SERVER['REQUEST_URI'];

return $proto . '://' . $host . $request;

}

$url = url_completa();

$urlnewp= htmlspecialchars($url);

$urlwp= urlencode ( $urlnewp );

?>





<?php echo '<a class="icon-whatsapp" href="https://api.whatsapp.com/send?text='.$urlwp.'"></a>';  ?>

Something similar happens with facebook but there I add these characters :(: link when the correct one should be: link

    
asked by Gatoles v 22.12.2018 в 23:19
source

0 answers