Page 1 of 1

hiding/showing problem

Posted: Tue Oct 28, 2003 11:57 am
by ex247
this is the code im using to show if the person is "user":

Code: Select all

<?
if (!is_user())
	{
 print "<TR><TD CLASS='td_label'>Problem Starts: &nbsp;&nbsp;</TD><TD>$problemstart</TD></TR>" ;
 print "<TR><TD CLASS='td_label'>Problem End: &nbsp;&nbsp;</TD><TD>$problemend</TD></TR>" ;
 }
 ?>
and the variable for $problemstart and $problemend are:

Code: Select all

$problemstart = "$_POST[frm_year_problemstart]-$_POST[frm_month_problemstart]-$_POST[frm_day_problemstart] $_POST[frm_hour_problemstart]:$_POST[frm_minute_problemstart]:00$_POST[frm_meridiem_problemstart]";
		$problemend   = "$_POST[frm_year_problemend]-$_POST[frm_month_problemend]-$_POST[frm_day_problemend] $_POST[frm_hour_problemend]:$_POST[frm_minute_problemend]:00$_POST[frm_meridiem_problemend]";
but its not showing up when its printed... its just showing blank... and clues?

Posted: Tue Oct 28, 2003 12:08 pm
by kendall
ex247,

Im not expert but lets do some process of elimination here....

try use the syntax

Code: Select all

$problemstart = $_POST["frm_year_problemstart"].'-'.$_POST["frm_month_problemstart"].'-';
note my quotes!!!! unless frm_year_problemstart is a $var
usually somtimes when variables are in 'quotes' when echoing a string the variable is literally outputted as a string. so if you actually get '$_POST["frm_year_problemstart"]' it could be a reason....

but you said its showing up blank???

next thing to is to see what version of php you have

Code: Select all

echo phpversion();
cant remember if this is the php function to check for the version but if its not > 4 you mite wanna use $HTTP_POST_VARS[ instead of $_POST

can't think of any other reasons as your query is a bit vague...mite wanna try details and may an example and a sample code for further dubuggin

Kendall

Posted: Tue Oct 28, 2003 12:11 pm
by nick2
isn't it

<?
phpinfo()
?>

tells you everything including the version at the top.

Posted: Tue Oct 28, 2003 12:18 pm
by ex247
PHP Version 4.3.3

and um...

Code: Select all

$problemstart = "$_POST[frm_year_problemstart]-$_POST[frm_month_problemstart]-$_POST[frm_day_problemstart] $_POST[frm_hour_problemstart]:$_POST[frm_minute_problemstart]:00$_POST[frm_meridiem_problemstart]"; 
      $problemend   = "$_POST[frm_year_problemend]-$_POST[frm_month_problemend]-$_POST[frm_day_problemend] $_POST[frm_hour_problemend]:$_POST[frm_minute_problemend]:00$_POST[frm_meridiem_problemend]";
is fine, i know my code is messye, but it displays find if i dont have it on the

Code: Select all

if(!is_user())
then it works find, like if i dont print it, its wierd that only when i do a print it does that.

Posted: Tue Oct 28, 2003 1:25 pm
by kendall
nick2,

yes it is but i just wanted to check the version no need to go trhough all that drama

ex247,

uhhmm...gonna have to break done into english man...

but what your saying is that the code prints out when its not in the 'if' loop?

but doesnt when is in the 'if' loop?

well then lets look at the if
what is the is_user function?

it looks like its not returning a correct answer..lets have a look at it shall we

Kendall