php

Is saving enormous user information into a MySQL table good if one wants to display it for later use?

I have a file named discussion.php, where a form is located. In this form, a user will enter information, and the information will be posted to savedisc.php. Below is the code for discussion.php: <form action='savedisc.php' method='post'> <p>What would you like to discuss?</p> <textarea name='message' rows='15' cols='40'></textarea>...

PDO: Call to a member function fetch() on a non-object ?

I am just trying out PDO and I get this error, Fatal error: Call to a member function fetch() on a non-object, but isn't it already on the $this->db object? class shoutbox { private $db; function __construct($dbname, $username, $password, $host = "localhost" ) { # db conections try { $this->db = new PD...

How to convert images to pdf using PHP?

Hi peeps, Can anyone have an idea how to convert images to pdf using PHP? Any response will be appreciated. Thanks... ...

PHP: delete directory with files in it?

hey guys, i wonder what's the easiest way to delete a directory with all it's files in it? i'm using rmdir(PATH . '/' . $value); to delete a folder. however if there are files inside of it, i simply can't delete it. regards ...

HTTP Headers of Included Files VS Browsing Location!

When an http header is sent by a browser because the url is included in another page is it any different than when it is called by browsing to that page. for example if I have myjavascript.php am I gonna be able to tell if its being viewed by someone browsing to it rather than it being included in a tag? ...

Change mailed-by header in PHP mail

I've configured several headers in the mail() function, sender name and other fields appear as set. But, in the gmail mailed-by field, I see the hostname of my server, even though I've set the Mailed-By header to be different... Is there a way to change this, or am I specifying the wrong header to effect the change? Current Headers: F...

How do I do this query with ActiveRecord Class from Code Igniter?

I need to increment the number of comments on an Entries Table, the SQL for this would be: UPDATE entries SET comments = comments + 1 WHERE entry_id = 123; And i was wondering how to do this using Active Record Class form Code Igniter. http://codeigniter.com/user_guide/database/active_record.html#update ...

PHP MySQL get locations in radius user's location from GPS

Hi, I have in my database car incidents for example. These incidents have a latitude and longitude. On a mobile using the GPS, I get the user's location with his coordinates. The user can select a radius that he wants to know if there are incidents around him. So let's say he want to know incidents 2 miles around him. So I send from th...

Get Weekend Dates in php

Hi all, I am working on a php application which requires that I extract the dates of the weekends between two dates and then insert them as single records in the mysql database. I was thinking if there was a simpler way of doing it, rather than going through the loop between start date and end date and for each date checking if date('l...

Custom Wordpress index.php which circumvents The Loop isn't working correctly.

I'm building a Wordpress theme for a client and it's unlike any other theme I've built before in that the homepage is a collection of posts spread across multiple different containers and styles. It's supposed to look and feel like a magazine in that, at the beginning of each month, 9 different posts are published simultaneously that eac...

Is it possible to create a php based iphone/android app with PhoneGap or Appcelerator?

I want to be able to make an iphone and android app using php. I have looked at phonegap and appcelerator and it seems like only html and javascript can be used. These frameworks want to make it easy to make apps using web technologies and PHP i would argue is one of the biggest web technologies, but I'm not seeing much (if any) support....

'Invalid' error for sfWidgetFormChoice when form is submitted.

Hi, i want to display combo box using symfony. In the CountryForm.php i have created widget as : $this->setWidgets(array('country' => new sfWidgetFormChoice(array('choices' => array())))); for this validator as: $this->setValidators(array('country' => new sfValidatorChoice(array('choices' => array(array_keys($countries)))))); I am ge...

How to convert images (GIF, JPG, JPEG, PNG) to TIFF in PHP?

How can I convert images to .tiff with php? (im testing on win xp) I remember I used imagemagick to do this but I cant find the code now, and couldnt find any example on google. A code sample will be appreciated. Also, is there a way to do it without imagemagick? ...

CURL vs fsockopen chunking

This may seem kind of weird.. but I need to evaluate/parse chunks being sent over HTTP with PHP. It's of note to say that the HTTP stream may never end. Is there any way I can parse chunks as I get them with CURL? Or do I have to resort to some home-brewed fsockopen() solution? ...

Real time graphing with flot, mysql, php

Hi, I'm trying to draw a real time graph as my mysql table is constantly being inserted with values, like a moving graph referenced from http://kalanir.blogspot.com/2009/11/how-to-plot-moving-graphs-using-flot.html The values actually come from a carbon dioxide sensor which updates the value of the table with co2 values with positions i...

file is not being accessed in php script in yahoo small business domain

hi every one i'am having problem with include/require_once in PHP by which iam accessing a configuration file to connect database. This problem exists in yahoo small business servers where i hosted my site in a free host it works fine for the same code. the database connection is working fine but the including of files are not working ...

How can I communicate between PHP and a Java program?

I'm working on a web application that frequently requires a calculation intense query to be run, the results of which are stored in a separate table. Using MySQL, this query takes about 500ms (as optimized as possible, believe me). To eliminate this bottleneck, I've created a Java program that loads the relevant DB data into memory and...

Retrieving the comment count in from a Facebook comments box

I use on my website, but I can't figure out how to retrieve the comment count from a comment box with a specific XID. I've tried intercepting all new comments with the following code: FB.Event.subscribe('comments.add', function(response) { alert("Comment was added."); }); I never receive the alert though. Any ideas? I just need the...

could script timeout cause javascript to fail at end of page?

I have a simple PHP upload page that when finished uploading runs a bit of JavaScript to show a form and 'save' button that I enter various bits of info in. When I upload a large file 100-200mb I find that the upload hangs or seems to hang in that the javascript form never shows up. Is there a way to set the script execution time for j...

Need validation for a form in PHP not in Javascript?

Hai.. i already added javascript validation for my form.Its working fine.But mean while i ve to validate the same form using PHP also. This is the form code: class airportclass{ function add_airport_frm(){ $errmsg=0; <table> <form action="" method="post" name="airport" > <tr> <td colspan="2" align="center"><?php echo $err...