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 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jan 2007
    Posts
    123
    Thanks
    20
    Thanked 1 Time in 1 Post

    Auto creating a link

    Hi,
    I can't seem to make a link open in Greybox
    PHP Code:
    <?php

    $con 
    mysql_connect("");
    if (!
    $con)
      {
      die(
    'Could not connect: ' mysql_error());
      }

    mysql_select_db(""$con);

    $link 'review.php?eventname=' $row['EventName'] . '&year=' $row['Year']; 
     
    $result mysql_query("SELECT * FROM results");

    while(
    $row mysql_fetch_array($result))
      {
      echo 
    "<a href='".$link."' 'title="Review"' 'rel="gb_page[500500]"'>review</a>"
      }  

    mysql_close($con)

    ?>
    PHP Code:
    'title="Review"' 'rel="gb_page[500, 500]"' 
    This part stops the page from working. How do I include it in
    PHP Code:
      echo "<a href='".$link."' 'title="Review"' 'rel="gb_page[500500]"'>review</a>"
    properly?

    I hope that is clear. Thanks

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    Hi Cheechm,
    Just use a print formatting:
    PHP Code:
    <?php

    error_reporting
    (E_ALL);

    $link '<a href="review.php?event=%s&year=%d" title="Review" rel="gb_page[500, 500]">review</a>';

    $con mysql_connect("");
    if (!
    $con)
      {
      die(
    'Could not connect: ' mysql_error());
      }

    mysql_select_db(""$con);

    $result mysql_query("SELECT * FROM results");

    while(
    $row mysql_fetch_array($result))
    {
        
    printf($link$row['EventName'], $row['Year']);
    }

    mysql_close($con);

    ?>
    This assumes that year is a number as well.
    Not familiar with grey box, but I'm assuming that the problem is that the link isn't properly created.
    Give that a shot, see if it works.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

  • #3
    Regular Coder
    Join Date
    Jan 2007
    Posts
    123
    Thanks
    20
    Thanked 1 Time in 1 Post
    Works perfectly. Thanks.


  •  

    Posting Permissions

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