php

Connection Reset by peer: mod_fcgid:

Hi When I try to run a program in PHP using domPHP API to create PDF files in runtime - with Godaddy server, I am getting the message - Connection Reset by peer: mod_fcgid the same work in our local server as well as in Dreamhost and Host gator. Godaddy support insists that this is a coding error and not server issue. Can any one hel...

Problem with keeping selected value in form after reloading page

Hey! I'm trying to populate a second dropdown in a dynamic way based on a previs selected dropdown. However, I've managed to write get the page to reload when I choose anything in the dropdownbox but the chosen value isnt passed after reloading. I have register_globals turned off (and prefer to) and i'm using the GET function to submit ...

PHP - Regex, remove font tag.

Could someone tell me why this isn't working please? $str = preg_replace("<font[^>]*>", '', $str); CMS is for flash and now the client wants to implement a html website. Need to remove evil inline font tags to show default styling. ...

convert word document to xml using php

Hi all, I want to convert the word document(.doc and .docx) to xml. How i can do this using php? After that i have to add some data in that xml file. Anyone know please help me. ...

PHP mysql connection?

can any one tell me the difference between mysql_connect and mysql_pconnect? ...

php compare or mysql data?

I not sure which one would use less execution time if the user is advertising a classifieds ad and did not upload any image, a 'blank.jpg' would replace the image in HTML code. which is: <img src="blank.jpg"> For the PHP, I use if-conditional when read data from mysql and replace '0' value with 'blank.jpg', would it be optimal if the d...

Going from C# to php

I'm going to have to learn php soon, because I need it for a new job. Up until now, i've always programmed in C#. Are there things I should know about php that are strange or different from a C# perspective? Things to look out for? ...

Populate drop down list from array using JQuery

Assuming I have this array: Array( [0] => Array( [Brand] => 'Toyota', [Model] => 'Camry', [Color] => 'Red', [Year] => 2002 ) [1] => Array( [brand] => 'Nissan', [Model] => 'Skyline', [Color] => '...

Joomla component development: Save, apply and cancel toolbar buttons not working

Hi, I am following the lessons on component development in the "Learning Joomla! 1.5 Extension Development" book. I've followed the instructions in the chapter exactly, creating a component I call "carousel". I've only created the Admin back-end, and I'm able to view the form for creating a new entry or edit existing one, but cannot sav...

how to display images stored in a mysql database using PHP

I have been trying to display image from database using php but i am only getting download prompt whenever i use or click the link. what i want to do is, i want to display it on the web browser. And want to use it in tags. my code is: require_once('dbconfig.php'); $cont=mysql_connect($dbhost,$dbuser,$dbpass) or die("Error Conn...

Use jQuery's ajax call to refresh a captcha.

I wrote my own php captcha script, with a jpeg header, so that I can say <img src="captcha.php"> which works by storing the value of the captcha into the session variable. When the user can't read it, I want it to be refreshable. I first tried $("#refresh").click(function() { $("#captcha").attr("src","captcha.php"); }); but o...

Backwards compability in reading requests in PHP

I am experienced with web development, but not with PHP. My challenge now is therefore that I am about to move an older PHP solution to a server only supporting PHP 5.2.+. The whole solution is using a $id - style to read the request instead of $_REQUEST['id'] or the $_GET..., $_POST... I wonder if this type of coding is not longer supp...

calculating checksum when uploading a file

Hi, I am uploading files to server. I found a function like $sha1 = sha1_file($filename); at http://www.tuxradar.com/practicalphp/8/15/0 So I was wonder whether or not $filename should point to the actual file with path or just the filename? $_FILES['upload']['name'] will do it right? ...

identify the selected td using javascript in html

Hi I have a table which contain 100 rows and td. like see below <table border="0" cellpadding="0" cellspacing="0" id="artcle-title" > <tr> <td>Artcle details 1</td> </tr> <tr> <td>Artcle details 2</td> </tr> <tr> <td>Artcle details 3</td> </tr> <tr> <td>Artcle details 4</td> </tr> .... </table> When a us...

php mail function

hi, i have been asked the php mail() function, is it send from linux ?or is it depend where the source code reside ? ...

Getting a view's ID from its name

I'm trying to get the id of a view by supplying its name. Right now I have to insert the view into a node, then inspect it with dsm to see its ID, which I then hardcode where I need it. That's not a good workflow. If at least I could get the view's ID without inserting it somewhere first and inspecting it with dsm, that would be better. ...

Loop a part of PHP code every 15 seconds

Hi everyone, i'm trying to make a logging function with php for a tool that captures computer information on Windows. Every 15 seconds the a txt file will be produced with information inside. i want to make it run in the background while the user access other pages and not be interrupted. Here's the code i'm now using <?php $tr...

Convert SimpleXML to DOMDocument, not DOMElement

I neeed to convert a SimpleXML object to a DOMDocument, to use it with DOMXPath. I need DOMXPath for it's method registerPHPFunctions. Can this be done? With dom_import_simplexml I get a DOMElement, not DOMDocument. ...

Unicode characters at top of page causing gap in WebMatrix

I am working on a simplistic website using PHP, a language I haven't touched in a long time, especially when it's running on a Windows system from WebMatrix. Lately I've been porting a couple of websites from ASP.NET (Umbraco) to PHP to a basic templating class written in PHP, and so far things have been going fairly well, until some uni...

PHP, Preg_replace (regex), replacing just the part of pattern in ( )?

Sorry for this basic question, but I've been looking over all the info about preg_replace I can find and I still can't figure this out.. I have a large string, like this, for example: $string= '# tjs { fassdaf } #fsk { fssf} # fskff { casf }'; And when I do this, it replaces the entire pattern, not just the part in ( ) as I expect i...