« first day (258 days earlier)      last day (52 days later) » 
00:00 - 15:0015:00 - 00:00

3:02 PM
0
Q: MongoDb delete by parametr

Vladimir ShabuniayeuI try NoSQL. I know how delete by id $criteria = array( '_id' => new MongoId('5277aeb6b28fada80a00002b'), ); $users->remove($criteria); but how to delete if you new for example value, like "name"="John"

0
Q: saving script variables from php variables in while loop

PeterPbeen trying to save my data from my while loop to script variables but no success. Did an example if how I want to save my php data to script variables. This doesn't work for me. Anyone have any idea? Don't want to save all data manually. Very greatful for answers! Ask if you don't understand :) ...

-1
Q: Search files through database or file system

bvlI have 6.000.000 XML files with data. What would be the fastest way to search them. 1) Search the files through the filesystem 2) Put the files in DB and search using the DB 3) ??? I use: Ubuntu, PHP and mySql

0
Q: How to average multiple columns and rowns from mysql with PHP?

Luís AssunçãoSo.. my doubt is... i want the average of time that goes from "Data Pedido" (Start Date) to "Data" (Date of Resolution) in every row. Per example... in row 2, its 3 days, row 3, 0 days and so on... and in the end, show the average of those. But the problem is, i cant define one period, the employ...

0
Q: Yiiframework message pop up

York KeijzerHe there! If have a question that is related to two different issues I currently have in an application I'm working on. Issue 1: - There is a message system. Users are able to send each other messages. I would like to have a real time pop up when the user gets a new message and is not on the ...

-3
Q: php: can't create class variable from function

Alan Pirallasorry for the noobish question. I'm new with PHP class programming and I can't figure out why this piece of code doesn't work: class Job { private $var1 = 'hi there'; private $var2 = date('Y/m/d'); public function foo() { /* some code */ } } $job = new Job(); I get parse error pa...

-3
Q: What is the difference between local host and server?

JOB S PARUTHICKALWhat is the difference between local host and server? give me detailed step on how to get localhost of a website on my computer?

0
Q: Wordpress WP_Query, in category_name but not in specific category

ConjakHi have a category with children categories in it. i want to show almost all categories except for some.. This is pretty much what I want to achieve: $slug1 = '1998'; $slug2 = '1999'; $slug3 = '2000'; $slug4 = '2001'; $slug5 = '2002'; $cat1 = get_category_by_slug($slug1); $cat2 = get_category_b...

1
Q: Edit Page in prestashop 1.5

Antonis AmpaHow can edit About Us and create an other pages in PrestaShop 1.5 from Admin work area; Can anyone help me. I found how can create a page via code but I don't need that. I want create and edit from administrator area.

2
Q: Why would MySQL functions be in their own class?

