Jump to content

Darkmatter5

Members
  • Posts

    422
  • Joined

  • Last visited

    Never

Posts posted by Darkmatter5

  1. 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>??

  2. 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>

  3. 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?

  4. 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?

  5. 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!

  6. 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!

  7. 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!

  8. 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]

  9. 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?

     

  10. 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>
    

  11. Removing max-height makes the div grow as new contents is added, I need it fixed to grow no more then 200.  Adding overflow-y: scroll to the div produces a scroll bar, but I need the scroll bar to be in the <td> tag of the table, not the div.

     

    Attached is a screen of the following code

    "<div id='roundedBox' class='roundedBox' style='float: right; width: 200px; padding: 0 1em 0 1em; overflow-y: scroll;'>"

     

    How can I only scroll within the <td>?

     

    [attachment deleted by admin]

  12. Here's my code

    <div id='roundedBox' class='roundedBox' style='float: right; width: 200px; padding: 0 1em 0 1em; max-height: 200px;'>
      <table width='100%' height='100%' cellpadding='2' cellspacing='0' border='0' style='table-layout: fixed;'>
        <tr><th style='border-bottom: 2px groove #F0FFF0;'>CHARACTER SHEET HELP </th></tr>
        <tr valign='top'><td style='overflow-y: auto;'>                      
          <ol>Acronyms
            <li>Str: Strength</li>
            <li>Dex: Dexterity</li>
            <li>Con: Constitution</li>
            <li>Int: Intelligence</li>
            <li>Wis: Wisdom</li>
            <li>Cha: Charisma</li>
            <li>Mod: Modifier</li>
            <li>Equip: Equipment</li>
            <li>Equip: Equipment</li>
            <li>Equip: Equipment</li>
            <li>Equip: Equipment</li>
            <li>Equip: Equipment</li>
            <li>Equip: Equipment</li>
            <li>Equip: Equipment</li>
            <li>Equip: Equipment</li>
            <li>Equip: Equipment</li>
            <li>Equip: Equipment</li>
            <li>Equip: Equipment</li>
            <li>Equip: Equipment</li>
          </ol>
        </td></tr>
      </table>
      <div class='corner topLeft'></div>
      <div class='corner topRight'></div>
      <div class='corner bottomLeft'></div>
      <div class='corner bottomRight'></div>
    </div>
    

     

    Thanks in advance!

     

    [attachment deleted by admin]

  13. Can you clarify your first sentence?

    "Since you don't define the padding (or margin) for "content", they're set as that div's content area."

     

    As per the CSS code:

    #content { padding: 1em; width: 75%; position: relative; }

    I thought I was defining the padding for "content".  My intention is to have a 1em padding for Content and anything within content, should conform to that padding and not render passed that padding.

     

    Thanks for the help!

  14. I have the following items in my CSS

     

    #wrap { width: 1000px; position: relative; padding: 0 5px 0 5px; margin: 0 auto; background-color: #FFFFFF; }

    #content { padding: 1em; width: 75%; position: relative; }

    .status { width: 100%; padding: 5px; border-style: double; border-color: #A9A9A9; }

     

    Here's my HTML

    <div id="wrap">
      <div id="content" style="float: left;">
        <div class='status'>test</div>
      </div>
    </div>
    

     

    The resulting render in the browser has the status div pushing to the edge of content, but not obeying the padding of content. Why not?

  15. Here's the query

    SET SESSION SQL_BIG_SELECTS=1;
    SELECT CONCAT(forename,' ',surname) AS name, c.class, pc.abil_strength AS str, pc.abil_dexterity AS dex, pc.abil_constitution AS con, pc.abil_intelligence AS `int`, pc.abil_wisdom AS wis, pc.abil_charisma AS cha, strmod.modifier AS strmod, dexmod.modifier AS dexmod, conmod.modifier AS conmod, intmod.modifier AS intmod, wismod.modifier AS wismod, chamod.modifier AS chamod
    FROM d_player_characters AS pc
    Inner Join d_classes AS c ON c.class_id=pc.first_class_id
    Inner Join t_ability_modifiers AS strmod ON strmod.score=pc.abil_strength
    Inner Join t_ability_modifiers AS dexmod ON dexmod.score=pc.abil_dexterity
    Inner Join t_ability_modifiers AS conmod ON conmod.score=pc.abil_constitution
    Inner Join t_ability_modifiers AS intmod ON intmod.score=pc.abil_intelligence
    Inner Join t_ability_modifiers AS wismod ON wismod.score=pc.abil_wisdom
    Inner Join t_ability_modifiers AS chamod ON chamod.score=pc.abil_charisma
    WHERE pc.character_id='11'
    

     

    Here's the PHP code that runs this query.

    $select="SET SESSION SQL_BIG_SELECTS=1;
      SELECT CONCAT(forename,' ',surname) AS name, c.class, pc.abil_strength AS str, pc.abil_dexterity AS dex, pc.abil_constitution AS con, pc.abil_intelligence AS `int`, pc.abil_wisdom AS wis, pc.abil_charisma AS cha, strmod.modifier AS strmod, dexmod.modifier AS dexmod, conmod.modifier AS conmod, intmod.modifier AS intmod, wismod.modifier AS wismod, chamod.modifier AS chamod
      FROM d_player_characters AS pc
      Inner Join d_classes AS c ON c.class_id=pc.first_class_id
      Inner Join t_ability_modifiers AS strmod ON strmod.score=pc.abil_strength
      Inner Join t_ability_modifiers AS dexmod ON dexmod.score=pc.abil_dexterity
      Inner Join t_ability_modifiers AS conmod ON conmod.score=pc.abil_constitution
      Inner Join t_ability_modifiers AS intmod ON intmod.score=pc.abil_intelligence
      Inner Join t_ability_modifiers AS wismod ON wismod.score=pc.abil_wisdom
      Inner Join t_ability_modifiers AS chamod ON chamod.score=pc.abil_charisma
      WHERE pc.character_id='$id'";
    $result=mysql_query($select) or die(mysql_error());
    $row=mysql_fetch_array($result);
    echo "<table border='0' width='100%'>
      <tr><td colspan='4'><b>Character: </b>$row[name]</td></tr>
      <tr><td colspan='4'><b>First class: </b>$row[class]</td></tr>
      <tr><td colspan='4'> </td></tr>
      <tr><th colspan='2'><b>Abilities</b></th><th>Mods</th><th> </th></tr>
      <tr><td width='40'><b>STR:</b></td><td width='30' align='right' class='abil'>$row[str]</td><td width='30' align='center' class='abil_mod'>$row[strmod]</td><td> </td></tr>
      <tr><td><b>DEX:</b></td><td align='right' class='abil'>$row[dex]</td><td align='center' class='abil_mod'>$row[dexmod]</td><td> </td></tr>
      <tr><td><b>CON:</b></td><td align='right' class='abil'>$row[con]</td><td align='center' class='abil_mod'>$row[conmod]</td><td> </td></tr>
      <tr><td><b>INT:</b></td><td align='right' class='abil'>$row[int]</td><td align='center' class='abil_mod'>$row[intmod]</td><td> </td></tr>
      <tr><td><b>WIS:</b></td><td align='right' class='abil'>$row[wis]</td><td align='center' class='abil_mod'>$row[wismod]</td><td> </td></tr>
      <tr><td><b>CHA:</b></td><td align='right' class='abil'>$row[cha]</td><td align='center' class='abil_mod'>$row[chamod]</td><td> </td></tr>";
    echo "</table>";
    

     

    I'm getting the following error: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT CONCAT(forename,' ',surname) AS name, c.class, pc.abil_strength AS str, p' at line 2".

     

    The query executes find in Navicat, but PHP doesn't seem to like it. If this is a PHP problem i'm sorry I posted it in the wrong forum. I just suspect it's the "SET SESSION SQL_BIG_SELECT=1;" that PHP doesn't like. So I suspect I'll have to go another route to make PHP like the code. Is there an easier way to write this query that PHP won't complain about?

     

    Any help is appreciated!

  16. Here's my js

    <script type="text/javascript" src="<?php echo "$url/library/scripts/selectclass.js"; ?>" /></script>
    <script type="text/javascript" />
    function subit(which) {
        if(which=='reroll') { document.attributes.action="res_t-pcb2.php?roll=yes"; }
        else if(which=='attributes') { document.attributes.action="tools/scripts/pcb.php"; }
    }
    </script>
    

     

    Here's my html

    <form method="get" name="attributes">
        <input type="hidden" name="page" value="2">
        <table>
          <tr>
            <td align="right"><label for="abil_str">Str: </label></td>
            <td><input type="text" name="abil_str" size="2" value="<?php if($_GET['roll']=='yes') { $werbgame->roll_dice(4,6,0,1); } ?>"> <?php echo substr($werb->getdata("descr","SELECT descr FROM d_abilities WHERE ability='strength'"),0,50); ?></td>
          </tr>
          <tr>
            <td align="right"><label for="abil_dex">Dex: </label></td>
            <td><input type="text" name="abil_dex" size="2" value="<?php if($_GET['roll']=='yes') { $werbgame->roll_dice(4,6,0,1); } ?>"> <?php echo substr($werb->getdata("descr","SELECT descr FROM d_abilities WHERE ability='dexterity'"),0,50); ?></td>
          </tr>
          <tr>
            <td align="right"><label for="abil_dex">Con: </label></td>
            <td><input type="text" name="abil_con" size="2" value="<?php if($_GET['roll']=='yes') { $werbgame->roll_dice(4,6,0,1); } ?>"> <?php echo substr($werb->getdata("descr","SELECT descr FROM d_abilities WHERE ability='constitution'"),0,50); ?></td>
          </tr>
          <tr>
            <td align="right"><label for="abil_dex">Int: </label></td>
            <td><input type="text" name="abil_int" size="2" value="<?php if($_GET['roll']=='yes') { $werbgame->roll_dice(4,6,0,1); } ?>"> <?php echo substr($werb->getdata("descr","SELECT descr FROM d_abilities WHERE ability='intelligence'"),0,50); ?></td>
          </tr>
          <tr>
            <td align="right"><label for="abil_dex">Wis: </label></td>
            <td><input type="text" name="abil_wis" size="2" value="<?php if($_GET['roll']=='yes') { $werbgame->roll_dice(4,6,0,1); } ?>"> <?php echo substr($werb->getdata("descr","SELECT descr FROM d_abilities WHERE ability='wisdom'"),0,50); ?></td>
          </tr>
          <tr>
            <td align="right"><label for="abil_dex">Cha: </label></td>
            <td><input type="text" name="abil_cha" size="2" value="<?php if($_GET['roll']=='yes') { $werbgame->roll_dice(4,6,0,1); } ?>"> <?php echo substr($werb->getdata("descr","SELECT descr FROM d_abilities WHERE ability='charisma'"),0,50); ?></td>
          </tr>
          <tr><td colspan="2" align="center"><input type="submit" name="reroll" value="Reroll" onclick="javascript:subit(reroll);"> <input type="submit" name="submit" value="Submit" onclick="javascript:subit(attributes);"></td></tr>
        </table>
        </form>
    

     

    When either submit button is pressed the following is sent to the browser.

    "res_t-pcb_p2.php?page=2&abil_str=&abil_dex=&abil_con=&abil_int=&abil_wis=&abil_cha=&reroll=Reroll"

    "res_t-pcb_p2.php?page=2&abil_str=&abil_dex=&abil_con=&abil_int=&abil_wis=&abil_cha=&submit=Submit"

     

    If reroll is pressed it should set the form action to "res_t-pcb2.php?roll=yes". If submit is pressed it should set the form action to "tools/scripts/pcb.php".

    What's wrong?

×
×
  • 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.