Jump to content

Adding strip tags


ltoto

Recommended Posts

ok so this is what i have done

[code]<?
// List the hotels
echo " function cutit ($var, $max)
{
return (strlen( $var ) > $max) ? substr($var, 0, $max).'...' : $var;
}


echo strip_tags(cutit($row_rsTour['pagesContent'], 350));
<div class=\"homebar2\"><h1>".$name."</h1></div><div class=\"hotel\">".$image."</div><div class=\"hotelcontent\">".$description."</div><h3><img src=\"".$star."\" hspace=\"2\"></h3>
\n";
}?>[/code]

this is the full code from this page....

[code]<?php
$colname_rsHotels = "1";
if (isset($_GET['Id'])) {
  $colname_rsHotels = (get_magic_quotes_gpc()) ? $_GET['Id'] : addslashes($_GET['Id']);
}
mysql_select_db($database_conTotal, $conTotal);
$query_rsHotels = sprintf("SELECT * FROM tabHotel WHERE Id = %s", $colname_rsHotels);
$rsHotels = mysql_query($query_rsHotels, $conTotal) or die(mysql_error());
$row_rsHotels = mysql_fetch_assoc($rsHotels);
$totalRows_rsHotels = mysql_num_rows($rsHotels);

$sql="SELECT * FROM tabHotel WHERE regionId = $id";
$result = mysql_query($sql);
if (!$result) {
  die('Invalid query: ' . mysql_error());
}
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)){
  $name = $row['hotelName'];
  $description = $row['hotelDescription'];
  $rating = $row['hotelRating'];
      $image = "<img src=\"../thumb/phpThumb.php?src=../images/hotel_{$row['hotelImage']}&w=100&h=100&zc=1\"  alt=\"Hotel\">"; 
?>
<?
if ($row['hotelRating'] == 3){
$star = "../images/star3.jpg";
}
else if ($row['hotelRating'] == 4){
$star = "../images/star4.jpg";
}
else if ($row['hotelRating'] == 5){
$star = "../images/star5.jpg";
}
?>
<?
// List the hotels
echo " function cutit ($var, $max)
{
return (strlen( $var ) > $max) ? substr($var, 0, $max).'...' : $var;
}


echo strip_tags(cutit($row_rsTour['pagesContent'], 350));
<div class=\"homebar2\"><h1>".$name."</h1></div><div class=\"hotel\">".$image."</div><div class=\"hotelcontent\">".$description."</div><h3><img src=\"".$star."\" hspace=\"2\"></h3>
\n";
}?>
<?
mysql_free_result($rsHotels);
?>
[/code]

what have i do wrong
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.