Jump to content

call function


Pavlos1316

Recommended Posts

give your page a .php extension and replace <emptyempty> with

<?php include(date&time.php); ?>

 

But really you shouldn't use & in your file name and it would be better to have a file that gets all your data for your page at the top, and then just use

<?=$var?>

wherever you want your data.

 

Also as masterAce14 says, you can probably just get away with using the date function if that's what you want.

 

Good luck

Link to comment
https://forums.phpfreaks.com/topic/117136-call-function/#findComment-602475
Share on other sites

date&time.php was ex name but that file includes time & date function. and i want to call it in a column inside my top.html....... if possible. Cannot change top.html cause then I have to change a lot of things.

 

Exept if there is an easy php script to display my own time and date in real time.

 

Oh and <?php include ("");?> doesn't work!!!

Link to comment
https://forums.phpfreaks.com/topic/117136-call-function/#findComment-602479
Share on other sites

You can only use PHP code within .php files, not .html files. However if you have access to your servers configuration, then you can configure the server so it parses .html files as PHP.

 

If not, then there is no other option to have php code running in .html files. If you are concerned with having to change all your links from path/file.html to path/file.php then don't worry, you can use mod_rewrite. This option will save you from having to change your links, here is an example:

RewriteRule ^(.*)\.html$ $1.php [L]

With the above any request for a file called filename.html will call filename.php instead.

Link to comment
https://forums.phpfreaks.com/topic/117136-call-function/#findComment-602928
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.