PHP is an open-source server-side scripting language widely used in web development. Use this tag for questions about PHP classes, methods, functions, syntax and use.

learn more… | top users | synonyms (6) | php jobs

0
votes
0answers
2 views

Using URL to grab from database to populate forms

So I have a form, and I want the form fields to be editable by the creator without having to open up account creation in my site to the public This is what I'm looking to accomplish- Someone fills ...
0
votes
0answers
4 views

SMPP 'Invalid Parameter Length.' Exception

I'm Using onlinecity/php-smpp library to create a SMPP client for first time and by running its example,I keep receive an exception which said: ( ! ) Fatal error: Uncaught exception ...
0
votes
2answers
9 views

php array removing successive duplicate occurances in an array

The question i would like to ask here is: Is there anyway that i can remove the successive duplicates from the array below while only keeping the first one? The array is shown below: ...
0
votes
2answers
15 views

split images from array

i am getting links from a database and want to display the images but break line every 5 images. i can display images but need help, I'm sure its an if statement but don't know how to write it. i ...
-1
votes
1answer
25 views

from javascript to php to javascript -need correction

im making something and this code isnt working <script src='jq.js'></script> <script> function getURLParameter(name) { return decodeURI( (RegExp(name + '=' + ...
0
votes
0answers
7 views

Why doesn't this PHP MongoDB range query return any results even though there is one?

I have a collection of users and users have a meta.create_date. I am trying to count how many users were created in the last N days. I have the following in the database: { "_id" : ...
0
votes
0answers
8 views

Console works, php fails when trying to convert .svg to .png using ImageMagick

I'm trying to convert SVG to PNG files via PHP. I've resigned myself to the fact that the only reasonable way to do this is via ImageMagick. I am doing development work on a xampp setup in Windows ...
-2
votes
0answers
9 views

Clicking on link assigns random values to other form values

A user is supposed to enter his details, to edit these details he can go into edit option, where there is upload CV option. when i click on this, all the previously answered/stored details are ...
1
vote
2answers
17 views

PHP setcookie function not saving cookies?

I was hoping someone might be able to help with this small issue I'm having with some code I'm working on. Please keep in mind, this is just for a hobby site, I am aware there are security holes. I ...
0
votes
1answer
22 views

User pictures in php

I'm making a user plateform on my website with php/mysql, and I want to know if is it good to allow users add photos using the mysql blob file, or adding their photos in a folder with their id, and ...
0
votes
0answers
7 views

How do I create a Request handler and set it to handle all requests?

I want to set a handler (a class in a PHP file) that all requests (GET, PUT, POST, etc) are directed to. How would I do this? Can it be done in a single .htaccess file at the webroot of the website? ...
0
votes
0answers
19 views

PHP Subscriber button

Alright, I feel a bit guilty asking this as there seems to be a plethora of other similar entries, but I'm terribly thick with anything PHP. I thought a personalized approach might be beneficial - I ...
2
votes
1answer
17 views

Getting the filename of where a function was called from

Is it possible (in an efficient manor) to retrieve the filename (and line if possible) of the previous command that called a function in another (included) file? For example: Foo.php function foo() ...
1
vote
4answers
33 views

PHP+MySQL UPDATE query (multiple columns) not working

Ok, it's probably something simple that I'm overlooking, but I've combed through this so many times..! Just a simple update via a PHP form, pulls in variables, builds query: // Connect $connect = ...
0
votes
0answers
7 views

Method for accessing a remote Oracle Instant Client PHP database abstraction layer - is this even a thing?

I've got an interesting problem. I have a need to interface with an Oracle database for an existing application from an existing PHP application on a separate server. The Oracle DB is running on ...
0
votes
3answers
46 views

Need help php array that i didnt know

I have this array: Array ( [_edit_last] => Array ( [0] => 1 ) [mymail-campaigns] => Array ( [0] => ...
0
votes
0answers
8 views

getUser returning 0 facebook sdk

I am trying to make a login with facebook on a codeigniter app. I have a login button that takes them to grant permissions and then redirects them to the page that should display their facebook ...
0
votes
1answer
14 views

PHP Template class / engine processing time

I want to learn a bit more about OOP within PHP. So i decided that i would build my own MVC framework and a simple application running on this framework. There are a lot of great tutorials out there ...
0
votes
0answers
3 views

joomla K2 how to load extra fields inside item body

How can I load extra fields/groups inside of a tab which is inside of an item? is there any way to load them akin to {loadposition extra-fields-group-name}, or anything else along these lines?
0
votes
0answers
5 views

PHP Laravel extending resource routing

Laravel routing functionality allows you to name a resource and name a controller to go with it. I am new to Laravel and would like to know if anyone knows how to extend the resources method in the ...
-5
votes
2answers
26 views

I have a probleme in Creating a php/mysql Delete form [on hold]

Hello to everyone in this fantastic club , Im amira from morocco , iam new to the forum ,all i need a little help here ,When a was creating a little code in php/mysql i wanted to know how to built a ...
1
vote
1answer
21 views

PHP close HTTP connection then continue processing?

Why is the last line of this function required to make this work? I don't understand what's going on here. It does work though. function close_connection() { // if we're using sessions this stops ...
0
votes
2answers
21 views

How do you get a return value from a php file called in Java

I'm using HttpURLConnection in Java (not Javascript) to call a PHP file which looks up a field in a mySQL database. In PHP how do I return the field contents (String) and in Java how do I receive ...
0
votes
2answers
18 views

Prepared Statements + MySQL (7 day Stats)

I'm currently working on a project in which I need to store 7 days worth of data for each individual object that a user creates, each object has a unique id as well as the user. I guess this is more ...
0
votes
1answer
9 views

Dynamic mysqli prepared statement

I need help creating a method for dynamic mysqli prepared statements. The code below has errors. I know I'm completely off with the way mysqli_stmt_bind_param is set up but I can't figure out a ...
1
vote
0answers
8 views

Cakephp best way to store count of children's children

OK so if a Student belongs to a Course and Course in turn belongs to a School: What's the best way to store/get the count of all the Students in a school? I've recently discovered counterCache but ...
0
votes
0answers
16 views

How can Google Analytic Cookies appear without using Analytics?

I have never used Google Analytics on my web site. I have recently implemented an online booking system that I wrote using JavaScript and PHP. My PHP code includes a "trace" which logs certain data ...
-1
votes
0answers
16 views

Freezing the output of mt_rand [on hold]

How would I be able to generate a random number that is then passed to a variable. This variable will retain the same random number until another variable is true?
0
votes
0answers
13 views

Image Cropper PHP script that blocks the page's loading

I have got a class in PHP, that I use for cropping/resizing, different pictures for a website I'm working on (this class is available underneath). My problem, as you've probably guessed, is that ...
-1
votes
1answer
39 views

Has anyone ever seen this happen in a php freach loop?

I built a multi-dimensional array from a query which has 101 keys When i echo $result['q101'] before a certain foreach loop it shows the proper data.. after this loop the array is modified somehow ...
0
votes
0answers
6 views

PHP to route JavaScript REST API requests to an outside service

Here's my scenario: There's a RESTful API I'd like to connect to that lives on another server and requires certificate authentication. I want to access data from it in the browser using AJAX. I ...
0
votes
0answers
4 views

Pipe raw HTTP stream to PHP r/w stream

I was wondering if it is possible at all to get an HTTP request that was made by a browser towards a PHP running as Apache module into a read- and writable stream. I did some research and testing and ...
0
votes
1answer
24 views

PHP: require_once for multiple files but coming out of order

I'm working on a startup that requires a website. I'm doing this by writing many separate php files and then having index.php for a page load them each with require_once('file.php') ...
0
votes
1answer
8 views

Download binary files from MySQL LONGBLOB field using PHP

I'm trying to download files from MySQL Longblob field using PHP. I tried dozens of sample codes but none of them worked. The files can be downloaded, but some bytes seem like changed. Not knowing ...
0
votes
0answers
14 views

Copy a URL from a post to a custom field in Wordpress

I'm using IFTTT.com to import youtube videos into Wordpress. One of the elements I am importing is the URL of the youtube video. I would like to copy this url to a custom field that my theme comes ...
0
votes
2answers
16 views

if-statement in a for(each)-loop. continue vs nothing

Let's consider following array: $data = array( '0' => array( 'id' => '0', 'guid' => '22dd39bf-f6d6-4283-b87c-370354a7c2dd', 'age' => '32', 'name' => ...
2
votes
2answers
22 views

logical operators or vs || (double pipe) in php [duplicate]

I've always used || (double pipe) for if (($a == $b) || ($a == $c)) { } and or for do_this() or do_that();. Why not if (($a == $b) or ($a == $c)) { } or do_this() || do_that();? Is there any reason ...
0
votes
2answers
16 views

Accessing query value after UNION statement

So I'm grabbing two sets of data from my database, and I need to merge them with a union, but I'm not sure how to access the second set of returned values with PHP. Any help would be appreciated! Some ...
0
votes
1answer
13 views

Issue with Doctrine/Symdony2.2.1 uploading files

I've been working with Symfony for a project and I've been experiencing issues uploading files, I just wondered if anyone could point me in the right direction? Here's my controller: <?php ...
-1
votes
1answer
23 views

Undefined index: sUS_UserID [duplicate]

I really need some help with PHP. I always get this error: Notice: Undefined index: sUS_UserID in C:\xampp\htdocs\fazebook\inc\class.user.php on line 21 My "error" code: $UserLoginQ = ...
-1
votes
2answers
35 views

select where id IN (list) not working after list modified

This seems like a very simple issue, but its causing me a ridiculous headache. Here is my query: SELECT * FROM table WHERE id IN ($list); Lets say the list is: 1,2,3,4,5,6 On the first execution of ...
0
votes
0answers
4 views

How to do method chaining with DOMDocument?

Do method chaining with PHP is easy. But I need something like this, $xml = $dom->transformToThis('file1.xsl')->transformToThis('file2.xsl')->saveXML(); It is possible with PHP's ...
-4
votes
1answer
50 views

need help converting javascript to php [on hold]

I need help converting this to php, I am trying to call the images by array in php then will use this function to swap images, then i also need help to store the array back to server to save changes. ...
0
votes
1answer
33 views

Need help about joining tables

I have a MySQL database and I'm trying to create a web interface to manage tickets, right now I'm trying to list the tickets like so: [title][name of the person that created the ticket][priority][date ...
0
votes
0answers
4 views

Zend 2 annotations and file validators

Is it possible to use file validation classes with form annotations? /** * @Form\Name("profile_avatar") * @Form\Type("Zend\Form\Element\File") * @Form\Options({"label":"Your avatar"}) * ...
0
votes
4answers
36 views

How to echo a lot of html with variables and functions?

So I got the following: I'm creating dynamic pages (based on the page ID (obtained through $_GET)). My page consists of a $_get check (the html may only be shown if a $_GET variable is set) and the ...
-1
votes
0answers
23 views

a php page requires dot php to be accessed

I have a php page, say named myInstance.com/excellent.php. The page used to work when user type the following to the browser address bar: myInstance.com/excellent (i.e., no dot php) Recently the ...
0
votes
2answers
47 views

Not sure how to parse this PHP/JSON object in Javascript/jQuery

So from what I understand, because I created a JSON object in PHP using json_encode and then used echo to display it, I can access it directly as an object in JS, like this .done(function(response) { ...
0
votes
0answers
15 views

How to Load Ajax in Wordpress

I'm familiar with using ajax in the ordinary way with jQuery. I've played around it for a while, but don't understand what Wordpress needs to get it to work... What I have here is taken from some ...
0
votes
0answers
15 views

CakePHP page hangs on load only in IE

I'm developing an application in CakePHP and I've been debugging it with Firefox. Everything has been great until I decided to test it with IE and came across some very strange behavior. Sometimes ...

1 2 3 4 5 8294