php

How to know when jquery $.get ajax calls have completed?

I have a php / mysql / jquery web app that makes 13 ajax queries to various APIs and stores the result in a database table. To each result I assign a score and when all the results have completed I want to display a 'total score'. My problem is knowing when all the ajax queries have completed and all the results are in and ready to be t...

Extracting data from a zip file (PHP)

i have a tutorial from a website Net Tuts which is used to upload a zip file and extract the data from within the file into the server. copying and pasting the code straight from the web page did not work, an error occured half way through the script being processed. Fatal error: Cannot instantiate non-existent class: ziparchive in /w...

preg_split() and converting all links in a string to anchors?

Hey all, I have a string ($string for this example) and I want to do the following: Parse the string and convert all links within it to "actual links" (adding the open/close anchor tag) -- what is the best way to do this? I tried using preg_split() to create an array of the links contained in the string, with the idea of using str_repl...

What is wrong with my `if` statement?

I'm using an if statement to declare whether a user is an admin, mod or neither with this code below, but its messing up by always making $status = "admin" even if that person is neither, this has really baffled me. if($info['rights'] == "m") { $status = '<font color="#FFFFFF">(mod)</font>'; }elseif ($info['rights'] == "a"); { $...

Can I have different versions of php installed and running on my server?

My friend has allowed me to have access to his server, he has been coding PHP a lot longer than me and still uses php version 4.3.9 and doesn't want to upgrade this current version. Is there anyway for me to install php version 5.2 and use that while he still runs 4.3.9? I require some functions which are only available in 5.2. The serve...

How do you set up cakephp on a shared hosting?

This is one thing I haven't been able to do with Cake. I have tried it a few times and couldn't figure it out. I am on hostgator and it could help if someone could point how they've been setting it up (Advanced installation). Edit I have read the documentation and I get errors. I guess I haven't been reading it all too well. Edit I ju...

What is the most popular web programming language?

I have seen various statistics on language popularity based on search engine results, number of books published, open source projects developed, etc. but none of them is specific for web development (on the server side). Almost all of them shows Java, C and C++ as the most popular. I wonder how PHP, which was created explicitly for web d...

Configure _Session to work on applications that are deployed over multiple servers, different subdomain

I have a website that consists of 2 applications: Front end application Backend application The front end has the www domain, whereas the backend has the job subdomain. For example, my front end application has the domain www.example.com/*, whereas my backend as the job.example.com/*. My front end application can locate on one server...

how to print another page from the current page ?

i need to print a different page from the current page , that is to describe my problem more precisely .. i need to put the print button in one page but need to print a different page , also need to send a value to the second page which is to be printed. If somebody could help me will be very much thankfull ...

how to print the contents of a hidden iframe?

i want to print a page which i put in an iframe but dont want the contents to be displayed in the webpage , but the print button doesnt work when i put the iframe to display='none' what i did:- i set the iframe style='none' "name="frame1" > <input type="button" onclick="frames['frame1'].print()" value="print!"> how can i print the ...

Does anyone know of any good PHP analysis & refactoring tools?

At present we have a rather large (4k+ loc) function that we wish to decompose in to separate functions. Some of it has been decomposed where there are relatively encapsulated side effects and these ones are the easy bits. However we now have ~3k loc of intertwined nastyness. Some vars are passed to external functions by ref and all so...

GD2 and PHP on OS X

There are tons of links on this topic - but all have a different approach. I have a clean install of os x 10.5.6. I'm using the version of PHP that came with the OS. I have installed GD using FINK, it has installed associated packages. My question is, how do I now get GD support in PHP? (pref no macports or marc liyanage suggestions as...

Getting an event from a database a week in advancee

I am currently developing a sports website where one of the pages with be forthcoming fixtures in which the user will be able to what team and where the team are playing their next match. I have a database with the following fields... ID TEAM NUMBER OPPOSITION VENUE DATE MEET TIME MATCH TYPE So a row of data pulled from the DB an...

is my php architecture solid?

I'm trying to design a solid server side architecture and came up with this : http://www.monsterup.com/image.php?url=upload/1235488072.jpg The client side only talks to a single server file called process.php, where user rights are checked; and where the action is being dispatched. The business classes then handle the business logic an...

php string formating

Here is the code $i=0; while ($row = mysql_fetch_array($result)) { $output.="idno".$i."=".urlencode($row['usr_id']). '&'."res".$i."=".urlencode($row['responce']). '&'."sex".$i."=".urlencode($row['sex']). '&'."com1".$i."=".urlencode($row['com1']). '&'."com2".$i."=".urlencode($row['com2']); $i++; } OUTPUT i get ...

What's the best method to separate nested discussions over multiple pages - for web application?

I am designing a threaded message display for a PHP/MySQL application - like comments on Slashdot or Youtube - and am wondering how I should go about ordering the comments and separating it into pages so that you can have, say, 20 comments to a page but still have them nested. Comments in my app can be nested unlimited levels, and this ...

WAMP - PHP shell_exec() problem

I'm using WAMP as a server, and I have a need to execute svn, which can be found in my Windows directory: C:/Program Files/Subversion/bin/ The problem, is that when I launch the php program from the server, it won't produce output. It works from the command line, which makes me think this is a permissions problem with WAMP. However afte...

East Asian Characters rendered as squares with PHP imagettftext()

Hi, I'm trying to render images with verdana text using PHP imagettftext function. However, all east asian characters are not being rendered correctly. I tried using other fonts like tahoma and Lucida Grande, but neither works. Arial Unicode, however, works perfectly. The problem is that I don't want to use Arial as my font. Is there a...

Replace spaces in URL with underline

How can I replace spaces in URL with a underline(_)? $query = mysql_query("SELECT * FROM users WHERE username = '$_GET[user]'"); But if a user has a space in her/his username I wanna replace the space with an underline. So the URL for profile.php?user=John Johnson would be profile.php?user=John_Johnson. How can I do this? Thanks! ...

website query, php

Hi, How can I query a particular website with some fields and get the results to my webpage using php? let say website xyz.com will give you the name of the city if you give them the zipcode. How can I acehive this easliy in php? any code snap shot will be great. ...