php-general Digest 12 Apr 2004 16:03:02 -0000 Issue 2701

Topics (messages 183140 through 183166):

[Newbie Guide] For the benefit of new members
        183140 by: Ma Siva Kumar

Re: How do you handle device detection?
        183141 by: DvDmanDT

Re: using $_SESSION inside of user functions
        183142 by: Jason Wong

After calling a Function the Script aborts without any error :-\
        183143 by: Ben
        183146 by: John Nichel
        183150 by: John W. Holmes
        183152 by: William Lovaton

Using only PHP is it possible (multiple re-directs)?
        183144 by: Jay Blanchard
        183147 by: John Nichel

requests per s with php and mysql queries
        183145 by: Merlin
        183148 by: John W. Holmes
        183149 by: William Lovaton
        183155 by: Merlin
        183156 by: Merlin

Re: ADOdb Operator question
        183151 by: Gabe

Re: PHP/MySQL difficulties on WindowsXP
        183153 by: Gabe

XML Parser Functions - problem interpreting an xml file
        183154 by: Kai Hackemesser
        183159 by: Chris Boget

Wanted: login and CMS system with a twist
        183157 by: David T-G

varible
        183158 by: edwardspl.ita.org.mo

Re: commercial autoresponses (was "Re: [PHP] Wanted: ...")
        183160 by: David T-G
        183166 by: Jason Barnett

Problems with mail and php
        183161 by: Luis Lebron

Re: php 5 install
        183162 by: Jason Barnett

Preg_match_all problem
        183163 by: Jeff McKeon
        183164 by: John Nichel

htmlentities, links, javascript
        183165 by: Beau Hartshorne

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
=======================================
This message is for the benefit of new 
subscribers and those new to PHP.  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. 

Please also try 
http://www.php.net/manual/faq.php 
for answers to frequently answered questions 
about PHP (added by Christophe Chisogne).

2. Try http://www.google.com next. Searching 
for "php YOUR QUERY" may fetch you relevant 
information within the first 10 results.

3. There is a searchable archive of the 
mailing list discussion at 
http://phparch.com/mailinglists. Many of the 
common topics are discussed repeatedly, and 
you may get answer to your query from the 
earlier discussions. 

For example: One of the repeatedly discussed 
question in the list is "Best PHP editor". 
Everyone has his/her favourite editor. 
You can get all the opinions by going through 
the list archives. If you want a chosen list 
try this link : 
http://phpeditors.linuxbackup.co.uk/ 
(contributed by Christophe Chisogne).

4. Not sure if PHP is working or you want 
find out what extensions are available to 
you?

Just put the following code into a file with 
a .php extension and access it through your 
webserver:

<?php
        phpinfo();
?> 

If PHP is installed you will see a page with 
a lot of information on it. If PHP is not 
installed (or not working correctly) your 
browser will try to download the file.

(contributed by Teren and reworded by Chris W 
Parker)

5. 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.

6. 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 
users'  computer related information (OS, 
screen size etc) using PHP. Nor can you 
modify any the user side settings. You need 
to go for JavaScript and ask the question in 
a JavaScript list.

On the other hand, you can access the 
information that is SENT by the user's 
browser when a client requests a page from 
your server. You can find details about 
browser, OS etc as reported by 
this request. - contributed by Wouter van 
Vliet and reworded by Chris W Parker.

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

8. When you want to start a new topic, open a 
new mail composer and enter the mailing list 
address [EMAIL PROTECTED] instead of 
replying to an existing thread and replacing 
the subject and body with your message.

9. 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]

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

11. Do not send your email to the list with 
attachments. If you don't have a place to 
upload your code, try the many pastebin 
websites (such as www.pastebin.com).
[contributed by Burhan Khalid]


Hope you have a good time programming with 
PHP.

-- 
Integrated Management Tools for leather 
industry
----------------------------------
http://www.leatherlink.net

Ma Siva Kumar,
BSG LeatherLink (P) Ltd,
Chennai - 600106

--- End Message ---
--- Begin Message ---
But afaik that function is broken, and PHP isn't allowed to use that
browscap.ini so.. Better make a list of user_agents that are devices..

