Tagged Questions
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.
0
votes
0answers
2 views
Change out put of the_post_thumbnail in PHP
I am brand new to PHP. I've messed with wordpress on it but not really with the code behind it. I am trying to speed up the loading time of our wordpress site but I am having some trouble. PHP uses ...
0
votes
0answers
3 views
500 errors using Predis for session storage
I'm using Predis to store my PHP session data in Redis.
My site has pages which make multiple ajax calls, each of which will be authenticated in PHP by connecting to the Redis session store to look ...
0
votes
0answers
12 views
php - get image urls from wordpress posts
I have website based on wordpress system and I need to get images urls from every post. I have this code and it's working, but there is problem, because all of posts have same pictures + at the end, ...
0
votes
0answers
8 views
Unable to use Imagick class
I have installed imagick version:6.8.6-7 on my PC
Operating system:Windows 7 32-bit
Now i want to use Imagick for my PHP project.I am using Wampserver which provides me PHP version:5.3.10.So i also ...
1
vote
1answer
31 views
Submitting multiple variables with one input
foreach($rates as $item){
if ($item->disabled == false){
echo '<input type="radio" name="rate" id="membership" required="yes" message="Please select your membership type." ...
0
votes
0answers
25 views
Dropdown menus and where statements
I have 4 dropdown menus that on submit may or may not contain values that would be a where statement in a mysql query. Basically with out writing and if statement for every possible combination of ...
1
vote
0answers
36 views
Stop JQuery Validation once submitting form
How do I not trigger validation of the following form once using
javascript: form.action
I have 2 Submit buttons first one must use sellitem1.php as action and not use JQuery VALIDATION but 2nd one ...
0
votes
2answers
23 views
Escaping & in filename for PHP download
Downloading file issues where the filename has & in it.
For example, a file called bla will download fine but bla & Blaaaaa doesn't locate the file.
Is there a way for me to escape the ...
1
vote
2answers
24 views
how to remove an object reference from a php array without destroying its object
I need to remove an object from an array in php but I need the object reference to still exist, when I tried using unset() as described here it unset both the array element and the object itself, how ...
0
votes
2answers
28 views
private function __construct() not working when class called on another page [duplicate]
im using the following type of class...
class datas{
protected $req ;
protected $db ;
private function __construct()
{
$this->db = new Database('localhost', 'user', ...
0
votes
1answer
22 views
add key to array with value generated based on current position of array
What i used:
$maxpoints = 40;
for($i = 0; $i < count($trainergross); $i++){
$trainergross[$i]['points'] = $maxpoints;
$maxpoints -=2;
}
...
0
votes
3answers
30 views
Allow upload of PHP file
I have a form in my website where users can upload files in TXT. These files are always PHP file that I request users to change the extension so it will make no harm to the server (which is running ...
0
votes
2answers
32 views
Sessions not being saved
So i have a silly problem with my php login script. I have noticed when i try and use it and login it set the session variable on the login.php but then when i try and move page it will destroy it. So ...
0
votes
1answer
10 views
Having issues with getting usort to work in ASC order
usort( $bla, function( $a, $b )
{
return strcmp( $a->title, $b->title );
});
is returning my list in DESC order rather than ASC order... How would I go about tweaking this?
I tried:
...
0
votes
2answers
6 views
How do I handle a related models add action in cakephp?
I have two models, Dealer and DealerReview.
I want to create a form to add DealerReview from the DealersController, View action.
What is the recommended way to achieve this in cakephp? Do i:
a) ...