Jump to content

Arnsenal

Members
  • Posts

    34
  • Joined

  • Last visited

Everything posted by Arnsenal

  1. Hi Guys Thanks For Looking At Least I found the solution in the depths of the easy php forum, they dont make it very easy to find and its rather important, anyways... If anyone else runs into this problem just follow the link, http://www.easyphp.org/forums/52/151095/how_to_run_php_from_command_line_
  2. Hello Ive been trying to install Symfony 2, I got it installed, the demo is working. Now Im trying to install Composer via the excutable that is available at thier website. When I select the php exe file and hit next during the installation I get... PHP Startup: Unable to load dynamic library 'C:\Program Files (x86)\NVIDIA.... (more win PATH values)... C:\Program Files (x86)\EasyPHP-12.1\php\php546x130322180633\ext\php_bz2.dll' - The spcified module could not be found. It give me this dialouge box about 15 times for different dlls which can be seen by the changing file in the last directory path listed above. As you may see I am using easy php In the php.ini file easy php has their ${path} variable, I tried changing that to the actual path without the ${path} and I imediately got the dialogue boxes again, just by saving the ini file. ; Directory in which the loadable extensions (modules) reside. ; http://php.net/extension-dir ; extension_dir = "./" ; On windows: extension_dir = "${path}\php\php546x130322180633\ext\" Ive also included the location of all the dlls in the Windows Path envrioment vaiable. I really have no idea how this all works and have been at it for a total of oh maybe 7 hours trying to figure it out. Can anyone help? Thanks, Jerry
  3. Christian F. That is exactly what I am trying to do!! Requinix, thank you for the detailed response!! If you guys still think persistent connections is not the way to go then I will drop the idea. The other way to go, I figure, is to have the application just create a connection with the correct user type as the application needs it. I thought persistent connections would be good because anytime my app needs scripting I will need a connection to the database, therefore if I have 1000 users on the site they will not be continually connecting to the database and therefor improving the applications performance.
  4. Hello Masters... Freaks I have a PDO Persistent Connections question. 1. If I connect to mySQL using PDO persistent connections turned as so.... $db = new PDO("mysql:host=localhost";"dbname=$this->dbName"; "$this->mySQLuser", "$this->mySQLpassword",array(PDO::ATTR_PERSISTENT => true,PDO::ATTR_EMULATE_PREPARES => false, PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION )); 2. Then I rerun this script (I rerun this script because it is a class that is auto loaded). 4. Will PDO reconnect to mySQL? Will PDO reconnect if the connection parameters change? The whole idea is to create db class that connects to mySQL using a user name and password that changes depending on the state of the user (logged in, not activated, not logged in). (Thought this would improve security because of the changing of the mySQL privliges based on user state, but Im a noob so I really dont know if it helps) Here is my full script. <?php class db { private $dbName='vulnVult'; public $tableName='users'; protected $mySQLuser='anon'; private $mySQLpassword="$this->mySQLuser".'password'; private $db; function __construct($PDO) { try { $db = new $PDO("mysql:host=localhost";"dbname=$this->dbName"; "$this->mySQLuser", "$this->mySQLpassword",array(PDO::ATTR_PERSISTENT => true,PDO::ATTR_EMULATE_PREPARES => false, PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION )); //Following Logic Sets MySQL user type if ($_SESSION['userID']) { $query= 'SELECT `activated` from `users` where'."$SESSION['userID']".'=`userID`'; $stmt = $db->query($query); $row = $stmt->rowCount(); if ($row = 1) { $this->mySQLuser='registered'; } else { $this->mySQLuser='notActivated'; } } else { $this->mySQLuser='anon' } // return a new PDO object with the corrct MySQL user type. Persistent Connection is On. return new $PDO("mysql:host=localhost";"dbname=$this->dbName"; "$this->mySQLuser", "$this->mySQLpassword",array(PDO::ATTR_PERSISTENT => true,PDO::ATTR_EMULATE_PREPARES => false, PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION )); } catch (PDOException $e) { echo "<br />There was a problem connecting to the database : ".$e->getMessage()."<br />"; die(); } } } $db = new db(PDO); ?>
  5. Very long explanation, Very easy fix. All I had to do was add :last to my Jquery selectors. Jquery so good.
  6. Yes, peipst9lker is right, it appears your script is running before the DOM's are finished loading, rendering it useless.
  7. Do you have Jquery linked in your HTML doc? <script src"../myrelative/jquery/directory/jquery1.5.js"></script>
  8. If you have Jquery linked in your document you can use this. <script src="../myRelative/js/directory/jquery1.7.js"></script> //link that make Jquery available to you browser. <script type="text/javascript"> $(".del").click(function(){ $(this).parent().remove(); }) </script> I changed your html to suit... You can easily change your all you <a> tags to have a class="del" by using the replace function of you text editor. <div id='50' class='player' style='display: block;'> <a class="del" href='#' >X</a> Beck, John <input type='hidden' id='input' name='starters[]' value='50' /> </div>​​​​​​​​​ Here is a working example... http://jsfiddle.net/42xkK/
  9. If you have a link to a Jquery file in your html document you can use this. <script type="text/javascript>$("input").before("<button>My Button</button>");</script> If we need to be more specific about which inputs should get buttons give them a class and we can do something similar. Does this help? Jerry
  10. Hello All I have a problem with my following example on js fiddle. http://jsfiddle.net/7nx6j/2/ My goal is to append on additional group of input fields into a existing form when a button is clicked. The server side php needs the name attributes of the input fields to be unique. So with j query I copy and append a div containing the addition input elements into a containing div when a button is clicked. Also, I change the value of the name attributes by incrementing a var and appending that number value to the existing value of all the name attribute. It works except for when I go to add the 2nd set of input elements. The Jscript selector selects all the existing name attributes with the ascendant class .appendRunTableRight and appends the increment value. So the first set of input elements will have a name attribute looking like : name="mill_rpm1_2_3" the second set will look like: name="mill_rpm2_3" and the third: name="mill_rpm_3" and so on... So logically the jquery selector must only select the last div with class .appendRunTableRight not all of them. Given my current script Im not sure how to rewrite it to fix the problem. Here is to hoping that someone will understand my problem and what Im trying to do! Thank You
  11. Alright!! Thanks Much Requinix, That's what I had in mind but didn't know how to use static properties to do such a thing. That will work perfectly thank you!!
  12. Hello, I have a db.php that initializes a MySQLI object. I have other scripts that include this db.php script. Is it possible to use the MYSQLI object inside functions from these other scripts that are including the db.php without passing the MYSQLI object as a parameter? Basically is there a way I can make the scope inside function have access to mysqli object without passing it in as a parameter? Thanks
  13. JC Bones The example replacement code you gave we works except that its seems the internal pointer of the $row array is always advanced 1 row when the for each statement executes. So this means that the first row is never printed out to the html table. I've tried using prev($row) right before the for each statement, but it had no affect. Any thoughts? Never Mind!! I didn't comment out the first $row = $result->fetch_row(); All works great.
  14. Thanks Guys, Ill try this out Monday. Ill consider the topic solved. Thanks Again
  15. Hello Masters The following code has an issue with the control structure I believe. My Goal: out put all the mysql data into an html table What I have correct: 1. The MySQL column names correctly fill in the top table row. 2. The number of rows displayed == the numbers of rows in my MySQL table. What I have Inncorrect: 1. The data in the table is repeatedly filled with the first row of data in MySQL. Here is the Code. class display_run_data { function __construct($mysqli){ $query="SELECT * FROM run_data"; $result=$mysqli->query($query); $num=$result->num_rows; $row = $result->fetch_row(); $feilds = $mysqli->field_count; echo"<tr>"; while ($finfo = $result->fetch_field()) { echo "<td><a href=\"index.html?where=".$finfo->name."\">".strtoupper($finfo->name)."</a></td>"; } echo"</tr>"; for ($i=0;$i<=$num;$i++){ echo "<tr>"; foreach ($row as $key=>$value){ echo "<td>".$value."</td>"; } echo "</tr>"; } } } Again the problem is: The data seen in the html table is repeatedly filled with only the first row of data from the MySql table. Tough problem to find solutions for on Google. Thanks, Jerry
  16. I figured everything out HaKu, thanks for your help! The main issue was resolved with using return statements (returning functions) from within a function that was nested in a j Query Chain. It allowed me to take string data from the dom make it a property name of an Object and increment the value of that property. Here is the final code that works if your interested. var arrayIndex = new Array(); var tallyTotal = {};//object that a funtion will push data to. var totalCompares = $('.comp-contain').size(); $('.comp-contain').css("display","none"); // Hide all Divs so each can be displayed singly. $('#comparisons div:first-child').css("display","inline-block"); //Show first Div whith 2 options to click on, the user clicks on one to proceed. function tallysTheTotals (obj,idIndex){ if (obj.hasOwnProperty(idIndex)){ obj[idIndex]++; } else { obj[idIndex]=1; } } $('.comp1 p,.comp2 p').click(function(){ var idIndex = this.getAttribute("id",2); $(this).parent().parent().css("display","none"); $(this).parent().parent().next().css("display","inline-block"); return tallysTheTotals(tallyTotal,idIndex); }); function display_tally_total(tallyTotal) { for (var x in tallyTotal) { $('#totals').append('<p>'+ x +':' + tallyTotal[x]+ '</p>'); //enumerate through the tallyTotal Object, dispaying the property name and its value } $('#featured-content h1').html('The highest score is your highest priority'); } $(".comp-contain:last").click(function(){ $('#totals').css("display","inline-block"); return display_tally_total(tallyTotal); });
  17. Thanks Haku I think i understand the syntax of objects now. I have one other question about objects and then I will ask series of questions one at a time so that I can break my problem down into easy to handle chunks. 1. How do I use a variable for the property name when creating a new property for an Object: Does this work? Var someText = "some text"; var tallyTotal = {}; tallyTotal.someText = 1; 2. How do I create a new property for an object and increment its value using Jquery? $('.comp1 p,.comp2 p').click(function(){ var someText = this.getAttribute("id",2); tallyTotal.someText=Number(); tallyTotal.someText++; });
  18. Hi Haku Thanks for the reply. After hours of trying to debug last night I realized that my code is shot all to hell. For example, Im trying to pass jquery objects into a for in statement and I dont know whats going on with the scope of my tallyTotal object. Im trying to combine Jquery selectors and standard JavaScript functions together and its not working out. I have read, in (Java Script: The good Parts) that I should not use and array vs an "array like object" when using strings for the index of the array. Do you argue otherwise? Anyway, Ill get back to this thread tonight and try to clearly explain what Im trying to do. Also if you got a link to a personal sight where you accept donations I would be willing to donate. Thanks, Jerry
  19. Are you using Firefox's Fire bug or Chrome's equivalent? Using those tools -- If you look under the console tab while reloading your page you may find errors that help you. Are your file paths correct when linking your JS files... I.E. you may be missing ../ <script type='text/javascript' src="../js/jquery.js"></script> <script type='text/javascript' src="../js/register.js"></script>
  20. I am having problems with my code. The inline notes may help you figure out what is going on. 1. I dont know if my function is actually incrementing the dynamically created tallyTotal properties. 2. I dont know how to display the contents of an object with enumeration. If this is confusing make fun of me and let me know, Ill try to clarify, Thanks for any help! --Edit, Now that I start to read JScript best practices on the sticky in this forum I see that I must use square bracket notation when referring to objects. Ill try this-- Please still help with other errors HTML <div style="display: inline-block;" class="comp-contain"> <div style="display: inline-block;" class="comp1"> <p id="Item1">Item1</p> </div> <em>Or </em> <div class="comp2"> <p id="Item2">Item2</p> </div> </div> <div style="display: none;" class="comp-contain"> <div style="display: inline-block;" class="comp1"> <p id="Item1">Item1</p> </div> <em>Or </em> <div class="comp2"> <p id="Item3">Item3</p> </div> </div> <div style="display: none;" class="comp-contain"> <div style="display: inline-block;" class="comp1"> <p id="Item1">Item1</p> </div> <em>Or </em> <div class="comp2"> <p id="Item4">Item4</p> </div> </div> <div style="display: none;" class="comp-contain"> <div style="display: inline-block;" class="comp1"> <p id="Item1">Item1</p> </div> <em>Or </em> <div class="comp2"> <p id="Item5">Item5</p> </div> </div> <div style="display: none;" class="comp-contain"> <div style="display: inline-block;" class="comp1"> <p id="Item2">Item2</p> </div> <em>Or </em> <div class="comp2"> <p id="Item3">Item3</p> </div> </div> <div style="display: none;" class="comp-contain"> <div style="display: inline-block;" class="comp1"> <p id="Item2">Item2</p> </div> <em>Or </em> <div class="comp2"> <p id="Item4">Item4</p> </div> </div> <div style="display: none;" class="comp-contain"> <div style="display: inline-block;" class="comp1"> <p id="Item2">Item2</p> </div> <em>Or </em> <div class="comp2"> <p id="Item5">Item5</p> </div> </div> <div style="display: none;" class="comp-contain"> <div style="display: inline-block;" class="comp1"> <p id="Item3">Item3</p> </div> <em>Or </em> <div class="comp2"> <p id="Item4">Item4</p> </div> </div> <div style="display: none;" class="comp-contain"> <div style="display: inline-block;" class="comp1"> <p id="Item3">Item3</p> </div> <em>Or </em> <div class="comp2"> <p id="Item5">Item5</p> </div> </div> <div style="display: none;" class="comp-contain"> <div style="display: inline-block;" class="comp1"> <p id="Item4">Item4</p> </div> <em>Or </em> <div class="comp2"> <p id="Item5">Item5</p> </div> </div> JavaScript var tallyTotal = {};//object that a function will push data to. $('.comp-contain').css("display","none"); // Hide all Divs so each can be displayed singly. $('#comparisons div:first-child').css("display","inline-block"); //Show first Div whith 2 options to click on, the user clicks on one to proceed. //this next section is suppose to tally the users clicks of a clicked div with the ID of that div being pushed to the tallyTotal object as a property and its value being incremented up. Then I also change the containing div (comp-contain) css display poperty to none, then display the next sibiling div, which the previous process is repeated until the list of comparisons is done. $('.comp1,.comp2').click(function(tallyTotal){ var ID = $(this).attr('id'); tallyTotal.ID+=1; //Im guessing this is wrong, how do I do this? $(this).parent().css("display","none"); $(this).parent().next().css("display","inline-block"); }); $(".comp-contain:last").click(function(e){ $('#totals').css("display","inline-block"); function display_tally_total() { var x; for (x in tallyTotal) { $('#totals').append('<p>' + x + ' ' + tallyTotal.x + '</p>'); // Also wrong? Trying to Enumerate through the tallyTotal Object, dispaying the property name and its value } } display_tally_total(); });
  21. Thorpe, Thank You All I needed to do was instantiate the parent constructor within my subclass constructor and all was fine. Thanks Again.
  22. Ok I may be on to something. http://us3.php.net/manual/en/language.oop5.paamayim-nekudotayim.php A couple questions 1. Am I suppose to be using :: to access functions from the class I'm extending? 2. If I'm extending a class that has a constructor and I create another constructor in my extended class then instantiate the extended class do both constructors run, or does one have precedence? Thanks Jerry
  23. Thanks Thorpe Yes the error is generated by Lexer.php which I attached. Here is my class code that is giving me the errors. require_once '/library/HTMLPurifier.auto.php'; $db_info = array ('host','user_name','password','db','table'); $purifier = new HTMLPurifier(); class s_v extends HTMLPurifier { public $clean_array; public $empty_fields_array = array(); public $invalid_fields_array = array(); private $db_info; public function __construct($dirty_array,$db_info) { foreach ($dirty_array as $key => $value) { $value = $this->purify($value); } $this->clean_array=$dirty_array; $this->db_info = $db_info; echo "'$this->db_info[0]'"."'$this->db_info[1]'"."'$this->db_info[2]'"."'$this->db_info[3]'"; } } $sv = new s_v($req_post_array,$db_info); There are notes in the lexer.php file. Thanks again. It would be awesome if you pointed me in the right direction even if you don't have time to help working out the solution. 17751_.php
×
×
  • 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.