PDA

View Full Version : am i doing this wrong? (conditionals)


sabret00the
06-10-2004, 07:21 PM
can you spot anything wrong with this code?

if ($action==report)
{
if ($bbuserinfo[usergroupid] > 0)
{
eval("\$report_form = \"".fetch_template("confessions_reportform")."\";");

if ($confirm==report)
{
if ($bbuserinfo[usergroupid] > 0 && $action == 'report' && $confessionid && $reason)
{
$body = "Please review confession $confessionid and take
appropriate action as you see fit\n\nReason given:\n
$reason\n\n$confessionurl\n\nThank You\n$bbuserinfo[username]";

vbmail($vboptions[$webmasteremail], 'Reporting A Confession', $body,
"From: \"$bbtitle Mailer\" <$vboptions[webmasteremail]>");
}
}
}
else
{
$url = "../confessions/";
eval(print_standard_redirect("confess_error_shouldnotbehere"));
}
}

it's within this if ($confessionid!='')
{
...
}


the second php tag opens the page "?confessionid=$confessionid"
where as the top php tag will go to ?confessionid=$confessionid&action=report" well should do anyway however it doesn't seem to want too and lastly since the '&action=report' is a form, the submitted data will go to "?confessionid=$confessionid&action=report&confirm=report"

Xenon
06-10-2004, 07:35 PM
erm, have you globalized the get / post parameters before using them here?

also alwasy put strings like report into '' :)

sabret00the
06-10-2004, 08:14 PM
yup, and i fixed the strings, but i can't figure out the problem, i just seem to be getting redicted back to the index, even when i comment out the redirect that should take me there.

sabret00the
06-10-2004, 08:15 PM
found the problem it was some duplicate code i had up earlier in the script :o

Xenon
06-10-2004, 08:35 PM
*gg*

such things can happen ^^

sabret00the
06-10-2004, 08:39 PM
always to me :( lol

Xenon
06-10-2004, 08:41 PM
Well, that's called Murphy's law