-- 
// DvDmanDT
MSN: dvdmandt¤hotmail.com
Mail: dvdmandt¤telia.com
"Lukasz Karapuda" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
> Richard,
>
> You would do that by looking at the user_agent parameter that is being
send
> by the browser to the server. PHP automatically places the user_agent
> information in the superglobal: $_SERVER['HTTP_USER_AGENT']. The
user_agent
> string might seems cryptic, therefore PHP provides you a built-in function
> for representing the user agent information in an object with properties
> representing the features of the browser. The function is get_browser().
> Link to documentation of this function:
>
> http://www.php.net/manual/en/function.get-browser.php
>
> Good luck,
>
> Lukasz Karapuda
>
>
>
>
> "Richard Davey" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Hi all,
> >
> > This is just a general question to get some ideas from the "wider
> > world" as it were.
> >
> > Say you've finished your site. It looks lovely and works perfectly.
> > You have a CSS file for modern browsers and one that degrades for
> > text-only devices also. You even have a special "small width" version
> > for PDAs and the like.
> >
> > So how do you go about detecting just what is looking at your site?
> > How would you handle detecting and then serving the same site for a
> > standard browser, a screen-reader, a PDA device or a WAP/mobile
> > device?
> >
> > Any tips/suggestions gratefully listened to.
> >
> > --
> > Best regards,
> >  Richard Davey
> >  http://www.phpcommunity.org/wiki/296.html

--- End Message ---
--- Begin Message ---
On Monday 12 April 2004 08:23, Andy B wrote:
> didnt know if it was possible to use $_SESSION vars in that function or any
> user defined functions for that matter...

