Hey gang,

Ok here's my problem, I'm in the midst of creating a string replace to work
on a rtf file that is on the server, this fuctionallity works perfect with
"GET" but not "POST", I guess I don't understand why.  The reason I don't
want to use GET over POST is due to the character restrictions. I need to be
able to place more characters than what are allowed in the URL. I created a
test script to have a person fill in the form fields and it would write a
detailed letter for them. This was just an idea I was using to test the
replacement functions within a rtf document.  My main project that I'm going
for, is to allow our on-site techs to enter in what they have done for a
client, lay it out perfect for our stationary and then hand the client their
spec sheet and invoice straight from the printer without having to come back
to the office.

The overall end of this will more than likely be database driven and maybe I
should place these items into the database then turn around and pull them
out assigning them to the given replace functions.  But my problem still
lies in the fact that I don't understand why the "GET" functionallity works
with this form and "POST" will not.

After some rough testing, the template is being displayed as it fills in the
static parts of the form by itself and then replaces all of my <<FNAME>>
<<LNAME>> with "" (blank spaces).

Code is below, any help would be wonderful!

rtfform.html::
<HTML><HEAD><TITLE>Testing RTF Input</TITLE></HEAD>
<BODY>
<FORM NAME="TEST" ACTION="rtf.php" METHOD="POST">
FIRST NAME: <INPUT TYPE=TEXT NAME="FNAME" LENGTH=30><BR>
...
Rest of form elements
...
<INPUT TYPE=SUBMIT NAME=SUBMIT VALUE="TEST ME">
</FORM>
</BODY></HTML>
>>>end rtfform


rtf.php::
$name = $_POST['FNAME'];
... rest of post variable conversions

$filename = "Lettertest.rtf";

header('Content-type: application/msword');
header('Content-Disposition: "Rtftest.rtf"');
$fp = fopen($filename, "r");

$output = fread($fp, filesize($filename));

$output = str_replace("<<FNAME>>",$name,$output);
... rest of output str_replace items

echo $output;
>>>end rtf.php

Thanks in advanced
Wolf

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to