php

php fatal error- no idea why

im getting this error message Fatal error: Cannot redeclare get_db_conn() (previously declared in `/home/maxer/domains/x/public_html/xmasapp/dbfuncs.php:21) in /home/maxer/domains/x/public_html/xmasapp/dbfuncs.php on line 24` this is the code function get_db_conn() { $conn = mysql_connect($GLOBALS['db_ip'], $GLOBALS['db_user'], $GL...

Question on xml site map in combination with mod_rewrite !

I have a classifieds database which is displayed to users depending on their query, in a php file! I'm currently struggling (and learning alot) with creating a xml site map. Also, users in the future doing the same thing will definetely find my posts and your help very useful as there is very little info about this out there (atleast th...

fun error logging / reporting idea for small website

I want to write (or implement) a quick and easy logging solution for our website. I figure rss is fine for the format. I was thinking of piping apache's error log to a simple script that, if the url passes a blacklist, gets logged into a sqlite database. The database will store for each log entry the ip address, url, current count of th...

Pre-loading array values into a function

I am not sure if I am doing this correctly,pre-loading my array values for coins with the function defaultcoindload(); defaultcoindload(); function defaultcoindload() { /*Have the coin loads up to a maximum of a 1.00 dollar in value: An associative array-ID key is associated with value(ID is Nickels with value of 20). $money = array("N...

Is it possible to use heredoc inside an if statement?

Is it possible and is it the correct way to code using heredoc inside an if statement in php? if($selection!='') { $price=getselection($selection,$getprice[$selection]); if ($selection<8) { print 'Please enter the amount<br />'; print '<form action="" method="post"><input type="text" name="money1" value="'.$money...

AS3 and mySQL or XML: Saving user votes on server from a flash movie.

Hi, A project of mine involves a flash movie (.swf) in a webpage, where the user has to pick from a number of items, and has the option to thumbs up or thumbs down (vote on) each item. So far I have gotten this to work during each run of the application, as it is currently loading the data from an XML file - and the data is still stati...

Deleting records from the server after 15 days

I need to delete uploaded files from the server after 15 days using SQL. How would I do that? The following is the current code, but it isn't working. <?php $con = mysql_connect("localhost","mt","mt"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("mt", $con); function curdate(){ date_default_timezo...

Proper way to declare a function in PHP?

I am not really clear about declaring functions in php, so I will give this a try. getselection(); function getselection($selection,$price) { global $getprice; switch($selection) { case1: case 1: echo "You chose lemondew <br />"; $price=$getprice['lemondew'].'<br>'; echo "The price:".$price; break; Please let me know if I am...

in this case Csv or Mysql?

I am starting new project. In my project I will need to use local provinces and local city names. I do not want to have many mysql tables unless I have to have or csv is fast. For province-city case I am not sure which one to use. I have job announcements related with cities, provinces. For Csv case I will keep the name of city in anno...

Difficult array sort order

I have an array like this: array( 0 => array("src" => "foo-21.gif"), 1 => array("src" => "bar-short.gif"), 2 => array("src" => "baz-1.gif"), 3 => array("src" => "whatever.gif"), 4 => array("src" => "some-long.gif"), 5 => array("src" => "xyz.gif"), ); The value in the src element can be anything. However t...

Installing PHP & Apache in Vista

Hi All, I'm new to PHP programming. I want to install PHP & Apache in my Vista machine. Could you guide me to get those installed? I would really appreciate, if you explain step by step. ...

mysql_fetch_array() giving error.

The following code is giving error: *Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in W:\Aptana WorkSpace\Website\lib\filldropdown.php on line 22* <?php error_reporting(E_ALL ^ E_NOTICE); $db_host = 'localhost:3306'; $db_username = 'superuser'; $db_password = 'admin'; $db_name = 'exampledb'; //c...

automatic unzipping rar files in pages

Hi frnds i am uploading the files suppose if i download one file from my webpage that should automatically unzip and go to table how i can do that can anyone help me out thanks in advance ...

PHP language barrier design problem

Background I need to design a set of utility classes that will ease out file system access to several types of remote services (Local, FTP, WebDAV, SVN, SSH), and I cannot seem to get a "perfect" design mostly because of a language barrier - I feel that every design path I have chosen was scraped because PHP did not have support for a s...

Working example Zend_Rest_Controller with Zend_Rest_Client ?

Hi , iam trying to write an short Rest Service with Zend Framework. But the documentation is not the best at this Part. I have an ApiController extended Zend_Rest_Controller with all needed abstract methods. My goal is to get Post data and return something. My client looks like this: public function indexAction() { $u...

How to fetch QueryString values without using GET?

My AJAX code is passing QueryString to a PHP file. The QueryString looks like this: var strUrl = "./lib/filldropdown.php?DivName = " + DivName + "&DropDownControlName = " + DropDownName + "&SqlQuery = " + SqlQuery; In the file "filldropdown.php", I want to fetch the values from the query string. How to do this without using GET? And a...

Seriously speeding up PHP?

I've been writing PHP for years, and have used every framework under the sun, but one thing has always bugged me... and that's that the whole bloody thing has to be interpreted and executed every time someone tells my server they want the page served. I've experimented with caching, FastCGI, the Zend Job Queue (and symfony plug-ins that...

[PHP] Appending a value of a variable to a variable name?

Am stuck here! $part_one = "abc"; $v = "one"; echo $part_???; // should output "abc" How do I modify ??? to reference $v? Thanks! ...

Can I use Ant with NetBeans PHP projects?

I would like to use Ant with some of my PHP projects but I'm not sure how. I tried creating a build script with a few targets but couldn't execute any of them from within Netbeans - there's simply no option to. Is this feature supported in this context or not? If yes, then how do I use it (I must obviously be missing something in this ca...

mvc redirect to the same form , but with err variables set

Hello, I hope this makes enough sense and someone can give me some feedback on this My problem is how to get back to the same form on errors found, but with the error values in place. As you would normally postback to the same script and set the variables as you go. Now I am in the situation, that when I do the validation and try to sh...