OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
php-general Digest 10 Sep 2003 16:26:52 -0000 Issue 2289

php-general-digest-helplists.php.net
Date: Wed Sep 10 2003 - 11:26:52 CDT


php-general Digest 10 Sep 2003 16:26:52 -0000 Issue 2289

Topics (messages 162138 through 162194):

Re: ereg_replace vs. preg_replace [was: str_replace question]
        162138 by: Curt Zirzow
        162175 by: Wouter van Vliet

Re: SID set or unset?
        162139 by: Curt Zirzow
        162152 by: Ford, Mike [LSS]

Re: yahoo messeger scrpt php
        162140 by: RoyD.bercacakra.com
        162143 by: Curt Zirzow
        162148 by: David Otton

Re: Try/Catch
        162141 by: Curt Zirzow

Re: Session Variables in a Class
        162142 by: Curt Zirzow
        162146 by: micro brew
        162169 by: CPT John W. Holmes

Re: Encrypt/Serialize Source Code for Sale
        162144 by: Adrian Teasdale

[Newbie Guide] For the benefit of new members
        162145 by: tech.leatherlink.net

Re: Validating Subdomain E-mail Addresses Using Regular Expressions
        162147 by: Ivo Fokkema

Messages for groupphp.net are in pending
        162149 by: Gibier Jean-Charles

Re: Installing PHP with MySQL RPM version
        162150 by: Marek Kilimajer

Re: Setting execution time for a loop
        162151 by: zavaboy
        162153 by: Ford, Mike [LSS]
        162155 by: zavaboy
        162156 by: Ford, Mike [LSS]
        162157 by: zavaboy

Re: A complete EXIF extension?
        162154 by: Marek Kilimajer
        162174 by: Greg Militello
        162179 by: Greg Militello
        162184 by: Marek Kilimajer

Re: str_replace question
        162158 by: SLanger.spirit21.de

PHP configure error
        162159 by: Mark McCulligh
        162161 by: Marek Kilimajer
        162164 by: Mark McCulligh
        162168 by: Mark McCulligh

Re: maillist php manger/interface
        162160 by: Marek Kilimajer

SQL not returning entire field
        162162 by: Christopher J. Crane
        162167 by: Christophe Chisogne
        162171 by: Christopher J. Crane

Re: Multiple Forms
        162163 by: Matthew Vos

WDDX Module for PHP
        162165 by: Rubal

Variable Overloading or Replacement (long)
        162166 by: Jay Blanchard
        162172 by: Raditha Dissanayake

session_set_save_handler
        162170 by: Chris Boget

Memory leak in PHP 5 / ODBC?
        162173 by: chris.neale.somerfield.co.uk

Re: divide
        162176 by: CPT John W. Holmes

How to access a program outside of PHP?
        162177 by: Adam Douglas
        162178 by: Raditha Dissanayake
        162180 by: CPT John W. Holmes
        162183 by: Adam Douglas
        162185 by: Adam Douglas
        162187 by: Raditha Dissanayake
        162188 by: Marek Kilimajer
        162190 by: Adam Douglas
        162193 by: Raditha Dissanayake

executing shell commands.
        162181 by: Sethi, Samir (IDS DM&DS)
        162186 by: Douglas Douglas
        162189 by: Curt Zirzow

Issues with exec()/system()
        162182 by: Tom Ray [List]
        162192 by: Curt Zirzow

PHP-General List post bounces???
        162191 by: Adam Douglas
        162194 by: Curt Zirzow

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscribelists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscribelists.php.net

To post to the list, e-mail:
        php-generallists.php.net

----------------------------------------------------------------------

attached mail follows:


* Thus wrote Wouter van Vliet (wouteresctoday.com):
>
> Btw, does anybody know why preg_replace is adviced over ereg_replace in the
> manual? .. and if ereg_replace doesn't have any advantages over
> preg_replace, couldn't this function get depricated?

I've done some testing with ereg and preg functions and
preg beats ereg by quite a bite (sorry don't have results)

preg is much more advanced and can do a lot more things than ereg
can. I think just by looking at the documentation (two separate
pages, not related to the functions), you can see that it is rather
thorough.

The biggest disadvantage with preg is that since it is complex,
mistakes can easily be overlooked.

Only since 4.2.0 has preg_* functions been compiled by default so
if a person wanted to write scripts that were portable across many
different hosting sites they would use ereg_* functions.

As for being deprecated, I doubt that will happen (as
mentioned above) ereg_* has been around for many years, since early
3.x versions. Php developers may be familiar with the posix syntax
so instead of learning the perl version they have the option to use
the ereg_* functions.

Although I haven't heard any (php) claims as such but some people may want
to be 100% POSIX compatible :)
 

Curt
--
"I used to think I was indecisive, but now I'm not so sure."

attached mail follows:


