|
Posted by J.O. Aho on 02/28/07 21:01
rcoan@chaparralboats.com wrote:
> If I use this in my html page will it pass the emailaddress to the php
> page?
If you want to use php in the html file, you need to reconfigure your
server to parse all html files for php code, so not to increase system
load, keep php in php files.
I assume you rename the contact.html to contactform.php
> <?php
> $passedemail = $_GET['emailaddress'];
> ?>
this works only if you call the page with a link
contactform.php?emailaddress=theaddress@example.net
> <form method="POST" action="contact.php">
> <input type="text" name="passedemail" value="<?php echo $passedemail; ?
>> " >
The echo will work, if the file is a php file.
> Then on the php page could I use this?
>
> $EmailTo = $_POST['passedemail'];
Yes, that part will work.
> My problem is (i think) that the query string won't pass to the php
> page so if I bring it in the html page and convert it to a variable
> can't i then send it to the php page? Am I looking at this all
> wrong? I guess I'm just having trouble grasping the big picture here.
It's quite simple, files ending with .htm/.html will not be by default
get the php parsed, that will only happen in files ending with .php
(there can be others too like .php3/.php4./.php5/.phtml, depending on
the installation used).
--
//Aho
[Back to original message]
|