Jump to content

Recommended Posts

Hey Everybody,

I guess I'll start with a basic rundown of what I'm trying to do. I made a form that posts to another PHP page and then lets the user recheck the information they entered and then from there it emails both me and the user a preexisting word document filled out with the variables already in there(in theory). However, I'm running into trouble on the last part. What would be the best way to go about this? I tried an include() of the HTML code of the Word document but the variables only show up not actually write in ( $_POST[product]; ) instead of "Product". I'm kinda stumped because the HTML of the Word document has lots of double quotes and won't turn into a variable to use to echo into an actual Word document. And it has to be Word. I'm newer to PHP too so any help would be greatly appreciated.

Thanks,

-Dan

Unfortunately,

The document I'm working with is a legal document and I don't know the issues and stuff regarding it. But basically I'm trying to


//Create file "(Name) (Reference) (Secret Key)//
$filename = ($_POST[cosign]." ".$short." ".$hash.".doc");
$fp = fopen("done/".$filename, 'w+'); 

$str = '<html xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:w="urn:schemas-microsoft-com:office:word"
xmlns:st1="urn:schemas-microsoft-com:office:smarttags"
xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=ProgId content=Word.Document>

...

 

and then $str is written into the word document.

 

But there's other double and single quotes in there. Do I need to replace them all? I mean I can do this I'm just trying to learn and see if there's a quicker way to accomplish this.

Sorry for sounding like a noob.

-Dan

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.