thanks, that pretty much cleared things up..

 -> -----Oorspronkelijk bericht-----
 -> Van: Curt Zirzow [mailto:php-generalzirzow.dyndns.org]
 -> Verzonden: woensdag 10 september 2003 6:30
 -> Aan: php-generallists.php.net
 -> Onderwerp: Re: [PHP] ereg_replace vs. preg_replace [was: str_replace
 -> question]
 ->
 ->
 -> * Thus wrote Wouter van Vliet (wouteresctoday.com):
 -> >
 -> > Btw, does anybody know why preg_replace is adviced over
 -> ereg_replace in the
 -> > manual? .. and if ereg_replace doesn't have any advantages over
 -> > preg_replace, couldn't this function get depricated?
 ->
 -> I've done some testing with ereg and preg functions and
 -> preg beats ereg by quite a bite (sorry don't have results)
 ->
 -> preg is much more advanced and can do a lot more things than ereg
 -> can. I think just by looking at the documentation (two separate
 -> pages, not related to the functions), you can see that it is rather
 -> thorough.
 ->
 -> The biggest disadvantage with preg is that since it is complex,
 -> mistakes can easily be overlooked.
 ->
 -> Only since 4.2.0 has preg_* functions been compiled by default so
 -> if a person wanted to write scripts that were portable across many
 -> different hosting sites they would use ereg_* functions.
 ->
 -> As for being deprecated, I doubt that will happen (as
 -> mentioned above) ereg_* has been around for many years, since early
 -> 3.x versions. Php developers may be familiar with the posix syntax
 -> so instead of learning the perl version they have the option to use
 -> the ereg_* functions.
 ->
 -> Although I haven't heard any (php) claims as such but some
 -> people may want
 -> to be 100% POSIX compatible :)
 ->
 ->
 -> Curt
 -> --
 -> "I used to think I was indecisive, but now I'm not so sure."
 ->
 -> --
 -> PHP General Mailing List (http://www.php.net/)
 -> To unsubscribe, visit: http://www.php.net/unsub.php
 ->

attached mail follows:


* Thus wrote Jean-Christian IMbeault (jcmega-bucks.co.jp):
> Is the PHP constant SID always defined? I have found conflicting answer
> in the documentation. One page of the docs says it is always defined
> while another says it is defined only if the right cookie hasn't been
> passed to the server.
>
> Also how can I check if the SID is set or not?
>
> I have tried the following but get an error:
>
> <?php
> if (isset(SID)) {}
> ?>
> Parse error: parse error, expecting `T_VARIABLE' or `'$''

SID is a constant, only variables can be tested with isset().
  http://php.net/isset

What you want is defined()
  http://php.net/defined

ie:
if (defined('SID')) {}

Curt
--
"I used to think I was indecisive, but now I'm not so sure."

attached mail follows:


On 10 September 2003 04:42, Jean-Christian IMbeault contributed these pearls
of wisdom:

> Is the PHP constant SID always defined? I have found
> conflicting answer
> in the documentation. One page of the docs says it is always
> defined while another says it is defined only if the right
> cookie hasn't been passed to the server.

H'mm, yes, the wording could be tidies up a little. SID is always defined
if there is a session active -- however, it will be defined to be the empty
string if the correct cookie is passed. This way, you can unconditionally
use SID, without needing to check whether it exists, in appropriate places.
 
> Also how can I check if the SID is set or not?
>
> I have tried the following but get an error:
>
> <?php
> if (isset(SID)) {}
>>
> Parse error: parse error, expecting `T_VARIABLE' or `'$''

isset() only works on variables, and SID is a constant -- use defined()
instead. But, as I've pointed out above, you shouldn't really ever have a
need to do this.

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.fordlmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211

attached mail follows:


Roy Daniel , ST , IT Application Support & Development Engineer PT
BERCA COMPUTEL

roydbercacakra.com // roy_daniel91yahoo.com

ICQ : # 103507581 / Handphone : +62-8161192832 / yahoo_messeger :
roy_daniel91

                                                                                           
                    Roy Daniel
                                         To: Dasmeet <phpdomainwala.com>
                    09/10/2003 cc: php-generallists.php.net
                    11:37 AM Subject: yahoo messeger scrpt php(Document
                                         link: Roy Daniel)
                                                                                           

dear all how to created the script in php / html , that someone knows that
another people online / off line in yahoo messeger in page ?

thank you all ..

Roy Daniel , ST , IT Application Support & Development Engineer PT
BERCA COMPUTEL

roydbercacakra.com // roy_daniel91yahoo.com

ICQ : # 103507581 / Handphone : +62-8161192832 / yahoo_messeger :
roy_daniel91

                                                                                            
                    Dasmeet
                    <phpdomainwal To: php-generallists.php.net
                    a.com> cc:
                                         Subject: [PHP] Cpanel or Plesk
                    09/07/2003
                    01:28 AM
                                                                                            
                                                                                            

Hi!
I guess many of you must have used both CPanel and Plesk. Can you tell
me which one is better and what are the basic differences between them?
Also can accounts hosted on WHM/CPanel moved to Plesk?
Any information would be of great help.
Thanks in advance!
Dasmeet

--
--
Domainwala.com
Domain Names from Rs. $7.99 at http://www.domainwala.com
http://www.domainwala.com/headlines/index.php
http://www.domainwala.com/links

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

attached mail follows:


* Thus wrote RoyDbercacakra.com (RoyDbercacakra.com):
> [...snip blank lines...]
>
> Roy Daniel , ST , IT Application Support & Development Engineer PT
> BERCA COMPUTEL
>
>
> roydbercacakra.com // roy_daniel91yahoo.com
>

What is all this in the beginning of your email?

> [...snip more unnecessary lines...]
>
>
> dear all how to created the script in php / html , that someone knows that
> another people online / off line in yahoo messeger in page ?

Research the YMSG protocol.

> [... snip some more lines not needed ...]
> Subject: [PHP] Cpanel or Plesk
> [... and some more ...]
>
> Hi!
> I guess many of you must have used both CPanel and Plesk. Can you tell
> [.. final clip...]

and what does this have to do with Cpanel or Plesk?

Curt
--
"I used to think I was indecisive, but now I'm not so sure."

attached mail follows:


On Wed, 10 Sep 2003 11:40:14 +0700, you wrote:

>dear all how to created the script in php / html , that someone knows that
>another people online / off line in yahoo messeger in page ?

You just need to pick up an image from Yahoo:

http://opi.yahoo.com/online?u=YahooID

attached mail follows:


* Thus wrote -- (edurmacielyahoo.com.br):
> Hello Jay,
>
> Yes, I´m running PHP5.
> And in my code you can see that the exception is
> throwed in an a call to a methode from an aggregated
> object in a suclassed one ($this->curl->GET()). The
> GET() methode throws the excpetion if curl_exec
> returns an error.
>
> But one would expect that the exception should be
> caught after this call returns. Wouldn´t ????

the try/catch appears to be under heavy development right now. I'm
not very familiar with try/catch programming but if this is what is
expected.

I would suggest for you to see if this is mentioned at
http://bugs.php.net and if it isn't report it.

HTH,

Curt
--
"I used to think I was indecisive, but now I'm not so sure."

attached mail follows:


* Thus wrote Curt Zirzow (php-generalzirzow.dyndns.org):
> * Thus wrote micro brew (microbrewclubyahoo.com):
> > Hi everyone,
> >
> > I've been experimenting with sessions. I can make
> > them work just fine in a normal PHP page. But when I
> > create a class and try to define a session variable
> > within a method in the class it won't work. I've
> > tried setting the session variable directly
> > ($_SESSION['name']='somevalue') but that didn't work.
> > The normal way of setting it -
> > session_start();
> > session_register('name');
> > $name='somevalue';
>
> You might want to read
> http://php.net/session
>
> You are most likley running into a register_globals issue.
>
> A couple things to note:
>
> . You must not mix $_SESSION[] access with session_register()
> anywhere in your script.
>
> . When you issue session_register('name') inside your class it is
> declaring the global var $name as a session var, not the $name in
> your script.
         ^^^^^^

should be 'function'

Curt
--
"I used to think I was indecisive, but now I'm not so sure."

attached mail follows:


Thanks Curt,

You were absolutely correct. Removing the
session_register() lines before the $_SESSION[] fixed
the problem. By mixing the two before, it actually
would register the variable so I could later test for
the registered session variable but it did not retain
the value I assigned it. Thanks again for the help.

Mike

>* Thus wrote micro brew (microbrewclubyahoo.com):
>> Hi everyone,
>>
>> I've been experimenting with sessions. I can make
>> them work just fine in a normal PHP page. But when
I
>> create a class and try to define a session variable
>> within a method in the class it won't work. I've
>> tried setting the session variable directly
>> ($_SESSION['name']='somevalue') but that didn't
work.
>> The normal way of setting it -
>> session_start();
>> session_register('name');
>> $name='somevalue';
>
>You might want to read
> http://php.net/session
>
>You are most likley running into a register_globals
>issue.
>
>A couple things to note:
>
> . You must not mix $_SESSION[] access with
>session_register()
> anywhere in your script.
>
> . When you issue session_register('name') inside
>your class it is
> declaring the global var $name as a session var,
not >the $name in
> your script.
>
>
>
>Curt

__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

attached mail follows:


From: "micro brew" <microbrewclubyahoo.com>

> Here's my class. I start the session in the
> constructor and in later methods attempt to register
> session variables. You can see I've tried a couple
> different methods but none of them maintain the
> session variable values. Any suggestions?

Is register_globals ON or OFF? You shouldn't mix session_register() with
$_SESSION. Just use one other the other, but I recommend just using
$_SESSION.

$_SESSION['var'] = 'some value';

to set a session var, and

if(isset($_SESSION['var']))

to see if a variable is set.

Also, if you have a varible $foobar within a class method that you define as
a session var, you must make it global if you want to access it in other
methods. The same thing for HTTP_SESSION_VARS. I think you're just running
into a scope issue.

---John Holmes...

> Mike
>
> <?php
>
> class login {
>
> //This variable tells the browser where to redirect to
> the loginpage
> var
> $loginPage='http://www.somedomain.com/somepage.php';
> var
> $exitPage='http://www.somedomain.com/somepage.html';
> var $loggedIn;
> var $access;
> var $accesslevel;
>
> function login($loggedIn, $access, $accesslevel) {
>
> session_start();
> if ($loggedIn=='1') {
> $this->checkLogin();
> }
> if ($access=='1') {
> $this->checkAccess();
> }
> if ($access=='0' && $loggedIn=='0') {
> $this->authenticateLogin();
> }
> }
>
> function checkLogin() {
>
> if (session_is_registered('user')!='True') {
> session_register('unauthorizedaccess');
> $unauthorizedaccess="http://" .
> $_SERVER['SERVER_NAME'] . $_SERVER['SCRIPT_NAME'];
> header("location: $this->loginPage");
> exit();
> }
> }
>
> function checkAccess() {
>
> if (session_is_registered('permission')=='True') {
> if
> ($HTTP_SESSION_VARS['permission']<$this->accesslevel)
> {
> session_destroy();
> header("location: $this->exitPage");
> exit();
> }
> }
> else {
> session_register('unauthorizedaccess');
> $unauthorizedaccess="http://" .
> $_SERVER["SERVER_NAME"] . $_SERVER["SCRIPT_NAME"];
> header("location: $this->loginPage");
> exit();
> }
> }
>
> function authenticateLogin() {
>
> if ((!$HTTP_POST_VARS['un']) ||
> (!$HTTP_POST_VARS['pw'])) {
> session_register('loginError');
> header("Location: $this->loginPage");
> exit();
> }
>
> else {
>
> include("includes/db_connect.inc");
>
> //call db_connect function from db_connect.inc
> db_connect() or trigger_error("MySQL error #" .
> mysql_errno() . ":" . mysql_error());
>
> $query="select * from users where username=\"" .
> addslashes($HTTP_POST_VARS['un']) ."\" and
> password=\"" . addslashes($HTTP_POST_VARS['pw']) .
> "\"";
>
> $result=mysql_query($query) or trigger_error("MySQL
> error #" . mysql_errno() . ":" . mysql_error());
>
> $foundCount = mysql_num_rows($result);
>
> if ($foundCount==1) {
> session_register('user');
> session_register('permission');
> session_register('company');
> session_unregister('loginError');
> for ($i=0; $i < $foundCount; $i++) {
> $row=mysql_fetch_array($result);
> $_SESSION['user']=$row['userID'];
> $_SESSION['permission']=$row['permissionLevel'];
>
> $_SESSION['company']=$row['companyID'];
> }
> if
> (session_is_registered('unauthorizedaccess')=='True')
> {
>
> $location=$HTTP_SESSION_VARS['unauthorizedaccess'];
> session_unregister('unauthorizedaccess');
> header("Location: $location");
> exit();
> }
> }
> else {
> session_register('loginError');
> header("Location: $this->loginPage");
> exit();
> }
> }
> }
>
>
> //closes class
> }
>
> ?>

attached mail follows:


There is also a free obfuscator at SourceGuardian:

http://www.sourceguardian.com/downloads/sg20.zip

The encryption tools to look at are:

Zend encoder
SourceGuardian Pro
Turck MMCache
Ioncube

Doing a google search for any of the above will bring up enough for you
to work with

> -----Original Message-----

>
> Take a look at Turck MMCache and Zend Encoder, both will require your
> user to install a free Loader. Turck MMCache is free, Zend
> Encoder is
> not, either will make your applications run faster.
>
> You should workout good licensing deals with your clients
> because with
> enough motivation and time they will reverse engineer an encoded
> script. The PHP Obfuscator was intresting but you need to test your
> application again after you use it because of the changes it makes to
> the code.
>
> Most people recommend good legal licensing and a good
> relationship, if
> that isn't possible I'd use MMCache or Zend Encoder and
> accept someone
> may reverse engineer it at some point, either of these programs are
> better than something that obscures the code because the store the
> optimized bytecode which will accelerate the program where an
> encrypted
> source file will slow you down, an obscured one shouldn't
> slow you down
> much if at all but then there is the testing thing :).
>
> Jason
>
> Ivo Fokkema wrote:
>
> >Hi,
> >
> >I've actually been looking for this kind of things for a
> while as well.
> >However, I would not want my client to install something to
> uncode the
> >scripts (probably causing the scripts to be unencoded
> easier). I found
> >these:
> >
> >PHP OBFUSCATOR
> >http://richard.fairthorne.is-a-geek.com/utils_obfuscate.php
> >
> >Phrozen
> >http://sourceforge.net/projects/phrozen/
> >
> >POBS
> >http://pobs.mywalhalla.net/
> >
> >Anyone have any recommendations or experience with any?
> >
> >--
> >Ivo
> >
> >
> >"Evan Nemerson" <evancoeus-group.com> wrote in message
> >news:200309062144.55392.evancoeus-group.com...
> >
> >
> >>Take a look at Turck MMCache (free) and Zend Encoder (not).
> >>
> >>http://www.turcksoft.com/en/e_mmc.htm
> >>http://www.zend.com/store/products/zend-encoder.php
> >>
> >>
> >>
> >>On Saturday 06 September 2003 01:59 pm, Charles Kline wrote:
> >>
> >>
> >>>What methods are available (ups and downs) for encrypting and
> >>>serializing php applications for sale?
> >>>
> >>>Thanks,
> >>>Charles
> >>>
> >>>
> >
> >
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>

attached mail follows:


=========================================================
This message is for the benefit of new subscribers and those new to PHP.
Those who do not want to be bothered just filter out the [Newbie Guide]
mails. Please feel free to add more points and send to the list.
==========================================================
1. If you have any queries/problems about PHP try http://www.php.net/manual/en
first. You can download a copy and use it offline also.

2. If you can not get answer here try http://www.google.com next. Try
searching for "php YOUR QUERY" and you may be lucky to get an answer within
the first 10 results.

3. Glancing through the list archive at
http://marc.theaimsgroup.com/?l=php-general , you can find many of the
common topics discussed repeatedly and can get your answer from those
discussions.

4. If you are stuck with a script and do not understand what is wrong, instead
of posting the whole script, try doing some research yourself. One useful
trick is to print the variable/sql query using print or echo command and
check whether you get what you expected.

After diagnosing the problem, send the details of your efforts (following
steps 1, 2 & 3) and ask for help.

5. Provide a clear descriptive subject line. Avoid general subjects like
"Help!!", "A Question" etc. Especially avoid blank subjects.

6. When you want to start a new topic, open a new mail and enter the mailing
list address php-generallists.php.net instead of replying to an existing
thread and replacing the subject and body with your message.

7. PHP is a server side scripting language. Whatever processing PHP does takes
place BEFORE the output reaches the client. Therefore, it is not possible to
access the users' computer related information (OS, screen size etc) using
PHP. You need to go for JavaScript and ask the question in a JavaScript
list.

8. It's always a good idea to post back to the list once you've solved
your problem. People usually add [SOLVED] to the subject line of their
email when posting solutions. By posting your solution you're helping
the next person with the same question. [contribued by Chris W Parker]

9. Ask smart questions http://catb.org/~esr/faqs/smart-questions.html
[contributed by Jay Blanchard)

Hope you have a good time programming with PHP.

Best regards,

--
Ma Siva Kumar,
================================================
INTEGRATED MANAGEMENT TOOLS FOR LEATHER INDUSTRY
BSG LeatherLink,
Chennai.
Ph: +91 44 55191757
URL : http://www.leatherlink.net

attached mail follows:


"Jami Moore" <jamijamisniche.com> wrote in message
news:000001c375cf$aeb3b9c0$3900cf0cKatya...
> I have been trying all weekend to get this right, and so far it does not
> validate an e-mail address with a subdomain.
>
> -- Code --
>
> $empatt =
> "^[_a-z0-9-]+(\.[_a-z0-9-]+)*[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$";
>
> if(eregi($empatt, $email))
> {
> //do stuff
> }
>
> -- End Code --
Try this pattern (which I use):

"^[-+.0-9A-Z_a-z]+[-+.0-9A-Z_a-z]+\.[A-Za-z]{2,4}$"

HTH,

Ivo

attached mail follows:


Hello,
    I have a request destined to the php "group", relevant of the
authorization to use "PHP" root in a project name. This must be done by
sending a mail to group_at_php.net but this adresse seems to be out of
order.

-----------------------8<--------------
Hi. This is the qmail-send program at php.net.
I'm afraid I wasn't able to deliver your message to the following addresses.
This is a permanent error; I've given up. Sorry it didn't work out.

<group_at_pair2.php.net>:
j-c.gibier_at_wanadoo.fr is in pending
I'm not going to try again; this message has been in the queue too long.
-----------------------8<--------------

Is there another way to pass my demand to the persons supposed to deliver
prior written permission ?
Thanks for your advices.

regards
JCG

attached mail follows:


As mysql is from an rpm, I bet it is in /usr, so use --with-mysql=/usr
Also make sure mysql-devel rpm is installed.

Mark McCulligh wrote:
> I am trying to ./configure PHP 4.3.3 on a system that already has MySQL
> 4.0.14 on it.
>
> In the configure line --with-mysql=/path/to/mysql were is the path for RPM
> versions of MySQL. I have search the computer but it looks like the mysql
> files are all over the place. Database files are in /var/lib/mysql BIN
> files are in /usr/bin/, etc...
>
> If you install MySQL from a RPM what path do you put in the PHP configure
> line
>
> Thanks,
> Mark.
>

attached mail follows:


// Ok, I have a loop:
for ($i = $Date; $i >= $sDate; $i--)

// Somthing like this is inside the loop:
if ($Exists)
 echo "Something here.";
else
 $sDate--;

I have it check if it exists, if it doesn't, then it reduces $sDate by 1.
$sDate is initially 3 to 31 days less than $Date.
By reducing $sDate by 1, it keeps looking, what if there are no more?
It keeps going until I reach 30 seconds, how can I set a time limit?

I have it on: http://zavaboy.jimbug.org/phptest/blog.php
Go to May 14, 2003 wait 30 seconds for the page to load and you'll see what
I mean.
I don't want it to last 30 seconds and a error, I want 3 seconds max and no
error.

"Curt Zirzow" <php-generalzirzow.dyndns.org> wrote in message
news:20030910035008.GN74221bagend.shire...
> * Thus wrote zavaboy (zavaboyhotmail.com):
> > How do I set execution time for a for() loop?
> > Like I have a loop stop once it finds 3 things, but what happens when
there
> > are only 2 things? It keeps looking for 30 seconds then shows this
error:
> > Fatal error: Maximum execution time of 30 seconds exceeded in...
> >
> > How can I set it to 3 seconds without a error?
>
> What you explained seems that you're doing something wrong... can
> you provide a small example of what you want to get done?
>
>
>
> Curt
> --
> "I used to think I was indecisive, but now I'm not so sure."

attached mail follows:


On 10 September 2003 11:26, zavaboy contributed these pearls of wisdom:

> // Ok, I have a loop:
> for ($i = $Date; $i >= $sDate; $i--)
>
> // Somthing like this is inside the loop:
> if ($Exists)
> echo "Something here.";
> else
> $sDate--;
>
> I have it check if it exists, if it doesn't, then it reduces
> $sDate by 1. $sDate is initially 3 to 31 days less than $Date.
> By reducing $sDate by 1, it keeps looking, what if there are
> no more? It keeps going until I reach 30 seconds, how can I
> set a time limit?

No need to set a time limit for this -- just set a limit on how far $sDate
can be decremented. Presumably only positive values are invalid, so just
stop the loop when $sDate goes <=0 -- either

    for ($i = $Date; $i >= $sDate && $sDate > 0; $i--)

or something like:

    for ($i = $Date; $i >= $sDate; $i--):

      if ($Exists):
        echo "Something here.";
      else:
        $sDate--;
        if ($sDate<=0):
          // do any necessary tidying up here -- e.g. set a
          // flag to say the loop was exited via the side door
          break; // escape from the for loop
        endif;
      endif;

    endfor;
    // break escapes to here

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.fordlmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211

attached mail follows:


if I wait untill $sDate is zero, it'll be in 2000.
I have $Date based on the current date, like to day is: 03252
03 is the year 252 is the day of the year.

"Mike Ford" <M.Fordlmu.ac.uk> wrote in message
news:841D90E489448A4F804E1D1B95768BF7D461DDlis-exchange3.lmu.ac.uk...
> On 10 September 2003 11:26, zavaboy contributed these pearls of wisdom:
>
> > // Ok, I have a loop:
> > for ($i = $Date; $i >= $sDate; $i--)
> >
> > // Somthing like this is inside the loop:
> > if ($Exists)
> > echo "Something here.";
> > else
> > $sDate--;
> >
> > I have it check if it exists, if it doesn't, then it reduces
> > $sDate by 1. $sDate is initially 3 to 31 days less than $Date.
> > By reducing $sDate by 1, it keeps looking, what if there are
> > no more? It keeps going until I reach 30 seconds, how can I
> > set a time limit?
>
> No need to set a time limit for this -- just set a limit on how far $sDate
> can be decremented. Presumably only positive values are invalid, so just
> stop the loop when $sDate goes <=0 -- either
>
> for ($i = $Date; $i >= $sDate && $sDate > 0; $i--)
>
> or something like:
>
> for ($i = $Date; $i >= $sDate; $i--):
>
> if ($Exists):
> echo "Something here.";
> else:
> $sDate--;
> if ($sDate<=0):
> // do any necessary tidying up here -- e.g. set a
> // flag to say the loop was exited via the side door
> break; // escape from the for loop
> endif;
> endif;
>
> endfor;
> // break escapes to here
>
> Cheers!
>
> Mike
>
> ---------------------------------------------------------------------
> Mike Ford, Electronic Information Services Adviser,
> Learning Support Services, Learning & Information Services,
> JG125, James Graham Building, Leeds Metropolitan University,
> Beckett Park, LEEDS, LS6 3QS, United Kingdom
> Email: m.fordlmu.ac.uk
> Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211

attached mail follows:


On 10 September 2003 12:14, zavaboy contributed these pearls of wisdom:

> if I wait untill $sDate is zero, it'll be in 2000.
> I have $Date based on the current date, like to day is: 03252
> 03 is the year 252 is the day of the year.

So for goodness' sake just choose a sensible value to limit the loop -- I
was just taking a stab in the dark from your mention of max 31 days'
difference to guess it was a day-number within a month, and hence my
assumption that only +ve values would be valid.

You really haven't given us very much to go on here -- it might be easier to
suggest a solution if you told us more about what *exactly* it is you're
trying to do. And a little bit more of your *actual* code (not "something
like") might help things along, too.
>
> "Mike Ford" <M.Fordlmu.ac.uk> wrote in message
> news:841D90E489448A4F804E1D1B95768BF7D461DDlis-exchange3.lmu.ac.uk...
>> On 10 September 2003 11:26, zavaboy contributed these pearls
>> of wisdom:
>>
>>> // Ok, I have a loop:
>>> for ($i = $Date; $i >= $sDate; $i--)
>>>
>>> // Somthing like this is inside the loop:
>>> if ($Exists)
>>> echo "Something here.";
>>> else
>>> $sDate--;
>>>
>>> I have it check if it exists, if it doesn't, then it reduces
>>> $sDate by 1. $sDate is initially 3 to 31 days less than
>>> $Date. By reducing $sDate by 1, it keeps looking, what if
>>> there are no more? It keeps going until I reach 30 seconds,
>>> how can I set a time limit?
>>
>> No need to set a time limit for this -- just set a limit on
>> how far $sDate can be decremented. Presumably only positive
>> values are invalid, so just stop the loop when $sDate goes
>> <=0 -- either
>>
>> for ($i = $Date; $i >= $sDate && $sDate > 0; $i--)
>>
>> or something like:
>>
>> for ($i = $Date; $i >= $sDate; $i--):
>>
>> if ($Exists):
>> echo "Something here.";
>> else:
>> $sDate--;
>> if ($sDate<=0):
>> // do any necessary tidying up here -- e.g. set a
>> // flag to say the loop was exited via the side door
>> break; // escape from the for loop
>> endif;
>> endif;
>>
>> endfor;
>> // break escapes to here
>>
>> Cheers!
>>
>> Mike

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.fordlmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211

attached mail follows:


Ok, I may be a little bad at telling people what exactly I want.
Probably I should try and figure this out for myself, I'm good at that! :D

"Mike Ford" <M.Fordlmu.ac.uk> wrote in message
news:841D90E489448A4F804E1D1B95768BF7D461DElis-exchange3.lmu.ac.uk...
> On 10 September 2003 12:14, zavaboy contributed these pearls of wisdom:
>
> > if I wait untill $sDate is zero, it'll be in 2000.
> > I have $Date based on the current date, like to day is: 03252
> > 03 is the year 252 is the day of the year.
>
> So for goodness' sake just choose a sensible value to limit the loop -- I
> was just taking a stab in the dark from your mention of max 31 days'
> difference to guess it was a day-number within a month, and hence my
> assumption that only +ve values would be valid.
>
> You really haven't given us very much to go on here -- it might be easier
to
> suggest a solution if you told us more about what *exactly* it is you're
> trying to do. And a little bit more of your *actual* code (not "something
> like") might help things along, too.
> >
> > "Mike Ford" <M.Fordlmu.ac.uk> wrote in message
> > news:841D90E489448A4F804E1D1B95768BF7D461DDlis-exchange3.lmu.ac.uk...
> >> On 10 September 2003 11:26, zavaboy contributed these pearls
> >> of wisdom:
> >>
> >>> // Ok, I have a loop:
> >>> for ($i = $Date; $i >= $sDate; $i--)
> >>>
> >>> // Somthing like this is inside the loop:
> >>> if ($Exists)
> >>> echo "Something here.";
> >>> else
> >>> $sDate--;
> >>>
> >>> I have it check if it exists, if it doesn't, then it reduces
> >>> $sDate by 1. $sDate is initially 3 to 31 days less than
> >>> $Date. By reducing $sDate by 1, it keeps looking, what if
> >>> there are no more? It keeps going until I reach 30 seconds,
> >>> how can I set a time limit?
> >>
> >> No need to set a time limit for this -- just set a limit on
> >> how far $sDate can be decremented. Presumably only positive
> >> values are invalid, so just stop the loop when $sDate goes
> >> <=0 -- either
> >>
> >> for ($i = $Date; $i >= $sDate && $sDate > 0; $i--)
> >>
> >> or something like:
> >>
> >> for ($i = $Date; $i >= $sDate; $i--):
> >>
> >> if ($Exists):
> >> echo "Something here.";
> >> else:
> >> $sDate--;
> >> if ($sDate<=0):
> >> // do any necessary tidying up here -- e.g. set a
> >> // flag to say the loop was exited via the side door
> >> break; // escape from the for loop
> >> endif;
> >> endif;
> >>
> >> endfor;
> >> // break escapes to here
> >>
> >> Cheers!
> >>
> >> Mike
>
> Cheers!
>
> Mike
>
> ---------------------------------------------------------------------
> Mike Ford, Electronic Information Services Adviser,
> Learning Support Services, Learning & Information Services,
> JG125, James Graham Building, Leeds Metropolitan University,
> Beckett Park, LEEDS, LS6 3QS, United Kingdom
> Email: m.fordlmu.ac.uk
> Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211

attached mail follows:


Try http://www.phpclasses.org/browse.html/package/1042.html

Greg Militello wrote:

> Hey all,
> I've been dealing with EXIF data in images for a while now. Reading
> in PHP is available, however editing, or creating EXIF entries doesn't
> exist.
>
> I am going to work on a set of classes to interphase with libexif a C
> package at:
> http://sourceforge.net/projects/libexif/
>
> The package itself, appears to have a license compatible with PHP (MIT
> license), and I beleive would make a great addition to PHP's graphics
> library. Currently industry standards use EXIF all over the place, and
> very few languages (from what I have found) have really good support for
> EXIF.
>
> Integration to PHP would be ideal. Say you resize an image using GD,
> currently the EXIF data that previously existed with your image is
> gone. Now you could rewrite information back into your image. EXIF
> also always for user defined feilds, which would mean I could attach a
> description directly to an image saving the use of a database or other
> datasource.
>
> I am not a C coder, and thus I don't fansy myself a writer of PHP/PECL
> extensions. I was wondering if support for this kind of action is
> scheduled? If not, is there a chance it might be? I am willing to
> offer my own assistance in the matter, but I have zero experience in
> this realm. Regaurdless of weather a PHP/PECL extension is created,
> I am planning to write abstraction for using this lib commandline. But
> ideally for speed, and integration/permissions reasons this would exist
> as a PHP/PECL extension.
>
>
> Thoughts?
> -Greg Militello
> <?php
> /**
> * show email
> */
> print "junk" . "" . "st"."eti" . "." . "com";
> ?>
>

attached mail follows:


Currently the phpExifRW, the classes you mentioned which are from
http://www.sanisoft.com/phpexifrw/ has incomplete write functions.

In fact the comments included in the code include text like
"This functiion writes back the modifed exif data into the imageinfo
array - INCOMPLETE" -exif.inc:1488

Not to mention a C extension would be faster, and more effiecient.

Thanks for the head up, but I doubt it will do all I need at present.
-Greg

Marek Kilimajer wrote:

> Try http://www.phpclasses.org/browse.html/package/1042.html
>
> Greg Militello wrote:
>
>> Hey all,
>> I've been dealing with EXIF data in images for a while now.
>> Reading in PHP is available, however editing, or creating EXIF
>> entries doesn't exist.
>>
>> I am going to work on a set of classes to interphase with libexif a
>> C package at:
>> http://sourceforge.net/projects/libexif/
>>
>> The package itself, appears to have a license compatible with PHP
>> (MIT license), and I beleive would make a great addition to PHP's
>> graphics library. Currently industry standards use EXIF all over the
>> place, and very few languages (from what I have found) have really
>> good support for EXIF.
>>
>> Integration to PHP would be ideal. Say you resize an image using
>> GD, currently the EXIF data that previously existed with your image
>> is gone. Now you could rewrite information back into your image.
>> EXIF also always for user defined feilds, which would mean I could
>> attach a description directly to an image saving the use of a
>> database or other datasource.
>>
>> I am not a C coder, and thus I don't fansy myself a writer of
>> PHP/PECL extensions. I was wondering if support for this kind of
>> action is scheduled? If not, is there a chance it might be? I am
>> willing to offer my own assistance in the matter, but I have zero
>> experience in this realm. Regaurdless of weather a PHP/PECL
>> extension is created, I am planning to write abstraction for using
>> this lib commandline. But ideally for speed, and
>> integration/permissions reasons this would exist as a PHP/PECL
>> extension.
>>
>>
>> Thoughts?
>> -Greg Militello
>> <?php
>> /**
>> * show email
>> */
>> print "junk" . "" . "st"."eti" . "." . "com";
>> ?>
>>
>

attached mail follows:


Also phpExifRW is not able to parse the EXIF format of all the different
camera types I need it to.

-Greg

Marek Kilimajer wrote:

> Try http://www.phpclasses.org/browse.html/package/1042.html
>
> Greg Militello wrote:
>
>> Hey all,
>> I've been dealing with EXIF data in images for a while now.
>> Reading in PHP is available, however editing, or creating EXIF
>> entries doesn't exist.
>>
>> I am going to work on a set of classes to interphase with libexif a
>> C package at:
>> http://sourceforge.net/projects/libexif/
>>
>> The package itself, appears to have a license compatible with PHP
>> (MIT license), and I beleive would make a great addition to PHP's
>> graphics library. Currently industry standards use EXIF all over the
>> place, and very few languages (from what I have found) have really
>> good support for EXIF.
>>
>> Integration to PHP would be ideal. Say you resize an image using
>> GD, currently the EXIF data that previously existed with your image
>> is gone. Now you could rewrite information back into your image.
>> EXIF also always for user defined feilds, which would mean I could
>> attach a description directly to an image saving the use of a
>> database or other datasource.
>>
>> I am not a C coder, and thus I don't fansy myself a writer of
>> PHP/PECL extensions. I was wondering if support for this kind of
>> action is scheduled? If not, is there a chance it might be? I am
>> willing to offer my own assistance in the matter, but I have zero
>> experience in this realm. Regaurdless of weather a PHP/PECL
>> extension is created, I am planning to write abstraction for using
>> this lib commandline. But ideally for speed, and
>> integration/permissions reasons this would exist as a PHP/PECL
>> extension.
>>
>>
>> Thoughts?
>> -Greg Militello
>> <?php
>> /**
>> * show email
>> */
>> print "junk" . "" . "st"."eti" . "." . "com";
>> ?>
>>
>

attached mail follows:


So go ahead and add the functionality. You have a code you can start
with. I don't believe php version will be a lot slower then its c
equivalent, and you are not c coder anyway. Besides this gives you more
freedom to choose a host, as most hosts don't have exif extension enabled.

Greg Militello wrote:

> Also phpExifRW is not able to parse the EXIF format of all the different
> camera types I need it to.
>
> -Greg
>
> Marek Kilimajer wrote:
>
>> Try http://www.phpclasses.org/browse.html/package/1042.html
>>
>> Greg Militello wrote:
>>
>>> Hey all,
>>> I've been dealing with EXIF data in images for a while now.
>>> Reading in PHP is available, however editing, or creating EXIF
>>> entries doesn't exist.
>>>
>>> I am going to work on a set of classes to interphase with libexif a
>>> C package at:
>>> http://sourceforge.net/projects/libexif/
>>>
>>> The package itself, appears to have a license compatible with PHP
>>> (MIT license), and I beleive would make a great addition to PHP's
>>> graphics library. Currently industry standards use EXIF all over the
>>> place, and very few languages (from what I have found) have really
>>> good support for EXIF.
>>>
>>> Integration to PHP would be ideal. Say you resize an image using
>>> GD, currently the EXIF data that previously existed with your image
>>> is gone. Now you could rewrite information back into your image.
>>> EXIF also always for user defined feilds, which would mean I could
>>> attach a description directly to an image saving the use of a
>>> database or other datasource.
>>>
>>> I am not a C coder, and thus I don't fansy myself a writer of
>>> PHP/PECL extensions. I was wondering if support for this kind of
>>> action is scheduled? If not, is there a chance it might be? I am
>>> willing to offer my own assistance in the matter, but I have zero
>>> experience in this realm. Regaurdless of weather a PHP/PECL
>>> extension is created, I am planning to write abstraction for using
>>> this lib commandline. But ideally for speed, and
>>> integration/permissions reasons this would exist as a PHP/PECL
>>> extension.
>>>
>>>
>>> Thoughts?
>>> -Greg Militello
>>> <?php
>>> /**
>>> * show email
>>> */
>>> print "junk" . "" . "st"."eti" . "." . "com";
>>> ?>
>>>
>>
>

attached mail follows:


> preg_replace('/*\<[a-z]+)[0-9]+(\>)/', '$1$2', $String);
Ok why not simply use reg_replace('/<ques[0-9][0-9]>/', '/<ques>/', $String);

BTW preg regex are more powerfull since they support some stuff that the
posix standard does not support. As far as I know lookbehinds and
lookbacks and stuff like that. Also the POSIX standard dictates that all
matches must be provided and the longest match is choosen. Preg on the
other hand simply returns the first found match and is therefor faster.

Please correct me if I'm wrong!!

Regards
Stefan Langer

attached mail follows:


Hi again, I once had MySQL 4.0.14 installed using rpm version, but now have
removed it and installed MySQL 4.0.14 from the source file.

When I run the make command the link --with-mysql=/usr/local/mysql/ I get
this errors:

ext/mysql/php_mysql.lo: In function `zif_mysql_create_db':
/usr/local/src/lamp/php-4.3.3/ext/mysql/php_mysql.c:1160: undefined
reference to `mysql_create_db'
ext/mysql/php_mysql.lo: In function `zif_mysql_drop_db':
/usr/local/src/lamp/php-4.3.3/ext/mysql/php_mysql.c:1202: undefined
reference to `mysql_drop_db'
ext/standard/image.lo: In function `php_handle_swc':
/usr/local/src/lamp/php-4.3.3/ext/standard/image.c:201: undefined reference
to `uncompress'
/usr/local/src/lamp/php-4.3.3/ext/standard/image.c:219: undefined reference
to `uncompress'
main/output.lo: In function `php_ob_init_named':
/usr/local/src/lamp/php-4.3.3/main/output.c:428: undefined reference to
`php_ob_gzhandler_check'
/usr/local/mysql/current/lib/libmysqlclient.a(my_compress.o): In function
`my_compress_alloc':
my_compress.o(.text+0xb4): undefined reference to `compress'
/usr/local/mysql/current/lib/libmysqlclient.a(my_compress.o): In function
`my_uncompress':
my_compress.o(.text+0x12a): undefined reference to `uncompress'
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1

Does anyone know what I am doing wrong?

Thanks, Mark.

attached mail follows:


Are mysql libraries installed in /usr/local/mysql/lib?
Can you paste here the full command that caused the error?

Mark McCulligh wrote:

> Hi again, I once had MySQL 4.0.14 installed using rpm version, but now have
> removed it and installed MySQL 4.0.14 from the source file.
>
> When I run the make command the link --with-mysql=/usr/local/mysql/ I get
> this errors:
>
> ext/mysql/php_mysql.lo: In function `zif_mysql_create_db':
> /usr/local/src/lamp/php-4.3.3/ext/mysql/php_mysql.c:1160: undefined
> reference to `mysql_create_db'
> ext/mysql/php_mysql.lo: In function `zif_mysql_drop_db':
> /usr/local/src/lamp/php-4.3.3/ext/mysql/php_mysql.c:1202: undefined
> reference to `mysql_drop_db'
> ext/standard/image.lo: In function `php_handle_swc':
> /usr/local/src/lamp/php-4.3.3/ext/standard/image.c:201: undefined reference
> to `uncompress'
> /usr/local/src/lamp/php-4.3.3/ext/standard/image.c:219: undefined reference
> to `uncompress'
> main/output.lo: In function `php_ob_init_named':
> /usr/local/src/lamp/php-4.3.3/main/output.c:428: undefined reference to
> `php_ob_gzhandler_check'
> /usr/local/mysql/current/lib/libmysqlclient.a(my_compress.o): In function
> `my_compress_alloc':
> my_compress.o(.text+0xb4): undefined reference to `compress'
> /usr/local/mysql/current/lib/libmysqlclient.a(my_compress.o): In function
> `my_uncompress':
> my_compress.o(.text+0x12a): undefined reference to `uncompress'
> collect2: ld returned 1 exit status
> make: *** [sapi/cli/php] Error 1
>
> Does anyone know what I am doing wrong?
>
> Thanks, Mark.
>

attached mail follows:


MySQL in located in /usr/local/mysql/current/

This is what is in my lib folder:
[rootgandalf current]# cd lib
[rootgandalf lib]# l
-rw-r--r-- 1 root mysql 10806 Jul 18 11:34 libdbug.a
-rw-r--r-- 1 root mysql 879270 Oct 24 2001 libmygcc.a
-rw-r--r-- 1 root mysql 309596 Jul 18 11:34 libmysqlclient.a
-rw-r--r-- 1 root mysql 317484 Jul 18 11:33 libmysqlclient_r.a
-rw-r--r-- 1 root mysql 113614 Jul 18 11:34 libmystrings.a
-rw-r--r-- 1 root mysql 239190 Jul 18 11:34 libmysys.a

This was my configure command line:
./configure
--with-apxs=/usr/local/apache/current/bin/apxs
--with-mysql=/usr/local/mysql/current

This is what I found in my configure output about MySQL:
checking for MSSQL support via FreeTDS... no
checking for MySQL support... yes
checking for specified location of the MySQL UNIX socket... no
checking for MySQL UNIX socket location... no
checking size of char... (cached) 1
checking size of int... (cached) 4

What does the "MySQL UNIX socket location... no" mean?

Thanks, Mark.

attached mail follows:


My mysql user home directory is set to: /var/lib/mysql which was were the
data was for the rpm version of mysql. When I installed the source version
of mysql wouldn't this be change to something like:
/usr/local/mysql/current/data/

What do other people have there mysql user home directory linked too? I am
hoping this is why my PHP configure it failing.

Mark.

attached mail follows:


We are just strugling with this. We are using ezmlm, you need to compile
it with mysql support. I solved webbased subscribing and unsubscribing
with sending an email to the apropriate addresses with From and
Return-Path set to the user's email address (I used smtp class instead
of mail() function so Return-Path does not get overwriten by MTA).

Boulytchev, Vasiliy wrote:

> Ladies and Gents,
> I need the following:
>
> 1. A online place for people to subscribe to mailing list.
> 2. A online place to unsibscribe from a mailing list.
> 3. Several admins for different mailing lists.
> 4. mysql integration.
>
> What do you guys use? Any free software out there? I have reviewed
> about a dozen, ready to pay for one. No time to develop.
>
> Vasiliy Boulytchev
>
> Colorado Information Technologies Inc.
>
> (719) 473-2800 x15
>
> <http://coinfotech.com/>
>
>
>
>
>
>
>

attached mail follows:


Please Help!
I am using PHP to pull data from a MS SQL database. All other fields are
returning data fine, but this one table PROFILE is returning only like some
of the data in the field.

I am using the following simplified code:

    MSSQL_CONNECT($HostName,$UserName,$Password);
    mssql_select_db($DBName) or DIE("Table unavailable");

   $ProfileResults = MSSQL_QUERY("SELECT Profile FROM CompanyProfile WHERE
CompanyID = '3004'");
   $ProfileField = MSSQL_FETCH_ARRAY($ProfileResults);
   $Profile = wordwrap($ProfileField["Profile"]);
    echo $Profile;
    MSSQL_CLOSE();

Actual Field Data
"99 Services, Inc. is a full service IT systems integrator and general
contractor specializing in cradle to grave technology planning with strong
emphasis on LAN/WAN design (routing and switching) and deployment of high
speed, fully redundant, high availability networks. 99 Services also
provides Internet/Intranet/Website/email systems design. The company
services small to medium sized businesses as well as home offices."

What I am getting back
"99 Services, Inc. is a full service IT systems integrator and general
contractor specializing in cradle to grave technology planning with strong
emphasis on LAN/WAN design (routing and switching) and deployment of high
speed, fully redundant, high availab"

attached mail follows:


Christopher J. Crane wrote:
> returning only like some of the data in the field.

> What I am getting back

only 255 chars or so...
Perhaps a varchar(255) field which should be something
like "text" (MySQL) ?

--
Christophe

attached mail follows:


I checked the field properties and it is set as large text or memo, and the
data is complete in the field, just when I try to fetch it, it comes back
truncated somehow.
"Christophe Chisogne" <christophepublicityweb.com> wrote in message
news:3F5F2954.9060203publicityweb.com...
> Christopher J. Crane wrote:
> > returning only like some of the data in the field.
>
> > What I am getting back
>
> only 255 chars or so...
> Perhaps a varchar(255) field which should be something
> like "text" (MySQL) ?
>
> --
> Christophe

attached mail follows:


<html>
<body>
<iframe name=post1 src="about:blank" height=1 width=1 frameborder=no
scrolling=no></iframe>
<iframe name=post2 src="about:blank" height=1 width=1 frameborder=no
scrolling=no></iframe>
<form name=form1 action="form_parser1.php" target=post1>
<input type=text name=form1_value1>
</form>
<form name=form2 action="form_parser2.php" target=post2>
<input type=text name=form2_value1>
</form>
<a href="about:blank" onClick="form1.submit();form2.submit();return
false">Process Forms</a>
</body>
</html>

Matt

On Tue, 2003-09-09 at 20:11, Dan Anderson wrote:
> Is it possible to tell a browser to send form a to URL a and form b to
> URL b?
>
> (i.e. post to two different URLS)
>
> Thanks,
>
> -Dan

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQA/XyBfH+kNu8/qKOwRAuHPAJwIeoJcym9/rnpIbdvVEpen8D+JcwCfeEB9
XCKAgoIUAmmr2d5ZrPNgDFU=
=6Q6r
-----END PGP SIGNATURE-----

attached mail follows:


> I have compiled my apache with WDDX PHP Module using CPanel inbuild
> feature.. But nothing seems to be working fine .. It doesn't show me
> proper weather ( forcast ) details also it doesn't return me icon
> names and because of that i cant see icons also.. When i see PHPInfo
> of my Server it says WDDX Session Serializer enabled .
>
> Please if someone can help me out i sorting this .. i uploaded the
> weather forcast script on the other server everything seems fine on
> the other one .
>
> Also from where can i find latest rpm of WDDX PHP Module .. and How to

> : to install it ..

attached mail follows:


First let me say that I have done quite a bit of reading this morning
and have been employing OOP techniques for several years in other
languages and I have found something that seems strange to me (given the
early hour, lots of things seem strange). If I have a property declared
in a class, extend that class with an identical property declaration but
different value, instantiate the extended class, and return the property
it is the property of the parent class. I found this quite by accident,
I wasn't really paying attention when I wrote the extension class. So
then I did a little exploration, reading especially the
http://us2.php.net/overload info. But something doesn't seem right to
me. Here is some code to illustrate what I found; (lots o' snippage,
only what counts);

------------------------------------------------------------
class AGENT{
        /*
        ** 2003-09-04 jb PRIVATE PROPERTIES
        */
        var $strCommCode; // agent commission code
------------------------------------------------------------

------------------------------------------------------------
function AGENT(){ // class pseudo-constructor
                /*
                ** 2003-09-09 jb initialize properties
                */
                $this->strCommCode = 'COINBASE';
------------------------------------------------------------

------------------------------------------------------------
require("agentclass.php");

class COIN extends AGENT {
        var $strCommCode = 'COIN0JAY';
}

/*
** instantiate new COIN object
*/

$objDime = new COIN();
echo $objDime->strCommCode."\n";
------------------------------------------------------------

The result of $objDime->strCommCode is 'COINBASE'...my thinking is that
it should be 'COIN0JAY'

Now really I didn't want to initialize a property for strCommCode in the
parent class. The property should get set in the extension class. I know
that a property will get over-ridden in the child class
pseudo-constructor if it gets addressed, like adding this to the COIN
class above;

function COIN(){ // pseudo-constructor
        $this->strCommCode = 'COIN0JAY'; // overrides parent strCommCode
}

With error reporting set (E_ALL) no errors occur before (or after, for
that matter) adding the COIN pseudo-constructor.

Having said all of that it just piqued my curiosity. I understand that
each property is private to its class, but during an extension of the
class aren't all properties private to the extended class?

Just some curiosities....discussion welcome, no problems with current
project.

attached mail follows:


Hello,

my comments are below this snippet.

>------------------------------------------------------------
>class AGENT{
> /*
> ** 2003-09-04 jb PRIVATE PROPERTIES
> */
> var $strCommCode; // agent commission code
>------------------------------------------------------------
>
>------------------------------------------------------------
>function AGENT(){ // class pseudo-constructor
> /*
> ** 2003-09-09 jb initialize properties
> */
> $this->strCommCode = 'COINBASE';
>------------------------------------------------------------
>
>------------------------------------------------------------
>require("agentclass.php");
>
>class COIN extends AGENT {
> var $strCommCode = 'COIN0JAY';
>}
>
>/*
>** instantiate new COIN object
>*/
>
>$objDime = new COIN();
>echo $objDime->strCommCode."\n";
>------------------------------------------------------------
>
>The result of $objDime->strCommCode is 'COINBASE'...my thinking is that
>it should be 'COIN0JAY'
>
>
You can get the expected result if you add an empty constructor to your
Coin class.

ASAIK php does not believe in the concept of default constructors. If a
class does not have a constructor it will happily call the constructor
in the super class instead and leave it at that. While on the other hand
if you have a constructor in your subclass the constructor in the
superclass does not get called!. I don't like it either but that's the
way it's 'defined to be' in PHP.

To sum up your strCommCode in the COIN class does override the
strCommCode member in AGENT. But it's value is actually set by the
constructor in AGENT and it's not the value that you define at the time
of declaration.

best regards

--
http://www.radinks.com/upload
Drag and Drop File Uploader.

attached mail follows:


If the above is called to set user defined session handling functions,
is there a way to reset it back to the default PHP session handling?
I tried calling it with no arguments but got an error. I've looked in the
docs but it doesn't say anything about resetting the handlers.

Does anyone know if/how this can be done?

thnx,
Chris

attached mail follows:


I'm having memory problems running a script in PHP 5 Beta on WINNT SP6a.

I am trying to generate 600 static HTML pages each containing a table of
data. I've taken out all the table formatting routines out the code below,
but it still replicates the same fault. The loop appends the SQL string with
the loop value and then calls ODBC_DO.

When I run it, PHP.exe shows up in task manager, eating away at memory fast
- about 1 meg every second gets consumed and it generates about 7000 page
faults every second too. [I've no idea what page faults are but there's lots
of them...]. But it still works, and the information comes out as expected.
The memory is then freed when PHP exits.

Here's the code.

$dbCon = odbc_connect('Test2', '', '');

for ($nval=1;$nval<=700;$nval++)
{
$query = "SELECT * from [tablename] where ID = ".$nval;
odbc_do($dbCon, $query);
}

odbc_close($dbCon);

I've run this code not only from a web page, but also from the command line
with some additional code which waits for a user keystroke before continuing
to the next loop iteration, to slow down the process. But the same problem
occurred, so I think I've ruled out some kind of bottleneck.

I expected the memory to remain fairly constant throughout execution, but it
keeps on rising and not always at a constant rate.

Can anyone shed any light on this? Is this a bug in PHP?

Kind regards,

Chris Neale
Contract Developer
Somerfield Stores Ltd.
 
If you are not the intended recipient of this e-mail, please preserve the
confidentiality of it and advise the sender immediately of any error in
transmission. Any disclosure, copying, distribution or action taken, or
omitted to be taken, by an unauthorised recipient in reliance upon the
contents of this e-mail is prohibited. Somerfield cannot accept liability
for any damage which you may sustain as a result of software viruses so
please carry out your own virus checks before opening an attachment. In
replying to this e-mail you are granting the right for that reply to be
forwarded to any other individual within the business and also to be read by
others. Any views expressed by an individual within this message do not
necessarily reflect the views of Somerfield. Somerfield reserves the right
to intercept, monitor and record communications for lawful business
purposes.

attached mail follows:


From: "phpu" <phpugo.ro>

> I'm new in php and i've got allready a problem.
> I wanna divide 2 numbers and the result to be an integer separated by
comma. For example:
> $number1=10000000;
> $number2=17;
> $result=$number1 / $number2;
> In this case the result is 588235.29411764....
> And I wanna the result to be like this 588,235

I don't know if this is old or not, but I just got it.

Anyhow, use number_format()

---John Holmes...

attached mail follows:


Hi. I'm trying to develop a web interface to the ghostscript (gs)
application. I have the ghostscript syntax down perfectly in the console.
Now when I go to try and do it in PHP I get nothing. No errors, nothing just
a blank page with PHP logs turned on and errors turned on.

I'm running Apache with PHP 4.3.3 on OpenBSD 3.3 i386. In my case Apache
(httpd) is chrooted to /var/htdocs/. So I figured I would have to copy
ghostscript and all it's dependencies to /var/htdocs/ at least for it to
work. Still nothing. Here's the code I used below. At this point I do not
know what direction to go to get this to work or if it is even possible.
I've tried exec(), system() and popen() api functions. I get nothing no
results, no errors what so ever. BTW, ghostscript does appear to work fine
in the chrooted directory via the console. At this point the below code is
all I have. The syntax for ghostscript shown below just outputs the data of
the 2 PDF files to the pdfwrite so it will merge them together into a
merged.pdf file. Quite simple actually.

$szPipe = popen("/htdocs/gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite
-sOutputFile=/htdocs/merged.pdf /htdocs/Sep08-113518.pdf
/htdocs/Sep08-113523.pdf", "r");

I tried resulting to something simple to get this to work. I took the
example from the PHP manual system() page
(http://www.php.net/manual/en/function.system.php). In this example is it
suppose to return "Last Line of Output: " and "Return value: 127"? This
occurs with system() and passthru(). I thought it should return the last
line of a ls would show in the console.

Any ideas or direction on how to do this would be greatly appreciated.

Thanks!

attached mail follows:


Hi,

1) please try $szPipe and see if you get any output.
2) if you are jailed in /var/htdocs/ your pathname /htdocs/qs is incorrect.
3) I guess you tried running gs from the jail either as yourself or as
root.
please see if nobody or apache (the webserver's user) can run gostscript.

all the best

Adam Douglas wrote:

>Hi. I'm trying to develop a web interface to the ghostscript (gs)
>application. I have the ghostscript syntax down perfectly in the console.
>Now when I go to try and do it in PHP I get nothing. No errors, nothing just
>a blank page with PHP logs turned on and errors turned on.
>
>I'm running Apache with PHP 4.3.3 on OpenBSD 3.3 i386. In my case Apache
>(httpd) is chrooted to /var/htdocs/. So I figured I would have to copy
>ghostscript and all it's dependencies to /var/htdocs/ at least for it to
>work. Still nothing. Here's the code I used below. At this point I do not
>know what direction to go to get this to work or if it is even possible.
>I've tried exec(), system() and popen() api functions. I get nothing no
>results, no errors what so ever. BTW, ghostscript does appear to work fine
>in the chrooted directory via the console. At this point the below code is
>all I have. The syntax for ghostscript shown below just outputs the data of
>the 2 PDF files to the pdfwrite so it will merge them together into a
>merged.pdf file. Quite simple actually.
>
>$szPipe = popen("/htdocs/gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite
>-sOutputFile=/htdocs/merged.pdf /htdocs/Sep08-113518.pdf
>/htdocs/Sep08-113523.pdf", "r");
>
>I tried resulting to something simple to get this to work. I took the
>example from the PHP manual system() page
>(http://www.php.net/manual/en/function.system.php). In this example is it
>suppose to return "Last Line of Output: " and "Return value: 127"? This
>occurs with system() and passthru(). I thought it should return the last
>line of a ls would show in the console.
>
>Any ideas or direction on how to do this would be greatly appreciated.
>
>Thanks!
>
>
>

--
http://www.radinks.com/upload
Drag and Drop File Uploader.

attached mail follows:


From: "Adam Douglas" <ADouglasvenmarces.com>

> Hi. I'm trying to develop a web interface to the ghostscript (gs)
> application. I have the ghostscript syntax down perfectly in the console.
> Now when I go to try and do it in PHP I get nothing. No errors, nothing
just
> a blank page with PHP logs turned on and errors turned on.

Does the Apache user have permission to run this program? PHP runs as the
Apache user when installed as a module.

---John Holmes...

attached mail follows:


> 1) please try $szPipe and see if you get any output.
> 2) if you are jailed in /var/htdocs/ your pathname /htdocs/qs
> is incorrect.
> 3) I guess you tried running gs from the jail either as
> yourself or as
> root.
> please see if nobody or apache (the webserver's user) can run
> gostscript.
 

1) When I echo out $szPipe I get "Resource id #2".
2) Oops, that chrooted in /var/www/. So I thought I should be putting just a
/htdocs/, no?
3)Yes I tried running gs in the console as root works fine and as myself and
that works fine. The user is www that runs httpd. How could I test to see if
www has access? To my understanding such accounts can not be used to log in
with. I have chown the /htdocs/ to be www:wwww.

> >Hi. I'm trying to develop a web interface to the ghostscript (gs)
> >application. I have the ghostscript syntax down perfectly in
> the console.
> >Now when I go to try and do it in PHP I get nothing. No
> errors, nothing just
> >a blank page with PHP logs turned on and errors turned on.
> >
> >I'm running Apache with PHP 4.3.3 on OpenBSD 3.3 i386. In my
> case Apache
> >(httpd) is chrooted to /var/htdocs/. So I figured I would
> have to copy
> >ghostscript and all it's dependencies to /var/htdocs/ at
> least for it to
> >work. Still nothing. Here's the code I used below. At this
> point I do not
> >know what direction to go to get this to work or if it is
> even possible.
> >I've tried exec(), system() and popen() api functions. I get
> nothing no
> >results, no errors what so ever. BTW, ghostscript does
> appear to work fine
> >in the chrooted directory via the console. At this point the
> below code is
> >all I have. The syntax for ghostscript shown below just
> outputs the data of
> >the 2 PDF files to the pdfwrite so it will merge them together into a
> >merged.pdf file. Quite simple actually.
> >
> >$szPipe = popen("/htdocs/gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite
> >-sOutputFile=/htdocs/merged.pdf /htdocs/Sep08-113518.pdf
> >/htdocs/Sep08-113523.pdf", "r");
> >
> >I tried resulting to something simple to get this to work. I took the
> >example from the PHP manual system() page
> >(http://www.php.net/manual/en/function.system.php). In this
> example is it
> >suppose to return "Last Line of Output: " and "Return value:
> 127"? This
> >occurs with system() and passthru(). I thought it should
> return the last
> >line of a ls would show in the console.
> >
> >Any ideas or direction on how to do this would be greatly
> appreciated.

attached mail follows: