Try setting up the form using the Action, and follow all the
directions. Make sure you get the mail as you expect. (You’ll need to
test this on a server, it can’t run on your Mac unless you enable the
built in PHP server in Mac OS X, or use a third-party tool like MAMP
to run a local server.)
Next, look at the form handler that the Action generated for you (it
will be named something-go.php where ‘something’ is related to the
filename of the form page it handles). It’s a plain text file
containing the programming instructions for your server to interpret,
and you’ll need a decent programmer’s text editor like the fabulous
(and FREE) TextWrangler in order to edit it without making trouble for
yourself.
To create a unique id in PHP, you just do this (anywhere inside the <?
php and ?> delimiters):
$rma = uniqid();
Now the variable $rma contains a short hash of letters and numbers
that’s fairly well collision-proof. (It won’t be on a Windows server,
but that’s just part of the fun you get if you decide to use Windows
for anything important.) Each time the script runs, this value will be
different and it won’t repeat.
So now you have to get into the code that sends mail, find the spot
where the body of the mail message is composed for the admin to
receive, and add your $rma bit into it somewhere. And do the same for
the e-mail confirmation sent to the person who filled in the form. You
have to call $rma = uniqid() exactly once in your script, and then re-
use that value in each place that you need to insert it, otherwise
each e-mail would have a different value for RMA, kind of negating the
purpose.
If you get stuck, locate the handler in your site folder and copy all
of its contents, and paste them at http://pastie.org and post the URL
to the resulting Pastie here.
This strikes me as a very gentle starting point to learn more about
how PHP works. You’ll have Tim’s Action to roll out the bulk of it,
and you can add the little grace notes that you need very easily.
Walter
On Sep 20, 2010, at 9:23 PM, Mike Cresci wrote:
Random numbers are fine. I have not done anything with php before
but I looked at the php feedback form and it looks like something I
can do. I am a bit confused on how to use “use the PHP function
uniqid().”
What I want to do is send the form response data to the right
people and then copies of the email sent to the person requesting
the RMA with the number/date/time to
whoever they want a copy to.
Some of this seems easy and some is a bit confusing.
By the way - I never go on these threads but please excuse me if I
am not technically responding correctly.
Thanks for your assistance and answers Walt and Mike
On 20 Sep 2010, 10:30 pm, waltd wrote:
Are they storing these tracking numbers in a database or something
like that? That would be where I would start looking if I needed to
integrate with another system. If that system generates IDs, I would
find a way to ask it for the next one, or to remotely invoke its RMA-
generation routine.
If they just need to create a random, non-sequential number, then
it’s
pretty simple to do this. If you’re using PHP Feedback Form to drive
your form, then you can extend the formname-go.php file that it
generates pretty easily. One way to create a short, random snip of
alphanumerical nonsense is to use the PHP function uniqid(). You
could
add the output to your admin e-mail message and to the message sent
to
the user. This will take a little bit of PHP hacking, but nowhere
near
the level needed for the first solution.
Walter
On Sep 20, 2010, at 4:45 PM, Mike Cresci wrote:
Hi,
One of my clients wants a form on their website that will generate
an email response back to the person who submitted it with a
tracking or return authorization automatically generated.
Can anyone point me in the right direction?
Thanks,
Mike
freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options
freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options