php

ASP.NET equivalent of this PHP code?

Hi All, We have a flash developer who uses calls a file called proxy.php with the querystring ?url="http://feedburner/whatever" to access external data from rss feeds from domains that not by default accessible from swf code. for example I could have the following in the browser: http://localhost/proxy.php?url=feedburner.com/a_feed and...

Remote update of multiple sites at once via PHP

I have close to 30 wordpress installs that will grow very rapidly to double that number. Each of these sites has the same theme that I frequently am updating. I'd like to create a script on one of my servers that acts as a control panel for all my sites so that I can push out an updated theme file for all selected sites. The sites wil...

XMPPHP gTalk stream_select error

Hello All, i'm working on a IM Bot that will send a simple IM to GTalk account, but I'm having trouble using the XMPPHP library. The authentication works fine and it looks like the first message sends correctly, but the last message receives an error from google code: 503. You can view the errors here: Example Method Here is the sa...

How do I get user input from a form?

I have the current PHP: $thisarray[] = "#000"; SetProfileField('usercss', $USER->id, implode(',',$thisarray)); Which writes #000 to the users profile field labelled usercss. However I would like the user to be able to set the value from a simple form. Can anyone suggest some code I might use? ++ Hope to extend this to include a jQ...

WordPress Conditional PHP Question

I'm trying to call WordPress's 'the_time' using a conditional statement that checks the category. I want to call the custom field 'event_date' if the category is '3' and 'the_time()' if the category is '4'... This is what I have, and it echoes fine if I use "is_single()" instead of "is_category()" but for some I'm getting no echo when I...

How to detect the site a user came from before mine in PHP?

How can I detect the site the user came from before accessing mine in PHP? ...

PHP: multiple commands in die/exit

when it gives a error I want him to do 2 things. echo nl2br($qVraagOp); mysql_error(); so i thougth: $rVraagOp = mysql_query( $qVraagOp ) or die( echo nl2br($qVraagOp); mysql_error(); ); I can write a function that does these two things and then call that but that a bit redundant. is there a other way? Matthy ...

Problems with PHP when trying to create big array

Hi, Here is my code, which creates 2d array filled with zeros, array dimensions are (795,6942): function zeros($rowCount, $colCount){ $matrix = array(); for ($rowIndx=0; $rowIndx<$rowCount; $rowIndx++){ $matrix[] = array(); for($colIndx=0; $colIndx<$colCount; $colIndx++){ $matrix[$rowIndx][$colIndx]=...

PHP: Using PHP to syntax highlight all <code>s on a page... ($highlight_string() isn't an option)

Hi Stackers! I'm using CodeIgniter, alongside the highlight_code("$string"); (More info) function to provide syntax highlighting to a dynamic site. I want the users to be able to submit their own posts written in a BBCode-style format. I'm using NBBC PHP library for this. My problem is that nomatter how I do it I cannot get NBBC to syn...

Decoding base64 php file

I currently have an encoded footer file for a wordpress file I want to decode, because the theme author has put in some 'interesting' links. Don't get me wrong, I'm very happy to link back to the author, but gambling sites aren't really what I want! The file is this- <?php $o="QAAAOzh3b3cnbmlka3JjYicvUwAAQkpXS0ZTQldGU08nKScgKAEAZWhzc2...

Setting up a development server

When developing PHP applications, it's best to have a server you develop/test on, and then a live server you put everything once it's ready. OK, but how? If you are hosting through a hosting company how can you setup your own development server to test on that mimics all the LAMP settings as your live server? Because if they differ the...

PHP Form without additional File

Is it possible to to have a PHP form without having a seperate file, e.g. Normal Form <form action="send.php" method="post"> But instead of calling send.php have the code held in send.php in the same file as the form? ...

Comparing two array values

I have a form used to void, dismiss, amend and correct citations. A void can not be done in conjucntion with a dismissal, amendment, or correction. If you need to void and amend, you complete two forms. You can however do a dismissal, amendment and/or correction on the same form. I have two arrays created based on the variables from the...

Why does class get redeclared multiple times?

Ok here is a method I use for initializing models in my controller actions: protected $_tables = array(); protected function _getTable($table) { if (false === array_key_exists($table, $this->_tables)) { include APPLICATION_PATH . '/modules/' . $this->_request->getModuleName() . '/models/' . $table . '.php'; ...

Server to Server > Retrieve and extract a remote zip file to local server directory

I have a wp plugin file on server B who's purpose is to retrieve a zip file from a remote server A. Once Server B receives the zip file, it should extract the contents and copy the files into a specific folder on server B overwriting any existing files. I have some code below that I've borrowed from a file that uses and uploader to do...

How to make correct regular expression

I want to get ${1} = Title, ${2} = Open, ${3} = Bla-bla-bla. from {{Title|Open Bla-bla-bla }} ...

PHP mysqli updating a blob value in table does nothing.

I have a variable called $description that has a paragraph of information in it. Some of these descriptions are a sentence or 2, some are long, so im using blobs to save this instead of var char. This statement executes without a problem, but nothing actually gets saved. No errors reported. $query = "UPDATE event SET description=? WHERE...

How to use strstr with $_SERVER['HTTP_REFERER']

I'm using php to make it so that incoming traffic to my website will append information depending on the search engine. I'm setting $_SESSION['kw'], if it's not already set, to tel me that it's seo and to append the search terms: if (isset($result['q'])) $_SESSION['kw'] = 'seo-'.str_replace('\\"',"X",$result['q']); elseif (isse...

Sorting by ratings in a database - Where to put this SQL? (PHP/MySQL)

Hi folks OK - I'll get straight to the point - here's the PHP code in question: <h2>Highest Rated:</h2> <?php // Our query base $query = $this->db->query("SELECT * FROM code ORDER BY rating DESC"); foreach($query->result() as $row) { ?> <h3><?php echo $row->title." ID: ";echo...

Ajax: displaying notification on another page, after succesfully saved data to database.

Hello. I have standed out for awhile now with a thing i want to do. Thing i want to do is to display a message(confirmation, "You have earned 2 points") at the top (message like stackoverflow). Ive did this storing a confirmation message using session variable, and then at index.php there is a ajax script that loads session.php each 1...