Jump to content

nezbie

Members
  • Posts

    31
  • Joined

  • Last visited

    Never

Contact Methods

  • MSN
    eaglesoft2001@hotmail.com
  • Website URL
    http://www.eaglesoft.tk

Profile Information

  • Gender
    Not Telling
  • Location
    FINLAND

nezbie's Achievements

Member

Member (2/5)

0

Reputation

  1. SELECT DISTINCT id FROM table WHERE languages_id = "1" AND id NOT IN (SELECT DISTINCT id FROM table WHERE languages_id = "2") works fine - thanx for both answer, really appreciate it!
  2. Hi I have a table consisting of following data: id name languages_id None of those fields are unique, so one id can have multiple languages_id's.. My problem is, that I'd need to select all id's from the table where languages_id has a value of x, but not y.. So the idea in php is to copy all the fields to language y if it does not exists.. Example: id 20 does not exists in german (languages_id = 2), select this id. I've tried like (as simple as I thought it COULD be.. wasn't): SELECT DISTINCT id FROM table WHERE languages_id = "1" AND languages_id != "2" I'll try to work this out
  3. Hi I have a small question, would be nice if you could give me at least some hints or point me to the right direction.. anyways: My page has a list of products in a javascript-generated table. I'd need some help with my "add to cart" -button. It's not really a shopping cart but works kinda the same way. For you to understand let's call it shopping cart. I have an inframe php-page which should display all the items i add from the products list to the shopping cart. I thought the shopping cart would use PHP session variables. Now my question is, what would be the easiest way to perform this action? I use the iFrame becase I need to use PHP in the cart and also - the main page which contains the products table should not reload itself unless user decides to (else loses search and sorting options) So, shortly: Button that contains a certain value -> when clicked, pass that value to inframe -> update this value into PHP session variable with possible inframe pagereload Any suggestions and replies are more than welcome a big thank you - nez
  4. Hi Does anyone know any good php scripts that would change text as image, letter by letter or create a new phrase using a predefined font. I'd need to use a non-standard font (not Arial, Verdana etc) to create page headers and other dynamic text for my page. I thought the best way was to convert the text as an image using this special font. Is this possible? I'm not asking anyone to do the code for me. Just a hint or two, or a link to a script someone has made earlier I've tried to search the web a little, but since my native language is not English, correct search terms are a mystery :)
  5. I use it for: structure of textfields = mytextfield[rowNR][colNR] (has a value), like mytextfield[0][5] = value (can also be "value") all the data are read and written to a [b]textfile[/b] [b]// save post as CSV foreach ($_POST['mytextfield'] as $key=>$value) {     $parsedData .= implode(';', $value) . "\r\n"; } [/b] so when foreaching an array, or otherwise handling arrays but I print out $_POST before any action after I have submitted the form, the "errorneus data" is visible there already. So in the foreach loop, the $value could be anything like 1234 or "1234" or Jim or "Jim"
  6. Let's say i have lots of inputfields that have values where doublequotes are used, like: <input type="text" value="\"myvalue\"" name="mytextfield[0][0]"> ( used addslashes to prevent value=""myvalue""> ) In page, this displays correctly, also in sourcecode But when posting, $_POST array shows only \\ or " or \ where there should be a "myvalue". I've tried to search the forums and google / manual but no matter what i do the post array returns one of the following useless values described above.. What am I doing wrong with this? :'(
  7. Ok, that works, thank you very much :)
  8. Ok, I solved this. Gladly there was nothing wrong with the javascript code, but form positions on page. It seems to be "illegal" to build forms like <table><tbody><form><tr><td></td></tr></form></tbody></table>, Mozilla and evidently Opera cannot read the form properly, at least not with "dynamic fields". I didn't think this the first because I've never had this kind of trouble with forms. When I changed the form -tags right before and after the table tags, my page started working perfectly :S I'm glad though, I just have a lot to repair in my other scripts now x)
  9. Yes I have. It's just as clear as usual ;) I didn't quite understand the keys and headers thing.. should it be something like columnName=>[rowNumber] = value ? I've never been too good with these anyways - and if there is no at least moderately easy solution with current code logic I will just leave this feature not to be included.. It's not so important, rather "nice to have". I don't want to rewrite my script for this. Would I have to?
  10. [code] <head>   <script type="text/javascript"> <!-- function addEvent(maxCols) {   var ni = document.getElementById('myDiv');   var numi = document.getElementById('theValue');   var num = (document.getElementById('theValue').value -1)+ 2;   numi.value = num;   var divIdName = "my"+num+"Div";     var divContents = "";     for(a=0; a < maxCols; a++) {       divContents += "<input class=\"inputFields\" name=\"rowContents["+num+"]["+a+"]\" style=\"width: 150px;\" value=\"\" type=\"text\">&nbsp;";       }     var newdiv = document.createElement('div');   newdiv.setAttribute("id",divIdName);   newdiv.setAttribute("id",divIdName);   newdiv.innerHTML = "Rivi "+num+" "+divContents+"&nbsp;<a href=\"javascript:;\" onclick=\"removeEvent(\'"+divIdName+"\')\">Poista rivi "+num+"</a>";   ni.appendChild(newdiv); } function removeEvent(divNum) {   var d = document.getElementById('myDiv');   var olddiv = document.getElementById(divNum);   d.removeChild(olddiv); } //-->   </script> </head> <body> <input type="hidden" value="' { my start value goes here, numeric } '" id="theValue" /> <a href="javascript:;" onclick="addEvent(\'' . $colCount . '\');">Lisää rivejä</a><br /><br /> <div id="myDiv"> </div> </body> Live example on web, but not using forms (this is where I adapted my code and modified): [url]http://www.dustindiaz.com/add-and-remove-html-elements-dynamically-with-javascript/[/url] [/code]
  11. [quote]$row = my starting row(code from php as well the whle "add rows thingy")[/quote] It is filled correctly - so that is not the problem. For some reason mozilla ignores these fields created with javascript when posting the form. If I echo out print_r($_POST) after form submission with PHP, Mozilla only prints out values for fields generated with php. IE echoes out lines generated with PHP and Javascript.
  12. The console gives no errors/notices/warnings What might the problem be, did you know? ;)
  13. I don't get it.. Really. So if I want to sort array $foo[x][y] ascending by "y", I can't find any clear answers to that, if it's even possible with as little code as possible?
  14. [code] function addEvent(maxCols) {   var ni = document.getElementById('myDiv');   var numi = document.getElementById('theValue');   var num = (document.getElementById('theValue').value -1)+ 2;   numi.value = num;   var divIdName = "my"+num+"Div";     var divContents = "";     for(a=0; a < maxCols; a++) {       divContents += "<input class=\"inputFields\" name=\"rowContents["+num+"]["+a+"]\" style=\"width: 150px;\" value=\"\" type=\"text\">&nbsp;";       }     var newdiv = document.createElement('div');   newdiv.setAttribute("id",divIdName);   newdiv.setAttribute("id",divIdName);   newdiv.innerHTML = "Row "+num+" "+divContents+"&nbsp;<a href=\"javascript:;\" onclick=\"removeEvent(\'"+divIdName+"\')\">Poista rivi "+num+"</a>";   ni.appendChild(newdiv); }         <input type="hidden" value="' . $row . '" id="theValue" />         <a href="javascript:;" onclick="addEvent(\'' . $colCount . '\');">Add row</a><br /><br />         <div id="myDiv"> </div>[/code] $row = my starting row(code from php as well the whle "add rows thingy" Firefox (1.5.0.8) cannot read the field values that are dynamically added but IE(7) can. How should I modify this code that mozilla could read the field values? So when I post a form the elements dynamically created are posted within. No trouble in IE. Thanks
  15. Hi, this consideres my csv manager. It reads a csv file and drops the info to a table and to inputfields so they are editable. The basic structure goes like the following (example with 2 rows and 3 columns: [b] |  index  |  First name  | Last name  |  ID      |[/b] |    1    |  John          | Smith        |  2920    | |    2    |  Harry        |  Shearer  |  1032    | in the very first line of my csv file the column headers are defined. (in this case first name, last name, id) I'd need to be able to sort these information by column index (name is also possible if that is what is needed) I mentioned earlier that those information are found in inputfields. They are named like: [b]contents[rowNR][columnNR][/b], so "Shearer" is found in [b]$contents[2][2][/b] After I edit this info it is send via form to be rewritten to it's original sourcefile using the following simple piece of code: [code] foreach ($_POST['contents'] as $key=>$value) {     $parsedData .= implode(';', $value) . "\r\n"; } [/code] So what I'd need help with is sorting the array $contents[row][[b]with this key[/b]]. Also I'd need to be able to s[b]kip the row with index "0"[/b] because it is used to save the column header information. I hope you understand what I'm after here.. All help and ideas highly appreciated, 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.