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
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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.