SitePoint Sponsor

User Tag List

Results 1 to 17 of 17
  1. #1
    SitePoint Enthusiast
    Join Date
    Oct 2007
    Posts
    36
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help with URL Error

    ey Guys,

    I've tried resolving the following problem for a while now and I haven't been able to find the answer anywhere.

    I have recently built a site which is PHP driven.

    if you follow this link:

    http://www.eliteclubbing.com/elitepa...tteryflylounge you will hopefully see that it works fine!

    However if you misspell the URL e.g.

    http://http://www.eliteclubbing.com/...ebutteryflylou or just leave the urlName i.e. http://www.eliteclubbing.com/eliteparty.php?urlName=

    You will receive a blank page.

    My code is:

    PHP Code:
    <?php
    require_once('');
    require_once (
    '');
    ?>
    <?php

    $problem 
    FALSE;

    if (!isset(
    $_GET['urlName'])) {

    $urlName trim($_GET['urlName']);

        
        
    $url 'http://' $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']);
        
        if ((
    substr($url, -1) == '/') OR (substr($url, -1) == '\\') ) {
            
    $url substr ($url0, -1);
        }
        
        
    $url .= '/eliteparties.php';
        
        
    ob_end_clean();
        
    header("Location: $url");
        exit();
        
    } else {

    if (isset(
    $_GET['urlName'])) {

    $urlNametrim($_GET['urlName']);

    $sql "SELECT * FROM guestlists WHERE urlName= '$urlName'";

    $result mysql_query($sql$dbc) or die('Error, query failed');
        
    if (
    mysql_num_rows($result)) { // Good to go!
        
    $row mysql_fetch_assoc($result);



    ?>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title><?php echo "{$row['pageTitle']}"?></title>

    <meta name="description" content="<?php echo "{$row['pageDescription']}"?>">
    <meta name="keywords" content="<?php echo "{$row['pageKeywords']}"?>.">

    <meta name="Author" content="Elite Clubbing">
    <meta name="Publisher" content="http://www.eliteclubbing.com">
    <meta name="copyright" content="Copyright (c) 2007, Elite Clubbing Limited ">
    <meta name="Distribution" content="global">
    <meta name="Robots" content="INDEX,FOLLOW">
    <META NAME="ROBOTS" CONTENT="NOODP">
    <meta name="revisit-after" content="1 day">

    <!-- RSS FEED -->
    <link href="http://www.eliteclubbing.com/eliterss.xml" rel="alternate" type="application/rss+xml" title="Elite Clubbing" />
    <!-- RSS FEED -->

    <!-- fav icon -->
    <link rel="icon" href="http://www.eliteclubbing.com/images/favicon.ico" type="image/x-icon" />

    <!-- CSS STYLE SHEET -->
    <link rel="stylesheet" type="text/css" href=""/>
    <!--[if IE]>
    <link rel="stylesheet" type="text/css" href="" />
    <![endif]-->
    <!-- CSS STYLE SHEET -->


    </head>

    <body>

    <!-- start wrapper -->
    <div id="wrapper">
    <!-- elite logo -->
    <div id="header">
    </div>
    <!-- elite logo -->
    <ul class="menu">
    <li><a href="http://www.eliteclubbing.com/home.php">Home</a></li>
    <li><a href="http://www.eliteclubbing.com/eliteparties.php" class="current">Parties</a></li>
    <li><a href="http://www.eliteclubbing.com/photos.php">Photo Gallery</a></li>
    <li><a href="http://www.eliteclubbing.com/elitevideogallery.php">Video Gallery</a></li>
    <li><a href="http://www.eliteclubbing.com/nightclubs.php" >Night Club Reviews</a></li>
    <li><a href="http://www.eliteclubbing.com/membership.php" >Membership</a></li>
    <li><a href="http://www.eliteclubbing.com/yourparty.php">Your Party</a></li>
    <li><a href="http://www.eliteclubbing.com/elitepress.php">Press</a></li>
    <li><a href="http://www.eliteclubbing.com/restaurants.php">Restaurants</a></li>
    <li><a href="http://www.eliteclubbing.com/rssfeeds.php">RSS Feeds</a></li>
    <li><a href="http://www.eliteclubbing.com/elitelifestyle.php">Lifestyle</a></li>
    </ul>
    <br style="clear: left" />
    <div id="main">
    <!-- start main -->
    <!-- splits the page into 3 -->
    <div id="columnsClubreviews">
    <div id="inner">
    <div id="leftClubreviews">
    <div id="clubsList">
    <span class="clubsList"> <strong>Elite Clubbing Parties</strong>
    <br />
    <br />
    <b>Thursday Nights</b>
    <br />
    <br />
    <?
    $query 
    "SELECT * FROM `guestlists` WHERE night='Thursday' AND active='1' ORDER BY title";
    $result mysql_query($query) or die('Error, query failed');
    while (
    $list mysql_fetch_array($result)) {
    echo 
    "<a href ='http://www.eliteclubbing.com/eliteparty.php?urlName={$list['urlName']}' >{$list['title']}</a>
    <br>"
    ;
    }
    ?>
    <br />
    <br />
    <b>Friday Nights</b>
    <br />
    <br />
    <?
    $query 
    "SELECT * FROM `guestlists` WHERE night='Friday' AND active='1' ORDER BY title";
    $result mysql_query($query) or die('Error, query failed');
    while (
    $list mysql_fetch_array($result)) {
    echo 
    "<a href ='http://www.eliteclubbing.com/eliteparty.php?urlName={$list['urlName']}' >{$list['title']}</a><br>";
    }
    ?>
    <br />
    <br />
    <b>Saturday Nights</b>
    <br />
    <br />
    <?
    $query 
    "SELECT * FROM `guestlists` WHERE night='Saturday' AND active='1' ORDER BY title";
    $result mysql_query($query) or die('Error, query failed');
    while (
    $list mysql_fetch_array($result)) {
    echo 
    "<a href ='http://www.eliteclubbing.com/eliteparty.php?urlName={$list['urlName']}' >{$list['title']}</a>
    <br>"
    ;
    }
    ?>

    </span>
    </div>
    </div>
    <!-- end left -->
    <!-- start content -->
    <div id="contentReviews">
    <?php

    echo "<h1 class='clubname'>{$row['title']}</h1><br><br><br>";

    echo 
    "<b>{$row['venue_name']}</b><br>";

    echo 
    "<b>{$row['address']}</b><br><br>";

    echo 
    "{$row['description']}<br><br>";

    echo 
    "<b>When:</b> Every {$row['night']}<br><br>";

    echo 
    "<b>Times:</b> {$row['times']}<br><br>";

    echo 
    "<b>Dress:</b> {$row['dress']}<br><br>";

    echo 
    "<b>Entry:</b> {$row['entry']}<br><br>";

    echo 
    "<b>Music:</b> {$row['music']}<br><br>";

    if (
    '' == $row['email'])
    {
    echo 
    "<b>Guest Lists:</b> Currently Unavailable. For our current nights please <span class='text'><a href='#'>view our events page</a></span> <br>";
    }
    else
    {
    echo 
    "<b>Guest Lists:</b> <span class='text'><a href ='mailto:{$row['email']}'>{$row['email']}</a></span> <br>";
    }


    ?>
    <br />
    </div>
    <!-- end content -->
    <div id="rightClubreviews">
    <div id="clubimages">
    <ul>
    <li id="t1"><img class="panelimage" src="<? echo "{$row['image001']}";?>" alt="<? echo "{$row['title']}";?>" width="190" height="126" /></li>
    <li id="t1"><img class="panelimage" src="<? echo "{$row['image002']}";?>" alt="<? echo "{$row['title']}";?>" width="190" height="126" /></li>
    <li id="t1"><img class="panelimage" src="<? echo "{$row['image003']}";?>" alt="<? echo "{$row['title']}";?>" width="190" height="126" /></li>
    <li id="t1"><img class="panelimage" src="<? echo "{$row['image004']}";?>" alt="<? echo "{$row['title']}";?>" width="190" height="126" /></li>
    </ul>
    </div>
    </div>
    <div id="googleAds">

    </div>
    </div>
    <!-- end inner -->
    </div>
    <!-- end columns -->
    </div>
    <!-- end main -->
    <!-- second half of page -->

    <div class="clear"></div>
    <?php include ("includes/footer.html"); ?>
    </div>
    <?
    }
    }
    }
    ?>
    <!-- end wrapper -->
    </body>
    </html>
    If i move the final php tags further up the page:

    PHP Code:
    <?
    }
    }
    }
    ?> 

    I will see the content of the page that is below these tags.

    If you can please help me on this that'll be great. I'm not sure if I need to alter my script or add something new?

    Thanks!
    Last edited by abbas1982; Oct 8, 2007 at 05:46.

  2. #2
    Theoretical Physics Student bronze trophy Jake Arkinstall's Avatar
    Join Date
    May 2006
    Location
    Lancaster University, UK
    Posts
    7,062
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up

    Hi, welcome to the sitepoint forums.

    I've tidied up the code a bit, and also fixed your problem. What you need to do is create a page record in the database, with an urlName of "Error_Page". In this page, explain that the user had the wrong url, with a link to the front page. Im guessing want the same to happen when the user didn't enter any urlName.

    Here's the code:
    PHP Code:
    <?php
    require('');
    require(
    '');
    $problem FALSE;
    if (!isset(
    $_GET['urlName'])) {
        
    $_GET['urlName'] = "Error_Page";
    }
    $urlNametrim($_GET['urlName']);
    $sql "SELECT * FROM guestlists WHERE urlName= '$urlName'";
    $result mysql_query($sql$dbc) or die('Error, query failed');
    if (!
    mysql_num_rows($result)) { // Nope - show content of error page
        
    $urlName"Error_Page";
        
    $sql "SELECT * FROM guestlists WHERE urlName= '$urlName'";
        
    $result mysql_query($sql$dbc) or die('Error, query failed');
    }
    $row mysql_fetch_assoc($result);
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
        <html xmlns="http://www.w3.org/1999/xhtml">
        <head>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
        <title><?php echo "{$row['pageTitle']}"?></title>
        
        <meta name="description" content="<?php echo "{$row['pageDescription']}"?>">
        <meta name="keywords" content="<?php echo "{$row['pageKeywords']}"?>.">
        
        <meta name="Author" content="Elite Clubbing">
        <meta name="Publisher" content="http://www.eliteclubbing.com">
        <meta name="copyright" content="Copyright (c) 2007, Elite Clubbing Limited ">
        <meta name="Distribution" content="global">
        <meta name="Robots" content="INDEX,FOLLOW">
        <META NAME="ROBOTS" CONTENT="NOODP">
        <meta name="revisit-after" content="1 day">
        
        <!-- RSS FEED -->
        <link href="http://www.eliteclubbing.com/eliterss.xml" rel="alternate" type="application/rss+xml" title="Elite Clubbing" />
        <!-- RSS FEED -->
        
        <!-- fav icon -->
        <link rel="icon" href="http://www.eliteclubbing.com/images/favicon.ico" type="image/x-icon" />
            
        <!-- CSS STYLE SHEET -->
        <link rel="stylesheet" type="text/css" href=""/>
        <!--[if IE]>
        <link rel="stylesheet" type="text/css" href="" />
        <![endif]-->
        <!-- CSS STYLE SHEET -->
        
        
        </head>
        
        <body>
        
        <!-- start wrapper -->
        <div id="wrapper">
        <!-- elite logo -->
        <div id="header">
        </div>
        <!-- elite logo -->
        <ul class="menu">
        <li><a href="http://www.eliteclubbing.com/home.php">Home</a></li>
        <li><a href="http://www.eliteclubbing.com/eliteparties.php" class="current">Parties</a></li>
        <li><a href="http://www.eliteclubbing.com/photos.php">Photo Gallery</a></li>
        <li><a href="http://www.eliteclubbing.com/elitevideogallery.php">Video Gallery</a></li>
        <li><a href="http://www.eliteclubbing.com/nightclubs.php" >Night Club Reviews</a></li>
        <li><a href="http://www.eliteclubbing.com/membership.php" >Membership</a></li>
        <li><a href="http://www.eliteclubbing.com/yourparty.php">Your Party</a></li>
        <li><a href="http://www.eliteclubbing.com/elitepress.php">Press</a></li>
        <li><a href="http://www.eliteclubbing.com/restaurants.php">Restaurants</a></li>
        <li><a href="http://www.eliteclubbing.com/rssfeeds.php">RSS Feeds</a></li>
        <li><a href="http://www.eliteclubbing.com/elitelifestyle.php">Lifestyle</a></li>
        </ul>
        <br style="clear: left" />
        <div id="main">
        <!-- start main -->
        <!-- splits the page into 3 -->
        <div id="columnsClubreviews">
        <div id="inner">
        <div id="leftClubreviews">
        <div id="clubsList">
        <span class="clubsList"> <strong>Elite Clubbing Parties</strong>
        <br />
        <br />
        <b>Thursday Nights</b>
        <br />
        <br />
        <?
        $query 
    "SELECT * FROM `guestlists` WHERE night='Thursday' AND active='1' ORDER BY title";
        
    $result mysql_query($query) or die('Error, query failed');
        while (
    $list mysql_fetch_array($result)) {
        echo 
    "<a href ='http://www.eliteclubbing.com/eliteparty.php?urlName={$list['urlName']}' >{$list['title']}</a>
        <br>"
    ;
        }
        
    ?>
        <br />
        <br />
        <b>Friday Nights</b>
        <br />
        <br />
        <?
        $query 
    "SELECT * FROM `guestlists` WHERE night='Friday' AND active='1' ORDER BY title";
        
    $result mysql_query($query) or die('Error, query failed');
        while (
    $list mysql_fetch_array($result)) {
        echo 
    "<a href ='http://www.eliteclubbing.com/eliteparty.php?urlName={$list['urlName']}' >{$list['title']}</a><br>";
        }
        
    ?>
        <br />
        <br />
        <b>Saturday Nights</b>
        <br />
        <br />
        <?
        $query 
    "SELECT * FROM `guestlists` WHERE night='Saturday' AND active='1' ORDER BY title";
        
    $result mysql_query($query) or die('Error, query failed');
        while (
    $list mysql_fetch_array($result)) {
        echo 
    "<a href ='http://www.eliteclubbing.com/eliteparty.php?urlName={$list['urlName']}' >{$list['title']}</a>
        <br>"
    ;
        }
        
    ?>
        
        </span>
        </div>
        </div>
        <!-- end left -->
        <!-- start content -->
        <div id="contentReviews">
        <?php

        
    echo "<h1 class='clubname'>{$row['title']}</h1><br><br><br>";
        
        echo 
    "<b>{$row['venue_name']}</b><br>";
        
        echo 
    "<b>{$row['address']}</b><br><br>";
        
        echo 
    "{$row['description']}<br><br>";
        
        echo 
    "<b>When:</b> Every {$row['night']}<br><br>";
        
        echo 
    "<b>Times:</b> {$row['times']}<br><br>";
        
        echo 
    "<b>Dress:</b> {$row['dress']}<br><br>";
        
        echo 
    "<b>Entry:</b> {$row['entry']}<br><br>";
        
        echo 
    "<b>Music:</b> {$row['music']}<br><br>";
        
        if (
    '' == $row['email'])
        {
        echo 
    "<b>Guest Lists:</b> Currently Unavailable. For our current nights please <span class='text'><a href='#'>view our events page</a></span> <br>";
        }
        else
        {
        echo 
    "<b>Guest Lists:</b> <span class='text'><a href ='mailto:{$row['email']}'>{$row['email']}</a></span> <br>";
        }
        
        
        
    ?>
        <br />
        </div>
        <!-- end content -->
        <div id="rightClubreviews">
        <div id="clubimages">
        <ul>
        <li id="t1"><img class="panelimage" src="<? echo "{$row['image001']}";?>" alt="<? echo "{$row['title']}";?>" width="190" height="126" /></li>
        <li id="t1"><img class="panelimage" src="<? echo "{$row['image002']}";?>" alt="<? echo "{$row['title']}";?>" width="190" height="126" /></li>
        <li id="t1"><img class="panelimage" src="<? echo "{$row['image003']}";?>" alt="<? echo "{$row['title']}";?>" width="190" height="126" /></li>
        <li id="t1"><img class="panelimage" src="<? echo "{$row['image004']}";?>" alt="<? echo "{$row['title']}";?>" width="190" height="126" /></li>
        </ul>
        </div>
        </div>
        <div id="googleAds">
        
        </div>
        </div>
        <!-- end inner -->
        </div>
        <!-- end columns -->
        </div>
        <!-- end main -->
        <!-- second half of page -->
        <div class="clear"></div>
        <?php include ("includes/footer.html"); ?>
        </div>
    <!-- end wrapper -->
    </body>
    </html>
    Last edited by Jake Arkinstall; Oct 8, 2007 at 04:41. Reason: Just edited it a bit
    Jake Arkinstall
    "Sometimes you don't need to reinvent the wheel;
    Sometimes its enough to make that wheel more rounded"-Molona

  3. #3
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,807
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    Hi abbas and welcome to the forums
    All I get from your first link is the 404 pagemoved page!
    http://www.eliteclubbing.com/pagemoved.html

    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  4. #4
    SitePoint Enthusiast
    Join Date
    Oct 2007
    Posts
    36
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hi arkin,

    thanks i will try this as soon as i can... and let you know how it goes!

    thanks

  5. #5
    SitePoint Enthusiast
    Join Date
    Oct 2007
    Posts
    36
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hey spike,

    the url hasn't shown up properly..

    it should be http://www.eliteclubbing.com/elitepa...tteryflylounge

  6. #6
    SitePoint Enthusiast
    Join Date
    Oct 2007
    Posts
    36
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hey arkinstall,

    i've finally managed to fix this issue!

    the code you suggested worked a treat!!

    thanks

  7. #7
    Theoretical Physics Student bronze trophy Jake Arkinstall's Avatar
    Join Date
    May 2006
    Location
    Lancaster University, UK
    Posts
    7,062
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    glad to help
    Jake Arkinstall
    "Sometimes you don't need to reinvent the wheel;
    Sometimes its enough to make that wheel more rounded"-Molona

  8. #8
    SitePoint Enthusiast
    Join Date
    Oct 2007
    Posts
    36
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hey arkinstall,

    I'm back and asking for your help again!...

    Though the script you modified for me works... it causes some problems with the rewrite rule.

    EG. If you http://www.eliteclubbing.com/elitepa...utterflylounge you should get a page which has the relevant information on it, however you just get the Error Page.

    My rewrite rule for my .htaccess file is

    Code:
    RewriteRule ^eliteparties/?$ ./eliteparty.php? [QSA,L]
    RewriteRule ^eliteparties/(.+)$ ./eliteparty.php?urlName=$1 [QSA,L]
    When I don't us this and use the dynamic URL such as:

    http://www.eliteclubbing.com/elitepa...tteryflylounge

    Everything is a ok!

    I'm not receiving an errors... which has left me scratching my head abit!!

    any ideas?...

  9. #9
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,807
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    Thats because your linking is inconsistent.
    the first link goes to:
    Code:
    http://www.eliteclubbing.com/eliteparty/thebutterflylounge
    whereas your rewrite rule says it should be
    Code:
    http://www.eliteclubbing.com/eliteparties/thebutterflylounge
    which if you go to the 2nd link - it is there
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  10. #10
    SitePoint Enthusiast
    Join Date
    Oct 2007
    Posts
    36
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hey spike,

    thanks for that! always seems to be the case when some fresh eyes look at something things get sorted!

    I'm still having problems however...

    If you goto:

    Code:
    http://www.eliteclubbing.com/eliteparties/carbon
    You get a random selection... and if you refresh the page you get a different venue on each refresh.

    This maybe because when you go to

    Code:
    http://www.eliteclubbing.com/eliteparties.php
    the intention here is that on each visit a random selection should be shown.

    Then using a file named eliteparty.php you'll select the venue.

    such as:

    Code:
    http://www.eliteclubbing.com/eliteparty.php?urlName=thebutteryflylounge
    I've tried re coded my .htaccess file so it's now:

    Code:
    RewriteRule ^eliteparty/?$ ./eliteparty.php? [QSA,L]
    RewriteRule ^eliteparty/(.+)$ ./eliteparty.php?urlName=$1 [QSA,L]
    but again i get an error page!!

    Code:
    http://www.eliteclubbing.com/eliteparty/thebutteryflylounge
    Any idea whats happening here?...

    do you think there's a problem with my PHP coding and rewrite not being compatible?!...

  11. #11
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,807
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    try

    Code:
    RewriteRule ^eliteparty/?$ ./eliteparties.php [L]
    RewriteRule ^eliteparty/([a-zA-Z0-9_])/?$ ./eliteparty.php?urlName=$1 [QSA,L]
    see if that makes a difference.
    Are you looking for the urlName variable on eliteparty.php?
    ie
    PHP Code:
    if(isset($_GET['urlName'])){
    // etc

    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  12. #12
    SitePoint Enthusiast
    Join Date
    Oct 2007
    Posts
    36
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    tried the alternative to the .htaccess but made no difference.

    my php code is: (this is placed at the top of the page above the <head> tag)

    PHP Code:
    <?php
    require_once(''); 
    require_once (
    ''); 

    $problem FALSE;

    if (!isset(
    $_GET['urlName'])) {

        
    $_GET['urlName'] = "errorpage";

    }

    $urlNametrim($_GET['urlName']);

    $sql "SELECT * FROM ec_guestlists WHERE urlName= '$urlName'";

    $result mysql_query($sql$dbc) or die('Error, query failed');

    if (!
    mysql_num_rows($result)) { // Nope - show content of error page

        
    $urlName"errorpage";

        
    $sql "SELECT * FROM ec_guestlists WHERE urlName= '$urlName'";

        
    $result mysql_query($sql$dbc) or die('Error, query failed');

    }

    $row mysql_fetch_assoc($result);

    ?>
    with the rest of the code being:
    PHP Code:
    <?php

        
    echo "<h1 class='clubname'>{$row['title']}</h1><br><br><br>";

        echo 
    "<b>{$row['venue_name']}</b><br>";

        echo 
    "<b>{$row['address']}</b><br><br>";

        echo 
    "{$row['description']}<br><br>";

        echo 
    "<b>When:</b> Every {$row['night']}<br><br>";

        echo 
    "<b>Times:</b> {$row['times']}<br><br>";

        echo 
    "<b>Dress:</b> {$row['dress']}<br><br>";

        echo 
    "<b>Entry:</b> {$row['entry']}<br><br>";

        echo 
    "<b>Music:</b> {$row['music']}<br><br>";

        if (
    '' == $row['email'])

        {

        echo 
    "<b>Guest Lists:</b> Currently Unavailable. For our current nights please <span class='text'><a href='http://www.eliteclubbing.com/eliteparties.php'>view our events page</a></span> <br>";

        }

        else

        {

        echo 
    "<b>Guest Lists:</b> <span class='text'><a href ='mailto:{$row['email']}'>{$row['email']}</a></span> <br>";

        }

        
    ?>

  13. #13
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,807
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    OK, just ran some tests using this code as the .htaccess file
    Code:
    # public #
    RewriteEngine On
    RewriteCond &#37;{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    
    RewriteRule ^eliteparty/?$ ./eliteparty.php [L]
    RewriteRule ^eliteparty/([a-zA-Z0-9_]+)/? ./eliteparty.php?urlName=$1 [QSA,L]
    assuming there is one page called eliteparty.php that everything is loaded on....

    and as a test, this php code
    PHP Code:
    <?php
        print_r
    ($_GET);
        if(!isset(
    $_GET['urlName'])) {
            
    $_GET['urlName'] = 'No Q';
        }
        
        
    $url $_GET['urlName'];
        
        if(
    $url == 'No Q') {
             echo 
    'default';
        } else {
            echo 
    $url;
        }
    ?>
    Try the htaccess first and see what happens.
    If there is no change, drop the htaccess file into a new folder with the php snippet and run that as a test.
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  14. #14
    SitePoint Enthusiast
    Join Date
    Oct 2007
    Posts
    36
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey Spike,

    Thanks for that again!

    I think what the problem might be is the server that the site is on.

    When I try the site on my own server it seems to work a ok:
    Code:
    http://www.spinmydesign.com/clients/eliteclubbing/eliteparty/thebutteryflylounge
    But he same script and .htaccess file on the clients server doesn't work.

    Do you think this could be the issue?

  15. #15
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,807
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    Very possibly but that is way beyond my remit!!!!!

    Check what version of Apache it is on the server against what yours is.
    Maybe going over to the Apache Configuration board on here and ask there.
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  16. #16
    SitePoint Enthusiast
    Join Date
    Oct 2007
    Posts
    36
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks for your help spike!

    i'll let you know how i get on!

  17. #17
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,807
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    No worries, hope you get sorted soon
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....


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
  •