Please help , I am confused

Hi all
I am very new to php.

This is the problem that I have. I have got my html page which is a template (I believe) then I have a php page which gets my data from the html post. This works fine. I then have a currency PHP converter which converts amounts of what the site is selling to different currencys. Now if I change the extension of the html to php and run that then the converter works fine, but the form does not. If I put the converter code into the other php file and have the origional html file then the form post works well and the currency convert puts its echo $emailcost at the bottom of the screen.

I think I am looking for a way to read a php variable after it is calculated in the php page back into the HTML page as html .

If anyone can help I would appreciate it.

Thanks in advance

Peter

I have 2 files , one is a HTML which I want to display a $variable from a php file.

The php file is the initial url file and the html is the template

What command do I use to get the variable from the PHP into HTML

Thanks

ur question is very confusing. u cant put a variable into HTML.

PHP works that way: a PHP file is called and just return HTML. so everything that has to be done has to be done there.

if u wanna use a template u my define ur own style of templates and template variables, wich are procect by the php file.

index.php:
[php]

<?php $template=file_get_contents('template.html'); $template=str_replace('<$emailcost>',$emailcost,$template); echo $template; ?>

[/php]

template.html:

<html>
 <head>
  <title>Title</title>
 <head>
 <body>
  <$emailcost>
 </body>
</html>

but why do u try to make it that compicated. start with one file being a php-file. and as sone as u got used to php well enough u may still change it to a template bases solusion.

Thanks the problem is that I have used codcharge studio and this makes the template html files. This almost did work but It have a problem.

I think it is easier if you see the site

http://www.gr8matches.com/products.php

if you look now the payment form works correctly but the php code to work out the exchange is working but I cannot put it into the html page. It sits at the bottom of the page (php file)
I have tried to put the php and html into 1 file and all hell breaks loose. This is why I need a way to get a variable into the html, if you understand , thanks

404

Sponsor our Newsletter | Privacy Policy | Terms of Service