Why didn't you waste one minute of your time to try it out?

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
printk("ufs_read_super: fucking Sun blows me
");
        2.0.38 /usr/src/linux/fs/ufs/ufs_super.c
*/

--- End Message ---
--- Begin Message ---
Hi Folks,

i got a big problem. I have a script which includes some other script i
tried include, require and require once. The problem is, if i do a
function call to a function in one of these included files, the script
aborts but without any error. The strange thing is, normally require
should give an error if it can't include any file. But the files are
accessible, error reporting is E_ALL. Some functions are callable but
others not and still no error. the only way how i came to this was
putting some die()s to see where 

the script is aborting.

I hope anybody can help me because i have no idea what that could be.

tia.

Ben


---
__________________________________________________________
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.656 / Virus Database: 421 - Release Date: 09.04.2004
 

--- End Message ---
--- Begin Message --- Ben wrote:
Hi Folks,

i got a big problem. I have a script which includes some other script i
tried include, require and require once. The problem is, if i do a
function call to a function in one of these included files, the script
aborts but without any error. The strange thing is, normally require
should give an error if it can't include any file. But the files are
accessible, error reporting is E_ALL. Some functions are callable but
others not and still no error. the only way how i came to this was
putting some die()s to see where

the script is aborting.

I hope anybody can help me because i have no idea what that could be.

tia.

Ben

You can see if the function exists in you main script...

if ( function_exists ( "functionName" ) ) {
        echo ( "Function Exists." );
} else {
        echo ( "Function Does Not Exists." );
}

Or you can echo out something in the function you're trying to call...

function whatever() {
        echo ( "<!-- It worked -->" );
        //  More Code
}

--
***********************************************************************
*  _  __       __      __       _                      * John  Nichel *
* | |/ /___ __ \ \    / /__ _ _| |__ ___  __ ___ _ __  * 716.856.9675 *
* | ' </ -_) _` \ \/\/ / _ \ '_| / /(_-<_/ _/ _ \ '  \ * 737 Main St. *
* |_|\_\___\__, |\_/\_/\___/_| |_\_\/__(_)__\___/_|_|_|* Suite #150   *
*          |___/                                       * Buffalo, NY  *
* http://www.KegWorks.com            [EMAIL PROTECTED] * 14203 - 1321 *
***********************************************************************

--- End Message ---
--- Begin Message ---
From: "Ben" <[EMAIL PROTECTED]>

> i got a big problem. I have a script which includes some other script i
> tried include, require and require once. The problem is, if i do a
> function call to a function in one of these included files, the script
> aborts but without any error. The strange thing is, normally require
> should give an error if it can't include any file. But the files are
> accessible, error reporting is E_ALL. Some functions are callable but
> others not and still no error. the only way how i came to this was
> putting some die()s to see where 

Do you have display_errors turned on?

---John Holmes...

--- End Message ---
--- Begin Message ---
Hi,

El lun, 12-04-2004 a las 09:27, John W. Holmes escribió:
> From: "Ben" <[EMAIL PROTECTED]>
> 
> > i got a big problem. I have a script which includes some other script i
> > tried include, require and require once. The problem is, if i do a
> > function call to a function in one of these included files, the script
> > aborts but without any error. The strange thing is, normally require
> > should give an error if it can't include any file. But the files are
> > accessible, error reporting is E_ALL. Some functions are callable but
> > others not and still no error. the only way how i came to this was
> > putting some die()s to see where 
> 
> Do you have display_errors turned on?

Sometimes I have this problems too, no matter if that setting is on.


-William

--- End Message ---
--- Begin Message ---
I'd like to do something like this...

a. click submit button in window A
b. open window B with stuff
c. have window A go to another location

It was just a thought I had this morning while working with some of our
intranet forms.

THANKS!

--- End Message ---
--- Begin Message --- Jay Blanchard wrote:
I'd like to do something like this...

a. click submit button in window A
b. open window B with stuff
c. have window A go to another location

It was just a thought I had this morning while working with some of our
intranet forms.

THANKS!


I don't think this is possible with just PHP. I think you can target the form action to open in the new page, but the original page is going to stay the same without some JavaScript.

--
***********************************************************************
*  _  __       __      __       _                      * John  Nichel *
* | |/ /___ __ \ \    / /__ _ _| |__ ___  __ ___ _ __  * 716.856.9675 *
* | ' </ -_) _` \ \/\/ / _ \ '_| / /(_-<_/ _/ _ \ '  \ * 737 Main St. *
* |_|\_\___\__, |\_/\_/\___/_| |_\_\/__(_)__\___/_|_|_|* Suite #150   *
*          |___/                                       * Buffalo, NY  *
* http://www.KegWorks.com            [EMAIL PROTECTED] * 14203 - 1321 *
***********************************************************************

--- End Message ---
--- Begin Message --- Hi there,

I am trying to stress my LAMP app with MS stress tool for web applications.
It simulates about 100 threads.

It looks like the LAMP app is only able to handel about 6 requests per second :-(
Is this normal für php with database queries?

Thanx for any info,

Merlin
--- End Message ---
--- Begin Message ---
From: "Merlin" <[EMAIL PROTECTED]>

> I am trying to stress my LAMP app with MS stress tool for web
applications.
> It simulates about 100 threads.
>
> It looks like the LAMP app is only able to handel about 6 requests per
second :-(
> Is this normal für php with database queries?

Every application is different. You can't ask a question like this. Even if
people said Yes or No, how is that going to help you?

---John Holmes...

--- End Message ---
--- Begin Message ---
I have never used any kind of stress tool in my web app.  Right now it
is in production under heavy load and some statistics are:

Authenticated users: 520 (this are the active sessions)
Dynamic requests per second: 25 Average
Max. Dynamic requests per second: 60 to 80 (these are peak values)

When I say dynamic requests I mean just PHP scripts.  Static content
(js, css, images, etc) is not registered here but it is usually 3 to 4
times dynamic requests... so, do the math. ;-)

For this app I'm using Apache 1.3, PHP 4.3 and Oracle 8.1.7

The server is an old compaq with RedHat Linux 9, 2 GB RAM and 4
proccessor with 550MHz each.

I hope it can serve you as a reference.


Regards,


-William


El lun, 12-04-2004 a las 08:37, Merlin escribió:
> Hi there,
> 
> I am trying to stress my LAMP app with MS stress tool for web applications.
> It simulates about 100 threads.
> 
> It looks like the LAMP app is only able to handel about 6 requests per second :-(
> Is this normal für php with database queries?
> 
> Thanx for any info,
> 
> Merlin

--- End Message ---
--- Begin Message --- Hello William,

how do you messure your statistics? I would be interested in comparing
those numbers. Do you use a special tool?

Thanx

Merlin


William Lovaton wrote:

I have never used any kind of stress tool in my web app.  Right now it
is in production under heavy load and some statistics are:

Authenticated users: 520 (this are the active sessions)
Dynamic requests per second: 25 Average
Max. Dynamic requests per second: 60 to 80 (these are peak values)

When I say dynamic requests I mean just PHP scripts.  Static content
(js, css, images, etc) is not registered here but it is usually 3 to 4
times dynamic requests... so, do the math. ;-)

For this app I'm using Apache 1.3, PHP 4.3 and Oracle 8.1.7

The server is an old compaq with RedHat Linux 9, 2 GB RAM and 4
proccessor with 550MHz each.

I hope it can serve you as a reference.


Regards,


-William


El lun, 12-04-2004 a las 08:37, Merlin escribió:

Hi there,

I am trying to stress my LAMP app with MS stress tool for web applications.
It simulates about 100 threads.

It looks like the LAMP app is only able to handel about 6 requests per second :-(
Is this normal für php with database queries?

Thanx for any info,

Merlin

--- End Message ---
--- Begin Message --- Hello William,

how do you messure your statistics? I would be interested in comparing
those numbers. Do you use a special tool?

Thanx

Merlin


William Lovaton wrote:

I have never used any kind of stress tool in my web app.  Right now it
is in production under heavy load and some statistics are:

Authenticated users: 520 (this are the active sessions)
Dynamic requests per second: 25 Average
Max. Dynamic requests per second: 60 to 80 (these are peak values)

When I say dynamic requests I mean just PHP scripts.  Static content
(js, css, images, etc) is not registered here but it is usually 3 to 4
times dynamic requests... so, do the math. ;-)

For this app I'm using Apache 1.3, PHP 4.3 and Oracle 8.1.7

The server is an old compaq with RedHat Linux 9, 2 GB RAM and 4
proccessor with 550MHz each.

I hope it can serve you as a reference.


Regards,


-William


El lun, 12-04-2004 a las 08:37, Merlin escribió:

Hi there,

I am trying to stress my LAMP app with MS stress tool for web applications.
It simulates about 100 threads.

It looks like the LAMP app is only able to handel about 6 requests per second :-(
Is this normal für php with database queries?

Thanx for any info,

Merlin

--- End Message ---
--- Begin Message ---
That helps, thanks!


"Curt Zirzow" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> * Thus wrote Gabe ([EMAIL PROTECTED]):
> > If you're using ADOdb, what is the name, purpose, and function of this
> > operator?
> >
> > ->
> >
> > e.g. $conn->Connect(false, 'scott', 'tiger', $oraname);
>
> The $conn variable is a adodb object that has methods and
> properties associated with it.  The -> tells php to access the
> property or method of the object.
>
>
> Curt
> -- 
> "I used to think I was indecisive, but now I'm not so sure."

--- End Message ---
--- Begin Message ---
I don't know if this is the root of your problem or not, but I tried running
PHP 4.3.5 on my Win2K box and it crashed a lot.  I found out that if you
have PHP configured to run as a SAPI module there are stability issues with
that version (this bug has been reported).  I think the CGI install should
be good though.  I reverted back to version 4.3.4 and don't have any
problems yet with the SAPI module.


<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello;
>
> We are having a miserable time with MySQL on a Windows/IIS server with
PHP.
> Here's the version numbers:
>
> MySQL 3.23.58-nt
> PHP 4.35
> Windows XP (although we previously experienced the same problems w/ Server
> 2000), 1gb RAM
>
> The site is for academics to submit scientific "papers" (data) for their
> organization.  In addition to submitting data, they can browse and search
the
> database.
>
> The problem is that one or more times per day, they whole thing grinds to
a
> halt.  Not sure that the server is completely locking up, but response
times
> are so slow it might was well be.  Restarting MySQL corrects the problem,
but
> that may be a symptom rather than the disease.  At one time we had IIS
running
> on one server and MySQL on another.  In this configuration, the IIS server
> would lock up, and reloading MySQL on *that* machine fixed the problem,
> according to my administrator.  That server was remote, and the admin
drove out
> to it to observe and noted that there were virtual RAM errors - running
out -
> which motivated us to move it to the XP box in the office.
>
> There's really not much complicated going on here.  The paper submission
engine
> is session based, and some data is stuffed into session variables until it
can
> be validated in later steps, then saved to the database.  I've optimized
the
> queries as much as possible, checked that MySQL connections are being
closed
> and result resources freed, and php session variables unset and the
session
> destroyed when appropriate.
>
> We're stuck, and the client is getting upset.
>
> Ideas?
>
> TIA
>
> Rob

--- End Message ---
--- Begin Message ---
Hello,

I have created my own handler following the examples in the manual. It works
fine for XML files I created for myself. Now I tried one file given by
someone else, but I get as result always following error:
"junk after document element" in line 1, column 0.
I send you a part of the XML file (- content), maybe you can tell me why it
cant be interpreted. It looks like it doesn't like the <? tag?

Regards,
Kai

<?xml version="1.0" encoding="ISO-8859-1"?>
<FONEXPORT>
<ARTIKEL>
<NEWS NR="174345" TOP="0">
<HEAD>
<WEBSITE NR="1"  URL="http://www.xxxxx.net";></WEBSITE>
<BEREICH NR="6">News</BEREICH>
<RUBRIK NR="150">xxxxx</RUBRIK>
<AUTOR NR="2">-red-</AUTOR>
<DATUM>12.04.2004 16:14:00</DATUM>
<COPYRIGHT>xxxxx</COPYRIGHT>
</HEAD>
<BODY>
<UEBERSCHRIFT><![CDATA[xxxxxxxxxxx]]></UEBERSCHRIFT>
<TEXT><![CDATA]]></TEXT>
</BODY>
</NEWS>
</ARTIKEL>
</FONEXPORT>

--- End Message ---
--- Begin Message ---
> I send you a part of the XML file (- content), maybe you can tell me why
it
> cant be interpreted. It looks like it doesn't like the <? tag?

Do you have short tags enabled?  If so, you might want to disable them.
Just
to test this theory, try to add the following at the top of your script and
see if
the problem doesn't go away:

ini_set( short_open_tag, '<phpscript' );

or something along those lines (anything other than <?).  If that does work,
you
may want to recompile with "--disable-short-tags".

Chris

--- End Message ---
--- Begin Message ---
Hi, all --

A client of mine wishes to create a web site which does more than just
the typical CMS functions in that what you can see not only depends on
whether or not you have an account but also how old your account is?).
Of course, I'd prefer that it is written in PHP :-)

Any recommendations?


TIA & HAND

:-D
-- 
David T-G
[EMAIL PROTECTED]
http://justpickone.org/davidtg/      Shpx gur Pbzzhavpngvbaf Qrprapl Npg!

Attachment: pgp00000.pgp
Description: PGP signature


--- End Message ---
--- Begin Message ---
Dear You,

Is there a solution ( without open global ) , then send the value of the
varible of list.php to view.php ?

list.php :

<?php
?? $username = "1234";
? $password = "1234";

? $MAILSERVER= "{localhost/imap/notls}";

? $link = imap_open($MAILSERVER, $username, $password);

? $headers = imap_headers($link);

? for ($x = 1; $x <= count($headers); $x++)
? {
???$idx = $x - 1 ;
?cho?"<a href=\"view.php?num=$x\">$headers[$idx]</a><br>";
? }
?>

view.php :

<?php
?? $username = "1234";
? $password = "1234";

? $mailserver = "{192.168.0.236/imap/notls}";
? $link = imap_open($mailserver, $username, $password);

? echo("<PRE>");

? echo(imap_fetchheader($link,$num));
? echo("<BR><P>");
? echo(imap_body($link,$num));

? echo("</PRE>");

?>

Thank for your help so much !

Ed.

--- End Message ---
--- Begin Message ---
Hi again, all --

...and then David T-G said...
% 
...
% Any recommendations?

I was amazed to receive from this

  - an entirely-in-German post apparently wishing me a happy Easter
  - a note from Credit Suisse letting me know they'd process my request
  - a promise from Astral Security and Finance to get back to me

and wondered for a moment if I'd really sent it to the right place!  Have
I really missed so much in a month of being too busy to post on the list?


TIA & HAND

:-D
-- 
David T-G
[EMAIL PROTECTED]
http://justpickone.org/davidtg/      Shpx gur Pbzzhavpngvbaf Qrprapl Npg!

Attachment: pgp00001.pgp
Description: PGP signature


--- End Message ---
--- Begin Message --- David T-G wrote:
Hi again, all --

...and then David T-G said...
% ...
% Any recommendations?

I was amazed to receive from this

  - an entirely-in-German post apparently wishing me a happy Easter
  - a note from Credit Suisse letting me know they'd process my request
  - a promise from Astral Security and Finance to get back to me

and wondered for a moment if I'd really sent it to the right place!  Have
I really missed so much in a month of being too busy to post on the list?


TIA & HAND

:-D


No David, I receive those messages also when I post. Just block them in your mail reader. As for your CMS question, don't know anything off hand that does it, but you can track timestamps in your database and show the "special" page for members that joined at a certain date/time or earlier.
--- End Message ---
--- Begin Message ---
I have a development box that uses our company's Exchange server as an smtp
host. All of a sudden, the php mail function has stopped working.
I can, however, send a message using mutt. 

Here's the output of the maillog: 

Apr 12 10:38:51 localhost sendmail[11879]: i3CFckaV011877:
to=<[EMAIL PROTECTED]>, ctladdr=<[EMAIL PROTECTED]> (48/48),
delay=00:00:04, xdelay=00:00:04, mailer=relay, pri=30323,
relay=sigma2.localdomain. [192.168.168.4], dsn=2.0.0, stat=Sent (OK)

As far as I can tell the message is being sent by sendmail. Any ideas on
where to look?

thanks,

Luis R. Lebron
Project Manager
Sigmatech, Inc

--- End Message ---
--- Begin Message --- Andy B wrote:
if i install php5 will it affect any of the php4.3.3 code that i have
running at all...?? i want to install 5 and see what they have new going on
and stuff but i dont want to crash my 4.3.3 running code any....

and where would i be able to read a list of stuff that is new in 5??

You _can_ run both PHP 5 and PHP 4 on the same server (and even at the same time), but I wouldn't recommend that. If you want to see an update on what all changed in PHP 5 just check out www.zend.com, they have articles with all the changes there.
--- End Message ---
--- Begin Message ---
Can anyone see why I'm getting this error message:

"Warning: No ending delimiter '^' found in
C:\Inetpub\wwwMIS_DEV\import_mvs.inc.php on line 126"

>From this line:

if(preg_match_all("^([00])?.*$",$called,$found))
        {
                substring($called,2,9);
        }

I basically have a phone bill that sometimes has the phone number
preceeded by "00" and sometimes not.

When it has the "00" I want to trim it with the substring command.

Thanks,

Jeff 

--- End Message ---
--- Begin Message --- Jeff McKeon wrote:
Can anyone see why I'm getting this error message:

"Warning: No ending delimiter '^' found in
C:\Inetpub\wwwMIS_DEV\import_mvs.inc.php on line 126"

From this line:

if(preg_match_all("^([00])?.*$",$called,$found)) { substring($called,2,9); }

I basically have a phone bill that sometimes has the phone number
preceeded by "00" and sometimes not.

When it has the "00" I want to trim it with the substring command.

Thanks,

Jeff


You need to enclose your regex in /regex/....

if ( preg_match_all ( "/^([00])?.*$/", $called, $found ) )

--
***********************************************************************
*  _  __       __      __       _                      * John  Nichel *
* | |/ /___ __ \ \    / /__ _ _| |__ ___  __ ___ _ __  * 716.856.9675 *
* | ' </ -_) _` \ \/\/ / _ \ '_| / /(_-<_/ _/ _ \ '  \ * 737 Main St. *
* |_|\_\___\__, |\_/\_/\___/_| |_\_\/__(_)__\___/_|_|_|* Suite #150   *
*          |___/                                       * Buffalo, NY  *
* http://www.KegWorks.com            [EMAIL PROTECTED] * 14203 - 1321 *
***********************************************************************

--- End Message ---
--- Begin Message ---
hi all,

i have a script that calls a popup like this:

<a href="/popup.php?name=Choices&amp;product_id=15" 
   target="_blank" 
   onclick="openWindow(this.href,600,200,'yes'); return
false;">Choices</a>

the &amp; is there to make sure the page validates. the problem is that
some browsers seem to be incorrectly translating this to:

[REQUEST_URI] => /popup.php?name=Choices&amp;product_id=15

instead of:

[REQUEST_URI] => /popup.php?name=Choices&product_id=15

a couple of browsers that have choked on this:

[HTTP_USER_AGENT] => Mozilla/4.0 (compatible; MSIE 4.0; Windows 95)
[HTTP_USER_AGENT] => Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-us)
AppleWebKit/103u (KHTML, like Gecko) Safari/100

i have safari 1.2.1 installed on one of my development machines, and
have had no trouble with the bad REQUEST_URIs. does anyone have some
insight into the problem?

i've posted a demonstration here:

http://hartshorne.ca/sandbox.php

you'll have to view the source of the popup to see if the & was
translated properly.

thanks,

beau

--- End Message ---

Reply via email to