Jump to content

butsags

Members
  • Posts

    33
  • Joined

  • Last visited

    Never

Everything posted by butsags

  1. Are you set on using php? I've run into problems a few times while using multiple header() calls and needed a resort. Try javascript. window.location = "http://www.google.com/" you can attach it to a link: <a href="javascript:window.location = 'http://www.google.com/'">Go</a> or add this into the header tag and it will redirect automatically: <script type="text/javascript"> <!-- window.location = "http://www.google.com/" //--> </script> This should be more universal
  2. Thanks man it worked perfectly. I didn't even know that such a thing as modulus exsisted (-__-) i need to go to college Hhaha, Thanks for your help my friend.
  3. Thanks for your reply man, im getting an error on $chunks = int($OrderWeight / 150); I think because int cant be used by itself like that. the error is saying its an undefined function ha. and presuming that that worked, now how would i print out however many chunks of 150 or less there are? something like an array and then a while (($i=0;$i<count($chunkarray);$i++)){echo "".$chunkarray[$i]."";}
  4. Hey guys, So i have a variable that i want to check. I want the script to check if a number is over 150 then break it down into multiple numbers each up to 150. so if the number is 900, there will be six chunks of 150. if the number is say 800, there will be 5 chunks of 150 and one chunk of 50. etc something like: <?php if($OrderWeight > 150){ $OrderWeight = explode("150", '$OrderWeight'); $i=0; while ($i < $OrderWeight) { $OrderWeight[$i]; } } else { } ?> Thanks Guys. I feel like this is a very simple equation, I'm just missing a simple php function
  5. hahahahaha adding overflow-x: hidden; into the body css fixed it. lmao
  6. also on different pcs with different resolutions, there will be space at the bottom and etc.
  7. Hey guys , so here's the problem, My main content in the page shows up but then theres extraneous scrolling to the right that has no content filled with the background color. its weird. heres a screenshot: and heres my css: body { margin: 0; padding: 0; background: #521f07; font-family: sans-serif; font-size: 12px; color: #000000; } .bgclouds{ background: #521f07 url(images/clouds.png) repeat-x left top; } /*Background Content*/ .top { background-image: url('images/top.png'); background-repeat: no-repeat; background-position: top center; } .wrapper { border:0; width:1000px; padding-left:185px; padding-right:185px; background-repeat: repeat-y; background-position:top center; } .footer{ background-image: url('images/footer.png'); background-repeat: no-repeat; background-position: bottom center; padding: 0px 0px 0px 0px; } /*End Background Content*/ .header { position: relative; padding-top: 75px; left: 180px; } .header img{ border:0; } a{ text-decoration: none; color: #4486C7; } a:hover { text-decoration: none; color: #3399FF; } #logo_banner { position: absolute; top: 60px; right: 10px; margin: 0px; } .topmenu { position: relative; height: 30px; padding: 0px; margin: 4px 0; overflow: hidden; } .topmenu li { float: left; list-style: none; } #border{ border-right: 1px solid #484848; } .topmenu li.back { background: url("images/lava.png") no-repeat right -30px; width: 9px; height: 30px; z-index: 8; position: absolute; } .topmenu li.back .left { background: url("images/lava.png") no-repeat top left; height: 30px; margin-right: 9px; /* 7px is the width of the rounded shape */ } .topmenu li a { font: bold 12px arial; text-decoration: none; color: #fff; outline: none; text-align: center; top: 7px; text-transform: uppercase; letter-spacing: 0; z-index: 10; display: block; float: left; height: 30px; position: relative; overflow: hidden; margin: auto 10px; } .topmenu li a:hover{ color:#0033FF; } .topmenu li a:active{ top:8px; } .topmenu li a:focus { top:8px; } #date { position: absolute; top: 48px; margin: 0px; color:#FFFFFF; } h1, h2, h3 { margin: 0; padding: 0; font-weight: normal; color: #FF0000; } h1 { font-size: 2em; font-family: Arial; } h2 { font-size: 2.4em; } h3 { font-size: 1.6em; } .post { margin-bottom: 15px; } .post-bgtop { } .post-bgbtm { } .post .title { height: 38px; border-bottom: 1px solid #E2E2E2; margin-bottom: 10px; padding: 12px 0 0 0px; letter-spacing: -.5px; color: #000000; } .post .title a { color: #32639A; border: none; } .post .meta { margin-bottom: 30px; padding: 5px 0px 15px 0px; text-align: left; font-family: Arial, Helvetica, sans-serif; font-size: 13px; font-weight: bold; } .post .meta .date { float: left; } .post .meta .posted { float: right; } .post .meta a { } .post .entry { padding: 0px 0px 20px 0px; padding-bottom: 20px; text-align: justify; } i know for a fact that its something with the .wrapper section because if i change the width of the wrapper to say 800px , most of the brown will go away but the wrapper image is 1000px wide , along with the .top and .footer images. idk ive been trying at it for a while now heres the makeup of the html body: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta name="keywords" content="squaredancing Square Dancing Paul Ingis PI Squared π2 - PI Squared" /> <meta name="description" content="PI Squared - Square Dance Calling. So why PI Squared? Well, my name is Paul Ingis. PI would be my initials. The squared is for..." /> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>π2 - PI Squared</title> <link href="style.css" rel="stylesheet" type="text/css" media="screen" /> <script type="text/javascript" src="js/jquery-1.1.3.1.min.js"></script> <script type="text/javascript" src="js/jquery.easing.min.js"></script> <script type="text/javascript" src="js/jquery.lavalamp.min.js"></script> <script type="text/javascript"> $(function() { $("#1, #2, #3").lavaLamp({ fx: "backout", speed: 700, click: function(event, menuItem) { return true; } }); }); </script> </head> <body> <div class="bgclouds"> <table border="0" cellpadding="0" cellspacing="0" align="center"> <tr> <td> <div class="top"> <div class="footer"> <!-- header --> <div class="header"> <!-- logo --> <a href="index.php" name="top"> <img src="images/logo.png" /> </a> <img src="images/squarelogo.png" style="padding-left:180px;" /> <div id="logo_banner"> </div> <!-- /logo --> <!-- date --> <p class="smallfont" id="date"> <script language="JavaScript" type="text/javascript"> var days = new Array(; days[1] = "Sunday"; days[2] = "Monday"; days[3] = "Tuesday"; days[4] = "Wednesday"; days[5] = "Thursday"; days[6] = "Friday"; days[7] = "Saturday"; var months = new Array(13); months[1] = "January"; months[2] = "February"; months[3] = "March"; months[4] = "April"; months[5] = "May"; months[6] = "June"; months[7] = "July"; months[8] = "August"; months[9] = "September"; months[10] = "October"; months[11] = "November"; months[12] = "December"; var dateObj = new Date(document.lastModified) var wday = days[dateObj.getDay() + 1] var lmonth = months[dateObj.getMonth() + 1] var date = dateObj.getDate() var fyear =+ dateObj.getFullYear() document.write(wday + ", " + date + " " + lmonth + " " + fyear) </script> </p> <!-- /date --> </div> <!-- navigation --> <table height="30px" border="0" width="745px" align="left" cellpadding="0" cellspacing="0" align="center" style=" padding-left:175px;"> <td> <ul class="topmenu" id="1"> <li><a href="index.php" class="current"><font color="#0033FF">Home</font></a></li> <li><a href="about.php">About</a></li> <li><a href="events.php">Events</a></li> <li><a href="videos.php">Videos</a></li> <li><a href="links.php">Links</a></li> <li><a href="contact.php">Contact</a></li> </ul> </td> </table> <!-- /navigation --> <!-- content table --> <!-- open content container --> <table class="wrapper" cellpadding="0" cellspacing="0" background="images/wrapper.png" > <tr> <td> <div> <div class="post"> <h2 class="title"><a>Square Dance Calling</a></h2> <p class="meta"><span class="date">October 18, 2009</span><span class="posted">Posted by <a>Paul Ingis</a></span></p> <div style="clear: both;"> </div> <div class="entry"> <p><b><big><a>So why PI Squared?</a></big></b> Well, my name is Paul Ingis. <i>PI</i> would be my initials. The "squared" is for Square Dancing. It’s that simple. I figured that out in third grade and have been waiting quite some time to use it. I finally found a way to do it.</p> <p>Square dancing is a relatively newly discovered activity for me. I love the way the rest of the world just melts away when I’m dancing.</p> <p>I took up calling because I wanted to be able to offer a class to Home Schooled families. I’m a Home School dad myself and felt like this would be something I had to offer to the Home School Sub-culture of which I’m a part. </p> <p>Little did I know that I would enjoy the calling so much that I would also want to call to clubs and private parties. Even though I’m a relatively new caller, I’ve had many opportunities to work with both experienced and inexperienced dancers. The feedback has been very positive and encouraging, so I figure, what the heck, I’m going to keep trucking along.</p> <p>If you are interested in having me call a dance or party, please drop me a line either via e-mail or phone.<br>Please visit our <a href="contact.php">Contact</a> page for more information.</p> </div> </div> </div> </td> </tr> </table> <!--footer--> <div> <div style="padding-left:202.5px; padding-top:90px;"> Paul Ingis <br> 201-664-1105 <br> <a href="mailto:[email protected]">Email Me</a> </div> <div align="center" style="padding-top:35px;"> <font color="green"> Copyright © 2009 <a href="http://ingis.com/squaredancing">Paul Ingis</a>. All rights reserved. <br> Layout & Design by <a href="http://ingis.com/squeaky-squash/info.php">Chris Ingis</a>.</p> </font> </div> </div> </div> <!--/footer--> </td> </tr> </table> </div> </div> </body> </html>
  8. hey i figured out the problem. its actualy simply the overflow-x:hidden; part that wasnt allowing the rest of it to flow. i moved the div styles to the stylesheet anyway to clear things up a bit. I dont realy need the overflow-x:hidden; tag because if u use overflow:auto; then it works just as well. thanks problem solved
  9. Hey guys so i have a top menu in js and a calendar in js and for some reason they wont both work at the same time. if i have the calendar and top menu, only the calendar loads but when i take the calendar out, the top menu will work. prob because they both use the same calling functions somewhere? so i was thinking maybe since the javascript for the top menu comes before the calendar, maybe we could divide them in some way? ive already separated it so that the calendar script refs and etc come after the top menu ends and the js references for the top menu are in the header. heres my script : <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta name="keywords" content="" /> <meta name="description" content="" /> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>p2 - PI Squared</title> <link href="style.css" rel="stylesheet" type="text/css" media="screen" /> <script type="text/javascript" src="js/jquery-1.1.3.1.min.js"></script> <script type="text/javascript" src="js/jquery.easing.min.js"></script> <script type="text/javascript" src="js/jquery.lavalamp.min.js"></script> <script type="text/javascript"> $(function() { $("#1, #2, #3").lavaLamp({ fx: "backout", speed: 700, click: function(event, menuItem) { return true; } }); }); </script> </head> <body> <div id="wrapper"> <div id="header"> <div id="logo" width="100%"> <h1><a href="index.php"><img src="images/logo.png" border="0" style="position:relative; bottom:20px;" /></a></h1> <img src="images/squarelogo.png" align="right" style="position:relative; bottom:0px; left:50px;" /> </div> </div> <!-- end #header --> <div> <ul class="topmenu" id="1"> <li><a href="index.php">Home</a></li> <li><a href="links.php">Links</a></li> <li class="current"><a href="contact.php"><font color="#3399FF">Contact</font></a></li> </ul> </div> <!-- end #menu --> <div id="page"> <div id="page-bgtop"> <div id="page-bgbtm"> <div id="content"> <div class="post"> <h2 class="title"><a>Calendar</a></h2> <div style="clear: both;"> </div> <div class="entry"> <script src="js/lib/prototype.js" type="text/javascript"></script> <script src="js/src/scriptaculous.js" type="text/javascript"></script> <script type="text/javascript"> function highlightCalendarCell(element) { $(element).style.border = '1px solid #999999'; } function resetCalendarCell(element) { $(element).style.border = '1px solid #000000'; } function startCalendar(month, year) { new Ajax.Updater('calendarInternal', 'rpc.php', {method: 'post', postBody: 'action=startCalendar&month='+month+'&year='+year+''}); } function showEventForm(day) { $('evtDay').value = day; $('evtMonth').value = $F('ccMonth'); $('evtYear').value = $F('ccYear'); displayEvents(day, $F('ccMonth'), $F('ccYear')); if(Element.visible('addEventForm')) { // do nothing. } else { Element.show('addEventForm'); } } function displayEvents(day, month, year) { new Ajax.Updater('eventList', 'rpc.php', {method: 'post', postBody: 'action=listEvents&&d='+day+'&m='+month+'&y='+year+''}); if(Element.visible('eventList')) { // do nothing, its already visble. } else { setTimeout("Element.show('eventList')", 300); } } function addEvent(day, month, year, body) { if(day && month && year && body) { // alert('Add Event\nDay: '+day+'\nMonth: '+month+'\nYear: '+year+'\nBody: '+body); new Ajax.Request('rpc.php', {method: 'post', postBody: 'action=addEvent&d='+day+'&m='+month+'&y='+year+'&body='+body+'', onSuccess: highlightEvent(day)}); $('evtBody').value = ''; } else { alert('There was an unexpected script error.\nPlease ensure that you have not altered parts of it.'); } // highlightEvent(day); } // addEvent. function highlightEvent(day) { Element.hide('addEventForm'); $('calendarDay_'+day+'').style.background = '#<?= $eventColor ?>'; } function showLoginBox() { Element.show('loginBox'); } function showCP() { Element.show('cpBox'); } function deleteEvent(eid) { confirmation = confirm('Are you sure you wish to delete this event?\n\nOnce the event is deleted, it is gone forever!'); if(confirmation == true) { new Ajax.Request('rpc.php', {method: 'post', postBody: 'action=deleteEvent&eid='+eid+'', onSuccess: Element.hide('event_'+eid+'')}); } else { // Do not delete it!. } } </script> <div id="calendar" class="calendarBox"> <div id="calendarInternal"> </div> <br style="clear: both;"> <span id="LoginMessageBox" style="color: red; margin-top: 10px;"><?= $loginMsg; ?></span> <div id="eventList" style="display: none;"></div> <div style="display: none; margin-top: 10px;" id="addEventForm"> <b>Add Event</b> <br> Date: <input type="text" size="2" id="evtDay" disabled> <input type="text" size="2" id="evtMonth" disabled> <input type="text" size="4" id="evtYear" disabled> <br> <textarea id="evtBody" cols="32" rows="5"></textarea> <br> <input type="button" value="Add Event" onClick="addEvent($F('evtDay'), $F('evtMonth'), $F('evtYear'), $F('evtBody'));"> <a href="#" onClick="Element.hide('addEventForm');">Close</a> </div> <div style="display: none; margin-top: 10px;" id="loginBox"> <b>Login</b> <br> <form action="calendar.php" method="post"> Username: <input type="text" name="username" size="20"> <br> Password: <input type="password" name="password" size="20"> <br> <input type="hidden" name="action" value="login"> <input type="submit" value="Login"> <a href="#" onClick="Element.hide('loginBox');">Close</a> </form> </div> <div style="display: none; margin-top: 10px;" id="cpBox"> <b>Control Panel</b> <a href="#" onClick="Element.hide('cpBox');">Close</a> <br><br> <b>Change the colours</b> <br> <form action="calendar.php" method="post"> Day Colour: <input type="text" name="dayColor" size="6" maxlength="6" value="<?= $dayColor; ?>"> <br> Weekend Colour: <input type="text" name="weekendColor" size="6" maxlength="6" value="<?= $weekendColor; ?>"> <br> Today Colour: <input type="text" name="todayColor" size="6" maxlength="6" value="<?= $todayColor; ?>"> <br> Event Colour: <input type="text" name="eventColor" size="6" maxlength="6" value="<?= $eventColor; ?>"> <br> Iterator 1 Colour: <input type="text" name="iteratorColor1" size="6" maxlength="6" value="<?= $iteratorColor2; ?>"> <br> Iterator 2 Colour: <input type="text" name="iteratorColor2" size="6" maxlength="6" value="<?= $iteratorColor1; ?>"> <br> <input type="hidden" name="action" value="updateColours"> <input type="submit" value="Update Colours"> </form> <br> <form action="calendar.php" method="post"> <input type="hidden" name="action" value="updatePassword"> <b>Change your password</b> <br> New Password: <input type="password" name="password1" size="20"> <br> Confirm it: <input type="password" name="password2" size="20"> <br> <input type="submit" value="Update Password"> </form> <br><br> <b>Logout</b> <form action="calendar.php" method="post"> <input type="hidden" name="action" value="logout"> <input type="submit" value="logout"> </form> </div> </div> <!-- FINAL DIV DO NOT REMOVE --> <script type="text/javascript"> startCalendar(0,0); </script> </div> </div> <div style="clear: both;"> </div> </div> <!-- end #content --> <!-- end #sidebar --> <div style="clear: both;"> </div> </div> </div> </div> <!-- end #page --> </div> <div id="footer"> <p>Paul Ingis <br>201-664-1105 <br><a href="mailto:[email protected]">[email protected]</a> <br>Copyright © 2009 <a href="http://ingis.com/squaredancing">Paul Ingis<a/>. All rights reserved. Design by <a href="http://ingis.com/squeaky-squash/info.php">Chris Ingis</a>.</p> </div> <!-- end #footer --> </body> </html> thanks guys
  10. not a bad idea/ ill look into it. thanks
  11. DBMS= database management system? i am using mysql for the website but mysql doesnt store images but i think i know what you mean. thanks for all your help Solved
  12. yep your right i was missing 1 slash after the directory name haha thank you so much thats a very big help. 1 last thing/ would you happen to know how to make them group into pages of say 15 for example? wouldnt want extraneous images making the page miles long
  13. yeah i would like the overflow to scroll once it reaches over 204 px. i tried it out but it didnt seem to work :/ isnt that weird?
  14. hey thats a great start but when i tried it , it only jumped to teh print function and tells me the amount of images there are in the directory. lol maybe the img src part is wrong? it deffinately sees the correct directory tho in order to tell how many images.
  15. thats a pretty good resource actually. i think i have most of what i need already in the above script. i think i just need a simple script that shoots out however many images are there. something like : if(!empty($images)) { $rand_key = array_rand($images, !); $src = $images[$rand_key]; echo " <a id='thumb1' href='".$src."' class='highslide' onclick='return hs.expand(this)'> <img src='".$src."' align='absmiddle' width='100' height='100' border='2px'></a> </a>"; } would that work? sorry im very new at php
  16. I was wondering if it was possible and if anyone knew how to make a simple php script that looks at one specified directory and makes <img src="*.*" \> type links out of it? ive got a very nice javascript type image viewer but i cant seem to get it to show every image. and the next step would be getting it to view like 10 images per page but i havent gotten to the time that i need to figure that out yet lol. anyone have any ideas? this is what i have but i would like it to show more than 2 images lol: $extensions = array('jpg','jpeg','gif','png','bmp'); // images folder $images_folder_path = 'images/screenshots/'; // url to folder $url_to_folder = 'http://ingis.com/butsagsms/images/screenshots/'; // Images Array (SRC value) $images = array(); srand((float) microtime() * 10000000); // IF PHP Version < 4.2.0 // Open directory and read images if ($handle = opendir($images_folder_path)) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { // get file extension $ext = strtolower(substr(strrchr($file, "."), 1)); if(in_array($ext, $extensions)) { $images[] = $url_to_folder.$file; } } } closedir($handle); } if(!empty($images)) // Do we have something to show? { $rand_key = array_rand($images, 1); $src = $images[$rand_key]; echo " <a id='thumb1' href='".$src."' class='highslide' onclick='return hs.expand(this)'> <img src='".$src."' align='absmiddle' width='100' height='100' border='2px'></a> </a>"; // Show second image; Make sure it will not be the same as the first one; We will remove the element of the first image from the array. This way the script will not reselect it unset($images[$rand_key]); $rand_key = array_rand($images, 1); $src = $images[$rand_key]; echo " <a id='thumb2' href='".$src."' class='highslide' onclick='return hs.expand(this)'> <img src='".$src."' align='absmiddle' width='100' height='100' border='2px' style='padding-left:3px;'> </a>"; } else { echo '<small>No images found</small>'; } if i set the array to say 6 and then i dont have 6 images , ill get a error so is there a way to present as many images as are in the directory?
  17. Hey guys. to clear things up, this is in php but its mostly html and the error I am having is the html functioning so I figured it was fit for the html section. If I was wrong in putting it in this board then by all means move it to the correct section and I am gratefully sorry. Okay now that thats cleared up, here's whats going on: I have a page and I would like it to start scrolling one it goes beyond a height of 204. here's the script: <table background=\"images/items.png\" width=177 height=289 style=\" padding-top: 22px; background-repeat: no-repeat;\"> <tr> <td style=\"padding-top: 2px; padding-left: 4px; \" valign=\"top\">"; $queryz = mysql_query("SELECT * FROM inventoryitems WHERE characterid = '$id' AND inventorytype = 1 AND quantity != 0");// Account section echo " <DIV id=\"tabcontent1\" style=\"MARGIN-LEFT: 0px; MARGIN-RIGHT:0px; OVERFLOW-X: hidden; OVERFLOW: auto; HEIGHT: 204;\"> <table cellspacing=0 cellpadding=0 border=0> <tr>"; while($row = mysql_fetch_array($queryz)){ $item = $row[itemid]; if ($p%4==0 AND $p>=3) { echo " </tr> <tr>"; } else { } echo " <td background=\"images/bgitem.jpg\" width=36 height=34 align=\"center\"> <img src=\"http://www.mapletip.com/images/maplestory-monsters/0$item.png\" style=\"max-width:36px; max-height:34px;\" alt=\" \"> </td>"; $p++; } echo " </tr> </table> </div>"; As you can see, I am trying to get the content located in the <div> tags to scroll . it doesn't necessarily have to be div tags or anything as long as the scroll works and the content lays inside still anyone have any ideas?
  18. yes i do. i have 4.4.9 okay so its the fact of my php version. thanks so much. all i have 2 do is update my php then. good thatll be easy
  19. Hey guys. So this is mostly my host's fault but, I got most of a website with a login feature as a cms template. it uses a hash function with sha512. the login feature works great on wampserver(hosting from my windows pc) but when i put it onto my domain, it gives a error when loging in: Fatal error: Call to undefined function: hash() in login.php on line 127 here's the source: if(isset($_POST['login'])) { $u = mysql_real_escape_string(stripslashes($_POST['username'])); $p = mysql_real_escape_string(stripslashes($_POST['password'])); $s = mysql_query("SELECT * FROM `accounts` WHERE `name`='".$u."'") or die(mysql_error()); $i = mysql_fetch_array($s); /*this is line 127*/ if($i['password'] == hash('sha512',$p.$i['salt']) || sha1($p) == $i['password']){ $userz = mysql_query("SELECT * FROM `accounts` WHERE `name`='".$i['name']."' AND `password`='".$i['password']."'") or die(mysql_error()); $auser = mysql_fetch_array($userz); $_SESSION['id'] = $auser['id']; $_SESSION['name'] = $auser['name']; $_SESSION['mute'] = $auser['mute']; if($auser['webadmin'] == "1"){ $_SESSION['admin'] = $auser['webadmin']; } $gmammt = $gmlevel - 1; if($auser['gm'] > $gmammt){ $_SESSION['gm'] = $auser['gm']; } $name = mysql_query("SELECT * FROM `butsags_profile` WHERE `accountid`='".$auser['id']."'") or die(mysql_error()); $pname = mysql_fetch_array($name); if($pname['name'] == NULL){ $_SESSION['pname'] = NULL; }else{ $_SESSION['pname'] = $pname['name']; } $return = "<meta http-equiv=refresh content=\"0; url=?butsags=misc&script=redir\">"; } else { $return = "<p><center>Invalid username or password.</center>"; } } Okay so i went to my domain hoster and i asked them whats up and they told me hashing is enabled and to use echo hash("md5","asdasd"); does anyone know how to implement using md5 instead of sha512? i tried swaping them but it still gives me errors.. hmmm
  20. thanks so much man ive been working on this dang script for like 2 freaking days just trying random combinations haah it works great
  21. hey alright i am trying to find out if there is a row with the characteristics defined in $query. and the if /else statement has to specify that if there is a row with inventorytype = -1 and position = -101 then output this: { echo "<img src=\"http://www.mapletip.com/images/maplestory-monsters/0$equipt.png\">"; } but if it cannot find a row with those characteristics then start: { echo "<img src='http://ingis.com/butsagsms/images/none.png'>"; } sorry if i threw you off in any way.
  22. also in mysql 'query amount' isnt one of my columns unless this is a function to get the amount which i dont think it is?
  23. hey there alright so i tried adding it in as you specified and it wasnt showing up either the none image or the other image. so i played around with it and i got the first image to show up: $query = mysql_query("SELECT * FROM inventoryitems WHERE characterid = '$id' AND inventorytype = -1 AND position = -101"); while($row = mysql_fetch_array($query)) { $equipt = $row[itemid]; if ($row['query amount'] = 1) { echo "<img src=\"http://www.mapletip.com/images/maplestory-monsters/0$equipt.png\">"; } else { echo "<img src=\"http://ingis.com/butsagsms/images/none.png\">"; } } sorry i formatted it a little differently in a few sections to see if that as why it wasnt working. adding if ($row['query amount'] = 1) fixed the first image but when i change this : $query = mysql_query("SELECT * FROM inventoryitems WHERE characterid = '$id' AND inventorytype = -1 AND position = -101"); to this: $query = mysql_query("SELECT * FROM inventoryitems WHERE characterid = '$id' AND inventorytype = -1 AND position = -2"); it doesnt bring up the none.png this SHOULD bring up the second image because the query amount is none then. but it doesnt. so i then thought it was the link to the second image so i direct linked it. if you put the link in your browser you can see it works. if it helps at all, the page im working with is here: http://ingis.com/butsagsms/?butsags=main&page=player&name=cygnushero i have it set to position = -101 so as you can see the "hat" image comes up (look to the equipment inventory image) ------------EDIT----------------- ok i was fooling around further and when i change if ($row['query amount'] = 1) to if ($row['query amount'] > 0) the none image shows up. so i think the problem lies in that row. so i think that the problem is that in that row, i think we need to specify that if the query amount is 1 then the first image shows and if its 0 then the none.png shows any ideas?
  24. Okay so i has a start already. $query = mysql_query("SELECT * FROM inventoryitems WHERE characterid = '$id' AND inventorytype = -1 AND position = -101"); while($row = mysql_fetch_array($query)){ $equipt = $row[itemid]; echo " <img src=\"http://www.mapletip.com/images/maplestory-monsters/0$equipt.png\">"; } I would like to somehow say, if there is no item that qualifies the specifications of $query , then to show <img src="images/none.png"> sorry i barely know any mysql implementing i guess it would have to be something like IF $query amount > 0 { echo " <img src=\"http://www.mapletip.com/images/maplestory-monsters/0$equipt.png\"> "; } else { echo " <img src=\"images/none.png\">"; } but i just don't know how to correctly say that. I would be extremely grateful for any help. thanks
×
×
  • 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.