SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Evangelist tangledman's Avatar
    Join Date
    Sep 2005
    Location
    Puerto de Mazarron, Murcia, Spain
    Posts
    425
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Dynamic rediect - should be easy?

    Is there a reason why this isn't working?

    PHP Code:
    <?

    include "connect.inc.php";

    $advert_id $_GET['advert_id'];

    $query "SELECT advert_link, advert_click_count FROM advert WHERE advert_id = '$advert_id'";
    $result mysql_query($query);

    while (
    $array mysql_fetch_assoc($result)) {

    $advert_link $array['advert_link'];
    $advert_click_count $array['advert_click_count'] + 1;
    mysql_query("UPDATE advert SET advert_click_count = '$advert_click_count'");

    }

    $redirect "Location $advert_link";

    //echo "$redirect";
    header("Location $advert_link");
    ?>

  2. #2
    Utopia, Inc. silver trophy
    ScallioXTX's Avatar
    Join Date
    Aug 2008
    Location
    The Netherlands
    Posts
    9,067
    Mentioned
    153 Post(s)
    Tagged
    2 Thread(s)
    You forgot the column after Location

    Example

    PHP Code:
    header('Location: http://www.sitepoint.com/'); 
    Rémon - Hosting Advisor

    SitePoint forums will switch to Discourse soon! Make sure you're ready for it!

    Minimal Bookmarks Tree
    My Google Chrome extension: browsing bookmarks made easy

  3. #3
    SitePoint Evangelist tangledman's Avatar
    Join Date
    Sep 2005
    Location
    Puerto de Mazarron, Murcia, Spain
    Posts
    425
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks


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
  •