Author Topic: newsbox problem  (Read 5920 times)

0 Members and 1 Guest are viewing this topic.

phantasus

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
    • Phantasus
newsbox problem
« 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?

griever

  • Sr. Member
  • ****
  • Posts: 457
    • View Profile
newsbox problem
« Reply #1 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.
"You can get all A's and still flunk life." (Walker Percy)

fesworks

  • Administrator
  • *****
  • Posts: 923
    • View Profile
    • http://www.fesworks.com
newsbox problem
« Reply #2 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.

Xepher

  • Techsmith
  • Administrator
  • *****
  • Posts: 4,334
  • Illegitimis non carborundum!
    • View Profile
    • Xepher.net
newsbox problem
« Reply #3 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
Code: [Select]
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.

phantasus

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
    • Phantasus
newsbox problem
« Reply #4 on: February 26, 2007, 05:33:05 pm »
thank you all, i think i got it now. =)