Tagged Questions
PHP is a general-purpose open source programming language that is especially suited for web development
-1
votes
0answers
8 views
How to set timezone for your european websites? PHP, mysql or Ubtuntu…?
I run a european website hosted on MediaTemple (DV server with full control on OS) here in US
what's the best practice to set the timezone? show i go to the MediaTemple admin/ubuntu? or mysql or php ...
0
votes
0answers
4 views
PHP Stream Array via HTTP API
I'm having a bit of trouble understanding if what I am trying to accomplish is possible and my quest for an answer has been muddied by the various "image/file chunking" stuff.
I have two web ...
0
votes
0answers
10 views
error trying to install symfony command line tools on Phpstorm
I'm running symfony3 and tried to install a symfony command line tools after having installed composer line tools (which get installed without any problems) however, whenever I try to fill the path ...
0
votes
0answers
6 views
Codeigniter how to use get_where() to search in a column that contains part of a string?
Apologies if the title is confusing. Currently I have this as part of a get_where function:
$query = $this->db->select('*');
$query = $this->db->get_where('Accounts', array('active' => ...
-1
votes
1answer
25 views
php mysqli_query not executin either echo is showing in url
I am not that good in php however the below code was working before I changed thr host name. the echo is not showing when I load the url , neither the insert is being executed.
$con = ...
0
votes
1answer
14 views
How can I arrange the column names to display the data by substituting “$variables”?
so this is what I have so far.
$query = mysql_query("SELECT * FROM tablename ORDER BY id");
while($r = mysql_fetch_array($query)){
extract($r);
echo $variables;
}
The error I get cause of above ...
1
vote
0answers
24 views
How to make foreign key
i'm trying to make an sql create table but I fail to make a foreign key.
My code :
Db::getInstance()->execute('
CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'sondage`(
`id` int(6) NOT ...
-1
votes
0answers
19 views
I lose value of $_SESSION when I call the second time
I get value null $_SESSION when I call the second time. The first time I get the value, but the second time not?
What am I doing wrong?
The code is the following:
<?php
session_start();
...
0
votes
0answers
7 views
Enqueueing script in Wordpress for post or page content only
I'm trying to create a flipbook on a page on my Wordpress site by using turn.js and I've successfully enqueued this script but it messes up the header portion of the page.
What can I do to ...
-3
votes
0answers
26 views
Which PHP framework can I use? [on hold]
I have to develop a web application, but seeing that I'm by myself, I'm looking for a PHP framework that help me to:
1) Manage users: registration, sessions, administration. I need default ...
-1
votes
1answer
8 views
Limit with Next and Previous buttons using PHP & Mysql
I seem to have encountered a problem implementing this code into my page.
Basically I'm trying to put a limit of 5 on the display from the database which can be changed using next and previous ...
0
votes
1answer
13 views
How to insert data into a mysql database form an Android app?
I need to insert into a mysql database some data retieving from an android app and insert it into some different tables.
I create a user's register page/activity and it work but I tried to insert ...
-1
votes
0answers
16 views
simple php login page with header [duplicate]
I'm trying to create a simple login page, however when I enter the user name and password correctly it keeps bringing up the try again link with no errors. Can any body see anything wrong with my ...
0
votes
0answers
5 views
php - image crop script not working
I'm trying to crop a jpeg image using imagecopyresampled function in PHP.
I've followed the same pattern that I've seen in numerous online tutorials, e.g.
...
0
votes
0answers
5 views
phpunit config file using wrong php.ini in vagrant
I have an application on a vagrant VM and am trying to implement PHPUnit in Sublime.
I got everything up and running and wanted to also install XDebug in order to utilize PHPUnit's code coverage ...
-1
votes
0answers
14 views
Can i save php scripts on ram memory disk for php webserver?
I think it will be faster how can i do it? any plugin for having files on ram disk? (For php server)
-7
votes
0answers
28 views
i want to print a java script variable to html input [on hold]
i want to skip javascript button press
this is a screenshot
i want it to print the total directly without the button press
this is my code
gtotal = formatDecimal(twt);
<?php if ...
0
votes
0answers
9 views
Run PHPUnit test when saving file in PHPStorm
I have configured PHPUnit on PhpStorm Version 8.0.3 and I was asking myself if it would be possible to run a Test each time I save a file or push it with git.
I searched on Google but didn't find any ...
0
votes
0answers
3 views
Magento {{depend}} directive for different contact forms
I have created an additional custom email form for catalogue requests and added to a CMS page as follows:
{{block type="core/template" name="contactForm"
form_action="/contacts/index/post" ...
-2
votes
0answers
23 views
find if the ng-model value is not in option of select box in angular js
i HAVE select box like this.
<select class="form-control" name="graduation" ng-model="p.grad" ng-required>
<option value="B.A">B.A</option>
<option ...
0
votes
2answers
19 views
access elements within an object of array of arrays
I have an object $invoiceitems - its a (smarty) object of array of arrays.
I cannot work out how to access values within it.
For example how would I access 'relid' element in the second array?
...
-1
votes
0answers
14 views
After encryprion of pdf i didnt see data on my pdf
Actually pdf getting from sap when i try to encrypt of that pdf is not showing any data.but when i taking other pdf it is working fine where is the problem ?
function pdfEncrypt ($origFile, ...
0
votes
0answers
15 views
How do I switch slider on certain checkbox value?
I have a checkbox to check for 'koop' or 'huur'
<li class="content-visible">
<a class="cd-faq-trigger" href="#0" style="text-decoration:none; color:#fff">Koop of ...
1
vote
0answers
12 views
Codeigniter form validation required array
I have a form with an array field that allows the user to select multiple category ids. They must select at least one category but can select more than one. My form validation needs to ensure at least ...
-4
votes
0answers
14 views
Real time ajax timer
Am developing an online voting system.I want people to be viewing results on screen as while the voting is happening.Such that when someone votes the figures against each candidate changes without ...
1
vote
1answer
11 views
Symfony2 Remove empty field in FormType
I have a onPreSubmit in my Symfony2 FormType.
public function onPreSubmit(FormEvent $event)
{
$data = $event->getData();
// Avoid sending empty RegisterProduct
foreach ...
0
votes
0answers
13 views
Laravel 5.2 Login Event Handling
In the database I have a table users with column last_login_at. Everytime when some user logs in - I want to uptade last_login_at.
So, I created app/Listeners/UpdateLastLoginOnLogin.php:
namespace ...
0
votes
1answer
7 views
Laravel 5.2 ErrorException instead of Warning
Given invalid argument supplied for foreach(), can anybody explain to me why Laravel gives ErrorException instead of Warning?
In regular PHP I would just ignore that warning and proceed coding. ...
1
vote
1answer
38 views
Is there a limit to SQL statements when done through a PHP script?
I have an SQL query that consists of lots of SQL statements separated by semicolons. When I run the query through phpmyadmin it works fine. However when I do it through a PHP script, I get a message ...
0
votes
2answers
15 views
Set status value with group by on different values with SQL
I have this SQL query
SELECT SUM(reach) AS reach, SUM(impressions) AS impressions, cpc, id_name,
SUM(clicks) AS clicks, SUM(amount_spent) AS amount, pagename, status
FROM mbk_ad_data
WHERE ...
0
votes
0answers
3 views
CORS issue on Windows Server 2003
I am running a node.js application on my server (Windows Server 2003) on port 3000 and I am using ajax call to PHP file to receive JSON data from MySQL. The PHP file runs on Apache port 8080 on the ...
2
votes
1answer
10 views
ManyToOne as ID on doctrine (symfony2)
I'm developing a project with Symfony2 LTS and need to create Entities for doctrine. In my database model I have a OneToMany relation, that is part of the PK.
Parent
...
1
vote
1answer
43 views
PHP - Check a value inside txt file if already exist
This is my code to write two value inside a txt database:
<?php
$bad_char = array("|");
$id = str_replace($bad_char, "", $_POST['id-group']);
$group = str_replace($bad_char, "", ...
0
votes
0answers
8 views
phpbb 3.1 passing variable between 2 pages
With phpbb3.1 it appears they have disabled more superglobals.
I have tried passing a variable between using sessions, but have had no success.
$_SESSION['example'] = 'example';
$example = ...
0
votes
2answers
28 views
PHP: strtototime, how to get a date of last 1 january early then NOW() minus N days/yars?
if today is 2016-02-09
minus 3 years (or minus 1095 days)
new date is 2013-02-09
now I need to get a date of last 01 january before 2013-02-09
result 2013-01-01
it should be something like this ...
0
votes
0answers
6 views
GetTransactionDetails PayPal SOAP API using PHP
I've been asked to retrieve the buyer's email address via the PayPal API using a transaction ID. I can see that I can use the GetTransactionDetails function to do this.
I've managed to login using ...
3
votes
1answer
61 views
PHP Script wipes strings completely - how to fix?
I have made a script which saves a few lines of PHP to a .php file. All my scripts work perfectly fine, but just this page is starting to get annoying.
Explaination of what is happening in the ...
-1
votes
1answer
34 views
How do I read a database table and store it in an array in html [on hold]
I'm studying php/html and I have the following problem/question :
I have an html page that works fine. One of the components is an iFrame to display various video clips. I have written a Javascript ...
0
votes
0answers
17 views
cURL: POST request gets treated as GET
I made a POST request, printed out header out information and noticed that is gets treated as GET. What is the reason for such behaviour?
HEADER OUT DATA:
GET /inx/aeGDrYQ HTTP/1.1
Host: example.com
...
0
votes
0answers
24 views
How to remove the string double quotes when exporting array variables?
I have a PHP script that reads a database in TXT format, sanitize the date fields and transform it in a CSV.
I have to read a line, separate each field (which is divided by number of characters) into ...
0
votes
2answers
18 views
PHP: Calculate average value of an array if have more than one element
I must to calculate the value of an array taken from a query only if had more than one element, else I must to return the value of the element, I'm using this code:
function calculate_average($arr) {
...
1
vote
2answers
13 views
Laravel: Migrations do not work
I have created a file Order.php:
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Order extends Model
{
/**
* The table associated with the model.
* @var string
...
0
votes
0answers
5 views
Establishing server to server communication with PayPal
I am trying to set up an android app which accepts payments via PayPal API.
I already created an online database. I also understand how to communicate with my server via php scripts saved on my ...
0
votes
1answer
15 views
Next and previous month not working in mozila firefox
My script below working for google chrome but not working for Mozilla Firefox. I can't find out problem.
$(document).ready(function () {
var x = 0;
$("#next").click(function (e) {
var ...
0
votes
0answers
18 views
Error in reading Excel file & Insert data into MySQL Database using PHP
My purpose is to read an excel (.xls) file and store it in the database as well as show the inputs of excel file in the browser.
I am facing problem while reading the file. I have integrated ...
-1
votes
0answers
25 views
Ajax Inserting loop in php
Hi i tried inserting data using ajax method
if checkbox is checked that data need to insert in the table
my problem is some value is missing
if i make it alert value
that case working fine if i ...
0
votes
0answers
11 views
CkFinder “Edit” mode how to set Save Changes preferences (Overwrite File)
We are evaluating CkFinder 3.2.0, we have an issue with setting some configurations/preferences.
After uploading an image, user can select it and making some modification using "Edit" feature.
At ...
0
votes
0answers
10 views
Fatal error: Allowed memory size of 134217728 Gavick News Pro GK5 Module
I'm using Gavick News Pro GK5 Module for creating article blocks on a new interface of a news website. I'm using two kind of module modes:
Portofolio Grid with these settings:
Source of articles: ...
0
votes
1answer
18 views
Generating Microsoft Word Documents using PHP and MYSQL
Currently we generate word documents based on information from our database and a user form using an old asp.net application. I personally am a PHP developer so I am not able to modify this code now. ...
0
votes
0answers
4 views
Laravel 5 call controller action in Kernel schedule
I have controller(testController) and action(index) with in namespace
App\Modules\Admin\Controllers\
I am tring to call action(index) from kernal schedule function in following way
...