can't do embedded PHP<

admin

Administrator
Staff member
ok, I have hosting through <!-- w --><a class="postlink" href="http://www.ehostsource.com">www.ehostsource.com</a><!-- w --> and I'm having a problem. Maybe you guys can tell me if it's me or them. I seem to be able to make a .php file, and use it, but I can't embed php in mt html documents. try this: <!-- m --><a class="postlink" href="http://campbells.dikaios.net/php/clock.php">http://campbells.dikaios.net/php/clock.php</a><!-- m -->
all that is in that file is this:
<?php
echo date("h:i:s A");
?>

did you get the server time? seems like php works...well, now try <!-- m --><a class="postlink" href="http://campbells.dikaios.net/forward2.htm">http://campbells.dikaios.net/forward2.htm</a><!-- m --> doesn't seem to work at all.

what am I doing wrong?

Aaronwhat are you doing wrong? well for one you can't load php in a html documetn. it has to be .php.You need to rename forward2.htm to forward2.phpOriginally posted by scoutt
what are you doing wrong? well for one you can't load php in a html documetn. it has to be .php.

Looks like we posted at the same time scoutt :mad:

You could have left this one to me :Dheh, I was 2 minutes faster. and if I leave all teh easy ones to you guys then what is left for me :POk, when I go to my site, <!-- w --><a class="postlink" href="http://www.dikaios.net">www.dikaios.net</a><!-- w -->, it will automatically go to index.html. How can I have it auto forward from there? I was told php, but if I can't put php in the index.html file, I can't use it can I? Any pointers as to where I should look now?you want to forward to where?

just make index.html to index.php and insert all the date and time in that.Thank you...I assumed (BAD aaron...BAD!) that the index HAD to be a .htm or .html for the server to find it. I was wrong. Thank you!

Aaronnot really bad, you just didn't know. if the server is setup correctly then all thses are valid

index.html
index.htm
index.shtml
index.pl
index.cgi
index.php


and that should be all. so all those can be the main default file. but if you have them all it will go to the first one I believe.If you want to redirect to forward.php from index.php using PHP then use this...

<?php
Header("http://www.yoursite.com/forword.php");
?>
 
Back
Top