php

PHP AES decryption

Hi All, I'm really struggling to decrypt a given cipher text in PHP and I'm hoping that one of you will be able to spot where I'm going wrong with this one. So this is the string I'm trying to decode Wq+J2IlE7Cug1gJNiwy1beIcFggGhn+gZHkTCQ4J/DR3OY45OMs4RXN850xbfAmy I know its encrypted with AES/CBC/PKCS5Padding with an IV of 2ZqVSH...

Need a method to convert a date from server's timezone to user's timezone

I need a method which could convert a given date from one time zone to another. Something like: Date Format: 2010-07-13 12:34:00 $newDestinationDate = $convertTimeZoneDate($dateTime, $serverTimeZone, $userTimeZone) Please help? ...

What is the use of PHP DOM Manipulation?

Hi, Sorry if the question is too general, but I wonder what is the use of a PHP DOM Manipulation compared to javascript DOM Manipulation? I understood that it was mainly used to parse some html, or xml, but are there other applications where it is good to use? Thanks :) ...

The WHERE IN clause using propel in symfony

Hi, I am new to symfony and propel . How can I create the following query using propel ? "UPDATE tablename SET status = 1 WHERE id IN (1,2,3,4)"; Thanks. ...

Magento catalogProductInfo - access denied for unknown reason

I am getting access denied when asking Magento with following request: <?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt; <soapenv:Body> <ns1...

Possibility of: $site->self::filter_name

Hello, I need to use: $site->self::filter_name Obviously that returns a Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM in error Thanks Edit: Answer is: $site->{self::filter_name} ...

mysql and or query

I need to make a search query, where a user can search by name or course or year or member, any one of above and also the user cam make a search with all the field or any number of field, e.g.;-as only with name & course. How it is possible? I don't want to make different query, can it be possible with a single query? now my query is: ...

Multiple domains pointing to the same folder

Hello, I am currently running two websites. I am able to add my domains and set the root folder to / instead of /domain1.com and /domain2.com. That way both websites go to the same folder, however they both maintain their domain names (no redirects). My code determines whether the user is from domain1.com or domain2.com and displays the...

Floating point operation returns different result in PHP and C#

I get different results when try to division same numbers in PHP and C#: PHP: echo 1000/0.03475; output:28776.9784173 C#: 1000/0.03475 output:28776,9784172662 Why? And how to get same results? ...

sql injection / Browser-Hijacker prevention php

Hi Folks, I have a website where I can't use html_entities() or html_specialchars() to process user input data. Instead, I added a custom function, which in the end is a function, which uses an array $forbidden to clean the input string of all unwanted characters. At the moment I have '<', '>', "'" as unwanted characters because of sql-...

PHP: endless loop of reading folders?

hey guys, i wonder how i can solve the following problem: I'm reading a folder on my server and i'm displaying the contents as follows. if there's an image i'll print an image, if there's folder i'll print a div with a folder icon. i wonder if it's possible click on one of those subfolders and then display the contents of this folder th...

Javascript: How do I convert a specific timezoned date to different time zone date?

I have a php script which gives server time, but as per knowledge, we can get the user's machine time and time zone with the help of client side scripts (javascript). I have mysql table which has dates stored along with timezone from where it was stored with the help of form. I need to show the data on a web page along with the time stor...

How to include the PEAR php packages on a MAC when changed include path in .htaccess

Hi folks, I'm trying to use the Text_Password class of PEAR but am not sure how to include it. I have installed PEAR. And I'm guessing it has put the classes somewhere in the PHP directory. I have this in my .htaccess file php_value include_path .:/Library/WebServer/Documents/phpweb20/include Which is why I'm guessing it isn't pic...

how to fetch url containg '#' in it by php ??

Possible Duplicate: retrieve the hash in the url with php? iam having a page that is containg bookmark in its url like http://www.abc.com/page_url#bookmark iam using $_SERVER['HTTP_HOST'] and $_SERVER["REQUEST_URI"] to get the url but its gigvng URL only upto http://www.abc.com/page_url i.e. its not giving my bookmarked lin...

mysql and or query together

I need to make a search engine where a user can search by name,year,member,year(text field) search will be with any one field or search will be with all the field or search will be with more than one field -How it is possible by using only one query?? now my code is $query="select * from fsb_profile where profile_name = '".$_REQUEST['n...

PHP Static code Analysis - Finding Class Dependancies

Hi, I am about to start a large refactoring job on a big PHP project. I have successfully used pdepend to generate dependancy reports on the packages outlined in the PHPDoc blocks at the start of every file. The information is really usefull, it outlines dependancies between packages (which packages are used by which, cyclic dependanc...

PHP - SimpleXML - echo / print_r return different values.

I am trying to convert some xml into a json object using PHP. This should be working, yet for some bizarre reason it is failing. Could someone provide some input. // Loop Through images and return the right one. $i = 1; foreach($page->image as $image) { if ($i == $_GET['id']) { echo json_encode(array( 'backgro...

FWRITE() Saving file to a specific location

This code below is using the FWRITE function. however i wish to save the file to a specific location but always get 'cant open file' as expected. i have setup the directory listed in mypath but it still wont write to that location. $mypath = "http://www.mysite.com/test/data/"; $myFile = $mypath."data.txt"; $fh = fopen($myFile...

Drupal variables - doesn't print path correctly

I'm trying to make a variable for an edit button. In template.php, I've put this code function phptemplate_preprocess_node(&$vars) { if ($user->uid == $node->uid || in_array('moderator', array_values($user->roles))|| $user->uid == 1){ $vars['edit'] = l('Edit', 'node/' . $node->nid . '/edit'); } } Then I print $edit...

php mass email and reminders

Hi, I am working on a site where I have the admin manager and i am trying to see how can I allow the admin to send mass emails to notify the event he is organizing, once he invites for the first time then towards during the event date, cron job should automatically send reminder to the author the email id's he used first time. something...