php

PayPal Adaptive Payments and SOAP SDK

Hi all, I'm integrating Adaptive Payments in a PHP application that already uses the PayPal SOAP SDK for MassPay. Everything looks very simple the problem is when calling the MassPay integration it now has a name clash because CallerServices were already declared by the Adaptive Payments API. Is there any easy (and good) way for those ...

Pagination script - getting data from two tables

I have a pagination script, which can be seen here: http://www.automotori6282.tk/phpsandbox/ This is the source code: http://pastebin.com/raw.php?i=63dCvfxD (PmcPagination.php) http://pastebin.com/raw.php?i=3k4nqwRB (demo.php, the page with the code in) and index.php for http://www.automotori6282.tk/phpsandbox/ simply uses PHP's incl...

How to embed php in javascript?

how can we use php in between javascript ????? like function jst() { var i = 0 ; i = <?php echo 35; ?> alert( i ); } Please suggest a better way ...

php script to convert .png to .icns for mac os

I am looking for php script that convert .png file to .icns file for mac. Thanks. ...

short regex datetime split

Hi, I'm trying to split the following: 2010-07-30 10:10:50 and I would like to ONLY end up with: 2010 07 30 normally with just the date, you regex with /-/ however now I would like something as simple as that but now i get 2010 07 30 10:10:50 how can i get that last part + space out? Thank you so much! ps, right now I need t...

Can I host a facebook PHP application in my Django site?

Hi, I've got a website http://www.mydomain.com made with Django, and I'd like to use the domain to host a facebook application written in PHP, in something like http://www.mydomain.com/facebook/myapp/. Is that possible? How can I do that? Thanks Jul ...

Get date range between two dates excluding weekends

Given the following dates: 6/30/2010 - 7/6/2010 and a static variable: $h = 7.5 I need to create an array like: Array ( [2010-06-30] => 7.5 [2010-07-01] => 7.5 => [2010-07-02] => 7.5 => [2010-07-05] => 7.5 => [2010-07-06] => 7.5) Weekend days excluded. No, it's not homework...for some reason I just can't think straight today. ...

Would an AJAX script persist a session in PHP?

I've been asked to develop a social networking site to tie in with a game. The game is in Flash (so delivered as just a .swf file) and will be hosted on the social networking website. One of the issues that's arisen during testing and developing is sessions timing out. I know session length can (theoretically) be modified using php.ini ...

two forms in smarty template

Hi, i have a feedback form in a website and that is included via a tpl file from a page. i am trying to include another tpl that has the contact us form. when i include this contact us form via .tpl file, the previous form(feedback) doesnt even show up. I tried having different form name, form fields are having different names. way both...

Automatically insert content into News section

Hi All, I'm developing a Wordpress theme. One of the sections on the front page is titled News. In that section the user should be able to insert information himself (I'll make a separate file called news.php which will php included into the markup), but I also want the content to be automatically updated once the user makes a post. Fo...

Stack overflow in Internet Explorer

Yesterday I came across an error which I was puzzled by and had a little laugh at. I opened my website in Internet explorer (I use chrome 99% of the time) and got a "Stack Overflow" error. I was just wondering is this a bad thing because when I open it in chrome or firefox it loads fine. Also does this happen to anyone else? the we...

Verifying mime type of pdf files on upload in PHP

I am working on a project that requires file uploads. I want to make sure it's secure and that only PDF files are being uploaded. I am already checking file extension but i want to make sure the file really is a pdf file. What is the best way to check the mime type in php? I am using PHP 5.2.5 and can't seem to get fileinfo or mime_cont...

Assign regex pattern as key to an array.

I have an array of regular expressions and am trying to loop through a text document to find the first pattern, assign that as the key to an array then continue through find the second pattern and assign that as the value. Whenever I come across pattern 1 I want that to always be assigned as a key and all pattern 2 matches that follow un...

'if' inside 'while' statement in php

I have this bit of code which loops through an array and echos out the result to the page thus: while($row = mysqli_fetch_array($result)) { echo '<tr><td><a target="_blank" href="' . $row['url'] . '">' . $row['name'] . '</a></td>' . '<td>' . $row['provider'] . '</td>' . '<td>' . $row['media'] . "</td></tr><br />\n"; } ...

acl for edit post page?

i wonder if i shld use an ACL rule (PHP/Zend_Acl in my case) for something as small as a edit post page? i guess the criteria to allow users to edit a post will be owner of post editors/moderators/admin the question will be if yes (to use acl), how can i define it (i am using Zend_Acl but if u give me some code example, i might be a...

Scaling a site I wrote 2 years ago and need advice on correct planning methods.

I made a website almost 2 years ago that needs some serious T.L.C. I've been maintaining the site, doing bug fixes and the like but I only ever wrote 'ideas' and features for the site on scrap paper or in a text file somewhere on my computer. The site never had a 'structured' development plan as it was just something fun to do at the tim...

Encoding problem in PHP SoapClient and C# SOAP Server responses

Hi, I have problems with special characters in soap responses. All connections are made in utf-8 (in xml headers, SoapClient configuration, php source code, database connections, soap server responses) and I don't understand what is happening. All special characters are replaced with a sharp "#" character. For example: Instead of "Sól...

Embed player auto start value not changing in php site but chaning in other site

I am using an iframe in my static page which contains HTML. Its working fine but not working in some other site which is developed by php. Problem is when i change the autostart value its changing in one site but not changing in other site(php). Value always shows autostart=false. Behaving as same in all browsers. ...

detecting failed uploads

Is it possible in PHP to detect when an upload failed because of filesize. I know about upload_max_filesize and post_max_size and set them to what i want but if a user doesn't see my file size limit (which is displayed in red) and uploads a large file it doesn't display an error. just takes a really long time. I have <input type="hidde...

Netbeans 6.9 uses 50-60% CPU

Netbeans eats 50-60% CPU all the time and I installed NB for PHP only and Yii framework. My PC detail: Intel(R) Pentium(R) Dual CPU E2200 @2.20GHz(2CPU), 1526MB Ram. Should I upgrade my PC or have right way to solve out this problem? ...