Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    Regular Coder googleit's Avatar
    Join Date
    Jul 2006
    Location
    birmingham, uk
    Posts
    189
    Thanks
    0
    Thanked 0 Times in 0 Posts

    whats wrong with my code?

    iam creating my own cms and iam trying to pull articles from a db but i get this annoying error
    Code:
     Parse error:  parse error, unexpected $ in /home/content/b/r/a/bradleyhession/html/test/test2.php on line 261
    PHP Code:
    <?php
    if(isset($_GET['EntryID'])) //If looking at a specific Article
      
    {
        
    $EntryID=$_GET['EntryID'];
        
    $tviewed "UPDATE CMS_articles SET timesviewed=timesviewed+1 
            WHERE EntryID = '$EntryID'"
    ;
        
    mysql_query($tviewed);
        print 
    "<center><table border='0' width=90% >";
        print 
    "<tr><td valign='top' width='75%' align='center'><br><br>";
        print 
    "<table border='1' width='90%' bordercolor=$borderc cellpadding='4' cellspacing='0'><tr><td bgcolor=$barcolor>";
        
    $article="SELECT * FROM CMS_articles where EntryID='$EntryID'";
        
    $article2=mysql_query($article) or die("It died");
        while(
    $r=mysql_fetch_array($article2))
          
     
         
    ?>
    any help wud be helpful
    thanks

    -googleit

  • #2
    Senior Coder rafiki's Avatar
    Join Date
    Aug 2006
    Location
    Floating around somewhere...
    Posts
    2,043
    Thanks
    19
    Thanked 42 Times in 42 Posts
    the almighty googleit is back....
    fixed by the way

  • #3
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,642
    Thanks
    2
    Thanked 405 Times in 397 Posts
    You haven't closed your if(). What is on like 261?

  • #4
    Senior Coder rafiki's Avatar
    Join Date
    Aug 2006
    Location
    Floating around somewhere...
    Posts
    2,043
    Thanks
    19
    Thanked 42 Times in 42 Posts
    Quote Originally Posted by Inigoesdr View Post
    You haven't closed your if(). What is on like 261?
    did u read my post we managed 2 fix it

  • #5
    Regular Coder
    Join Date
    Oct 2006
    Location
    Bristol
    Posts
    128
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You also don't seem to do any validation on the $_GET['entryID']...as far as I'm aware you should always do at least some kind of validation on any kind of user input.

    Alex
    Give me Rep if I was helpful and ignore if I wasn't ;)

    http://www.google.com <--use this before asking

    Nominate a Helpful Member


  • #6
    Senior Coder rafiki's Avatar
    Join Date
    Aug 2006
    Location
    Floating around somewhere...
    Posts
    2,043
    Thanks
    19
    Thanked 42 Times in 42 Posts
    Quote Originally Posted by Alex! View Post
    You also don't seem to do any validation on the $_GET['entryID']...as far as I'm aware you should always do at least some kind of validation on any kind of user input.

    Alex
    LOL hi alex, u live quite close to me, me and googleit managed to fix this thread now, its quite unnessacary for any more posts. thanks though guys

  • #7
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,642
    Thanks
    2
    Thanked 405 Times in 397 Posts
    Quote Originally Posted by rafiki View Post
    did u read my post we managed 2 fix it
    Yes. Did you look at the time of the post? You posted just before me.

  • #8
    Regular Coder googleit's Avatar
    Join Date
    Jul 2006
    Location
    birmingham, uk
    Posts
    189
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks for your help guys i should be more care

  • #9
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    So...what was the solution? Others might have the same issue and would like to know the solution. Don't be selfish.
    ||||If you are getting paid to do a job, don't ask for help on it!||||


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •