Jump to content

g__ink

New Members
  • Posts

    8
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

g__ink's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. did you want to use the variables in this $values[] = "<a id=\"mpform_a_". $field_id . "\" class=\"mpform_a_help\" href=\"#\" onclick='javascript:helpme(\"mpform_a_$field_id\", \"$help\", \"" .$field['title']."\",\"".$MENU['HELP']."\");return false;' title=\"".$MENU['HELP']."\">\n<img class=\"mpform_img_help\" src=\"".WB_URL."/modules/mpform/images/help.gif\" alt=\"".$MENU['HELP']."\" /></a>"; in the new link structure or completely replace them with <ul> <li class="inlineblock"><a href="#">Help<span class="tooltip silver">Help</span></a></li> </ul>
  2. <a id=\"mpform_a_". $field_id . "\" class=\"mpform_a_help\" href=\"#\" onclick='javascript:helpme(\"mpform_a_$field_id\", \"$help\", \"" .$field['title']."\",\"".$MENU['HELP']."\");return false;' title=\"".$MENU['HELP']."\">\n".$MENU['HELP']."\" /></a>"; is this the only link that you need to change? or are you looping over multiple links? A little more information would be useful
  3. A quick google search produced the following: http://stackoverflow.com/questions/125113/php-code-to-convert-a-mysql-query-to-csv
  4. while ($row2 == mysql_fetch_assoc($res2) or die(mysql_error())) { the double equals (==) and the or die(mysql_error() looks like your problem. changing it to the following should help. while ($row2 = mysql_fetch_assoc($res2)) {
  5. Im sorry but if you are sending data via a standard html form then this is incorrect. As per http://www.w3schools.com/tags/att_input_disabled.asp
  6. OK so straight up without seeing any of your code, you are going to get nothing in your $_POST array as your text fields are all disabled. If you would like further help, please post your form code as well as the code you are using to process the $_POST array.
  7. In your second post - the reason you are only getting the first row (pd_price1) from your first query is that you are overriding the value of the $result variable when you run your second query. // Perform Query $result = mysql_query("SELECT * FROM tbl_order_item WHERE od_id = '$orderId'"); //this overrides $result as it is within your first while loop $result = mysql_query("SELECT * FROM tbl_product WHERE pd_id = '$pd_id'");
  8. OK, so first of all what you are attempting to do is SO not clear. However, I'm going to make some assumptions and see if I can get this right. So... You have a list of roles and a list of candidates to fill those roles. You are generating a form based on theses roles and candidates. What you want is for the user to pick a single candidate for each role. These roles come from the database, and therefore the number of roles may not be consistent each time you generate the form. So far so good? You are generating your form along these lines: while($results = mysqli_fetch_assoc($sql){ while($results2 = mysqli_fetch_assoc($sq2l){ print('<input type="radio" name="'.$results['name'].'" value="'.$results2['value'].'" />'.$results2['value'].'<br />'); } } which is going to give you something like this: <input type="radio" name="President" value="Mitt Romney" />Mitt Romney<br /> <input type="radio" name="President" value="Barack Obama" />Barack Obama<br /> ... <input type="radio" name="Vice-President" value="Mitt Romney" />Mitt Romney<br /> <input type="radio" name="Vice-President" value="Barack Obama" />Barack Obama<br /> ... Now because you are using radio buttons, when you submit the form you will get 1 option per role (ie 1 for President and 1 for Vice-President) Now as the number of roles may vary, I would suggest using a for loop and a switch statement on the page that you post the data to. ie if(!empty($_POST)){ foreach($_POST as $field => $value){ switch($field){ case 'President': //process the president break; case 'Vice-President': //process the vice-president break; default: //do something else } } } Now this may not work for you, depending on what you want to do with the form data once it is submitted, but hopefully it will give you an idea to play with. PS. This code has NOT been tested so it may not work straight up
×
×
  • 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.