php

<noscript> redirection

I want to redirect the user to a certain page if he/she has javascript disabled. I tried this code: <noscript><?php url::redirect('controller/method'); ?></noscript> // url::redirect is much like the location header to no avail... How do I do this? ...

Code Igniter Function Call 404

I was going through the official Code Igniter tutorial when I hit a snag... The tutorial had me save and run this code: <?php class Blog extends Controller { function index() { echo 'Hello World!'; } function comments() { echo 'Look at this!'; } } ?> IF I enter the following URL: ind...

Determine locations mentioned in shortish (500 to 1000 words) piece of text using PHP

I'd like to find a way to take a piece of user supplied text and determine what addresses on the map are mentioned within the text. I'd be happy to use a free web service if it exists or use a script which will not consume too many resources. One way I can imagine doing this is taking a gigantic database of addressing and searching for...

Printing without opening print dialog in php

Hai Guys, I have to print a page in php but i dont want to use window.print ..... I have to print without opening the print dialog box... I am using php..... ...

Intepreting debug info from trying to use gmail as SMTP to send mail with PHP

I used a PHP library to try and use my gmail account to send mails. Just an experiment, to see if I can set it up. After succesfully completing the send() method, I request debug information. This is what was shown to me: 220 mx.google.com ESMTP g9sm901968gvc.25 250 mx.google.com at your service 530 5.7.0 Must issue a STARTTLS command f...

Charset problem, MySQL and get_meta_tags()

Hello, I'm trying to get HTML meta tags with PHP by using get_meta_tags() function. I'm using UTF8 for tables, charset/collations, as connection charset to MySQL and everything else. But unfortunetely MySQL cuts off the string when inserting to table. It happens while HTML encodings are different than UTF-8 (for example ISO 8859-1) Is...

how to get the dropdown value?

Hi i am using dropdown for display the timezone.The timezone values are come from database.Whenever the user change the value I need to alert the new timezone.For example if user change the time GMT+5.30 to GMT+6.30 then I want to alert GMT+6.30.Here the the dropdown values coming as an array?What can I do to get the values? ...

File upload and storage handling in a web application

I am currently using php and ajax file upload to develop a web application. in a web application involves getting the files uploaded from user, e.g email client, photo gallery. This is the scenario that i got stuck. When user uploads some files but close the browser without submit, i want to delete those files and only move the releva...

What native mysql class should I port to from Zend_Db? ( No PDO or Mysqli )

I'm dealing with a client who has a legacy cPanel account where the php installation was not compiled with PDO nor Mysqli therefore my Zend_Db code is useless since it relies on either of those. What library/class should I go with? ...

Time calculation in php (add 10 hours)?

I get the time: $today = time(); $date = date('h:i:s A', strtotime($today)); if the current time is "1:00:00 am", how do i add 10 more hours to become 11:00:00 am?? ...

Registration and Session with PHP and MySQL

Hello boys and girls. I'm looking for an in-depth tutorial of registration and session management using PHP and MySQL. Sorry if this is the wrong place to ask for this, but i really haven't been able to find a good tutorial elsewhere. Cheers! ...

How to implement SimpleTest in Kohana

Here's the problem, I was assigned task from my bos to learn how to use Kohana and implement simple test in that. We would like to use it as our framework for future projects. Being new to both KohanaPHP and SimpleTest, I can't figure it out how to do even the simplest test of my helpers. I can't even find a single step-by-step tutorial...

Is there a windows program to automatically indent/tidy up PHP source code?

Is there a windows program to automatically indent/tidy up PHP source code? ...

PHP regex and compare variables in a string

Hi, i have a tricky problem and seems like i'm stuck. I have an idea how to proceed but no idea how to do it in practice. What i want to do is convert a string inside .txt file to another format (using regex and variables?). The main problem is when i need to convert those lines marked with //comments. NOTE: "...villainx calls $x" is c...

Letting users custom skin

As an exercise, I'm trying to wrap my head around what goes into letting a user custom skin their profile (like myspace as an example). I'm using PHP. Since I'm clueless as to the whole thing, I'm not sure what to ask, but some of my concerns are how complex this is, is it going to require an overhaul of my code, can I separate this part...

Integrating jQuery fullcalendar into PHP website

Hello, I would like to integrate the jQuery fullcalendar into my PHP website, but I don't know how to handle the event and how to use the JSON data from MySQL. Any advice would be appreciated. ...

On error, attempt to include a file and re-execute the failed function

First of all, this question is purely theoretical. Fact is, whether it's possible or not, it would be terribly bad practice. Having said that, here's my question: PHP offers the possibility to define custom error handlers via the set_error_handler function. By parsing the error message, it's possible to find out what triggered the error...

How do I send an empty dateTime with NUSOAP?

I'm using NUSOAP on the server-side of a web service. I want to return a null dateTime element, but I'm not sure how. If I return the values false or '' , the result is <due_date xsi:type="xsd:dateTime" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/&gt; whereas I would like it to be <due_date xsi:type="xsd:dateTime" xmlns:...

Parse string containing range of values to min and max variables

I'm looking for a nice way to parse a string into two variables using PHP. The variables are called minage and maxage, and they should be parsed according to the examples below: "40" -> minage=40, maxage=40 "-40" -> minage=null, maxage=40 "40-" -> minage=40, maxage=null "40-60" -> minage=40, maxage=60 ...

timeout for fread

Hello All, I am calling TCL script from PHP. I am sending a unique string from TCL process to PHP to make sure that script has ended . If I don't send that string then my fread in PHP is blocked forever . // PHP code <?php $id = 'done'; //Unique string $app = 'c:/wamp/www/tcl/bin/tclsh84.exe'; $descriptorspec = array( 0 => a...