php

sendmail() php help

Hi I am getting an error while sending a mail from a form Failed to connect to mailserver at "mail.yoursite.com" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\xampp\xampp\htdocs\send.php on line 8 Warning: mail() [function.mail]: SMTP server response: 550 ACCESS DENIED in C:\xampp\xampp\htdocs...

jquery - send string to php to safe it in mysql

Hi, i got this script, which i found in the web: <script type="text/javascript"> $(document).ready( function () { $('a.closeEl').bind('click', toggleContent); $('div.groupWrapper').Sortable( { accept: 'groupItem', helperclass: 'sortHelper', activeclass : 'sortableactive', hoverclass : 's...

Loading role-based navigation upon login

I have a login form through which one of three types of users gets into the website (PHP-based). Upon login the index page should load with the navigation bar based on user type. Right now the login page loads the index without checking for user type. How to achieve this? I'm not using any PHP framework. ...

Passing parameters to a static method with PHP

Hello, I'm building my own framework, and I'm trying to pass a parameter to a static method. For some reason, the parameter is not getting passed. Here is the code: Front.php: if(URI::get(0) === "") URI.php: public static function get($index) { die($index); if(!filter_var($index, FILTER_VALIDATE_INT)) { ...

Documentation of FacebookRestClientException

Using the Facebook REST API PHP client library, it seems wise to wrap calls in try{} thus: require('facebook.php'); $fb = new Facebook($fbApiKey, $fbSecret); try { $result = $fb->api_client->some_api_method(...); } catch (FacebookRestClientException $e) { // now what? } But I'm not sure what to do with the exception, e.g. to f...

Is there something like a macro in PHP? Or: How to make an own include function?

What I want to do is this: When I write a class and the class instantiates another class, I want to import that class with an require_once. Just the way I do so in Objective-C. But instead of using plain require_once function and messing around with paths and string concatenation, I would prefer something like: importClass('myclass'); ...

Drupal Theming - Background images without dimensional constraints

I 'm using zen as the basic theme to make a new theme for my site. The problem is i want background images for header and footer that are not getting displayed until i specify a height and width for them.Moreover, the height and width specified in the CSS inside the #header and #footer have to match the exact dimension of the original im...

Dynamic Testing Tools

I am looking for some sort of dynamic testing tool. Let me explain what I mean. I have a modular application and part of my business strategy is to license each module independently. I would like to test things such as the fact that one module's tests all still pass even when the other module is not present on the file system. Another t...

Unexpected Connection Reset: A PHP or an Apache issue?

Hello all, I have a PHP script that keeps stopping at the same place every time and my browser reports: The connection to the server was reset while the page was loading. I have tested this on Firefox and IE, same thing happens. So, I am guessing this is an Apache/PHP config problem. Here are few things I have set. PHP.ini max...

preg_replace not working!

Here's my Codeigniter function: function edit_phone($phone) { if (preg_match('/^\(?[0-9]{3}\)?[-. ]?[0-9]{3}[-. ]?[0-9]{4}$/', $phone)) { return preg_replace("/([0-9]{3})([0-9]{3})([0-9]{4})/", "$1-$2-$3", $phone); } else { $this->CI->validation->set_m...

Changing a spreadsheet formula so it works with PHP

Hello, for years now I have used a math formula to determine relative activity levels for message boards. Now I would like to use that formula in a php search engine to replace the non-functioning Google Page Ranking system. The data items used are: Members (B2), Posts (D2), Topics (C2), and the Boards creation date (E2). In the spreads...

PHP: Log errors to a logfile locally

Hello all, I am trying to setup PHP to log errors locally so that I can solve this problem. However, I can't even get this to work. I have followed this tutorial, but nothing. Does it only log fatal errors or what? Is there anything else I need to make sure of? ...

How to make a function find a file through multiple directories?

Is there a "performant" way in PHP to search for a file through multiple directories? Lets say I know that the file may be in one of the search paths: $pathOne, $pathTwo, $pathThree. But now lets imagine, the user (developer who uses the framework) is able to group his stuff in subfolders as well. $pathTwo contains 20 subfolders, and e...

jquery stops insert into database

Hello all, i have made this script but then i press submit the jquery animation start but it will not submit it into the database with PHP :S. Here is my script http://pastebin.org/68943 Thanks ...

Deeply Nested Inheritance - Bad or Good Practice?

I am in the process of making a PHP web application. I have a situation that I believe would foster a good time for nested inheritance. Anyway, here is my situation: public class RecurringWeeklyEvent extends RecurringEvent { } public class RecurringEvent extends Event { } It does not seem to me that this would be a bad design practic...

''' character shows up as "\'" in php output.

I am working on a post type form. The site is wordpress based. While testing the form, I noticed that everytime I use the ''' character, when the post is posted, it prints out "\'" instead. For example: Input: "Bob's birthday plans." Output: "Bob\'s birthday plans." How do I stop php or wordpress, whichever is responisble, from doi...

PHP log will not ignore repeated errors with ignore_repeated_errors = On

The title says it all. Although I have instructed php to only log an error once - i see the error over and over again in my log file. Any ideas why this directive would get ignored? I've restarted apache, etc. ...

'Remember' form drop list value when submitting to SELF ?

I know how to 'remember' some form values whenever submitting the form to itself, in this case because of a picture upload function which requires the form to be submitted to itself. I simply want it so that if the user has filled out all fields and then uploads an image, the form doesn't get resetted (cleared). I have solved this in re...

Running a Zend_Application from the command line?

Is there a blessed way to run a Zend_Application from the command line? That is, I want to run a shell script that invokes a Zend_Application, loads its configuration, and then calls a specific controller action OR run an arbitrary command line script with access to the applications configurations, models, etc. I can think of a few w...

UML: Modeling php includes? How to?

I have a php application where some Web Pages are used for different purposes. Depending on the value of one (or more) parameters being passed in the URL the page includes one or other php file with different functionality. Let's say I have clients.php with the following code fragment: <?php $do=$_GET["do"]; switch($do){ case "...