<?xml version="1.0" encoding="UTF-8" standalone="yes"?><rss version="2.0"><channel><title>Java, PHP, MySQL, Ruby, and more at Sagewire.org</title><link>http://www.sagewire.org/</link><description>Blogs and forums for Java, PHP, MySQL, and more.</description><language>en</language><item><title>Simple image gallery?</title><link>http://www.sagewire.org/php-programming/Simple-image-gallery-1961476.aspx</link><description>Hello

I have been googling for a couple of hours, but still have not found what
I need:
- really simple PHP-based image gallery software. Ideally, just a
single file that I just drop into a directory filled with JPG files
- uses eg. GD to generate thumbnails automagically, and saves them
into a sub-directory for the next time (I do not want thumbnails to be
regenerated every time someone views the pictures)
- as an option, supports slideshow
- free/open-source

Any good recommendati...</description><guid isPermaLink="true">http://www.sagewire.org/php-programming/Simple-image-gallery-1961476.aspx</guid><author>rss@sagewire.org</author><pubDate>Sun, 28 Oct 2007 17:51:41 GMT</pubDate></item><item><title>About Resource id's</title><link>http://www.sagewire.org/php-programming/About-Resource-ids-1998430.aspx</link><description>Hello,

wrote in message and have some questions
related to the resource id's. When a new client connects to the server
or the server opens a file the Resource id number increases normally,
but when the server closes the socket and the file and then a new
client connects or file opens, the Resource id still increases without
reseting to the previous closed id's.

For example:

Client connects to the server...accept();
Client fd: Resource id #1
client quits.... fclose/socket_close
C...</description><guid isPermaLink="true">http://www.sagewire.org/php-programming/About-Resource-ids-1998430.aspx</guid><author>rss@sagewire.org</author><pubDate>Sun, 28 Oct 2007 17:12:06 GMT</pubDate></item><item><title>determine of part of string is uppercase, based on requirements</title><link>http://www.sagewire.org/php-programming/determine-of-part-of-string-is-uppercase-based-on-1998850.aspx</link><description>[code]&amp;lt;?php

$testcase = 'AKLWC139';

    if (ctype_upper($testcase)) {
        echo &amp;quot;The string $testcase consists of all uppercase letters.
\n&amp;quot;;
    } else {
        echo &amp;quot;The string $testcase doesn't consist of all uppercase
letters.\n&amp;quot;;
    }

?&amp;gt;[/code]

This is some code that will check a string and validate if it consists
of all uppercase letters.  I am not too familiar with syntax of PHP as
I am learning, ... can someone please show me a way to make this, so
it dives a li...</description><guid isPermaLink="true">http://www.sagewire.org/php-programming/determine-of-part-of-string-is-uppercase-based-on-1998850.aspx</guid><author>rss@sagewire.org</author><pubDate>Sun, 28 Oct 2007 16:17:11 GMT</pubDate></item><item><title>comp.lang.php</title><link>http://www.sagewire.org/php-programming/complangphp-1996067.aspx</link><description>Hello

I am having trouble making PHP web page that uploads an image file and
moves it to a new file name. The problem occurs when the new filename
already exists.

I am using move_uploaded_file().

The fist time an image file is uploaded and moved to a new file name
there is no problem, however if I decide to upload a different image
file, when the script tries to move this to the same filename (which
is what I want as I want the uploaded file to have a specific name) it
does not wo...</description><guid isPermaLink="true">http://www.sagewire.org/php-programming/complangphp-1996067.aspx</guid><author>rss@sagewire.org</author><pubDate>Sun, 28 Oct 2007 15:35:10 GMT</pubDate></item><item><title>cannot pass query string (GET) vars</title><link>http://www.sagewire.org/php-programming/cannot-pass-query-string-GET-vars-1996301.aspx</link><description>I'm having a very odd issue, that arose this morning after working
fine yesterday...

here's a very simple script:

 1: [code]&amp;lt;?php
 2: $test = $_GET['test'];
 3: echo &amp;quot;Hello&amp;quot; . $test . &amp;quot;&amp;lt;p&amp;gt;[/code]&amp;quot;;
 4: ?&amp;gt;

when called using this URL:

 http://216.244.107.150/info.php?test=me

the code should just output:

 Hello me

but instead the server just hangs, until my browser timesout. If I
remove &amp;quot;?test=me&amp;quot; from the URL, the script works just fine (output:
&amp;quot;Hello &amp;quot;), but for some r...</description><guid isPermaLink="true">http://www.sagewire.org/php-programming/cannot-pass-query-string-GET-vars-1996301.aspx</guid><author>rss@sagewire.org</author><pubDate>Sun, 28 Oct 2007 15:29:32 GMT</pubDate></item><item><title>Paginate from group by</title><link>http://www.sagewire.org/php-programming/Paginate-from-group-by-1999336.aspx</link><description>I'm having some difficulty paginating from  the $_GET variable,
because in this instance the string being passed is of a group by
query (one letter). Currently I'm limiting the results using limit,
Here's what I currently have and it works just fine at displaying, I
just need to add pagination.

[code]&amp;lt;?php

