php5

using SOAP without a wsdl? php5

It appears i dont have a wsdl file but many xsd files. Can i do anything with SOAP or is a wsdl file required? ...

Check Upload file type from an array in PHP.

Hi, I know this has been asked a few times before. However, it's something I've had a problem with for a long time. How can I check if a file extension and mime type are in an array this is the code I currently have. $upload_project_thum = $_FILES['upload_project_thum']['name']; $upload_project_thum_ext = substr($upload_project_thum...

How do i send specific SOAP request?

After using this code (and the previous example) i was able to send this request (after modifying) NOTE: There are -'s bc i copied from IE for nicer formatting. <?xml version="1.0" encoding="UTF-8" ?> - <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="urn://www.herong.home/req" xmlns:xsd="http://www.w3.org...

Reading word document

this works with vs < office 2007 and its pure PHP, no COM crap, still trying to figure 2007 /***************************************************************** This approach uses detection of NUL (chr(00)) and end line (chr(13)) to decide where the text is: - divide the file contents up by chr(13) - reject any slices containing a NUL -...

php_memcache.dll for PHP 5.3

Hello all, I recently setup a server using the latest version of XAMPP for Windows. With it came PHP 5.3. I'm now looking for a memcache.dll file that works with PHP 5.3 I've used some of the previous .dll files and recieved an error message: "PHP Startup: memcache: Unable t initialize module. Module compiled with module API=20060613...

PHP URL Routing, kind of like Django

I am trying to construct a regex based router for a MVC framework I am working on. I was very fond of the way Django handled urls in urls.py, and would like to create something similar. Does anyone have any code / examples of how I can create an array of regular expressions which my router can 'process' to instantiate the controller (or ...

web based FTP help needed

I am looking for a web based FTP client for our clients that is password protected, they can upload & download files. Each client must have a user/pass to login into their folders. Any reccomendation of open source would be very much appreciated ...

When is it good to use Exceptions on PHP?

I've been developing big applications using try/catch to handle all the exceptions and errors; however, I've been trying to figure out: When is it correct to use a try/catch statement? Is there a good practice/rule for try/catchs? Currently I'm building a SEO library for my PHP Framework and I have a "small" function, and I asked mysel...

How can I get the callee in PHP?

I would like to know from where a global function or public method is being called. I guess I could do it by inspecting debug_backtrace but I'd rather use a lighterweight mechanism if one exists. Any suggestions? For example something like so, if you imagine the get_callee() function and constant existing: function doSomething() { ...

problem with class method - cannot get it to work inside foreach loop - php

Hello, I wrote the class Link which has a method shortTolong() this should return the real URL for a shortend url by returning the 'location' response header. i tested it and it works OK here is the code public function shortTolong() { $urlMatch = array(); $ch = curl_init(); $options = array ( ...

Replace newlines with BR tags, but only inside PRE tags

In stock PHP5, what is a good preg_replace expression for making this transformation: replace newlines with <br />, but only within <pre> blocks (Feel free to make simplifying assumptions, and ignore corner cases. For example, we can assume that tags will be one line, and not pathological things like ) Input text: <div><pre class='s...

Run a php file for a particular time interval

I develop a webpage where I need to send an email to a particular user [depend upon the database value] at a particular time automatically [without human interference]. For example I have a file named Send_mail.php. It will execute once per day by script [Not by Cron or other way]. Please guide us in this. Thanks in advance. ...

get text between <tags>in php</tags>

Currently i am using and have looked through this code http://us.php.net/manual/en/function.xml-set-element-handler.php#85970 How do i get the text between tags? i am using php5 and XML Parser ...

XML to JSON or array? PHP

I was thinking, it might be able to use and process XML data if i can run the XML through a func to validate it (against a schema) then convert the XML to json for easy object access? How can i convert XML to JSON easily? ...

select inbetween elements in mysql?

I am trying to implement the pagination in php. I am using the Mysql as back end database. I am trying to implement the pagination logic. I would be having lots of record. But the user will see only 10 at a time. Now to show the first page, i do a SELECT * from USERS LIMIT 10. Now to get the next 10 and the subsequ...

URL Regex for PHP framework

I'm trying to get the controller, method and queries from a URL array. Something like this: 'home/news/[day]/[month]/[slug]/' I need some regex which will give me the following: Controller: home Method: News Arguments: day, month, slug For the arguments, it'd be nice if I could somehow get the name inside the brackets so I can put th...

What does a PHP warning mean if it refers to something that happened on "Line 0"?

I've not come across an error like this before where Line 0 is referred to. Does it have a specific meaning, or is it simply that PHP was unable to determine the line number before something went wrong? The full warning is: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /xxxxxx/text_editor.php o...

What are the possible return values for $_SERVER['REMOTE_ADDR'];?

In writing a login module, I want to log IP's as an additional measure for verifying who's on the other side is still the same person on the other side. I'm using $_SERVER['REMOTE_ADDR'] as one (of many) ways to get the remote machine's IP address. Aside from an IPv4 or IPv6 address, are there any other values i should expect this to r...

PHP denying use of short hand "<?"

I just installed php 5.3.0 and it won't run php scripts utilizing short open tags like <?, only <?PHP ...

PHP OOP extending class can't access database connection

Perhaps you can help. I have a main class that creates a MySql connection. Then I extend this class. I wasn't able to access the connection unless I did a parent::__construct(); and recently while doing this I got an error message that I was out of connections. So how do program this so it doesn't run out of connections and can access ...