« first day (290 days earlier)      last day (20 days later) » 

10:04 PM
0
Q: PHP How to Insert Data Input from a Dynamically-Generated Form

user1713438I need assistance in taking the next step in inserting data entered into a dynamically-generated form. I have looked for a number of days at other similar questions and am still missing a piece. Here is my HTML form (minus error trapping/validations): <form id="form" name="form" method="post" a...

 
10:17 PM
0
Q: Specify columns for PDO::FETCH_KEY_PAIR

Lucky SoniI have a table with a following columns (more than 2) in my database: 1. id 2. name 3. email I am trying to fetch key value pairs using PDO by fetching the fetchMode to PDO::FETCH_KEY_PAIR and specifying columns id and name which works just fine But when i try to specify name and email as the d...

1
Q: CakePHP: how to do sub-actions with sub-views

SDPApologies if I'm using the wrong terminology to describe what I'm trying to do... I have a model/controller called Report which users can view like so: example.com/reports/view/123 Each report hasAndBelongsToMany File objects. I need to make those files accessible like so: example.com/report...

0
Q: using php via terminal not loading

TH1981I'm trying to use php via the command line. I've setup my alias to the MAMP php5.4.10 version. It's giving me the following error: dyld: Library not loaded: /Applications/MAMP/Library/lib/libfreetype.6.dylib Referenced from: /Applications/MAMP/bin/php/php5.4.10/bin/php Reason: Incompatible...

0
Q: CURL and TCP ports

user2203703Can CURL make a connection to any TCP ports not just http or https For example: I need to check open port for example: 11740 Does it possible? Thanks

0
Q: Not allowed to load local resource: file:///

user3000457I have some images in a folder called "Slides" in my project; I am trying to access those images; but it gives me the following error: Not allowed to load local resource: file:///C:/xampp/htdocs/MyProject/Slides/123_completed.jpg where is "file://" coming from?! (Probably thats the problem!) ...

0
Q: I'm unable to run sqlite functions in php

user3076112When I run the following code <?php echo sqlite_libversion(); echo "<br>"; echo phpversion(); ?> I get this error Fatal error: Call to undefined function sqlite_libversion() I was brought to this page PHP isn't working with SQLite Like the person who asked a similar question I typed php -m ...

0
Q: After successful ajax POST operation nothing happens in the database

user3050963I've checked for duplicates and there are NONE restrictly related with this problem. I have the following javascript code var value = $.ajax({ type: "POST", url: "bank.php", data: {sum:money}, cache: false, async: true }).done(function() { console.log( "success" ); ...

0
Q: Replacing URLs with link using a for loop

JafoolI've been searching around for this but all I could find was broken scripts and plus, I might have a method that is quite simple. I'm trying to use a for () loop for this one. This is what I've got: <?php $reg_exUrl = "/(http|https|ftp|ftps)\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?/"; $ma...

0
Q: Simple PHP Object-Oriented $this

Mitch GlennI'm trying to brush up on some object oriented basics. I wrote this simple script but am confused as to why it works the way it does. class Foo { function run($text = null) { $this->bar = strtolower($text); echo $this->bar; } } $foo = new Foo; $foo->run('THIS IS SOME TEXT IN LOWER ...

0
Q: Can't Start apache server in XAMPP

