
Darkmatter5
Members-
Posts
422 -
Joined
-
Last visited
Never
Profile Information
-
Gender
Not Telling
Darkmatter5's Achievements

Advanced Member (4/5)
0
Reputation
-
I have 3 fields in a table called allo_hp, allo_mp and allo_mp and I'm wanting to add up the numbers in each of those fields and have that sumed result aliased out as total. How can I go about doing that?
-
Here's my css code: #pc_toolbar_cell { -moz-opacity: 0.25; filter: alpha(opacity=25); opacity: .25; background-image: url(../images/nuclear.png); background-repeat: no-repeat; background-position: center; } <th width='25%' height='100' id='pc_toolbar_cell'>test</th> This makes the background semi-transparent, but also makes the text semi-transparent. How can I make the opacity stuff only affect the background image and NOT the content of the <th>??
-
Here's my code: $query="SELECT CONCAT_WS(' ', dpc.forename, dpc.surname) AS name, dc.class, dpc.class_level AS level FROM d_player_characters AS dpc INNER JOIN d_classes AS dc ON dc.class_id=dpc.class_id WHERE dpc.owner_id='$id' ORDER BY dpc.class_id ASC, surname ASC"; $result=mysql_query($query) or die(mysql_error()); while($row=mysql_fetch_array($result)) { echo "<th width='25%'>$row[name]</th>"; } /*$row=mysql_fetch_array($result); for($i=0;$i<=3;$i++) { if(!is_null($row[$i])) { echo "<th width='25%' height='60'>$row[name]<br>a $row[level] level<br>$row[class] character</th>"; } else { echo "<th width='25%' height='60'><span class='large_text'><a href='$parent_url/create_pc.php'>Create a new Player Character</a></span></th>"; } }*/ The above code produces the list of names, but the below code only lists the first array element, but does in fact list it 4 times, so how can I use the for loop to get all the data like the while loop does? $query="SELECT CONCAT_WS(' ', dpc.forename, dpc.surname) AS name, dc.class, dpc.class_level AS level FROM d_player_characters AS dpc INNER JOIN d_classes AS dc ON dc.class_id=dpc.class_id WHERE dpc.owner_id='$id' ORDER BY dpc.class_id ASC, surname ASC"; $result=mysql_query($query) or die(mysql_error()); //while($row=mysql_fetch_array($result)) { echo "<th width='25%'>$row[name]</th>"; } $row=mysql_fetch_array($result); for($i=0;$i<=3;$i++) { if(!is_null($row[$i])) { echo "<th width='25%' height='60'>$row[name]<br>a $row[level] level<br>$row[class] character</th>"; } else { echo "<th width='25%' height='60'><span class='large_text'><a href='$parent_url/create_pc.php'>Create a new Player Character</a></span></th>"; } } So the while loop will produce this: <th width='25%'>John Smith</th> <th width='25%'>Joe Blow</th> <th width='25%'>Jane Smith</th> The for loop produces this: <th width='25%' height='60'>John Smith<br>a 1 level<br>Strong character</th> <th width='25%' height='60'>John Smith<br>a 1 level<br>Strong character</th> <th width='25%' height='60'>John Smith<br>a 1 level<br>Strong character</th> <th width='25%' height='60'><span class='large_text'><a href='$parent_url/create_pc.php'>Create a new Player Character</a></span></th> Why doesn't the for loop produce this: <th width='25%' height='60'>John Smith<br>a 1 level<br>Strong character</th> <th width='25%' height='60'>Joe Blow<br>a 1 level<br>Strong character</th> <th width='25%' height='60'>Jane Smith<br>a 1 level<br>Strong character</th> <th width='25%' height='60'><span class='large_text'><a href='$parent_url/create_pc.php'>Create a new Player Character</a></span></th>
-
Thanks friend!
-
Here's the relevant portion of my code. <tr> <td class="row_title"> Numerical listing of job numbers in <form method="get" action="reports/rep_Njobnumber-year.php"> <select name="year"> <option value="-84">84</option> <option value="-85">85</option> <option value="-86">84</option> <option value="-87">87</option> <option value="-88">88</option> <option value="-89">89</option> <option value="-90">90</option> <option value="-91">91</option> <option value="-92">92</option> <option value="-93">93</option> <option value="-94">94</option> <option value="-95">95</option> <option value="-96">96</option> <option value="-97">97</option> <option value="-98">98</option> <option value="-99">99</option> <option value="-00">00</option> <option value="-01">01</option> <option value="-02">02</option> <option value="-03">03</option> <option value="-04">04</option> <option value="-05">05</option> <option value="-06">06</option> <option value="-07">07</option> <option value="-08">08</option> <option value="-09">09</option> </select> <input type="submit" value="Submit"> </form> </td> <td class="row_title" align="center">-</td> <td class="row_title" align="center">-</td> </tr> When I click the submit button it does nothing. What's going on?
-
Here's my code: The variables "$imagesml, $imagelrg and $imagesys are all created above this code. if(file_exists("$imagesml")) { $imagesmla="The file $imagesml exists"; } else { $imagesmla="The file $imagesml does not exist"; } if(file_exists("$imagelrg")) { $imagelrga="The file $imagelrg exists"; } else { $imagelrga="The file $imagelrg does not exist"; } if(file_exists("$imagesys")) { $imagesysa="The file $imagesys exists"; } else { $imagesysa="The file $imagesys does not exist"; } <table> <tr><td>imagesml: <?php echo $imagesml; ?><br>imagelrg: <?php echo $imagelrg; ?><br>imagesys: <?php echo $imagesys; ?></td></tr> <tr><td>imagesmla: <?php echo $imagesmla; ?><br>imagelrga: <?php echo $imagelrga; ?><br>imagesysa: <?php echo $imagesysa; ?></td></tr> </table> Here's the output from that code: imagesml: http://www.thealienhive.com/facebook/ent-trader/images/logos/i101-small.png imagelrg: http://www.thealienhive.com/facebook/ent-trader/images/logos/i101-full.png imagesys: http://www.thealienhive.com/facebook/ent-trader/images/logos/icon-256 360.png imagesmla: The file http://www.thealienhive.com/facebook/ent-trader/images/logos/i101-small.png does not exist imagelrga: The file http://www.thealienhive.com/facebook/ent-trader/images/logos/i101-full.png does not exist imagesysa: The file http://www.thealienhive.com/facebook/ent-trader/images/logos/icon-256 360.png does not exist If you copy and paste the links you'll see they do in fact exist. This is a Facebook application, but the PHP code is all resides on the same location as the image files being checked for. What might I be doing wrong?
-
Thanks, worked great!
-
Here's my Javascript function disablefield(form,element) { if(element='att_pc') { document.form.att_npc.disabled=true; document.form.att_beast.disabled=true; } elseif(element='att_npc') { document.form.att_pc.disabled=true; document.form.att_beast.disabled=true; } elseif(element='att_beast') { document.form.att_pc.disabled=true; document.form.att_npc.disabled=true; } } Here's the HTML <form method='get' name='simcombat' action='http://mysite/simcombat.php?ta=20'> <table border='0' bgcolor='#D2B48C'> <tr><th colspan='4'>Combat simulator</th></tr> <tr><th> </th><th>Player characters</th><th>Nonplayer characters</th><th>Beasts</th></tr> <tr> <td align='right'>Attacker:</td> <td align='center'> <select name='att_pc' onchange='disablefield(this.form,this.name)'> <option value='0'>--SELECT--</option> <option value='13'>a b</option> <option value='2'>Joe Blow</option> </select> </td> <td align='center'> <select name='att_npc'> <option value='0'>--SELECT--</option> <option value='2'>Joe Bloe</option> <option value='1'>John Smith</option> </select> </td> <td align='center'> <select name='att_beast'> <option value='0'>--SELECT--</option> <option value='4'>Cat</option> <option value='3'>Rat</option> </select> </td> </tr> <tr><th colspan='4'><input type='submit' name='submit' value='Simulate combat'></th></tr> <table> </form> I'm basically wanting to disable all form elements besides the element changed. I know my usage of "this" is incorrect. Please help!
-
I've heard to accomplish sending array variables from page to page in PHP, you need to use serialize() and unserialize(). Is this try? Here's my example. Imagine in one page I generate an array $names[]. It contains a list of names obviously. How do I use serialize() and unserialize() to pass this array from page to page so I can later use a loop to display each element of the array? Thanks!
-
Here's the CSS #wrap { width: 95%; position: relative; padding: 0 5px 0 5px; margin: 0 auto; background-color: #FFFFFF; } #header { /*position: relative;*/ height: 70px; width: 100%; background-color: aqua; } #status { height: 100px; width: 100%; background-color: blue; } #navcontainer { line-height: 2.5em; height: 30px; width: 100%; background-color: fuchsia; } #content { /*padding: 1em;*/ max-width: 100%; min-height: 200px; position: relative; background-color: green; } #left_menu { width: 200px; min-height: 100%; float: left; background-color: red; } #right_menu { width: 200px; min-height: 100%; float: right; background-color: aqua; } .profile { width: 200px; margin: 0 auto; background-color: lime; } Here's the HTML <div id="wrap"> <div id="header">header</div> <div id="status">status</div> <div id="navcontainer"><?php //$wm->user_rights($page); ?></div> <div id="content"> <div id="left_menu">MENU</div> <?php $wm->list_profiles(); ?> <div id="right_menu">MENU</div> </div> </div> Here's the PHP for list_profiles(); function list_profiles() { $result=mysql_query("SELECT * FROM profiles ORDER BY name ASC") or die(mysql_error()); //$row=mysql_fetch_array($result); $count=mysql_num_rows($result); switch ($count) { case 0: echo "<div class='profile'>ZERO</div>"; break; case 1: echo "<div class='profile'>ONE</div>"; break; case 2: echo "<div class='profile'>TWO</div>"; break; } } I'm wanting to get the left_menu, profile and right_menu divs to all be aligned, but if I apply "style='display: inline;" to the profile div, it makes the profile div not centered and forces it against the left_menu div, but the three divs are inline. If I render with the code as is, the right_menu div renders down a line. Help please!
-
Help with a generated select list being rendered where it should be
Darkmatter5 replied to Darkmatter5's topic in HTML Help
Thank you for all your suggestions I got it working. -
Here's the dropdown menu code I wrote. <?php function dropdown($name,$select,$default,$onchange) { $id=$name. "_id"; echo "<select name='$name' class='text_boxes'"; if(isset($onchange)) { echo " onchange='$onchange(this.value)'"; } echo "><option value='0'>--SELECT--</option>"; $query=mysql_query($select) or die(mysql_error()); while($row=mysql_fetch_array($query)) { $r1=$row[$id]; $r2=$row[$name]; if($r1==$default) { echo "<option value='$r1' selected='selected'>$r2</option>"; } else { echo "<option value='$r1'>$r2</option>"; } } echo "</select>"; } ?> Here's the code that calls this function. <table width='100%' cellpadding='3' style='border-collapse: collapse; border: 2px solid black;' border='0'> <tr><th colspan='2' style='font-size: 16px; font-weight: bold;'>Profile</th></tr> <form method='post' action='$url/library/scripts/siteadmin_t1.php'> <input type='hidden' name='id' value='$row[member_id]'> <tr><td width='100' align='right'><b>Username:</b></td><td><input type='text' name='username' value='$row[mem_username]'></td></tr> <tr><td align='right'><b>Firstname:</b></td><td><input type='text' name='firstname' value='$row[mem_firstname]'></td></tr> <tr><td align='right'><b>Lastname:</b></td><td><input type='text' name='lastname' value='$row[mem_lastname]'></td></tr> <tr><td align='right'><b>Email:</b></td><td><input type='text' name='email' value='$row[mem_email]'></td></tr> <tr><td align='right'><b>Activation code:</b></td><td>$row[activation_code]</td></tr> <tr><th colspan='2'><hr></th></tr> <tr><th colspan='2'>Privileges</th></tr> <tr><th colspan='2'>Site Admin:<input type='checkbox' name='siteadm' value='" .($row['priv_admin']==1?"1' checked='checked'":"0'"). "> News Admin:<input type='checkbox' name='newsadm' value='" .($row['priv_news']==1?"1' checked='checked'":"0'"). "><br>Forums Admin:</b><input type='checkbox' name='forumsadm' value='" .($row['priv_forums']==1?"1' checked='checked'":"0'"). "> Game Master:</b><input type='checkbox' name='gm' value='" .($row['priv_gm']==1?"1' checked='checked'":"0'"). "></th></tr> <tr><th colspan='2'><hr></th></tr> <tr><th colspan='2'>Preferences</th></tr> <tr><td align='right'><b>Theme:</b></td><td>" .$rpgbuilder->dropdown(theme,'SELECT * FROM themes ORDER BY theme ASC',4,''). "</td></tr> <tr><td align='right'><b>Rows per page:</b></td><td><input type='text' name='rows' size='2' value='$row[rowsperpage]'></td></tr> <tr><th colspan='2'><input type='submit' value='Submit'></th></tr> </form> </table> Attached is a screenshot of how it's being rendered. Why's it rendering outside the table? [attachment deleted by admin]
-
Here's the part of the URL "res_site-admin.php?ta=21&id=8" Here's the php code <?php $t=substr($_GET['ta'],0,1); $a=substr($_GET['ta'],1,2); if(isset($_GET['ta'])) { $even="#D2B48C"; $odd="#FFDEAD"; $rowtog=0; if($t==1) { echo "<table class='notice'><tr><td width='40' align='right'><b>Notices:</b></td><td>"; if(isset($_GET['er'])) { $er=$_GET['er']; if($er==1) { echo "User successfully edited!"; } elseif($er==2) { echo "User successfully deleted!"; } elseif($er==3) { echo "User successfully added!"; } } else { echo " "; } echo "</td></tr></table> <p class='section_text'>User management</p>"; } elseif($t==2) { include("$url/pages/siteadmin_t2.php"); } } else { echo "<span class='notice_text'>Choose a task above</span>"; } ?> Now in siteadmin_t2.php I have the following code <?php if(isset($_GET['id'])) { echo " value='" .$rpgbuilder->getdata("SELECT title FROM news WHERE article_id='$_GET[id]'"). "'"; } ?> but, $_GET['id'] doesn't seem to be present for siteadmin_t2.php to use. So in the include how can I ensure the URL variables are available to siteadmin_t2.php?
-
Help with table data overflowing outside it's containing div
Darkmatter5 replied to Darkmatter5's topic in CSS Help
I got it working with this code: <div id='roundedBox' class='roundedBox' style='float: right; width: 200px; padding: 0 1em 0 1em;'> <table width='100%' height='100%' cellpadding='2' cellspacing='0' border='0'> <tr><th style='border-bottom: 2px groove #F0FFF0;'>CHARACTER SHEET HELP </th></tr> <tr valign='top'><td height='200'> <div style='overflow-y: auto; height: 200px;'> <b>Acronyms</b> <ol> <li>Bon = Bonus</li> <li>Cha = Charisma</li> <li>Con = Constitution</li> <li>Dex = Dexterity</li> <li>Equip = Equipment</li> <li>Int = Intelligence</li> <li>Misc = Miscellaneous</li> <li>Mod = Modifier</li> <li>Pen = Penalty</li> <li>Str = Strength</li> <li>Wis = Wisdom</li> <li>Wis = Wisdom</li> <li>Wis = Wisdom</li> <li>Wis = Wisdom</li> <li>Wis = Wisdom</li> <li>Wis = Wisdom</li> <li>Wis = Wisdom</li> <li>Wis = Wisdom</li> <li>Wis = Wisdom</li> <li>Wis = Wisdom</li> </ol> </div> </td></tr> </table> <div class='corner topLeft'></div> <div class='corner topRight'></div> <div class='corner bottomLeft'></div> <div class='corner bottomRight'></div> </div>