Xepher.Net Forums

Xepher.net => Technical Support => Topic started by: phantasus on February 23, 2007, 08:09:40 AM

Title: newsbox problem
Post by: phantasus on February 23, 2007, 08:09:40 AM
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?
Title: newsbox problem
Post by: griever on February 23, 2007, 09:46:07 AM
You can just save it as .php, I think, then run fix file permissions in the account management page.
Title: newsbox problem
Post by: fesworks on February 23, 2007, 04:42:42 PM
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.
Title: newsbox problem
Post by: Xepher on February 23, 2007, 10:01:28 PM
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. http://xepher.net/newsbox-source.php

Next, this is what that code actually outputs AFTER it's run. http://xepher.net/newsbox-example.php 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.
Title: newsbox problem
Post by: phantasus on February 26, 2007, 05:33:05 PM
thank you all, i think i got it now. =)