php

XMLReader mysteriously fails when parsing document

I have a php script that takes in some XML data and parses it, displaying various bits of information I pull out of it. This has been working fine for over 6 months, until recently it now fails mysteriously on a certain tag. The XML is generated from an outside source(a conferencing bridge), so I have no control over how it is built. I ...

PHP & MySQL submit error message problem

When I submit a new name and not a new avatar I get the following avatar error message Please upload a .gif, .jpeg, .jpg or .png image!. I want to be able to send a new name only without having to upload a new avatar each time I submit the form without getting the avatar error message Please upload a .gif, .jpeg, .jpg or .png image! can ...

php for-loop issue

Heya, I have a loop which generates a table code for a specific number of times. What I'm having problems with is to echo a variable inside the loop. The loop runs 10 times, and there are 10 text messages sent to the page, so my problem is how do I get each of the looped tables to echo one of the text messages each time? ...

HTML Output from XML and strange characters

Im using CURL to fetch Twitter RSS, then write those tweets to Wordpress. Here is an example of the XML: <title>Bob: Twitter&#8217;s @Anywhere Platform Is Now Live - http://bit.ly/b54cTS&lt;/title&gt; I then write this to Wordpress, but the result is: Bob: Twitterâs @Anywhere Platform Is Now Live - <a href="http://bit.ly/b54cTS" t...

Remove files from Bazaar

I'm using Bazaar (bzr) to keep source code for a website updated, but we've ran into a problem when we remove files from version control. The files we are removing are ones we never intended to version to begin with. When this happens we use bzr rm --keep to remove the file from version control, but keep the file in the file system. Doi...

Encrypting cookies in PHP

Hi, How can i encrypt and later decrypt a value of a cookie in PHP (how secure will the encryption be ) ...

Which CMS do I need? Needs to be easy to post a certain kind of post

Hi, I'm creating a site for a video store and it needs to be CMS. I'm doing this for free so I need to use a free CMS like Wordpress, Drupal or Joomla. Do I need a new CMS, a plugin or some PHP of my own? What I need: User accounts Categories Custom post Here's the site as it stands with WP: http://sundancevideo.ca. Right now an expe...

WordPress > Custom Category Listing by excluding Category Slug matches

I have a group of categories where the slug of each has a prefix "mycat-" and I would like to insert code into my sidebar.php file to create a custom sidebar widget that lists all categories except those preceeded by "mycat-". Any help much appreciated. Example Categories (by slug)... mycat-hidden, mycat-favorites, mycat-nofollow, myc...

What is the difference between a private and public function?

I am a new programmer, and I started in C and am now starting to enjoy JavaScript and a tiny bit of PHP more. Lately I've heard the terms 'private' and 'public' functions a lot. Could anybody give an explanation of the both and how they are of use to a programmer? And I'm probably totally wrong here... but is a (function(){}) in j...

How Do I See The Final Text Of A Query Resulting From A Call To mysqli->prepare?

After code like this: $stmt = $mysqli->prepare("SELECT District FROM City WHERE Name=?")) { $stmt->bind_param("s", $city); $stmt->execute(); $stmt->bind_result($district); $stmt->fetch(); printf("%s is in district %s\n", $city, $district); How Do I See The Actual SQL Statement That Was Executed? (It Should Look Something Like "SELECT...

PHP doesn't show any kind of errors

Hello everybody I have a PHP server at home for development. It is running: Ubuntu 9.10 Apache 2.2.12 PHP 5.3.2-0.dotdeb.1 MySql 5.0.7-dev Currently the settings in the php.ini for displayiong errors are: display_errors = on error_reporting = E_ALL But I do not see any errors in my php script. Also very strange is that phpinfo() s...

IIS 7 with PHP 5.2 - Error 500

I have a fresh install of IIS 7 - I just added Web Platform Installer, and PHP 5.2 thru that. However, when trying to access to a simple test.php file (just has phpinfo() in it), I get the following list of errors: • IIS was not able to access the web.config file for the Web site or application. This can occur if the NTFS permissions ...

how do i troubleshoot transfer closed with outstanding read data remaining or Empty reply from server?

Hi all, Recently and without any website code changes, a few of our dynamic PHP pages are either only partially rendering or not rendering at all. When the page won't render at all, and when I run curl, this is what I see: curl -lv http://mysite.com/create_ad.php * About to connect() to mysite.com port 80 * Trying 66.777.888.999... ...

Image upload storage strategies

When a user uploads an image to my site, the image goes through this process; user uploads pic store pic metadata in db, giving the image a unique id async image processing (thumbnail creation, cropping, etc) all images are stored in the same uploads folder So far the site is pretty small, and there are only ~200,000 images in the u...

Explode in jquery with php.

Hi! I've got a jquery script, which creates a h3 tag and print a variable called result.tbUrl to it. I'd like to explode the variable at "::" and use the 2nd piece. This is my method. var link = document.createElement('h3'); link.innerHTML = <?php $link = "result.tbUrl"; $linkpiece = explode("::", $link); echo $pieces[1]; ?>; Could ...

How to remove BB codes from a string?

How to get ride of all BBcodes in a string but keep the content? Example: [B]This is bold[/B] and This is [color=#FFCCCC]colored[/color] Will be : This is bold and This is colored ...

Read Data From Text File PHP

Hi, I'm just wondering how I can read a text file in php, I'd like to have it display the last 200 entries (their each on a new line) from the text file. Like John White Jane Does John Does Someones Name and so on Thanks! ...

Would Apache running on port 8080 prevent dynamically loaded scripts in JavaScript?

Had a nice PHP/HTML/JS prototype working on my personal Linode, then tried to throw it into a work machine. The page adds a script tag dynamically with some JavaScript. It's a bunch of Google charts that update based on different timeslices. That code looks something like this: // jQuery $.post to send the beginning and end timestamps ...

comparing actual IP with partial IP in PHP

Using PHP I'd like to compare an actual ip address to part of one, and see if it matches. For example I want to see if the address matches 12.34.. <?php $rem_address = getenv('REMOTE_ADDR'); $temp = substr ($rem_address,0,6) if ($temp == "12.34.") echo "It's a match"; ?> Is there an easier/better way to do this? ...

Doctrine Fatal Error - Unknown relation alias

I am getting following error message: Doctrine_Table_Exception: Unknown relation alias shoesTable in /home/public_html/projects/giftshoes/system/database/doctrine/Doctrine/Relation/Parser.php on line 237 I am using doctrine 1.2.2 with Codeigniter My Code is below: (BaseShoes.php and Shoes.php is auto generated) ------------BaseShoes-...