ParadoxicalAfter looking through the source code for FluxBB (a forum system), I noticed they have a DB class with functions like "query". Then instead of using mysql_query(), they can use $db->query() (if you'd like to see what I mean then I've pasted the file containing the class here: http://pastebin.com/...

0
Q: How can I get php variables into a linux script?

user2943416I'm trying to work out how to get variables from php into a script because I want to create a user registration page so users can register and the php will call a script and send the variables to it. Specifically this line i'm having trouble with (its in the php page): PHP: $results = bash ...

0
Q: Putting £ symbol into excel from PHP?

Jason KingI'm trying to insert a £ symbol into an .CSV file using PHP. Currently I'm doing this $list = array( array( $row["order_id"], $c_client, $c_media, $row["insertion_date"], "£".$row["buy_cost"], $row["sell_cost"], $commsion_row_total,...

0
Q: Yii CGridView - set default afterAjaxUpdate callback

Aspeddoes somebody know a possibilty to set a default function in CGridView, which will run on all grids on the page after every AJAX update? I use the CGridView on many pages, and I don't want to specify this function for each grid separatly. I need this because I use jQuery selectmenu for my filter ...

0
Q: Laravel, storing encrypted secrets in a MySQL indexed column

SlyI kind of know the answer to this already but I wanted more of a general opinion of which way to go next. I want to have users' emails secured by encryption in my application's database, but emails being emails I also want them as an index as well on the user table. I was doing my seeding of th...

0
Q: CodeIgniter and dependancy injection / Controller injection

James TI would like to be able to do controller injection with codeigniter. Is there a library that changes the core controller file for it? My use would be something like this (pseudo): Factory file if ( Controller == "Navigation" ) { new Navigation( new PageRepository() ); } else{ new Nav...

0
Q: Can't write on Database from Form

John GarnettWell I have a problem, but I can't find it. I changed everithing and tried everything different everytime, I ended up with this coded which it looks good but still doesnt work. I would like to know if someone can help me to find it. Here the action of the form: <?php $lname = mysql_escap...

0
Q: in Twig how to compare if date is within X days?

AlanChavezI'm using twig to flag a row in a table, if the date associated with that row is less than 30 days old. Twig's documentation states that to compare two date objects, you have to convert the object to date first, and then make a comparison this way: {% if date(yourDate) < date(-'30days') %} ......

-12
Q: Why does this code-snippet not work?

Moritz Hupedear stackoverflow users! I really need your help with this code. I want to read the just uploaded image ID and take it from the folder to show it. But now it doesn't show anything.. <? echo '<img src="localhost/uploads/'file$id'.tmp"/>'; ?> Thanks for any help!

0
Q: Print in PHP in Bixolon printer

user2952996I have a problem to print a sale recipe in a Bixolon SRP - 275. I try with two ways: 1st: Create a pdf with FPDF (http://www.fpdf.org/) and send it to print. 2nd: Create a web page in html styling like with FPDF and when I send to print i delete all header and footer in order to only print we...

0
Q: Encoding and Decoding not working on Wordpress Comment

Vinoth KumarAm designing a wordpress captcha comment, in that I need to pass the value to verify with the entered value. So that I used input box to be hidden. So far worked good, after adding the encrypt and decrypt code shown below, the comment is not working properly. Actually the page is not loading full...

0
Q: Fuelphp migrations

notmiiHi guys does any one know how to migrate an existing database to new schema ? for example my current table schema is id: int(10) name: varchar(100) and the table is already populated by production data. Later on I decided to add a new field to the table. The new table schema would be id: int...

0
Q: Wordpress create user from FB connect with recommendor's ID

PShahI have third party code which creates user with Facebook login on Wordpress blog. I wish to store coupon code which will be part of blog URL and write that code in extra field. (ex: http://myblog.com/?coupon=xyzabc) The user creation is very complex so I wish coupon-code to be stored either in s...

0
Q: Tracking changes and different itterations of a configuration file

madphpI have a number of different versions of a php application, configuration file. Currently the conf folder is being ignored by git, but I'd like to track the changes to config.ini separately, and also label where each version of the config.ini should be. We are not using any specific deployment to...

0
Q: Wordpress / Jquery ajax, get works post fails with jquery error

SamHi all the following function will work and do exactly as I want it to but I want this to be a .post not a .get can anyone see a problem with the following? its pretty much straight from another answer on stack overflow and should work fine. jQuery(document).ready(function() { //This fu...

0
Q: Wordpress Get Theme Default Menu

Ricky MatakaI have the need to dynamically add menu item to a wordpres menu I figured how to do this.. the issue is I have to tell it which menu to add it too. Well the problem is this is a plugin that can get installed on any theme itself. Im having trouble figuring out a way to get the default or active m...

0
Q: Download php genereted csv file though jquery/javascript

ShahidI can download a csv file from php, but I need to do it via jquery/javascript. what would be the best solution for that? Save php generated csv file in tmp dir and download via jquery/JS but how?(app used internally) Send array of data back to frontend, do all in jquery/JS. Actually I want t...

0
Q: Why won't the font size increase inside my <td>

Joel LewisI have a PDF that is being generated by TCPDF in php. The whole thing looks great, but I cant increase the size of font in any section of the table that is generated. My CSS is not great, but any idea what I am doing wrong? CSS: <style> } table.first { color: #0033...

0
Q: Zend Framework 2: create sidebar

StonerI'm trying to understand how is possible to generate the code for sidebar with diefferent content per module. This is my layout.phtml (module/Application/view/layout) .... <div class="main-container"> <aside> <?php echo $this->sidebar; ?> </aside> <section> <?php echo $this-

0
Q: Pulling JSON object from JSON array

NoobsterI have been surfing SO for quite some time to find an answer to my question, and I have to admit that I am stumped. I think I must be missing something very simple here but right now I can't see the wood for the trees. I am trying to load a highchart via JSON, and the JSON is created by a PHP ar...

0
Q: warning: failed to open stream: No such file or directory - When rendering registration form with two models

Ahmad DajaniI followed the guide to make a registration form using two models (User,UserInfo) but when I view the registration form a warning (include(data.php) [function.include]: failed to open stream: No such file or directory) pop up and I really don't understand what cause this warning. Here's my code: ...

0
Q: xgettext output to specific folder

JohnI am new using xgettext for php So I don't know what am I doing wrong. I put the command xgettext -n *.php -o --output='/home/public/sample' in my script but I get an error: xgettext: cannot create output file "--output=/home/public/sample": No such file or directory But when I run xgettext -n ...

-2
Q: Error with my code?

Mackan90095I'm making a project for my school. It's a page-source viewer, but I've ran in to a problem.. Using google chrome, I get this error: Uncaught SyntaxError: Unexpected token : main.php:10 HTML: <html> <head> <title>Codeview - See how your code turns out!</title> <link rel="s...

0
Q: Special Spanish Characters not displaying, Codeigniter MySQL

Francisco OchoaSpanish special characters are not displaying correctly, a word like: 'Árbol' is displayed like '�bol'. 1) Text in database is saved correctly. 'Árbol' looks perfect on database. 2) If I insert a new word, eg. 'Tétrico', it is saved correctly on database. I've been experiencing this problem...

0
Q: Yii upload a file using a model

E2BI am simply trying to upload a file using a model. I get the exception message in the current situation (see model/controller/view below): CException MyFile and its behaviors do not have a method or closure named "save". If my model extends CActiveRecord instead of CFormModel there is an anot...

0
Q: Replace variables from .tpl file

Joran Den HoutingSituation at this moment I'm using this function: public function fetch($file){ $file = $this->options['template_dir'].(string)$file; if(file_exists($file)){ ob_start(); if($this->options['extract']){ extract($this->vars); } include $...

0
Q: mysqli aggregate fetched values

zogbyI'm trying to write class that encapsulates mysqli logic (strongly using stack overflow articles) and I've encounetered this problem: $row keys reference to the recent values that've been fetched, and so does the array $rows, in which I want to aggregate fetched values. How those references can b...

0
Q: PHP Form Post back to same page checkbox selected

Homer_JI have a simple form that has a checkbox on it. If a user selects it and the submits the form (the form posts back to the same page) - how can I ensure that the checkbox is selected when the page re-loads?

0
Q: CakePHP v2.x bake. How to bake model that cross database, and models with recursive structure?

ZorjiI have an application in the following structure, a master database with all the users information in it, and N instance database that each has its own news, and resource folder. My news table in the instance has the following structure: id INT title TEXT content TEXT user_id INT And the user...

0
Q: Connect Android app to external Database (phpmyadmin)

user2953054I'm trying to connect my android application to an external database. I have some php scripts on a ftp server that provide some function for my database. On my phpmyadmin database i have a table 'users'. when i try to insert a new user my android app access to my php scripts but then the "mysql_q...

0
Q: Drupal reset password: Fatal error

DrupalStarterWhen I create a account on my website, then I get a email with instrutions to set a password. When I click on the link, than I get a login button. I can only click one time on it. But when I click i get this error: Fatal error: Call to a member function access() on a non-object in /sites/al...

0
Q: Get a simple JSONP object from a remote server php file using ajax (and jquery) embedded in javascript directly in my wordpress page

JohnI have some php written on a static wordpress page (using the include-php-in-pages-and-posts plugin) that gets a JSON object from a remote server. This of course just works once on page load, and then never again (as it is not ajax). But as the call is sent to a server with its own php and throu...

0
Q: WordPress adding random strong tags, breaking divs, when accessed from google

Joshua RichardsThis is extremely strange. When I visit dfcmopen.com directly from the address bar, all is well. If I try to search for the site, then access it from google, I see the page code and a bunch of broken divs. Upon using the inspector, I see that tags are being added randomly ie: " <" <strong>

0
Q: Should I support IE?

M.Sidim1 - Should I support IE at all? 2 - Also, should programmers in general support IE? I have noticed that whenever I use JQuery, it seldom works in IE. Using HTML5 is no problem, but using JQuery and PHP often generates problems. Sometimes using a compatibility mode in the meta tag will make it wo...

0
Q: select foreign table names to pull-down list and insert into other table with id only

user2952495I have done some database normalization and made for the product table a foreign producttype table because of the fixed value's. Now i run into some php form problems. I am trying to make work: adding a product and make a producttype option (producttypes from pull-down list) and store only the ...

0
Q: PHP Session Getting CorrectValue

ms061210Question: What to do to fix my problem on handling the session because it is returning an incorrect value. Situation: I'm having problem on this session variable from the table. I added data from database to a table using while loop. Here is my code: <form action="edit2.php" ...

0
Q: server side experiments per country

justaguyI'm trying to run a very complex analytics content experiments. I have more then 50 offers, but I display a max of 3 per page which are selected based on user geo location. There can be 1 offer for one country visitors and 5 offers (which I need to test which one works better) for another country...

-2
Q: My website is not working properly in IE 7

PhaniRecently i developed one website which is not working(Menu) fine in IE7,IE6 help me with this issues and i want every things on center which is also not working properly. Website URL : vtradefair/fair/home.php not working pages vtradefair/fair/stall.php vtradefair/fair/auditorium.php Id : ph...

0
Q: Append Child's Child Element

user1419338Is there a way to append a SimpleXML elements child's child? For example <comments> <comment1> <commentcontent>Test</commentcontent> </comment1> <comment2> <commentcontent>Test2</commentcontent> <comment3> <commentcontent>Test3</commentcontent> ...

0
Q: mssql_execute returns no results - better way to debug?

etm124My connection is established, and I can call my stored procedure: $pid = $_GET['pid']; $conn = mssql_connect($server, $username, $password); ... mssql_select_db('mydb',$conn); $sproc = mssql_init('consultGetPatientData'); mssql_bind($sproc, '@pid', $pid, SQLINT2); $result = mssql_execute($spro...

0
Q: Regular expression to preg_match longitude and latitude in scraped html

Ben PatonCan you see where my regular expression to match the longitude and lattiude from some scraped html is going wrong? The script should work by using file_get_contents to load some html then use a regular expression and preg_match to extract the lattitude and longitude. Currently the script below ...

0
Q: Mssql Query Performance using Php

user2857877When Management Studio 2008 opened , My queries results comes faster in my PHP script. However when I closed Management Studio , It response too slow. Why ?

0
Q: PHP How can I sort a 2D array which consist of sequence of integers (dynamic length)?

Cheang Kwong YewSay for example I have several arrays, and I need to sort them in order of their sequence: $list[0] = array(1,2,3,5); $list[1] = array(1,2,4,6,8); $list[2] = array(1,2,3,4,9); The result I'm looking for is: $list[2] = array(1,2,3,4,9); $list[0] = array(1,2,3,5); $list[1] = array(1,2,4,6,8); ...

0
Q: Simplifying utf8_encode

Publi DesignSo I'm trying to find a fast way to show all my results from my database, but I can't seem to figure out why I need to add the utf8_encode() function to all of my text in order to show all my characters properly. For the record, my database information is both French and English, so I will need ...

0
Q: Password resetting probelm with fosuserbundle

SandocheI am using Symfony2 and Fosuserbundle on my website. But I have a problem when I want to reset my password. When I go to the /resetting/request page I first put my email. I receive an email with a link When I click at this link I can see a form with only the new password and a confirmation When...

0
Q: Doctrine batch delete join table records

Hugo MigneronI have a normal many to many relationship between two entities : User and Object. ________ _________________ ____________ | User | | User_Object | | Object | |------| |---------------| |----------| | id | | user_id | | id ...

0
Q: PHP: Validating $_POST Numeric String for Primary Key

Michael RichI was using is_numeric to validate integers coming from POST data like: if( ! is_numeric($_POST['integer_string'])) return FALSE // not a integer Then I discovered is_numeric will return TRUE if the value has a decimal. Next I tried casting and is_int: $int = (int) $_POST['numeric_string']; ...

-2
Q: IF ROW_COUNT() return error

user2953241According to this article ( http://blogs.msdn.com/b/miah/archive/2008/02/17/sql-if-exists-update-else-insert.aspx ) I would like to do something like this: UPDATE chunks SET targets = CONCAT(targets, ",phpValue1") WHERE scopeX=phpValue2 AND scopeY=phpValue3; IF ROW_COUNT() = 0 INSERT ...

0
Q: Creating Session on login and creating variable from myql

user2953181INTRO: I'm creating a 'Social network' site. It's more of a learning exercise than a business venture. I have created the simple version of login and registration (without encryption) they use PHPMyadmin and work. HOWEVER: I'm now struggling with SELECTing from my database and add it to a $_SE...

0
Q: PHPTAL for ZF2 setup

mokkI am trying to implement PHPTal for my ZF2 application. So far I have only found this github project HERE. But after few hours spent on it I am still unable to use it (there is no doc also linked to it). Except that I haven't been able to find any piece of information about it!! Do you guys kn...

0
Q: Simple PHP APC progress bar

Tonny StruckI am currently working on one php upload progress bar that is using APC method. More for this bar you can check here: http://www.johnboy.com/php-upload-progress-bar/ Here is my upload.php code: <?php $up_id = uniqid(); if ($_POST) { //specify folder for file upload $folder = "tmp/"; $redirec...

0
Q: dll in php "the specified module could not be found"

zubojeI am having trouble with PHP extensions. I am trying to run a script and nothing happens then I checked my error log and here is what I got: PHP Startup: Unable to load dynamic library 'C:\Program Files (x86)\PHP\ext\php_oci8.dll' - The specified module could not be found. in Unknown on line 0 ...

0
Q: PHPExcel - After adding cache: ERR_EMPTY_RESPONSE

PippoAfter I had a problem with exceeding the memory limit, I've added the cache function to my phpexcel call. Now the excel can be read fully, but everytime after this i get an error: ERR_EMPTY_RESPONSE Here is my code for the PHPExcel Call: $cacheMethod = PHPExcel_CachedObjectStorageFactory:: cach...

-1
Q: How can i ajaxify this simple 'like' script?

HosseinCodei'm trying to write a simple "who liked this post" kind of script. i've done it but i want to ajax it but i don't know how. i've googled and read lots of tutorials but none of them was helpfull to me. this is my main php file: http://baziwood.ir/sandbox/who/main.php this is part of my script y...

-1
Q: getting error in session_start()

user2953308I'm trying to create a login system, however when I click login, I got the following error: Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/webtutc/public_html/ilumynus.com/admin/validate.php:1) in /home/webtutc/...

3
Q: PHP Calculate Start of Financial Year

Felix EveThe company I'm working for has a financial year that starts on 1st January if that is a Thursday, otherwise starts on the last Thursday of the previous year. I've written a function that does this but it seem inefficient needing to loop: function get_start_of_financial_year() { $date = dat...

0
Q: Drupal 7 - displaying video content of specific non logged in user

user2266878I need to display video content ( custom video content type). I need to display the content of a specific user ( determined by a previous user choice). When the page loads I have other blocks on the page pulling in the user ID via GET commands, and interacting with my seperate mysql database. T...

0
Q: 'Unescaping' strings in PHP

Ben321Simple question. I have a program that uses AJAX to send data from an HTML form to a PHP script that creates a PDF. If a user inputs a value on the HTML form that has an apostrophe it's encoded/escaped with a backslash. For instance, 'Joe's' becomes 'Joe\s' How can remove the backslash? I suppo...

0
Q: Is there a NMEA parser for PHP?

EhsanIs there a good NMEA string parser for PHP that you can recommend? I know it is easy to parse but I would rather not re-invent the wheel. Thanks

0
Q: Error handling PHP class

Amy NevilleI am trying to write an error handler class for php. I've tested that the object has been created but it doesn't seem to be handling errors. I used the same code in a function in the index file initially and it worked fine, but I'd rather have a class. Why is this not handling errors? class cla...

0
Q: convert PHP SOAP call to Perl

recursive9I am trying to take this, what looks to be simple soap call in php: $params->Context->ServiceAccountContext = $serviceAccountContext; //this is a string $params->Query = "test"; // invoke service $researchService = new SoapClient($serviceurl); $response = $researchService->

-3
Q: Save.php "NO Data Received"

kuclukwhen i want to save data to database using save.php button then my browser show NO Data Received and data not saved in database? <?php include 'database.php'; $nama = $_POST['nama']; $jalan = $_POST['jalan']; $lat = $_POST['lat']; $lng = $_POST['lng']; $deskripsi = $_POST['deskripsi']; $...

-4
Q: Whats the suitable web development platform for real time applications with smartphone?

vaughanWhats the suitable web development platform or programming language to work REAL TIME applications with ios, android and windowsphone? This application is similar to bank. There are many applications available such as ASP.NET, JSP, PHP, PYTHON, RUBY, PEARL Basically it would use the website as ...

0
Q: Rails working with an API defined in PHP

acaciaI am working with an API only defined in PHP. I hope i have managed to successfully make a request like this; url = "https://www.jambopay.com/JPExpress.aspx" uri = URI.parse(url) http = Net::HTTP.new(uri.host, uri.port) request = Net::HTTP::Post.new(uri.requ...

0
Q: strict standards errors on cakephp 1.3.4 PHP 5.4.12 and Apache 2.4.4 (wamp server)

user765368I get strict standards errors when I trying to run a cakephp application (version 1.3.4) under PHP 5.4.12 and Apache 2.4.4. I cannot upgrade the cakephp version of the application right now. I tried all the proposed solutions online but nothing worked (like setting the error_reporting in bootstra...

0
Q: Link to index and trigger specific ajax load

user2688810I have a site where the index.php is a DOM that has various links in the menu. <li><a class="book" href="#blog">Blog</a></li> <li><a class="kontakt" href="#contact">contact</a></li> Every link loads the content of a div via ajax. (and in my case a little animation). What if I want to redirec...

0
Q: getting the value of found_records from stored procedure with prepared statement

KevinHere is the stored procedure DELIMITER $$ BEGIN SET @sql = concat(@sql ,'SELECT SQL_CALC_FOUND_ROWS '); SET @sql = concat(@sql ,';'); prepare stmt from @sql; execute stmt; deallocate prepare stmt; SELECT found_rows(); END The php that calls the stored procedure. $mysqli = new mysqli($datab...

0
Q: Model inheritance in Laravel 4

DonnieGroundwork I have a database design (snipped to relevant portions) like so: records entities people where no proper relationship exists between the tables, but rather records is extended by entities is extended by people by sharing the same id. I have my Eloquent models similarly defin...

1
Q: mysql php query dies

user2786343Im creating a login php script that connects to a mysql db with a table called users containing a list of users. I am running into what looks like either an empty set or a mysql error. I have included a connection error echo and a query die echo and the script is echoing the latter error that gi...

1
Q: PHP Datelight Savings Time Issue

scapegoat17I have the following function that is used to get the correct time and is used for my website. Unfortunately, It doesn't check for daylight savings time and is causing a time error. I was wondering if anyone would have a possible solution or help me out with my issue? I am very new to PHP coding...

1
Q: Wordpress loop keeps producing an extra open and closed div

BlakeI am trying to create a slider with two divs inside of it and then close. Right now I have a counter and if the posts are divisible by two it will close and open a new div. Unfortunately it is opening and closing an empty div too. Here is my code: <div id="brew-slider" class="global-width ...

0
Q: pass variables/values from php to opened window process and vice versa

user2686029i want to have an constantly opened program (wrote in c++ prefferably). when the php script is acessed, it will be acessed with some variables which will be passed to the active program. then the program will make some calculations, and it will pass other variables back to the php script, which w...

0
Q: What is the Wordpress Options API flow?

Nixi AlexandruI want to create an options page for my plugin that will have a section with 3 fields. I to have a button Add One More Instace that will produce andother section (with its 3 fields) in other words dinamicly add sections to the option page. I am new to plugin developement I can`t understand the fl...

0
Q: Change table background color when change row value PHP

user2953395I have a table on PHP like bellow and I need that, when the first column changes value, the line changes color. E.g.: at table in example, first and second lines will be red, third line will be blue, fourth red again and so on <table> <tr> <td>1</td> <td>Test 1</td> <td>Today</td> </tr>

1
Q: Zend Framework 2 and PHP 5.1 + CLI

beingalexI have made an application that uses ZF2 and deployed it on a server that is running php 5.1. The application works fine through a web interface but when I try to use the CLI to run an action I get the following error: [user@domain public]# php index.php generate PHP Warning: Unexpected charact...

0
Q: How to Stop Header, so I can echo to screen from the same function (PHP)

VereonixI'm finding Headers a nightmare to get my head around, I have a file the user downloads which works fine. However I then whish to echo to the screen that xx file has been sent; but ofc this echo is just placed inside the sent file. Full dowload code is as follows: function download() { $ord...

1
Q: Using variables on multiple PHP pages for mySQL

BuddhistBeastI have created a member login page and now I am working on a restricted 'Member's Only Section'. I am fairly new to mySQL and I am also practically trying to teach myself. My question is related to authorizing someone who has just logged in, to allow them to go to that restricted section. Vice ve...

2
Q: PHP form not saving to table

John BeasleyI have a page called service.php that uses a modal window to open a form. The action on the form was service.php. <div class="modal hide fade" id="myServiceModal" tabindex="-1" role="dialog" aria-labelleby="myModalLabel" aria-hidden="true"> <div class="modal-header"> <button type="button" c...

0
Q: Using dokuwiki plugin directly from php file

Rajiv NairI am new to php and I would really be grateful if you could help me! I have to add a word cloud to the sidebar of a page constructed using dokuwiki. The side panel is called using an independent php file (that is not managed by the doku). I believe that the way I can accomplish this is by calling...

0
Q: Date regex check in php

CataneoI am trying to make a date regex validator. The issue I'm having is that I'm using an input field with "date" type, which works like a charm in Chrome; it opens a calendar-like in Chrome, but in the rest it does nothing, so I decided to go for a manual input of the date for the rest. This is my ...

2
Q: How to upload file via an AJAX form in Zend Framework 2?

SidI have an AJAX form in my ZF2 application. I want to handle file uploads. The JavaScript code I have written to handle the form submission can be found here. How do I send the uploaded file's details to my PHP script? My current code just sends the file name. Appreciate any help.

1
Q: Class Structure and Passing Data

JREAMBelow I have a series of classes. I am trying to figure out the best way to pass my data from Process.php into each of the following classes. /CLI/ /Process/ /Condition Rule.php Condition.php Single.php Process.php Response.php Registry.php <-...

0
Q: How to parse string as JSON object javascript

user1128939I have the following code from my php script. var str = "[{id : 'Gadji Tallo', poste : 'attaquants', taille : '1.85m', poids :'77kg', age :'20'},{id:'Mbaye Diagne', poste :'attaquants', taille : '', poids :'', age :'22'},{id:'Sigamary Diarra', poste :'attaquants', taille : '1.76m', poids :'74kg'...

1
Q: I've installed the PHP SDK for Paypal using composer. How do I make a basic Express Checkout call?

justkevinThe only documentation on how to use Paypal's Merchant SDK for PHP I've been able to find covers how to install it using Composer and that's it. No explanation for how to initialize the SDK or make a SetExpressCheckout call. Is there documentation for the PHP SDK that I'm missing? Or even just ...

1
Q: 500 error from ajax request (jQuery) to Code Igniter controller

MinoWas wondering if anyone had encountered this problem. I am calling a CI controller that runs a model (on the server) and takes longer (about 5 minutes) for a specific scenario. The problem is that I am getting a 500 error after a long request but I do not get any errors when the request is sh...

1
Q: What is the best way to use websockets along with PHP and MySQL scripts?

Pablo J. MartínezWhat is the best way to use websockets along with PHP and MySQL scripts? If I want to add a live chat to my PHP site, or store vars to the MySQL database when doing X action in real time (for a RPG website trading, for example). I have found Ratchet, it's a good choice to achieve those things e...

1
Q: Mysql - Voting once per Day

Marek123I have an entry where users can vote once per day. I''m saving this in my database. Now I need to check, if the user is allowed to vote on this entry again (after one day). So far I got this: SELECT count(*) FROM entries e WHERE e.voterID =1 AND e.pID =1 AND e.date < NOW( ) - INTERVAL 1 D...

0
Q: Looking for a quick way to make all of my form fields read only

ChrisI have a form that contains fields that should be read only for certain user types. Right now, I'm adding this code to each field: <?php if($_SESSION['userFlag'] == 2 || $_SESSION['userFlag'] == 3) { ?> readonly <?php } ?> This works, along with some hidden variables to make sure the data stil...

0
Q: SQL query between two times on every day

keyboredI'm currently trying to write a query that will allow me to find all records that occur between two times every day. As an example, say you had five records each with their own unique timestamps that represent when the record was created. They look something like this: |--|------|---------------...

0
Q: php variable inside echo 'html code'

KarimkhanI have php file index.php In this file to use html code I am doing: index.php echo ' <div> <a class="fragment" href=""> <div>'; In href I want to put value of some php variable i.e. $url How could be done? is this correct way? <a class="fragment" href="<?php echo $url; ?>">

0
Q: Changing main image in a gallery of an basic webpage without javascript and refresh

bubblebathI have been looking for a way to change a main image without using javascript AND not refreshing the page. By reading the title I am sure you will be thinking 'this chap is an idiot an minimum of refreshing the page is required, however, I have seen on ASOS e.g. http://www.asos.com/ASOS/ASOS-2-In...

0
Q: Domain validation for Javascript

John RobinsonI know, I know... Javascript is a client-side language. Of course, any Javascript required to be read by the browser can be read by the person USING the browser. But I am building an HTML5 game that runs purely off of Javascript and I am trying to come up with a way to at least omit some necessa...

0
Q: Hiding tables based on current month

Nathan SThis is probably a relatively simple PHP script, but I'm at a loss after trying for a while. I have a series of tables (see below), and I want to automatically hide the tables where the month has already passed. I'm thinking of using PHP to generate embedded CSS to achieve this. I would need a s...

0
Q: PayPal IPN returning item_number empty

mossWhen I send cart details to paypal on checkout I include item_numberX for each item(i.e. &item_number1=4). When I recieve PayPals response all item_number fields are empty. I can't figure out why this is happening. I need the item numbers in order to process the order. Has anyone run into this,...

0
Q: PHP Login header location

Avadanii ClaudiuI have the following code, but im blocked here.. <?php require 'members/core/init.php'; $general->logged_in_protect(); if (empty($_POST) === false) { $username = trim($_POST['username']); $password = trim($_POST['password']); if (empty($username) === true || empty($password) === true) { $...

0
Q: PHP curl post call is not working. 'curl' is enabled

rupanjanTrying to call a java service from php client using curl function. My api expecting a json request body like below, {"personRequest":{"emailId":"rupanjan@gmail.com","isActive":"true"}} And my php client code as follows, $postData['personRequest'] = array( 'emailId'=>"rupanjan@gma...

0
Q: Second select load from database after first one is selected

Rawrrr1337I have 2 select items. In the first one I'm loading the options from a MySQL database table using PHP. The second one I want to load the fields from another table where for example category field equals the value of the item selected on the first tag. I have no idea about how I can make the s...

0
Q: php/mysql: get data from one table, convert and insert in another table

diasjei have a table where i have an ldap info: table1 Tag_number Operating_System LastLogon LastLogonHidden My script fetch data from ldap server and inserts in my database the tag number, operating system and lastlogon. The lastlogon cames in a code and is inserted in the table field la...

0
Q: Dynamically created textboxes don't work with $_POST

Bart SchefferFor a voting system people see 3 textboxes. But they can add textboxes manually in case they want to vote for more artists. But those textboxes are dynamically created via Javascript using this code: $(document).ready(function(){ var counter = 4; $("#addButton").click(function () { var newTex...

-2
Q: Consuming Java Restful Service in Drupal and Wordpress

bdfiosI have a form authentication application developed as a Restful service using Java. It happens that I need to implement this in a webform built using Wordpress and Drupal. PHP is not one of the languages I know. I need ideas on possible steps I can take to be able to accomplish this. Thanks i...

0
Q: Php Routing array_key_exists vs foreach

Tim98760I found 2 ways to this and I'm looking for what style here would be less overhead and more efficient. Does anyone know what one is best? This project might have alot of links and get big arrays. 1 foreach($this->routes as $pattern => $action) { if($pattern === $uri) { return $actio...

0
Q: Echo Video Embed to Hyperlink in Table that Sends to Another Page

MylesFirst off I'd like to say stack overflow has helped me a lot with my first coding project ever. I'm still very new to this. This is the first time I've been really stumped and unable to find an answer on the interwebz. So here's my code. What I'd like to do is add a vimeo code which is a few ...

0
Q: PHPMailer displays mail on top of page

erdomesterI am using PHPMailer to send emails. On one of my pages the mail script runs before the page is displayed. The mail is sent and it is also displayed on the screen above the content of the page. Why? <?php /* many things */ $mail = new PHPMailer(); $mail->IsSMTP(); ...

0
Q: amazon s3 bucket upload images curl exception 'data rewind wasn't possible '

sha375420I am using codeigniter to upload images to a bucket in amazon storage bucket.Iam getting this error and i dont know what to do to overcome this problem Fatal error: Uncaught exception 'Guzzle\Http\Exception\CurlException' with message '[curl] 65: necessary data rewind wasn't possible [url] ht...

0
Q: how to exclude files in Zeus rewrite

user2953473I wonder if anyone can help? I've spent ages trying to hunt down a solution but there appears to be very little info out there. Basically a site I'm working on for a client is hosted in a Zeus environment (I usually work in Apache) and am having an issue with the rewrite.script for setting up SEO...

0
Q: How do i update db when i move the google marker

AlexWell, following is my completed google map code. All latitude and longitude is come from db and I can update and delete it by click on the marker. To update the marker I've to move it another place then a popup window appear with "Update Marker" Link. To delete the marker i've to click on it ...

0
Q: Magento custom function implementation issues.

dstiefeljrI want to implement some custom php into the product view page. I have a custom function that I want to pull the dynamic price and output a custom message. Only problem is I do not know how to pull in the price variable. Can this even be done the way I am trying or do I have to take the long rout...

1
Q: How to do select between an IN .. Read more

TylerI am trying to do a mysql select where i need to get all the rows where the column is equal to values from 1100 - 1400. The problem is that i am getting values though a IN too. My code: $sql="SELECT * FROM places WHERE number IN (3500, 2950, 2942, && 1100-1400 )"; But it doesnt give me all th...

0
Q: Retrieving Mysql data fails... Why?

AlexSo this is my code but it does not work, I just get this Title Article "; while($row = mysqli_fetch_array($result)) { echo ""; echo "" . $row['Title'] . ""; echo "" . $row['Article'] . ""; echo ""; } echo ""; mysqli_close($con); ?> Any ideas? <?php $con=mysqli_connect("localhost","____","____...

0
Q: It seems that I cannot use @file_get_contents at a new host

SashaI am using function (snippet from CSS Trics) to get country of the user based on IP. On localhost (on my computer) it is working without the problem, but once I transferred and tried website this is the error I am getting: Fatal error: Uncaught exception 'InvalidArgumentException' with messa...

0
Q: filtering values (php + jquery)

user2953549I have a problem and hope someone with more experience can help me. I have a table with the following fields and their values​​: id | types | colors ----|---------|-------- 1 | pant | blue 2 | pant | green 3 | pant | red 4 | shirt | brow 5 | shirt | pink 6 | shirt ...

0
Q: Regular Expression to get anything between two strings '$' and ';' and not preceded by '\\'

user1518071I got the following code $original_file=str_replace('<?php','',file_get_contents('file.txt')); //regular expression to get anything that starts with '$' and end with ';' preg_match_all("/\\$(.*?);/",$original_file,$matches,PREG_PATTERN_ORDER); I have succeeded in the getting the variables or ...

0
Q: Date range filter not work , please help me

nisvet Hi all please help me about this PHP problems , my date range filter not work. Filter with fields "PREGLEDALI","PREGLEDA1","PREGLEDA2" works perfect but date range filter not work. I have this date format (01.10.2013) in database . $result = mysql_query("SELECT * FROM preglediv1 WHERE N...

 
6:26 PM
-1
Q: I want to include header file in my sub directory file the file is also includes but the css link not remained in header file

Umar Ashiqhi there I want to include header file in my sub directory file the file is also includes but the css link not remained in header file anyone can help about on this topic??

0
Q: encode php object into json

user2809051There is alot on this subject but I can't figure out why it's not working, it was, now it stopped. I run a query and return an object with php, then try to encode it to json, then parse it client side to json. It is telling me that SyntaxError: JSON.parse: unexpected non-whitespace character afte...

0
Q: Transfer mysql table to server

MutekingI've set up a website on my local drive and created a table with xamp and php myadmin. The simple answer I'm asking is: how do I transfer the table into the server? I've tried to export the file with sql extension placing it in the root directory of the remote but that didn't work.

-1
Q: Create html select list from php array?

beaterHello i find php function that outputs html select list from array, more about function: Create nested list from PHP array for dropdown select field function printTree($tree, $r = 0, $p = null) { foreach ($tree as $i => $t) { $dash = ($t['parent'] == 0) ? '' : str_repeat('-', $r) .' '; ...

0
Q: a file which is exist alread in some OS

user2874861I want to do some manipulation on some file which is already exists in some OS. So I need to know for each OS the file's path. For the moment I only need some file's path for Linux, Mac OS X and Windows. if (PHP_OS === "Linux"): $fichier = ""; elseif (PHP_OS === "Darwin"): ...

-3
Q: Mysql advanced search

StonerCould anyone help me with some advanced search functionality in mysql, using php? I need to perform serach in specific fields (title, description) and some special characters could be used as: * for several words starting with given text (e.g. search term is 'north*', should return entries conta...

0
Q: Magento add discount for a single user (Not user usergroup)

MartinIs there any ways I can add a fx 10% discount for a single user? (Not a usergroup) Or is the only option to add each user to its own usergroup? In promotion > Catalog Price Rules its not possible to add a user attribute, only choose usergroups. (Shopping Cart Price Rules is not an option, beca...

0
Q: PHP session conflict

AlbatorI'm getting a conflict with these 2 sections of code: first one to validate that the log in session is in the database tab include "../scripts/connectpage.php"; $sql = mysql_query("SELECT * FROM login WHERE id='$managerID' AND username='$manager' AND password='$password' LIMIT 1"); $existCount...

0
Q: display custom nextgen gallery in a custom page

otherDewiI am using NextCellent Gallery plugin and a custom theme. I created an Album, Gallery and wish to display the gallery in a new page. The gallery displays in the same page when gallery>options>gallery settings>deactivate gallery page link is selected. When the option is deselected the gallery ...

0
Q: php preg_match extract args

Tim98760Does anyone know how to get the int from this preg_match? It's only showing me the URI. $uri = "/user/view/2"; $pattern = "/user/view/[0-9]+"; if(preg_match('#^' . $pattern . '$#', $uri, $matched)) { print_r($matched); } else { echo "No match!"; }

-5
Q: How do I clear a text file using PHP or javascript at a specific time?

KrakenI have set up an IP logger on my website, but it currently is quite long. How can I set up a PHP or javascript system in place that will clear these logs at a specific time (midnight, to be exact)?

0
Q: Hi I was wondering if there was a way to automatically send an e-mail to myself whenever there is a row added to a MySQL table?

Julio SitgesSo far I have made a new table named notification_queue from what i read in the following post. How can I receive an e-mail when my MySQL table is updated? Then I made a cron job like the one described in that link. The problem is that it is not working. I have the notification table with 0 ...

0
Q: Manually updating a Wordpress database

Daymon SchroederI am currently working with a team of developers trying to port our website to WordPress. On our local dev. server, we have complete ability to edit MYSQL schema. However, our parent company runs the MYSQL server on our production server, meaning we can't make script-based schema changes. Instead...

0
Q: Change Client id to Client Name with CakePHP

user2948950Okay, so I have a form in CakePHP that submits to a database. In this form it submits a field called client_id and it is stored in the database as such as well. Then I have a view to allow me to view all of the invoices that have ever been created. To view the client responsible for the invoice...

-1
Q: PHP empty not working

Ds.109I am just trying to check if a form variable is empty .. the code sets the variables $getsubject and $getsubject to the $_POST of the form, then I am checking if they are empty and if they are I want to set them to "No Message" or "No Subject" ... I tried with isset as well and it didn't work .. ...

0
Q: My composer won't update completely with Laravel 4 it gets stuck with artisan

Jean-Nicolas Boulay DesjardinsHere is the error I am getting: Script php artisan optimize handling the post-update-cmd event returned with an error [RuntimeException] Error Output: update [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--lock] [--no-plugins] [--no-custom-installers] [--no-scripts] [--no...

0
Q: Service unavailable. The service is temporarily unavailable. Please try again later

M CharlesI'm using SoapClient with my PHP page to gather data from a third party. I have increased my max_execution_time to 50 seconds and I have stopped getting those errors in the logs. However, now I get the Service Unavailable error and nothing in the logs after about 32 seconds. I've timed the soap ...

0
Q: How to change php executable used by CakePHP Console?

Patrick Maciel - p4devI have in my customer server 2 apaches/php version. So, the primary version (/usr/bin/php) is the old version, and other is the 5.4.17 (/usr/bin/php54). I verify the app/Console/cake file, and found the exec command. When I try change to php54 -q ....... doesn't work. How can I do that? Or che...

0
Q: making changes to wordpress site using http requests

David ConnerAs the title says, is it possible for example to install a theme, add a text widget, change a picture remotely with an HTTP request (or some other method)? I would appreciate if anyone could point me in the right direction, thanks.

0
Q: PHP help ! php failing to react

Urvin<?php session_start(); $error = ''; if(isset($_POST['submit'])){ $name = trim($_POST['name']); $radiob = $_POST['g1']; if(empty($name)) { echo "you need to enter Your name"; } if(!isset($_POST['g1'])) { echo "you did not select a phone type"; } ?> <!DOCTYPE HTML> <meta charset="utf-8">

0
Q: I moved my drupal 7 website from a remote server to a local computer (Aquia Dev Desktop) and can't login

user2872546I've come to you many times before in search of answers and have always found them without having to post a question; for that, I'd like to start by thanking the community. This time however, all the answers that I've found haven't seemed to work for me. Here's what's going on. I have a site ...

0
Q: WordPress: Build valid query string from parameter array

grayOn my site, the following array parameters will work fine through the WordPress query_posts() function in an ajax request: $arr_params= array ( 'post_type'=>'university', 'tax_query' => array( array( 'taxonomy' => 'uni', 'field' => 'slug', 'terms' =>

-1
Q: Why does this appear at the bottom of the page when i'm using it in a div (PHP)

Mick RustenhovenOkay so I was following a tutorial on how to make your own forums, so now I want to put it in my own layout. <?php $sql = "SELECT categories.cat_id, categories.cat_name, categories.cat_des...

0
Q: session not working when communicating with localhost

AlexIf I navigate to 'sub.domain.com/session_test.php' in browser, the session are saved and work fine. I can see all the sessions on page refresh. However, if I make an http post request from javascript in localhost to the same URL, the sessions are not being saved because I dont get any data(data ...

0
Q: How do I combine these two Wordpress search queries?

John RobinsonI have two search queries. One searches in the default manner, for any post titles that match the arguments. The second query is set to search any posts with the postmeta key of "SKU" LIKE the search query. I am trying to combine these two queries so that the search will return any posts whos...

0
Q: Update table from multiple checkboxes

John PriestakosI want to update a table from multiple checkboxes with dynamic fields. I built the checkboxes with the below code: <div class="form-horizontal" style="margin-right: 35px; margin-left: 0px;"> <div class="form-group"> <? $i = 0; foreach ($row_specifics as $title => $value) { ...

0
Q: Codeigniter Disable Cache

kaarchI'm trying to learn Codeigniter and understand the basics so far, but as I try to test, it seems the cache is getting in the way. Normally when I test on localhost I make a change and instantly can see it in browser, but with Codeigniter it seems I have to wait ~1 minute for changes to be seen in...

0
Q: PHPMyAdmin Running Slowly - How to fix?

JustAnotherUser32I am using phpmyadmin, and every time I load the page it takes forever to load. Once I get in, it is still taking forever to go from one page to another. Does anybody know how to speed up phpmyadmin?

0
Q: Writing to file but it's not working on my Pi?

user2882612I am attempting to write to a text file using PHP. I have this form <form action="fish.php" method="POST"> <p>Gmail Login</p> <input name="gmail1" type="text" /> </br> <p>Password</p> <input name="gmail2" type="password" /> </br> <input type="submit" name="submit" value="Submit"> </form> I al...

0
Q: SQL statement to validate if two values are NULL

ApologicianRight now I have a sql statement in my website that checks if an active value is NULL in my database in order for users to login. I implemented a secondary activation method and I now have two active fields: active and active2. Below is my sql statement that works currently however I need to it...

0
Q: Magento add a form to a custom tab

user2953807I have the following within my layout file: <adminhtml_sales_order_view> <reference name="sales_order_tabs"> <action method="addTab"> <name>bulkupload</name> <block>bulkorderupload/adminhtml_sales_order_view_tab_bulkupload</block> </action> </refer...

0
Q: get value of selected item and change the list on second dropdown

Umar Khani am trying to change the second dropdown list when an item is selected on 1st dropdown $output_body = '<select>'; $accounts = $service->management_accounts->listManagementAccounts("~all"); foreach($accounts['items'] as $item) { $output_body .= sprintf('<option value="%d">%s</option>', $item[...

0
Q: CakePHP and HTTP/Request2

Ronny vdbI am building a web application and need to connect to a third party API. The example code provided by the third party uses HTTP/Request2 to connect. I know that I could use curl to connect but I would prefer to use the method that was provided to me. I have tried to add: App::import('Core', '...

0
Q: post data to mysql DB from external source using a link

user2835653I have a web based, php, DB system using mysql. users login, enter data in forms, click submit, and data is entered and can be read, analyzed, reported on, etc etc etc. now we have a data provider who wants to send data to the mysql DB via a link, an external submission to the DB from a source n...

-1
Q: Select 10 users from row but group as playing and reserve

user2953790I have one row (ID). From ID i need to extract/select 10 primary ID's with 3 secondary ID for each one. There is one more condition! Every primary ID must be first selection! After we selected the first 10 (random unique id) ​​i need to select 3 (random unique id) as reserves for each one. Exampl...

0
Q: add custom cookie in PHP cURL

user1801060I'm a cURL and PHP newbie. I am writing a script in which I need to create a custom cookie and maybe include it with the cookies that cURL creates. Following advice I found on this site, I've created a cookie like this curl_setopt($ch, CURLOPT_COOKIE, "DOAReferrer==$cookie_header=$cookie_ip_valu...

0
Q: How discard empty HTML form inputs from $_FILES array

NewbieI have a HTML form with multiple file inputs <input type='file' id='images' name='images[]'> I use implode() to covert the $images array into comma separated string and insert it into my DB , then when calling I use explode() to recall single images. the problem is : empty input fields are st...

-2
Q: Programming language for DNS server

OnurI want to write a DNS server. But I can't decide about which programming language I need to use. I am thinking Python or PHP. But I can't select one. Please help me for selecting language.

0
Q: How to select pending friend requests from Database mysql

Red BalloonSQL: http://www.sqlfiddle.com/#!2/0f7a0d5/4 Table contains these rows: INSERT INTO `friends` (`asker_user_id`, `asked_user_id`, `status`) VALUES (1,2,1); INSERT INTO `friends` (`asker_user_id`, `asked_user_id`, `status`) VALUES (2,1,1); INSERT INTO `friends` (`asker_user_id`, `asked_user_id`, `...

-2
Q: Joomla Template Development/Customization

Dennis PalerHere is the details.. In joomla, when you click the menu such "about", it is possible to display the content/article via slide out using jquery or css3 transitions? How to implement this type of styling in Joomla Template or System? Thanks

0
Q: submit the full path for file in php

user2874861I'm trying to get the fuul path for a file using php. for that I used this : <form method="get" action=""> <label for="fichier">Choisir votre fichier : </label> <input type="file" name="fichier"><br> <input type="submit" value="procéder"> </form> I ...

-2
Q: eBay store template with dynamic categories?

user2953877I have been searching for a solution for this for days and I haven't been able to find anything! I found this: dynamic ebay categorys on listing but it doesn't answer the question which is a shame. I have seen many ebay templates with dynamic categories and i am just wondering how they do that...

0
Q: php goes to blank page, no errors, but does not input infi in database

Moses BoltonThanks for your help, let me know if you need anything else. details in the title. <?php $subject = $_POST['subject']; $comment = $_POST['comment']; $submit = $_POST['submit']; if ($submit) { $connect = mysql_connect("host","un","psw"); mysql_select_db("rebeler_comment"); $query = mysql_quer...

0
Q: How to sniff these kind of request?

user1792805im using a script that fetch google content (google snippet) on Zend Framework since the script is not suported anymore by the DEV team i need to debug the script & i would like to know how to sniff the return of the google query : exemple of the code: public function fetchContent($keyword...

0
Q: PHP change varibles from static function

Ariel AharonsonI have started to build this class, and I want to register a user: <?php class User { protected $_id; protected $_name; protected $_email; protected $_password; public $isLogged = false; public $errors = array(); public function __construct() { } public stat...

0
Q: Generating email addresses in PHP

user2690891Here is my problem: Generating Email Addresses The DisplayRow function in the online examples used in the regular expression examples take a line of input from the data file and displays the HTML for one row of the resulting table. There is some code in this function that will display the instru...

0
Q: Wordpress WooCommerce Product Page Template

user1269625I just setup WooCommerce on my wordpress site: http://artendijen.com/product/test-product/ I am not a fan of the template where it has the description and additional information below and in tabs, I would like the have the description and additional information to the right of the product image...

0
Q: Insert an associative array into mysql using php

user2879070I have a database with a table I've just created with the following info- table: rec_nutr columns: nutrDesc varchar(60), nutr_ttl float, units varchar(7), I have a php array called $stuff that I want to insert into this table. When I print_r($stuff) it looks like: Array ( [0]=> Array ( ...

0
Q: php/javascript zip images and allow user to download

Jack HillardI have several image galleries on a page and I want to allow users to download all images in a particular gallery as a .zip file. Problems are: I have no access to the server this page will be hosted on so I can't write a zip file to the server and then present that file as a downloadable f...

-1
Q: Can't find error inside PHP script

Rawrrr1337I have this script. It should display a table, but it does not! I can't find the problem! I've made another simple echo of the first element of the database, and it displays it, so the problem is in this script. It worked yesterday, but today I had to try to solve the problem for 3 hours, no resu...

0
Q: Owncloud without DynDNS-Service via PHP

velopI'm asking myself if it is possible to send the ip address from my router to a php script on a web hosting package (not an own server), safe it (like http://www.axelteichmann.de/DynamicDNS/index-DynDNS-mit-Fritzbox.php) and relay all incoming traffic on port 80 http and 443 https (via socket_crea...

0
Q: 301 Redirect all files within directory to directory root

Michael LarsonI am trying to redirect all files within a directory to the directory root. So, Original URLS: http://www.mysite.com/about/whatsnew/2013DHReadersChoice.pdf http://www.mysite.com/about/whatsnew_story.cfm?id=296 http://www.mysite.com/about/kitchen.cfm All go to: http://www.mysite.com/about/ ...

-1
Q: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /functions.php on line 94

user2900272I have the following error in a script (not my script): mysql_fetch_array() expects parameter 1 to be resource, boolean given in /functions.php on line 94 Line 94 contains the following http://i.imgur.com/CfrFHdz.png I currently have not much php and mySQL knowledge. I plan to learn about that ...

0
Q: Dynamically change the text of a psd?

user1697949Here is my problem: A designer creates a banner ad showing a sale. For example: 10% off all items. The sale changes every other weekend from 10% to 15%. The design of the ad and the position of the text changes from week to week or day to day. I would like to automate the text change and banne...

0
Q: codeigniter imagecrud error was encounterd

RenswebI'm getting an error when I try to call a function with a variable. When I open the URL (http://example.com/taarten/index.php/admin/fotos) I'll get the (standard) imagecrud page with the entries from the table "kindertaarten". When I now enter the URL (http://example.com/taarten/index.php/admin...

0
Q: How should I schedule tasks from a web server?

Deron FredericksonI have a scenario that I'm not too sure how to approach/solve. I'm developing a php/mysql site where users are going to upload a list of names and phone numbers. Once they upload their list, they can schedule when that list will be processed (ie: 11/04/2013 at 8am). My issue is this: I have a...

0
Q: trouble creating an image download link

gurungI use wordpress cms and I am working on a little script wherein visitor could upload image, resize and download. I am stuck in the download stage. Somehow I am unable to connect these things together to make it work. First among these is a resize.php which basically resizes the image and creates...

0
Q: Multiple Custom Validation Constraint in Symfony2

francoI created multiple validators using de oficial documentation and all of them works fine, but only when I use separately. In a bundle I defined this: # Resources/config/validation.ynl SF\SomeBundle\Entity\SomeEntity: properties: name: - NotBlank: ~ - SF\UtilsBu...

0
Q: Break try catch if select query returns does not return false

kyrosI would like my code to execute if a SELECT query returns false, this is my following code: $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $dbh->beginTransaction(); if(!$dbh->query($stmt)){ $query->execute(); if($stmt->execute()){ while(...

0
Q: validate form data and use PHP to generate the form

cpom1So i need to convert an HTML survey I have created into a PHP form. Im very lost with this. It needs to test my regular expressions which I do not have but if someone can use the information I have to help me create some that would be great. Im sure all of my labels can have a regular expression ...

1
Q: Noindex BuddyPress members directory subpages

henrywrightThe BuddyPress members directory is broken into a number of subpages e.g. example.com/members/?upage=2 example.com/members/?upage=3 How can I set the subpages to 'noindex' so they are not indexed by search engines such as Google? Note, I would like the main members directory page ( example.com...

0
Q: Website Security From Mailicious Attacks

iamde_coderI'm currently trying to strengthen the security of my website and I've come across this issue: Is it possible to edit an html file to output the contents of a php file contained on my server? for instance, I don't want a malicious attacker to be able to read my config.php file containing server ...

0
Q: how to curl into a dom document then iterate over the links php

aavthis displays Warning: DOMDocument::loadHTML() [domdocument.loadhtml]: Empty string supplied as input in how to properly curl this url and dom doucment it then iterate over its links the response is empty how do you set the headers properly with php $ch = curl_init(); // set u...

-1
Q: Inserting into database PHP/MySQL

XanderI am working on my first web app, built on the UserCake framework. Since it was built on this framework, all of the user account aspects of it are functioning as expected, however I am now trying to insert other data into the database and it isn't working. I have tried to model this exactly to ho...

0
Q: Accessing AJAX added inputs with JQuery

Amie CrutchleyI have a form that on document load, loads additional fields based on previous selected values on another page. This is all done with JQuery. Rather than posting all my code in here right now, here is a basic mockup on what I am doing... <form> <input> <input> <div id="loadedcontent">...

0
Q: PHP - pagination after setting the UI slider values

ram eshI have a huge CSV file. I am displaying the contents of the CSV file in a paginated format. Initially, I load the CSV file and display it in the web page in paginated format as below. $names = file('outputmodified.csv'); $pagedResults = new Paginated($names, 100, $page); while ( $ro...

-2
Q: online php file multi function editor

droohSo I was wondering if there is some type of open source php script that allows you to manipulate files on a server? Unfortunately I've come across something like what I have described a few times on sites that have been compromised. Usually the attacked uploaded some php file that allowed them to...

0
Q: Return empty value instead of an object

Maor BariI have class "Classname" with magic method "__get": public function __get($prop) { $this->actions['action'] = 'select'; return $this; } When I call some getter like this: print_r($Classname->some_get); I got null. i try change print_r to var_dump and it show me NULL. I cant understa...

0
Q: How to convert cakephp 2.x component and helper to 1.3

HartsI have a cropping tool component and helper which work on cake 2.x but now I need to use this cropping tool into one of the older project in cakephp 1.3. How should I do this? The component: <?php App::uses('Component', 'Controller'); class JcropComponent extends Component { pu...

1
Q: simplehtmldom scrape pagination of pure javascript

marcusI am practising using simplehtmldom however I have hit a slight problem, the pagination on the site I am planning to practice on is just javascript and when I turn off javascript it breaks the pagination so it does not display at all (http://www.asus.com/uk/Motherboards/Intel_Platform_Products/)....

0
Q: iphone/ objective C - PHP API security

Imagine digitalI'm building an iphone application that has to communicate with a mysql database through a PHP API. Now obviously, I don't want anyone to have acces to my database. therefore, I want to put some decent security in the PHP API and the objective C ad. After some research, I found out that this m...

0
Q: how to call php script from android application

Nedimoi am new in android, and am am trying to create code for when user click on button simple php script is executed, and string is returned to android app from php. Here is my code: package com.example.phptest; import java.io.IOException; import java.util.ArrayList; import java.util.List; import ...

0
Q: How to load a twig template based on rules

user973810I'd like to load different templates depending on whether a given file exists. E.g. by default I would load templates from a base folder, but if a specific folder exists then I would load that template instead. I'm picturing some functionality similar to an autoload function offers. Does twig off...

0
Q: Javascript function to load different config.json files depending on URL

ChristoI have a mobile website that loads a config.json file using the following javascipt: $.ajax({ type:'GET', url: '/config.json', contentType: 'plain/text; charset=UTF-8', dataType: 'json', success: function(data){ }, error: function(jqXHR, t...

-2
Q: PHP translator class with mysql

Moxet JanI have a database of more than 16K words in Pashto language which works as dictionary in my project. Now i want to utilize these words as translator for the same language. Let me know is there any built-in class in PHP which sort out this issue. P.S: The translator should work like google transl...

-1
Q: CViewAction don't work [Yii]

Michel PhelpsI created controller: class WebsiteController extends Controller { public function actions(){ return array( 'page'=>array('class'=>'CViewAction') ) ; } in protected\views\website\pages I created file login.php <h1>Hello</h1> index.php?r=website/page&...

0
Q: PHP MySQL, get next key

bagofmilkI'm very new to PHP/MySQL. I have a form that submits data into the following categories of my MySQL database: DATE_INIT, PARTNO, QTY I also have a column titled "ECRNUM" that is my primary key and auto-increments. After the data is placed in the database, I have a phpmailer that needs to in...

0
Q: php redirect causing making circular referal

georgeI am trying to redirect to login page if user has not registered. I check the URL for permitted pages for unregistered users. If they are on any other page I do a redirect. However when I get back to same point in code, when I get URL, I get the old url not the redirected url. //Get Session da...

0
Q: PHP Distinct Equivalent

John SmithI know that if you can use distinct in an SQL query like so: SELECT DISTINCT column_name FROM table_name; In order to pull all the unique matching data so it is not replicated over and over again in a loop. I am having a bit of a conundrum in which I have a SELECT statement using Joins; everyt...

0
Q: jQuery post of array to PHP returns a string on server side... why?

zgr024Given the following table... I am taking the value of each cell and appending to a data array... <table id="ProductTable" width="1200"> <thead>...</thead> <tbody> <tr> <td>SLOTP10</td> <td>Some Description</td> <td>Some Qty</td> ...

0
Q: SQLSTATE[HY093]: Invalid parameter number: parameter was not defined - using greater than operator in SQL

Leothis is a weird one. Please look at the following php: $time = 1234; $query = $pdo->prepare('SELECT order_id, expiry FROM installs WHERE upd_code = ? AND expiry > ?'); $query->bindParam(1, $_POST['id'], PDO::PARAM_STR); $query->bindParam(2, $time, PDO::PARAM_INT); $query->execute(); Produces t...

0
Q: SQL Query - Contains query not working

AndersI have a column in my MySQL called 'country' What I want to be able to do is to load multiple records if the country column contains the country code that my visitor have. Lets say there are 2 offers for the same country. (US, GB) So the column, 'country' would look like this: US,GB Country | ...

0
Q: When implementing a Service Oriented Architecture is a good idea?

Łukasz LalikI'm considering to implement SOA architecture in Company where IT department has about 20 people. Are there any cases where SOA was sucessfully implemented in such a small team? Our first step was to divide our big PHP web application into two separate applications: backend that performs busines...

0
Q: How to use data from jquery appended dependent inputs in a form

Notsogood13Not sure that the title I choose is very explicit. If not, sorry. My question is if we have a form with dependent inputs like so: <form> <input type='text' name='item-1'/> <input type='text' name='sub-item-1'/> <input type='text' name='sub-item-2'/> </form> In this case, the sub items are dir...

0
Q: Inspect what's in current Mongo database with php

natecraft1I would like to see create a new connection to MongoDB within an already existing database using php and inspect/display all the embedded documents. All I have so far is $m = new MongoClient(); Is there a way to display the existing information in the database? Thanks

0
Q: PHP not showing data from MySQL

user2953986this is the code i am useing but when i open the page there is nothing on it. i do have data in the database and inside this table. but i dont get a error. i just get nothing. HELP!!! <?php $dbhost = 'localhost:3036'; $dbuser = '******'; $dbpass = '******'; $conn = mysql_connect($dbhost, $dbuser...

0
Q: CakePHP2 - url rewriting not working on live server throwing - 404 error

user2953967I have built a few small cakePHP sites before and decided to use it as a solution for a client that already had a functioning front-end and simply wanted to plug some update tools in. And so I stuck it in a sub directory and built the tools with no problems... that is until I took it live. On th...

0
Q: Pretty URLs on BuddyPress members search

henrywrightSearching the BuddyPress members directory without ajax enabled results in search URLs looking like this: example.com/members/?s=searchterm Is there a way have 'pretty' URLs such as: example.com/members/searchterm I have tried Mark Jaquith's Nice Search, but this doesn't work for the BuddyP...

0
Q: Sending data between two views in codeigniter

DeveloperI have 10 item in my home page now i select the first item which id is 1.Then after i clicking this i am navigating to the second page .I want to Send this id to the second page but i am not able to do that .I am nobs at codeigniter framework.I have tried several technique but all fail.And also w...

0
Q: Symfony2 "connection reset" only on one route

BispensGipsGebisI've been coding a project for some time. I'm quite new in Symfony2 and php frameworks, but find myself starting to understand it - which is great. Now however something weird has happened, and I don't know where to start to look. I was coding a scraper combining Symfony2 and casperjs - it has ...

0
Q: Is is possible to load an external ASP page then perform a submit to an ASP pages form

user1504605I would like to perform a search via GET from one website's html form to another ASP.net page's form that's on a different webpage. Is this possible? I want to do this for this website: http://www.fasnetdirect.com/kaneprls.asp?Page=home After inspecting element of the search box that says "Sear...

3
Q: How to reverse mysql result

Michael St ClairI need to reverse my array and I can't do it by switching the ORDER BY. This is getting the last 12 months, but I need to display them in the opposite order, right now it has October first, but I need it to echo last. If I switched from DESC then I would be getting the wrong months. My code is th...

-3
Q: I need to figure out how to manuipulate a name and get first initial and last name

user2690891I have data which holds many names. I need to output the first initial with the last name so for example: take john doe and return jdoe. I need to take into account that their are many names so I need a function(s) that will return the desired output.

0
Q: Adding an image to a JSON WebService -PHP

PasargadIs there any way that I can send images via my JSON Webservice? Here is my code which looks for new images in a specific folder and return some data including (path, id which is the name of image file and the creation time of the file): function getAllNewPhotos($lastCHK) { $dirPath = 'c:\m...

-5
Q: Is there cookie code help that will allow the remember function in form data for repeat submitters?

D ForstenI have a client who has a quote form and would like repeat "quoters" to have the option of having the form "remember" their basic information with out having to create an account. We are using Contact form 7 or Gravity forms to create the basic quote form. I am looking solutions and would like ...

-1
Q: Toggle the display of a table echod from php in Jquery

Dan BarrI have a table created in php that contains rows of customer information, with an additional row containing notes about each customer. I would like a button above the table that when clicked will show or hide the notes row of each customer. So far my code doesn't seem to produce anything, I cre...

0
Q: Problems with CSS @import url() on port 8080

timMy machine is listening on port 8080. The site outputs the following rel tag to the browser: <rel type="stylesheet" href="/path/to/loader.css" media="screen"> The loader.css outputs: @import url(this.css); @import url(that.css); This works in FireFox and Chrome on port 80. But not on port ...

0
Q: uppercase sensitive php mac

antI have my development website on a mac, and php don't care with uppercase and lowercase. But when I set my website on production server (debian) I have problems because I forgot to set uppercase. Is there a solution to set php on mac case sensitive ? for exemple $test = new test(); will work...

0
Q: Removing Tracking Spec from Ad Group

fiatuxI am using PHP-SDK for Facebook Ads API. While adding tracking_specs or conversion_specs to an ad group on Facebook platform, I am passing an array to relative parameters. But when I need to remove tracking_specs from an ad group, setting tracking_specs parameters to null, empty array, empty obj...

0
Q: Silex redirect from Twig template

travis.paxtonFirst, I know this is a horrible thing to do and should be done in controller logic only, but what I'm trying to do is create a custom redirect tag in Twig that fires a Silex redirect. I have a custom node that outputs the following into the doDisplay template: return $this->getEnvironment()->g...

0
Q: RNCryptor AES256 to match PHP MCRYPT_RIJNDAEL_256

Arnold SakhnovThe PHP API I’m calling from within my iOS app requires the payload to be encrypted in a certain customised way. I’m having troubles replicating that approach in Objective-C, with RNCryptor. Here is the PHP code used to encrypt a string: function encrypt($string) { $key = 'some-random-key';...

0
Q: i have a YouTube link one a string that i need to but on a single line

user2948145The function: function the_content( $more_link_text = null, $strip_teaser = false) { $append = '&w=480&rel=0'; $content = get_the_content( $more_link_text, $strip_teaser ); $content = apply_filters( 'the_content', $content ); $content = str_replace( ']]>', ']]&gt;', $content ); ...

0
Q: PHP comparing XML files

user2954005I'm having a problem with comparing XML files with eachother. I have a correct and a incorrect file in XML and I like to check where to went wrong, and if they went wrong I wanna give a message where it went wrong. My XML file is something like this. This could be the correct file and the second ...

-1
Q: insert PDF file into mysql database and retrieve it

collieI would like to use MySQL and PHP to insert PDF files into my database and then retrieve them and display them. How would I go about doing this.

0
Q: large mysql database slow acctions

peiman F.i have a database like this it have content of a site i grabbed with a php script and linux cron jobs after i got all pages of the sites it goes to work slowly and server load is: now i cant run a small query like this SELECT * FROM `content` WHERE `html` LIKE '%%simple%%' i think 3gb...

0
Q: PHPmailer from localhost?

bagofmilkI'm very new to PHP. I downloaded a phpmailer script (with files) from here -> phpmailer I'm using XAMPP and I located the files in: \htdocs\QMS\phpmailer My php script resides in: \htdocs\QMS\ I get the message that the mail was sent, but I do not see anything in my inbox, trash, or spam. I ...

0
Q: Can't select a column with an odd integer

Tuinopo80I'm learning MySql for a while now and I thought it would be fun to make a fun project where you can search for a plane. The problem is that I want to select planes in PHP with the given amount of engines. This works fine for even numbers, but when using odd numbers something goes wrong, but only...

0
Q: Email PHP Contact Form error as random output

Ad-vicpart of HTML file <div id="formwrap"> <form method="post" id="submitform" action="submitemail.php" > <input type="text" class="formstyle" title="Name" name="name" /> <input type="text" class="formstyle" title="Email" name="email" /

0
Q: Jquery post to reload or refresh Another window

SIndhuAm developing a php mysql app with codeigniter for users on an intranet. It heavily uses jquery and flexigrid. One of the components on a page is a table which gets populated via jquery post based on user action/actions on other components of the same page ... So far, all works fine. There are t...

0
Q: Facebook Graph API returns error when using Page ID

Jared EitnierPossible Duplicate: Graph API returns 'false' or 'Unsupported get request' accessing public Facebook Page and Unsupported get request in Facebook Graph API Problem: Trying to access a page ID using the graph yields this message as in the above two questions: { "error": { "message": "Un...

0
Q: Insert images (NSData) into BLOB fields

MallocFrom iOS app to php script, I want to store a bench of images as BLOB types: $profile_images = $_REQUEST['profile_images_array'];//get the array of images //loop the images and store them one by one foreach($profile_images as $image){ $sqlinsertimages = "insert into pr...

-2
Q: How to generate pdf with defined forms in php?

kavenI'm php newbie. I'll try to explain my needs. I would like to fill few forms in php that would be placed at appropriate locations in the document and then generate pdf file. I'm using mPDF atm. because I need polish signs to show up correctly. If you could help me anyhow I would appreciate tha...

0
Q: PHP and mysql syntax error

shawn aMy register.php wont query the simplest of queries: <?php session_start(); /* Connect and Query database "accounts", then close connection */ $connection=mysql_connect("localhost","root",""); if (!$connection) { die('Cannot connect to MySQL. Error: ' . mysql_error()); } $check_database = m...

0
Q: Change class for active menu item with php

user2954158I am trying to change the class of an active element in my menu with php, but I am having trouble when using "?side=testpage" as URL I'm typing the href in php to get the pages opened in the correct div according to my index where this code is included. The whole code is: <?php funct...

0
Q: Database column names in API result

TheBrockEllisI'm attempting to design a small API for our product. We have a MySQL database and I'm using a small framework for creating simple GET/POST commands in PHP. The problem that I am having is that I am not sure how to expose the data from the database without revealing the column names from the tab...

0
Q: fluent query for the following scenario

RoshanI have list of programs in database that it has organization_id to which the program belongsTo, a start_date and end_date. my question is, how should the query look like if two dates are given and i have to get all the programs that start between the dates or end between the dates for a specific...

0
Q: php foreach checkbox checked add to $emailto

Ghost EchoMy form needs to have multiple email addresses. I have a form that has checkboxes. Every checkbox that is checked should be added to where the emails' recepient list. The data is getting passed correctly, I know this because if I echo it out on a new page it will correctly show each of the values...

0
Q: PHP related- getting SQL Server 2005 to cooperate with Windows Server 2003

user2954185I realize the software I'm asking about are outdated to say the least, however it's due to the constraints placed upon this experiment. This is not a homework assignment, merely an experiment to test sql injection across several operating systems and configurations. I'm trying to find a way to s...

0
Q: What is the difference between using CSS or Jquery in this case

PHPI am creating a menu bar at the moment which uses 2 images designed in Photoshop , one image is normal and one image is on hover effect. I have seen that I can use both css and JQuery to create the hover effect, I find CSS much easier to use for example : image { background-image:url .. } imag...

0
Q: PHP page output as PDF issue

user1777711PHP page output as PDF issue I tried using dompdf and wkhtmlpdf but both output my pdf incorrectly, the font is too big and the table is over stretch. Then i saw one commercial site evopdf or something which output just like how my page appear as. Which pdf library works for php that can rende...

0
Q: Getting a 500 Internal server error when binding parameters to MySQLi object in PHP

user2954118I have a little problem with my PHP script. I have checked the code without the binding and then it works and I can't see any misstakes that should call a 500 error. The execution that is messing with me is $stmt->bind_param('sssssssssiiiiiiiiiiiiiii', $company, $orgnr, $street, $zip_area, $na...

0
Q: Parse Error: Syntax Error, unexpected T_STRING in /server.php

user2954201Parse error: syntax error, unexpected T_STRING in /server.php. The line shows as follows; $data = file_get_contents('http://awebsite.com/status?server_ip=<?=$s['ip'];?>&clean=true'); I believe I am getting this because of <?=$s['ip'];?> Are there any work arounds for the T_STRING in the...

0
Q: Multiple &(AND) fails in query

N e w B e ehere is my query $sql = 'SELECT * FROM Orders INNER JOIN [Order Details] ON Orders.OrderNumber = [Order Details].OrderNumber WHERE Orders.CartID =2 AND [Order Details].Option10 Is Null AND [Order Details].Status="Shipped"'; this queries when entered in MS_Access sql view, returns the c...

0
Q: Can Not delete a file from directory using php

Rahi M.I have some files in the directory ../gallery/drawingimage/ i have to delete a file. I have written the following code. But it is not working. <?php include("../gallery/includes/connection.php"); $file = $_POST['fname']; if($_POST['ptype']=='drawing'){ $delete = mysql_query("DELETE FR...

-1
Q: How to count the number of row with select count(*)

Jason Van MalderI tried to get the number of row using select count(*) with multiples parameters and encode it on JSON Format, but i got this : {"notification":[{"count(*)":0}],"message":[{"count(*)":0}]} Instead of excepted : {"notification":0,"message":0} There is the code of the page here : <?php ses...

0
Q: Is it possible to store an array as flash data in Laravel?

AntonNiklassonI have been looking around for a way of doing this. I know it is possible to store an array in the session with the following: Session::push('user.teams', 'developers'); Is it possible to do the same but with flash data? Something like Session::flashpush('user.teams', array('developers', 'design...

0
Q: Issue integrating captcha with PHP

user2673246So i am trying to integrate this captcha package. i have followed the steps and have the image displaying and refreshing on the submission page. the issue i'm having is validation on the php page that does form validation. no matter what i do, it states that the entry is invalid. here is the ...

0
Q: Generating user pages, where to start?

jt0ddI'm ready to try to develop a site that allows viewers to see user-specific information pages by visiting www.domain/username, but I haven't found any tutorials on the subject. Can someone point me in the right direction?

0
Q: Symfony and Doctrine Querying For Hour Ranges

keyboredIn a previous question (SQL query between two times on every day) I asked about querying across a set of data and returning all entries that had dates associated with them that were between two hour values. I'm also trying to exclude Saturday and Sunday. The answer I received is valid when dealin...

1
Q: Redirect 301 an address with a / in .htaccess

user2954254I want to redirect an address with a / : mywebsite.com/img-41/ to another without the /: mywebsite.com/img-41 Of course the 41 is a variable. I tried this: RewriteRule ^img-([0-9]*)/$ /img-$1 [L,R=301,NC] But it doesn't work :( Could you please help me? Thanks in advance, lucas.

0
Q: Smart image upload script: MySQL database design/logic

LemonI have a basic project design idea and know some PHP and MySQL but am struggling with the logic, and am not sure if I've planned it correctly. The project is an 'upload from URL' image uploading script. It's MySQL database contains unique locally hosted URLs which are linked to one or more off-s...

0
Q: Publish to users feed returns error : Array

Adrian De Barroif($user !== 0) { $info = $facebook->api('/me?fields=id,name,email,work'); $acces = $facebook->getAccessToken(); try { $publishStream = $facebook->api("/$user/feed", 'post', array( 'message' => "Hello {$info['name']}", 'name' => 'Test ...

0
Q: When I auto-load a class/file with composer, what is actually happening behind the scenes?

user2171102I haven't been able to find a strait answer to this question yet elsewhere online and was wondering how exactly composer autoloading worked. When I autoload a class using PSR-0 or classmap what is actually happening behind the scenes? Is it just calling include(or some include variant) on the th...

0
Q: PHP - String spanning multiple lines

Evan DefendI'm fairly new to php. I have a very long string, and I don't want to have newlines in it. In python, I would accomplish this by doing the following: new_string = ("string extending to edge of screen......................................." + "string extending to edge of screen..................

0
Q: Using AJAX to call a php function keeps failing

Tom Burmanim having a problem trying to get an ajax call to trigger a php function and then return successfully. As far as i can see my syntax is correct. Here is the JAvascript file contents: function set_ship() { var datastring = {'ship':'true'}; $.ajax({ type:'POST', url:'http://localhost/magen...

0
Q: Run a second query inside a foreach loop?

user2921557Need to run 2 queries inside a foreach but cant do it without errors. So, i have this for showing comments: $query = 'SELECT * FROM comments WHERE updatepostid = "' . $postID . '"'; try { $stmt = $db->prepare($query); $stmt->execute(); $countcomments = $stmt->rowCoun...

0
Q: Can not loop topic

user1807378The code is not able to loop topic_title on 2nd foreach loop..... Its looping the subcategory list but not topic_title. It shows only one topic_title under each subcategory Please help <?php if (isset($_GET["datatb"]) AND isset($_GET["cat_id"])){ $datatb = $_GET["datatb"]; $cat_id = $...

0
Q: Use regular expression to extract longitude from hidden input

Ben PatonI need a regular expression in php to extract the longitude and latitude from this html: <input type="hidden" value="53.484561000000" id="latitude" /> <input type="hidden" value="-2.951027000000" id="longitude" /> I thought something like this might work: preg_match('/id="latitude"\s*value="(...

0
Q: Sonar php analyzeOnly

deblocktI don't understand why my build sonar not read my phpUnit xml log. # Required metadata sonar.projectKey=org.wewakeweb.sonar:culturalstore sonar.projectName=culturalStore sonar.projectVersion=1.0 # Comma-separated paths to directories with sources (required) sonar.sources=src # sonar.exclusions=...

0
Q: MySQLi - search through an array

Homer_JI have the following code: function resultToArray($result) { $rows = array(); while($row = $result->fetch_assoc()) { $rows[] = $row; } return $rows; } // Usage $query = 'SELECT q17, COUNT(q17) FROM tresults GROUP BY q17'; $result = $mysqli->query($query); $rows = resultT...

0
Q: How to store the needles found in a haystack into an array?

SempiternaI have a few unknown needles in a haystack, of which I want all the needles extracted and stored in an array. The unknown needles are all in the same format. They start with a [, followed by 1 to 10 digits and end with a ]. So far i have this: $keywords = preg_split("/\[[0-9]{1,10}\]/i", $stri...

0
Q: Using PHP/MySQL I need to have a form dropdownlist generated using tablenames from my database

user2954287First and foremost first time posting a question be easy on me please :) I am trying to generate a Form DropDownList (Select/options) using PHP/MySQL. I need the options to automatically populate using tablenames from my database that only contain ".com" This is my current code: <?php $con = m...

0
Q: button onclick javascript not working on ie

user2954275We are having some trouble with IE using this. I am using this code to show the button: <button onclick='del_book(); return fale'>Delete Booking</button> And this is my function: function del_book(){ $("#rem_error").text(''); $("#rem_error").hide(); if($("#pid_").val() != null){ ...

0
Q: Woocommerce+Show a Menu with only the Category and Sub-category

rickvoI have a menu structure that looks like this: Categorie 1 - Sub Category - Sub Category Categorie 2 - Sub Category - Sub Category Categorie 3 But I only want to show the active category with it's subcategories on the product archive and product detail pages. Like this: Category 3 - Sub Cat - ...

0
Q: adding <?php ?>into a <TD>

user2954201I'm still new a PHP so i'm trying to figure things out as I go. There is one thing puzzling me. (LINE 51) <TD><?php $data = file_get_contents("http://awebsite.com/status?server_ip={$s['ip']}&clean=true"); if($data == 'true') { echo 'Online'; } else { echo 'Offline'; } ?></TD> This see...

0
Q: difference between single quote and double quote

N e w B e eokay....today...I fell an issue and as Aaron told me, issue was with quotes, I was using single quotes outside and double quotes inside.. Can somebody explain what is difference between ' and "" any rule where to use each ? can we always / some times replace it with each other?? it will b...

0
Q: Session set in subfolder not working on root folder in live server but works on localhost

user2780294This is driving me nuts. The code works fine on localhost but not on live server. I set the session in subfolder, This is my subfolder file, I set a session using PHP: $_SESSION['test'] = 'hi'; print_r($_SESSION); But I can't access the session i set in subfolder, in root index using in index...

0
Q: AdaptivePayments error

user2954307I wrote a script more than a year ago to send automatic payments using the AdaptivePayments api. It worked fine till october 25th when I started getting this message: This+transaction+cannot+be+processed.+Please+enter+a+valid+credit+card+number+and+type Our company paypal account is linked to a...

0
Q: Wordpress wp_insert_post causing Infinte Loop

nef426I'm developing a Wordpress Plugin, which takes a PitchEngine JSON feed, which takes the PitchEngine 'Pitch' and adds it as a Wordpress Post. I am able to retrieve the 'Pitch' contents, however the bellow function which adds the 'Pitch' as a post, results in an infinite loop, which adds an infin...

0
Q: Save Img Src to Javascript Variable

Samit PatelI am trying to set the image src inside a hidden variable that is passed from my form. When I output the variable is "undefined" I am pretty new to Javascript and not sure what the problem could be. My error is on line: document.sampleForm.image.value = "images/"+img.attr('src')+""; Thanks!...

0
Q: PHP add the word 'at' in Date()

artSir $dateFormatted = date("l, M j g:i a", strtotime($day .' '. $preferTime ) ); very simple but can't find it i want to word 'at' between my month and time, obviously 'a' and 't' are reserved. What can i do? Should i just do this? there must be a smarter way $dateFormatted1 = date("l, M j ...

 
10:53 PM
0
Q: SQL Injection accept-language php

Michael ColeI'm working through a security assessment report on a php app generated by Accunetix. The report is claiming a SQL Injection vulnerability. The app is PHP with MySQL. Here's the headers it says are making the attack (specifically the accept-language header): GET /user_login.php HTTP/1.1 user-...

0
Q: PHP MySQL auto-create hardcoded hyperlinks

bagofmilkBelow is a picture of my database. I am going to make the numbers on the left (81305, 81306, etc..) all hyperlinks. When the user clicks on the hyperlink, they will be directed to a page (all links will be this page) "dpupage.php". This page will have a form with empty values. I will then use S...

0
Q: xampp https becomes unresponsive while http is fine

ArianMy xampp server has SSL configured to work, however after about a couple hours of heavy traffic, my https:// site becomes unresponsive and the http:// is still working fine. What could be causing this problem? I've set the logs to debug mode, and still haven't found anything. I followed these ste...

0
Q: PHP-FPM: Operation not permitted

vanchesterWhen I try to open index.php in browser I see the error: No input file specified. In error.log: 2013/11/04 22:40:07 [error] 3435#0: *4 FastCGI sent in stderr: "Unable to open primary script: /var/www/index.php (Operation not permitted)" while reading response header from upstream, client: 10....

0
Q: nexmo balance check with message alert box

Syed Farhan AhmedI want to show my nexmo balance in alert message box button. Will you please guide me that How can I do this? <script> function myFunction() { alert("Your Total Balance is : " . $balance . " Euro "); } </script> </head> <body> <input type="button" onclick="myFunction()" value="Check Balance" />

0
Q: SUM of Multiple COUNTs on Different Tables

Rmilligan2372This topic appears to be a popular one and definitely saturated in terms of the number of related posts, however, I've been working on this for 3 days and I cannot get this figured out. I've been scouring this site and many others with potential solutions to this and some are executing, but I ...

0
Q: How to access smarty php function using jquery/javascript?

Rochelle CanaleI have a problem with my code. What I want is how can I access a smarty PHP function using jquery. Right now I have this code. <div class="select_wrap w096 h024 ml006 f1"> <select id="dispatch" name="dispatch"> <option value="companies.catalog" {if $smarty.request.dispatch eq...

0
Q: Magento White screen of death on back and front end

connori tried to update my magento site using this method: How to upgrade magento 1.4 1.1 to 1.7.0.2 i typed the code in ("magento-core/Mage_All_Latest") and hit "install", i left the page and it when i came back, it refreshed. and since then the front and back end are just white screens of death and ...

0
Q: uploading a file with uniqid()

Rodrigo Ayalai am trying to upload a file to a web page, but i have to use the function uniqid(), but i doesnt work, what i am doing wrong? here is my code where do i have to write that function? thanks a lot ......................................................... echo "<blockquote>"; require("../lib/MySQL...

0
Q: Converting WSDL to PHP source code

SteApA third party provided a WSDL specification, through which I'm going to transfer data to a remote application using SOAP. I'd like to convert all declared types, constants and method signatures to corresponding classy PHP source code. Today, I gave WsdlToPhp a try. As far as I figured out, this...

0
Q: MySQL syntax error - can't create a table

Newbiehere is my code CREATE TABLE IF NOT EXISTS items ( id INT NOT NULL AUTO_INCREMENT, name varchar(256) , description TEXT, price INT , images TEXT, views INT , hidden TEXT, purchases INT, PRIMARY KEY (id) ); CREATE TABLE IF NOT EXISTS methods ( method_id INT NOT NULL AUTO_INCREMENT, metho...

0
Q: Codeigniter function array always returns no

Rohan PetersRather noobish question. Given the following code: public function in_group($group) { $session = $this->CI->session->userdata('logged_in'); $query = $this->CI->db->get_where('people_groups', array('people_id' => $session['user_id'])); $array = array(); foreac...

0
Q: mySQL syntax for select query

DaveI keep getting a syntax error on my query and I do not know what I am getting incorrect. The idea is to select the nth row like this: $sql = "SELECT name FROM people WHERE age = ? AND (family = ? OR family = ?)"; if($limited){ $sql = $sql . ' ORDER BY id LIMIT '.$nth_row.', 1'; } $stm...

0
Q: only on chrome i got this error: Uncaught TypeError: Illegal constructor

Robertas Uldukiswhen i did load jquery on Chrome i will receive this error: "Uncaught TypeError: Illegal constructor" On rest browsers (IE, Mozilla) it's working fine. Here is couple screen shots from my PC. It's a same error. Any ideas how I can fix it?

0
Q: Database table to make drop down select using cakephp

user2948950I have one controller for invoices and another for clients. I have made some "relationships" in the models of these controllers as below: Client.php <?php class Client extends AppModel { public $hasMany = array( 'Invoice' => array( 'className' => 'Invoice', ...

0
Q: PHP Cookies returning empty from jQuery/Ajax call

AndrewI have a domain (example.com) that sets a cookie using PHP like so: $source = 123; setcookie("source", $source, time()+3600, '/', ".example.com"); I want to share this cookie across sub-domains. When I navigate to "sub.example.com/index.php" and run the following PHP code: echo $_COOKIE['sour...

0
Q: OpenCart - How to test what category a product is in?

Laurence LordIs it possible to test which category a product is in from the View Cart template? This file: catalog/view/theme/my_theme/template/checkout/cart.tfl I guess modifications need to be made to the controller (catalog/controller/checkout/cart.php) but I can't work out how to test for the category o...

0
Q: Parse JSON Data with PHP

Brett PowellI have parsed JSON data numerous times but for some reason cannot find the correct syntax to use when the data is nested. I am trying to parse the "assets" from this JSON but continue to get a invalid argument supplied foreach() regardless of what I try. "3435":{ "name":"COLO-1014-SJ1",...

0
Q: PHP : Parsing HTML table to JSON

user116954I have a HTML table that want to parse to JSON. <table class="valas" border="0"> <tr> <th>Mata Uang</th><th>Jual</th><th>Beli</th> </tr><tr class="odd"> <td>USD</td><td class="number">11.450,00</td><td class="number">11.300,00</td> </tr><tr class="...

0
Q: Possible to get user profile information after login using hwioauthbundle in symfony2?

PezI'm using HWIOauthBundle and FOSUserBundle on a Symfony2 application. I have a situation where a user can opt to create a profile object at a step unrelated to logging in, and would like to grab the data from their social profile at this step. Is it possible to user HWIOauthBundle to get profil...

-1
Q: Regex: Match all quotes inside brackets

user2954380i have a text like this: hi this is <some-tag parameter="abc"> example text with quote sign here " and also some quote sign here " and here ". Quote does not have to be closed. And some numbers here 123.</some-tag> Basically, what i need is to match all occurrences of double quotes (") that ar...

0
Q: dompdf HTML to PDF - can't set margin of page

Nereo Costacurtaverion: 0.6.0 beta 3 I tryed in every manner to make dompdf set the margin of the page. I have a long page with a lot of text, divided in chapters... my css is something like: #wrapper{ padding:8px; } /* other styles... */ @page{margin: 0.2in 0.5in 0.2in 0.5in;} when the php is <?php ...

-1
Q: how to change the version of php in ubuntu?

user2938952I'm using php version 5.3 in my local and I need to use phpldapadmin, but it doesn't work in version 5.5. how to change the version of php 5.5 to 5.4 in ubuntu 13.10?

-1
Q: PHP: how to use array key on function when you know an array will be returned?

hamobiFor example.. can I do this $data = $this->getSiteAcq()['mykey']; or can I only access it after i set data

1
Q: Passing a variable in a url to a PHP file

GiovanniIm following a MySQL article on the basics of using HTML and PHP. The two files I have are very very basic: Index.html: <A HREF="welcome.php?name=Kevin"> Hi, I'm Kevin! </A> welcome.php: <?php echo( "Welcome to our Web site, $name!" ); ?> When the link is clicked on the index page, I get...

0
Q: Override routes in Joomla

Luis MartinI needed to create an estate agency online on a Joomla 3.x installation. Since I didn't code anything in Joomla since v1.5 and I forgot almost everything, and due to lack of time, I decided to do it by using a plugin for embedding PHP code within articles. So I'm using an article to list properti...

0
Q: Extract html information from a JSON request and displaying in html document

ScottI would like to extract the iframe code from a JSON request and display it in an HTML document. The link is: https://sketchfab.com/oembed?url=https://sketchfab.com/show/a79f6f7b26574baeb58ce392f837c3c7 The iframe code I would like to extract from this link is: <iframe frameborder=\"0\"\n wi...

0
Q: Dynamic JQuery Form Submit for Multiple Forms

Amie CrutchleyI have PHP that searches a database and then echoes an html form for each result found. These are loaded via AJAX into the main HTML page into a div on document load. Now I want to have listeners for each of these forms submitting. They all have the same inputs. Each form has an incremental ID of...

0
Q: PHP: imagettftext & imagettfbbox - collision detection of words

JonI have a list of words in an array which I am able to write to a PNG using imagettftext. imagettfbbox is being used to determine where the next word should go. I would like to check if the current word I am trying to write to an image will overlap with the previous word that has already been wr...

0
Q: PHP file not executing in IIS

KilizoI have a PHP site which works fine, except when I try to access a script which is saved a few levels down it displays the source of the php file. The server is IIS. I can provide the web.config or any other information that might help. Thanks in advance

0
Q: Why is my validation from files index.php to login.php not working?

RomelWhat I'm trying to do is make sure the user inputs a quantity before clicking submit. The problem is that, the user can continue to the log in screen without any numerical input in the quantity box. I've tried pasting validation codes, but it still takes my user to the login.php screen. Any he...

0
Q: Trouble shooting PHP cURL

David NguyenThis is an old script that is no longer working that logins to Paypal, I had a working version but deleted it by accident now I'm trying to get an old back up working. Initialize curl: $ch = curl_init(); curl_setopt($ch, CURLOPT_VERBOSE, 1); curl_setopt($ch, CURLOPT_POST, 0); curl_setopt($ch, C...

0
Q: $_FILES not working and gives no errors

user2738046this is my html page which includes form : <html> <head> <meta charset="UTF-8"/> </head> <body style="text-align:center;" > <form id="upload" action="file_upload.php" method="post" enctype="multipart/form-data"> <input type="hidden" name="MAX_FILE_SIZE" v...

 
00:00 - 15:0015:00 - 00:00

« first day (258 days earlier)      last day (52 days later) »