php

How to get variable from php file to actionscript?

I will write the text that getting from php file in adobe flash . how can I? ...

Can I validate with javascript and then process with php?

I am creating a simple form. I would like to use embedded javascript to validate that the form is filled out and then, if it turns out to be valid, process the data with a php script. I don't know how to do this, because I don't know how to associate more then 1 script with a form. <form id="aform" name="aform" action="myvalidationscr...

Colorize code inside <code></code>

I'm looking for a open source PHP script to colorize the code inside <code></code> or [code][/code] tags. Thanks ...

Netbeans xdebug nightmare

I know what you're thinking, ANOTHER netbeans xdebug post? Well, I've tried everything I've seen in other posts, and nothing seems to work. Here's my setup: OS: Ubuntu 9.10 PHP: 5.2.1 Netbeans: 6.8 The following is in my /etc/php5/apache2/php.ini zend_extension=/usr/lib/php5/20060613/xdebug.so xdebug.remote_enable=1 xdebug.remote_...

X-Forwarded-For causing Undefined index in PHP

Hi, I am trying to integrate some third party tracking code into one of my sites, however it is throwing up some errors, and their support isn't being much use, so i want to try and fix their code myself. Most I have fixed, however this function is giving me problems: private function getXForwardedFor() { $s =& $this; $xff_ips = array(...

Why is Wordpress $wpdb->query() response 1 when the rows returned is 0

I'm doing the following in a custom function: $exists = $wpdb->query($wpdb->prepare(' SELECT COUNT(*) FROM wp_%d_gdsr_data_article WHERE post_id = %d ', $blog_id, $post_id)); $exists evaluates to 1 even if no rows are returned by the query. Also, var_dump($wpdb->queries) yields a NULL. Anyone know what is going on her...

php find line number for a particular keyword

Hello, say I have a paragraph of text, with some new lines/line breaks. I would like to find the occurance of a certain keyword, and return the line numbers of those keywords. How do I do that? Thanks! ...

Is it possible for a parent to use a child's constant or static variables from inside a static method?

Below is an example of what I'm trying to do. The parent can't access any of the child's variables. It doesn't matter what technique I use (static or constants), I just need some kind of functionality like this. class ParentClass { public static function staticFunc() { //both of these will throw a (static|const) not def...

PHP / Zend Framework: Force prepend table name to column name in result array?

I am using Zend_Db_Select currently to retrieve hierarchical data from several joined tables. I need to be able to convert this easily into an array. Short of using a switch statement and listing out all the columns individually in order to sort the data, my thought was that if I could get the table names auto-prepended to the keys in th...

error checking to ensure that a field isn't blank?

My website has an opt-in member directory. Currently, the error checking function simply looks at the form $_POST to see if (!empty($userRealName)) and then allows the member to appear in the list. It took about 30 minutes for someone to show up as a blank name in the list, and upon examination of the database I've determined it's becau...

Can PHP and Oracle pass complex types to each other?

I want to pass/bind an array of (key1, key2) to an Oracle PL/SQL stored procedure using PHP. I'm able to bind primitive types and arrays of primitive types, but haven't found a way to pass complex datatypes back and forth. Is this unsupported? So far I've been having to pass along multiple arrays -- one for each subtype in my complex ...

URLs with query stripped of ampersands appearing in error logs

I've noticed a curious phenomena popping up in my error logs recently. If, as the result of processing a form, I redirect my users to the URL http://www.example.com/index.php?foo=bar&amp;bar=baz, I will see the following two URLs in my log http://www.example.com/index.php?foo=barbar=baz http://www.example.com/index.php?foo=bar&amp;bar=...

How to append to all urls in a string?

How should I go about appending to the end of all urls in string of html that is about to be sent out as as email? I want to add the google analytics campaign tracking to it like this: ?utm_source=email&utm_medium=email&utm_campaign=product_notify 99% of the pages will not end in '.html' and some urls might already have things like ?sr=...

Getting started with vBulletin development

I was asked if I could program something for vBulletin. As I never programmed something for vBulletin I started to search for documentation and tutorials. Unfortunately I wasn't very lucky. The most promising thing I found was this, but it looks like it was autogenerated and isn't very helpful for beginners. After some more searching I ...

Facebook Connect, how to allow users to find and invite friends to your site?

I've read quite a bit of documentation, and it's all based around on setting up full blown Facebook integration on your site to the point where you're completely relying on Facebook. All I want to know is 2 things: 1) How do I allow my users to find out which of their Facebook friends have already joined my site 2) And what's the easies...

PHP Summarize any URL

Hey guys, How can I, in PHP, get a summary of any URL? By summary, I mean something similar to the URL descriptions in Google web search results. Is this possible? Is there already some kind of tool I can plug in to so I don't have to generate my own summaries? I don't want to use metadata descriptions if possible. -Dylan ...

Passing an array for setting variable

Hi, I often see this idiom when reading php code: public function __construct($config) { if (array_key_exists('options', $config)) { ... } if (array_key_exists('driver_options', $config)) { ... } } Here I am concern with the way the parameter is used. If I were in lisp I would do: (defun ct (&key optio...

Which PHP calendar will suit my needs? Or build my own?

There are so many web based calendars out there that I'm not sure which will best suit my purposes. I want to create an events calendar, which I suppose looks and functions in much the same way as google calendar. But users shouldn't need to sign up for a gmail account or a google account. Users of my social network website should be ...

Mod_rewrite causing 404 error

These are the .htaccess files from two of my localhost sites. Virtual host 1 (mysite1.com): # this is the initialization Options +FollowSymLinks RewriteEngine On # Turn on the rewriting engine RewriteRule ^news-07/?$ news_01_06_2007.php [NC,L] # Handle requests for "news" RewriteCond %{REQUEST_FILENAME} !-s RewriteRule ^(...

Retrieve articles from array of category ids

I have an array of category ids and want to retrieve articles from my mysql database with these category ids. What is the best method for this? ...