simflex Posted July 14, 2010 Share Posted July 14, 2010 Hello experts, Please bear with me for a somewhat silly question. This code below works fine when placed on a php server. echo "<table border=1 align=center width=300><tr><td>"; include ("smallcal.php"); echo "</td></tr></table>"; It allows us to place a mini calendar on the home page of our website. However, we would like place this mini calendar on another server that is not a php server. Is there any way place this calendar on another page on another server? In other words, instead of include("smallcal.php"), can this snip be written to something like <a href="http://servername/calendar/smallcal.php"??? Thanks in advance Quote Link to comment Share on other sites More sharing options...
trq Posted July 14, 2010 Share Posted July 14, 2010 You could place it within a frame. Quote Link to comment Share on other sites More sharing options...
simflex Posted July 14, 2010 Author Share Posted July 14, 2010 Thanks Thorpe for your prompt response. I suppose I didn't explain it well. That, I think, may explain why you moved it to html page. Is there another way to write include("smallcal.php") For instance, if I put it in an iframe like you suggested like this: <table> <tr> <td align="center"><br> <IFRAME SRC="smallcal.php" NAME="Mini Calendar" FRAMEBORDER=0 SCROLLING=auto WIDTH="250" HEIGHT="210" MARGINHEIGHT=0 MARGINWIDTH=10 ALIGN=TOP> </IFRAME> </td> <td align="justified" valign="middle"><br> </td> </tr> </table> As you can see, I can't save this file as smallcal.php because the page I want to display it on is not a php server. If I save it as smallcal.htm, I get the php text, not the calendar. Hope my explanation is clearer. Again, thanks, Quote Link to comment Share on other sites More sharing options...
trq Posted July 14, 2010 Share Posted July 14, 2010 Your iframe's src attribute would need to point to a server running php. Even then, its not guaranteed to work because it will actually be executing on the other server. In short, without having php installed, you cannot run php scripts. Quote Link to comment Share on other sites More sharing options...
simflex Posted July 14, 2010 Author Share Posted July 14, 2010 To add to your comments, even on a php server, saving the iframe as something.htm still doesn't work. I take that back. It works with a .htm extension as long as it is on a php server. Thanks for your help Quote Link to comment Share on other sites More sharing options...
trq Posted July 14, 2010 Share Posted July 14, 2010 The html document containing the iframe code goes on the server without php. You then use.... <iframe src="http://phpenabledserver.com/smallcal.php"></iframe> To include the php script into that page. Like I said however, there is no guarantee it will work as expected because the php will be parsed on the remote (php enabled) server then it will serv the html to the frame. Quote Link to comment Share on other sites More sharing options...
Far Cry Posted July 14, 2010 Share Posted July 14, 2010 You could just have it like this.... <html> <body> (HTML HERE) and then just start some php tags <?php ?> Quote Link to comment Share on other sites More sharing options...
Vince889 Posted July 14, 2010 Share Posted July 14, 2010 The server wouldn't parse it as PHP unless it is saved with a relevant PHP extension. Quote Link to comment Share on other sites More sharing options...
haku Posted July 14, 2010 Share Posted July 14, 2010 Or if the server is set up to parse other filetypes as PHP. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.