Page 1 of 1

PHP dynamic web content ( I'm newbie to PHP :D HELP ME)

Posted: Mon Mar 22, 2010 10:30 am
by PHP Starter
So this is the scenario, now I have a website that I make using php extension file, I make my website to have a static header, 2 sidebar and content which different from page to page. Now my concern is the home page of my website, I've had my static header, 2 sidebar, but about the content I'm so confuse. I want my content part of the home page to be actively changed. I can see this type of actively update able content is from blogspot, but I might not as professional as them, so maybe i can find a way to handle this with any simple php code or maybe html code if possible, because i use static header and sidebar, i use include function,where you can see it at the file of my website that i've uploaded.

Header.php (http://www.mediafire.com/file/k2mmzzymjq5/header.php)
leftmenu.php (http://www.mediafire.com/file/j50mnnzddyo/leftmenu.php)
index.php (http://www.mediafire.com/file/zznmylymkjn/index.php)
you all can download as many as you wish :D Please help me out of this

Simple way is, what I want is :
1. I often update my content part of my home page
2. do you see the left part of my home page? the leftmenu, I want to give it subcategory, but it eat up space, i have seen many of website that their subpage is invisible, and as soon as your mouse on the link, it will open the sub category, any advice?

Thank you in advance :wink:
__________________

Tommy Lv

Re: PHP dynamic web content ( I'm newbie to PHP :D HELP ME)

Posted: Mon Mar 22, 2010 10:59 am
by scarface222
1. if you want to actively change content, you need a javascript function to load a separate page that has some sort of mysql query on a set time interval using ajax, so the user does not have to experience a page refresh. I am using this on some of my pages where refreshMe is your div container with refreshable content and yourpage.php is the page that has some sort of mysql query and will hence update your results if database entries change. As far as your needs, you need to look into javascript and client-side scripts. PHP will not improve the look of your page. Look into CSS and javascript/jquery.
PS, this code will not work without jquery library included on your page.

Code: Select all

<script language="JavaScript">
$(document).ready(function(){
 
    $(document).ready(function()
    {
        $(".refreshMe").everyTime(15000,function(i){
            $.ajax({
              url: "yourpage.php",
              cache: false,
              success: function(html){
                $(".refreshMe").html(html);
              }
            })
        })
    });
 
});
</script>

Re: PHP dynamic web content ( I'm newbie to PHP :D HELP ME)

Posted: Mon Mar 22, 2010 11:09 am
by PHP Starter
I'm sorry, as I'm new to php, as far as i can tell you is I do not understand your coding, but I think your coding will help me to open a new thinking about javascript, now my hosting website got mysql feature, but i've never learn sql either, prepared to take it, but i thought making the real practice might help me to study more than learning inside class.

So the main problem is i would have more than 1 article in my page,its like blogspot.com, so like your newest article is
"my new website coming soon" .after sometime you make another article which is "new feature is coming"

so it would be like this

newfeature is coming
article content bla bla bla

my new website coming soon
content bla bla bla

more


thats what I want to be, but I don't know whether your coding will make it. but I need to thank you first as you check out my problem, thank you very much

Updated : will this javascript feature affect SEO?

Re: PHP dynamic web content ( I'm newbie to PHP :D HELP ME)

Posted: Mon Mar 22, 2010 11:15 am
by PHP Starter
http://viewinto.blogspot.com/ <<<this one is the example of puting some article in 1 web page ( I make it for sample), but using html to do this would be ridiculous where i need to add and delete so many code, so i would like to make my website so would be like only shown the latest 10 article, which will show the newest article in my website andkeep the old article in other page together with all other article

Re: PHP dynamic web content ( I'm newbie to PHP :D HELP ME)

Posted: Mon Mar 22, 2010 11:26 am
by scarface222
ok, so basically you want a static web site. Fair enough, then forget about my code above, you can learn about that to do some neat things later, by looking into javascript and Jquery libraries and experimenting. As far as simply wanting to update your entries like blogspot, if you are the only one who will be posting articles and you are not sure how to use mysql, then really the only thing you can do is just manually edit your html source code and add entries yourself. Mind you, mysql is fairly easy to learn, as far as administering your database, since there are tools given to you to visually administer and queries that you write in php to communicate with your database in real time will come to you eventually. If you decide that you want others to be able to post entries, then you will need to have mysql so information can be stored and you will need to use php to insert this information through mysql queries, but until then just manually update until you have time to learn more about php and mysql. I would recommend going on a torrent site and downloading some php books and mysql books to get a little bit of a background, and then experiment with coding as you go which is the best way to learn.

Re: PHP dynamic web content ( I'm newbie to PHP :D HELP ME)

Posted: Mon Mar 22, 2010 11:37 am
by gfreak000
developphp.com

This guy shows you some good stuff and has tutorials. its great. It might help you out.

Re: PHP dynamic web content ( I'm newbie to PHP :D HELP ME)

Posted: Mon Mar 22, 2010 11:57 am
by PHP Starter
Thank you very much for all your reply, this is a good news for me and customplaza.com . I will try to work out later as I will take my last 2 exam of MCSE this friday, Thank you very much