1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Directory Link Details page coding help

Discussion in 'PHP' started by cagintranet, Sep 11, 2005.

  1. #1
    Hello all,

    i am running the Biz-Directory Free PHP Directory scipt on my website: http://www.cagintranet.com/pghsource/directory/

    If you go to a page where there are actually links, i would like to have a "view details" page for each individual link in the directory. On this page i want to show all the dessc, name, etc of each specific link, and then also put a simple forum script on that page for any "review/comments". I do realize this will have to be dynamicly created via calling the link's own id number, but cant seem to get the page to create itself at all.

    I have messed with this code for hours now, and granted i do not know PHP or MySQL very well, but i thought all my logic seems ok for it to work correctly. Please, please, please look at my details.php page code below and let me know where i am going wrong.

    Background on page: each page will have a url such as http://www.....details.php?c=320 (where 320 is the link id number)

    <?
    require_once("config.php");
    require_once("include.php");
    $c *= 1;
    if ($c == 0) $c = 1;
    $bd = mysql_connect($mysql_hostname, $mysql_user, $mysql_password);
    mysql_select_db($mysql_database, $bd);
    mysql_query("SELECT id, url, title, description FROM {$prefix}pages WHERE id = $c);
    
    name: ["title"]
    url: ["url"]
    
    ?>
    PHP:
    i copied most of this code verbatim from my index.php page... so i thought by copying it, the syntax would have to be right... guess not. Any help would be much appreciated... thanks!!!!

    Chris Cagle
     
    cagintranet, Sep 11, 2005 IP
  2. rederick

    rederick Peon

    Messages:
    128
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
         <?
       
          require_once("config.php");
          require_once("include.php");
         
          $c *= 1;
       
          if ($c == 0) $c = 1;
          $bd = mysql_connect($mysql_hostname, $mysql_user, $mysql_password);
       
          mysql_select_db($mysql_database, $bd);
          $sql = "SELECT id, url, title, description FROM ".$prefix."pages WHERE id = ".$c."";
          $result = mysql_query($sql);
          $row = mysql_fetch_row($result);
          
          $name= $row['title'];
          $url = $row['url'];
      
          ?> 
    PHP:
    I don't know if this is what you want for the final result, but that should make the codes syntax correct anyways. Unless your directory script uses the { } brakets to echo variables, I don't think that they are standard php systax... I could be wrong.
    Red.
     
    rederick, Sep 11, 2005 IP