php - my document has no title - my url is displayed as title -


it such have not shown title , keywords , description,

but if print php code away works fine if add php'en not work in manner.

i have 3 posts in database.

here click im site;

<?php $sql =  " select fms_forum.id, fms_forum.title, fms_forum.url, fms_bruger.fornavn, fms_bruger.efternavn, fms_bruger.profilbillede fms_forum inner join fms_bruger on fms_forum.brugerid=fms_bruger.id "; if ($stmt = $this->mysqli->prepare($sql)) {      $stmt->execute();     $stmt->bind_result($id, $title, $url, $fornavn, $efternavn, $profilbillede);     while ($stmt->fetch()) {     ?>     <tr class="postbox">         <td><a href="/forum/<?php echo $id;?>/<?php echo $url;?>/"><?php echo $title;?></a></td>     </tr>     <?php     }     $stmt->close(); } ?> 

.htaccess

rewriterule ^forum/([0-9]+)/([^/.]*)/?$ /forum-s.php?id=$1&url=$2 [l] 

it title on site;

if ($stmt = $this->mysqli->prepare('select title, info fms_forum url = ?'))   {      $stmt->bind_param('s', $url);     $url = $_get["url"];     $stmt->execute();     $stmt->bind_result($title, $info);     while ($stmt->fetch()) {     ?>     <title><?php echo $title;?></title>     <meta name="description" content="hey">     <meta name="keywords" content="hey">     <?php     }     $stmt->close(); } else {     echo 'der opstod en fejl erklæringen: ' . $this->mysqli->error; } 

enter image description here

here can see how title appears code,

if udkommentar php code , write works fine.

but need id of post is,

its here database;

create table if not exists `fms_forum` (   `id` int(11) not null auto_increment,   `title` varchar(70) not null,   `url` varchar(350) not null,   `info` varchar(156) not null,   `indhold` longtext not null,   `brugerid` int(11) not null,   primary key (`id`) ) engine=innodb  default charset=latin1 auto_increment=4 ;  -- -- data dump tabellen `fms_forum` --  insert `fms_forum` (`id`, `title`, `url`, `info`, `indhold`, `brugerid`) values (1, 'velkommen til tasakker - sjælland', 'velkommentiltraenigsmakkersjaelland', 'velkommen til tasakker - sjælland, du har mulighed få @ find en makker dit område.', '<p><span style="font-family: arial, ''times new roman''; font-size: medium;">p&aring; tr&aelig;ningsmakker &ndash; sj&aelig;lland har du mulighed @ finde en makker dit omr&aring;de, som tr&aelig;ner med samme m&aring;l og samme antal ugentlige tr&aelig;ninger</span></p>', 1), (2, 'velkommen til trasakker - sjælland', 'velkommen-til-traenigsmakker---sjaelland', 'velkommen til trasmakker - sjælland, du har mulighed få @ find en makker dit område.', '<p>hjheryre yrey</p>', 1), (3, 'velkommen til trasmakker - sjælland', 'velkommentiltraenigsmakkersjaelland', 'herherh', '<p>reh rehre hre reh</p>', 1); 

i have complete now::

if ($stmt = $this->mysqli->prepare('select title, info fms_forum fms_forum.id = ?')) {          $stmt->bind_param('s',$id);         $id = $_get["id"];         $stmt->execute();         $stmt->bind_result($title, $info);         while ($stmt->fetch()) {         ?>         <title><?php echo $title;?></title>         <meta name="description" content="hey">         <meta name="keywords" content="hey">         <?php         }         $stmt->close();     } else {         echo 'der opstod en fejl erklæringen: ' . $this->mysqli->error;     } 

if doing on way change

$stmt->bind_param('s',$id);  $id = $_get["id"];     $id = $_get["id"];  $stmt->bind_param('s',$id); 

Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -