« first day (280 days earlier)      last day (30 days later) » 

8:02 PM
0
Q: find and replace smilar keywords with url parameters

Nurettin Acari have text and my keywords with url so i want to find smilar keywords and replace them with url . $text="Didimin, Aydın'ın turistik bir ilçesidir. Didimdeki sahil şeridi ve altınkumdaki plajları ile birlikte akbükteki plajlarda...."; $urls=array('didim'=>'didim.html','altınkum'=>'altinkum.html...

-1
Q: Querying three tables in MySQL

steepedI have three tables: notes, users, and documents. I am trying to query the tables to display all the notes belonging to a specific user, and grab all the documents in the documents table that are associated with the notes. The query below doesn't work... what is the proper query? Thank you! SELE...

0
Q: Simple XML removing string between tags

setiI have XML contains product. I need take from this XML: description, price, weight etc. When I opening XML using SimpleXML and printing i don't have text between tags. This is piece of my XML <product id="30" currency="PLN" code_producer="M-1100/21"> <producer id="1282294004" name="MAT linger...

0
Q: How to get posts that have a specific tag or don't have a specific tag

user2502562I'm editing a wordpress index page and I want to get a post that has a specific tag "Feature", this is the code (previous person's code): $args = array( 'numberposts' => 4, 'post_status'=>"publish",'post_type'=>"post",'orderby'=>"post_date",'tag'=>"Feature",'category'=> "-27,-454"); But it doe...

0
Q: PHP Rounding Issue When Diving by 100

BillI have a value coming from an array that needs to be converted to a percentage. My issue is that when I divide by 100 I seem to lose the number after the decimal point. For example, I need 56.5 to become .565 and this makes it .56. I've tried using round() number_format(), etc. to no avail. $...

0
Q: php: Create array with ojects or how to get rid off extra quotes symbols

pakaI store some data in file, that looks like this {"name":"name1","uuid":"uuid1"} {"name":"name2","uuid":"uuid2"} than with php I convert it to JSON with next code $file = "someData.json"; $content = explode("\r\n", file_get_contents($file)); $output = array( 'someData' => array_values( array_...

0
Q: How to change content of my android app via webserver?

Michael Joseph ImahenI am creating an android app that is use to conduct surveys. the survey questions are generated from a website. Now, how can i send this questions to my app? pls help me

0
Q: Preventing directory traversal in PHP page

BasI'm on a website that offers several safe programming/hacking excersises. Not really homework, I'm just doing this for my own betterment. One of the lessons is about preventing directory traversal in PHP. This is the given code: $pagedir = "pages"; if (!isset($_GET['page'])) { header("L...

0
Q: Fine Uploader for S3 server side CORS via ASP.NET usage

sthedeI am converting a working copy of the s3demo-cors.php example code, to ASP.NET. I am trying to understand in which instances the CORS handling is required. For example I see that the PHP code calls the handleCorsRequest() before attempting to delete an object. Why would the server running the ...

-1
Q: SQL INSERT has no effect

runelynxMy SQL insert statement is resulting in nothing being added to my table. I have similar statements to other tables that are working fine, so my connection and database setup seems to be working OK. It's something specific to the INSERT that is going wrong. Anyone have any ideas? MySQL table stru...

0
Q: PHP Warning: socket_bind(): unable to bind address [98]: Address already in use in

user3038095Seguinte, Estou desenvolvendo um sistema de rastreamento veicular utilizando PHP, com o equipamento ST240, da Suntech. O equipamento se comunica a um servidor, previamente configurados IP e PORTAS, eu utilizarei o PHP pra 'ouvir' essa porta com sockets, confesso que não entendo de sockets, por ...

0
Q: MySQL 'select WHERE like x OR y' multiple results for one row

user3011922Alright, I tried to word the title as well as possible. Here's what I'm looking for...let's say I've got a row with an ID of 3 in a table called 'table' with a 'col1' value of "apple,potato,carrot,squash" that I want to search. I want to be able to do a search something like this: SELECT * F...

0
Q: Using Named paramters in CakePHP 2.x

CameronI have the following method which takes a query to search my notes: function search( $q = null ) { if ( $q == null ) { $this->redirect(array('action' => 'index')); } $this->paginate = array( 'limit'=>5, 'order'=>'Note.datetime DESC', 'conditions' => array( ...

 
8:41 PM
1
Q: PHP doesn't free my memory?

Michael HirnI have the following code, which receives data from a database ( quite a lot ) and passes them to a function which is processing those data. Here's what the codes looks like. for($o=0; $o<$times; $o++) { echo "Before Data: ".memory_get_peak_usage().PHP_EOL; $data = $u->getDat...

1
Q: Pass value from dynamically generated table

user3038125I am new to php. I have created a code that generates table of products dynamically. I want to submit particular product to add that product in cart and Product_id should be pass to next page. I am using form for that. However, the problem is I dont know how to pass value to other page. here is ...

0
Q: XSS leak when not using htmlspecialchars

ArianSome one told me that this code is open to XSS LEAK... I tried googling it and not much information showed up, except just ways how to perform the leak. My question is what am I really subseptible if I am not using htmlspecialchars(), can someone edit a $_POST[] variable to be <?=$db_password?>....

1
Q: Paypal Completed Transaction Cookie on client - Need to expire as Leaves Shopping Cart Filled

user2971434Been reading posts and testing solutions for days..... Basically, when 'Add to Cart' button clicked, Paypal creates 3 cookies on client. When Checkout completed, another 3 cookies created on client. All appears fine until user views Paypal basket and contents previously purchased are still there ...

1
Q: Call by category id's and not each individual product id's

jrizzle88I am trying to filter the payment gateways by category id's. Each category has child categories but I was hoping we could call just the main parent category id. Which are Invoice and Credit. https://gist.github.com/JRizzle88/7665367 The gist above is actually a set that is separating the produc...

0
Q: Unable to load the requested file - codeigniter on hostmonster server

EmekaI've been trying to host an application design with codeigniter framework for days on at hostmonster.com but I continued having this disturbing error - An Error Was Encountered Unable to load the requested file: Desktop\resourceBatch\stylesheets.php NB: Desktop\resourceBatch\stylesheets.php ...

0
Q: Joomla link to category

Stefano MaglioneI've a custom module with some href that refer to a single article like this: <a href="index.php?option=com_content&amp;view=article&amp;id=5&amp;Itemid=473"> or <a href="index.php/9-articles/7-sport"> When I click on link,the relative article is showed, but I would refer to a category ,as...

1
Q: Angularjs - dynamic pages, same template, how to access and load article by id

Persistent NewbieI am slightly puzzled on how to use angularjs to build a blog-like web site. If you think of an ordinary blog,,, and say,, I am building it using php and mysql.. what I don't understand is how do I make angular get an article based on id.. I can load data for a list of all articles.. I can load...

0
Q: How to run a script which uses ZendFramework library from CLI

asdk77I intend to run a script using ZendFramework library from CLI. My script is as following: require_once 'Zend/Loader.php'; Zend_Loader::loadClass('Zend_Rest_Client'); It can run in a browser, but failed in a command prompt. How can I let the script run from CLI? Thanks!

0
Q: Don't have access to post meta in save_post action

MaazSo what I've noticed is that if I check for a meta value in my save_post function, it comes as blank, meaning the meta value hasn't actually been entered into the post. Looking at this code for example, function order_mirror_create($post_id) { global $post; if($post->ID == ''){ ...

0
Q: Integrating Ink File Picker and Aviary

user3038148I want to be able to upload a image with Ink File Picker, edit in Aviary and than save it to Amazon S3 or dropbox or something with Ink FIle picker. Used this "guide" https://www.inkfilepicker.com/products/aviary/ This loads Ink file picker at the end but the user has to choose location, I want ...

0
Q: Uploading multiple files via PHP and posting information to MYSQL database

RuFFCuTI am trying to upload multiple files to the server, while inputting upload information into a database. For some reason only the first or last file is being put into the DB but I can not for the life of me figure out why! Any help appreciated - thanks! public function processNewUploads() { ...

0
Q: return value from function with post

user3038167I have function: function test(){ $.post('data.php', function(val){ return val; }) return 'error'; } and i use this simply: console.log(test()); post is doing - return good value, but function test return me 'error' instead of value from data.php. Is possible get value from...

0
Q: laravel 4 where to store select field values? database or array?

user3038158I have a table e.g. - id (PK) - name - manufacturer_id - material_id - strength_id And now my question is, where I should store the id -> values? Should I create a new table for each foregin key? E.g. manufacturers, materials, strengths? Or should I save them into an array and access them with...

0
Q: Capturing some different part of text and replacing with another

wwwThere is a deprecated function in PHP and for that reason, I need to replace all functions with their replacements. Since some of the arguments have different values, I need to use a regex find-and-replace method to do this. For example I have two functions: mysql_result($one,0,"val1") mysql_re...

0
Q: Double curly brace (complex) syntax or replacement in PHP

Michael J MulliganMy question is short, as I am sooo close. Basically, I have an JSON API that returns strings that look kind of like "This is a string that is in side an object with the name {{a_object.name}}". Of course, this is note exact, but imagine the object is of structure: response = { a_object: {...

0
Q: Processing POST data from a third party

user2292539I have been struggling with the following problem for a few days. I have a company that I am tasked with receiving POST data from for certain real time events. I have been in contact them as to why my script isn't seeing anything but they are less then helpful and just tell me "it works for every...

0
Q: PHP/CSS change background image depending on running session

Xation1993I have a problem changing the background image depending of what area I'm in. If I open the file in the browser it looks like this: background-image: url('CHRISTIAN/images/forest.jpg'); <?php session_start(); header("Content-type: text/css"); if($_SESSION['in_area']==false){ $backgroundimage =...

0
Q: Browser Compatible Speech to text API

SupraI am looking for a speech to text API for my project. I have already gone through x-webkit-speech, its exactly what I need. Can anybody suggest me something like this which is also compatible in Firefox ? To be more specific I need to add an API to a text-area of a webpage which needs this kind...

0
Q: Sending an image through $http.post

Patrick ReckI am trying to catch a file using PHP and AngularJS. However, I cannot send the file successfully using AngularJS. HTML <input type="file" ng-model="image" onchange="angular.element(this).scope().sendFile(this);"> Angular function $scope.sendFile = function(image) { var postData = { ...

0
Q: Nav position fixed on scroll wordpress

user1652997I was wondering how I can achieve an effect similar to this website. When you scroll down the site the logo disappears but the menu remains fixed: http://www.nowness.com/ This is my site: http://www.itsalifestylething.co.uk/quick-cupcake-catch-up/ PHP <body <?php body_class(); ?>> <div id="pa...

0
Q: How to add ubuntu user from php exec or php called script

LouieVI have done some research and have not been able to come up with a solution on how to add a user. Using exec(sudo -u root useradd -d $path -m -g ftpuser -s /bin/bash -p $password $userName", $output, $return) the user gets added but if I try to su to that user I get an authentication error. My P...

0
Q: PHP MVC framework and Events - when to use them efficiently?

MatthewMost of the MVC frameworks today use the observer pattern and allow developers to subscribe and listen for their own events. For example Laravel has a package illuminate/events, ZF2 is called an event-driven MVC framework and has a package zendframework/zend-eventmanager, Symfony has an event dis...

0
Q: Get strtotime to find next timestamp at given time

RoboFormI'm trying to make strtotime give me a timestamp, but I only know that it's a hour and minute and it's the next in the row. Fx. If the given hour and minute is 01:00 (AM) I require it to return the timestamp of 01:00 (AM), if it is the day before at 19:00, I would like it to return the timestamp...

0
Q: deleting entire row with jquery json ajax php

JimenaWhat i want to achieve is to delete an entire row. First i display the table, then if you click on "delete" button from every row then a confirmation modal shows up asking you if you want to delete that row. I'm trying to work with jquery, ajax, json and php. I'm still learning of course. So fa...

0
Q: Bitmap not being upload to server if loaded with decodeFile() in Android

GeorgiI am uploading a picture taken by user in Android to my shared hosting using PHP post request. I keep the file path to the picture so I can decode it as Bitmap and then send it to the server. If I try to use decodeResource with test image for creating the Bitmap it all works fine, however if a lo...

0
Q: Call To A Member Function On A Non-Object - PHP

mike jonesCan someone show, fixed or tell me why i am getting this error Call to a member function getRating() on a non-object Here is the function public function getRating($movieid){ $movieid = mysql_real_escape_string($movieid); $average = 0; $e = mysql_query("SELECT AVG(`rating`) as ave...

 

« first day (280 days earlier)      last day (30 days later) »