Jump to content

keyword, description script


Recommended Posts

The script below adds a custom keyword and description to a webpage by pulling information from a field.

 

How do I remove the comma after the "$subdivision"? Lakes at Plantation Pines,  

I want to add text after $subdivision but the script adds a comma? Lakes at Plantation Pines homes for sale, 

 

 

code below:

 

<!DOCTYPE html>
<html lang="en">
<head>
<?php if (isset($_GET['action']) && $_GET['action'] == 'searchresults' && isset($_GET['L_City']) && $_GET['L_City'] != '') { 
$citynameraw[] = $_GET['L_City'];
$cityname = str_replace("_", " ", $citynameraw[0]);
$subdivision = "";
if (isset($_GET['LM_Char25_4']) && $_GET['LM_Char25_4'] != '') {
$subdivision = $_GET['LM_Char25_4'] . ", ";
}
?>
 
<title> homes for sale <?php echo $subdivision; ?> real estate in <?php echo $subdivision . $cityname; ?> homes for sale in <?php echo $subdivision . $cityname; ?> real estate listings <?php echo $subdivision . $cityname; ?> real estate agents, <?php echo $cityname; ?> real estate companies, <?php echo $cityname; ?> MLS listings</title>
<meta name="description" content=" homes for sale <?php echo $subdivision; ?> real estate in <?php echo $subdivision . $cityname; ?> real estate listings <?php echo $subdivision . $cityname; ?> real estate listings, <?php echo $subdivision . $cityname; ?> real estate agents, <?php echo $cityname; ?> real estate companies <?php echo $cityname; ?> MLS listings" />
 
<?php } else { ?>
<title>{site_title}</title>
{load_meta_description_short}
<?php } ?>
 
 
This is what the code produces: (Longs = is the city), (Lakes at Plantation Pines = is the subdivision)
 
homes for sale Lakes at Plantation Pines, real estate in Lakes at Plantation Pines, Longs homes for sale in Lakes at Plantation Pines, Longs real estate listings Lakes at Plantation Pines, Longs real estate agents, Longs real estate companies 
homes for sale Lakes at Plantation Pines, real estate in Lakes at Plantation Pines, Longs real estate listings Lakes at Plantation Pines, Longs real estate listings, Lakes at Plantation Pines, Longs real estate agents, Longs real estate companies
Edited by johnny5alive
Link to post
Share on other sites
  • 4 weeks later...
This thread is more than a year old.

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.