Print Reseller Scheme
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Editing PHP Pages

Discussion in 'Website Design Forum:' started by solvaworld, Jul 22, 2010.

  1. solvaworld

    solvaworld Member

    Hi All,

    Im trying to add page titles to a webpage thats in PHP. I am opening the pages in note pad and changing them accordingly. However once the edited pages are uploaded the live page shows an invalid syntax error.

    This is really odd because I am not changing the tags of the section in which the text is located. All I am doing is replacing the text with different text.

    The text I have highlighted in red is the only area of the page I have changed with notepad. Hence my confusion?

    Any ideas?
     
  2. Mark Alexander

    Mark Alexander Senior Member

    Doesn't it give you the line of the error?
     
  3. solvaworld

    solvaworld Member

    textext
     
  4. Mark Alexander

    Mark Alexander Senior Member

    Well paste the first 20 lines or so of the file that gives the error.
     
  5. solvaworld

    solvaworld Member

    see post below
     
  6. Renniks

    Renniks Senior Member

    Is this not just you putting the html within the php?

    Code:
    <meta name="keywords" content="Westcountry Fire Protection, Westcountry Fire Protection, West Country Fire Protection, Fire Prevention, Fire Protection, WFP, "><meta name="description" content="Westcountry Fire Protection's home page - we offer comprehensive products and services with friendly, professional and local advice.">
     
  7. Harry

    Harry Senior Member

    PHP:
    <?php
    $this_page 
    "index";
    ?>

    <meta name="keywords" content="Westcountry Fire Protection, Westcountry Fire Protection, West Country Fire Protection, Fire Prevention, Fire Protection, WFP, ">

        <meta name="description" content="Westcountry Fire Protection's home page - we offer comprehensive products and services with friendly, professional and local advice.">

    <?php
    $browser_title 
    "Westcountry Fire Protection > Sentri > Fire Alarms Exeter > Fire Alarms Newton Abbot ";
    ?>
    <meta name="keywords" content="Westcountry Fire Protection, Westcountry Fire Protection, West Country Fire Protection, Fire Prevention, Fire Protection, WFP, ">
    <meta name="description" content="Westcountry Fire Protection's home page - we offer comprehensive products and services with friendly, professional and local advice.">

    <?php
    include("includes/header.php");
    include(
    "includes/database.php");

    // Get latest News Stories

    $news_sql "SELECT id, headline, extract, body, created, author, category, status, starts, expires, CASE WHEN starts != 0 THEN 'yes' ELSE 'no' END AS 'starts_flag', CASE WHEN expires != 0 THEN 'yes' ELSE 'no' END AS 'expires_flag' from syscon_news WHERE status = 'live' ORDER BY created DESC limit 0,4"
    $news_query mysql_query($news_sql$db_handle);

    $length 120;

    while(
    $news_record mysql_fetch_array($news_query)) { 
        
        unset(
    $status);
        
        if(
    $news_record['starts_flag'] == "no" && $news_record['expires_flag'] == "no") { 
            
    $status "yes";            
        } elseif(
    $news_record['starts_flag'] == "yes" && date(U) > $news_record['starts']) { 
            
    $status "yes";
        } elseif(
    $news_record['expires_flag'] == "yes" && date(U) < $news_record['expires']) { 
            
    $status "yes";
        }
        
        if(
    $status == "yes") { 
            
            if(
    strlen($news_record['extract']) > $length) { 
                
    $extract stripslashes(substr($news_record['extract'],0,$length)) . "...";
            } else { 
                
    $extract stripslashes($news_record['extract']);
            }
            
            
    $latest_news[] = array(
                
    id => $news_record['id'],
                
    headline => stripslashes($news_record['headline']),
                
    extract => $extract,
                
    body => stripslashes($news_record['body']),
                
    created => $news_record['created'],
                
    author => stripslashes($news_record['author']),
                
    category => $news_record['category'],
                
    status => $news_record['status'],
                
    expires => $news_record['expires']
            );    
        }                
    }
    ?>
     
  8. solvaworld

    solvaworld Member

    textetx
     
  9. Harry

    Harry Senior Member

    PHP:
    $browser_title "Westcountry Fire Protection > Sentri > Fire Alarms Exeter > Fire Alarms Newton Abbot";
     
  10. solvaworld

    solvaworld Member

    Hi Harry is that the code I should use?
     
  11. Harry

    Harry Senior Member

    I dunno, but it's incorrect HTML, so it's definitely better than the previous haha.
     
  12. solvaworld

    solvaworld Member

  13. Harry

    Harry Senior Member

    The difference is the appearance of special characters (>). Try making them entities ( > )
     
  14. solvaworld

    solvaworld Member

    Thanks Harry Sorted
     
  15. Harry

    Harry Senior Member

    No problem :)
     
  16. Jazajay

    Jazajay Active Member

    Are you sure that fixed your problem as that doesn't make sense if it did. :confused:
    First off granted all the ">" are bad HTML but they are in quote marks so will be treated as part of a string and not special characters in the PHP langauge so that shouldn't flag up any issues.

    Secondly your error is for the "<" less than not the ">" greater than symbol and all the symbols that you changed to entities are greater than symbols not less than symbols so again I can't see how that fixed it.

    A tad confused if that was the solution TBH. :)
     
  17. Harry

    Harry Senior Member

    I had exactly the same thoughts Jaz, but that was the only anomaly I could spot in the whole script :S
     

Share This Page