Jump to content

h8ids

Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

h8ids's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks litebearer, I'll check it out. [!--quoteo(post=378860:date=May 31 2006, 04:40 PM:name=litebearer)--][div class=\'quotetop\']QUOTE(litebearer @ May 31 2006, 04:40 PM) [snapback]378860[/snapback][/div][div class=\'quotemain\'][!--quotec--] right here in rivercity [a href=\"http://www.phpfreaks.com/tutorial_cat/25/Page-Number--Pagination.php\" target=\"_blank\"]http://www.phpfreaks.com/tutorial_cat/25/P...-Pagination.php[/a] Lite... [/quote]
  2. Attempting to set up pagination. Data is being passed to page and being displayed in a dynamic table (Adjusts based upon the number of records to display.). Table row colors alternate; gray - white - gray. In addition, the <thead> is set up to allow for ordering of records. Now I want to add pagination; limiting the number of displayed rows to 20. Needing a good tutorial. Here's what I have so far: [code] <?php session_start; error_reporting(E_ALL | 'E_STRICT'); $db = mysql_connect("localhost", "root", "");             mysql_select_db("newcourse",$db); $result = mysql_query("SELECT * FROM proposals ORDER by Records DESC",$db); //let's get the number of rows in our result so we can use it in a for loop $numofrows = mysql_num_rows($result); //Table formatting and sorting buttons echo "     <b>Courses you have submitted.</b> <TABLE BORDER=0 width='631' cellpadding=4 cellspacing=0 bgcolor='#FFFFFF'> <thead bgcolor='lightyellow'> <TR><TH><a title=\"Organize by course name\" href=\"\" onclick=\"this.blur(); return sortTable('offTblBdy', 0, true);\"><B>Course title</B></a></TH> <TH><a title=\"Organize by course number\" href=\"\" onclick=\"this.blur(); return sortTable('offTblBdy', 1, true);\"><B>Course number</B></a></TH><TH></TH></TR> </thead> <TFOOT> <TR bgcolor='lightyellow'> <Td><img src='spacer.jpg'></Td> <Td><img src='spacer.jpg'></Td> <Td><img src='spacer.jpg'></Td> </Tr> </TFOOT>"; // coloring every other row echo "<tbody id=\"offTblBdy\">"; for($c = 0; $c < $numofrows; $c++) { $myrow = mysql_fetch_array($result); //get a row from our result set if($c % 2) { //this means if there is a remainder echo "<TR class=\"alternateRow\">"; } else { //if there isn't a remainder we will do the else echo "<TR>"; } echo "<TD>".$myrow['CourseTitle']."</TD>         <TD><center>".$myrow['CourseNumber']."</center></TD>"; echo "<TD width='170'> <a title='Edit record' style='text-decoration: none' href=\"addedit.php?Records=".$myrow['Records']."\">Edit</a> | <a title='Create PDF' style='text-decoration: none' href=\"PDFgen.php?Records=".$myrow['Records']."\">PDF </a> | <a title='Submit for review' style='text-decoration: none' href=\"EmailComment.php?Records=".$myrow['Records']."\">Submit </a> | <a title='Delete record' style='text-decoration: none' href=\"delete.php?Records=".$myrow['Records']."\"> Delete</a>"; //<a onmousedown='textSWAP()' id='textSubmitted' style='text-decoration: none' href=\"javascript: textSWAP('textSubmitted','Submitted');\">Submit </a> | echo "</TD>"; echo "</TR>"; } echo "</tbody>"; //now let's close the table and be done with it echo "</TABLE>\n"; // Close DB connection mysql_close($db); $Binary="0"; ?> [/code]
  3. SOLVED! [!--quoteo(post=357774:date=Mar 23 2006, 03:07 PM:name=h8ids)--][div class=\'quotetop\']QUOTE(h8ids @ Mar 23 2006, 03:07 PM) [snapback]357774[/snapback][/div][div class=\'quotemain\'][!--quotec--] Running into an issue with a dynamic web-page. I have PHP populating listboxes with data. The web-page is a form divided into five different sections. Each section is identified by use of <Span></span> and remains hidden until called. Using Javascript to call the different <Span></span> sections. The page loads quickly, but navigating between the different sections is painfully slow. There are several listboxes and textareas. I'd like to speed this process up! The source code is very lengthy; I'll be glad to post it if needed. D [/quote]
  4. Running into an issue with a dynamic web-page. I have PHP populating listboxes with data. The web-page is a form divided into five different sections. Each section is identified by use of <Span></span> and remains hidden until called. Using Javascript to call the different <Span></span> sections. The page loads quickly, but navigating between the different sections is painfully slow. There are several listboxes and textareas. I'd like to speed this process up! The source code is very lengthy; I'll be glad to post it if needed. D
  5. Why does IE suck? Save that one for another thread. Using JavaScript to disable and enable a textarea based upon a drop down selection. All options, but the last one, in the selection box are set to disable the textarea. The text area is set to disabled by default. All entered text and the drop down selection are to be saved to a database. Here's the source: [code] <html> <body> <form method="POST" action="dataincourse.php" name="form1"> <script> function enable6(){ if (document.all || document.getElementById){ if (document.form1.test6.disabled==true) document.form1.test6.disabled=false else document.form1.test6.disabled=false } } function disable6(){ if (document.all || document.getElementById){ if (document.form1.test6.disabled==true) document.form1.test6.disabled=true else document.form1.test6.disabled=true } } </script> <!--how often will the course be taught--><br><font color="#FFFFFF"><a name="offer"></a> <b>10.</b> How often will the course be taught? </font> <select size="1"  name="dropdown" style="background-color: lightyellow"> <option name="dairy" value="Please Choose One" onclick="disable6()">Please Choose One</option> <option name="protein" value="On a regular basis - Probably Annually" onclick="disable6()">On a regular basis - Probably Annually</option> <option name="protein" value="On a regular basis - Probably Biennually" onclick="disable6()">On a regular basis - Probably Biennually</option> <option name="protein" value="One time only" onclick="disable6()">One time only</option> <option name="protein" value="Other - Please specify" onclick="enable6()">Other - Please specify</option></select> <!--<select style='background-color: lightyellow' name="Offered">     <option value="Please Choose One">Please Choose One</option>     <option value="On a regular basis - Probably annually">On a regular basis - Probably annually</option>     <option value="On a regular basis - Probably biennually">On a regular basis - Probably biennually</option>     <option value="One time only">One time only</option>     <option value="Other - Please specifiy">Other - Please specifiy</option> </select>--> <br><font color="#FFFFFF"><b>Other specification: </b></font> <textarea id="test6" type="text" style="background-color: lightyellow" name="OtherOffered" cols="58" maxlength="500" disabled></textarea> </span> </form> </body> </html>[/code]
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.