Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing values frpm PHP to HTML 1

Status
Not open for further replies.

ZOR

Technical User
Jan 30, 2002
2,963
GB
The site entry page (index.htm) asks for username/password, the submit then passes the values to a PHP page for validation against the server database. If a visitor has permission, they go into HTML pages which contain mailto:

Question - after moving into HTML page with mailto:, how do I get the data back I had obtained in the previous PHP page to include in the mailto email?. I have looked at sessions, but if correct thats only a PHP to PHP page function or is it?

Regards
 
I believe that you could set a cookie using PHP and then access it on your HTML pages using javascript. This however requires that your users have javascript enabled.

The best solution to your problem would be to make all of the relevant pages PHP pages and then use PHP sessions.
 
Many thanks Dweezel.

As you say not everyone has Java enabled. I only just moved into PHP last week, and struggling. My other problem is I cheat and use what most people deplore - Frontpage. As my server does not recognise PHP pages unless they end with .PHP
wonderful Frontpage will not go into design mode. So how do I work on a page that I can see whilst using PHP. Do I have to keep changing the extension to see HTML design? Wish I was on a desert island at the moment. Regards
 
Since mailto: is a simple html call to start email programs with printed information, you can output any php code to it in the same way you would output anything else in php. The bigger question is ... why are you using clumsy, awkward and very client dependent call mailto: if you have php's very own mail() (and also great custom classes like phpmailer) available to you, which can do the job quicker, easier and more reliable.
 
Thanks again Vragabond. As you can see/know, I am very new with PHP. I can see all the advantages of using it with MySql and the mailing side, and see where you are comming from. As I need to be able to visually see the pages I am putting together in design mode, which HTML does, I need to find a crossover point to get into PHP with data to send. However that raises the issue of how can I pass data to a PHP page from an HTML page without cookies, etc. Can't use the database in HTML. ??? But thanks again.
 
If the only reason you're still using .html extension is the fact you need it to design the page in FrontPage, I am afraid that is hardly a good excuse for doing it. What happens if you open a page with .php extension (but no php code) in FrontPage?

Incidentally, there is an article about using php within frontpage on MS website:

If nothing works, simply make a solid design with placeholders for code in FrontPage and then manually change them as you convert the static html page to dynamic php.
 
No wonder your top of the class!! Thanks very much, I can now see my pages!!!!! Thanks a milion
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top