Jump to content

dodgeitorelse3

Members
  • Posts

    195
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by dodgeitorelse3

  1. should mysql_connect really have quotes around variables?
  2. your form is posting to addname.php but it looks like you are trying to add the data to the database on the same page as form. What is your code that is on addname.php page?
  3. Shouldn't they be square brackets at $fields instead of curly braces?
  4. thank you gizmola, no idea why I didnt think of that. @HemendraSingh, Thank you. I will have to learn how to debug javascript and then I will see what you were getting at for that line of code.
  5. my bad I meant to put this in the javascript forum, can an admin please move it?
  6. I have been working on this code for quite some time var ul = top.document.getElementById("sub-menu"); var li = top.document.createElement("li"); var a = document.createElement('a'); var stradd = " (tours.ini not found)"; var linkText = document.createTextNode("<?php echo $loguname;?>"+stradd); a.appendChild(linkText); a.href = "tours_U/<?php echo $loguname;?>/tours.ini"; li.appendChild(a); li.setAttribute("name", "tours_download[]"); li.setAttribute("id", "li<?php echo $loguname;?>"); li.style.fontSize="12px"; ul.appendChild(li); what I am having trouble doing is setting the color of stradd variable. I cannot figure out how to access just that part to make the font color white (parenthesis included). Where can I find documentation to help me sort this out?
  7. Just compare lines 8-16 to lines 20-28 of your code posted above for contact3.php.
  8. Remove single quotation marks at 618 and 625
  9. Create an array to hold all the limited id's then in your if statement check each id to see if it is in the limited id array
  10. I don't use mysqli but seems the query is written wrong to me. dont you need to use something like $result1 = mysqli_query($DBcon, "SELECT........ ??
  11. the query is mysqli and the mysql_num_rows is not
  12. you have $nrowsx defined already, in your if statement change from if(nrowsx to if($nrowsx
  13. nrowsx will always be equal to zero since it isnt defined anywhere. the code you showed is missing the dollar sign before nrowsx
  14. Your error reporting will do nothing. First it has to be inside php tags. And then I don't think it will help you because I see no php code in your posted code. As for the memory thing are you talking about sessions?
  15. Your welcome but please read a couple of the replies prior to yours as this is not the best way to achieve your goal.
  16. Understood. Is it possible for you to remove my posts to prevent showing anyone the improper way?
  17. this also works <table border = "1" align = "center" style="line-height:25px;"> <tr> <th>Obst/Gemuese</th> <th>Alkohol</th> <th>Saft/Sirup</th> <th>Sonstige</th> </tr> <?php while ($row = mysqli_fetch_array($result)) { $tableid[] = $row['id']; $obst_gemuese[] = $row['obst_gemuese']; $alkohol[] = $row['alkohol']; $saft_sirup[] = $row['saft_sirup']; $sonstige[] = $row['sonstige']; } foreach($tableid as $key => $tblid) { echo "<tr> <td><input type='checkbox' name='selected[]' value='{$obst_gemuese[$key]}' /> $obst_gemuese[$key]</td> <td><input type='checkbox' name='selected[]' value='{$alkohol[$key]}' /> $alkohol[$key]</td> <td><input type='checkbox' name='selected[]' value='{$saft_sirup[$key]}' /> $saft_sirup[$key]</td> <td><input type='checkbox' name='selected[]' value='{$sonstige[$key]}' /> $sonstige[$key]</td> </tr>"; } ?> </table>
  18. editted: removed due to double post lol
  19. by declaring $checkboxes as you have there is no value being assigned therefore nothing is showing as expected which is correct. I am not a master coder by any means, in fact I'm just a noob in learning. however the following does seem to work. I would assume there is probably a much better way to do this. //$checkbox = '<input type ="checkbox" name = "selected[]" value="" />'; while ($row = mysqli_fetch_assoc($result)) {?> <tr> <td><input type ="checkbox" name = "selected[]" value="<?php echo $row['obst_gemuese'];?>" /> <?php echo $row['obst_gemuese'];?></td> <td><input type ="checkbox" name = "selected[]" value="<?php echo $row['alkohol'];?>" /> <?php echo $row['alkohol'];?></td> <td><input type ="checkbox" name = "selected[]" value="<?php echo $row['saft_sirup'];?>" /> <?php echo $row['saft_sirup'];?></td> <td><input type ="checkbox" name = "selected[]" value="<?php echo $row['sonstige'];?>" /> <?php echo $row['sonstige'];?></td> </tr>
  20. You are also probably going to need to name each checkbox ( if that's what you end up using) which is going to help you end the end because I would think you intend to do more with the selections than just display them the way you are currently.
×
×
  • 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.