Creating a CSV file with PHP? 

by on February 11, 2010

Q: I need to create a CSV file using PHP, then send that CSV data to SatNav. I am not experienced with PHP, so any direction would be helpful.

 
 

How do I call a PHP script from within another PHP script? 

by on February 2, 2010

Q: Is there are way to call a PHP script within PHP?

I have tired exec() and system() but when running the script from my host (Network solutions) they do not allow command line/cron jobs to run. I have also tried passing a form as well.

All I need is that upon completion of script A then script B (independent of script A) is called by script A.

 
 

Use PHP to display images 

by on January 26, 2010

Q: How can I use PHP to display images on my website that are in a location on the server that the web server does not have access to? Since the web server does not have access to the folder I cannot use a regular HTML IMG tag.

A: There are a few things you need to remember when doing this. The first is that the web server might not have access to the folders/files to display them using a regular URL but the web server does have to have permission to access the folder for the script to get to the files inside of it. If there is a vulnerability in your code or in any other part of the site then you need to understand that not only the images in this “out of the way” directory will be accessible but anything else as well. Read the rest of this entry »

 
 

How can I use php to display an image file? 

by on January 8, 2010

Q: How can I use PHP to generate complex images from a file? I have a public_html folder on the root of my webhost filesystem. I also created a private_data folder for sensitive information, such as bio profiles. I have the profile picture stored in the private_data/Registration/Profiles/USERNAME/Picture.jpg but because that folder is not accessible on the web, the IMG SRC tag doesn’t work. How can I say something like “img src=blah.php” and the php file actually loads the profile picture? All i understand so far is how to create backgrounds and plaintext into an image. But how do I load a preexisting image file?

 
 

Can I use AJAX without using POST? 

by on December 5, 2009

Q: I am just becoming familiar with AJAX and have copy-pasted the coding for sending GET requests to a PHP program. However, a large part of my website contains a function which handles a few large chunks of data. Some of this data can be upwards of 8,000 characters. I am trying to write a page to use AJAX to create articles, upload pictures all without refreshing the page. How can I do this without using POST? And can POST handle a total of 3MB of data (text only, image uploads are handled separately)?

 
 

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

by 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 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 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 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 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.