php

Drupal Array of Inputs

I have a drupal form where users are entering a list of names (via textfields) and I'd like for them to be able to enter as many as they want. Is there some way to make an "input array" with drupal? Any ideas for using Ajax or Ahah to do this? ...

Enable a third button after two files have been uploaded

I have 3 buttons and I have the code to upload the files. First button I want to be able to click and upload a file. After this action I would also like to disable the button. Second button Same as the first. Third button After both files are uploaded I want to enable the third button and show a form using an iframe. How do I code...

Shared Hosting mail limits workaround

Hey guys, so i have a couple of sites on paid shared hosting, my host limits the mail to 300 per hour. One of my sites has more than 500 subscribers. My question is how can i send the newsletter to all my subscribers? is there a way or a script that i can use to send the first 300 users the email and after an hour to send the rest...? ...

Codeigniter application design

Hello, I have several questions regarding CI application design. Q. When creating a new form and your using CI's form_helper I'm creating arrays in the controller and passing it to the view/form_input() method. Should I be doing this in the controller, the view, or a separate file? Q. In my controller, I create a method for my form...

Drupal: fieldgroup_view_group to print multigroup in block

I'm trying to use the fieldgroup_view_group function to print a multigroup inside a block. The fieldgroup_view_group function looks like this: <?php function fieldgroup_view_group($group, &$node, $teaser = FALSE, $page = FALSE) { $group_name = $group['group_name']; $field_types = _content_field_types(); // Clone the node to pre...

How to handle the absence of Flash in a browser

Hi, Please can somebody explain to me how to render a static banner instead of a flash banner in the event that the browser doesn't have Flash installed already, so as not to interrupt the user's browsing experience. I'm coding in PHP and it probably makes sense to test for this in IE as well as Firefox. Thank you ...

quotes in queries

I have a mysql query which requires that parameters be enclosed in either "" or '', if I have an array passed to this function: function orderbyfield($column, array $selection) { // will it be alright (secure) to do this? foreach ($selection as $s) { $s = '"' . $s . '"'; } $string = implode(',', $selection) return array($column...

What's the best way to modify/compile source code of open source projects?

Like PHP and ubuntu. Is there a convenient way to see the modification alive? ...

How can I use QuickForm to add disabled select options?

I have code using QuickForm that creates a select widget with the following: $form->addElement( 'select', 'state_id', 'State:', statesArray() ); statesArray() queries the database to get the states available and returns an associative array with the ids linked to the state names. I'm using a similar technique throughout the solution. ...

Adding events in Fullcalendar on CodeIgniter

I just implemented Adam Shaw's popular calendar called 'fullcalendar' (http://arshaw.com/fullcalendar/) using CodeIgniter. But I require addition and other operations on events from my database. I was able to find one CakePHP plugin with the same purpose from here, http://bakery.cakephp.org/articles/view/events-plugin. Since I'm not in...

PHP for loop will affect the page load speed?

$categories = array("google","adobe","microsoft","exoot","yahoo"); $sql='google,exoot,adobe';//from mysql_query $categs = explode(",",$sql); for($x=0;$x<count($categs);$x++){ for($y=0;$y<count($categories);$y++){ if($categs[$x] == $categories[$y]){ $str .= $y.","; } } } echo str; // 0,3,1, Will thi...

javascript, php, cookies

the application returns a value "1" in the database instead of the mac address... I'm able to document.write the output of the mac address, but not able to have it store in the database. Is the program using the previous cookie? (but Ive deleted all the cookies from the pc) but if i change the variable mac to string data, it keep ref...

function.session-start is displaying on sign-in-action page with other correct links why so and how to check session for sign-in-action-form

<?php session_start(); if(isset($_POST['username']) && ($_POST['password'])) { $con=mysql_connect("localhost","root",""); if(!$con) { die('Could Not Connect:'.mysql_error()); } mysql_select_db("tcs",$con); $usr=$_POST["...

Link file to a row in Doctrine

I want to link a physical file with a row in a table. My intention is to use database habilities to delete the files that are referenced in the table. For example: $o = Doctrine::getTable('Document')->find(12); $o->delete(); This code delete the row in the table, i want to delete an hipotetical file referenced in $o->file_locatio...

when i download a file from uploaded files and when i open it it is not opening correctly..image or data in text file is not dispalying...

Hello Fiends... I follow all steps mentioned in the link given below to upload file add file,list file and get file...All things are going fine..But i have one problem When i download the file(it is downloaded no problem) but when i open it then file is not opening..Like suppose i have downloaded an image then after download if i try to...

Is this how the Factory Pattern works?

The Singleton and the Registry patterns were very simple and easy for me to understand right away but the Factory pattern has been something I haven't been able to get my brain to interpret 100% yet. I think I might understand it now, I have wrote a sample code below, please review and tell me if this is the proper use of the Factory pa...

How to save/copy file in php script between two windows servers with authorization?

Hello I want to copy/save file in php script from one Windows Server (source) to second Windows Server (dist). I cant use anonymous "Guest" account, I need to authorize on dist server by user and pass. Have you any idea how to do this? I tried to to this with UNC paths like this: "\path\to\dist\file.txt" but I cant force user authoriz...

PHP + curl, HTTP POST sample code?

Can anyone teach me, preferable show some sample how to do a php + curl HTTP POST? I want to send data like, username=user1, password=passuser1, gender=1 etc to www.domain.com And I am expecting a response, e.g "result=OK". Thanks ...

How Does the Zend Application / Bootstrapping Work?

Hi, A few questions regarding the basics of Zend Framework 1.9. i followed the quickstart guide, and basically, bootstrapping involves, a. from index.php: $ZEND_FRAMEWORK_LIB_PATH = '/appl/ZendFramework-1.9.7/library'; defined('APPLICATION_PATH') || define('APPLICATION_PATH', (realpath(dirname(__FILE__) . '/../application'))); defin...

combine two xml files into one

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt; <xsl:param name="pXml1" select="''" /> <xsl:param name="pXml2" select="''" /> <xsl:param name="pRoot" select="'root'" /> <xsl:template match="/"> <xsl:variable name="vXml1" select="document($pXml1)" /> <xsl:variable name="vXml2" select="do...