Web Hosting Talk







View Full Version : More PHP errors


Joshua44
10-11-2002, 02:35 PM
ARG!
I'd like to know if anyone can find an error with this code (the 'bad' code is bold):

<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 :)

Studio64
10-11-2002, 08:33 PM
just do

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

Not the cleanest method but, it'll work...

Joshua44
10-12-2002, 12:29 PM
Thanks...
I didn't know if my server allowed http://s in their includes... but I found out that it does work, so thanks. :D