RE: [PHP] Can I use variable appended to the end of a link if I'm not using it for SQL query?
| From: | Martin Towell | Date: | Tue, 02 Apr 2002 05:35:16 +0000 |
| Subject: | RE: [PHP] Can I use variable appended to the end of a link if I'm not using it for SQL query? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-91079@lists.php.net to get a copy of this message | ||
yep - definately need that hidden field, just a simple line will do
(normally)
<input type="hidden" name="title" value="<?= $title; ?>">
you'll have to do "funky" stuff if there's quotes in the title or anything
that gets escaped, like "'", and "\", etc
-----Original Message-----
From: lmlweb [mailto:junkit@lmlweb.com]
Sent: Tuesday, April 02, 2002 3:33 PM
To: php-general@lists.php.net
Subject: Re: [PHP] Can I use variable appended to the end of a link if
I'm not using it for SQL query?
Hi,
I went ahead and tried it - it works beautifully, where the title does show
up perfectly when you arrive at the form.
I filled out the form both to test the actual email body and the resulting
html page once you've filled out the form and submitted.
The $title variable does not show up in either the email body nor in the
resulting page (the thank you for filling out this form page).
While I can make the resulting page very generic by not adding the $title
anywhere there, but the email body must contain the $title variable. I'm
thinking maybe I should be adding the hidden form field for the $title?
Here's the mail code:
mail("$recipientname
<$final_recipient>","$form[subject]","$form[first_name]
$form[last_name] ($form[email]) send the following message to $recipientname
($final_recipient) : \n\n $form[message]\n\n Name: $form[first_name]
$form[last_name] \n Event: $event \n Address: $form[address] \n
City/Province: $form[city], $form[province] \n Phone: $form[areacode]
$form[part1]-$form[part2] \n Email: $form[email] \n Subject: $form[subject]
\n", "From: $form[first_name] $form[last_name] <$form[email]>\nReply-To:
$form[first_name] $form[last_name] <$form[email]>\nContent-type:
text/plain\nX-Mailer: PHP/" . phpversion());
"Martin Towell" <martin.towell@world.net> wrote in message
news:6416776FCC55D511BC4E0090274EFEF508A138@exchange.world.net...
> sure - do exactly as you described.
>
> just because a variable is appended to a url, doesn't mean it HAS to be
used
> in an SQL statement. It can be used for anything you like - even
ignored...
> :)
>
>
> -----Original Message-----
> From: lmlweb [mailto:junkit@lmlweb.com]
> Sent: Tuesday, April 02, 2002 2:56 PM
> To: php-general@lists.php.net
> Subject: [PHP] Can I use variable appended to the end of a link if I'm
> not using it for SQL query?
>
>
> For example, on a page, I have this link:
>
> <a
> href="http://www.website.com/register.html?select=$title">$title</a>
>
> where
>
> $title is whatever the database spits up on a previous query. Now I want
to
> be able to carry that $title onto the next page, which is a form mail for
> registering for the events, without having to use database. Basically I
want
> to be able to set the form up so it says:
>
> To register for $title, please fill out the form:
> who: ____
> what: _____
> where: _____
> [submit] [reset]
>
> and when it's submitted the mail() function will have an subject heading
> that consits of "$title Registration"
>
> is that possible?
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php