gibbo1715 Posted November 28, 2009 Share Posted November 28, 2009 Hi All reasonably new still to php/ my sql and i d like to know what the standard would be for the follows please I intend to have a page with a tree view on the left, a text input area on the right and various content in the middle all called from a database. When clicking on the treeview it will call the database and update the middle section with the content Do we still use frames (As i used to in the distant past), do we uss css and have it all on one page with the treeview in one php file called fromn the index and the middle another and so on or is there a third way thanks in advance, i d just like to comply with standards, i ve got the various bits working but im sure if i get this wrong it may impact on performance etc thanks again Gibbo Link to comment https://forums.phpfreaks.com/topic/183231-some-advice-please-re-best-way-to-put-my-bits-of-code-together/ Share on other sites More sharing options...
dragon_sa Posted November 28, 2009 Share Posted November 28, 2009 if your not wanting to reload entire page you can put the content section in a div tag and use ajax to change the conents of the div tag, this way your content will still get referenced by bots. Content placed inside frames or iframes does not get indexed. Link to comment https://forums.phpfreaks.com/topic/183231-some-advice-please-re-best-way-to-put-my-bits-of-code-together/#findComment-967037 Share on other sites More sharing options...
gibbo1715 Posted November 28, 2009 Author Share Posted November 28, 2009 Thanks putting things in div tags i understand, not so calling it through ajax, are you able to give a short example for me thanks for you help Gibbo Link to comment https://forums.phpfreaks.com/topic/183231-some-advice-please-re-best-way-to-put-my-bits-of-code-together/#findComment-967041 Share on other sites More sharing options...
mattyvx Posted November 28, 2009 Share Posted November 28, 2009 Depending on your content you can; use the "GET" method by doing the following; your tree menu might look like; <a href="mypage.php?Content=Page1">Page 1</a> <a href="mypage.php?Content=Page2">Page 2</a> <a href="mypage.php?Content=Page3">Page 3</a> When you click on the link it will set the Content variable in the URL bar. Then in your centre body <div> tag maybe; <?php $Content = $_GET['Content']; if(isset($Content)) //if variable is set { $Content = mysql_real_escape_string($Content); // sanitises data before using in database //select some content from some table where the content column equals the URL variable set by the link i.e. page1 $sql = "SELECT whatever FROM mytable WHERE Content= '$Content'"; mysql_query($sql); //....... now fetch and output the result } else { //do something if the Content variable is not set like display homepage for example } ?> I don't know what your existing knowledge is like but if your up to scratch on HTML and have basic php knowledge then there's some building blocks! Link to comment https://forums.phpfreaks.com/topic/183231-some-advice-please-re-best-way-to-put-my-bits-of-code-together/#findComment-967096 Share on other sites More sharing options...
gibbo1715 Posted November 28, 2009 Author Share Posted November 28, 2009 thats great, recon i can do something from here thanks for all your help, much appreciated gibbo Link to comment https://forums.phpfreaks.com/topic/183231-some-advice-please-re-best-way-to-put-my-bits-of-code-together/#findComment-967123 Share on other sites More sharing options...
mattyvx Posted November 28, 2009 Share Posted November 28, 2009 sure, if you get stuck ill try and help. just looking back it will be better if you change $Content = $_GET['Content']; if(isset($Content)) //if variable is set { to if(isset($_GET['Content'])) //if variable is set { $Content = $_GET['Content']; There are other ways to do what you want but try the above see how far you get! Link to comment https://forums.phpfreaks.com/topic/183231-some-advice-please-re-best-way-to-put-my-bits-of-code-together/#findComment-967138 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.