Parse error: parse error, unexpected T_STRING in D:\web_pub\word.php on line 29
This is the error when I run
http://xxx.xxx.xxx.xxx/word.php?YourName=Richard%20Quadling&YourAge=36]
With this code (inside word.php)
<?php
// Some servers may have an auto timeout, so take as long as you want.
set_time_limit(200) or die ('så døde den sku');
// Show all errors, warnings and notices whilst developing.
error_reporting(E_ALL);
// Used as a placeholder in certain COM functions where no parameter is required.
$empty = new VARIANT();
// Load the appropriate type library.
com_load_typelib('Word.Application');
// Create an object to use.
$word = new COM('word.application') or die('Unable to load Word');
print "Loaded Word, version {$word->Version}\n";
// Open a new document with bookmarks of YourName and YourAge.
$word->Documents->Open('d:/web_pub/JA.DOC');
// Fill in the information from the form.
$word->Selection->GoTo(wdGoToBookmark,$empty,$empty,'YourName'); // Note use of wdGoToBookmark, from the typelibrary and the use of $empty.
$word->Selection->TypeText($_GET['YourName']);
$word->Selection->GoTo(wdGoToBookmark,$empty,$empty,'YourAge');
$word->Selection->TypeText($_GET['YourAge']);
// Save it, close word and finish.
$word->Documents[1]->SaveAs('d:/web_pub/{$_GET['YourName']}.doc');
$word->Quit();
$word->Release();
$word = null;
print "Word closed.\n";
?>
Does anyone have any idea?