php

Basic help with include php

Ok I'm at my work this friday setting up a table that will have data in it that will come from a separate file called values.php. When I write it like this, the divs turn up blank. I think I have the "include" written wrong, does an absolute path not work? <?php include('http://www.nextadvisor.com/credit_report_services/values.php'); ...

PHP - Iterating multiple $_post arrays

Hi all, I have the following code: <tr> <td width="60%"><dl> <dt>Full Name</dt> <dd> <input name="fullname[]" type="text" class="txt w90" id="fullname[]" value="<?php echo $value; ?>" /> </dd> </dl></td> <td width="30%"><dl> <dt>Job Title</dt> <dd>...

Eclipse + PDT performance tips?

I recently wanted to get a decend IDE for my PHP side-projecs, and by searching SO found Eclipse+PDT. Although it's not quite at the level of Visual Studio yet, it's pretty nice and better than Notepad++ for this purpose. I can even debug somewhat, although it's pretty glitchy. But there is one thing that is bugging me. It seems to have...

JSON encode MySQL results

How do I use the JSON_encode function with mysql query results, do I need to iterate through the rows or can I just apply it to the entire results object? ...

Looking for advice on a "related videos" query on a tagged video system

Well I run a small video website and on the actual video page there is a strip of "related videos" similar to most video sides (e.g. YouTube) and currently all I'm doing is taking one of its tags randomly and finding other videos with the same tag. Not surprisingly this isn't a great method as some tags are very vague and some videos ar...

How Can I Recognize Well-Engineered PHP Code?

In one of my questions about PHP programming, several people had commented that the programming in large PHP-based projects is not optimal. Amongst the projects not to look at are Drupal, Joomla, and Wordpress (commenters and answerers say). What is an example of a PHP project in which the programming is first rate, then? More important...

PHP function to get Facebook status?

I'm looking for a good, simple PHP function to get my latest Facebook status updates. Anyone know of one? Thanks! EDIT: I've added a half-solution below. Or if anyone knows a good way to read in the RSS feed and spit out the recent status update? ...

Need to re-format phone number entries in a PHP Formmail script

I have a simple text field for "Phone Number" in a contact form on a client's website. The formmail script returns whatever the user types into the field. For example, they'll receive "000-000-0000", "0000000000", (000) 000-000, etc. The client would like to receive all phone numbers in this form: 000-000-0000. Can someone provide a simp...

Zend_Pdf - Text On Top of Shapes?

Is it possible to draw text over top of a drawn shape with Zend_Pdf? No matter what order I execute the draw statements, the shape is always on top of my text. ...

What is a python equivalent of PHP's var_dump()

When debugging in PHP I frequently find it useful to simply stick a var_dump($foo, $bar, ...) in my code to show me the the what a variable is, what is value is, and the same for anything that it contains. What is a good python equivalent for this? I have seen several things in my Google searching that are somewhat equivalent, but noth...

How to seamlessly mix ASP.NET and PHP Web applications

I have two websites, one driven by ASP.NET and the other in PHP. The PHP site is hosted on a relatively inexpensive host provider ('unlimited bandwidth and diskspace for $10 a month). The PHP site also provides REST URLs which would help me in monetizing my website. The other site (the 'main' site, as it were) is an ASP.NET website wh...

PDO MySQL Driver on Mac

I have a mac with a custom PHP 5 install that built from about a year ago. I remember it took all Sunday and I had to compile about 20 times to get it right. The MySQL I have is from entropy and was precompiled. Now I need to get PDO with the MySQL driver working and the driver is not installed. I tried the "pecl install pdo_mysql" and ...

Unzipping files in PHP with zlib?!?

My web site is hosted at Dreamhost and there they only get zlib installed along with PHP. I couldn't figure out how to unzip files with the commom methods from this extension as described here : http://php.net/zlib Does anyone knows how can I unzip a .gz or .gzip file with zlib extension on PHP? That would save my life! ...

SQL Query: Grouping by an ntext field

I have the below query, which basically it retrieves the 5 top most books sold: select top 5 count(id_book_orddetails) 'books_sold', bk.* from orderdetails_orddetails ord inner join books_book bk on ord.id_book_orddetails = bk.id_book group by id_book, name_book,author_book,desc_book,id_ctg_book,qty_book,image_book,isdel...

PHP and MySQL to design map search site

Hi Everyone, I have a project to designing a website to search Zip codes on a digital map. Somebody advised me to use PHP with postgreSQL or MySQL. My professor wants me to tell him why I chose this for a mapping site. The question is... Is there an expertise web language for GIS site ?? What is the difference if I use MySQL or MSsql ...

Circular matching. PHP / MySql

Hi I need some help with the following scenario in php. I have a db with users every user has an ID, have_card and want_card. I know how to make a direct match (one user trades with another user). But if there is no direct match but there is a circular swap like: User #1 has card A wants card B User #2 has card B wants card C User #3 ...

I'm having a helluva time with data importing (PHP MySQL)

I'm building an app that pulls data in from an excel .csv file and applying various levels of formatting, moving and mapping. Most everything is figured out except for one hitch with cleaning the data. Here is an example of the data from Excel: GREAT PERFORMANCES,GREAT PERFORMANCES,57744 ROUND LAKE RD,NEW YORK,NY "GUASTAVINO'S, INC",...

A piece of PHP code I'm not so sure about.

I have here a piece of PHP code that deletes a directory and all files in it if present. However, I'm not too sure about it, it looks to me like it'll delete all sub-maps too and then files in those and so on... I basically want to give and optional true/false parameter to select wheter or not to delete sub directories. Or would it be b...

No PHP for large projects? Why not?

I've read a few posts where people have stated (not suggested, not discussed, not offered) that PHP should not be used for large projects. Being a primarily PHP developer, I ask two questions: What defines a "large project"? Why not? What are the pitfalls of using PHP I run a small development team and I know from experience the qu...

PHP date issues with daylight saving

I've got a very strange bug cropping up in some PHP code I've got. The page is managing student enrolments in courses. On the page is a table of the student's courses, and each row has a number of dates: when they enrolled, when they completed, when they passed the assessment and when they picked up their certificate. The table data is ...