Results 1 to 3 of 3

Thread: Experts please review my addon

  1. #1
    Join Date
    Dec 2008
    Posts
    31

    Default Experts please review my addon

    Pretty basic, just grabs the name of the property class if available in the URL string.

    What I'd like feedback on is if I'm handling the $_GET['pclass'] in the proper way. That is, is that the correct way for an addon to access the url string?

    Code:
    function pcf_display_name()
    {
    	global $conn,$config,$lang;
    	$display="";
    	$c=$_GET['pclass'];
    	$sql='SELECT class_name FROM ' . $config['table_prefix'] . 'class WHERE class_id = ' . $c[0];	
    	$rs=$conn->Execute($sql);
    	while (!$rs->EOF)
    	{
    	$display.='<p>'.$rs->fields['class_name'].'</p>';	
    	$rs->MoveNext();
    	}
    	return $display;
    }
    Attached Files Attached Files

  2. #2
    the_sandking's Avatar
    the_sandking is offline hadron remnant - Moderation Fachmann
    Join Date
    Apr 2003
    Location
    Nullspace
    Posts
    5,289

    Default Re: Experts please review my addon

    That looks like it should work..

    If you have PHP error reporting turned-up all the way (and you should when developing), you'll probably get PHP NOTICE errors for not checking if $_GET['pclass'] exists and/or contains a value before assigning it to a variable. It is also usually a good idea to assign GET variables with default values in case a check fails.
    "Much of what looks like rudeness in hacker circles is not intended to give offense. Rather, it's the product of the direct, cut-through-the-BS communications style that is natural to people who are more concerned about solving problems than making others feel warm and fuzzy."

    "We gotta' go to the crappy town where I'm a hero!"
    -Hoban 'Wash' Washburne 2485-2519


    "When you’re born you get a ticket to the freak show. When you’re born in America, you get a front-row seat.."
    -George Carlin 1937-2008

    New to Open-Realty® and need help? Check the:
    -OR DOCUMENTATION -

    Important: Read this at least once in your lifetime
    How To Ask Questions The Smart Way

  3. #3
    Join Date
    Dec 2008
    Posts
    31

    Default Re: Experts please review my addon

    Oh, it works just fine, and yes, I've included a check with isset. Just needed to check if that was the correct way of grabbing the $_GET parameter in an addon.

Similar Threads

  1. site ready for review
    By bighomebuyers.com in forum Show Off (CLOSED)
    Replies: 4
    Last Post: 01-28-2009, 01:35 PM
  2. User Review and Rating
    By animas in forum Addon help, ideas and discussion (CLOSED)
    Replies: 11
    Last Post: 11-06-2006, 07:31 AM
  3. Site Proposal - Please Review!
    By cguild in forum Show Off (CLOSED)
    Replies: 0
    Last Post: 10-12-2006, 11:39 PM
  4. Testing MLS/IDX - Please review
    By frobn in forum Show Off (CLOSED)
    Replies: 20
    Last Post: 03-25-2005, 03:15 AM
  5. Still working on site - Please review
    By Jackson in forum Show Off (CLOSED)
    Replies: 4
    Last Post: 10-27-2004, 10:19 PM

Bookmarks

Posting Permissions

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