•  
     
  •  
     
 

Is it possible to have a single form submit to two PHP scripts? 

by Guest Geek on September 30, 2009

Q: Is it possible to have an HTML form that passes the same value to two different PHP files and then display the two in one window?

I am using PHPLot and once I create the graph I want to display the list, in HTML format, of information that is being graphed.

 
 

How do I pull data from MySQL to use with PHPlot? 

by Guest Geek on September 26, 2009

Q: How does one fetch data from MySQL and graph it using PHPlot?

I have looked around for references and none have examples using MySQL.

 
 

Using html_entity_decode with Smarty 

by Guest Geek on September 22, 2009

Q: I have HTML formatted text in database and when calling the data from PHP (using html_entity_decode) the information is displayed in the correct format. When using the same function in smarty the HTML tags show and I am wondering if there is an alternative?

Here is some sample code:

{$obj->mCode[k].field|html_entity_decode}

 
 

How come I get errors when using PHP PDO to run stored procedures? 

by Guest Geek on September 21, 2009

Q: I am working with the PDO library in PHP to connect to MySQL and when I try to execute a stored procedure I get the following error:

trigger_error(”SQLSTATE[HY000]: General error”, “256″)

Any idea?

 
 

What are my options for chats and graphs with PHP? 

by Guest Geek on September 12, 2009

Q: I am working on a prototype app and looking for the best way to create dynamic charts/graphs–similar to analysis tools created by nytimes, etc.

Currently using PHP, MySQL and I have good knowledge of various scripting/programming languages.

 
 

How come HTML pulled from MySQL comes out as HTML source when using PHP? 

by Guest Geek on September 9, 2009

Q: I am storing HTML formatted text into MySQL. When fetching the data from MySQL (using PHP) the information displays all the text including the HTML tags. Is there a function that would allow me to display the information per the “HTML” format?

 
 

Is there a way to install a php server on a router ? (without computer) 

by Guest Geek on November 15, 2008

Q: Is there a way to install a php server on a router ? (without computer)

 
 

Generate a CSV file using PHP 

by matt on February 28, 2006

Q: How do you create a CSV file dynamically with PHP? I have tried many of the examples on the web but while the save/open prompt does show, it lets me know my file is unable to be opened. I need this to not be a file that is stored on my server but instead created at the time of demand.

A: The key to generating a CSV file using PHP that will be sent to your users web browser for them to open and do with as they want is to make sure you tell the browser that it is coming. Normally using PHP you just send the browser an html document and that is what the browser expects.

You need to tell the web browser to expect a file. In order to do this you have to use the header() functions built into PHP.

header(’Expires: 0′);
header(’Cache-control: private’);
header(’Cache-Control: must-revalidate, post-check=0, pre-check=0′);
header(’Content-Description: File Transfer’);
header(’Content-Type: application/vnd.ms-excel’);
header(’Content-disposition: attachment; filename=”file_name.xls”‘);

Then you just echo your data. You have to make sure not to send any information before you call your header functions or else you will get errors on your page and the file will not be downloadable but will be displayed in the browser.