Tagged Questions
PHP is a general-purpose scripting language widely used in web development.
0
votes
1answer
7 views
Why can't i echo my results from MySQL in PHP?
I try to show every result that the current username has in the database,
but it won't work..
I've tried anything and ya'll are my last hope.
Thanks in advance!
I can not get any answer from my code ...
0
votes
2answers
11 views
Removing Last Comma within while loop - PHP
I've been building a little tool to manage a dataset, I'm trying create a JSON output in order to serve my front-end the data.
Right now I have an extra comma at the end of every row in the loop. I ...
0
votes
0answers
7 views
How would I access my multidimensional array in Smarty PHP?
I'm trying to access a Multidimensional array of users in Smarty PHP.
Here is the array of data:
Here is how I am trying to access it in Smarty PHP.
{foreach from=$users item=user}
{/foreach}
0
votes
0answers
6 views
Associative array in wordpress meta data
I would like to have a user meta-data field that is an associative array. Specifically, I would like to store what the user voted for any posts voted for. In other words I would like to have:
for ...
-2
votes
1answer
9 views
What is error in this when load image it is not loading inside EOT docs
<?php $content=array(
'header' => 'Welcome to Our Site' ,
'welcontent' => 'There are two ways of resolving this: either giving each file a uniqe base name ...
0
votes
1answer
17 views
Web page requested through PHP returns a 404 error but when the same URL is accessed through a browser it works
I have tried accessing an API endpoint URL through both file_get_contents and the HTTP_Request class, but both return a 404 error. However, the same URL is accessible through the browser.
It's worth ...
-2
votes
1answer
25 views
spam protection needed on php form
I have a pretty basic PHP site and I want a simple spam protection to stop the spam submissions.
I've found one that I like which is a basic 4 character input. Easy to read, small space requirements. ...
-1
votes
1answer
19 views
Multiple usernames as admin php
I have a simple php script that check for the username "admin" and makes certain pages available to that user. I want to add multiple users to that admin "role" is that possible? Here is the code:
...
0
votes
2answers
20 views
Prevent Jump to Top of Page When Clicking Link
I have been stuck on how to prevent jumping to the top of the page when clicking on a link that has parsing PHP data.
I have tried so many AJAX examples off the internet, but unfortunately with no ...
0
votes
1answer
22 views
How to dynamically build <<<EOD string in PHP
I want to build my string dynamically depending on the results from the DB. So far I have created something like this:
$feed = Some essential xml that needs to go here;
for ($a = 0; ...
0
votes
0answers
3 views
Any advice on improving inline style using php variable from redux theme options?
I am using the redux framework for wordpress and was wondering if anybody could give me some advice on improving the following code:
<?php
$topbar_from = ...
0
votes
0answers
3 views
updating open graph meta tags not sync with facebook
I implemented open graph meta tags in one of my joomla extension here - http://extensions.techhelpsource.com/demo/jsocialintegration , if you see page source you will see og:title meta tag with this ...
0
votes
1answer
16 views
Retrieving events from a server for a website
I am building a website using Javascript and PHP. The website has events like receiving a message or receiving a challenge etc and also events that occur at a specific time like the challenge ...
0
votes
2answers
24 views
How to change name of form in php when its in while loop?
$friendRequests = ("SELECT * FROM zahtjevi_prijatelja WHERE user_to='".$_SESSION['ID']."'");
$res = mysql_query($friendRequests) or die(mysql_error());
if (mysql_num_rows($res) ==0) {
...
0
votes
1answer
31 views
output error in php json-decode
my php code generate a non-Valid json output error
my php code :
$questions = array();
while($question = mysql_fetch_array($result, MYSQL_ASSOC)) {
$questions[] = array('question'=> $question);
...
0
votes
0answers
7 views
using fpdf to output a bullet list from an array
I have been looking for a way to add bullets, or numbering of lists to my pdf output file.
Let's say I have three lines of text coming from the database:
Line 1
Line 2
Line 3
What I want is fpdf ...
0
votes
3answers
26 views
how to eval a string within a string using javascript
this works in PHP:
$i = 4;
$fruit4 = 'apple';
$answer = $fruit{$i};
echo $answer; // apple
so i hoped this would work in javascript:
var i = 4;
var fruit4 = 'apple';
var answer = fruit{i};
...
0
votes
0answers
4 views
PHP Ldap - View deleted objects
I need find in active directory all objects deleted.
I've tried using the filter (isDeleted=*).
I've tried using the dn cn=deleted objects.
I read this ...
0
votes
0answers
6 views
Magento REST API fetch POST function error 404
I'm trying to upload new products to my Magento Store via the REST API. I've managed to get to the point where I authenticate my app and a new product is being created in the store.
I'm using the ...
0
votes
1answer
20 views
Show 'Google Books` items with PHP
I'm studying a way to use the Google Books API.
Using this code have the expected result.
$page = file_get_contents("https://www.googleapis.com/books/v1/volumes?q=julio+verne&maxResults=40");
...
0
votes
0answers
24 views
PHP - compare elements from array and delete elements if used in function
I have a $test array which contains strings. I also have two functions, replaceOverlap that merges two overlapped strings and findNested that finds if one of the two strings is a substring from the ...
0
votes
0answers
13 views
500 internal Server Error for Controller. CodeIgniter and godaddy
I know there are a bunch of questions like this but I didn't find any solution for my site yet. I don't know why. Please help me.
This is my site: ivoiceup.com. I've developed it in Codeigniter. Home ...
0
votes
1answer
19 views
How to save a html form including the data in the form fields
I'm making a small web-application where the user need to enter data in form fields (he can add more fields and delete them dynamically). On the server side, there is a Php script which, when the form ...
-1
votes
1answer
13 views
Making custom web based software using a framewok [on hold]
I have to make a new custom web based software but am having trouble choosing a framework. Previously i used raw php,ajax,javascript and soon found out that even though they get the job done, people ...
0
votes
1answer
13 views
unexpected session identifier php
So I looked into other threads but didnt find a solution that worked for me.
Here is my problem:
I have two php pages:
http://codepad.org/VhblM76K and
http://codepad.org/W9bz8L3E.
The first page is ...
0
votes
3answers
11 views
Infinite loop php redirect based on cookie
I'm currenting busy coding a registration page. The page has three steps and every step has its own cookie value. What I'd like to do is checking for the cookies value and transfer the user to the ...
1
vote
1answer
5 views
Php stdclass object returned to ajax
I have only recently started usign ajax and i have run into a slight problem.
The code is as follows:
Input form -> Value to AJAX.
AJAX sends the form value to a php function that sends the request ...
-1
votes
0answers
33 views
Why doesn't it sets the $_SESSION?
My script doesn't saves the value into a $_SESSION, how is that possible?
Whenever my users login, i try to place their username into a session.
My only problem is when i use ...
-1
votes
0answers
23 views
Undefined index: action
I'm trying to do a chat application but I get this error on my ajax.php
Notice: Undefined index: action on line 35
and then I get the error I put "Wrong action" which means my switch statement may ...
0
votes
0answers
9 views
Saving Repeatable Fields Options to PHP Object Array
So I am trying to save a dynamically created set of fields to the database using $_POST. Basically, I can't figure out how to get the options to save as an object for each fieldset instead of as an ...
1
vote
1answer
11 views
How shrink file size when Wordpress resizes an image?
I've optimized an image that is 1280px x 800px in width/height and is 150kb in file size. I have used add_image_size to Wordpress to make different thumbnail, small and large versions of the uploaded ...
0
votes
1answer
10 views
Naming convention issues when using codeigniter in windows and linux
I have made a web application in codeigniter framework. I was developing the app on a Windows machine and the final version runs perfectly well on the same (i.e windows, wamp to be precise).
Now i ...
-1
votes
0answers
7 views
PHP Warning: Module 'ionCube Loader' already loaded in Unknown on line 0
I'am get the follow errors after upgrade PHP from 5.3 to 5.4
Failed loading /usr/lib/php/modules/ioncube_loader_lin_5.4.so: /usr/lib/php/modules/ioncube_loader_lin_5.4.so: cannot open shared object ...
0
votes
1answer
23 views
Correct use of PDO procedure not using global
I am having a play around with PDO and currently have the following code but I am getting Call to a member function prepare() on a non-object and I don't want to use global.
Do I use a class or do I ...
0
votes
0answers
13 views
GPS coordinates on Google maps with JavaScript
I'm building a google map page that will act somewhat like a database for 4 or 5 gps devices around the country. the gps devices that i am using will have their own ip address within a router they ...
-1
votes
0answers
13 views
Search form not displaying results
I'm creating a search form with a dynamic dependent select boxes, which works. When I've chosen my options, the results aren't displaying. Firstly, the user has to choose a subcategory. Then they can ...
-2
votes
1answer
27 views
apostrophe in php query
I have read many answers to related questions but I'm still having issues. I have relatively simple code, looking for anything that has "arizona's future" in the title or keywords columns:
SELECT *
...
0
votes
0answers
15 views
PHP: index.php posts headers are not clickable, not able to click inside post through header
Good evening my fellow coders, I came here with a quest to find an answer for my whole day solution looking problem.
Why this code
<h1><a ...
-4
votes
0answers
22 views
I need to manage different user type login [on hold]
My site has two types of users:
subscriber
page owner
I created three tables in the database:
subscriber details,
page owner details
and details of pages created by page owner
What I need ...
0
votes
2answers
29 views
problems implementing AJAX post
I have a html link, here it is (post php interpretation):
<a href="javascript:void(0)" onclick="vote_comment(28, 1);" class="vote-arrow">
<img id="up-arrow-pic-comment-28" ...
1
vote
2answers
17 views
in need of a php preg_replace regex
I am writing a script that needs to download images related to a product ID array to an external website.
Here are the possible product ID combinations.
ABC1234AB
ABC1234AB-CD
ABC1234AB-CDE
...
0
votes
3answers
19 views
PHP replace Array values based on certain requirements
I have an array as such:
$array = ["1","0","0","1","1"]
//replace with
$newArray = ["honda","toyota","mercedes","bmw","chevy"]
// only if the original array had a value of "1".
// for example ...
0
votes
0answers
10 views
Laravel not holding sessions on ajax calls
I'm writing a chat application using jQuery and laravel.
This is a single page application. The users can log in fine and the session is stored.
But when i get to the chat window and i try to ...
0
votes
1answer
16 views
PHP site is waiting on ajax calls to complete
I've got this PHP site that makes some hefty ajax calls. They take about 8-10 seconds and communicate with a lot of 3rd party APIs via cURL requests.
When these ajax calls are going on, the rest of ...
0
votes
0answers
6 views
Apache apachectl-k start error while loading shared libraries: libpcre.so.1:
Running into an issue with an apache/php installation.
Redhat 6.5
Apache 2.4
PHP 5.6
Installed apache in a non-standard installation(did not use yum install httpd). I did so by: -placing the apache ...
0
votes
0answers
5 views
CI - Flexi Auth, $this->flexi_auth->insert_user() shows “Creating default object from empty value” error
I'm starting with Flex Auth in CodeIgniter, and I should missed or misunderstood something.
Any idea why this piece of code is giving an "Creating default object from empty value" error ?
My code :
...
-1
votes
0answers
9 views
WAMP - PHP 5.3.13 to PHP 5.3.8
I am trying to upgrade my WAMP installation to PHP 5.3.8 but failing to find a copy of the core PHP files for this version.
Unfortunately, a further upgrade is not an option as I am trying to emulate ...
0
votes
0answers
36 views
Delete array item if match another array item
I have two array.
first array store in $array1;
Array
(
[status] => 0
[message] => Already In List
[result] => Array
(
[0] => Array
(
...
3
votes
2answers
13 views
Wordpress: How to redirect feed URL to another one?
I have a blog built with Wordpress, where I host a podcast. iTunes is currently reading the RSS from URL "A" (http://ramonkayo.com/categoria/hashcast/feed), but I want it to read from URL "B" ...
0
votes
0answers
11 views
Append images added in custom fields to create and set featured image
I'm new to WordPress and PHP. I have gotten some basic custom post types, taxonomies, and meta fields to work.
But I am stuck on this issue: When making a new custom_post, the author will upload ...