[Solved] Issues with ajax contact form inside wordpress theme [closed]

[ad_1] Nothing Happens when you click submit because in your js you are calling this $(“.comment_form, .contact_form”).submit(function(event) and you have used event.preventDefault(); , therefore the form does not show default behavior. Check the console there is an error in you js. It says TypeError: $(…).block is not a function. you need to fix these errors … Read more

[Solved] A Parse error with the PHP mysql Class function of insert method

[ad_1] This line of code isn’t closed: $this->query(“INSERT INTO testing_Rand (number1, // etc and you are missing a ; after this line: $newRand.=implode(‘,’, $varNum) If I get it, you meant to write this instead: public function insert_SQL($varNum ) { $this->query(“INSERT INTO testing_Rand (number1, number2, number3, number4, number5, number6, number7, number8, number9, number10) VALUES (“.implode(‘,’, $varNum).”)”); … Read more

[Solved] PHP: How to create a linear function, calculating a credit card fee? [closed]

[ad_1] I’ve got what you want, so think in this way: you have original price you want to calculate final transferAmount that: transferAmount = originalPrice + fee but fee here depends on transferAmount fee = transferAmount * 0.029 + 2.25 now solve it: transferAmount = originalPrice + transferAmount * 0.029 + 2.25 transferAmount*(1-0.029) = originalPrice … Read more

[Solved] Why mysql_num_row less than condition doesn’t work?

[ad_1] Use this: <?php $sql=mysql_query(“SELECT ID FROM emp WHERE user=”$login_session””); // its currently zero $row=mysql_num_rows($sql); $b = 3; $tot=$b – $row; echo “$tot”; if($row < $b) { echo “good”; } else { echo “wrong”; } ?> You have been trying to output variables, which is not defined. You code was: Ouput undefined variables Assign something … Read more

[Solved] How to store and display an image in MySQL database

[ad_1] Well, you gave a different name for the file in the input file tag in your form. Change this <input type=”file” name=”image” ><br> to this <input type=”file” name=”file” ><br> and it should work. Let me know if it doesn’t. You may also consider putting the contents in upload_file.php in an if-conditional to prevent it … Read more

[Solved] mySQL data type for form elements

[ad_1] 1) you will get string as the value of radio so it will be varchar type 2) for check boxes any one can have multiple values so you need to create a separate table(working_project) for this values( data type will be same as radio) and another table for mapping(user_working_project) user_working_project table will containing user … Read more

[Solved] PHP Displaying of page issues [closed]

[ad_1] You need closing parenthesis on every line that has one opening. Example: move_uploaded_file($_FILES[“thematicseniorphoto”][“tmp_name”], “uploads/” . $_FILES[“thematicseniorphoto”][“tmp_name”]; should be move_uploaded_file($_FILES[“thematicseniorphoto”][“tmp_name”], “uploads/” . $_FILES[“thematicseniorphoto”][“tmp_name”]); EDIT: Next time use a while() statement and find a pattern of text to search/use. You’ll go from 700 lines to like…20. [ad_2] solved PHP Displaying of page issues [closed]

[Solved] How to compare two different extension files in php? [closed]

[ad_1] Its basic. <?php $ext= explode(“.”,$filename); // explode filename by “.” $extension= $ext[1];// get extension. if($extension==”pdf”) { // do something } elseif($extension==”jpg” ||$extension==”png”….. ) { // do something } ?> 0 [ad_2] solved How to compare two different extension files in php? [closed]

[Solved] PHP Get 2 data rows in single iteration [closed]

[ad_1] First get all data into an array. Then compose that array multidimensional array. So you can push two rows in every single key something like that. while($row = mysql_fetch_assoc($query)){ $data[] = $row; } $last_data = array(); $key = 0; for($i=0;$i<sizeof($data);$i++) { if($i%2 == 0) { $key++; } $last_data[$key][] = $data[$i]; } Then you can … Read more

[Solved] PHP Regex for Username? [duplicate]

[ad_1] This: $newStr = preg_replace(‘/[^a-z0-9]/i’, ‘_’, $str); should be: $newStr = preg_replace(‘/[^a-zA-Z0-9!@#$-]/’, ‘_’, $str); The code below should strip out: ‘”/\;?” <?php $newStr = preg_replace(‘/[^a-zA-Z0-9!@#$-]/’, ‘_’, “test\’\”\/\\\;\?”); echo $newStr; ?> Which produces: test__________% 4 [ad_2] solved PHP Regex for Username? [duplicate]

[Solved] Relation to many and get without this

[ad_1] In SQL, this type of query needs what is known as an EXCEPTION JOIN. Some RDBMSs actually implement this as a separate type (such as DB2), while others need to use a workaround. In your case, it amounts to (in SQL): SELECT User.* FROM User LEFT JOIN UserHouse ON UserHouse.id_user = User.id WHERE UserHouse.id_user … Read more

[Solved] What can I do to get this function to output?

[ad_1] What do I need to do to get output from this function? Just call the function: function recursion($a) { if ($a < 20) { echo “$a”; recursion($a + 1); } } recursion(1); // <— here Defining a function only defines it, not execute it. To execute a function you have to call it. [ad_2] … Read more

[Solved] Finding month preg-match

[ad_1] I make a snippet for you, so you can start from here $str=”December 2012 Name: Jack Brown”; $ptr = “/^(?P<month>:Jan(?:uary)?|Feb(?:ruary)?|Dec(?:ember)?) (?P<year>:19[7-9]\d|2\d{3}) (Name:(?P<name>(.*)))/”; preg_match($ptr, $str, $data); echo ‘For ‘.trim($data[‘name’]).’ – ‘.$data[‘month’].’ ‘.$data[‘year’]; the result will be ‘For Jack Brown – December 2012’ this is a array Array ( [0] => December 2012 Name: Jack Brown … Read more