php

separate email content

Hi I am trying to separate contents within an incoming email. Whenever the user receives and email with a marker line (### Reply above this line to append to the ticket ###) and if he clicks reply to this email the reply area starts with On Apr 22, 2010, at 11:22 AM, Test wrote: Reply above this line to append to the ticket ### Now...

Documenting PHP multiple inheritance with PhpDoc

I have multiple inheritance like this one: http://stackoverflow.com/questions/356128/can-i-extend-a-class-using-more-than-1-class-in-php (let's not discuss this approach itself please) and want my IDE to know about inherited class methods and properties. Is there a way to do it with PhpDoc? ...

Drupal theme code to work out if you are editing a node

Does anyone know the php code to check if you are in edit mode? I want to edit how my theme looks when in edit mode so need to work out if I am or not. ...

Return Total Rows from a table.

while($row=mysql_fetch_array($result)) { $output .= "<Reports>"; $output .= "<ProjectName>"; $output .= $row['ProjectName']; $output .= "</ProjectName>"; $output .= "<ProjectCount>"; $output .= $row=mysql_fetch_array($result) $output .= "</ProjectCount>"; $output .= "</Reports>"; } My SQL Query. SELE...

Webservice needs to be accessible through website

Hi, I have a .exe program which has an embedded webservice running on port 800. I can access it locally via 127.0.0.1:800 just fine once the program is executed. I need to be able to send the service commands such as: * 127.0.0.1:800/dev * will get a list of devices attached to the program. To my knowledge i need to forward port 800 o...

generating dynamic word documents for mass mailing

I need to generate a mass mailing based on a word document model with PHP. Given is a database with the adresses and the data that need to be filled in my word model. I want to generate a single word document with the different adresses and field contents from the database. We have a Linux server and the COM object is not avalaible. I...

PHP/MySQL - updateing 2 tables in one request

Morning, I want to learn more about sql and I'm wanting to update to tables; $query3 = "INSERT INTO `$table1`, `$table2` ($table1.DISPLAY_NAME, $table1.EMAIL_ACCOUNT, $table2.DISPLAY_NAME, $table2.EMAIL_ACCOUNT) values ('" . DISPLAY_NAME . "', '" . EMAIL_ADDRESS . "', '" . $get['rn'] . "', '" . $email . "')"; could some one point me i...

MySQL: How to check if a string is a valid DATE, TIME or DATETIME

When I try to put a value into a DATE field which is invalid, MySQL seems to use 0000-00-00 instead. Is there a way I can do this "check" without updating a DATE field? And to do it from for example PHP? Like, is there a way I can query the MySQL server and ask "Hey, is this DATE, TIME or DATETIME valid to you?" Or is there maybe an ev...

Symfony 1.4 - Don't save a blank password on a executeUpdate action.

I have a form to edit a UserProfile which is stored in mysql db. Which includes the following custom configuration: public function configure() { $this->widgetSchema['password']=new sfWidgetFormInputPassword(); $this->validatorSchema['password']->setOption('required', false); // you don't need to specify a new password if you ...

how can I determine the path of a site using php/smarty?

Ok, say I have a page with the url: URL.com/checkout/completed, how can I setup an if statemet to perform: <if "This page has url of checkout/completed"> No Content <else> Content </if> Is there a way? A simple way, my php/smarty-fu lacks.. A lot. EDIT: {if $smarty.server.REDIRECT_URL eq 'http://www.euroworker.no/checkout/comple...

PHP IIS problems downloading file says it is corrupt

Hi, I am running PHP on IIS 6 with mssql. I have uploaded a file to my webserver through a php script. Upon checking the file on the server the file is ok and not corrupt. However, when i then have a link on my website to try and download the file, it says the file is corrupt. I know the file isnt corrupt as i can view it perfectly i...

parse XML attribute via PHP XMLReader

the followings are XML sample code. <m:ad xmlns:m="http://www.w3c.org/soap"&gt; <title><![CDATA[TITLE]]></title> <phone>123456789</phone> <attributeGroup> <attribute id="14" name="A1">40</attribute> <attribute id="15" name="A2">50</attribute> </attributeGroup> </m:ad> I only know PHP XMLReader to get value...

Reading any well-formed RSS/ATOM file using PHP

Hello, I want to be able to read any well-formed RSS/ATOM file. That would mean I would not not know the tags, start the loop and the fields. How do I go about doing it in PHP. Thanks Jean ...

PHP: producing relative date/time from timestamps

Hi, I'm basically trying to convert a Unix timestamp (the time() function) to a relative date/time that's both compatible with past and future date. So outputs could be: 2 weeks ago 1 hour and 60 minutes ago 15 minutes and 54 seconds ago after 10 minutes and 15 seconds First I tried to code this, but made a huge unm...

How to get the real type of a value inside string?

I was searching here on StackOverflow about converting string to the real value and i didn't found. I need a function like "gettype" that does something like the result above, but i can't do it all :s gettypefromstring("1.234"); //returns (doble)1,234; gettypefromstring("1234"); //returns (int)1234; gettypefromstring("a"); //returns (ch...

How to create HTML tables from MySQL?

Hi Guys, I'm building a part of a system where the user can define "views" from a mysql database. I want some way of generating simple HTML tables/reports from the data, but not just plain output of sql queries- simple joins probably isn't enough. Any ideas? Just to be clear: I know perfectly well how to create a HTML table with PH...

mod rewrite, title slugs and htaccess

I have been taken in to provide some SEO guidance on a website which has been running since 2005. My problem is I want to use clean URLs. The code that handles the URL is hidden away in some class file. And with over a few thousand lines of code its a struggle to rewrite it. So I'm think, I have gone through all the products and create...

problems with the email body, appearing special characters in emails

Hi, I have some issues with my email -body when i send mails I'm using php in my site. My website is a spanish site , when ever i send a mail some special characters are comming in that mail. Always there is an ! mark in that mail, that too in the same place below is the code which i'm using and an email which i got. Code $domain...

PHP variable like $myvar-test is not valid?

I need to create a var like $myvar-test; but thats not valid or? ...

How to convert date and time into unix timestamp in php?

echo $_POST['time']."<br/>"; echo $_POST['day']."<br/>"; echo $_POST['year']."<br/>"; echo $_POST['month']."<br/>"; I have value store like this now I want to create a timestamp from these value. How to do that in PHP? Thanks in advance ...