Ahmad Vataniwhen I want to install XAMPP in my windows 8.1, before installation I got this Warning: Important! Because an activated User Acount Control (UAC) on your system some functions of XAMPP are possibly restricted. With UAC please avoid to install XAMPP to C:\Program Files (x86) (missing write per...

0
Q: How can we perform server-side form validation by taking advantage of HTML5 attributes as one might do in JS/jQuery?

Manav MisraHere is a bit of JS/jQuery code that basically goes through and 'picks up' on any fields that are marked with HTML5 attribute 'required' or 'pattern.' It then adds an 'error' class to call attention to it for the user, etc. $('[required], [pattern').each(function () { // if field is required, we...

0
Q: prevent input string or integer value php

KingkongI have a question about to writing a php code which prevent to input string or integer let say I'm waiting for user input which should be a string. example please Enter todays date : $date and I write a code to prevent input integer. if($edate== NULL || !_string($edate){ close }...

0
Q: Fullcalander dont show time

user3075918dont show de time in calendar i have this code on javascript: var calendar = $('#calendar').fullCalendar({ firstDay: 1, monthNames: ['Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre'], monthNamesShort: ['...

0
Q: Php Login not working for me

user3076201<?php if(isset($_POST['submit'])){ $dbHost = "localhost"; //Location Of Database usually its localhost $dbUser = "xxxx"; //Database User Name $dbPass = "xxxxxx"; //Database Password $dbDatabase = "medical"; //Database Name $db = mysql_con...

0
Q: PHP echo fails but return works?

user1721230I have made the below for wordpress plugin shortcode, "return" works fine, however "echo/print" doesn't seem to work. "echo/print" isn't present anywhere else in the file so I guess its disabled or something, if that is even possible. So without the use of "echo/print" how do I compress the belo...

0
Q: Is it correct to use require/require_once() statement in ZF2 OO PHPUnit test case code?

DennisThis is a question on proper coding of PHPUnit Tests in Zend Framework 2, using Object Oriented code principles. I have the following PHPUnit Test Case: namespace FedcoUserTest; use FedcoUser\Controller\MachinistController; class MachinistControllerTest extends Framework\TestCase {...} My Ma...

0
Q: Pull only one category from tables

user3076198I'm making two web pages one for SHOES and the other for BOOTS. I would like to fetch all the shoes for one page and then all the boots for the second page. So basically I would like to know how I can list all the products from one category from my tables. First table product_id, name, desc,...

0
Q: load JSON data in variables, "echo" them and refresh every x seconds?

user3075799need some help. I´m ok with php but really don´t know much about javascript. I need to get the JSON data into variables and want to update that every x seconds on a website without reloading the whole page. How do i get the data in the variables? How do i refresh the data without reloading the ...

0
Q: Having a cycled (interval) pictures on pre-loaded page through a directory

user3076219I am currently working for a library that would like to have a webpage designed digital signage. Most of it has been designed with widgets and through a program called Xcite Pro. I was unable to find any widgets that will allow me to do a slideshow from a directory that will cycle through. I do k...

0
Q: Uploading files to Amazon S3 with PHP ends up with a 28 byte file

Frederik NielsenI am working on a project where users can upload files to the site that is stored in an Amazon S3 bucket. This doesn't really work though.. The server sees the file and everything seems good, apart from the file only being 28 bytes big when it ends up on amazon.. This is my code so far: contro...

 
10:58 PM
0
Q: Can my user access the content of $_SESSION by clicking a button short of Ajax?

JDelageI have an array of arrays in $_SESSION. I want to print the first sub-array in an HTML table and then populate the table with the next element each time the user clicks on a button. I know how to do that using Ajax. That seems like overkill (after all I don't need to retrieve more data from my db...

0
Q: Why doesn't mktime() work with double digits when a single digit is sufficient?

jimiringsI'm fairly new to PHP, so forgive me if this is a stupid question. I tried to run mktime() on my site and, because I'm still getting familiar with the syntax, ran something like this: echo date('h:i:s M-d-Y', mktime(12, 00, 00, 12, 08, 2013) ); Which I was surprised to find returned this: ...

posted on December 06, 2013 by totymedli

I have an array structure like this: Array( Array( 'name' => 'apple', 'price' => 2, 'parent' => 1 ), Array( 'name' => 'pear', 'price' => 3, 'parent' => 1 ), Array( 'name' => 'milk', 'price' => 10, 'parent' => 5 ), Array( 'name' =>

0
Q: Delete script for Dropzone.js and PHP not working

JSHelpI am using dropzone for file upload. I want to delete the files on the server when the removeLink is clicked. For that I use Ajax which opens the .php site. But somehow I can't pass the filename of the file which should be deleted (the delete_image.php works). How can I pass the filename so it ca...

0
Q: Google Analytics Transaction Not Tracking

Mike BarwickI'm trying to set-up Google Analytics transaction tracking on a client site. Below is the code I have placed on the Order Confirmation page (directly after opening <body /> tag). However, the transaction is not being tracked on GA. Note, I'm using analytics.js versus ga.js, which is the newer GA...

0
Q: Browser is caching even when forced not to

nourdineI have a strage behaviour I cannot explain with an app I am working on. In the bootstrap of the app I do something like this: try { // db connection and 3rd party services availability checks } catch (Exception $ex) { // here I will put all sorts of headers meant to disable caching...

0
Q: MySQL sum values of a row

user3073626This query update user points for game1 and game2, I would like to insert the sum of these 2 values in another column called 'total_points'. I realized I can't use SUM(), because they're many columns but just one row. What's the best way to do this? I currently have this query: $query = "UPDAT...

0
Q: Can not pass variables from Javascript to PHP for database use

FearlessRoosterI am not recieving any errors when testing it but it does not insert into the database or select from the database to return results. I think the problem is in passing the 2 variables via the xmlhttp.open() method. Any help would be greatly appreciated. Code Below: HTML File: <script> func...

0
Q: woocommerce landing page: how to add an add to cart button

JoelI'm building this page for a client: http://alliedscientificpro.com/lp/lightingpassport.php It is a simple HTML, NON WORDPRESS landing page. So there is no wordpress code, no Woocommerce code, etc. Just a custom built html page, made to look like the site. What is the best way to have my "add t...

0
Q: Create login accounts and store them in a text file using php

craft3makerI want to create a create account page for my simple login site where the user clicks a create account button and they are brought to a page with the following form to enter a login name and a password. <form action = "createaccount.php" method="get"> <h1> Please enter your information ...

1
Q: Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL

user3076307Help me out, Im using localhost and getting this error whenever i fill out the form and click on submit button Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''aw-tech'.'contact' (name, email, ph...

0
Q: Laravel strange PDO fetchMode issue

Lucky SoniThis works and shows the result set: $mainFeatures = new Mainfeature; $mainFeatures->getConnection()->setFetchMode(PDO::FETCH_KEY_PAIR); $main = $mainFeatures::get(array('id','data'))->toArray(); dd($main); But if i try to return with the result set: return View::make('orders.create') ->...

0
Q: Wordpress php excerpt not working - v simple

Rob Frostfirst post on here and its something I cant possibly find an answer to without a direct question. I am assuming this will be easy to answer to people who understand what they are looking at. I have an excerpt in my theme but it isn't working. By this I mean it is showing the excerpt but it is no...

-3
Q: interview Coding test PHP

melnajjarI had interviewed test my knowledge in PHP I have this code what is the output and I make educated guess 48 this is what I remember from the code can someone help me ? $items = array("apple"=>2,"orange"=>50,"banana"=>3,"ss"=>4) print getItem(items[2]-2); function getItem($items) { $ite...

0
Q: Cutting down my PHP SQL query to a function or variable

Mike WoodIs there a way i can make the following code a single variable or function $result = mysql_query("SELECT * FROM a0pg3_mikes WHERE pkey=".$pkeyurl); while ($custrow = mysql_fetch_array($result)) { } ?> I want to put this in my functions.php file and call the whole lot with something like... <?...

-2
Q: Make an image move to another place when it is clicked on, using javascript and php?

user3076322So I have a PHP page with images. And when each image is clicked on, I want each of them to move across the page and then become hidden. <div class="lagoon"> <img src="images/lagoon.jpg" alt="lagoon" id="LL"/> <p class="text">Lagoon</p> </div> This is the code for one of my images. I now n...

0
Q: ffmpeg php - how to apply filters without losing quality

JohnHere is a simple request, it has an input, output, and two watermarks. From what I gathered I can't apply "-codec copy" because I'm using a filter. exec('ffmpeg -i input.mp4 -i wm-bl.png -i wm-br.png -filter_complex "overlay=x=0:y=H-h,overlay=x=W-w:y=H-h" output.mp4'); this does the trick, as ...

0
Q: PHP IF statements and Multidimentional arrays accoriding to data

iammikerodriguezI'm trying to write an IF() statement that will prevent multiple things from happening according to the data that is inside of a multidimentional array. I'm having trouble translating this into code. Unfortunately, in_array doesnt work for multidimentional arrays. Explanation: If the student co...

-3
Q: Php log in building

user3076201 <form action="adminlogin.php" method="post"> <div class="form_row"> <label>Staff id:</label> <input type="int" class="form_input" name="staff_id" /> </div> <div class="form_row"> <label>Staff Password</label> <input type="int" cla...

-2
Q: Upload XML file to update database

beginneri wanted to know if it is possible to upload an XML file , which contains data in a ordered manner, which can then update values in a table of a database. Considering I have a database with table furniture with columns ID , type , cost . Can I upload an XML file (like our everyday file upload,...

0
Q: Image doesn't update after changing it on the server when downloaded by app

NirPesYou could say its a little complicated so read carefully: I have an app that upload an image to the net, (image can be anything, from user's device). I have now added a edit function to that "struct" where the user can also upload a new image if he would like. It DOES work.. Im checking it thr...

 
11:59 PM
0
Q: PHP Interface and Abstract Class best practice for inheritance?

user702300When defining the structure and inheriting Interface and/or Abstract Class, which one is the best practice? And why? Here are 2 examples: Here is the example for [Interface] -> [Abstract Class] -> [Class] Interface DataInterface { public function __construct($connection); ...

0
Q: Detect if two recurrent events overlap each other

true ツI need to check that one recurrent event does not overlap another one. Each recurrent event looks like following: dateStart (for example, 2013-12-07 03:30:00) duration (duration in seconds, minimum 5 mins, no maximum limit) repeatDaysMask (for example 0011001) So, each occurance of individual...

 

« first day (290 days earlier)      last day (20 days later) »