newbie help with php code

05-10-06, 08:44 AM
|
|
New Member
|
|
Join Date: May 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
|
newbie help with php code
i have downloaded a php script that uses a mysql database.
i managed to install it no problem and change a few of the grapics files as it seemed alot like html.
i wanted to install a counter on the site and one i downloaded said to create a text file which i did then it says put the script in the page you want it to be displayed.
heres the problem index.php looks nothing like a index.html and i dont know where to put it.
any help would be great thanks
|

05-10-06, 08:49 AM
|
 |
Community Liaison
|
|
Join Date: May 2005
Location: Antwerp, Belgium
Posts: 3,165
Thanks: 4
Thanked 25 Times in 25 Posts
|
|
could you post the index.php page?
it's rather hard to say where to put it when you don't know what coding there is
probably the entire html output is generated by php, so you could just place it on top of the script. or at the bottom, as long as you don't place it somewhere in between.
Greetz,
UnrealEd
__________________
"Good judgement comes from experience, and experience comes from bad judgement." - Fred Brooks
|

05-10-06, 10:08 AM
|
|
New Member
|
|
Join Date: May 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
|
here is the index.php
this is what is in the main program index.php file
Last edited by Christian; 05-10-06 at 12:36 PM.
|

05-10-06, 10:15 AM
|
 |
Community Liaison
|
|
Join Date: May 2005
Location: Antwerp, Belgium
Posts: 3,165
Thanks: 4
Thanked 25 Times in 25 Posts
|
|
does your counter script require something from the coding that is in the index page?
if not, just past it on top of the page
Greetz,
UnrealEd
__________________
"Good judgement comes from experience, and experience comes from bad judgement." - Fred Brooks
|

05-10-06, 11:30 AM
|
 |
Community VIP
|
|
Join Date: Apr 2006
Location: Los Angeles, CA
Posts: 660
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
The "HTML version" of your page is index.tpl. You are using smarty, so all of your program logic is in the php file and all of the layout (html, etc.) is in the tpl (template) file.
So, if your counter is a php script, you'll need to run it in the php page and then assign the output as a variable to smarty. If it is javascript code, then you should be able to just paste it into the tpl file.
HTH
|

05-10-06, 04:37 PM
|
|
New Member
|
|
Join Date: May 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
well i dowloaded the main script from the internet and followed the instructions to install it. compaired to simple html its seems totally different. so i dont know where to put the counter code . html would be easy id just put it in the html anywhere. php seem to have no logic to me. is index the start page when a web address is looked at?
here the script i want to add
Hit Counter
This script gives you all required code to add a simple hit counter onto your webpage, with the option to make it invisible.
|

05-10-06, 04:55 PM
|
 |
Community VIP
|
|
Join Date: Apr 2006
Location: Los Angeles, CA
Posts: 660
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
|
This should work...
Change your index.php file to this:
And then in your index.tpl file, wherever you want the count to show up, add:
That should do it.
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|