Jump to content

kucing

Members
  • Posts

    54
  • Joined

  • Last visited

    Never

Everything posted by kucing

  1. Dear friends, I have search google and tested many examples I found but non of them work for me.. So now I need your help to solve this thing.. Actually what I wanted to do was save some variables from javascript to my database but when doing that I don't want my page to refreash and also don't want any button asking me to submit then save! Any thing will be best which do it automaticaly without clicking anywhere Here is my code example. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Java2php Test</title> </head> <body> <script type="text/javascript"> var N=5; var array = new Array() var items = list.getElementsByTagName("li") for (var i = 0, n = N; i < n; i++) { var item = items[i] array.push(myFnc(item)) } alert(array); // [b]<----- i want this array to forward to my php script[/b] return array.join('|') </script> <ul id="menu"> <li class="box" id=1>TEST1</li> <li class="box" id=2>TEST2</li> <li class="box" id=3>TEST3</li> <li class="box" id=4>TEST4</li> <li class="box" id=5>TEST5</li> <li class="box" id=6>TEST6</li> <li class="box" id=7>TEST7</li> <li class="box" id=8>TEST8</li> <li class="box" id=9>TEST9</li> <li class="box" id=10>TEST10</li> </ul> </body> </html> Thanks I appreciate your help. K
  2. Hi all.. I am having problem with proper syntax format. If i am not mistaken this syntax is right $myVar[$i]["var"] = ($a>1?$a=true:a=false); but when i try to make some change like this $myVar[$i]["var"] = (($a>1?$a=true:a=false)?$b=true:b=false); it doesn't seems to work As I want something like when the first parameter is true then the next parameter should work. Thanks I appreciate your help
  3. is that happen when you post something or do get method?
  4. I wanted to combine all the subarrays in one array and I solved it using tllewellyn given codes and added $myTestArray which now contain all the subarrays data foreach($array as $key=>$value) { foreach($array[$key] as $userid) { //do what you are going to do with the var $userid $myTestArray["test"][]=$userid; } } Thanks
  5. Hi, You may want to check your index.php as it may contain some xss attach protection like blocking some know ways. It may be one of the reason your ' is changing to ? K
  6. tllewellyn thank you very much and also those who tried their level best to help me:) My problem is solved
  7. I appreciate your help thanks but as I was being doing that before this problem started only after I added a feature for my users to make their own questions and when it comes to user define array keys my foreach doesnt work there since they making their own questions and answers and I got no clue what the question would be. An example: Array ( [abcdxyz] => Array ( [0] => xyz ) ) so that loop was good if i had default values.. Array ( [userID] => Array ( [0] => 200 ) ) So I was looking for a way to make those subarrays combine with all the arrays if there is a way I would really love to know Thanks in advance
  8. Actually that was just an example to make this post easy to understand and in real every user has its own array which is using the same way of the array shown above. Why I want it to be like that because I want to use array_slice Example: And when I do that in this $array It give me result like this which I don't want Array ( [userIds] => Array ( [0] => 32 ) [userAge] => Array ( [0] => 14 ) [income] => Array ( [0] => 1100 ) [status] => Array ( [0] => 01 ) ) But I only want it to show me Array ( [userIds] => Array ( [0] => 32 ) ) I am totally confuse.. Thanks
  9. sorry:( my bad i wrote that by mistake actually i want it like this Array ( [0] => 32 [1] => 33 [2] => 34 [3] => 14 [4] => 27 [5] => 32 [6] => 1100 [7] => 900 [8] => 1350 [9] => 01 [10] => 00 [11] => 00 ) Also about the username, userage, income and status could be random as users also allowed to make new things which stores in one array. I really appreciate your kind help Thanks
  10. Dear friends and fellows, I am stuck with this array combine stuff which I have tried all my skils but still no hope so I would appreciate any help if someone could Ok here is what I am facing. $array=array ( 'UserIds' => array ( 0 => '32', 1 => '33', 2 => '34', ), 'UserAge' => array ( 0 => '14', 1 => '27', 2 => '32', ), 'Income' => array ( 0 => '1100', 1 => '900', 2 => '1350', ), 'Status' => array ( 0 => '01', 1 => '00', 2 => '00', ), ); and when I do print_r($array); It show me result like this Array ( [userIds] => Array ( [0] => 32 [1] => 33 [2] => 34 ) [userAge] => Array ( [0] => 14 [1] => 27 [2] => 32 ) [income] => Array ( [0] => 1100 [1] => 900 [2] => 1350 ) [status] => Array ( [0] => 01 [1] => 00 [2] => 00 ) ) Also about the username, userage, income and status could be random as users also allowed to make new things which stores in one array. And my problem start right here After wasting my 2 days I have no choice but to ask help I want result to be like this Array ( [0] => 32 [1] => 33 [2] => 34 [3] => 14 [4] => 27 [5] => 32 [6] => 1100 [7] => 900 [8] => 1350 [9] => 01 [10] => 00 [11] => 00 ) Here i do not want to display any username, userage, income or Status but want all the subarrays in one array.. Thank you for you help I really appreciate it K
  11. Thanks alot effigy It works perfectly..
  12. What do you mean by "illegal chars"? Any example?
  13. Oh this is nice.. But with a little problem.. It select body{background-color:444444; So is that possible to make this regexp something like this (?<=body\{\s)(?<=background-color:+)(?=;\s\)) which is not working as I am still noob in regexp and I took this from http://www.phpfreaks.com/forums/index.php/topic,123402.0.html This actuall idea here is that it only should take the background-color:"value" Thanks
  14. Hi ted_chou12, This isn't working and also in css codes there will be many background-color but I only need one background-color value which will be located in body{} Regards, K
  15. Hi ted_chou12.. Thanks but your codes will get all the data but I only need one value which exist in body{} The background-color value.. Regards K
  16. Thanks for reply.. Actually I only need one value from the css file which is the background-color value.. And it should only come from body { background-color:444444; } which will be "444444" So my I can re-define the google adsense background value..
  17. Hi.. Works fine for me Right Ip and Country..
  18. Hi every one.. I got a little question about how do I dig css values from a css file.. Like in my site my members are allowed to change the background of there page so my google ads are having a tought time with background colors as the default I set was white.. I need a function or php script or a way how to sort this out.. An example what kinda css codes are being used at my site.. <!-- Css --> <style type="text/css"> { Background Properties } table, tr, td { background-color:transparent; border:none; border-width:0;} body { background-color:444444; background-attachment: fixed; background-position:bottom left; background-repeat:no-repeat; border-color:EEEEEE; border-width:2px ; border-style: solid; scrollbar-face-color:000000; scrollbar-highlight-color:BBBBBB; scrollbar-3dlight-color:000000; scrollbar-shadow-color:000000; scrollbar-darkshadow-color:000000; scrollbar-arrow-color:EEEEEE; scrollbar-track-color:EEEEEE; } { Table Properties } table table { border: 0px } table table table table{border:0px} table table table { border-style:solid; border-width:2px; border-color:CCCCCC; background-color:666666; } { Text Properties } table, tr, td, li, p, div { color:EEEEEE; } .btext { color:EEEEEE; } .blacktext10 { color:EEEEEE; } .blacktext12 { color:EEEEEE; } .lightbluetext8 { color:EEEEEE; } .orangetext15 { color:EEEEEE; } .redtext { color:EEEEEE; } .redbtext { color:EEEEEE; } .text { color:EEEEEE; } .whitetext12 { color:EEEEEE; } a:active, a:visited, a:link { color:EEEEEE; } a:hover { color:EEEEEE; } a.navbar:active, a.navbar:visited, a.navbar:link { color:EEEEEE; } a.navbar:hover { color:EEEEEE; } a.redlink:active, a.redlink:visited, a.redlink:link { color:EEEEEE; } a.redlink:hover { color:EEEEEE; } .nametext { color:EEEEEE; } </style> <!-- /Css --> Now if you see the background-color value is define three times so the only background value I would need will be from body.. body { background-color:444444; background-attachment: fixed; background-position:bottom left; background-repeat:no-repeat; border-color:EEEEEE; border-width:2px ; border-style: solid; scrollbar-face-color:000000; scrollbar-highlight-color:BBBBBB; scrollbar-3dlight-color:000000; scrollbar-shadow-color:000000; scrollbar-darkshadow-color:000000; scrollbar-arrow-color:EEEEEE; scrollbar-track-color:EEEEEE; } Any Help at all is welcome..
  19. Here is another example which may work for you since my understanding that you are trying to input bbcodes.. I am still a noob when comes to regexp but trying to get few things sorted function replace_tags($string) { $RegExpPattern = array( '/(&#33;|!){10,}/', '/\[b\](.*?)\[\/b\]/is', '/\[i\](.*?)\[\/i\]/is', '/\[u\](.*?)\[\/u\]/is', '/\\n/', ); $RegExpReplace = array( '!', '<strong>\\1</strong>', '<em>\\1</em>', '<u>\\1</u>', '<br />', ); $string = preg_replace($RegExpPattern, $RegExpReplace, $string); return $string; }
  20. Hi.. Yes in normal case it would be, as many of my members started putting their fav movies from google video and youtube but I also have seen few putting their photo album using slide means there is no <object> or <param> but it only has <embed> tags is attributes you mean "value" or "<param name="allowScriptAccess" value="never">".. and effigy I will appreciate your help :) Thanks
  21. Exactly thats the thing I am looking for and mine regexp seems not working as I want them to work :( [quote author=effigy link=topic=124875.msg518080#msg518080 date=1170259598] By "good" do you mean properly formatted (valid)? Users should be allowed to use object, param, and embed tags as long as they conform to HTML, basically, right? [/quote]
  22. Hi.. Actually I am looking for a way where my script should understand like between bad codes and good codes and delete the bad ones.. [quote author=effigy link=topic=124875.msg518040#msg518040 date=1170257508] Can you be more specific? Are you trying to remove all embed tags? [/quote]
  23. Hello every one.. First I want to thanks in advance who gonna spent some of there time to help me out :) Well.. I found that few of my users are playing around with these codes and its making my site and many pages dead.. they are not loading at all.. So I am here for your kind help.. I tried stoping it using preg_match  [code]<embed[^>].*embed>[/code] But it only effect for the good codes and bad codes are still there.. even thought I can delete it if someone post it again but need a perfect solution.. [b]Good Codes:[/b] [code]<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/dZ7h8q4kMBE_E"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/dZ7h8q4kMBE_E" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>[/code] [b]Bad Codes:[/b] [code]<object width="425" height="350"><param name="movie" value="http://www.yo utube.com/v/aa$$33ffZZxx uot;></param>< ;param name="wmode" value="transparent&q uot;></param>< ;embed src="http://www.yout ube.com/v/aa$$33ffZZxxuo t; type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"> ;</embed></objec t>[/code]
×
×
  • 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.