I'm new to PHP and javascript and I've run into a problem where I need to edit values in an xml document that is read in. I have an HTML Select that has been dynamically created by PHP code. function outputTableRow() { echo "<tr>"; echo &q
I am newbie to android development. I am using android studio for developing an application. Things i have done Created a DB with two tables in it in MySQL. Created two separate api's for both GET and POST methods. Successfully accessed both api's Wh
I'm working on cart functionality in one of my projects. We are using Laravel 5.3 and cart item is stored in Laravel session as an array. So if I have 3 items in my cart (add_to_cart Laravel session) it looks like this: array:3 [▼ 0 => array:6 [▼ "
When first opening the mobile app homepage it returns an error "TypeError: Jqueryxxxxxx is not a function" although it shows the API callback results "jQuery111309512500500950475_1459208158307({"code":1,"msg":"Ok&qu
I have these links on my website: http://crw4u.be/werkgever.php (I can only add 2 urls in my question, since i'm a n00b) I added a code to htaccess so I can access these pages without the php: http://crw4u.be/werkgever It works fine with this code: R
I am having a problem when searching the database for utf8 enocded strings in MySQL. I have a kind of a social website with users and they are allowed to add descriptions for their profile and because in my country we use cyrillic alphabet the obviou
I have learned PHP and now I'm learning Python. I have written this code in both languages, but its behaviour differs. PHP: <?php $x = []; $y = $x; $x['key'] = 'value'; var_dump($x); var_dump($y); Python: x = {} y = x x['key'] = 'value' print(x) prin
I'm trying to append a number of NULL characters '\0' to a string in PHP. $s = 'hello'; while(strlen($s) < 32) $s .= '\0'; However, PHP adds 2 characters (\ and 0), instead of escaping the character and adding NULL. Does anyone know to add a NULL cha
I am trying to send a group of variables and using PDO to insert into my database, however when i run the page, i get an empty message box and nothing is happening on the page. This is how I am getting the user inputs. <div class="caption1" c
I have a simple AJAX call that retrieves text from a file, pushes it into a table, and displays it. The call works without issue when testing on a Mac running Apache 2.2.26/PHP 5.3 and on an Ubuntu box running Apache 2.2.1.6/PHP 5.3. It does not work
If variable value is 0 (float) it will pass all these tests: $test = round(0, 2); //$test=(float)0 if($test == null) echo "var is null"; if($test == 0) echo "var is 0"; if($test == false) echo "var is false"; if($test==false
How can we upload big files in chunks to a PHP server so that if the connection dies, the upload can be resumed at any time. Specifically, what libraries are needed in Android to do this? The users are uploading big files from countries with slow/uns
Which is better method to prevent XSS attacks? Here is the code I am trying to do. Is this line of code enough to prevent XSS attacks? or Do I have to parse each element with 'strip_tags'. Thank you for any suggestions. $xss = array_map('strip_tags',
I'm having a bit of a problem with a MySQL query in my PHP. I'm assuming it's down to a simple syntax issue and am hoping somebody here can help me out. The query is: SELECT * FROM `Threads` INNER JOIN `Categories` WHERE `Threads`.`Category_ID` = `Ca
I read a lot of similar topics, but i can't understand my mistake. Problem: Uncaught exception 'PDOException' with message 'SQLSTATE[HY093]: Invalid parameter number: parameter was not defined' in I:\home\lm.ru\www\classes\db.class.php:39 Stack trace
I'm using MODX the first time and it all worked since yesterday. I didn't change anything and the dashboard and the package manager worked without any problems but since yesterday I couldn't see the dashboard itself, just the top navigation menu in t
Hope Somebody will help me about how I bind a parameter in mysqli when a multiple character wildcard needs to be next to the variable value. I found that it worked for me when creating a SQL statement, like this: $sql = "SELECT item_title FROM item W
I have only one page with distinct sections managed with AJAX. In one section (1) I add and edit company names. In the following section (2) I display these company names. (Please see attachment) When I have edited a company name in section 1 (alread
You know you can make a server parse HTML pages as PHP (execute PHP code in a HTML doc) using .htaccess? Well, some people say it's bad to do so. Why? Some people also say it opens a security vulnerability in your application. How? The source code is
I have an array, I want the result to be like this: type id, name. username, password, email. Array ( [0] => 1 [id] => 1 [1] => xyz [name] => xyz [2] => admin [username] => admin [3] => 200820e3227815ed1756a6b531e7e0d2 [password] =>
How to execute Multiplication Operation in a Mysql Query? If my query is like this : "SELECT registration.hosteladmissionno, registration.student_name, registration.semester, student_month.hosteladmissionno, student_month.student_name, student_month.
$flag=0; if($q->num_rows > 0) : echo '<div id="testimonial">'; while($r = $q->fetch_array(MYSQLI_ASSOC)) : if($flag=0) : $class=test1; $flag=1; else : $class=test2; $flag=0; endif; echo '<div class="'.$class.'">';
Concerns a project I am undertaking for my degree. Its a simple question bank where questions are stored in a database and later used to generate a question paper with random questions in a fixed template. I was successfully able to implement this us
Using MySQL The two fields I need to compare the current date to are: startDate, endDate I need a query something like this: SELECT * FROM `{$this->_sPrefix}` WHERE `profileID` = '{$iProfileId}' AND CUR_DATE() BETWEEN `startDate` AND `endDate` ORDER
I am using the next decorators for my input. I want to make this as table. $this->setDecorators(array('ViewHelper','Errors', array(array('data'=>'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row'=>'Ht
I'm running Ubuntu 10.04 with Apache2 and PHP5. I have a directory structure like this: \www\ \index.php \parts \head.php \body.php Inside my index.php I have a command <?php include("parts/head.php") ?> and the equivalent for body. These
I got in every php project (around 25!), some sh scripts that help me with routine tasks such as deployment, repo syncronizing, databases exporting/export, etc. The sh scripts are the same for all the projects I manage, so there must be a configurati
Wildcards are cool. I am trying to do this: $route["(:any)/controller"] = "controller"; basically, I want to put the wildcard in the front. It doesn't quite work, and I don't know any work around.Should work. If it doesn't try shufflin
I am using the widget sfWidgetFormChoice(array ( 'choices' => CountryPeer::getAllCountry(), )) and validator as sfValidatorChoice(array ( 'choices' => array_keys(CountryPeer::getAllCountry()), )) I get a select element as <select id="country
I have a list of images that need to be displayed. However theres only space for 5. I need to display 5 of these at a time randomly. Whats the best way to do this?If you have the list of images in an array, you could use shuffle().