PHP is a general-purpose scripting language widely used in web development as a server side scripting language to make web applications more dynamic.

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

0
votes
0answers
3 views

PHP - Managing Session - Doesnt Logout

I have created a user authentication system with necessary DB tables and php. THe first time before I login (Before any SESSION is created) the redirect on every page works perfect (ie Redirects to ...
0
votes
0answers
4 views

PHP CLI: how to handle unnamed argument

In a PHP script to use from the command line: As far as I understand, the function getopt() only allows to process 'named' arguments, eg.: $args = getopt("h:m:"); would allow to run the script ...
0
votes
0answers
5 views

2-name character of state name is not working when two state name same in different country in php

This is part of my code: <?php function csvToJson($csv) { $rows = explode("\n", trim($csv)); $csvarr = array_map(function($row) { $keys = array( 'var0', ...
0
votes
0answers
4 views

Netbeans 8 support php mysql commands

I have question about using mysql commands of php in netbeans 8. It is quite weird, but at work laptop i can type mys... and code complete suggests me commands like mysql_connect, or mysql_select_db ...
0
votes
0answers
12 views

How to keep track of the user searched items by using cookies

In my controller I am using this code to take user searched place in to a cookie. $visitingPlace = $this->input->post('place_visiting'); $cookie = array( 'name' => ...
0
votes
0answers
3 views

Laravel Token For Password Reminder Always Mismatch

Hi there i have some strange problem for password reminder system. The return for this function is always password token mismatch. here is the remember controller <?php class ...
0
votes
0answers
7 views

Two actions for a cron job in Yii

Note: I set up cron job in yii, did all the necessary things and in /protected/commands and I have one EmailCommand class inside which there is a function run(). It is working just fine. It sends ...
-3
votes
1answer
26 views

how do i add a username already exist check to my code [duplicate]

i need help i want to work on the username is already exist but i dont know the code and i dont know where can i put it? this is my code please tell me <?php define('DB_NAME', 'cmyglogin'); ...
0
votes
0answers
19 views

PHP Array to String conversion issue

I want to show all data from $result in my table but there's some error. The notice is "Array to string conversion" Here's the controller : public function actionIndex() { $command = ...
0
votes
1answer
12 views

retrieve parent child records in one query

I have a similar data set table called ‘album’ album_id parent_id name 2 NULL ... 34 NULL ... 35 2 ... 36 2 ... In php, my url ...
0
votes
0answers
4 views

Laravel : How do I compare/obtain specific datas from cache?

In my normal polling Laravel chat app, I will save new messages sent by a user into a file cache with the key as a string, getting its value from date(current_time) function and the body of the ...
0
votes
0answers
4 views

Make thumbnail of limited size with correct aspect ratio from the middle of the video

I need to create thumbnails for WebM videos uploaded on a website written in PHP. They need to be: Taken from the middle of the video Have correct aspect ratio Limited by width or height What ...
0
votes
0answers
7 views

cannot start mysql / phpmyadmin in xampp 3.2.1

I tried to install xampp 3.2.1 but when I tried to start mysql, i got this 2014-06-25 11:26:35 1740 [Note] Plugin 'FEDERATED' is disabled. 2014-06-25 11:26:35 1a30 InnoDB: Warning: Using ...
0
votes
0answers
11 views

Do we need to close & re-create entity manager for every loop iteration

I was wondering, which of the following is safer approach, for a cron job that will run continuously for few months? Approach 1 $entity_manager = getEntityManager(); while (true) { ... } ...
0
votes
0answers
16 views

drop down lists in php using cookies

<?php $i=1; //echo '<form id="form1" name="form1" method="post" action="<?PHP $_SERVER ['PHP_SELF' ] echo '<form>'; echo "<select name='dropdown' id=$i ...
0
votes
0answers
15 views

AutoLoading Multiple Classes Within A Class

What's the correct way to use the spl_autoload_register function in PHP within a class to load other classes. What I want to do, is have a single class which has a bunch of functions that I can call ...
0
votes
0answers
2 views

How to create Livefyre recent comment widget

Im google around and cannot find recent comment widget for livefyre. So, can anybody here create example code snipped to show recent comment widget livefyre for my blog? Im newbie about php and ...
0
votes
0answers
5 views

Query database in tpl file for CSCart add on?

I have created an add on for cscart. The template file tpl needs to show data from a table in the cscart database. How/where would I query the mysql database? I have read that it is bad practice to ...
0
votes
0answers
7 views

How to include a wordpress template dynamically

I'm working on a wordpress theme that has various custom post types for various purposes. Some I usually need and others for specific requirements. When I need said cpt I usually include the file ...
0
votes
0answers
6 views

PHP/Magento: Show, sort , and limit by products based on subcategory on category page

How do I sort products on a category page by subcategory as well as limit the number of products from each subcategory: For example if the category was Food I would want to display the following: ...
0
votes
0answers
4 views

Oauth Cookies error

I am trying to use Oauth 2.0 to authenticate with Google Spreadsheets. Currently the authentication code gives me an error about cookies not enabled even so I checked and they are. I am using Safari ...
0
votes
0answers
5 views

How to configure the socket permission for Nginx + php5-fpm? [duplicate]

Nginx runs under user www-data. For php5-fpm pool, I have two websites namely, website1 and website2 with the following configuration in /etc/php5/fpm/pool.d/: website1 config in fpm pool user = ...
0
votes
1answer
20 views

PHPMailer IsHTML(true) not working

I am trying to send emails from PHPMailer. Everything is working but the problem is it is sending emails along with HTML tags even after writing $mail->IsHTML(true); . Below is my code for sending ...
0
votes
1answer
15 views

Sum multiple table columns using php

I have two identical columns in multiple tables in same database. I want to combine the sum of each column in each table independently and display the results using php. Database name and tables: ...
-2
votes
1answer
30 views

Im not getting any returned value from this… why?

Yes it connects to the database, everything else works fine. I cant seem to pull the pass from the db its showing no returned echo <?php $username="test"; include("db.php"); ...
0
votes
0answers
18 views

Something like $smarty->assign without smarty

I know the question might be silly but I've read so many rumors about smarty lags and bugs I don't really want to get into all that, but I do want to use comfortable template for my scripts. What I ...
0
votes
2answers
47 views

How to print a string in an object in PHP

I get the following object in response to a call in PHP: Transaction[id=g855fm, type=sale, amount=100.00, status=processed, createdAt=Tuesday, 24-Jun-14 19:17:58 UTC] I am able to ...
0
votes
2answers
35 views

Printing the logged in username in PHP. “Hi, $username, welcome back!”

this question may seem simple but I have been stuck on it for 3 hours. Scenario: An end-user logs into my website. Question: How can I print his credentials and store it as a variable? I have been ...
-1
votes
0answers
15 views

how to link a min.js in wordpress …?

add_action( 'wp_enqueue_scripts', 'theme_scripts_styles' ); function theme_scripts_styles() { wp_enqueue_style( 'jquery-1.10.2', get_stylesheet_uri() ); wp_enqueue_script( 'jquery-1.10.2', ...
1
vote
2answers
42 views

JQuery AJAX if-else not working

The return data for this one as I investigated is "authenticated" which means the if statement should take effect. However, to reasons I know not it goes directly to the else part of the statement ...
0
votes
2answers
28 views

Update database every hour without cronjob

Alright, So users in my game have an hourly income. Each hour I have a cronjob run to check and see if it's time for them to be payed. It works and all, But I want to stop using cronjobs as much. ...
0
votes
0answers
4 views

Implementing a common nusoap.php class for API to work with

Currently I am using two api having nusoap.php as a part. But in order to have code consistancy I'm required to use only one nusoap.php in order to satisfy the API service. Can you please help me in ...
-1
votes
0answers
16 views

Security analysis of input validation and sanitization

Considering that I have no colleagues who know anything about programming to analyze my code, I feel I need to post this question here. I wrote some code regarding for user registration and used all ...
0
votes
1answer
8 views

Extract date from RSS Description

I need to extract the date from a description which is displayed on an RSS Feed (Workopolis) Here's an example of a feed item: <item> <guid ...
-1
votes
0answers
8 views

How to compile PHP with LDAP?

I referred the following link in order to understand how to compile php with ldap. http://www.nusphere.com/kb/phpmanual/ref.ldap.htm In here, they mention getting and compiling LDAP client libraries ...
0
votes
1answer
18 views

Displaying different include file based on logged in status

I'm trying to include a different navigation menu for users that are logged in but seem to be having trouble. I'm currently setting a session when a user successfully authenticates, that session then ...
0
votes
0answers
11 views

MultipleIterator to Combine Two Array Loops Not Working

I am simple trying to combine two foreach array loops, each being json_decode associative arrays; I have discovered that multipleiterator is the best approach. However, my code is not working! The ...
-1
votes
0answers
7 views

google app engine not working properly

hi i am trying to transfer a website from amazon cloud to google cloud. i have launched the server and client side scripts in different appengine making client to listen to the server and the server ...
0
votes
0answers
15 views

PHP SQL login case sensitive

I am learning out to do website log-in and create creation. I am facing the probably where my script does not check if the two strings are the same case. Example, Foo and foO return both true. My ...
-2
votes
3answers
30 views

How to save in session?

How can i save a session in php so that when i click value in td tag it will save a session and redirect into another page? this is my code: <? $sql = "SELECT * from members"; $result = ...
1
vote
1answer
15 views

how to store phonetics in mysql database

I have to store the phonetics of words in a database in this format: blow = \ˈblō\ But when I see in the database, it's stored like this: blow = \?bl?\ There are ? instead of symbols you can ...
0
votes
0answers
13 views

viewing my database in the view at laravel

sorry if this is a very newbie Q.. but please help me to solve this problem. plus give me the reason about why this error happened.. this is my edit view new.blade.php @section('content') ...
-1
votes
0answers
23 views

PHP 'OR' operator not working on 'elseif' [on hold]

So I have somthing for changing Name and bio of a user database in PHP. When I try this code: }elseif($getimage->nombre == $_POST['nombre'] OR $getimage->bio == $_POST['bio']){ $errores = ...
0
votes
0answers
7 views

Return paginated JSON response in Laravel

I'm using Laravel 4 to make a paginated result of contents in my database. I've successfully displayed the contents in HTML form but I also want it to return in JSON format. Here is what I did so ...
-1
votes
1answer
23 views

PHP Array_replace argument not an array?

I'm modifying Wordpress post formats and displaying them in a custom tab bar horizontally across the top of the Wordpress Post Editor page. I'm trying to rename the labels in the array before they ...
-6
votes
0answers
19 views

World population API [on hold]

I was looking a website today. I searched on the internet for any API so that I can use it on my own project, but I have not found any. Is there any API for this or any script that I can use to put ...
0
votes
1answer
17 views

Ajax post value not working in chrome

Here I have an ajax function. It all works in FireFox but when I try in Chrome the ajax wasn't working. Any help will be appreciated. Index.php <input id="tag"> <input id="n_prjt_code"> ...
0
votes
0answers
3 views

aspell/pspell installation xampp

i'm trying to build a web application using php in which it will determine if the entered word is valid or exists in the english library. but the instructions is unclear, and some of the questions ...
0
votes
3answers
27 views

Echo out one value from an array

I selected an array of product IDs and product names from the table product. I tried to echo out only one product name from the array, but all I got was the first letter of the product name. Below is ...
-2
votes
0answers
21 views

Licensing a web based application [on hold]

I've been working on a IT "Helpdesk" application for a few years now. My plans are to "license" (not sure on correct terminology) the application to nearby businesses and school districts. I know how ...