Jump to content

mike12255

Members
  • Posts

    439
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by mike12255

  1. thats your login page, your contact us page has session start at the top of it aswell?
  2. ok, sorry i've been busy however i got the error error: and below is the code using random: <?php $randoms = array(); $start =1; $total =11; while (count($random) < 3) { $random = mt_rand($start,$total); if (!in_array($random, $randoms)) { $randoms[] = $random; } } $captions = array("RBC","Prodomax","Liews Motors","Advanced Motion Controls","Burnside","TD Canada Trust","Reinhart","SCDSB","ARO","Stayner Lions","test","ComTek"); $urls = array("http://www.royalbank.com", "http://prodomax.com/","http://a-m-c.com/","http://www.rjburnside.com/","http://tdcanadatrust.com","http://www.reinhartfoods.com/", "http://www.scdsb.on.ca/", "http://www.aronet.com/", "http://www.lionsclubs.org/","test","http://www.comtekcomputers.com/"); for ( $i = 0; $i < 3; $i++){ print $randoms[$i]; $caps = $captions[$randoms[$i]];; $img = $urls[$randoms[$i]]; } ?> <td align="center"><img src="images/random/<?php echo $random.".jpg" ?>" height="25"/> </td> </tr> <tr> <td align="center"><a href="<?php echo $img ?>" class="link"><?=$caps?></a></td> </tr> <tr> <td align="center" class="dotline"> </td> </tr> <tr> <td align="center"><img src="images/random/<?php echo $randoms.".jpg" ?>" height="25" /></td> </tr> <tr> <td align="center"><a href="<?php echo $img ?>" class="link"><?php echo $caps ?></a></td> </tr> <tr> <td align="center" class="dotline"> </td> </tr> <tr> d align="center"><img src="images/random/<?php echo $randoms.".jpg" ?>" height="25" /></td> </tr> <tr> <td align="center"><a href="<?php echo $img ?>" class="link"><?php echo $caps ?></a></td> </tr> </table></td> </tr>
  3. On the following page i have a custom forum, : http://schoolworkanswers.com/message.php?id=1 The actual part were the name message and all that is displayed is done through css. I was wondering if it was possible to add a button, such as qoute insidie one of those posts using css or something else?
  4. yeah did that already, P.S i know this is a css question but i dont want to have to create another thread just for it, is it possible to use css to make post 1 box a certian color and post 2 box another color?
  5. its in a css folder, thats why you cant find it, it's always worked that that before, ill try it at top and with none in a couple mins
  6. ARH! 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*/ ---> and i've linked the message.php file to it: print "<link rel='stylesheet' href='style.css' type='text/css'>"; but i still got the box???
  7. I got the following code displaying an image: $result = mysql_query($query) or die(mysql_error()); $record = mysql_fetch_assoc($result); // if ($record['locked'] < 1 || ($session->isAdmin())) { print "<a href= 'reply.php' ><img src='images/reply-btn.gif' width='100' height='32'></a>"; } if($session->isAdmin()) { and for some reason a blue box appears around my gif (as can be seen at http://schoolworkanswers.com/message.php?id=1) anyone know why P.S how do i turn on error reporting in php?
  8. connect before this peice of code: $title = $_REQUEST["title"]; $post = $_REQUEST["post"]; its not a long peice of code, but please remember to put it in code tags, ill display below ** actually tags do not include the "." [code.][./code] html> <head> <title>posted</title> </head> <body> <table> <thead>YES</thead> <tbody> <?php $title = $_REQUEST["title"]; $post = $_REQUEST["post"]; $dbh = mysqli_connect("--", "--", "--", "--"); $sql = "INSERT INTO Posts (Number,Title,Content) VALUES(null,'$title', '$post');"; $query = mysqli_query($dbh,$sql); $newpost = "SELECT Number,Title,Content FROM Posts ORDER BY Number DESC"; $query2 = mysqli_query($dbh,$newpost); if($query2) { echo "YES"; $feed = mysqli_fetch_assoc($query2); $number = $feed['Number']; $title = $feed['Title']; $post = $feed['Content']; echo"VIEW POST\n"; echo "</tbody>"; } ?> </table> </body> </html>
  9. these are the first 6 lines: <html> <head> <title>School Work Answers</title> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <style type="text/css">
  10. i was thinking this line: <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> was causing the error but that dosnt change the header i guess?
  11. I got some code that needs to be rewitten to fix the following error: <html> <head> <title>School Work Answers</title> <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>
  12. should look like: http://www.sgi-clan.info/gnomes/index.html Currently looks like: http://www.sgi-clan.info/gnomes/index.php i know about the banners and whatnot, im talking about the things below the video player (half way down and lowe) Entire page here: <?php include ("connect.php"); ?> <!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=iso-8859-1" /> <title>Home of the Gnomes</title> <script type="text/JavaScript"> <!-- 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];}} } //--> </script> <link href="css/style.css" rel="stylesheet" type="text/css" /> <script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script> <style type="text/css"> <!-- .style1 {color: #E68B57} .style2 {font-size: 9px} --> </style> </head> <body> <table width="974" border="0" align="center" cellpadding="0" cellspacing="0" class="topbg"> <tr> <td width="45"><table border="0" cellpadding="0" cellspacing="8"> <tr> <td width="33"> </td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> </table></td> <td width="929"><img src="images/top.jpg" width="883" height="195" /></td> </tr> </table> <table width="975" border="0" align="center" cellpadding="0" cellspacing="0"> <tr valign="top"> <td width="459"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="12" valign="top" class="pagebg"><img src="images/leftbtncorner.jpg" width="12" height="21" /></td> <td class="btnlinebg"><table border="0" align="center" cellpadding="0" cellspacing="1"> <tr> <td width="58" align="center"><a href="index.php" class="toplink">HOME</a></td> <td width="58" align="center"><a href="team.php" class="toplink">TEAM</a></td> <td width="58" align="center"><a href="sponsers.php" class="toplink">SPONSORS</a></td> <td width="58" align="center"><a href="download.php" class="toplink">DOWNLOAD</a></td> <td width="58" align="center"><a href="forums/index.php" class="toplink">FORUM</a></td> <td width="58" align="center"><a href="movies.php" class="toplink">MEDIA</a></td> <td width="58" align="center"><a href="images.php?album=0" class="toplink">GALLERY</a></td> </tr> </table></td> <td width="12" valign="top" class="pagebg"><img src="images/rightbtncorner.jpg" width="12" height="21" /></td> </tr> </table> <table width="100%" height="26" border="0" cellpadding="0" cellspacing="0" class="topline"> <tr> <td align="center"><span class="blacktext"><a href="http://www.sgi-360.com/forums/viewforum.php?f=1" class="link">Have a question, try <span class="style1">contacting us!</span></a><span class="style1"><a href="http://www.sgi-360.com/forums/viewforum.php?f=14" class="link"></a></span></span></td> </tr> </table></td> <td width="517"><form id="form1" name="form1" method="post" action=""> <table height="26" border="0" cellpadding="0" cellspacing="0" class="pagebg"> <tr> <td width="116" valign="top"><img src="images/gnomelogo2.gif" width="117" height="22" /></td> <td width="218" valign="bottom" class="TOPLINEBG"><table border="0" cellspacing="0" cellpadding="0"> <tr> <td width="60" align="right">Username:</td> <td width="105"><input name="textfield3" type="text" class="textfield" value="username" /></td> <td width="31"><a href="http://sgi-clan.info/gnome/ucp.php?mode=register&sid=4d1e69f1366a55f73f9806b0e366066b"><img src="images/modifiedfinalsliced_17.jpg" width="31" height="14" border="0" /></a></td> </tr> </table></td> <td valign="bottom"><img src="images/right.jpg" width="182" height="26" /></td> </tr> </table> <table width="100%" height="26" border="0" align="center" cellpadding="0" cellspacing="0" class="topline"> <tr> <td width="116" align="center" valign="bottom"><a href="index.php"><img src="images/modifiedfinalsliced_40.gif" width="107" height="18" vspace="3" border="0" /></a></td> <td valign="top"><table border="0" cellspacing="0" cellpadding="0"> <tr> <td width="60" align="right">Password:</td> <td width="105"><input name="textfield2" type="password" class="textfield" value="password" /></td> <td width="31"><a href="http://sgi-clan.info/gnome/ucp.php?mode=login"><img src="images/index_33.gif" width="31" height="15" border="0" /></a></td> </tr> </table></td> <td align="center"><img src="images/user.gif" width="11" height="13" hspace="3" align="absmiddle" /><span class="blacktext">USERS:</span><span class="redtext">35753</span> <span class="blacktext">MEMBERS:</span><span class="redtext">5637</span></td> </tr> </table> </form> </td> </tr> </table> <table width="974" border="0" align="center" cellpadding="0" cellspacing="1" class="middleline"> <tr valign="top"> <td height="5" colspan="2"></td> </tr> <tr valign="top"> <td width="406"><table width="100%" border="0" cellpadding="0" cellspacing="0" class="blackbg"> <tr> <td><img src="images/black1.jpg" width="3" height="3" /></td> <td align="right"><img src="images/black2.jpg" width="3" height="3" /></td> </tr> </table> <table width="100%" border="0" align="center" cellspacing="0" class="blackbg"> <tr> <tr> <td><img src="images/latestthreads.jpg" width="200" height="23" /></td> <td><img src="images/latestdownload.jpg" width="200" height="23" /></td> </tr> <tr> <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="3"> <td height="18" class="bluetext"><img src="images/title.jpg" width="30" height="7" /></td> <td colspan="2" align="right" class="bluetext"><img src="images/posted.jpg" width="37" height="7" /></td> <?php $newitems = mysql_query ("SELECT * FROM phpbb_posts JOIN phpbb_topics ON (phpbb_posts.topic_id = phpbb_topics.topic_id) ORDER BY post_time DESC LIMIT 4") or die(mysql_error());// for the newest posts. while($row = mysql_fetch_array($newitems)) { $title = $row["topic_title"]; $name = $row["topic_first_poster_name"]; if (strlen ($row["topic_first_poster_name"]) >6) { while (strlen($name) >6){ $name = substr($name,0,-1); } } if (strlen ($row["topic_title"]) > 27){ while (strlen ($title) > 27){ $title = substr($title,0,-1); } } if (strlen ($name) == 6){ $name .="..."; } if (strlen ($title) == 27){ $title .="..."; } ?> <tr> <td> <a class="whitelink" href="http://sgi-clan.info/gnome/viewtopic.php?f=<?=$row["forum_id"]?>&t=<?=$row["topic_id"]?>"><?php print $title;?></a> </td> <td><a class="whitelink" style="text-align:right" href="http://sgi-clan.info/gnome/memberlist.php?mode=viewprofile&u=<?=$row["topic_poster"];?>"><?php print $name;?></a></td> <?php } ?> </table></td> <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="3"> <tr> <td height="18" class="bluetext"><img src="images/title.jpg" width="30" height="7" /></td> <td colspan="2" align="right" class="bluetext"><img src="images/rating.jpg" width="37" height="7" /></td> </tr> <tr> <td width="30">00/00</td> <td><a href="#" class="whitelink">sGi Wallpaper Pack</a></td> <td><img src="images/star.gif" width="11" height="13" /><img src="images/star.gif" width="11" height="13" /><img src="images/star.gif" width="11" height="13" /><img src="images/star.gif" width="11" height="13" /></td> </tr> <tr> <td>00/00</td> <td><a href="#" class="whitelink">The sGi Movie</a></td> <td><img src="images/star2.gif" width="11" height="13" /><img src="images/star2.gif" width="11" height="13" /><img src="images/star.gif" width="11" height="13" /><img src="images/star.gif" width="11" height="13" /></td> </tr> <tr> <td>00/00</td> <td><a href="#" class="whitelink">Custom sGi Steam Skin</a></td> <td><img src="images/star.gif" width="11" height="13" /><img src="images/star.gif" width="11" height="13" /><img src="images/star.gif" width="11" height="13" /><img src="images/star.gif" width="11" height="13" /></td> </tr> <tr> <td>00/00</td> <td><a href="#" class="whitelink">CS:S Movie Demo Reel</a></td> <td><img src="images/star2.gif" width="11" height="13" /><img src="images/star2.gif" width="11" height="13" /><img src="images/star.gif" width="11" height="13" /><img src="images/star.gif" width="11" height="13" /></td> </tr> </table></td> </tr> <tr> <td><a href="#"><img src="images/viewforums.jpg" width="200" height="19" border="0" /></a></td> <td><a href="#"><img src="images/viewdownload.jpg" width="200" height="19" border="0" /></a></td> </tr> <tr> <td><img src="images/latestmedia.jpg" width="200" height="23" /></td> <td><img src="images/latestgallery.jpg" width="200" height="23" /></td> </tr> <tr> <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="3"> <tr> <td height="18" class="bluetext"><img src="images/title.jpg" width="30" height="7" /></td> <td colspan="2" align="right" class="bluetext"><img src="images/rating.jpg" width="37" height="7" /></td> </tr> <tr> <td width="30">00/00</td> <td><a href="#" class="whitelink">sGi Wallpaper Pack</a></td> <td><img src="images/star.gif" width="11" height="13" /><img src="images/star.gif" width="11" height="13" /><img src="images/star.gif" width="11" height="13" /><img src="images/star.gif" width="11" height="13" /></td> </tr> <tr> <td>00/00</td> <td><a href="#" class="whitelink">The sGi Movie</a></td> <td><img src="images/star2.gif" width="11" height="13" /><img src="images/star2.gif" width="11" height="13" /><img src="images/star.gif" width="11" height="13" /><img src="images/star.gif" width="11" height="13" /></td> </tr> <tr> <td>00/00</td> <td><a href="#" class="whitelink">Custom sGi Steam Skin</a></td> <td><img src="images/star.gif" width="11" height="13" /><img src="images/star.gif" width="11" height="13" /><img src="images/star.gif" width="11" height="13" /><img src="images/star.gif" width="11" height="13" /></td> </tr> <tr> <td>00/00</td> <td><a href="#" class="whitelink">CS:S Movie Demo Reel</a></td> <td><img src="images/star2.gif" width="11" height="13" /><img src="images/star2.gif" width="11" height="13" /><img src="images/star.gif" width="11" height="13" /><img src="images/star.gif" width="11" height="13" /></td> </tr> </table></td> <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="3"> <tr> <td height="18" colspan="2" align="right" class="bluetext"><img src="images/event.jpg" width="32" height="7" /></td> <?php $newitems = mysql_query ("SELECT * FROM phpbb_files ORDER BY id DESC LIMIT 4") or die(mysql_error());// for the newest posts. while($row = mysql_fetch_array($newitems)) { $title = $row["name"]; $name = "admin"; if (strlen ($name) >6) { while (strlen($name) >6){ $name = substr($name,0,-1); } } if (strlen ($row["name"]) > 27){ while (strlen ($title) > 27){ $title = substr($title,0,-1); } } if (strlen ($name) == 6){ $name .="..."; } if (strlen ($title) == 27){ $title .="..."; } ?> <tr> <td> <?php print $title;?></a> </td> <td><a class="whitelink" style="text-align:right" href="http://sgi-clan.info/gnomes/images.php"></a></td> <?php } ?> </table></td> </tr> <tr> <td><a href="#"><img src="images/viewmedia.jpg" width="200" height="19" border="0" /></a></td> <td><a href="#"><img src="images/viewgallery.jpg" width="200" height="19" border="0" /></a></td> </tr> </table> <table width="100%" border="0" cellpadding="0" cellspacing="0" class="blackbg"> <tr> <td><img src="images/black3.jpg" width="3" height="3" /></td> <td align="right"><img src="images/black4.jpg" width="3" height="3" /></td> </tr> </table></td> <td height="293" align="center"><script type="text/javascript"> AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0','width','552','height','297','src','player','quality','high','pluginspage','http://www.macromedia.com/go/getflashplayer','wmode','transparent','movie','player' ); //end AC code </script> <noscript> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="552" height="297"> <param name="movie" value="player.swf" /> <param name="quality" value="high" /> <param name="wmode" value="transparent" /> <embed src="player.swf" width="552" height="297" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent"></embed> </object> </noscript> </td> </tr> </table> <table width="974" height="795" border="0" align="center" cellpadding="0" cellspacing="1" class="pagebg"> <tr valign="top"> <td width="245" class="line"><table width="100%" border="0" cellpadding="0" cellspacing="0" class="blackbg"> <tr> <td><img src="images/modifiedfinalsliced_137.gif" width="243" height="24" /></td> </tr> <tr> <td><iframe id="main" scrolling="no" width="243" height="170" frameborder="0" src="team.html"></iframe> </td> </tr> <tr> <td><img src="images/modifiedfinalsliced_156.gif" width="243" height="23" /></td> </tr> <tr> <td><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr class="sgititlebg"> <td align="center"><strong class="redtext">Regionals</strong></td> <td align="center"><strong class="greentext">Wins</strong></td> <td align="center"><strong class="blue">Ties</strong></td> <td align="center"><strong class="redtext">Losses</strong></td> </tr> <tr class="sgibg"> <td align="center" class="redtext">Regional One</td> <td align="center" class="greentext">000</td> <td align="center" class="blue">00</td> <td align="center" class="redtext">000</td> </tr> <tr class="sgibg"> <td align="center" class="redtext">Regional Two</td> <td align="center" class="greentext">000</td> <td align="center" class="blue">00</td> <td align="center" class="redtext">000</td> </tr> <tr class="sgibg"> <td align="center" class="redtext">Overall </td> <td align="center" class="greentext">000</td> <td align="center" class="blue">00</td> <td align="center" class="redtext">000</td> </tr> </table></td> </tr> <tr> <td><img src="images/modifiedfinalsliced_223.gif" width="244" height="24" /></td> </tr> <tr> <td><img src="images/newsimg.jpg" width="243" height="169" /></td> </tr> <tr> <td nowrap="nowrap" class="whitetext"> <span class="style2"> September 9, 2007 Racs takes to the field with new <br /> found Australian FIFA star Haroutig after his first place<br /> finish in the Region 6 qualifiers. <a href="#" class="style1">read more</a></span></td> </tr> </table> <table width="100%" border="0" cellpadding="0" cellspacing="0" class="blackbg"> <tr> <td><img src="images/black3.jpg" width="3" height="3" /></td> <td align="right"><img src="images/black4.jpg" width="3" height="3" /></td> </tr> </table> </td> <td width="190"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td><img src="images/modifiedfinalsliced_138.gif" width="177" height="25" /></td> </tr> <tr> <td class="sponsorbg"><table width="90%" border="0" align="center" cellpadding="0" cellspacing="5"> <tr> <td align="center"> </td> </tr> <tr> <?php $randoms = array(); $start =1; $total =11; while (count($random) < 3) { $random = mt_rand($start,$total); if (!in_array($random, $randoms)) { $randoms[] = $random; } } $captions = array("RBC","Prodomax","Liews Motors","Advanced Motion Controls","Burnside","TD Canada Trust","Reinhart","SCDSB","ARO","Stayner Lions","test","ComTek"); $urls = array("http://www.royalbank.com", "http://prodomax.com/","http://a-m-c.com/","http://www.rjburnside.com/","http://tdcanadatrust.com","http://www.reinhartfoods.com/", "http://www.scdsb.on.ca/", "http://www.aronet.com/", "http://www.lionsclubs.org/","test","http://www.comtekcomputers.com/"); for ( $i = 0; $i < 3; $i++){ print $randoms[$i]; $caps = $captions[$randoms[$i]];; $img = $urls[$randoms[$i]]; } ?> <td align="center"><img src="images/random/<?php echo $random.".jpg" ?>" height="25"/> </td> </tr> <tr> <td align="center"><a href="<?php echo $img ?>" class="link"><?=$caps?></a></td> </tr> <tr> <td align="center" class="dotline"> </td> </tr> <tr> <td align="center"><img src="images/random/<?php echo $randoms.".jpg" ?>" height="25" /></td> </tr> <tr> <td align="center"><a href="<?php echo $img ?>" class="link"><?php echo $caps ?></a></td> </tr> <tr> <td align="center" class="dotline"> </td> </tr> <tr> d align="center"><img src="images/random/<?php echo $randoms.".jpg" ?>" height="25" /></td> </tr> <tr> <td align="center"><a href="<?php echo $img ?>" class="link"><?php echo $caps ?></a></td> </tr> </table></td> </tr> <tr> <td><img src="images/modifiedfinalsliced_204.gif" width="179" height="24" /></td> </tr> <tr> <td class="sponsorbg"><table width="94%" border="0" align="center" cellpadding="0" cellspacing="5"> <tr> <td align="center"> </td> </tr> <tr> <td align="center"><img src="images/first_toronto.png" width="160" height="100" /></td> </tr> <tr> <td align="center"><a href="http://www.firstroboticscanada.org" class="redtext style2">http://www.firstroboticscanada.org</a></td> </tr> <tr> <td align="center" class="dotline"> </td> </tr> <tr> <td align="center"><img src="images/first_toronto.png" width="160" height="100" /></td> </tr> <tr> <td align="center"><a href="http://www.firstrobotics.uwaterloo.ca" class="link"><span class="redtext style2">http://www.firstrobotics.uwaterloo.ca</span></a></td> </tr> </table></td> </tr> <tr> <td><img src="images/modifiedfinalsliced_250.gif" width="176" height="20" /></td> </tr> <tr> <td><table width="100%" border="0" cellspacing="0" cellpadding="3"> <tr> <td><strong class="blacktext">How do you like the new site?</strong></td> </tr> <tr> <td class="blacktext"><input name="radiobutton" type="radio" value="radiobutton" /> Alright</td> </tr> <tr> <td class="blacktext"><img src="images/line.gif" width="100" height="8" /></td> </tr> <tr> <td class="blacktext"><input name="radiobutton" type="radio" value="radiobutton" /> Amazing</td> </tr> <tr> <td class="blacktext"><img src="images/line.gif" width="120" height="8" /></td> </tr> <tr> <td class="blacktext"><input name="radiobutton" type="radio" value="radiobutton" /> Horrible</td> </tr> <tr> <td class="blacktext"><img src="images/line.gif" width="60" height="8" /></td> </tr> <tr> <td class="blacktext"><input name="radiobutton" type="radio" value="radiobutton" /> Bad</td> </tr> <tr> <td class="blacktext"><img src="images/line.gif" width="80" height="8" /></td> </tr> </table></td> </tr> </table> <table width="100%" border="0"> <tr> <td width="43%"> </td> <td width="22%"><img src="images/vote.jpg" width="31" height="14" /></td> <td width="35%">View Details</td> </tr> </table></td> <td width="550"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td><img src="images/modifiedfinalsliced_140.gif" width="546" height="24" /></td> </tr> <tr> <td height="22" class="newsinfobg"><table width="95%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td class="blacktext"><strong>NEW TEAM WEBSITE : PLEASE READ! </strong></td> <td align="right"><img src="images/flag.jpg" width="18" height="12" hspace="5" align="absmiddle" /><a href="http://www.sgi-360.com/forums/profile.php?mode=viewprofile&u=2" class="redtext">PhySiQu3 sGi</a></td> </tr> </table></td> </tr> <tr> <td height="22"><img src="images/modifiedfinalsliced_159.jpg" width="544" height="119" vspace="2" /></td> </tr> <tr> <td class="line2"><table width="95%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td class="blacktext"><?php /*$insertpost="INSERT INTO phpbb_index (message, title) values('testing this','test')"; mysql_query($insertpost) or die("Could not insert post"); //insert post*/ $query = mysql_query ("SELECT * FROM phpbb_index ORDER BY messageid DESC LIMIT 4") or die(mysql_error());// while ($message == mysql_fetch_array ($query)){ $message2 = $message['message']; print $message2; } ?></td> </tr> <tr> <td align="right"><a href="#"><img src="images/modifiedfinalsliced_233.gif" width="59" height="14" border="0" /></a></td> </tr> </table> </td> </tr> <tr> <td><table width="100%" border="0" cellpadding="0" cellspacing="0" class="line3"> <tr> <td><img src="images/corner1.jpg" width="3" height="3" /></td> <td width="3"><img src="images/corner2.jpg" width="3" height="3" /></td> </tr> </table></td> </tr> <tr> <td height="22" class="newsinfobg"><table width="95%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td class="blacktext"><strong>NEW TEAM WEBSITE : PLEASE READ! </strong></td> <td align="right"><img src="images/flag.jpg" width="18" height="12" hspace="5" align="absmiddle" /><a href="http://www.sgi-360.com/forums/profile.php?mode=viewprofile&u=2" class="redtext">PhySiQu3 sGi</a></td> </tr> </table></td> </tr> <tr> <td height="22"><img src="images/modifiedfinalsliced_159.jpg" width="544" height="119" vspace="2" /></td> </tr> <tr> <td class="line2"><table width="95%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td class="blacktext"><p> </p> <p>The site is currently undergoing ALOT of work. The Media player does not work because we need to get it converted <br /> into flash. This will take a little bit more time then the rest but soon enough the entire site will be fully functioning <br /> properly.</p> <p>If you havent yet, Please take the time to register with the forums. <a href="#" class="redtext">Click Here</a></p> <p>If you have Questions at all, Please feel free to contact PhySiQu3 sGi as he is the man to ask. If you are intrested<br /> in joining up with Team sGi, Please post your recruiting application via the forums.</p> <p>Thats all for today, If anyone wants to give there feedback, comments etc.. please do so by registering with the forums<br /> and posting your thoughts about todays topic there.</p> <p>Thank you all once again and have a nice day,<br /> - PhySiQu3 sGi</p></td> </tr> <tr> <td align="right"><a href="#"><img src="images/modifiedfinalsliced_233.gif" width="59" height="14" border="0" /></a></td> </tr> </table></td> </tr> <tr> <td><table width="100%" border="0" cellpadding="0" cellspacing="0" class="line3"> <tr> <td><img src="images/corner1.jpg" width="3" height="3" /></td> <td width="3"><img src="images/corner2.jpg" width="3" height="3" /></td> </tr> </table></td> </tr> </table></td> </tr> </table> <table width="974" border="0" align="center" cellpadding="0" cellspacing="0" class="pagebg"> <tr> <td height="50" align="center" class="blacktext">Copyright © Team Cyber Gnomes 2009<br /> <a href="www.sgi-360.com" class="redtext">www.Team2013.com</a></td> </tr> </table> </body> </html>
  13. make sure you echo the line or end the php script so its read as an html peice of code
  14. still no luck just a white bo empty box...thats pushed over father then it should be. Any ideas anyone?
  15. still not luck, i think it has something to do with the way im trying to display them in these lines: <?php for ( $i = 0; $i < 3; $i++){ print $randoms[$i]; $caps = $captions[$randoms[$i]];; $img = $urls[$randoms[$i]]; } ?> <td align="center"><img src="images/random/<?=$random[1].".jpg"?>" height="25"/> </td> </tr> <tr> <td align="center"><a href="<?=$img[1]?>" class="link"><?=$caps[1]?></a></td> </tr> <tr> <td align="center" class="dotline"> </td> </tr> <tr> <td align="center"><img src="images/random/<?=$randoms[2].".jpg"?>" height="25" /></td> </tr> <tr> <td align="center"><a href="<?=$img[2]?>" class="link"><?=$caps[2]?></a></td> </tr>
  16. So i dont know whats wrong (can see reference site here: http://sgi-clan.info/gnomes/) but the site certiantly dosnt look like it should. I happen to know its from my random sponser code, but its not working could somone please revise this and tell me any erros you see so i can fix this problem. <?php $randoms = array(); $start =1; $total =11; while (count($random) < 3) { $random = mt_rand($start,$total); if (!in_array($random, $randoms)) { $randoms[] = $random; } } $captions = array("RBC","Prodomax","Liews Motors","Advanced Motion Controls","Burnside","TD Canada Trust","Reinhart","SCDSB","ARO","Stayner Lions","test","ComTek"); $urls = array("http://www.royalbank.com", "http://prodomax.com/","http://a-m-c.com/","http://www.rjburnside.com/","http://tdcanadatrust.com","http://www.reinhartfoods.com/", "http://www.scdsb.on.ca/", "http://www.aronet.com/", "http://www.lionsclubs.org/","test","http://www.comtekcomputers.com/"); for ( $i = 0; $i < 3; $i++){ print $randoms[$i]; $caps = ($captions[$randoms[$i]]); print $caps[$i]; $img = ($urls[$randoms[$i]]); print $img[$i]; print $random[$i]; } ?> <td align="center"><img src="images/random/<?=$random[1].".jpg"?>" height="25"/> </td> </tr> <tr> <td align="center"><a href="<?=$img[1]?>" class="link"><?=$caps[1]?></a></td>
  17. actually to be honset i dont even use that line, i ment to take that out.
  18. I have made some code that chooses a random image and displays it, i have spots for three images and all them apear with that white box that has the X in the top left that means picture not found. I cannot seem to figure out the problem, here is my code: <?php // Change this to the total number of images in the folder $total = "11"; // Change to the type of files to use eg. .jpg or .gif $file_type = ".gif"; // Change to the location of the folder containing the images $image_folder = "images/random"; // You do not need to edit below this line $start = "1"; $random = mt_rand($start, $total); $temp1; if ($temp1 < 1){ $temp1 = $random; } if ($temp1 > 0){ $temp2 = $random; } if ($temp1 > 0 && $temp2 > 0){ $temp3 = $random; } $image_name = $random . $file_type; } randomint($image_name); if(randomint($temp1) == randomint($temp2) || randomint($temp1) == randomint($temp3) || randomint($temp3) == randomint($temp2)){ randomint($image_name); }else{ $img1 = randomint($image_name); } randomint($image_name); if(randomint($temp1) == randomint($temp2) || randomint($temp1) == randomint($temp3) || randomint($temp3) == randomint($temp2)){ randomint($image_name); }else{ $img2 = randomint($image_name); } randomint($image_name); if(randomint($temp1) == randomint($temp2) || randomint($temp1) == randomint($temp3) || randomint($temp3) == randomint($temp2)){ randomint($image_name); }else{ $img3 = randomint($image_name); } ?>
  19. so im trying to redirect the use with a 3 second delay after uploading the image. With the following code: <?php header('Refresh:3 ; URL=images.php');?> however i get the following error: I've had this error before but it was because i was already changing the header, however i dont think i have this time, below is the entire script. <?php include "connect.php"; //define a maxim size for the uploaded images in Kb define ("MAX_SIZE","10000"); //This function reads the extension of the file. It is used to determine if the file is an image by checking the extension. function getExtension($str) { $i = strrpos($str,"."); if (!$i) { return ""; } $l = strlen($str) - $i; $ext = substr($str,$i+1,$l); return $ext; } //This variable is used as a flag. The value is initialized with 0 (meaning no error found) //and it will be changed to 1 if an errro occures. //If the error occures the file will not be uploaded. $errors=0; //checks if the form has been submitted if(isset($_POST['Submit'])) { //reads the name of the file the user submitted for uploading $image=$_FILES['image']['name']; //if it is not empty if ($image) { //get the original name of the file from the clients machine $filename = stripslashes($_FILES['image']['name']); //get the extension of the file in a lower case format $extension = getExtension($filename); $extension = strtolower($extension); //if it is not a known extension, we will suppose it is an error and will not upload the file, //otherwise we will do more tests if (($extension != "jpg") && ($extension != "jpeg") && ($extension != "png") && ($extension != "gif")) { //print error message echo '<h1>Unknown extension!</h1>'; $errors=1; } else { //get the size of the image in bytes //$_FILES['image']['tmp_name'] is the temporary filename of the file //in which the uploaded file was stored on the server $size=filesize($_FILES['image']['tmp_name']); //compare the size with the maxim size we defined and print error if bigger if ($size > MAX_SIZE*1024) { echo '<h1>You have exceeded the size limit!</h1>'; $errors=1; } //we will give an unique name, for example the time in unix time format $image_name=time().'.'.$extension; //the new name will be containing the full path where will be stored (images folder) $newname="uploads/".$image_name; //we verify if the image has been uploaded, and print error instead $copied = copy($_FILES['image']['tmp_name'], $newname); if (!$copied) { echo '<h1>Copy unsuccessfull!</h1>'; $errors=1; }}}} //If no errors registred, print the success message if(isset($_POST['Submit']) && !$errors) { echo "Upload sucess,redirecting..."; $width =100; $heightt = 100; $insert ="INSERT INTO `phpbb_files`(`shortname` ) VALUES ('$image_name')"; //echo $insert; mysql_query($insert) or die(mysql_error()); header('Refresh:3 ; URL=images.php'); } ?> <!--next comes the form, you must set the enctype to "multipart/frm-data" and use an input type "file" --> <form name="newad" method="post" enctype="multipart/form-data" action=""> <table> <tr><td><input type="file" name="image"></td></tr> <tr><td><input type="text" name="imagename"><-- Enter what you want the file to be named</td></tr> <tr><td><input name="Submit" type="submit" value="Upload image"></td></tr> </table> </form><?php include "connect.php"; //define a maxim size for the uploaded images in Kb define ("MAX_SIZE","10000"); //This function reads the extension of the file. It is used to determine if the file is an image by checking the extension. function getExtension($str) { $i = strrpos($str,"."); if (!$i) { return ""; } $l = strlen($str) - $i; $ext = substr($str,$i+1,$l); return $ext; } //This variable is used as a flag. The value is initialized with 0 (meaning no error found) //and it will be changed to 1 if an errro occures. //If the error occures the file will not be uploaded. $errors=0; //checks if the form has been submitted if(isset($_POST['Submit'])) { //reads the name of the file the user submitted for uploading $image=$_FILES['image']['name']; //if it is not empty if ($image) { //get the original name of the file from the clients machine $filename = stripslashes($_FILES['image']['name']); //get the extension of the file in a lower case format $extension = getExtension($filename); $extension = strtolower($extension); //if it is not a known extension, we will suppose it is an error and will not upload the file, //otherwise we will do more tests if (($extension != "jpg") && ($extension != "jpeg") && ($extension != "png") && ($extension != "gif")) { //print error message echo '<h1>Unknown extension!</h1>'; $errors=1; } else { //get the size of the image in bytes //$_FILES['image']['tmp_name'] is the temporary filename of the file //in which the uploaded file was stored on the server $size=filesize($_FILES['image']['tmp_name']); //compare the size with the maxim size we defined and print error if bigger if ($size > MAX_SIZE*1024) { echo '<h1>You have exceeded the size limit!</h1>'; $errors=1; } //we will give an unique name, for example the time in unix time format $image_name=time().'.'.$extension; //the new name will be containing the full path where will be stored (images folder) $newname="uploads/".$image_name; //we verify if the image has been uploaded, and print error instead $copied = copy($_FILES['image']['tmp_name'], $newname); if (!$copied) { echo '<h1>Copy unsuccessfull!</h1>'; $errors=1; }}}} //If no errors registred, print the success message if(isset($_POST['Submit']) && !$errors) { echo "Upload sucess,redirecting..."; $width =100; $heightt = 100; $insert ="INSERT INTO `phpbb_files`(`shortname` ) VALUES ('$image_name')"; //echo $insert; mysql_query($insert) or die(mysql_error()); header('Refresh:3 ; URL=images.php'); } ?> <!--next comes the form, you must set the enctype to "multipart/frm-data" and use an input type "file" --> <form name="newad" method="post" enctype="multipart/form-data" action=""> <table> <tr><td><input type="file" name="image"></td></tr> <tr><td><input type="text" name="imagename"><-- Enter what you want the file to be named</td></tr> <tr><td><input name="Submit" type="submit" value="Upload image"></td></tr> </table> </form>
  20. I just recreated the database and it appears to be working
×
×
  • 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.