Jump to content

please help with function problem


lJesterl

Recommended Posts

ill try to explain the best I can. I am working on some scripts for a gaming ladder and im using cookies and sessions. Im using the following code to display messages when an action is complete i.e for deleting comments

 

 

if($result){
include("finishmessage.php");
display_message("Comment(s) have been deleted<META HTTP-EQUIV='refresh' content='2;URL=playermanager.php'>","playermanager.php");
}
}

 

all is well it goes to the page, redirects, everything.

 

Here is the problem.

 

When it goes to the page it does not recognize the session becuase on the menu i use if session id = 0 login, validate else player manager, team manager

 

when it goes to finishmessage.php it does not recognize the session id at all even if i list $session[id] in the finishmessage.php

 

here is the code for finishmessage.php

 

<?
function display_message($finishmessage,$returnpage){

if($returnpage){
$returnto="$returnpage";
}else{
$returnto="main";
}


include("config/dlconfig.php");
include("include/session.php");

$poplayerid=$HTTP_COOKIE_VARS["pid"];
$poplayerpw=$HTTP_COOKIE_VARS["ppw"];

$out[body]=$out[body]."
<center>
<br>
<br>$finishmessage<br>

<br>
<br>
$session[id]
</center>";

include "themes/$theme/$themefile";
exit;
}



?>

 

 

Please help i dont know how else to show a message

 

Link to comment
https://forums.phpfreaks.com/topic/44446-please-help-with-function-problem/
Share on other sites

umm try including your session file at the way top and i think you need the single quotes when you use stuff in array format with letters like this

echo $var[one]; //i think would be wrong
echo $var['one']; //would be right
$varshow = "one"; echo $var[$varshow]; //would be right
//it's just a guess because my scripts didnt work till i added the single quotes

so try changing

$out[body]=$out[body]."

<center>

<br>

<br>$finishmessage<br>

 

<br>

<br>

$session[id]

</center>";

to

$out['body']=$out['body']."
<center>
<br>
<br>$finishmessage<br>

<br>
<br>
".$session['id']."
</center>";

and so on...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.