Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About denny911

  • Rank
  • Birthday 03/11/1983

Profile Information

  • Location
    Bosnia and Herzegovina
  1. Thank you very much!How can I use an array (located in lets say config file) in multiple functions in my functions.php file.like this: // config file$keywords = array('chicago', 'dallas', 'washington'); and usage in function file: // the array with the same values like the above should go here, but i need it in form of a variable pulled from config file// so similarly i can simply use it in another function$needles = array(); // need values from keywords array located in config file hope you understand what i wantEDIT: the problem is that i cant even print that external variable ($keyword)
  2. this is great, but i decided to change the approach. i wont use sql query, i'll just utilize $_get stringso, i managed to do this:$string = $_GET['string']; if($string) { $haystack = $string; $needle = 'washington'; $pos = strpos($haystack,$needle); if($pos === false) { // string needle NOT found in haystack print "string not found"; } else { // string needle found in haystack print "string found!"; } now, this needs some tweaking$needle should be an array of values (let's say: washington, chicago, dallas, ohio)and IF ANY OF THEM is found in the $haystack, execute the codeany s
  3. Hi,could (something like) this be shortened or in any other way made more efficient:(not the real code, just an idea) $string = "something,stuff,thing,whatever";$exploded = explode(',',$string);$item1 = $exploded[0];$item2 = $exploded[1];$item3 = $exploded[2];$item4 = $exploded[3];$sql = mysql_query("SELECT * FROM someTbl WHERE sth LIKE '%$item1%'OR sth LIKE '%$item2%'OR sth LIKE '%$item3%'OR sth LIKE '%$item4%' ";.... since this is only a presentation, the code probably has errors or something,but i'm sure you have a basic idea what i'm trying to achieve.but i think there might be better wa
  4. try this:<?phpif($page="default") { print 'style="opacity:1.0;filter:alpha(opacity=100)" '; }else{ print 'style="opacity:0.6;filter:alpha(opacity=60)" '; }?>
  5. Hello,I'm experimenting with AJAX and very thrilled with its possibilites. But..One thing about it made me disappointed. Here's some kind of scenario from yesterday:I wanted to put a small section with several database inputs which will beserved via AJAX page.So i had, lets say, my /index.php page, ajaxPage.js and finally ajaxFetched.php pageObviously, I needed an MySql connection. it was already included in /index.php but apparentlyAJAX page didn't pay much attention to it. It required a connection of its own. So, i tried to includethe connection within it. It didn't work. SO I HAD TO TYPE TH
  6. well, i should've known from the start, it was pretty much obvious that the problem wasrelated to paths. one more reason for that was the fact that this worked on my localhostand not on my web server (probably the two have different settings for paths)i carefully inspected everything, put my ajax served PHP file in the root (to avoid trickypath setting), and that solved the problem finally (at least, seems to be so)thank you for your help and pointing out what you've noticed. that's been very helpful!have a nice day,regards from bosnia h.// Denis
  7. my friend, thanks for the effort you put in thissuddenly, the damned thing works in FF but still shows error and doesnt work in IE7 (probably IE6 too)i was messing something about paths (after your posts i became suspicious about them) and somehow fixed it for FFcan you repeat the same as previous now and tell me if there's any difference now (what can you tell me about showUser.js now)thanks
  8. i'm not experienced with javascript nor with the error consolewell, if showUser() not being defined is the case, how do you explain everything working onmy localhost? is that normal?this is showUser.js script:var xmlHttp;function showUser(str){ xmlHttp=GetXmlHttpObject();if (xmlHttp==null) { alert ("Browser ne podrzava HTTP Request"); return; }var url="ajax/subjektiTop.php";url=url+"?q="+str;url=url+"&sid="+Math.random();xmlHttp.onreadystatechange=stateChanged;xmlHttp.open("GET",url,true);xmlHttp.send(null);}function stateChanged() { if (xmlHttp.readyState==4 || xmlHttp.readyState=="comple
  9. hmm, that f_id is the argument needed by AJAX page (there's an sql query that isexpecting it via $_GET variable, to know what rows to serve)dont think anything beside what's already happening (and that's links not working)would happen.I wonder whether there is a way to send that parameter (id number) using onclickevent - that is, what is the correct way to form a link
  10. dont think sonotice single quotes on the beginning, after "print", so that does not interfere with doublequotes and therefore they dont have to be escapedIf im wrong, someone correct mebesides, everything works on localhost
  11. Hello to all,Here's the link to my site: www.poslovni-adresar.baI decided to set up a small section for displaying several inputs from my databaseI tried to implement simple AJAX page to do the job (i slightly changed w3schools ajax mysql+php example to suit my needs)On my LOCALHOST everything works just fine (FF 3.0, IE7 and IE8) but it made me quite disappointedwhen i noticed it doesn't work on my web serverIt seems this part of the code is the problem: while($row = mysql_fetch_array($result)) { print '<div class="subjekt"><a onclick="showUser(\'' . $row['f_id'] . '\')">'; print
  12. this is getting more and more frustrating.. even your code doesnt work.it may be the installation that is set up wrong. I already have the .ini file and im able to write to it but that your line of code just doesnt seem to work!Any other suggestions? Consider that the 4 lines of code (from my 1 post) are excerpted from the Joomla test site and they work! I know that because the .ini file is the same for MY site and that TEST site (the test site belongs to my hosting provider - they gave me access to it so i could set the .ini file up myself).but i just dont know why nothing works? Help please!
  • Create New...