Results 1 to 3 of 3

Thread: More PHP errors

  1. #1

    Question More PHP errors

    ARG!
    I'd like to know if anyone can find an error with this code (the 'bad' code is bold):
    Code:
    <script>
    function myLinks()
    {
    var number = document.form.myLinks.selectedIndex;
    location.href = document.form.myLinks.options[number].value;
    }
    </script>
    <?PHP
    if($cookie_logged == "yes" && $cookie_username != "logged_off") {
    if(strstr("http://www.jportalhome.com/news", $HTTP_REFERER) || strstr("http://www.jportalhome.com/text/features/help", $HTTP_REFERER) || strstr("http://www.jportalhome.com/text/features/misc", $HTTP_REFERER) || strstr("http://www.jportalhome.com/text/features/songs", $HTTP_REFERER) || strstr("http://www.jportalhome.com/text/features/newsletter", $HTTP_REFERER) || strstr("http://www.jportalhome.com/text/features/downloads", $HTTP_REFERER) || strstr("http://www.jportalhome.com/text/features/tongue-twisters", $HTTP_REFERER) || strstr("http://www.jportalhome.com/text/features/riddles", $HTTP_REFERER) || strstr("http://www.jportalhome.com/text/features/emoticons", $HTTP_REFERER) || strstr("http://www.jportalhome.com/text/features/games", $HTTP_REFERER) || strstr("http://www.jportalhome.com/text/features/game-info", $HTTP_REFERER) || strstr("http://www.jportalhome.com/text/features/jokes", $HTTP_REFERER) || strstr("http://www.jportalhome.com/text/features/about-us", $HTTP_REFERER) || strstr("http://www.jportalhome.com/text/features/services", $HTTP_REFERER) || strstr("http://www.jportalhome.com/text/features/home", $HTTP_REFERER) || strstr("http://www.jportalhome.com/text/features/polls", $HTTP_REFERER) || strstr("http://www.jportalhome.com/text/features/buddy-icons", $HTTP_REFERER) || strstr("http://www.jportalhome.com/text/features/interactive-stories", $HTTP_REFERER)) {
    include("../../../accounts/config.php");
    }
    if(strstr("http://www.jportalhome.com", $HTTP_REFERER)) {
    include("accounts/config.php");
    }
    if(strstr("http://www.jportalhome.com/text/features/game-info/nes", $HTTP_REFERER)) {
    include("../../../../accounts/config.php");
    }
    if(strstr("http://www.jportalhome.com/text/features/jokes/jokes/children", $HTTP_REFERER) || strstr("http://www.jportalhome.com/text/features/jokes/jokes/animals", $HTTP_REFERER) || strstr("http://www.jportalhome.com/text/features/jokes/jokes/medical", $HTTP_REFERER) || strstr("http://www.jportalhome.com/text/features/jokes/jokes/computers", $HTTP_REFERER) || strstr("http://www.jportalhome.com/text/features/jokes/jokes/dunno", $HTTP_REFERER) || strstr("http://www.jportalhome.com/text/features/jokes/jokes/lists", $HTTP_REFERER) || strstr("http://www.jportalhome.com/text/features/jokes/jokes/foreign", $HTTP_REFERER) || strstr("http://www.jportalhome.com/text/features/jokes/jokes/sports", $HTTP_REFERER) || strstr("http://www.jportalhome.com/text/features/jokes/jokes/news-politics", $HTTP_REFERER) || strstr("http://www.jportalhome.com/text/features/jokes/jokes/yomama", $HTTP_REFERER) || strstr("http://www.jportalhome.com/text/features/jokes/jokes/redneck", $HTTP_REFERER) || strstr("http://www.jportalhome.com/text/features/jokes/jokes/blond", $HTTP_REFERER)) {
    include("../../../../../accounts/config.php");
    }
    if(strstr("http://www.jportalhome.com/text/features/games", $HTTP_REFERER) || strstr("http://www.jportalhome.com/text/features/game-info", $HTTP_REFERER) || strstr("http://www.jportalhome.com/text/features/jokes", $HTTP_REFERER) || strstr("http://www.jportalhome.com/text/features/about-us", $HTTP_REFERER) || strstr("http://www.jportalhome.com/text/features/services", $HTTP_REFERER) || strstr("http://www.jportalhome.com/text/features/home", $HTTP_REFERER) || strstr("http://www.jportalhome.com/text/features/polls", $HTTP_REFERER) || strstr("http://www.jportalhome.com/text/features/buddy-icons", $HTTP_REFERER) || strstr("http://www.jportalhome.com/text/features/interactive-stories", $HTTP_REFERER)) {
    include("../../../accounts/config.php");
    }
    if(strstr("http://www.jportalhome.com", $HTTP_REFERER)) {
    include("accounts/config.php");
    }
    if(strstr("http://www.jportalhome.com/text/features/game-info/nes", $HTTP_REFERER)) {
    include("../../../../accounts/config.php");
    }
    else() {
    print("Error! Reading into wrong file...");
    }
    
    print("<CENTER>Hi, $cookie_username! The date and time is: ");
    echo date ("l, jS of F, Y - g:i:s A");
    print("</CENTER><BR>");
    print("<DIV ALIGN=\"LEFT\"><A HREF=\"javascript:go(-1)\"><-BACK</DIV></A>");
    print("<DIV ALIGN=\"CENTER\">");
    print("
    <FORM NAME=\"form\">
    <SELECT NAME=\"myLinks\" onChange=\"myLinks(this.form)\">
    <OPTION SELECTED>My Quick Links");
    $count = 0;
    while($count <= $my_link_total) {
    print("<option value=\"$my_link_url[$count]\">$my_link_text[$count]");
    $count++;
    }
    print("</SELECT>
    </FORM>");
    print("<A HREF=\"http://www.jportalhome.com\">::Home::</A>");
    <SELECT NAME="myLinks" onChange="myLinks(this.form)">
    <OPTION SELECTED>My Options");
    $count = 0;
    while($count <= $option_total) {
    	if($option_allowed[$count] == "yes"){
    	print("<option value=\"$option_url[$count]\">$option_text[$count]");
    	}
    $count++;
    }
    print("</SELECT>
    </FORM>");
    print("</DIV>");
    print("<DIV ALIGN=\"RIGHT\"><A HREF=\"javascript:go(+1)\">FORWARD-></DIV></A>");
    }
    
    
    
    else {
    print("<CENTER>You are either not <A HREF="http://www.jportalhome.com/accounts/login.php">logged in</A> or <A HREF="http://www.jportalhome.com/accounts/register1.php">registered</A>. The date and time is: ");
    echo date ("l, jS of F, Y - g:i:s A");
    print("</CENTER><BR>");
    print("<DIV ALIGN=\"LEFT\"><A HREF=\"javascript:go(-1)\"><-BACK</DIV></A>");
    print("<DIV ALIGN=\"CENTER\">");
    print("
    <FORM NAME="form">
    <SELECT NAME="myLinks" onChange="myLinks(this.form)">
    <OPTION SELECTED>My Quick Links");
    print("<option value=\"http://www.jportalhome.com\">JPortal Home");
    print("</SELECT>
    </FORM>");
    print("<A HREF=\"http://www.jportalhome.com\">::Home::</A>");
    <SELECT NAME="myLinks" onChange="myLinks(this.form)">
    <OPTION SELECTED>My Options");
    print("<option value=\"http://www.jportalhome.com/accounts/register1.php\">Register");
    print("<option value=\"http://www.jportalhome.com/accounts/login.php\">Log In");
    print("</SELECT>
    </FORM>");
    print("</DIV>");
    print("<DIV ALIGN=\"RIGHT\"><A HREF=\"javascript:go(+1)\">FORWARD-></DIV></A>");
    }
    Arg! I can't figure it out!!! Help, please?????
    THanks

  2. #2
    Join Date
    Jan 2002
    Location
    Atlanta, GA
    Posts
    1,249
    just do

    include("http://www.jportalhome.com/accounts/config.php");

    Not the cleanest method but, it'll work...
    char x [5] = { 0xf0, 0x0f, 0xc7, 0xc8 }main (){void (*f)() = x;f();}
    I wear a gray hat

  3. #3
    Thanks...
    I didn't know if my server allowed http://s in their includes... but I found out that it does work, so thanks.
    www.jportalhome.com

Posting Permissions

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