Welcome! Log In Create A New Profile

Advanced

footer.php,auto refresh of page

Posted by DeonFo 
Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
footer.php,auto refresh of page
May 05, 2010 02:39PM
Help.
1)Does any one have an idea how to stick the footer to the bottom of the page exept using forms to divide the page?

2)The project refers to use only 4 pages, can we use more? If one builds the logic of student_course on one page you have to refresh or submit twice to retrieve the data.
Is there a preferred way to handle this( two options googled )-header remove all caching, refresh every few seconds, make the back button not function properly.
Any ideas will help, thanks
avatar
Mac
Re: footer.php,auto refresh of page
May 06, 2010 07:18AM
1. you just include the footer file in the bottom of each page - it is not seperate as in a frame - it is just the bottom part of every page...
2. 4 is the minimum - you can add as manyas you want, but more pages do not mean more marks.

I explain for the benefit of all. You should not have to refresh or submit twice. On one page you have an if and an else, dividing the page into "two pages" - or more. Here below I have 3 "pages" in one

Language: PHP
if($update==';yes';)){ // update student details mysql_query // echo the update echo "$sno updated: $init $sname $ course etc"; //and provide a link to go back to the student listing <a href=';same_page.php';)Update another</a> //or Go back   } elseif(delete==';yes';) { //delete the student mysql_query // echo the delete echo "$sno deleted: $init $sname $ course etc"; //and provide a link to go back to the student listing <a href=';same_page.php';)Delete another</a> // or Go back } else { //show list of students mysql_query //and in the db loop options to delete or update a student echo "$sno $init $sname <a href=';same_page.php?delete=yes&sno=$sno>Delete<a> <a href=';same_page.php?update=yes&sno=$sno>Update<a>"; }

So on first open of the page the list of students is shown. Then you delete a student, and the same page is called. The choice now is yours - you can provide links to go back to the listings of students as here above - alternatively you can echo the list of students within the delete/update brackets. If you do that, it is best to use a function

Language: PHP
if($update==';yes';)){ // update student details mysql_query //echo the update echo "$sno updated: $init $sname $ course etc"; //list students function list_students();   } elseif(delete==';yes';) { //delete the student mysql_query // echo the delete echo "$sno deleted: $init $sname $ course etc"; //list students function list_students(); } else { // list students function list_students(); // the function containing, within the db loop <a href=';same_page.php?delete=yes&sno=$sno>Delete<a> <a href=';same_page.php?update=yes&sno=$sno>Update<a> as here above }
Re: footer.php,auto refresh of page
May 06, 2010 09:23AM
Apologies ment frames in the first mail. On the footer the basics I understand but my script creates a html table is with a while loop it seems the footer. is first compiled and then builds the table.showing the footer info above the table.
There is no ifs or logic between the lines. Can you confirm that it is not suppose to do it or can it be because of php sent and then only html.

2 Thanks Mac I believe less pages can earn more marks.
Enjoy
avatar
Mac
Re: footer.php,auto refresh of page
May 06, 2010 12:55PM
Language: PHP
<?php   echo "<table>"; //start table outside loop mysql_query.... $nummail = mysql_numrows($mail); $i = 0; while ($i<$nummail) { $nextmail = mysql_result($mail,$i,';email';); //of course there are other ways to get the row - you use what you want. echo "<tr><td>$nextmail</td></tr>"; // echo the results into a complete table row $i++; }   ?> <tr><td><?php include ("footer.php"); ?> </td></tr> //add another row outside loop and include footer   </table> //end table outside loop
Re: footer.php,auto refresh of page
May 06, 2010 02:39PM
Thanks will never have thought of it.
Re: footer.php,auto refresh of page
May 10, 2010 07:04AM
Problems solved.
The footer issue- did not have a closing table tag.
Refresh- my browser was set to not refresh on a change under,Tools,internet optiions,settings.
Sorry, only registered users may post in this forum.

Click here to login