php

Beginning GWT and Java - wich is the best route when coming from LAMP background?

Hi! I've worked a lot with php/mysql on linux servers, including frameworks, orm etc. Now I want to give GWT and Java a try! Installing GWT SDK, Eclipse plugin etc and running a "Hello world" is no problem. The server is running automagically in the background, taken care of by Eclipse. But when it comes to setting it up my self, there ...

PHP - Ignoring script files from a directory when navigating to them?

Hey there. I'm currently working on a file uploading sript in PHP, but i'm kind of stuck. Users are allowed to upload files such as PHP and JS, but i don't want the scripts to run when a user is trying to download them. Is it possible to block that somehow using htaccess or something? Thanks in advance. ...

how to do multi insert and obtain ids

hi, I want to insert some data into a table (id PK autoincrement, val) with use multi insert INSERT INTO tab (val) VALUES (1), (2), (3) Is it possible to obtain a table of last inserted ids? I'm asking becouse I'm not sure if all will in this form: (n, n+1, n+2). I use mysql inodb. ...

CodeIgniter output XML in View

I tried to output XML in the view file. The view file is result_view.php and its first line is <?php echo '<?xml version="1.0" encoding="UTF-8"?>'; ?> But I get the error "Content is not allowed in prolog". So how to do this correctly? I use Eclipse + PDT. ...

PHP/regex: matching/replacing 24-hour times

Hi, How can I take a line like this: Digital Presentation (10:45), (11:30), 12:00, 12:40, 13:20, 14:00, 14:40, 15:20, 16:00, 16:40, 17:20, 18:00, 18:40, 19:20, 20:00, 20:40, 21:20, 22:00, 22:40, 23:10, 23:40. And match all the 24 hour times so I can convert to a more human readable format using date()? Also I want to match times in t...

php mysql , update query is not working

I'm trying to update some info into database but for some reasons it doesn't update. Also I'm not getting error in the server logs. mysql_query("UPDATE `view_item` SET `item_number` = $item_number, `title` = $title, `price` = $price, `shipping` = $shipping, `location...

Is using project:permissions in a symfony project safe in a production environment?

As the question states, is this task safe for a production environment? I find the permissions rather permissive, the cache directory is the one i find particularly suspicious. Write and execution permission on a code directory is somewhat suspicious. Cheers ...

Accessing the database and sending an email in a symfony batch script

I am running Symfony 1.3.2 on Ubuntu. I need to write a batch script that can: Access the database using the ORM Send email(s) IIRC, this was in a previous cookback, but I thing that was for an earlier version of Symfony (the API may have changed since). Does anyone know how I may access the database via the ORM layer in a batch scr...

How can I send a date from one site to other sites?

I'm not much of a php coder, mainly use VB. But I had a problem with one of my apps. To make it more secure I would need each php parameter to go through one site. Here is an example of what I mean: Application loads Sends ip and location to 2 servers (a.php & b.php) The problem so far is that the PC is making direct connections to t...

How to setup testing LAMP environment to work with outsourcing companies?

Hello Guys, I need to setup testing LAMP environment in my office to work with outsourcing companies. This is what I think should be done on my side: Setup testing web server with the same configuration as on production Setup testing SQL server with "fake data"? Outsourcers should have access only to some part of original code Outso...

loading xml slow down my site

Hi is it possible that loading an xml is slowing down my site? I've written this little function in php to iterate over an array of Strings to calculate the total amount of my followers function getFeedCount() { foreach ($array as $value) { $xml = simplexml_load_file("http://api.feedburner.com/awareness/1.0/GetFeedData?ur...

Problems with utf-8 encoding in php

Hi, Another utf-8 related problem I believe... I am using php to update data in a mysql db then display that data elsewhere in the site. Previously I have run into utf-8 problems before where special characters are displayed as question marks when viewed in a browser but this one seems slightly different. I have a number of records t...

Any way to enumerate class members?

I have a class instance, and I want to enumerate its members. How can this be done? ...

PHP and SOAP getting data out of array

Sorry for such a basic question. I have a snippet in which the var_dump($result) returns array(1) { [0]=> object(stdClass)#2 (10) { ["number"]=> int(1600) ["zip"]=> int(20502) ["suffix"]=> string(2) "NW" ["prefix"]=> string(0) "" ["type"]=> string(3) "Ave" ["street"]=> string(12) "P...

PHP IDE with Integrated Web Server

Note: This is not another "What is the best PHP IDE?" question. I'm looking for a PHP IDE with a specific feature, namely an integrated / embedded (php enabled) web server; ideally with xdebug pre-bundled. I already know that Aptana 1.5 has this functionality (and some older versions of Zend Studio as well), but Aptana 1.5 hasn't been ...

Retrieve Domain Name instead of IP

All, I am using the following command to retrieve the domain name of my server. $_SERVER['HTTP_HOST'] This seems to return the IP address instead of domain name like www.example.com. I looked at PHPInfo and it also lists an IP address for HTTP_HOST instead of Domain name. What do I need to change to make the domain name appear instea...

Functionality Workthrough of "price.phtml" template of catalog products in Magento

Can anybody please describe the total walkthrough of the catalog product's price.phtml template file? I have been trying to understand its full functionality, in how it implements its price logic, for the special price, wee price, regular price, and all of those; but have reached nowhere till now. Any help is greatly appreciated. After...

how to execute a .exe program by php script

hello I want to execute a .exe file on my Apache server using a php script. the procedure is as follow: 1- user comes, fills a html form 2- it goses to a php script 3- php script executes the name.exe file 4- php prints the output of the name.exe file on the page. I execute the name.exe normally from windows like this: run--> cmd-...

Pass form data from block to a page view in Drupal

I am using the location module and views module for a postcode search, which works fine in a page display using views. However I want the user to be able to enter their postcode into a block on the homepage and clicking submit my module sends them to the page created in views and the postcode is set as a session S_SESSION['postcode'] b...

path for running php file in eclipse

Hi I am a newbie running Ubuntu 10.04 and eclipse 3.5 with the PDT 2.2 beta. just installed all 3 . I have lamp installed via http://tuxtweaks.com/2010/04/installing-lamp-on-ubuntu-10-04-lucid-lynx/. when I try to run a " hello world " script , it doesn't work. the file is not found using both internal and external browsers. Can anyone...