php

Security.yml is_secure false not working

Hi, i'm working in a webservice built on top off symfony framework. Lately i was trying to make curl requests to a module but it gave me 500 error code reply asking for login and password, i looked inside module and it had the config folder with the file security.yml with this contents : default: is_secure: false What's wrong? why...

PHP file upload form cannot submit a POST variable?

I have a PHP file upload form with method="post" enctype="multipart/form-data" I am trying to do a <input type = "hidden" name = 'something' value = "something"/> along with the input for file upload, but I am not able to get the value of 'something' in the upload handling script like $_POST['something'] Is it not possible to use POST ...

Remembering destination when logging in

When I want to redirect a user to a specific page behind a login wall and they're not already logged in, they get redirected to the homepage where they can login. When they login, they are redirected to a default address. How do I go about remembering where the users original destination, before they were redirected to the login page? ...

Difference between float and double in php?

I have this code $vad = 1.1; print gettype($vad); var_dump($vad); this will output: double float(1.1) So it is double or float in php? ...

Dynamic Table Layout using PHP Logic

Hello all, I have simple table that has about 80 rows, which I populate dynamically using PHP. What I am trying to do is to layout those rows in chunks for each column. So if I have 80 rows, I would like 4 columns of 20 rows or so, maybe the last column has less or more depending on the total number of rows. The total number of rows can...

php5 magic function __toString($param =null ) can not take args

i used to have a function defined like this (that is working fine under ubuntu 9.10): public function __toString( $surNameFirst = false) { if ($this->givenName . $this->surname == '') return null; else ....... } after i have updated my machine to ubuntu 10.04( and php version Version: 5.3.2-1ubuntu4.2 ) my app starts to sh...

Incrementing days if day is a workday

Hi guys, I need your help again. This should be a function for php. I've got two dates. One is set by myDate and the other one is the date of today. I want to find out the number of days left to myDate, but saturday and sundy should be excluded. The result for this function would be 7... How can I make it work? <?php myDate = "29.07.2...

wordpress 3.0 php custom fields issue

This worked perfectly in a previous version of wordpress, different site tho. I have a custom field called flash on several wp pages but it keeps defaulting to "printed if results are empty". Any ideas on why this wouldn't work? <?php if ( function_exists('get_post_custom_values') ) { $mykey_values = get_post_custom_values('f...

How to add title attribute to link tags generated by view in Drupal?

I've built a view using the views module in Drupal to display a grid of thumbnail images (field_image) that are linked to a full size image for use with Lightbox. I've got that part working but I also display caption text beneath the thumbnail image. I want to append this caption text to the A tag like: <a href="image/photo.jpg" title="...

PHP - create a search on a static site

I have a site which does not have a DB in the back-end but one day could possibly have one. I currently need the capability to search my existing site from the homepage. My first question is it a good idea to search a site consisting of only static pages? I was hoping to somehow leverage google for this so I do not have to write my own...

How to read multiple files in parallel?

I have a number of text files that I need to open, then allocate certain fields to set strings inside PHP to eventually write into MySQL. Each txt file does have the same unique value for app_id, eg So text file 1 has app_id name description text file 2 has app_id category text file 3 has app_id price I want to get name, descript...

Getting back into the website development game.

Back in the 90's I used to develop websites using Cold Fusion. We also still used tables for most of our page layout, hehe. I just started getting back into website development again seriously. I'm getting a pretty good handle on the basics with CSS and starting to add Javascript. I'm guessing that I will eventually add PHP as a mode...

Good tutorial on how to make a site search using PHP?

Is there a tutorial on how to make a search engine using php PHP Version 5.2.8 ...

How to verify if user is logged in?

Hello, I am using CodeIgniter framework for PHP. There are some pages that are exclusively for Admin and they are located in Admin/*. When the user logs in, i store some value in session as a flag and verify it in my controller to test whether the user is logged or not. I wrote the code to check session in every method in my controller....

Create JSON-object the correct way

I am trying to create an JSON object out of a PHP array. The array looks like this: $post_data = array('item_type_id' => $item_type, 'string_key' => $string_key, 'string_value' => $string_value, 'string_extra' => $string_extra, 'is_public' => $public, 'is_public_for_contacts' => $public_contacts); The code to encod...

How can i take an excel file, parse it contents and store the column's data of excel sheet in my database column?

Hello, There is one excel sheet which contains student name, rollno etc. How can i parse the contents of excel file and store that in my sql database? ...

I have a c sharp dll. How can I make it usable in other languages, such as PHP or Delphi?

I have a dll developed in C Sharp. How can I make it usable in other languages, such as PHP or Delphi? I cannot find any solution to this problem yet. Isn't there any easy way of doing this? ...

creating pdf forms from CMS based data on the fly

Hello, I am using modX cms, and would like to have administrators be able to create some form fields in a larger form (basically a label, and form elements of various kind) which is then made accessible to users as a PDF document which is to be downloaded, filled out, saved and sent to appropriate recipients via email as pdf. The main ...

Using array function on an object.

In PHP is it possible for the array functions such as array_values() and array_key_exists() to be used on an object ? ...

PHP - calling class that implements interface without knowing class name

I'm trying to create a PHP file that calls a function in another file. Some sample code: Interface code: interface AJAXDispatcher { static function dispatch($action); } Implementation: class myAJAX implements AJAXDispatcher { static function dispatch($action) { if ($action === "action1") { do_something(); } This s...