php

cakephp database not found

I have project developed using cakephp which is getting data from different DBs, but if one of theses database some pages not open and give me the following error : Database table tablenae for model moedlname was not found. ..and I have in this page other data displayed from the other database which work probably. how i can deter...

PHP: Modifying array recursively?

Hi everybody, I have tried to make a function that iterates through the following array to flatten it and add parent id to children, where applicable. I just can't make it work, so I hope that anyone here has an idea of what to do: Here's the starting point: Array ( [0] => Array ( [id] => 1 [children] => ar...

Difference between HTML and PHP

I know that HTML is viewed on the client side and PHP is on the server side. I guess I want to know why they use different things. Why doesn't the client just view a php file? ...

web page validation question?

when using JQuery, HTML, PHP is mandatory to make your web pages validate even when JQuery, HTML and PHP can sometimes cause havoc as well as being backwards compatible, ...

Symfony and doctrine searchable sfDoctrinePager (symfony 1.4)

Can someone help me on paginating results with sfDoctrinePager? $articlesResults = Doctrine::getTable('Article') ->getTemplate('Doctrine_Template_I18n') ->getPlugin() ->getTable() ...

RewriteRule help

I have successfully setup htaccess to do this: domain.com/ad.php?ad_id=bmw_m3_2498224 INTO: domain.com/ads/bmw_m3_2498224 However, I have a link on the page which makes the page submit to itself... The link saves the ad inside a cookie: domain.com/ad.php?ad_id=bmw_m3_2498224&save=1 // Note the 'save' variable I need to ...

how to create URL extractor like facebook share

i need to extract data from url like title , description ,and any vedios images in the given url like facebook share button like this : http://www.facebook.com/sharer.php?u=http://www.wired.com&t=Test regards ...

Why would I be seeing execution timeouts when setting $_SESSION values?

I'm seeing the following errors in my PHP error logs: PHP Fatal error: Maximum execution time of 60 seconds exceeded in D:\sites\s105504\www\index.php on line 3 PHP Fatal error: Maximum execution time of 60 seconds exceeded in D:\sites\s105504\www\search.php on line 4 The lines in question are: index.php: 01 <?php 02 session_star...

Class design: is creating an object just for creation of objects from child classes bad form?

I currently have a message system which writes to two tables, sent and received, which largely have the same schema. I wrote a class called Message which populates the user inputted data before instantiating the two child classes which use a common method in Messageto set the rest of the properties and writing each to the database. The...

how to call a php class function directly using ajax?

Is it possible to call a php class function DIRECTLY using ajax? Something like below... except ajax... myclass::myfunction(); I've been using the jquery library to work with AJAX. $.get('control.php', {func: funcName, arg1: arg1}); The above is similar to what I'm trying to achieve MINUS the control.php; I'm not sure if this is...

Stop a user directly accesing a page

I have a page called create.php. It receives post variables and sets up accounts. I don't want that page to be accessible by a user. What's the conventional way of achieving this? I think I remember reading something about including a page with a CONSTANT. If the CONSTANT is not present the page has been accessed directly. I think Wordp...

php+jquery+captcha, is this is the correct way?

I am using combination of php+jQuery for captcha validation and later sending mails and do other stuff. The pseudo code is something like this: captcha_code = jQuery.post(.....execute captcha script and get status) if(captcha_code == "correct"){ send_mail_using_php_script; } Now I have no idea whether spammers can directly execute...

CakePHP without htaccess and mod_rewrite - how to overwrite WEB URL PATH

So I installed CakePHP on a IIS box and followed the steps of uncommenting the appropriate lines in core.php to make my URLs work as index.php/controllername/methodname/ My only problem now is that all the convenience functions such as $html->css, $html->link, etc. are pointing to some wacky paths. If I am viewing index.php/pages/home d...

Recreating http request with cURL incl. files

I consistently get the error 'failed creating formpost data' from the below code, the same thing works perfectly on my local testing server, but on my shared host it throws the error. The sample part is just to simulate building the array with both files and non-file data. Essentially all I'm trying to do here is redirect the same http ...

Success function not being called when form is submitted

Hi, I've been trying to figure out why the following script's success function isn't running. Everything in my form works perfectly, and the form contents are being emailed correctly, but the success function isn't being called. If anyone could review my code and let me know why my success function isn't being called I would very much ...

SVN Production Deployment on Commit

Hi, I m setting up SVN on my local web development server and I'm wanting to create a post-commit hook that exports the repo to the production server (either via FTP, SSH, etc) when the commit message contains the word "deploy" or something similar. I know this has to be a common function for SVN but I can't seem to find anything that d...

Facebook require_login not working

hi guys, I am having some trouble with my little facebook application, I keep getting this friggin error, "Fatal error: Call to undefined method Facebook::require_login()", now the funny bit is that my exact same code is working for other people, but not for me, here is the code. <?php require_once( "facebook-php-sdk/src/facebook.php" )...

File upload with tdo-miniforms not working

I am using the TDO-miniforms plugin for wordpress. I have a form set up that lets the user submit files. The files are successfully uploaded to the tmp-folder, but once the post is created they are not copied into the allocated post folder. The only thing that is created in the folder with a post id is a file called array. It seems like...

PHP / MySQL Query Builder UI with jQuery?

So, I need to construct a front-facing query builder for a database, but I'm having trouble finding existing code for what I can't imagine is a rare requirement. Basically, I have non-SQL fluent people needing to build queries on the fly and view the results. I found this: http://plugins.jquery.com/project/SQL_QUERY_BUILDER (Demo: htt...

What's the most straightforward way in PHP to create an associative array from two parallel indexed arrays?

Given the following two indexed arrays: $a = array('a', 'b', 'c'); $b = array('red', 'blue', 'green'); What is the most straighforward/efficient way to produce the following associative array?: $result_i_want = array('a' => 'red', 'b' => 'blue', 'c' => 'green'); Thanks. ...