Good morning, I have a website where I want to share school photos, for example. In my Open Graph tags I have this
if (!empty($_GET['search'])) { $search = $_GET['search'];}
if (!empty($_GET['id_photo'])) { $id_photo = $_GET['id_photo'];}
if (!empty($_GET['nom_photo'])) { $nom_photo = $_GET['nom_photo'];}
if (!empty($search) && !empty($id_photo) && !empty($nom_photo)) {
?>
<meta property="og:url" content="=<?php echo $search;?>&id_photo=<?php echo $id_photo;?>&nom_photo=<?php echo $nom_photo;?>" />
<meta property="og:type" content="website" />
<meta property="og:title" content="Photos de classe de <?php echo $search ;?>" />
<meta property="og:description" content="Des centaines de photos de classe couvrant plus de 60 ans d'école." />
<meta property="og:image" content="/<?php echo $nom_photo;?>.jpg" />
<meta property="og:image:alt" content="Les écoles de La Machine. Une classe où était <?php echo $search;?>" />
<?php
}
require_once( ROOT_PATH_LINK.'fin_entete.php' );
?>
All this works perfectly when I share from a PC (even reducing the size of the window width to switch to responsive mode). I get the student's name and the correct photo. On the other hand, when I am on my mobile with the same page, it is impossible to retrieve the OG tags. Sharing is done but without any personal settings, name or photo.
I hope my explanation is clear. If anyone could tell me where the problem is and how to fix it.
Thank you in advance
My page looks correct. Above all, it works perfectly with a PC even by minimizing the page in Chrome with CTRL+SHIFT+I.
I read here (in a 2014 post) that sharer.php no longer accepts personal settings. This is false from a computer but appears true from a mobile.
Thank's for any help.