Hi all I use this code to include a page into other one <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> <?php if ($num = 1){ include('1.php');} else{ include('error.php');} ?> PHP: But this code generates unwelcome blank space on the top of the page on ie but on Firefox work well! How can resolve this problem Thanks in advance
I can’t do this because page has continue <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> <?php if ($num = 1){ include('1.php');} else{ include('error.php');} ?> some html code PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"><?php if ($num = 1){ include('1.php');} else{ include('error.php');} ?> some html text here Code (markup): Peace,
in the if ($num = 1) you are assigning $num with a value 1 not a condition if $num equal to 1 the result is ... the if condition will always return true and the statement include('1.php'); will always get executed. if you mean you want to compare $num with 1 try using if ($num == 1) instead
I've had this problem before. Make sure you upload your file in ASCII not Binary. Sometimes, with some FTP servers, you have to set this manually. Also try converting your newlines to "\n" in your text editor. Lemme know which editor you're using and I'll give you more specific instructions.
Thanks all I solve this problem using notepad++ (http://notepad-plus.sourceforge.net/) Open php files with notepad++ and in Format menu chose encode in utf-8 without BOM and save it.