Php to ms doc question

Hello forums
I am currently doing a script to download a .doc file created by php from a mysql table. So far the script is working, however is it possible to make the word document in landscape format. What I am getting right now is in portrait format. here’s what I have:

<?
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=index.doc");
header("Pragma: no-cache");
header("Expires: 0");

include '../../opendb.php';
$cap="<table align=center border=1><tr><th colspan=\\"3\\">PERSONAL DETAILS 
</th></tr>";
$title="<tr><td><b>NAME</b></td><td><b>E-MAIL</b></td><td><b>CITY</b></td></tr>";

$tmp_per_res=mysql_query("select * from sd_record");
while($row=mysql_fetch_array($tmp_per_res,MYSQL_BOTH))
{

$body.="<tr><td>".$row['name']."</td><td>"
		.$row['email']."</td><td>"
		.$row['city']							
		."</td></tr>";
					
}
echo $cap.$title.$body."</table>";						
?>

tnx …

Hi,

I think this could be the solution :

<style>
<!–
@page Section1
{
mso-page-orientation:landscape;
}
–>
</style>

They can work on Windows XP, it’s a setting in php.ini.

However, I’d suggest you don’t use them, as it makes your code less portable (some hosts may not allow short tags).

wow it did work…and it’s amusing the short php tags does work on windows xp.

Thanks a lot.

You’re using short php tags, try regular php tags instead:


<?php include 'home.php'; ?>

If that doesn’t help, please let us know what (if any) error messages are displayed.

hello forums
I don’t know if this is the right forum to post this.

Anyway I’m usung xammp as a test server on a windows vista machine but for strange reason this code doesn’t wrok:

<? include 'home.php' ?>

Is there a special setting for php includes on Windows vista. I also tried the wampp server and it still doesn’t work.

I hate vista so bad … any ideas?