The anti-spam plugins have stopped being effective. Registration is back to requiring approval. After registering, you must ALSO email me with your username, so that I can manually approve your account.

Main Menu

newsbox problem

Started by phantasus, February 23, 2007, 08:09:40 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


ok, i know there is already something posted about it, but i read it and didnt understand.

i cant get the newsbox to work. i havent uploaded my site, im cheking it all works on my computer before uploading it and it doesnt? or does it haves to be up to work? (im talking about the news box)
im writing html code on notepad, how do i change it to php? just by saving it as .php? or do i have to do something else?

im sorry, im an ignorant. can someone help me please?


You can just save it as .php, I think, then run fix file permissions in the account management page.
"You can get all A's and still flunk life." (Walker Percy)


Yea, the newsbox MUST be on a .PHP file.., and it must appeare on the main page of your site.. the page in which will be viewed the most... you can try and make an iframe on your HTML page,  and put the .php code onto it's own .php page and link it like that too.


Which are all good answers, but lemme see if I can explain the concept so it makes more sense. I basically ask you to put into your page. You then save that page with the extension .php and set it to be executable... that is, a script that will be run (like a program) by the server before it serves it to viewers. When the server runs that script, it won't do anything at all with the rest of your page as it's just normal HTML. All that just gets sent straight on through to the viewer's webbrowser. When it comes to a php section though, it will run that bit as a sort of program/script. The code you include above basically tells it to grab/include and run a bigger script/program saved as "newsbox.php" That script does a lot of stuff, like checking what username it's running as, looking up info about your site, etc. What it spits out is the html that makes the newsbox you see on the pages here.

So you're correct in your original assumption, that it won't work viewing it on your own computer. Your computer doesn't have the newsbox.php script, nor the database and such that let it look up your site info, the news items, and the other stuff that goes into the newsbox. If you view it directly on your computer, there won't be anything where the newsbox should be, as there's no program running on YOUR computer to create it.

To further explain, here's two examples. First, this is raw code that someone might have for their webpage.

Next, this is what that code actually outputs AFTER it's run. If you view the source code there, you'll see all the PHP stuff disappears, and it's been replaced by the actual tables and such that make up the newsbox.

I hope that clears things up.


thank you all, i think i got it now. =)