php

Why is this php script not mailing me?

I'm running the example from chapter 1 in Head First's PHP and MySQL. I placed the files on Head Fist's site on apache's /var/www folder and the thing runs. Yet, why isn't php's mailto working? edit: btw, I'm working on Ubuntu 10.04 I added two debugging lines to the script: $testmail = mail($to, $subject, $msg); echo 'WAS IT MAILED...

How to detect a Web server and localserver?

Is there a way to detect if the site is running under a web server and local server. ...

Accessing data from server through php in iphone

Hi all, I am using this code for accessing data from server, NSString *post = [[NSString alloc] initWithFormat:@"Email=%@",GEmail]; NSData *postData = [post dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES]; NSString *postLength = [NSString stringWithFormat:@"%d", [postData length]]; NSURL *url = [NSURL URLWit...

Zend Framework/Form Elements: Create custom class or?

the result i want is a textarea that hooks up to WMD (markdown editor). and include a div.wmd-preview element. what i have currently is in my forms (extending Zend_Form) ... i add the functionality thru decorators // init() $this->addElement('textarea', 'bio', array( 'label' => 'Bio', 'description' => '<a href="http://daringfire...

PHP Coding Efficiency: How to fill an array without using [variableName++] (probably easy)

Something about using $array_increment++ to fill an array seem inefficient, even though it works. Is there a more efficient way to fill $color_names in the code below than using a variable to walk through the array? Since I'm using a foreach and 'if' to fill the array, it's harder to figure out a different way than using ++. $array_inc...

php jquery include files

Hi I know that a you put the reference to jquery between the head tags as below. Script src="js/jquery-1.3.2-full.js" type="text/javascript" But on a php page with no head tags, where would I place the reference? thanks Rifki ...

How to remove the author and date of creation details from an article?

Hi all Am creating a sample website using Joomla. I am just a beginner. How to hide the author details and date of creation from an article published? ...

Enabling domxml in php

I have installed xampp 1.7.3 and the php version is PHP 5.3.1.When iam using the function domxml_open_file() ,it throwing an error Call to undefined function domxml_open_file(). How i can enable DOM in php.Thanks in advance. I canot find 'extension=php_domxml.dll' in php.ini file, so i added extension=php_domxml.dll this in php.ini fi...

remove_before()

Is there some better way to do the below? (without having the possibility of a fatal error) function remove_before($needle,$haystack){ return substr(strstr($haystack,$needle),strlen($needle)); } like strstr($haystack,$needle) but without the needle in the returned string, and I might as well ask if this can be improved too... fu...

How to Count number of lines of javascript in php files?

I need to count the no. of lines of inline java script between script tags in php files. How do I do it? Will grep linux command suffice or I can get some tool to do it? Please help. ...

Import CSV file in mysql with email validation

I have a 2 column in my subscriber table. Name | email I want to import a CSV file data in respective column with validation of email column. I have done uploading CSV part, but i don't know how to insert data with email validation. How I can do this, I have search allover net but I can't find any working answer on it. Please help ...

Text to HTML in PHP.

Hello, nl2br(); can do for EOL but what about white spaces and/or tabs at the beginning(or not) of line? Is there any function to do this at once? I need well formatted html output of text file. Thx. ...

problem in directory mapping/config

my index file is- include("application.php"); $DOC_TITLE = "MyMarket Home"; include("$CFG->templatedir/header.php"); ?> //html page code <? include("$CFG->templatedir/footer.php"); ?> application.php code- error_reporting(15); /* define a generic object */ class object {}; $CFG = new object; /* database configuration */ $CFG->d...

Write variable PHP with TCPDF

Hello, I have to generate a PDF with TCPDF, my information come from my database, so I have to write PHP variables. I know how to do. But I want to write CSS + xHTML (as an example I have seen of TCPDF site) using : $html = <<<EOF <style> <!-- My CSS --> </style> <!-- My xHTML --> EOF; $pdf->writeHTML('$html', ''); I have er...

getting attachments from a mailbox without the imap module

Hi Guys, We want to implement a pop3 client that gets the attachments out of an email, checks if there are video files and save them. The problem is, we can't use the IMAP php module. So we need a custom pop3 class i guess. Does anyone know a good pop3 client class that can handle attachments? Greetings ...

AJAX downfalls, the line between server and client side scripting?

I've been developing my first web based app for about two months now (I'm an undergrad student who is mostly experienced with C and Python with some Java thrown in to boot). So far my page works as a thin HTML layout (thin meaning a very simple layout, aka less than 50 lines of HTML) which is manipulated heavily by AJAX, primarily using ...

Can't track down bug

Hi The following is part of a script which is used to authenticate paypal payments. $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://' . $server . '/cgi-bin/webscr'); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $parameters); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOP...

Does the Auto Assign Role Module not work with Custom form registrations?

I have a custom user registration form at: somepath/register using hook form alter. I set up auto assign role by path to "/somepath/register" and it does not seem to assign the role that I am wanting. Does Auto Assign only work with content profile and not hook form alter registration ? ...

headers to force the download of a tar archive

Hi, i have a tar archive on the server that must be downloadable through php. This is the code that i've used: $content=file_get_contents($tar); header("Content-Type: application/force-download"); header("Content-Disposition: attachment; filename=$tar"); header("Content-Length: ".strlen($content)); unlink($name); die($content); Th...

what contents should be filled in PDT eclipse?

at "debug configurations" -> 'php script' -> 'new_config', on the right "PHP script arguments",what arguments should i fill in? for example: < ?php $tmp = $_GET['arg']; // is here the argument will be replaced ? echo $tmp; ?> i have no idea how to debug a URL with parameters. ...