php

how do you use multiple dropdowns and know which status each has?

the below code shows a table with users to be accepted or declined. the code as it is has a dropdown on the end allowing to either accept it, deny it or leave as is. there is a button on the bottom to submit the form and after that there should be a php script that decides which user is accepted, denied or still pending. what would be ...

Symfony : Generating filter+form classes = Fatal error (Allowed memory size exhausted)

Hello, I've got this weird error when i try to generate either the filters or the form on my production server. Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 20 bytes) in /var/www/project/lib/vendor/symfony/ lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Core.php on line 669 I don'...

How to make PHP / Cakephp database driven pages that are indexed as static pages by Google

If you have a database driven website based on PHP / Cakephp , how do you make the database driven pages to look like somesite.html or somesite/ - so that the pages can be indexed by Google or so that these pages can be directly linked to ...

Dynamic User Directorys

When a user registers I am wondering how to create them a dynamic directory (which will show they're profile), such as Facebook / MySpace. I want the directory to be that of their username. The username is stored on the database. Technologies being used Database: MySQL Front End: PHP I've looked at using the PHP MKDIR command to cre...

Decode data with Json in PHP

Hi, i need decode this Json with the PHP, but i dont know how. I saw this function php.net/json, but it haven't how to decode this type of data. {"c":[{"v":"0","e":"","n":"45","cc":"PSDB - PTB \/ PPS \/ DEM \/ PMN \/ PSDB \/ PT do B","nm":"JOSÉ SERRA","nv":"VICE: ÃNDIO DA COSTA"},{"v":"0","e":"","n":"13","cc":"PT - PRB \/ PDT \/ PT \/ ...

Need an easy example of actionscript 3 and facebook API integration

Hello guys, im programmer in PHP, AS2, AS3 and others, i want to develop a flash application for facebook, i know a litle bit about how to start with the API configuration and that kind of thinks, i know how to integrate PHP scripts with flash (but in AS2). So, i cant find a good (and simple) example of an app made in flash (AS3) who in...

Import excel file through php into mysql database

Hello, I facing a problem regarding the import of an excel file into mysql through php. i have used phptriad as a local server to test my web application(site). The application imports the excel file present on the client side computer. the code works fine when accessed through local server. recently i have registered a subdomain at or...

Using APC to store data in arrays

Hello, I'm currently attempting to implement APC caching as a datastore in my web application. Currently, the system retrieves data directly from the MySQL database, and requires a database call per request. I'm currently attempting to change this by prepopulating the cache with data which is intercepted and served from the cache at e...

mysql & php: temporary/ virtual ids for query results?

Hi, I wonder if it is possible to assign temporary/ virtual IDs for a query result? For instance, I have this as my query, SELECT pg_id AS ID, pg_url AS URL, pg_title AS Title, pg_content_1 AS Content FROM root_pages ORDER BY pg_created DESC output: ID URL Title Content 53 a A xxx 40 b B xxx ...

php redirect based on url variable

I want to create a URL redirect based on a URL variable. so, if student%20gender (student gender) is male then go to www.one.com, if female, go to www.two.com. couldn't figure this one out yet. any help? ...

How to customize twitter "via" message in PHP ?

I can't find any mention on how to do this with twitter api. I'd like to do it without buying this commercial software: http://www.webdesigndev.com/photoshop/how-to-brand-your-tweets-with-your-url-and-why-you-should I mean not just having my appname but putting any name I want at any time. ...

Is my use of MVC overcomplicating things and cuasing duplicate code?

I've wrote my own PHP MVC however i'm struggling to distinguish between the model and controller part. For example with a simple form that will add data to the database, the controller is pulling the form data from a request object, and passing it to the Model to handle the actual database insert. However there seems a lot of somewhat du...

Loop constructing the URLs in a little parser-script: a seven liner needs some help!

howdy - good morning Community! i want to parse the site - and get the results out of it: see this URL here - a swiss-server - head over to this site where i want to loop over - see this page here - i want to access the sub-pages in order to get the information that is shown in the "detail-pages!" therefore i need to loop over the ...

Dynamicly add values to and sort Javscript Object

Lets say i have this array of movie directors: var directors = ['Woody Allen', 'Woody Allen', 'Clint Eastwood', 'Quentin Tarantino', 'Robert Rodriguez', 'Woody Allen', 'Steven Soderberg', 'Robert Rodriguez, Quentin Tarantino' ]; A PHP print_r of the aray would look like this: Array ( [0] => Woody Allen [1] => Woody Allen ...

PHP - Database query or POST

I have a search page that allows the users to filter other users by various categories (age, gender, country, region, ethnicity, etc). The first time the search function is called it gets all the possible values for each category from the database. Just wondering though... Is it better to POST this data back each time the page is re-loa...

Calling method of another class in same file of class being used?

class.mysql.php has 2 classes: MySQL and MySQLResult class.mysql.php: <?php /** * MySQL Database Connection Class * @access public */ class MySQL { /** * MySQL server hostname * @access private * @var string */ var $host; /** * MySQL username * @access private * @var string */ ...

Returning JSON from a PHP Script.

I want to return a .JSON from a PHP script, do I just echo the result? Do I have to set header content-types? Any help would be great! ...

How do I display the correct number of comments for my status system?

I'm creating a system where users can write their current status and other users can comment. If anyone has commented on a user's status the user will get notified, but I'm having an issue coding this behavior. My desired behavior is this: if i have one comment on my status (by one user, of course): echo "user has commented your statu...

PHP CLI + Ajax for web terminal

I'm trying to determine the best approach to providing an Ajax based terminal using PHP. I haven't made an attempt at writing it yet but having rolled the idea around, the only way I could see it possible, would be 2 scripts: Script 1; handles Ajax communication between server and client browser. when a request is made to use the termi...

Frinds table for a social network website

Hello, Now i am working on a social network website and i already built the friends table for this website but i need some suggesion before i moved forward. I have a user table where user_id is the primary field. So for frinds i made a friends table with fields like friend1,friend2,is_active what i do actually when user1 send a frie...