Jump to content

mike12255

Members
  • Posts

    439
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by mike12255

  1. http://img21.imageshack.us/img21/4605/problemy.jpg
  2. right at the top of the page: $page = $_GET['id'];
  3. oh nothing appeared so i guess im not getting anything...but i know that there is that table in my db
  4. 57 is the first one, 60 is the last one: <td><div align="center"><strong><?=$title?></strong></div></td> </tr> <tr bgcolor="#E6E6E6"> <td height="138"><div align="center" class="style1"><?=$message?></div></td>
  5. I got the following code (will put at end) and im trying to grab some info from my database and stick it on the webpage however i get these errors: Im not sure why ??? anyway my code is below is somone could help - thanks. <?php $getthreads="SELECT * FROM forumtutorial_posts WHERE postid = '$page'"; $findamount = mysql_query($getthreads) or die (mysql_error()); //grab all the content while($r=mysql_fetch_array($findamount)) { //the format is $variable = $r["nameofmysqlcolumn"]; - makes it easier to call later CAUSE IM LAZY!! $answer=$r["answered"]; $title=$r['title']; $post=$r['post']; } ?>
  6. well that kind of fixed my problem - thanks. However im not seein the number 1 with a link to index.php?id=1 so i checked in the page source and its there, any ideas. (website is at stayner.ca/TEST/) heres my code: <?php include ("connect.php"); ini_set ("display_errors", "1"); error_reporting(E_ALL); ?> <html> <script language="JavaScript1.1"> var slideimages=new Array() var slidelinks=new Array() function slideshowimages(){ for (i=0;i<slideshowimages.arguments.length;i++){ slideimages[i]=new Image() slideimages[i].src=slideshowimages.arguments[i] } } function slideshowlinks(){ for (i=0;i<slideshowlinks.arguments.length;i++) slidelinks[i]=slideshowlinks.arguments[i] } function gotoshow(){ if (!window.winslide||winslide.closed) winslide=window.open(slidelinks[whichlink]) else winslide.location=slidelinks[whichlink] winslide.focus() } </script> <title>Stayner, The Town Of Friendly People</title> <meta name="description" content="Stayner, Ontario, Canada,Local Businesses, Town Of Stayner, Events, News, E-Commerces, About Stayner, Questions about Stayner, Adversiting" /> <meta name="keywords" content="Stayner, Businesses, Town Of Stayner, Stayner Business, Business Directory, Stayner Business Information, Stayner Listings, Local Businesses,News, Events, Adveristing, Businesses,Advertising, Stayner, Stayner Business, Local Business Stayner, News, Stayner Advertising" /> <meta name="author" content="Joshua Baker - Stayner.ca" /> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <meta name= "robots" content="index-2,email_script, nofollow"/> <script type="text/javascript"> <!-- function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc; } function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}} } function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && d.getElementById) x=d.getElementById(n); return x; } function MM_swapImage() { //v3.0 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } //--> </script> <style type="text/css"> <!-- .style15 {font-size: 9px} --> </style> <head> <title>Stayner.ca</title> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <script type="text/javascript"> <!-- function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc; } function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}} } function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && d.getElementById) x=d.getElementById(n); return x; } function MM_swapImage() { //v3.0 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } //--> </script> <style type="text/css"> <!-- .style11 {font-size: 14px} .style5 {font-size: 12px} .style6 { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 16px; } body,td,th { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; } body { background-color: #FFFFFF; margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; } .style8 { font-size: 10px; color: #FFFFFF; font-weight: bold; } #Table_01 .style8 a { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; color: #FFFFFF; } .style14 {font-size: 16px} .style17 {color: #000000} --> </style> </head> <body onLoad="MM_preloadImages('images/rollover-1_07.gif','images/rollover-1_08.gif','images/rollover-1_09.gif','images/rollover-1_10.gif','images/rollover-1_11.gif','images/rollover-1_12.gif')"> <!-- ImageReady Slices (index-3.psd) --> <table width="800" height="901" border="0" align="center" cellpadding="0" cellspacing="0" id="Table_01"> <tr> <td colspan="11"> <img src="images/index-3_01.gif" width="800" height="28" alt=""></td> </tr> <tr> <td colspan="2" rowspan="2"> <img src="images/index-3_02.gif" width="30" height="100" alt=""></td> <td colspan="4"> <img src="images/index-3_03.gif" width="303" height="82" alt=""></td> <td colspan="5" rowspan="2"> <img src="images/index-3_04.gif" width="467" height="100" alt=""></td> </tr> <tr> <td colspan="4"> <img src="images/index-3_05.gif" width="303" height="18" alt=""></td> </tr> <tr> <td colspan="3"><a href="index.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image55','','images/rollover-1_07.gif',1)"><img src="images/index-2_06.gif" alt="" name="Image55" width="133" height="42" border="0"></a></td> <td colspan="2"><a href="localbusinesses.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image56','','images/rollover-1_08.gif',1)"><img src="images/index-2_07.gif" alt="" name="Image56" width="134" height="42" border="0"></a></td> <td colspan="2"><a href="services.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image57','','images/rollover-1_09.gif',1)"><img src="images/index-2_08.gif" alt="" name="Image57" width="133" height="42" border="0"></a></td> <td><a href="buyandsell.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image58','','images/rollover-1_10.gif',1)"><img src="images/index-2_09.gif" alt="" name="Image58" width="133" height="42" border="0"></a></td> <td><a href="events.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image59','','images/rollover-1_11.gif',1)"><img src="images/index-2_10.gif" alt="" name="Image59" width="134" height="42" border="0"></a></td> <td colspan="2"><a href="contactus.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image60','','images/rollover-1_12.gif',1)"><img src="images/index-2_11.gif" alt="" name="Image60" width="133" height="42" border="0"></a></td> </tr> <tr> <td height="190" colspan="6" background="images/index-3_12.gif"><p class="style14"><br> Welcome to Stayner!</p> <p class="style5">We are delighted to offer you lots of information about our town on our web-site! Our local businesses have teamed up with us to show themselves off to you. We encourage our residents to shop locally and welcome internet users who want more information, as we show off our best!<br> Keep coming back, as we constantly update our <a href="events.html">Events</a> calendar and offer you lots to do in this area.</p></td> <td height="226" colspan="5" rowspan="4" valign="top" background="images/index-3_13.gif"><br> <table width="467" border="0" align="center" cellpadding="5" cellspacing="5"> <tr> <td width="366" bgcolor="#E6E6E6"><div align="left"><strong>Question:</strong></div></td> <td width="85" bgcolor="#E6E6E6"><div align="center"><strong>Answered?</strong></div></td> </tr> <tr><?php if(isset($_GET['id'])) { $page = $_GET['id']; }else{ $page = 1; } $tolimit = 4; $showend = $page * $tolimit; $showstart = $showend - 4; //Get all Topics (Parentid = 0) $getthreads="SELECT * FROM forumtutorial_posts WHERE parentid ='0' ORDER BY parentid DESC LIMIT $showstart, $tolimit"; $findamount = mysql_query($getthreads) or die (mysql_error()); $num_rows = mysql_num_rows($findamount); $pagestoshow = floor($num_rows/$tolimit); //grab all the content while($r=mysql_fetch_array($findamount)) { //the format is $variable = $r["nameofmysqlcolumn"]; - makes it easier to call later CAUSE IM LAZY!! $answer=$r["answered"]; $title=$r["title"]; $id=$r["postid"]; if ($answer == 0){ $answer = "no"; }else{ $answer = "yes"; } ?> <td bgcolor="#FFFFFF"><div align="left" class="style17"><a href="showquestion.php?page=<?=$id?>"><?=$title?></a></div></td> <td bgcolor="#FFFFFF"><div align="center" class="style17"><?=$answer?></div></td> </tr> <?php } for ($i = 1; $i <= $pagestoshow; $i++){ print "<a href= 'index.php?$page=$i> $i </a>"; } ?> <tr> <td bgcolor="#FFFFFF">Have a question you would like answered?, <a href="questionform.php">Click Here</a></td> <td bgcolor="#FFFFFF"><div align="center">N/A</div></td> </tr> </table> <strong><br> </strong></td> </tr> <tr> <td colspan="6"> <img src="images/index-3_14.gif" width="333" height="8" alt=""></td> </tr> <tr> <td rowspan="2"> <img src="images/index-3_15.gif" width="14" height="28" alt=""></td> <td colspan="3"> <a href="contactus.html"><img src="images/index-3_16.gif" alt="" width="122" height="24" border="0"></a></td> <td colspan="2"> <img src="images/index-3_17.gif" width="197" height="24" alt=""></td> </tr> <tr> <td colspan="5"> <img src="images/index-3_18.gif" width="319" height="4" alt=""></td> </tr> <tr> <td colspan="6" rowspan="3" valign="top" background="images/index-2_28.gif"><p align="center" class="style5"><span class="style10"><br> <strong>Stayner News</strong></span><br> <span class="style9 style15">found at http://www.theenterprisebulletin.com</span></p> <p align="center" class="style5"> <script type="text/javascript" src="http://app.feed.informer.com/digest3/RVG2HWRNOC.js"> <noscript><a href="http://app.feed.informer.com/digest3/RVG2HWRNOC.html">Click for "The enterprise Bulletin".</a> Powered by <a href="http://feed.informer.com/">RSS Feed Informer</a></noscript></script> <br> <br> <br> <br> <br> </p></td> </tr> <tr> <td colspan="4" valign="top"><div align="center"> <p><a href="javascript:gotoshow()"><img src="img1.gif" name="slide" border=0></a> <script> <!-- //configure the paths of the images, plus corresponding target links slideshowimages("/455 X 100 Cards/gifs/studentworkspaintingpsd.gif", "/455 X 100 Cards/gifs/savingscardstudentworkspainting.gif") slideshowlinks("/student.html","/student.html") //configure the speed of the slideshow, in miliseconds var slideshowspeed=3000 var whichlink=0 var whichimage=0 function slideit(){ if (!document.images) return document.images.slide.src=slideimages[whichimage].src whichlink=whichimage if (whichimage<slideimages.length-1) whichimage++ else whichimage=0 setTimeout("slideit()",slideshowspeed) } slideit() //--> </script> </p> <p align="center"><span class="style14">Local Weather</span></p> <p align="center"><br> <script src='http://netweather.accuweather.com/adcbin/netweather_v2/netweatherV2.asp?partner=netweather&tStyle=whteYell&logo=0&zipcode=NAM|CA|ON|STAYNER|&lang=eng&size=10&theme=silver&metric=1&target=_self'></script> <span class="style11"><strong>Professional listings are now available!</strong></span></p> <blockquote> <p align="center" class="style5">To learn more about advertising on Stayner.ca contact us at:</p> <p align="center" class="style5">Cell Phone: (705) 241-6388</p> <p align="center" class="style6"><span class="style11">Have some idea's for the site? Click here to post <br> your <a href="index-feedback.html">Feedback</a></span></p> <table width="375" height="218" border="0"> <tr> <td width="204" height="25" bgcolor="#F7F4E9"><strong>Recent Listing:</strong></td> </tr> <tr> <td height="25" bgcolor="#D9D9D9"><div align="center"><a href="/localbusinesses.html">ANGEL HOUSE BED & BREAKFAST</a></div></td> </tr> <tr> <td height="25" bgcolor="#F7F4E9"><div align="center"><a href="/localbusinesses.html">Bryan Davies Photography</a></div></td> </tr> <tr> <td height="25" bgcolor="#D9D9D9"><div align="center"><a href="/localbusinesses.html">Baker Storage </a></div></td> </tr> <tr> <td height="25" bgcolor="#F7F4E9"><div align="center"><a href="/localbusinesses.html">Mountain Vista Veterinary Hospital</a></div></td> </tr> <tr> <td height="25" bgcolor="#D9D9D9"><div align="center"><a href="/localbusinesses.html">R.D. Moving Systems</a></div></td> </tr> <tr> <td height="25" bgcolor="#F7F4E9"><div align="center"><a href="/localbusinesses.html">Student Works Painting </a></div></td> </tr> <tr> <td height="25" bgcolor="#D9D9D9"><div align="center"><a href="/localbusinesses.html">Uncommon Groundz Cafe</a></div></td> </tr> </table> <p align="center">Add you business to our <a href="http://www.stayner.ca/Business Directory/" target="_blank">Business Directory</a>.</p> <p align="center"> </blockquote> </p> <p align="center" class="style6"><br> </p> </blockquote> </div> </td> <td> </td> </tr> <td colspan="9" align="center" valign="top"><p> </p> <p align="center"> </p> </td> </tr> <tr> <td height="31" colspan="11" background="images/index-3_24.gif"><div align="center"><span class="style8"><a href="index.html">Home</a> |<a href="localbusinesses.html"> Local Business</a>| <a href="buyandsell.html">Buy and Sell</a> | <a href="services.html">Services</a> | <a href="events.html">Events</a> | <a href="contactus.html">Contact Us</a></span></div></td> </tr> <tr> <td> <img src="images/spacer.gif" width="14" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="16" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="103" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="3" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="131" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="66" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="67" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="133" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="134" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="121" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="12" height="1" alt=""></td> </tr> </table> <!-- End ImageReady Slices --> <div align="center"><br> <script type="text/javascript"><!-- google_ad_client = "pub-4039459301194765"; /* Banner - Stayner.ca - Home Page */ google_ad_slot = "2960757624"; google_ad_width = 728; google_ad_height = 90; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> <!-- Start of StatCounter Code --> <script type="text/javascript"> var sc_project=4371229; var sc_invisible=1; var sc_partition=55; var sc_click_stat=1; var sc_security="b029fc02"; </script> <script type="text/javascript" src="http://www.statcounter.com/counter/counter.js"></script> <noscript> <div class="statcounter"><a title="wordpress com stats plugin" href="http://www.statcounter.com/wordpress.com/" target="_blank"><img class="statcounter" src="http://c.statcounter.com/4371229/0/b029fc02/1/" alt="wordpress com stats plugin" ></a></div> </noscript> <!-- End of StatCounter Code --> <script type="text/javascript"> var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); </script> </div> <script type="text/javascript"> try { var pageTracker = _gat._getTracker("UA-6968494-1"); pageTracker._trackPageview(); } catch(err) {}</script> </body> </html>
  7. would that replace my line below? $page=$_GET['id'];
  8. Still getting an error invalid index on line 172 which is this line: $page = $_GET['id'];
  9. So i got a table that grabs id's from the URL because im trying to do a pageination thingy however when you first view the site, you dont have an idea because your just seeing stayner.ca (non actually site) instead of stayner.ca/id=1 so after my get statment im trying to say if its null then var = 1 however its not working and im getting this error: Here is my code: <?php include ("connect.php"); ini_set ("display_errors", "1"); error_reporting(E_ALL); ?> <html> <script language="JavaScript1.1"> var slideimages=new Array() var slidelinks=new Array() function slideshowimages(){ for (i=0;i<slideshowimages.arguments.length;i++){ slideimages[i]=new Image() slideimages[i].src=slideshowimages.arguments[i] } } function slideshowlinks(){ for (i=0;i<slideshowlinks.arguments.length;i++) slidelinks[i]=slideshowlinks.arguments[i] } function gotoshow(){ if (!window.winslide||winslide.closed) winslide=window.open(slidelinks[whichlink]) else winslide.location=slidelinks[whichlink] winslide.focus() } </script> <title>Stayner, The Town Of Friendly People</title> <meta name="description" content="Stayner, Ontario, Canada,Local Businesses, Town Of Stayner, Events, News, E-Commerces, About Stayner, Questions about Stayner, Adversiting" /> <meta name="keywords" content="Stayner, Businesses, Town Of Stayner, Stayner Business, Business Directory, Stayner Business Information, Stayner Listings, Local Businesses,News, Events, Adveristing, Businesses,Advertising, Stayner, Stayner Business, Local Business Stayner, News, Stayner Advertising" /> <meta name="author" content="Joshua Baker - Stayner.ca" /> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <meta name= "robots" content="index-2,email_script, nofollow"/> <script type="text/javascript"> <!-- function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc; } function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}} } function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && d.getElementById) x=d.getElementById(n); return x; } function MM_swapImage() { //v3.0 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } //--> </script> <style type="text/css"> <!-- .style15 {font-size: 9px} --> </style> <head> <title>Stayner.ca</title> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <script type="text/javascript"> <!-- function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc; } function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}} } function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && d.getElementById) x=d.getElementById(n); return x; } function MM_swapImage() { //v3.0 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } //--> </script> <style type="text/css"> <!-- .style11 {font-size: 14px} .style5 {font-size: 12px} .style6 { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 16px; } body,td,th { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; } body { background-color: #FFFFFF; margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; } .style8 { font-size: 10px; color: #FFFFFF; font-weight: bold; } #Table_01 .style8 a { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; color: #FFFFFF; } .style14 {font-size: 16px} .style17 {color: #000000} --> </style> </head> <body onLoad="MM_preloadImages('images/rollover-1_07.gif','images/rollover-1_08.gif','images/rollover-1_09.gif','images/rollover-1_10.gif','images/rollover-1_11.gif','images/rollover-1_12.gif')"> <!-- ImageReady Slices (index-3.psd) --> <table width="800" height="901" border="0" align="center" cellpadding="0" cellspacing="0" id="Table_01"> <tr> <td colspan="11"> <img src="images/index-3_01.gif" width="800" height="28" alt=""></td> </tr> <tr> <td colspan="2" rowspan="2"> <img src="images/index-3_02.gif" width="30" height="100" alt=""></td> <td colspan="4"> <img src="images/index-3_03.gif" width="303" height="82" alt=""></td> <td colspan="5" rowspan="2"> <img src="images/index-3_04.gif" width="467" height="100" alt=""></td> </tr> <tr> <td colspan="4"> <img src="images/index-3_05.gif" width="303" height="18" alt=""></td> </tr> <tr> <td colspan="3"><a href="index.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image55','','images/rollover-1_07.gif',1)"><img src="images/index-2_06.gif" alt="" name="Image55" width="133" height="42" border="0"></a></td> <td colspan="2"><a href="localbusinesses.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image56','','images/rollover-1_08.gif',1)"><img src="images/index-2_07.gif" alt="" name="Image56" width="134" height="42" border="0"></a></td> <td colspan="2"><a href="services.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image57','','images/rollover-1_09.gif',1)"><img src="images/index-2_08.gif" alt="" name="Image57" width="133" height="42" border="0"></a></td> <td><a href="buyandsell.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image58','','images/rollover-1_10.gif',1)"><img src="images/index-2_09.gif" alt="" name="Image58" width="133" height="42" border="0"></a></td> <td><a href="events.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image59','','images/rollover-1_11.gif',1)"><img src="images/index-2_10.gif" alt="" name="Image59" width="134" height="42" border="0"></a></td> <td colspan="2"><a href="contactus.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image60','','images/rollover-1_12.gif',1)"><img src="images/index-2_11.gif" alt="" name="Image60" width="133" height="42" border="0"></a></td> </tr> <tr> <td height="190" colspan="6" background="images/index-3_12.gif"><p class="style14"><br> Welcome to Stayner!</p> <p class="style5">We are delighted to offer you lots of information about our town on our web-site! Our local businesses have teamed up with us to show themselves off to you. We encourage our residents to shop locally and welcome internet users who want more information, as we show off our best!<br> Keep coming back, as we constantly update our <a href="events.html">Events</a> calendar and offer you lots to do in this area.</p></td> <td height="226" colspan="5" rowspan="4" valign="top" background="images/index-3_13.gif"><br> <table width="467" border="0" align="center" cellpadding="5" cellspacing="5"> <tr> <td width="366" bgcolor="#E6E6E6"><div align="left"><strong>Question:</strong></div></td> <td width="85" bgcolor="#E6E6E6"><div align="center"><strong>Answered?</strong></div></td> </tr> <tr><?php $page = $_GET['id']; //if they just entered the website make page equal 1 if ($page == NULL){ $page = 1; } $tolimit = 4; $showend = $page * $tolimit; $showstart = $showend - 4; //Get all Topics (Parentid = 0) $getthreads="SELECT * FROM forumtutorial_posts WHERE parentid ='0' ORDER BY parentid DESC LIMIT $showstart, $tolimit"; $findamount = mysql_query($getthreads) or die (mysql_error()); $num_rows = mysql_num_rows($findamount); $pagestoshow = floor($num_rows/$tolimit); //grab all the content while($r=mysql_fetch_array($findamount)) { //the format is $variable = $r["nameofmysqlcolumn"]; - makes it easier to call later CAUSE IM LAZY!! $answer=$r["answered"]; $title=$r["title"]; $id=$r["id"]; if ($answer == 0){ $answer = "no"; }else{ $answer = "yes"; } ?> <td bgcolor="#FFFFFF"><div align="left" class="style17"><a href="index.php?page=<?=$id?>"><?=$title?></a></div></td> <td bgcolor="#FFFFFF"><div align="center" class="style17"><?=$answer?></div></td> </tr> <?php } for ($i = 1; $i <= $pagestoshow; $i++){ print "<a href= 'index.php?$page=$i> $i </a>"; } ?> <tr> <td bgcolor="#FFFFFF">Have a question you would like answered?, <a href="questionform.php">Click Here</a></td> <td bgcolor="#FFFFFF"><div align="center">N/A</div></td> </tr> </table> <strong><br> </strong></td> </tr> <tr> <td colspan="6"> <img src="images/index-3_14.gif" width="333" height="8" alt=""></td> </tr> <tr> <td rowspan="2"> <img src="images/index-3_15.gif" width="14" height="28" alt=""></td> <td colspan="3"> <a href="contactus.html"><img src="images/index-3_16.gif" alt="" width="122" height="24" border="0"></a></td> <td colspan="2"> <img src="images/index-3_17.gif" width="197" height="24" alt=""></td> </tr> <tr> <td colspan="5"> <img src="images/index-3_18.gif" width="319" height="4" alt=""></td> </tr> <tr> <td colspan="6" rowspan="3" valign="top" background="images/index-2_28.gif"><p align="center" class="style5"><span class="style10"><br> <strong>Stayner News</strong></span><br> <span class="style9 style15">found at http://www.theenterprisebulletin.com</span></p> <p align="center" class="style5"> <script type="text/javascript" src="http://app.feed.informer.com/digest3/RVG2HWRNOC.js"> <noscript><a href="http://app.feed.informer.com/digest3/RVG2HWRNOC.html">Click for "The enterprise Bulletin".</a> Powered by <a href="http://feed.informer.com/">RSS Feed Informer</a></noscript></script> <br> <br> <br> <br> <br> </p></td> </tr> <tr> <td colspan="4" valign="top"><div align="center"> <p><a href="javascript:gotoshow()"><img src="img1.gif" name="slide" border=0></a> <script> <!-- //configure the paths of the images, plus corresponding target links slideshowimages("/455 X 100 Cards/gifs/studentworkspaintingpsd.gif", "/455 X 100 Cards/gifs/savingscardstudentworkspainting.gif") slideshowlinks("/student.html","/student.html") //configure the speed of the slideshow, in miliseconds var slideshowspeed=3000 var whichlink=0 var whichimage=0 function slideit(){ if (!document.images) return document.images.slide.src=slideimages[whichimage].src whichlink=whichimage if (whichimage<slideimages.length-1) whichimage++ else whichimage=0 setTimeout("slideit()",slideshowspeed) } slideit() //--> </script> </p> <p align="center"><span class="style14">Local Weather</span></p> <p align="center"><br> <script src='http://netweather.accuweather.com/adcbin/netweather_v2/netweatherV2.asp?partner=netweather&tStyle=whteYell&logo=0&zipcode=NAM|CA|ON|STAYNER|&lang=eng&size=10&theme=silver&metric=1&target=_self'></script> <span class="style11"><strong>Professional listings are now available!</strong></span></p> <blockquote> <p align="center" class="style5">To learn more about advertising on Stayner.ca contact us at:</p> <p align="center" class="style5">Cell Phone: (705) 241-6388</p> <p align="center" class="style6"><span class="style11">Have some idea's for the site? Click here to post <br> your <a href="index-feedback.html">Feedback</a></span></p> <table width="375" height="218" border="0"> <tr> <td width="204" height="25" bgcolor="#F7F4E9"><strong>Recent Listing:</strong></td> </tr> <tr> <td height="25" bgcolor="#D9D9D9"><div align="center"><a href="/localbusinesses.html">ANGEL HOUSE BED & BREAKFAST</a></div></td> </tr> <tr> <td height="25" bgcolor="#F7F4E9"><div align="center"><a href="/localbusinesses.html">Bryan Davies Photography</a></div></td> </tr> <tr> <td height="25" bgcolor="#D9D9D9"><div align="center"><a href="/localbusinesses.html">Baker Storage </a></div></td> </tr> <tr> <td height="25" bgcolor="#F7F4E9"><div align="center"><a href="/localbusinesses.html">Mountain Vista Veterinary Hospital</a></div></td> </tr> <tr> <td height="25" bgcolor="#D9D9D9"><div align="center"><a href="/localbusinesses.html">R.D. Moving Systems</a></div></td> </tr> <tr> <td height="25" bgcolor="#F7F4E9"><div align="center"><a href="/localbusinesses.html">Student Works Painting </a></div></td> </tr> <tr> <td height="25" bgcolor="#D9D9D9"><div align="center"><a href="/localbusinesses.html">Uncommon Groundz Cafe</a></div></td> </tr> </table> <p align="center">Add you business to our <a href="http://www.stayner.ca/Business Directory/" target="_blank">Business Directory</a>.</p> <p align="center"> </blockquote> </p> <p align="center" class="style6"><br> </p> </blockquote> </div> </td> <td> </td> </tr> <td colspan="9" align="center" valign="top"><p> </p> <p align="center"> </p> </td> </tr> <tr> <td height="31" colspan="11" background="images/index-3_24.gif"><div align="center"><span class="style8"><a href="index.html">Home</a> |<a href="localbusinesses.html"> Local Business</a>| <a href="buyandsell.html">Buy and Sell</a> | <a href="services.html">Services</a> | <a href="events.html">Events</a> | <a href="contactus.html">Contact Us</a></span></div></td> </tr> <tr> <td> <img src="images/spacer.gif" width="14" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="16" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="103" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="3" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="131" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="66" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="67" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="133" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="134" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="121" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="12" height="1" alt=""></td> </tr> </table> <!-- End ImageReady Slices --> <div align="center"><br> <script type="text/javascript"><!-- google_ad_client = "pub-4039459301194765"; /* Banner - Stayner.ca - Home Page */ google_ad_slot = "2960757624"; google_ad_width = 728; google_ad_height = 90; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> <!-- Start of StatCounter Code --> <script type="text/javascript"> var sc_project=4371229; var sc_invisible=1; var sc_partition=55; var sc_click_stat=1; var sc_security="b029fc02"; </script> <script type="text/javascript" src="http://www.statcounter.com/counter/counter.js"></script> <noscript> <div class="statcounter"><a title="wordpress com stats plugin" href="http://www.statcounter.com/wordpress.com/" target="_blank"><img class="statcounter" src="http://c.statcounter.com/4371229/0/b029fc02/1/" alt="wordpress com stats plugin" ></a></div> </noscript> <!-- End of StatCounter Code --> <script type="text/javascript"> var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); </script> </div> <script type="text/javascript"> try { var pageTracker = _gat._getTracker("UA-6968494-1"); pageTracker._trackPageview(); } catch(err) {}</script> </body> </html>
  10. So im trying to grab data from a form and throw it into my database but its telling me the query was empty below ill post the form and then the insertpost.php file. The form: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Have a Question?</title> <style type="text/css"> <!-- body,td,th { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; color: #333333; } body { background-color: #FFFFFF; margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; } .style2 { font-size: 16px; font-weight: bold; } --> </style></head> <body> <div align="center"> <p><img src="../banner.gif" width="778" height="130" /><br /> </p> <table width="780" border="0" cellpadding="5" cellspacing="5"> <tr> <td><div align="center" class="style2">Have a question about Stayner?</div></td> </tr> <tr> <td><form id="form1" name="form1" method="post" action="insertquestion.php"> <p><strong> Ask your question here:</strong><br /> <br /> Your Name : <label> <input type="text" name="name" id="name" /> </label> </p> <p>Question Subject: <input type="text" name="subject" id="subject" /> <br /> <br /> Email : <label> <input type="text" name="email" id="email" /> </label> <br /> <br /> Question: <label> <br /> <textarea name="question" id="question" cols="45" rows="5"></textarea> </label> <br /> <br /> <label> <input type="submit" name="submit" id="submit" value="Submit" /> </label> <label> <input type="reset" name="reset" id="reset" value="Reset" /> </label> </p> </form> </td> </tr> </table> <p><br /> </p> </div> </body> </html> The insertpost.php: <?php include ("connect.php");//Connect to the database $thedate=date("U"); //get unix timestamp $displaytime=date("F j, Y, g:i a");//Convert UNIX timestamp to something readable // lets get the variables from the form $subject=$_POST['subject']; $name=$_POST['name']; $yourpost=$_POST['question']; //the Strip_tags ensures that people cannot insert code into your website - its secruity $name = strip_tags($name); $subject = strip_tags($subject); $yourpost = strip_tags($yourpost); //the mysql_real_escape_string protects our database - so if they enter a mysql command its ignored. $name = mysql_real_escape_string($name); $subject = mysql_real_escape_string($subject); $yourpost = mysql_real_escape_string($yourpost); $displayetime = mysql_real_escape_string($displayetime); $thedate = mysql_real_escape_string($thedate); // Lest insert this stuff into the database $insertpost="INSERT INTO forumtutorial_posts(answered,author,title,post,showtime,realtime,lastposter) values('0','$name','$subject','$yourpost','$displaytime','$thedate','$name')"; $post = mysql_query($insertport) or die (mysql_error()); if ($post){ header("Location: index.php"); } ?>
  11. So im trying to create it so i query my db and get all the questions inserted into it, and it displays them from newest to oldest. Then, I want to make it so that it shows four per page. So it will show four questions there status (answered or not) and then underneither numbers: 1 2 3 4 ect depending on how many pages to show. My problem now lies inbetween the query and putting down the required amount of pages. I dont know how to use my query to displaye the x-x amount on the page (1-4,5-8 ect) the buttons will link to www.stayner.ca/index.php?page=X were 1 = questions 1-4. Below is my current code: <?php $tolimit = 4; //Get all Topics (Parentid = 0) $getthreads="SELECT * from forumtutorial_posts WHERE parentid='0' order by parentid DESC"; //grab all the content while($r=mysql_fetch_array($getthreads)) { //the format is $variable = $r["nameofmysqlcolumn"]; - makes it easier to call later CAUSE IM LAZY!! $answer=$r["answer"]; $title=$r["title"]; } $findamount = mysql_query($postquery) or die (mysql_error()); $num_rows = mysql_num_rows($findamount); $pagestoshow = floor($num_rows/$tolimit); for ($i = 1; $i <= $pagestoshow; $i++){ print "<a href= 'answer.php?id=$id$page=$i&catagory=$area> $i </a>"; } ?>
  12. so its wise to run both statments?? - im going to be displaying this data im getting
  13. so using mysql_real_escape_string makes it so i dont need strip_tags? $name = strip_tags($name); $subject = strip_tags($subject); $yourpost = strip_tags($yourpost);
  14. did i use this function correct to protect me?? <?php $insertpost="INSERT INTO forumtutorial_posts(author,title,post,showtime,realtime,lastposter) values('$name','$subject','$yourpost','$displaytime','$thedate','$name')";// Lest insert this stuff into the database<br /> mysql_query($insertpost); mysql_real_escape_string($name); mysql_real_escape_string($subject); mysql_real_escape_string($yourpost); mysql_real_escape_string($displayetime); mysql_real_escape_string($thedate); ?>
  15. i cant see the peice of code were i made that mistake "color;" can you point it out please?
  16. i use this css on a couple diffrent pages though so i kind of want to figure out whats wrong, it would make things easier. the main problem with just setting it to white manually is i want everyhng else .headline {font-family: Verdana,Sans-serif;font-weight: bold;color: white; background-color: #003366;font-size: 11px;} and to go through and manually set all them to that could take a while.
  17. So I have a css(will show below) that should be making text to be white. Here is my css. <!--- body { a:link, a:visited, a:active { text-decoration: none} font-family:Verdana, Sans-serif; color; #000000; font-size: 12px } input,textarea, select,{ color : #000000; font: normal 12px; border-collapse: collapse; border: 1px solid #000000; } img{ border:0; } .maintable {border: 0px ; width: 100%; padding: 0px; background-color: #FFFFFF} /*main table for forum*/ .regrow {font-family: Verdana,Sans-serif; color: #000000; font-weight: bold; background-color: #FFFFFF;font-size: 12px;} /*registration row, mainly here for symetry*/ .headline {font-family: Verdana,Sans-serif;font-weight: bold;color: #FFFFFF;background-color: #003366;font-size: 11px;} /*headline row, the first row that says forum name, topics, posts and such*/ .forumrow {font-family: Verdana,Sans-serif; color: #000000;background-color: #F2F2F2;font-size: 12px;} /*color of the forum rows*/ .mainrow a:link, a:visited, a:active { text-decoration: none;} .mainrow {font-family: Verdana,Sans-serif; color: #000000;background-color: #F2F2F2;font-size: 12px; a:link, a:visited, a:active { text-decoration: none}} /*color of the forum rows*/ .maintables{background-color: #FFFFFF; width: 85%; padding: 0px; border: 3px solid; cellspacing: no} /*main table for forum*/ ---> Know the text appears brown (as can be seen at http://schoolworkanswers.com/math.php ) I think it must be something to do with the setting up of the tables in my math.php file. Ill include the entire file, and then point out the part that deals with it. Entire file: <?php include "connect.php"; //mysql db connection here $area = "math";?> <html> <head> <!-- TemplateBeginEditable name="doctitle" --> <title>School Work Answers</title> <!-- TemplateEndEditable --> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <style type="text/css"> <!-- body,td,th { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; color: #333333; } body { background-color: #E2E2E2; margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; } --> </style> <script type="text/javascript"> <!-- function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc; } function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}} } function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && d.getElementById) x=d.getElementById(n); return x; } function MM_swapImage() { //v3.0 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } //--> </script> <!-- TemplateBeginEditable name="head" --><!-- TemplateEndEditable --> </head> <body onLoad="MM_preloadImages('images/rollover_12.gif','images/rollover_14.gif','images/rollover_16.gif','images/rollover_18.gif','images/rollover_20.gif','images/rollover_22.gif','images/rollover_03.gif','images/rollover_05.gif','images/rollover_07.gif')"> <!-- ImageReady Slices (index.psd) --> <table width="1000" height="1401" border="0" align="center" cellpadding="0" cellspacing="0" id="Table_01"> <tr> <td colspan="22"> <img src="images/index_01.gif" width="1000" height="82" alt=""></td> </tr> <tr> <td colspan="12"> <img src="images/index_02.gif" width="678" height="14" alt=""></td> <td colspan="3"><a href="login.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image59','','images/rollover_03.gif',1)"><img src="images/index_03.gif" name="Image59" width="39" height="14" border="0"></a></td> <td> <img src="images/index_04.gif" width="16" height="14" alt=""></td> <td colspan="2"><a href="memberarea.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image60','','images/rollover_05.gif',1)"><img src="images/index_05.gif" name="Image60" width="83" height="14" border="0"></a></td> <td> <img src="images/index_06.gif" width="17" height="14" alt=""></td> <td colspan="2"><a href="register.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image61','','images/rollover_07.gif',1)"><img src="images/index_07.gif" name="Image61" width="57" height="14" border="0"></a></td> <td rowspan="10"> <img src="images/index_08.gif" alt="" width="110" height="1318" align="top"></td> </tr> <tr> <td rowspan="9"> <img src="images/index_09.gif" width="90" height="1304" alt=""></td> <td colspan="20"> <img src="images/index_10.gif" width="800" height="19" alt=""></td> </tr> <tr> <td rowspan="2"> <img src="images/index_11.gif" width="137" height="36" alt=""></td> <td><a href="index.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image53','','images/rollover_12.gif',1)"><img src="images/index_12.gif" name="Image53" width="77" height="15" border="0"></a></td> <td rowspan="2"> <img src="images/index_13.gif" width="10" height="36" alt=""></td> <td><a href="aboutus.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image54','','images/rollover_14.gif',1)"><img src="images/index_14.gif" name="Image54" width="62" height="15" border="0"></a></td> <td rowspan="2"> <img src="images/index_15.gif" width="12" height="36" alt=""></td> <td><a href="com.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image55','','images/rollover_16.gif',1)"><img src="images/index_16.gif" name="Image55" width="78" height="15" border="0"></a></td> <td rowspan="2"> <img src="images/index_17.gif" width="10" height="36" alt=""></td> <td><a href="events.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image56','','images/rollover_18.gif',1)"><img src="images/index_18.gif" name="Image56" width="116" height="15" border="0"></a></td> <td rowspan="2"> <img src="images/index_19.gif" width="12" height="36" alt=""></td> <td colspan="3"><a href="howitworks.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image57','','images/rollover_20.gif',1)"><img src="images/index_20.gif" name="Image57" width="86" height="15" border="0"></a></td> <td rowspan="2"> <img src="images/index_21.gif" width="13" height="36" alt=""></td> <td colspan="3"><a href="forums" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image58','','images/rollover_22.gif',1)"><img src="images/index_22.gif" name="Image58" width="49" height="15" border="0"></a></td> <td colspan="4" rowspan="2"> <img src="images/index_23.gif" width="138" height="36" alt=""></td> </tr> <tr> <td> <img src="images/index_24.gif" width="77" height="21" alt=""></td> <td> <img src="images/index_25.gif" width="62" height="21" alt=""></td> <td> <img src="images/index_26.gif" width="78" height="21" alt=""></td> <td> <img src="images/index_27.gif" width="116" height="21" alt=""></td> <td colspan="3"> <img src="images/index_28.gif" width="86" height="21" alt=""></td> <td colspan="3"> <img src="images/index_29.gif" width="49" height="21" alt=""></td> </tr> <tr> <td colspan="20"> <img src="images/index_30.gif" width="800" height="27" alt=""></td> </tr> <tr> <td colspan="10" rowspan="2"> <img src="images/index_31.gif" width="567" height="243" alt=""></td> <td height="222" colspan="9" background="images/index_32.gif"> </td> <td rowspan="2"> <img src="images/index_33.gif" width="20" height="243" alt=""></td> </tr> <tr> <td colspan="9"> <img src="images/index_34.gif" width="213" height="21" alt=""></td> </tr> <tr> <td height="29" colspan="20" background="images/index_35.gif">Math Questions:</td> </tr> <tr> <td height="569" colspan="20" valign="top" background="images/index_36.gif"><table width="800" height="569" border="0" cellpadding="10"> <tr> <td width="553" valign="top"><?php /* print ("<A href='post.php'>New Topic</a> -"); print ("<A href='register.php'>Register</a> -");*/ //print("<A href='main.php'>Control Panel</a> ");// correct way print "<link rel='stylesheet' href='style.css' type='text/css'>"; print "<table class='maintable'>"; print "<tr class='headline'><td color = 'white' width='50%'>Topic</td><td width='20'>Topic Starter</td><td>Replies</td><td> Last replied by</td></tr>"; //Get all Topics (Parentid = 0) $getthreads="SELECT * from forumtutorial_posts WHERE parentid='0' AND `area`= '$area' order by lastrepliedto DESC"; $getthreads2=mysql_query($getthreads) or die("Could not get threads"); while($getthreads3=mysql_fetch_array($getthreads2)) { //while its doing it get this information and take away anything harmful (php code) $getthreads3['title']=strip_tags($getthreads3['title']); $getthreads3['author']=strip_tags($getthreads3['author']); $name = strip_tags($getthreads3['post']); // the var that controls the length of the desciptions $len = 45; // so part of the descirption dosnt Fu*k up the table shorten it if its more then X chars $name = substr($name,0,$len);//start at the first letter, and then show $desclen amount of chars //if the length is 30 chars add "..." so they know there is more to it. if (strlen ($name) == $len){ $name = $name. "..."; } print "<tr class='mainrow'><td><A href='message.php?page=1&id=$getthreads3[postid]&catagory=$area'>$getthreads3[title]<br /></a>$name</td><td>$getthreads3[author]</td><td>$getthreads3[numreplies]</td><td> <b>$getthreads3[lastposter]</b></td>"; print "</tr>"; } print "</table>"; ?> <br></td> <td width="201" valign="top"> <script type="text/javascript"><!-- google_ad_client = "pub-8552204471372682"; /* 250x250, created 2/9/09 */ google_ad_slot = "0482586252"; google_ad_width = 250; google_ad_height = 250; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script><br> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> </td> </tr> </table> </td> </tr> <tr> <td colspan="20"> <img src="images/index_37.gif" width="800" height="381" alt=""></td> </tr> <tr> <td> <img src="images/spacer.gif" width="90" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="137" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="77" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="10" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="62" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="12" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="78" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="10" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="116" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="12" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="53" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="21" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="12" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="13" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="14" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="16" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="19" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="64" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="17" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="37" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="20" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="110" height="1" alt=""></td> </tr> </table> <!-- End ImageReady Slices --> </body> </html> Now its the words: Topic Topic Starter Replies Last replied by that appear the wrong color. The code that ouputs these is here: <?php print "<link rel='stylesheet' href='style.css' type='text/css'>"; print "<table class='maintable'>"; print "<tr class='headline'><td color = 'white' width='50%'>Topic</td><td width='20'>Topic Starter</td><td>Replies</td><td> Last replied by</td></tr>"; ?> any ideas anyone?
  18. I am trying to make is so that part of a post appears unders its respective topic tittle as can be seen on ( http://schoolworkanswers.com/math.php <-- also my error) problem is im not the best with tables and thats the reason its messing up i was wondering if anyone else knew how to fix this problem. Heres my code: <?php $getthreads="SELECT * from forumtutorial_posts where parentid='0' AND `area`= 'math' order by lastrepliedto DESC"; mysql_real_escape_string('parentid'); mysql_real_escape_string('area'); $getthreads2=mysql_query($getthreads) or die("Could not get threads"); while($getthreads3=mysql_fetch_array($getthreads2)) { $getthreads3[title]=strip_tags($getthreads3[title]); $getthreads3[author]=strip_tags($getthreads3[author]); $name = strip_tags($getthreads3[post]); if (strlen($name) > 20){ while (strlen($name) >20){ $name = substr($name,0,-1); } } print "<tr class='mainrow'><td><A href='message.php?page=1&id=$getthreads3[postid]&catagory=$area'>$getthreads3[title]</a></td><td>$getthreads3[author]</td><td>$getthreads3[numreplies]</td><td> <b>$getthreads3[lastposter]</b></td>"; print "<br>"; print "$name</tr>"; } print "</table>"; ?>
  19. yeah i had to do array[], and it worked. Thanks
  20. I sent a query and im tryingto find out the amount of posts inside a topic and i got the followng code to do so, but it returns the array size 0, anyone know how to fix?? <?php include ("connect.php"); $id = 22; $area = 'math'; /* Err... Let p be the number of posts, let m be the number of posts per page and let y be the number of pages. y=p/m*/ $postquery = "Select * from forumtutorial_posts WHERE parentid = $id AND area = '$area'"; $findamount = mysql_query($postquery) or die (mysql_error()); $array = array(); while ($row = mysql_fetch_assoc($findamount)) { $array = $row['posts']; } $testt = sizeof($array); echo $testt ?>
  21. are you getting an error?if not add this at the top of the page : ini_set('error_reporting', E_ALL); P.s why do you have $email inside quotes " " ? if you dont get an error message after adding that then im not to sure.
  22. your vote button links to that file? if so may we see the php code that the vote button is in?
  23. your math looks a lot better...is celi away of getting rid of decimals?
  24. found it: <?php if($result) {//1 open if(mysql_num_rows($result) == 1) {//2open session_regenerate_id(); $member = mysql_fetch_assoc($result); $_SESSION['email'] = $member['email']; $_SESSION['subject'] = 'Password Request'; $_SESSION['message'] = 'Link to reset pass here'; $_SESSION['from'] = 'do.not.reply@email.com'; session_write_close(); }//1 close were is 2 close?? mail("$email", $subject, $message, $from);?> look at your braces '}' in the code i posted i put comments next to them
×
×
  • 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.