Php Newbie Question

windows

Guest
Okay I'll admit it, I'm really just learning PHP and this is probably REALLY stupid but I've exhausted all my resources so I thought I'd try here. I want to include a stupid simple PHP/mySQL counter routine in each of my pages. <br /><br />If I call the counter script directly i.e. <!-- w --><a class="postlink" href="http://www.villagebistro.info/counter/counter.php">www.villagebistro.info/counter/counter.php</a><!-- w --> it works.<br /><br />I try to include it in the footer of my pages using:<br /><br /><body ... blah blah blah<br />...<br /><?php<br />include ("..\counter\counter.php");<br />?><br /></body><br /><br />and that is exactly what appears when I use the "View Source" command from my browser window. I've tried moving it *everywhere* in the html file to no avail. It doesn't seem to be doing the include <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/blink.gif" style="vertical-align:middle" emoid=":blink:" border="0" alt="blink.gif" /><br /><br />I'm feeling really stupid right now so I'm going to knock off for the day and have a glass of scotch and contemplate the meaning of life for a little while. <br /><br />I'd really appreciate one of you "PHP gurus" giving me a hand here ... Thanks in advance,<br />Paul<!--content-->
I'm pretty new at PHP myself, so I hope this doesn't sound too ridiculous:<br /><br />When I had that problem, I suddenly realized that the file I added the PHP code was still saved as .HTML. When I resaved the file using the .PHP extension, it worked.<br /><br />I only mention this since you said:<br /><br /><!--quoteo--><div class='quotetop'>QUOTE</div><div class='quotemain'><!--quotec-->is exactly what appears when I use the "View Source" command from my browser window. I've tried moving it *everywhere* in the html file to no avail.<!--QuoteEnd--></div><!--QuoteEEnd--><br /><br />It was the "...in the html file" part that made me wonder if your page had the right extension.<br /><br />I hope this helps,<br /><br />aikiDave<!--content-->
<img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/ohmy.gif" style="vertical-align:middle" emoid=":o" border="0" alt="ohmy.gif" /> To quote the very wise and honorable Homer Simpson .... DOH! Ridiculous? Ridiculous? No ridiculous, is my total lack of knowledge LOL ... Haven't tried it yet, cuz' the scotch is just too damn good but it sounds perfectly logical to me!<br /><br />Thanks a bunch for opening yet another window on this poor old scotch soaked brain! <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/biggrin.gif" style="vertical-align:middle" emoid=":D" border="0" alt="biggrin.gif" /> <br /><br />Later,<br />Pauol<!--content-->
Well, if that doesn't work, here's a snippet of what I use to include a file:<br /><br /><?PHP<br />include($DOCUMENT_ROOT . '/<i>name of file</i>');<br />?><br /><br />So, to include the counter, you would probably put:<br /><br /><?PHP<br />include($DOCUMENT_ROOT .'/counter/counter.php');<br />?><br /><br />Might want to check your code and see if it looks like this at all.<br /><br />Again, hope this helps,<br /><br />aikiDave<!--content-->
Dave thanks a LOT! A simple change of the file name was all it took LOL Yeah, I'm feeling kinda' dumb about now but maybe I can redeem myself by getting some scripts working today <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/biggrin.gif" style="vertical-align:middle" emoid=":D" border="0" alt="biggrin.gif" /> <br /><br />Thanks again,<br />Paul<!--content-->
Glad I was able to help!<br /><br />And no need to feel dumb--if I had a nickel for every time I wondered why a script wouldn't run, only to discover that I hadn't put a semi-colon somewhere.... Sheesh. <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/biggrin.gif" style="vertical-align:middle" emoid=":D" border="0" alt="biggrin.gif" /> <br /><br />Hope your scripts go well,<br /><br />aikiDave<!--content-->
 
Back
Top