if( !isset( $_GET['title'] ) )
{
    print 'No Record was Selected';
}
else
{
    $query = mysql_query(&amp;quot;SELECT ID,Title FROM table WHERE Title LIKE
'&amp;quot; . $_GET['title'] . &amp;quot;%' L...</description><guid isPermaLink="true">http://www.sagewire.org/php-programming/Paginate-from-group-by-1999336.aspx</guid><author>rss@sagewire.org</author><pubDate>Sun, 28 Oct 2007 14:11:17 GMT</pubDate></item><item><title>filtering xdebug ini keys</title><link>http://www.sagewire.org/php-programming/filtering-xdebug-ini-keys-1999481.aspx</link><description>I have created the following function for returning only ini keys that
pertain to xdebug.  I'm wondering how I might go about doing the same
sort of thing with one or more of the various &amp;quot;array_&amp;quot; functions
instead (e.g. array_filter).  Since I'm working with xdebug (if you
can not tell ;) I will respond in kind with trace data comparing the
functions.

Thanks in advance....George Jempty

  function ini_get_xdebug() {
    $ini_all = ini_get_all();
    $ini_xdebug = array();
    $xdebu...</description><guid isPermaLink="true">http://www.sagewire.org/php-programming/filtering-xdebug-ini-keys-1999481.aspx</guid><author>rss@sagewire.org</author><pubDate>Sun, 28 Oct 2007 13:52:01 GMT</pubDate></item><item><title>Formatting a date with php from a mysql table</title><link>http://www.sagewire.org/php-programming/Formatting-date-with-php-from-mysql-table-1998791.aspx</link><description>Hello
I have date and time in my mysql table in the form
2007-05-03 00:00:00
which I have dispayed on my webpage using
echo $selldatetime
I want to know how I can display it in the form
03-05-2007

Thanks</description><guid isPermaLink="true">http://www.sagewire.org/php-programming/Formatting-date-with-php-from-mysql-table-1998791.aspx</guid><author>rss@sagewire.org</author><pubDate>Sun, 28 Oct 2007 13:27:43 GMT</pubDate></item><item><title>Session or browser problem??</title><link>http://www.sagewire.org/php-programming/Session-or-browser-problem-1999335.aspx</link><description>Hi all,

I have a news website tat is developed on joomla 1.5.Login facility is
done thru a login component.On each page,ther s a 'Log In' link that
redirects them to a login page.On successful login,user details are
set in session as well as cookies and then redirected back to d
referring page.The 'Log In' section changes to 'Welcome user',along
wid a 'Log Out' link.All this works d same in IE 6 as well as in FF
2.The difference comes durin log out action.

In FF,on clickin 'Log Out',...</description><guid isPermaLink="true">http://www.sagewire.org/php-programming/Session-or-browser-problem-1999335.aspx</guid><author>rss@sagewire.org</author><pubDate>Sun, 28 Oct 2007 13:09:52 GMT</pubDate></item><item><title>Is it possible to pass a variable to a PHP script from inside another PHP piece of code?</title><link>http://www.sagewire.org/php-programming/Is-it-possible-to-pass-variable-to-PHP-script-1998851.aspx</link><description>Hi. Sorry for what is perhaps a neophyte question: is it possible to
pass a variable to a PHP script from inside another PHP piece of code?

For instance, the file test.php (which of course resides on a
webserver that supports PHP) is as such:

[some HTML code...]
[code]&amp;lt;?php
echo(&amp;quot;&amp;lt;i&amp;gt;[/code]the variable abc contains &amp;quot; . $_GET['abc'] . &amp;quot;[code]&amp;lt;/i&amp;gt;[/code]&amp;quot;);
?&amp;gt;
[some more HTML code...]

and if I open this file directly i.e. by typing test.php?abc=888 in
the URL line of a web browser,...</description><guid isPermaLink="true">http://www.sagewire.org/php-programming/Is-it-possible-to-pass-variable-to-PHP-script-1998851.aspx</guid><author>rss@sagewire.org</author><pubDate>Sun, 28 Oct 2007 11:40:38 GMT</pubDate></item><item><title>Securing an Email script</title><link>http://www.sagewire.org/php-programming/Securing-an-Email-script-1998739.aspx</link><description>I have changed our web site to use a simple PHP script to send a demo request 
to our sales office.  We use Postfix and everything is set up properly and 
works fine.  I have been informed there are some security issues to review.

The script looks like:

[code]&amp;lt;html&amp;gt;[/code]
[code]&amp;lt;head&amp;gt;[/code][code]&amp;lt;title&amp;gt;[/code]PHP Mail Sender[code]&amp;lt;/title&amp;gt;[/code][code]&amp;lt;/head&amp;gt;[/code]
[code]&amp;lt;body&amp;gt;[/code]
   [code]&amp;lt;?php

/* Pre-defined script variables. */
/* $eol      = &amp;quot;\r\n&amp;quot;; */
   $eol      = &amp;quot;\...</description><guid isPermaLink="true">http://www.sagewire.org/php-programming/Securing-an-Email-script-1998739.aspx</guid><author>rss@sagewire.org</author><pubDate>Sat, 27 Oct 2007 21:16:19 GMT</pubDate></item><item><title>Trouble with AddType application/x-httpd-php .png</title><link>http://www.sagewire.org/php-programming/Trouble-with-AddType-applicationxhttpdphp-png-1997001.aspx</link><description>I'm trying to create the forum favorite dynamic sig image, that's
realy PHP script. I have had moderate success with .php files but when I
change the extension to .png I'm prompted to download the file, rather
than it rendering.

My understanding is that this isn't supposed to happen, and that by
adding an.htaccess file I can force .png files to be compiled/parsed/
whatevered by PHP. In my .htaccess file I have:

AddType application/x-httpd-php .png

Any advice?

I'm using heliohost...</description><guid isPermaLink="true">http://www.sagewire.org/php-programming/Trouble-with-AddType-applicationxhttpdphp-png-1997001.aspx</guid><author>rss@sagewire.org</author><pubDate>Sat, 27 Oct 2007 21:14:24 GMT</pubDate></item><item><title>Need scroller that reads a php file</title><link>http://www.sagewire.org/php-programming/Need-scroller-that-reads-php-file-1998186.aspx</link><description>I need a scroller (JAVA) or whatever that can read a php file and
display it in the script. Does anyone know of any?

I have searched the script sites but did not find anything.</description><guid isPermaLink="true">http://www.sagewire.org/php-programming/Need-scroller-that-reads-php-file-1998186.aspx</guid><author>rss@sagewire.org</author><pubDate>Sat, 27 Oct 2007 19:28:36 GMT</pubDate></item><item><title>mod_rewrite rules for live site</title><link>http://www.sagewire.org/php-programming/modrewrite-rules-for-live-site-1998682.aspx</link><description>* I'm trying to work out some rewrite rules that should do the
following:

case 1: a request to mysite.com:
rewrite http://www.mysite.com/files/sheets.ppt
to http://www.mysite.com/sites/default/files/sheets.ppt

case 1 - n: a request to othersite.com:
rewrite http://www.othersite.com/files/sheets.ppt
to http://www.othersite.com/sites/othersite/files/sheets.ppt

So, if a request comes in to mysite.com, /files/-urls need to be
rewritten do /sites/default/files/sheets/ppt, since mysite ...</description><guid isPermaLink="true">http://www.sagewire.org/php-programming/modrewrite-rules-for-live-site-1998682.aspx</guid><author>rss@sagewire.org</author><pubDate>Sat, 27 Oct 2007 18:25:02 GMT</pubDate></item><item><title>Does a lower php.ini replace an upper php.ini in the directory tree ? Activation in .htaccess necessary ?</title><link>http://www.sagewire.org/php-programming/Does-lower-phpini-replace-an-upper-phpini-in-the-1998320.aspx</link><description>As far as I know I can override the php settings for a certain branch of the whole directory tree
by putting a additional, new php.ini in this directory.

Is this true ?

If I assign in this new php.ini only a new value to 1 (!) php variable are then all the
other php parameter values taken from the next php.ini when I go towards the root of
the directory tree? Or - otherwise - are default built-in values from PHP taken in this case ?

Do I have to do something else to activate this new...</description><guid isPermaLink="true">http://www.sagewire.org/php-programming/Does-lower-phpini-replace-an-upper-phpini-in-the-1998320.aspx</guid><author>rss@sagewire.org</author><pubDate>Sat, 27 Oct 2007 15:02:01 GMT</pubDate></item><item><title>Best solution to tedious form validation?</title><link>http://www.sagewire.org/php-programming/Best-solution-to-tedious-form-validation-1997750.aspx</link><description>I have been working on a membership form for a while, and find it very 
tedious to get an acceptable level of form validation. A web search for 
solutions revealed some home-brewed solutions, such as these:

http://simonwillison.net/2003/Jun/17/theHolyGrail/
http://samuelsjoberg.com/archive/2004/11/form-validation-on-client-and-server

Quoting from the first link, this is my idea of what form validation is 
like from the user's perspective:

   1. The form is displayed; you fill it in....</description><guid isPermaLink="true">http://www.sagewire.org/php-programming/Best-solution-to-tedious-form-validation-1997750.aspx</guid><author>rss@sagewire.org</author><pubDate>Sat, 27 Oct 2007 13:10:55 GMT</pubDate></item><item><title>Dirty Form Error Trapping?</title><link>http://www.sagewire.org/php-programming/Dirty-Form-Error-Trapping-1991339.aspx</link><description>Greetings,

I'm an occasional php/mysql dabbler.

I have a basic data form with a submit button. Unfortunately, it's still 
possible for the user to enter data changes and close the window, 
without clicking the submit button, thus losing the data.

Can someone point me to a generic example of some code that will trap 
and handle this error?</description><guid isPermaLink="true">http://www.sagewire.org/php-programming/Dirty-Form-Error-Trapping-1991339.aspx</guid><author>rss@sagewire.org</author><pubDate>Sat, 27 Oct 2007 12:47:20 GMT</pubDate></item><item><title>Can not login to remote SSH server using ssh2_auth_pubkey_file</title><link>http://www.sagewire.org/php-programming/Can-not-login-to-remote-SSH-server-using-ssh2authp-1997914.aspx</link><description>I'm trying to make use of ssh2_auth_pubkey_file() and login into
remote machine.

I have read somewhere that in order to make that function work I have to
supply it with public key with specific format due to limitation of
libssh2. The public key should look like this: [code]&amp;lt;key_type&amp;gt;[/code]{1 space
character}[code]&amp;lt;key_data&amp;gt;[/code]

Well it still doesn't work even if I change my public key file. Says
&amp;quot;Authentication failed for [code]&amp;lt;user_name&amp;gt;[/code] using public key&amp;quot; Can somebody
h...</description><guid isPermaLink="true">http://www.sagewire.org/php-programming/Can-not-login-to-remote-SSH-server-using-ssh2authp-1997914.aspx</guid><author>rss@sagewire.org</author><pubDate>Sat, 27 Oct 2007 10:09:47 GMT</pubDate></item><item><title>resampling images</title><link>http://www.sagewire.org/php-programming/resampling-images-1998066.aspx</link><description>Hello,

I was wondering if I was missing something simple, an existing
function, that allows me to resample image in size (width and height)
as well as the file size as well.

What I am trying to do is automate importing images and standardize
the saved version to a typical dimension and maximum file sie (80Kb).

I have found numerous scripts for resample the dimensions of an image
but file size seems trickier to find or I'm not looking in the right
places.

Any pointers, help is gr...</description><guid isPermaLink="true">http://www.sagewire.org/php-programming/resampling-images-1998066.aspx</guid><author>rss@sagewire.org</author><pubDate>Sat, 27 Oct 2007 08:34:48 GMT</pubDate></item><item><title>Integration of differential equations in PHP</title><link>http://www.sagewire.org/php-programming/Integration-of-differential-equations-in-PHP-1993239.aspx</link><description>Is there a package of functions to do numerical integration in PHP ?</description><guid isPermaLink="true">http://www.sagewire.org/php-programming/Integration-of-differential-equations-in-PHP-1993239.aspx</guid><author>rss@sagewire.org</author><pubDate>Sat, 27 Oct 2007 08:16:06 GMT</pubDate></item><item><title>send email to me</title><link>http://www.sagewire.org/php-programming/send-email-to-me-1994217.aspx</link><description>Dear All,
I have created a website.
in the contact us page I want to send all information (Entered by
visitor in text boxex) directly to my e-mail address.
to do this I have no idea because I am new to PHP.
thanks in advance
Dev</description><guid isPermaLink="true">http://www.sagewire.org/php-programming/send-email-to-me-1994217.aspx</guid><author>rss@sagewire.org</author><pubDate>Sat, 27 Oct 2007 02:14:35 GMT</pubDate></item><item><title>comparing two XML-&gt;objects</title><link>http://www.sagewire.org/php-programming/comparing-two-XMLobjects-1997997.aspx</link><description>I'm getting data from an XML file using this method:

$name = $xml-&amp;gt;user_info-&amp;gt;user['name'];
$nickname = $xml-&amp;gt;user_info-&amp;gt;user['nickname'];

&amp;amp;

$age = $xml-&amp;gt;user_info-&amp;gt;user['age'];
$shoe_size = $xml-&amp;gt;user_info-&amp;gt;user['show_size'];

I want to compare name &amp;amp; nickname, and age &amp;amp; shoe_size, but I can not
figure out how, as all 4 are objects.

Basically I want to know if age &amp;gt; show_size or name == nickname.

How'd I do that?

I tried:
if ($age &amp;gt; $shoesize)
{
  echo &amp;quot;age is higher&amp;quot;;...</description><guid isPermaLink="true">http://www.sagewire.org/php-programming/comparing-two-XMLobjects-1997997.aspx</guid><author>rss@sagewire.org</author><pubDate>Fri, 26 Oct 2007 23:27:39 GMT</pubDate></item><item><title>Cant figure out ajax/php problem.</title><link>http://www.sagewire.org/php-programming/Cant-figure-out-ajaxphp-problem-1991064.aspx</link><description>Here's my issue: I have an instant messenger type feature for my site, its 
basically an ajax IM feature. I run with a mysql backend on the site, I have 
a div on my main page that runs a JAVAscript timer to load the php page via 
ajax every 15 seconds which checks the &amp;quot;pinguser&amp;quot; table to see if the user 
has any chat requests, then echoes them to a div on the page. what I REALLY 
want to do is have the ajax page see if there is a ping for the user, and if 
so, pop up a JAVAscript alert or...</description><guid isPermaLink="true">http://www.sagewire.org/php-programming/Cant-figure-out-ajaxphp-problem-1991064.aspx</guid><author>rss@sagewire.org</author><pubDate>Fri, 26 Oct 2007 19:04:12 GMT</pubDate></item><item><title>WordPress question....</title><link>http://www.sagewire.org/php-programming/WordPress-question-1992891.aspx</link><description>hi expert php'ers.....;)

is it ok to ask WordPress questions here?  I mean if you do not get a 
response to your quetion in WP forums where else can you go??
I have WP 2.3 installed on my own hosting server..
I'm tying to do something that should be quite simple yet I can not get it 
to work...

I want to do my own form, w/o having to use a plugin.. I tried a contact 
plugin, but you can not specify what address to send email to, which 
renders the plugin pretty useless..  in readme f...</description><guid isPermaLink="true">http://www.sagewire.org/php-programming/WordPress-question-1992891.aspx</guid><author>rss@sagewire.org</author><pubDate>Fri, 26 Oct 2007 17:22:06 GMT</pubDate></item><item><title>PHP to Fax</title><link>http://www.sagewire.org/php-programming/PHP-to-Fax-1986477.aspx</link><description>So I know I can fax from my computer so I'm guessing there is a way to
get PHP to fax.

I have a program that allows for a customer to be emailed or faxed
certain information.

If PHP can not do this maybe you know whether ASP or asp.net can do it.
But basically I just want to click a button and have it fax...</description><guid isPermaLink="true">http://www.sagewire.org/php-programming/PHP-to-Fax-1986477.aspx</guid><author>rss@sagewire.org</author><pubDate>Fri, 26 Oct 2007 16:53:49 GMT</pubDate></item><item><title>free tool to encrypt php?</title><link>http://www.sagewire.org/php-programming/free-tool-to-encrypt-php-1983532.aspx</link><description>Hi
   Any free tool I can use to encrypt my php source code?
thanks
from Peter (cmk128@xxxxxxxxxxx)</description><guid isPermaLink="true">http://www.sagewire.org/php-programming/free-tool-to-encrypt-php-1983532.aspx</guid><author>rss@sagewire.org</author><pubDate>Fri, 26 Oct 2007 15:45:30 GMT</pubDate></item><item><title>Is it Daylight Savings Time ?</title><link>http://www.sagewire.org/php-programming/Is-it-Daylight-Savings-Time-1995827.aspx</link><description>I found out that I can only set an offset in my session timezone 
in my ISP's MySQL server, not a timezone.  So I am left with the 
task of setting the offset, which will vary, depending on whether 
or not DST is in effect.

Is there a way of discovering, from a PHP script is we are in DST 
or standard time ?

bill</description><guid isPermaLink="true">http://www.sagewire.org/php-programming/Is-it-Daylight-Savings-Time-1995827.aspx</guid><author>rss@sagewire.org</author><pubDate>Fri, 26 Oct 2007 13:26:02 GMT</pubDate></item><item><title>Include Problem ?</title><link>http://www.sagewire.org/php-programming/Include-Problem-1996911.aspx</link><description>Why does thisn't work ?

$fileDir = '../folder2/';
$content is an array of php files, file1.php file2.php file3.php
etc...

$c = count($content);
for( $x=0; $x&amp;lt;$c; $x++ ){
   include( $fileDir.$content[$x] );
}

any ideas'd be appreciated,
thanks.
Xav</description><guid isPermaLink="true">http://www.sagewire.org/php-programming/Include-Problem-1996911.aspx</guid><author>rss@sagewire.org</author><pubDate>Fri, 26 Oct 2007 11:18:27 GMT</pubDate></item><item><title>php regular expression does not match</title><link>http://www.sagewire.org/php-programming/php-regular-expression-does-not-match-1993855.aspx</link><description>Hi
   PHP's regular expression look like does not support .*? syntax. So I 
cannot match the shortest match. For exmaple:

$str=&amp;quot;a1b a3b&amp;quot;;
$str1=ereg_replace(&amp;quot;a.*b&amp;quot;, &amp;quot;peter&amp;quot;, $str1);
will produce &amp;quot;peter&amp;quot;, but I want &amp;quot;peter peter&amp;quot;, so how to?

thanks
from Peter (cmk128@xxxxxxxxxxx)</description><guid isPermaLink="true">http://www.sagewire.org/php-programming/php-regular-expression-does-not-match-1993855.aspx</guid><author>rss@sagewire.org</author><pubDate>Fri, 26 Oct 2007 09:31:35 GMT</pubDate></item><item><title>file_get_contents outputs nothing</title><link>http://www.sagewire.org/php-programming/filegetcontents-outputs-nothing-1996065.aspx</link><description>Hi everyone,

The output of

echo file_get_contents(&amp;quot;http://watchout4snakes.com/creativitytools/
RandomWord/RandomWordPlus.aspx&amp;quot;);

leaves the browser empty.. no error messages, nothing.

Why is this occurring?

Thanks

Taras</description><guid isPermaLink="true">http://www.sagewire.org/php-programming/filegetcontents-outputs-nothing-1996065.aspx</guid><author>rss@sagewire.org</author><pubDate>Fri, 26 Oct 2007 04:59:36 GMT</pubDate></item><item><title>copy of object is a reference in PHP5</title><link>http://www.sagewire.org/php-programming/copy-of-object-is-reference-in-PHP5-1996302.aspx</link><description>Can someone please explain the results below
We switched to PHP 5
if I make a copy of an object, and then change the variable inside the
object the change is reflected in the copy.

Either the copy is a reference to the object or the variable inside
the object is a static variable, I'm not sure what is going on, but It
does not seem like it should be doing that. Is that because of a
setting on the server or  something ?

[code]&amp;lt;?$label=new myObj();
$label-&amp;gt;[/code]settext('the text');...</description><guid isPermaLink="true">http://www.sagewire.org/php-programming/copy-of-object-is-reference-in-PHP5-1996302.aspx</guid><author>rss@sagewire.org</author><pubDate>Fri, 26 Oct 2007 04:58:20 GMT</pubDate></item><item><title>efree cause errors during resource de-allocation</title><link>http://www.sagewire.org/php-programming/efree-cause-errors-during-resource-deallocation-1983251.aspx</link><description>I'm developing small extension that deals with resources. If I use
emalloc/efree for allocating freeing resource data I get random memory
corruption errors. If I replace emalloc/efree with malloc/free,
everything works fine. At least there are no errors produced. I'm
using PHP 4.4.8/Zend Engine 1.3.0/no any optimiser.

-------- myext.c ------
static int le_connections;

struct myconn {
  ...
}

static void _close_connection(zend_rsrc_list_entry *rsrc TSRMLS_DC)
{
  struct myconn *...</description><guid isPermaLink="true">http://www.sagewire.org/php-programming/efree-cause-errors-during-resource-deallocation-1983251.aspx</guid><author>rss@sagewire.org</author><pubDate>Fri, 26 Oct 2007 03:54:23 GMT</pubDate></item><item><title>Problem reading/writing sockets</title><link>http://www.sagewire.org/php-programming/Problem-readingwriting-sockets-1994596.aspx</link><description>I have been trying to put together an application to change channel on a
media streaming server.  The server is able to issue IR commands to
its attached equipment using LIRC, with commands being issued by a
socket connection to TCP/8765.

I put together a basic Python app that issued a command, which worked
fine.  I wanted to create a fairly simple web interface and so set
about producing a similar simple PHP application.  I have had limited
success so far, with the media server rejecti...</description><guid isPermaLink="true">http://www.sagewire.org/php-programming/Problem-readingwriting-sockets-1994596.aspx</guid><author>rss@sagewire.org</author><pubDate>Fri, 26 Oct 2007 03:43:09 GMT</pubDate></item><item><title>Regex help for email</title><link>http://www.sagewire.org/php-programming/Regex-help-for-email-1984192.aspx</link><description>Hi

I need a regex code for parsing this string to an email array

 &amp;quot;mnp test&amp;quot; [code]&amp;lt;celo@xxxxxxxxxxx&amp;gt;[/code],&amp;quot;test testt&amp;quot;
[code]&amp;lt;otur@xxxxxxxxxxx&amp;gt;[/code],sett@xxxxxxxxxxx,test@xxxxxxxxxxx

thanks</description><guid isPermaLink="true">http://www.sagewire.org/php-programming/Regex-help-for-email-1984192.aspx</guid><author>rss@sagewire.org</author><pubDate>Thu, 25 Oct 2007 23:56:15 GMT</pubDate></item><item><title>Using PHP to send a fax?</title><link>http://www.sagewire.org/php-programming/Using-PHP-to-send-fax-1984846.aspx</link><description>Hi,

I'm using PHP 4.4.4 with MySQL 5.0.  Does anyone have any experience
and/or recommendations about PHP libraries to use that will allow one
to send a fax from our servers?  The fax'd contain order receipt
information from a sale.

Thanks, - Dave</description><guid isPermaLink="true">http://www.sagewire.org/php-programming/Using-PHP-to-send-fax-1984846.aspx</guid><author>rss@sagewire.org</author><pubDate>Thu, 25 Oct 2007 21:40:12 GMT</pubDate></item><item><title>anyone know this error msg?</title><link>http://www.sagewire.org/php-programming/anyone-know-this-error-msg-1996400.aspx</link><description>&amp;quot;PHP has encountered an Access Violation at 01C21255&amp;quot;

I'm running a very simple script, that fails when I run it, though
other seem to be able to use it (see this thread:
http://groups.google.com/group/comp.lang.php/browse_thread/thread/4b5602c289865a7d/#)

when I run via Firefox, initially I see the above error msg, then I
get the Firefox standard &amp;quot;The connection was reset&amp;quot; message.</description><guid isPermaLink="true">http://www.sagewire.org/php-programming/anyone-know-this-error-msg-1996400.aspx</guid><author>rss@sagewire.org</author><pubDate>Thu, 25 Oct 2007 20:54:37 GMT</pubDate></item><item><title>why is the $_POST variable empty?</title><link>http://www.sagewire.org/php-programming/why-is-the-POST-variable-empty-1996066.aspx</link><description>Hi everyone,

I'm trying to get the code found at http://www.inventory-management.org/
up and running. So far I have created the database, edited the
configuration files to include the database information, renamed the
fputcsv function to f_put_csv. I'm trying to log into the page by
using the suggested user/pass of admin/test. However, I can see by
placing var_dump($_POST) at the top of index.php, that when I submit
the form no data is in the $_POST array?!

When the action is changed...</description><guid isPermaLink="true">http://www.sagewire.org/php-programming/why-is-the-POST-variable-empty-1996066.aspx</guid><author>rss@sagewire.org</author><pubDate>Thu, 25 Oct 2007 18:48:08 GMT</pubDate></item><item><title>Seeking beta-testers for a new reportingtool</title><link>http://www.sagewire.org/php-programming/Seeking-betatesters-for-new-reportingtool-1994709.aspx</link><description>L.S.,

I'm in the process of wraping up a 0.9-version of a new reporting-tool
I have been developping for the past months. I want to invite 2 or 3
people to beta-test this new, exciting tool!

My tool is class-based. (ie: you need to be able to use classes, so if
you do not know OOP 1) please learn, you will love it! 2) do not try to
test my new tool :-) )
The users I have in mind are PHP-programmers that create online
applications. (Not CMS'ses, that won't be of much use.) I'd like
m...</description><guid isPermaLink="true">http://www.sagewire.org/php-programming/Seeking-betatesters-for-new-reportingtool-1994709.aspx</guid><author>rss@sagewire.org</author><pubDate>Thu, 25 Oct 2007 18:21:13 GMT</pubDate></item><item><title>General Advice - objects, classes and coding style</title><link>http://www.sagewire.org/php-programming/General-Advice-objects-classes-and-coding-style-1994965.aspx</link><description>I am in the process of transforming a procedural code base into an OO 
code base. The code lends itself to this refactoring and it is proving 
an effective exercise.

However, I am running into a few irritations.

I am using __autoload to load class files corresponding to code names.

I have cranked up error reporting, but if for some reason there is a 
syntax error or whatever in a class, the application crashes with no 
explanation. The bug hunt takes ages and lots of echoing.

Is ...</description><guid isPermaLink="true">http://www.sagewire.org/php-programming/General-Advice-objects-classes-and-coding-style-1994965.aspx</guid><author>rss@sagewire.org</author><pubDate>Thu, 25 Oct 2007 17:53:19 GMT</pubDate></item><item><title>Screen Res Question</title><link>http://www.sagewire.org/php-programming/Screen-Res-Question-1992755.aspx</link><description>Guys

Is there a way to capture via an environment variable the users screen res

Steve</description><guid isPermaLink="true">http://www.sagewire.org/php-programming/Screen-Res-Question-1992755.aspx</guid><author>rss@sagewire.org</author><pubDate>Thu, 25 Oct 2007 17:37:58 GMT</pubDate></item><item><title>What does @xxxxxxxxxxx do?</title><link>http://www.sagewire.org/php-programming/What-does-xxxxxxxxxxx-do-1994964.aspx</link><description>I am new to php and google does not allow for searching on the @xxxxxxxxxxx
symbol.

I have a script with the following line:

if (@xxxxxxxxxxx$type_toggle || @xxxxxxxxxxx) {
do_query........

What does the @xxxxxxxxxxx do?  Can you give me a link so I can read about it.

Thanks!</description><guid isPermaLink="true">http://www.sagewire.org/php-programming/What-does-xxxxxxxxxxx-do-1994964.aspx</guid><author>rss@sagewire.org</author><pubDate>Thu, 25 Oct 2007 15:17:18 GMT</pubDate></item><item><title>Why is "include" printing my code instead of executing it?</title><link>http://www.sagewire.org/php-programming/Why-is-include-printing-my-code-instead-of-executi-1994828.aspx</link><description>Hi,

I'm using PHP 4.4.4 with Apache 2 on Fedora Linux.  I have a page,
which contains (roughly)

        $sub_cat_name_arr = split(&amp;quot;,&amp;quot;,
trim($_REQUEST[PROD_SUB_CATEGORIES_ID_PARAM]));
        foreach ($sub_cat_name_arr as $sub_cat_name) {
                /* Processing */

                include(&amp;quot;add_product_response.inc&amp;quot;);
        }   // foreach

        header(&amp;quot;confirmation.html&amp;quot;);

But what is happening is that the contents of
&amp;quot;add_product_response.inc&amp;quot; (which only contain PH...</description><guid isPermaLink="true">http://www.sagewire.org/php-programming/Why-is-include-printing-my-code-instead-of-executi-1994828.aspx</guid><author>rss@sagewire.org</author><pubDate>Thu, 25 Oct 2007 15:04:18 GMT</pubDate></item><item><title>know when user tries to access php file</title><link>http://www.sagewire.org/php-programming/know-when-user-tries-to-access-php-file-1995068.aspx</link><description>is there a way to detect if a user tries to access a php file?

For instance, db.config.php is called in many php pages but should
never actually be open directly.  Is there a way to know if someone
tried to open it directly?

Also, I want to learn more about securing php/MySQL pages any good
resources I should start with?

Thank you,

Daniel</description><guid isPermaLink="true">http://www.sagewire.org/php-programming/know-when-user-tries-to-access-php-file-1995068.aspx</guid><author>rss@sagewire.org</author><pubDate>Thu, 25 Oct 2007 09:35:22 GMT</pubDate></item><item><title>Optimization of mySQL to XML output...</title><link>http://www.sagewire.org/php-programming/Optimization-of-mySQL-to-XML-output-1994595.aspx</link><description>I'm trying to print out a table of mySQL data as XML. However, the
performance I'm getting is REALY bad. Adding the header(&amp;quot;Content-Type:
$mime;charset=$charset&amp;quot;); statement triples the load time of the data
for example. Can someone with more php experience then I look this
over and tell me that I'm stupid and doing it wrong?

define( &amp;quot;DATABASE_SERVER&amp;quot;, &amp;quot;localhost&amp;quot; );
define( &amp;quot;DATABASE_USERNAME&amp;quot;, &amp;quot;root&amp;quot; );
define( &amp;quot;DATABASE_PASSWORD&amp;quot;, &amp;quot;&amp;quot; );
define( &amp;quot;DATABASE_NAME&amp;quot;, &amp;quot;mydatabase&amp;quot; );

$m...</description><guid isPermaLink="true">http://www.sagewire.org/php-programming/Optimization-of-mySQL-to-XML-output-1994595.aspx</guid><author>rss@sagewire.org</author><pubDate>Thu, 25 Oct 2007 03:14:19 GMT</pubDate></item><item><title>Question About Regular Expression</title><link>http://www.sagewire.org/php-programming/Question-About-Regular-Expression-1993132.aspx</link><description>Hello guys, I am primarily an asp.net programmer, but lately I have been
doing some work with Apache, MySQL and PHP.

Anyways, I have a question that I posted in the microsoft asp.net
newsgroup. Thus far no one there has been able to answer it. I feel
some of you may know the answer, and that's why I'm posting it here...

I have a web app with two textboxes. The first textbox allows users to
type in various text, html tags and CSS. The second textbox, on post
back, will display/markup t...</description><guid isPermaLink="true">http://www.sagewire.org/php-programming/Question-About-Regular-Expression-1993132.aspx</guid><author>rss@sagewire.org</author><pubDate>Wed, 24 Oct 2007 21:25:46 GMT</pubDate></item><item><title>update/requery db</title><link>http://www.sagewire.org/php-programming/updaterequery-db-1994457.aspx</link><description>Hello,

I have setup a table with 1 row and 2 columns.In the 1st, I have a
iframe that displays tons thumbnails of images.  In the next I have an
image (enlarged).  When the user selects a thumbnail it displays the
enlarged image in the 2nd column.  This work quite nicely.

Where I need some help is with the fact that each image has an entry
(description in a database table).  How can I display the entry when
the image is updated.  The image gets updated using JAVAscript but the
page i...</description><guid isPermaLink="true">http://www.sagewire.org/php-programming/updaterequery-db-1994457.aspx</guid><author>rss@sagewire.org</author><pubDate>Wed, 24 Oct 2007 21:08:40 GMT</pubDate></item><item><title>sums, averages stuff help</title><link>http://www.sagewire.org/php-programming/sums-averages-stuff-help-1994594.aspx</link><description>Hey people, I need to do some sistem in PHP and MySQL, I have do it a
part but the other is the problem, basically is mathemetical
operations, te user register something and after insert some registry
and after is needed obtain sums, averages and something similar, does
anyone have some code similar for read about??

kisses, Elena</description><guid isPermaLink="true">http://www.sagewire.org/php-programming/sums-averages-stuff-help-1994594.aspx</guid><author>rss@sagewire.org</author><pubDate>Wed, 24 Oct 2007 20:05:22 GMT</pubDate></item><item><title>How to fit text to a [code]&lt;DIV&gt;[/code]/[code]&lt;SPAN&gt;[/code] of width X px / height Y px</title><link>http://www.sagewire.org/php-programming/How-to-fit-text-to-codeDIVcodecodeSPANcode-of-widt-1994593.aspx</link><description>I have a [code]&amp;lt;span&amp;gt;[/code] of width X px and height Y px. I want to read the text
of an article, which is stored in a mySQL table, and pass to that
[code]&amp;lt;span&amp;gt;[/code] only just enough text to fit in it, along with a 'read more'
hyperlink which will take the user to the full article. I don't want
any overflow scroll bars to show. The font-size is set by external
stylesheet in em's.

How can I determine how much text is enough?

Approaches I have thought of:

-just set a semi-arbitra...</description><guid isPermaLink="true">http://www.sagewire.org/php-programming/How-to-fit-text-to-codeDIVcodecodeSPANcode-of-widt-1994593.aspx</guid><author>rss@sagewire.org</author><pubDate>Wed, 24 Oct 2007 17:52:38 GMT</pubDate></item><item><title>Parameters in PHP</title><link>http://www.sagewire.org/php-programming/Parameters-in-PHP-1992892.aspx</link><description>I have down-loaded several php scripts and am working my way through them 
as part of my learning process. I  haven'ticed situations like this:

mysql_query(&amp;quot;DELETE FROM $table WHERE id=$id&amp;quot;,$db);

where scripts have been called from another script/page with a parameter - 
i.e. 'id' is a parameter that isn't defined in the script before the 
above line is called.

They do not work as they are but I can get the parameters by using 
$_GET['id'] or sometimes $_POST['id'].

Is this a res...</description><guid isPermaLink="true">http://www.sagewire.org/php-programming/Parameters-in-PHP-1992892.aspx</guid><author>rss@sagewire.org</author><pubDate>Wed, 24 Oct 2007 17:12:26 GMT</pubDate></item><item><title>register_globals on / off - I think I'm missing the point</title><link>http://www.sagewire.org/php-programming/registerglobals-on-off-think-Im-missing-the-point-1994127.aspx</link><description>I understand that register_globals was turned off by default as, unless 
you initialised it, it could be altered by a malicious coder.

What I do not understand is how the $_POST['foo'] form is any more 
secure.  Surely Mr Malicious Coder can still just send his own version 
of $_POST['foo']?

Obviously I'm missing something, I just can not figure out what!

+mrcakey</description><guid isPermaLink="true">http://www.sagewire.org/php-programming/registerglobals-on-off-think-Im-missing-the-point-1994127.aspx</guid><author>rss@sagewire.org</author><pubDate>Wed, 24 Oct 2007 14:45:08 GMT</pubDate></item></channel></rss>