[PHP] Socket warning

2004-02-17 Thread Tan Ai Leen
Hi all,
I programmed a server to bind to an external server(Let's call it 
C-server). My server will have to listen on the connection to C-server 
and send over data frequently. Each write of data to C-server from my 
server will cause C-server to response a string.
So the codes will be something like this:

if($response)
{   
socket_write($read_socket, "$response", strlen($response));
echo $response."\n";
}
...
some processing to construct string to be send over
...
foreach($message as $part)
{
socket_write($this->c_socket, $part);
echo $part."\n";
$out = socket_read($this->c_socket, 1024);
echo $out."\n";
error_log($part.":".$out."\n", 3, $this->logfile);
}
Everytime the execution reaches socket_write($this->c_socket, $part);
a php warning is issued

Warning:  socket_read() unable to read from socket [11]: Resource 
temporarily unavailable in 
/var/www/html/dreamscape_mg/connectors/celcom/mo.php on line 
134

Line 134 is the curl brace after the foreach. I am assuming that the 
socket read would be $out = socket_read($this->c_socket, $part). Why do 
I get the warning? c_socket is non blocking.

Thanks for your help
Ai Leen
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Headers Again

2004-02-17 Thread PETCOL
Jason,

What I shock, 307,000 entries returned.

Maybe someone with ability greater or other than I, should give some serious 
consideration to a solution or work around.

I've been using ColdFuion for 7 years and I can do a  anywhere in the page, no matter if I've run CFML, 
Javascript it still works.

Sorry I'm just frustrated.

Regards
Col


"Jason Wong" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
> On Tuesday 17 February 2004 09:57, PETCOL wrote:
> 
> > I have authenticated a user, after that I want to take them to another
> > page:
> >
> > Header("Location: welcome.php");
> >
> > But I get the following error?
> >
> > error
> > Cannot modify header information - headers already sent
> > error
> >
> > Suggestions?
> 
> google?
> 
> -- 
> 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
> --
> /*
> I don't want to achieve immortality through my work.  I want to achieve
> immortality through not dying.
> -- Woody Allen
> */

[PHP] Messenger via PHP

2004-02-17 Thread "Miguel J. Jiménez"
Hi, I want to know if there's a way to send MSN messenger messages thru 
PHP... If there is How can I do it? Thanks...



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

Re: [PHP] Headers Again

2004-02-17 Thread Jason Wong
On Tuesday 17 February 2004 16:37, PETCOL wrote:

What you're asking is a VERY FAQ. Something that's asked almost every other 
day. The list archives will have plenty of answers.

> What I shock, 307,000 entries returned.

If you don't want to trawl through those search results then read the error 
message again (carefully, all of it). If you still haven't figured it then 
read the manual entry for header(), every single line, then correlate what is 
said with the error message.

> Maybe someone with ability greater or other than I, should give some
> serious consideration to a solution or work around.

All the info you need is in the archives.

> I've been using ColdFuion for 7 years and I can do a  url="anotherlocation.htm"> anywhere in the page, no matter if I've run
> CFML, Javascript it still works.

You can do that as well, again, all the info you need is in the archives.

> Sorry I'm just frustrated.

I'm sure regulars on the list are just as frustrated at how often this 
question crops up and at how little research people do before asking another 
FAQ.

-- 
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
--
/*
Losing your drivers' license is just God's way of saying "BOOGA, BOOGA!"
*/

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



[PHP] Re: Messenger via PHP

2004-02-17 Thread Manuel Lemos
Hello,

On 02/17/2004 05:40 AM, "Miguel J. Jiménez" wrote:
Hi, I want to know if there's a way to send MSN messenger messages thru 
PHP... If there is How can I do it? Thanks...
I am not sure about sending messages, but here you may find a couple of 
classes that can communicate with MSN messenger servers.

http://www.phpclasses.org/browse/class/66.html



--

Regards,
Manuel Lemos
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/
Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] zip problem

2004-02-17 Thread Jason Wong
On Tuesday 17 February 2004 03:28, marc serra wrote:

> I want to know if it's possible to extract a zip file in PHP.
>
> I've read php documentation on ZZIPlib but i don't find any solution to
> extract file.
>
> Can you please help me to solve it.

The example in the manual shows how to open a zip archive and read each file 
into memory and display. It should be a straight forward matter to use the 
functions in "Filesystem functions" to write the uncompressed files to disk.

-- 
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
--
/*
If it seems too good to be true, it probably is
-- Murphy's Love Laws n10
*/

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



[PHP] problem with resultset

2004-02-17 Thread Angelo Zanetti
HI all,

I am querying a db and getting the resultset, then to get out each
individual field of the resultset (which is a single unique line all the
time)  as mysql_result($result2, 0, "p_company"). the problem is that if the
actual field has a space in it say "Sun microsystems", I only get "sun" and
it doesnt give me anything after the first space.

I have looked at the manual but as far as im concerned its really vague in
its description of alot of the mysql functions.
any idea what could be causing this??

thanx Angelo


Disclaimer 
This e-mail transmission contains confidential information,
which is the property of the sender.
The information in this e-mail or attachments thereto is 
intended for the attention and use only of the addressee. 
Should you have received this e-mail in error, please delete 
and destroy it and any attachments thereto immediately. 
Under no circumstances will the Cape Technikon or the sender 
of this e-mail be liable to any party for any direct, indirect, 
special or other consequential damages for any use of this e-mail.
For the detailed e-mail disclaimer please refer to 
http://www.ctech.ac.za/polic or call +27 (0)21 460 3911

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



Re: [PHP] Headers Again

2004-02-17 Thread PETCOL
Jason,

I appreciate people get just as frustrate by reading repetative posts.

Alliare and Macromedias forums for ColdFusion and other software, allow a
search through the entire post, archive everything.  Which always avoid this
problem of a newsgroup.  Maybe I'm wrong, but I don't thing there's a search
like this for a newsgroup?

If you do happen to know, as it would appear you may, the url of the answer
to the original question, then could you simply supply it.

I'm new to this code, I appreciate any assistance, and I will troll through
archives etc to get it.  However, if some kind sole can save me 3 hours
work, I'll also appreciate it, which is probably why this list get
repetative posts.

Cheers, relax, and have a nice day.

Col

"Jason Wong" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Tuesday 17 February 2004 16:37, PETCOL wrote:
>
> What you're asking is a VERY FAQ. Something that's asked almost every
other
> day. The list archives will have plenty of answers.
>
> > What I shock, 307,000 entries returned.
>
> If you don't want to trawl through those search results then read the
error
> message again (carefully, all of it). If you still haven't figured it then
> read the manual entry for header(), every single line, then correlate what
is
> said with the error message.
>
> > Maybe someone with ability greater or other than I, should give some
> > serious consideration to a solution or work around.
>
> All the info you need is in the archives.
>
> > I've been using ColdFuion for 7 years and I can do a  > url="anotherlocation.htm"> anywhere in the page, no matter if I've run
> > CFML, Javascript it still works.
>
> You can do that as well, again, all the info you need is in the archives.
>
> > Sorry I'm just frustrated.
>
> I'm sure regulars on the list are just as frustrated at how often this
> question crops up and at how little research people do before asking
another
> FAQ.
>
> -- 
> 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
> --
> /*
> Losing your drivers' license is just God's way of saying "BOOGA, BOOGA!"
> */

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



[PHP] Global vars or Environment var on Class

2004-02-17 Thread Turbo
Hi

I cann't call Global vars or Environment var on Class.How to's i do to 
call it?
I want to call variable same below.

var $location 
="http://".$HTTP_SERVER_VARS['HTTP_HOST'].$_SERVER['REQUEST_URI']."?".$HTTP_SERVER_VARS['QUERY_STRING']; 

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


[PHP] Re: Global vars or Environment var on Class

2004-02-17 Thread Vivian Steller
Turbo wrote:

> Hi
> 
> I cann't call Global vars or Environment var on Class.How to's i do to
> call it?
> I want to call variable same below.
> 
> var $location
> ="http://".$HTTP_SERVER_VARS['HTTP_HOST'].$_SERVER['REQUEST_URI']."?"
$HTTP_SERVER_VARS['QUERY_STRING'];
> 
> 
> Thank you.
> Turbo.

i would try the following:
- check if it works with $GLOBLAS['_SERVER']['REQUEST_URI']..., but I think
your implementation should work then, too.
- so: if you don't necessarily need this var to be a real class var (with
the only disadvantage not seeing it when asking for
get_class_vars("Class")) then let the var set by the constructor:

location = $GLOBLAS['_SERVER']['REQUEST_URI'] . ...;
}
}
?>

hope i could help.
vivi

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



[PHP] A date n the future

2004-02-17 Thread Shaun
Hi,

How can i tell if one date occurs before another date in the format
-mm-dd?

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



[PHP] UK Postcodes Format

2004-02-17 Thread Shaun
Hi,

does anyone know the format of the postcodes in the UK so I can keep my
database accurate?

Thanks

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



RE: [PHP] Headers Again

2004-02-17 Thread Michael Egan
Got to agree with Jason's comments - as I'm sure all other regulars on the list will 
do.

I've just had a quick look at the php.net site, done a search for "header" and halfway 
down the first page returned found this:

"Remember that header() must be called before any actual output is sent, either by 
normal HTML tags, blank lines in a file, or from PHP. It is a very common error to 
read code with include(), or require(), functions, or another file access function, 
and have spaces or empty lines that are output before header() is called. The same 
problem exists when using a single PHP/HTML file."

Not hard is it?

Regards,

Michael Egan

> -Original Message-
> From: PETCOL [mailto:[EMAIL PROTECTED]
> Sent: 17 February 2004 09:22
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Headers Again
> 
> 
> Jason,
> 
> I appreciate people get just as frustrate by reading repetative posts.
> 
> Alliare and Macromedias forums for ColdFusion and other 
> software, allow a
> search through the entire post, archive everything.  Which 
> always avoid this
> problem of a newsgroup.  Maybe I'm wrong, but I don't thing 
> there's a search
> like this for a newsgroup?
> 
> If you do happen to know, as it would appear you may, the url 
> of the answer
> to the original question, then could you simply supply it.
> 
> I'm new to this code, I appreciate any assistance, and I will 
> troll through
> archives etc to get it.  However, if some kind sole can save 
> me 3 hours
> work, I'll also appreciate it, which is probably why this list get
> repetative posts.
> 
> Cheers, relax, and have a nice day.
> 
> Col
> 
> "Jason Wong" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > On Tuesday 17 February 2004 16:37, PETCOL wrote:
> >
> > What you're asking is a VERY FAQ. Something that's asked 
> almost every
> other
> > day. The list archives will have plenty of answers.
> >
> > > What I shock, 307,000 entries returned.
> >
> > If you don't want to trawl through those search results 
> then read the
> error
> > message again (carefully, all of it). If you still haven't 
> figured it then
> > read the manual entry for header(), every single line, then 
> correlate what
> is
> > said with the error message.
> >
> > > Maybe someone with ability greater or other than I, 
> should give some
> > > serious consideration to a solution or work around.
> >
> > All the info you need is in the archives.
> >
> > > I've been using ColdFuion for 7 years and I can do a  > > url="anotherlocation.htm"> anywhere in the page, no 
> matter if I've run
> > > CFML, Javascript it still works.
> >
> > You can do that as well, again, all the info you need is in 
> the archives.
> >
> > > Sorry I'm just frustrated.
> >
> > I'm sure regulars on the list are just as frustrated at how 
> often this
> > question crops up and at how little research people do before asking
> another
> > FAQ.
> >
> > -- 
> > 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
> > --
> > /*
> > Losing your drivers' license is just God's way of saying 
> "BOOGA, BOOGA!"
> > */
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

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



Re: [PHP] UK Postcodes Format

2004-02-17 Thread Roddie Grant
on 17/2/04 10:25 am, Shaun at [EMAIL PROTECTED] wrote:

> Hi,
> 
> does anyone know the format of the postcodes in the UK so I can keep my
> database accurate?
> 
> Thanks


Try http://javascript.internet.com/forms/uk-postcode-validation.html

Roddie Grant
[EMAIL PROTECTED]

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



[PHP] Re: UK Postcodes Format

2004-02-17 Thread Michael Nolan
Shaun wrote:

Hi,

does anyone know the format of the postcodes in the UK so I can keep my
database accurate?
Thanks

http://www.royalmail.com/portal/rm/content1?catId=400044&mediaId=9200078#3400055

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


Re: [PHP] Headers Again

2004-02-17 Thread Stuart
PETCOL wrote:
Alliare and Macromedias forums for ColdFusion and other software, allow a
search through the entire post, archive everything.  Which always avoid this
problem of a newsgroup.  Maybe I'm wrong, but I don't thing there's a search
like this for a newsgroup?
http://marc.theaimsgroup.com/?l=php-general

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


Re: [PHP] A date n the future

2004-02-17 Thread Stuart
Shaun wrote:
How can i tell if one date occurs before another date in the format
-mm-dd?
$date1 = '2004-01-01';
$date2 = '2004-02-01';
if (strtotime($date1) < strtotime($date2))
{
...
}
--
Stuart
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re[2]: [PHP] Headers Again

2004-02-17 Thread Richard Davey
Hello PETCOL,

Tuesday, February 17, 2004, 8:37:15 AM, you wrote:

>> google?

P> What I shock, 307,000 entries returned.

Assuming you're running Windows, do what I do and download the Windows
CHM help file version of the PHP manual. It includes standard
search capabilities, so clicking on Search and entering "header" will
bring you back exactly what you need to know.

In this case it's the top 2 results.

Takes like 3 minutes at the most.

Then if the manual description doesn't help enough you can check out
the on-line annotated manual and post messages to this list without
receiving sarcastic replies back again.

P> I've been using ColdFuion for 7 years and I can do a
P>  anywhere in the page, no
P> matter if I've run CFML, Javascript it still works.

Yes, ASP does similar with Response.Redirect - but you're in PHP land
now so why not get yourself a copy of the PHP bible? It'll save you SO
much hassle.

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

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



php-general Digest 17 Feb 2004 11:39:20 -0000 Issue 2595

2004-02-17 Thread php-general-digest-help

php-general Digest 17 Feb 2004 11:39:20 - Issue 2595

Topics (messages 177886 through 177923):

Ora_Parse failed
177886 by: Matt Hillebrand
177888 by: Matt Hillebrand

Re: How many days between two dates
177887 by: Marek Kilimajer

Steps to installin PHP on apache 2
177889 by: Philip J. Newman
177890 by: Stuart
177891 by: Richard Davey

pdflib alternatives
177892 by: Fernando M. Maresca
177894 by: James Kaufman

Re: Opening a popup window?
177893 by: memoimyself.yahoo.com.br

Headers Again
177895 by: PETCOL
177896 by: John Nichel
177903 by: Jason Wong
177907 by: PETCOL
177911 by: Jason Wong
177913 by: PETCOL
177918 by: Michael Egan
177921 by: Stuart
177923 by: Richard Davey

Problems with authentication (I think)
177897 by: Leif Gregory
177898 by: Leif Gregory

PowerPoint to html converter, server-side
177899 by: Andrew Warner

Re: Are variables persistent?
177900 by: André Cerqueira

Algorithm
177901 by: Bob Eldred
177902 by: Martin Towell
177904 by: Manuel Vázquez Acosta
177905 by: Bob Eldred

Socket warning
177906 by: Tan Ai Leen

Messenger via PHP
177908 by: "Miguel J. Jiménez"
177910 by: Manuel Lemos

Re: zip problem
177909 by: Jason Wong

problem with resultset
177912 by: Angelo Zanetti

Global vars or Environment var on Class
177914 by: Turbo
177915 by: Vivian Steller

A date n the future
177916 by: Shaun
177922 by: Stuart

UK Postcodes Format
177917 by: Shaun
177919 by: Roddie Grant
177920 by: Michael Nolan

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 ---
I have an Oracle 8 problem. Unfortunately, I can't use the OCI functions and must use 
the ORA functions. The code below looks fine to me. It will return *almost* all of the 
rows, but then the script just dies with no warnings or errors, even though I have 
called error_reporting(E_ALL). I do get the following error message in an Apache error 
log:
 
Ora_Parse failed (ORA-00936: missing expression -- while processing OCI function 
OPARSE).

Here's my code:

ora_parse() failed: ".ora_error());
   ora_exec($cursor) or die("ora_exec() failed: ".ora_error());

   print '';
   $rowcount = 0;

   while(ora_fetch($cursor)) {
  print '';
  for($i=0; $i$cell_data";
  }
  print "\n";
   }

   print '';
?>

Thanks for any advice.
Matt

 
--- End Message ---
--- Begin Message ---
I modified that code to make it more readable. You may be wondering why the $columns 
variable looks like a string and then later like an array. Don't worrythere's no 
bug there. The $query variable actually equals "select ${columns_imploded} from 
${state}_spell where ${where_clauses}";
 
Matt

Matt Hillebrand <[EMAIL PROTECTED]> wrote:
I have an Oracle 8 problem. Unfortunately, I can't use the OCI functions and must use 
the ORA functions. The code below looks fine to me. It will return *almost* all of the 
rows, but then the script just dies with no warnings or errors, even though I have 
called error_reporting(E_ALL). I do get the following error message in an Apache error 
log:
 
Ora_Parse failed (ORA-00936: missing expression -- while processing OCI function 
OPARSE).

Here's my code:

ora_parse() failed: ".ora_error());
   ora_exec($cursor) or die("ora_exec() failed: ".ora_error());

   print '';
   $rowcount = 0;

   while(ora_fetch($cursor)) {
  print '';
  for($i=0; $i$cell_data";
  }
  print "\n";
   }

   print '';
?>

Thanks for any advice.
Matt

 
--- End Message ---
--- Begin Message ---
Shaun wrote:
"Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Shaun wrote:

Hi,

how can I check how many days are between two given dates?

Thanks for your help

There are many ways, it would help if you tell us what form are the
dates in - timestamp, formated string, sql date column ...


Sorry,

The dates are retrieved from the database so are stored as -MM-DD
HH-MM-SS in MySQL
Thanks for your help

Let mysql do it:

SELECT TO_DAYS(date1) - TO_DAYS(date2) AS number_of_days ...
--- End Message ---
--- Begin Message ---
Can someone send me a link to where i can find easy to read docs on 
getting php set up on Apache ...
--- End Message ---
--- Begin Message ---
Philip J. Newman wrote:
Can someone send me a link to where i can find easy to read docs on 
getting php set up on Apache ...
You're kidding right?!?!?!?

http://php.net/install.apache2

Introducing the PHP Documentation - all you ever wanted to know about 
PHP in one convenient location in several formats an

[PHP] How to calculate my local time?

2004-02-17 Thread Hamid Hossain
Hi,

My local time zone is GMT+3

My website is located in a remote server with different time zone.

So, How to calculate my time zone using the GMT functions in PHP?

Regards,
Hamid Hossain
---
Check Amazon.com Latest PHP books:
http://www.amazon.com/exec/obidos/redirect?tag=zawraqclassif-20&path=tg/browse/-/295223
Start Accepting CreditCard at your site in minutes:
http://www.2checkout.com/cgi-bin/aff.2c?affid=106720
Download Alexa Tool Bar to stop Pop-ups for FREE:
http://download.alexa.com/?amzn_id=zawraqclassif-20
Download Ready-Made Templates for your site:
http://www.aplustemplates.com/cgi/affiliates/c1.cgi/zawraq_ad
_
The new MSN 8: advanced junk mail protection and 2 months FREE* 
http://join.msn.com/?page=features/junkmail

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


Re: [PHP] Headers Again

2004-02-17 Thread PETCOL
Stuart

Thank you.


"Stuart" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> PETCOL wrote:
> > Alliare and Macromedias forums for ColdFusion and other software, allow
a
> > search through the entire post, archive everything.  Which always avoid
this
> > problem of a newsgroup.  Maybe I'm wrong, but I don't thing there's a
search
> > like this for a newsgroup?
>
> http://marc.theaimsgroup.com/?l=php-general
>
> -- 
> Stuart

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



Re: [PHP] Headers Again

2004-02-17 Thread PETCOL
Michael,

So are you answering my problem not, really just antaganising it.

I've tried ob_end_flush();  it didn't work, maybe it's a server
configuration issue.  Maybe it's just php can not do it?

So pleased to hear the php community is here to help each other.

For those of you who are making the effort I thank you.

Col

"Michael Egan" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Got to agree with Jason's comments - as I'm sure all other regulars on the
list will do.

I've just had a quick look at the php.net site, done a search for "header"
and halfway down the first page returned found this:

"Remember that header() must be called before any actual output is sent,
either by normal HTML tags, blank lines in a file, or from PHP. It is a very
common error to read code with include(), or require(), functions, or
another file access function, and have spaces or empty lines that are output
before header() is called. The same problem exists when using a single
PHP/HTML file."

Not hard is it?

Regards,

Michael Egan

> -Original Message-
> From: PETCOL [mailto:[EMAIL PROTECTED]
> Sent: 17 February 2004 09:22
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Headers Again
>
>
> Jason,
>
> I appreciate people get just as frustrate by reading repetative posts.
>
> Alliare and Macromedias forums for ColdFusion and other
> software, allow a
> search through the entire post, archive everything.  Which
> always avoid this
> problem of a newsgroup.  Maybe I'm wrong, but I don't thing
> there's a search
> like this for a newsgroup?
>
> If you do happen to know, as it would appear you may, the url
> of the answer
> to the original question, then could you simply supply it.
>
> I'm new to this code, I appreciate any assistance, and I will
> troll through
> archives etc to get it.  However, if some kind sole can save
> me 3 hours
> work, I'll also appreciate it, which is probably why this list get
> repetative posts.
>
> Cheers, relax, and have a nice day.
>
> Col
>
> "Jason Wong" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > On Tuesday 17 February 2004 16:37, PETCOL wrote:
> >
> > What you're asking is a VERY FAQ. Something that's asked
> almost every
> other
> > day. The list archives will have plenty of answers.
> >
> > > What I shock, 307,000 entries returned.
> >
> > If you don't want to trawl through those search results
> then read the
> error
> > message again (carefully, all of it). If you still haven't
> figured it then
> > read the manual entry for header(), every single line, then
> correlate what
> is
> > said with the error message.
> >
> > > Maybe someone with ability greater or other than I,
> should give some
> > > serious consideration to a solution or work around.
> >
> > All the info you need is in the archives.
> >
> > > I've been using ColdFuion for 7 years and I can do a  > > url="anotherlocation.htm"> anywhere in the page, no
> matter if I've run
> > > CFML, Javascript it still works.
> >
> > You can do that as well, again, all the info you need is in
> the archives.
> >
> > > Sorry I'm just frustrated.
> >
> > I'm sure regulars on the list are just as frustrated at how
> often this
> > question crops up and at how little research people do before asking
> another
> > FAQ.
> >
> > -- 
> > 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
> > --
> > /*
> > Losing your drivers' license is just God's way of saying
> "BOOGA, BOOGA!"
> > */
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

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



Re: [PHP] Headers Again

2004-02-17 Thread Stuart
PETCOL wrote:
Stuart

Thank you.
Don't thank me[1], thank them. Preferably with cash[2].

[1] I will accept cash if offered.
[2] http://marc.theaimsgroup.com/?q=about#Begware
--
Stuart
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re[2]: [PHP] Headers Again

2004-02-17 Thread Richard Davey
Hello PETCOL,

Tuesday, February 17, 2004, 11:52:25 AM, you wrote:

P> I've tried ob_end_flush();  it didn't work, maybe it's a server
P> configuration issue.  Maybe it's just php can not do it?

Have a look at the headers_sent() function to see *where* your script is
outputting the headers you don't want it to.

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

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



Re: [PHP] pdflib alternatives

2004-02-17 Thread Fernando M. Maresca
> > Is there are any alternatives to the pdflib for on the fly generation of
> > printable documents? May be a postcript lib?
> 
> http://www.fpdf.org/?lang=en
> 
> -- 
> Jim Kaufman
> Linux Evangelist
> public key 0x6D802619
> http://www.linuxforbusiness.net
> 
Thanks Jim, it's what i need.
-- 

Fernando M. Maresca

Cel: (54) 221 15 502 3938
Cel: 0221-15-502-3938

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



RE: [PHP] UK Postcodes Format

2004-02-17 Thread Ford, Mike [LSS]
On 17 February 2004 10:43, Roddie Grant wrote:

> on 17/2/04 10:25 am, Shaun at [EMAIL PROTECTED] wrote:
> 
> > Hi,
> > 
> > does anyone know the format of the postcodes in the UK so I can
> > keep my database accurate? 
> > 
> > Thanks
> 
> 
> Try http://javascript.internet.com/forms/uk-postcode-validation.html

Wow, at a glance I'd say that looks like pretty crappy JavaScript, and also not a 
totally accurate UK postcode checker.

The only guaranteed way to fully validate a UK postcode is to purchase the Royal 
Mail's Postcode Address File (PAF) (and subscribe to its updates!), but you can 
validate the format fairly closely with some simple rules.

For example, here's a regexp that matches valid UK postcode patterns:

   /[A-Z]{1,2}[0-9][0-9A-Z]? [0-9][ABD-HJLNP-UW-Z]{1,2}/

or, in English:

* an "outward" code consisting of:
  - 1 or 2 alphabetic characters
  - followed by 1 or 2 digits, or 1 digit and 1 letter

* a space

* in "inward" code consisting of:
  - 1 digit
  - followed by 2 letters, but not including C, I, K, M, O or V.

(The special code GIR 0AA also exists for the headquarters of the 
formerly-Government-owned Girobank, now part of the Alliance & Leicester, and is the 
only one that doesn't match these rules).

Although this will check for potentially valid formats, there are a number of other 
checks you can make if you wish:

- the initial 1 or 2 letters come from a restricted set of about 120, indicating the 
main sorting office which handles mail for an area -- generally they correspond to a 
large town or city (B - Birmingham, L - Liverpool, LS - Leeds, etc.) but London ones 
are taken from the much older London postal district names (E - East, EC - East 
Central, etc.) and a few represent more general area names (ZE - Shetland Islands, for 
example.  (I could probably produce a list of these fairly easily.)

- The range of values in the rest of the "outward" code is likewise restricted; the 
range is different for each area, with many restricted to 20 or less, and none uses 
the full set of 1-99; however, higher values are often used for special purposes (98 
and 99 for PO Boxes, for example), and most of the larger areas have multiple disjoint 
ranges.

- The only postcodes which have a final letter in the "outward" portion of the code 
are some of the London districts (off the top of my head, EC, SW, W and WC only, I 
think, and maybe not all of those!).

- For each "outward" code, there may also be restrictions on the range of "inward" 
codes, and these will again be different for each area (for example, for my home 
outward code all inward codes begin with a 2; in the neighbouring outward code, all 
inward codes begin with a 3).  These are so numerous and diverse that they're not 
really worth bothering about unless you're going the full-blown PAF route.

Anyway, this is probably already far more information than you were expecting, so I'll 
shut up now!

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: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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



Re: [PHP] How to calculate my local time?

2004-02-17 Thread Richard Davey
Hello Hamid,

Tuesday, February 17, 2004, 11:47:32 AM, you wrote:

HH> My local time zone is GMT+3
HH> My website is located in a remote server with different time zone.
HH> So, How to calculate my time zone using the GMT functions in PHP?

There is an unknown part of your equation - the timezone of the
server.

Assuming your server is GMT-5 (i.e. hosted in the States) - that means
it is 8 hours behind you, so:

$my_time = strtotime("+8 hours");

Assuming your server is GMT+8 - that means it is 5 hours ahead of you:

$my_time = strtotime("-5 hours");

This will give you a timestamp based on now() on your server, adjusted
accordingly. Do with this what you will.

strtotime is your friend :)

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

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



Re: [PHP] How to calculate my local time?

2004-02-17 Thread Dr Ben Guofu Wu
Shouldn't you use javascript to get the local time of the HTTP client, and 
use PHP to get the time of the server?
Ben
On Tuesday 17 February 2004 11:47, Hamid Hossain wrote:
> [EMAIL PROTECTED]

-- 
Dr Ben Guofu Wu
Programming Director
Tel: 01743-340034 Fax: 01743-368214
Icom Innovations, http://www.icom-web.com
140a Longden Colham,
Shrewsbury, Shropshire, SY3 7DN

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



[PHP] php and texfield values

2004-02-17 Thread Angelo Zanetti
Say I want to populate a textfield from a resultset and the resultset's
field has 2 words in it say: mike smith.
when I echo the value out to the texfields value it only displays mike and
not mike smith, I cant understand why.

here is my code:


   

>

is the space between mike and smith possibly causing it to only recognize
the first word as all that is needed. Should i be running some function on
the returned value or is my code for entering the value of the textfield
simply incorrect??

TIA
Angelo


Disclaimer 
This e-mail transmission contains confidential information,
which is the property of the sender.
The information in this e-mail or attachments thereto is 
intended for the attention and use only of the addressee. 
Should you have received this e-mail in error, please delete 
and destroy it and any attachments thereto immediately. 
Under no circumstances will the Cape Technikon or the sender 
of this e-mail be liable to any party for any direct, indirect, 
special or other consequential damages for any use of this e-mail.
For the detailed e-mail disclaimer please refer to 
http://www.ctech.ac.za/polic or call +27 (0)21 460 3911

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



Re: [PHP] UK Postcodes Format

2004-02-17 Thread Roddie Grant
on 17/2/04 12:14 pm, Ford, Mike   [LSS] at [EMAIL PROTECTED]
wrote:

> On 17 February 2004 10:43, Roddie Grant wrote:
> 
>> on 17/2/04 10:25 am, Shaun at [EMAIL PROTECTED] wrote:
>> 
>>> Hi,
>>> 
>>> does anyone know the format of the postcodes in the UK so I can
>>> keep my database accurate?
>>> 
>>> Thanks
>> 
>> 
>> Try http://javascript.internet.com/forms/uk-postcode-validation.html
> 
> Wow, at a glance I'd say that looks like pretty crappy JavaScript, and also
> not a totally accurate UK postcode checker.
> 
> The only guaranteed way to fully validate a UK postcode is to purchase the
> Royal Mail's Postcode Address File (PAF) (and subscribe to its updates!), but
> you can validate the format fairly closely with some simple rules.
> 
> For example, here's a regexp that matches valid UK postcode patterns:
> 
>  /[A-Z]{1,2}[0-9][0-9A-Z]? [0-9][ABD-HJLNP-UW-Z]{1,2}/



Hmm, I hadn't actually looked at the JavaScript - just at the description of
how postcodes are structured. But the link to the Royal Mail site is much
better for that.  If only Royal Mail had remembered programmers when
they thought up the postcode system.

Mike, I'm very impressed with your knowledge of postcodes! Even better than
the Royal Mail site.

Roddie Grant
[EMAIL PROTECTED]

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



RE: [PHP] php and texfield values

2004-02-17 Thread Angelo Zanetti

I also tried this to get the result from resultset:

echo(mysql_result($result2, 0, "p_company"));


-Original Message-
From: Angelo Zanetti [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 17, 2004 2:52 PM
To: [EMAIL PROTECTED]
Subject: [PHP] php and texfield values


Say I want to populate a textfield from a resultset and the resultset's
field has 2 words in it say: mike smith.
when I echo the value out to the texfields value it only displays mike and
not mike smith, I cant understand why.

here is my code:


   

>

is the space between mike and smith possibly causing it to only recognize
the first word as all that is needed. Should i be running some function on
the returned value or is my code for entering the value of the textfield
simply incorrect??

TIA
Angelo


Disclaimer 
This e-mail transmission contains confidential information,
which is the property of the sender.
The information in this e-mail or attachments thereto is 
intended for the attention and use only of the addressee. 
Should you have received this e-mail in error, please delete 
and destroy it and any attachments thereto immediately. 
Under no circumstances will the Cape Technikon or the sender 
of this e-mail be liable to any party for any direct, indirect, 
special or other consequential damages for any use of this e-mail.
For the detailed e-mail disclaimer please refer to 
http://www.ctech.ac.za/polic or call +27 (0)21 460 3911

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


Disclaimer 
This e-mail transmission contains confidential information,
which is the property of the sender.
The information in this e-mail or attachments thereto is 
intended for the attention and use only of the addressee. 
Should you have received this e-mail in error, please delete 
and destroy it and any attachments thereto immediately. 
Under no circumstances will the Cape Technikon or the sender 
of this e-mail be liable to any party for any direct, indirect, 
special or other consequential damages for any use of this e-mail.
For the detailed e-mail disclaimer please refer to 
http://www.ctech.ac.za/polic or call +27 (0)21 460 3911

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



[PHP] ob_start() and session_start() conflicts

2004-02-17 Thread Duncan
Hi,

I am currently working on a download script, where I use a session 
variable to make sure that the downloaded file cannot be linked directly.
However, this protection is not mandatory, so that a download can also 
be created, which can be initiated via a direct link.

So, I'm using the following for the file download:

   ob_start();
   $filename = $sql_result[0];
   $type = $sql_result[1];
   $path = $sql_result[2];
  
   header("Content-Type: $type");
   header("Content-Disposition: attachment; filename=$filename");
   readfile($path);
   ob_end_flush();

...which is working just fine as a standalone, but as soon as I add

session_start();

before the ob_start() call, then the download is no longer working properly.
The following happens in such a case:
if the browser window was used to click through the script and initiate 
the download, then the file can be downloaded properly.
if a new browser window gets opened and you try to access the file 
download via a direct link, then you get the filename presented for 
download without type and path info, e.g.:

Filename: index.php?cmd=download&id=12
Type:
Path:
As soon as I comment the session_start(); it's working just fine, though 
and the file can be downloaded properly via direct access.

Am I right to assume, that since the session_start(); is sending headers 
as well, the ob_start cannot work properly anymore?
And since it only happens when you're opening a new window and try to 
access it directly, I assume it's related to the fact, that the session 
gets set at the user end with a cookie and therefor causes the problem?
Would preventing session cookies and using trans_id maybe help here?

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


RE: [PHP] UK Postcodes Format

2004-02-17 Thread Angela K Hilton
I 'Think' there are also different formats for military bases here and
overseas.

[this is a faint memory from validating post codes in a database some
years ago]

A

***
Angela K Hilton
Web & E-Learning Officer
ISD, UMIST
Tel: 0161 306 3109
***


-Original Message-
From: Ford, Mike [LSS] [mailto:[EMAIL PROTECTED] 
Sent: 17 February 2004 12:15
To: 'Roddie Grant'; Shaun; [EMAIL PROTECTED]
Subject: RE: [PHP] UK Postcodes Format

On 17 February 2004 10:43, Roddie Grant wrote:

> on 17/2/04 10:25 am, Shaun at [EMAIL PROTECTED] wrote:
> 
> > Hi,
> > 
> > does anyone know the format of the postcodes in the UK so I can
> > keep my database accurate? 
> > 
> > Thanks
> 
> 
> Try http://javascript.internet.com/forms/uk-postcode-validation.html

Wow, at a glance I'd say that looks like pretty crappy JavaScript, and
also not a totally accurate UK postcode checker.

The only guaranteed way to fully validate a UK postcode is to purchase
the Royal Mail's Postcode Address File (PAF) (and subscribe to its
updates!), but you can validate the format fairly closely with some
simple rules.

For example, here's a regexp that matches valid UK postcode patterns:

   /[A-Z]{1,2}[0-9][0-9A-Z]? [0-9][ABD-HJLNP-UW-Z]{1,2}/

or, in English:

* an "outward" code consisting of:
  - 1 or 2 alphabetic characters
  - followed by 1 or 2 digits, or 1 digit and 1 letter

* a space

* in "inward" code consisting of:
  - 1 digit
  - followed by 2 letters, but not including C, I, K, M, O or V.

(The special code GIR 0AA also exists for the headquarters of the
formerly-Government-owned Girobank, now part of the Alliance &
Leicester, and is the only one that doesn't match these rules).

Although this will check for potentially valid formats, there are a
number of other checks you can make if you wish:

- the initial 1 or 2 letters come from a restricted set of about 120,
indicating the main sorting office which handles mail for an area --
generally they correspond to a large town or city (B - Birmingham, L -
Liverpool, LS - Leeds, etc.) but London ones are taken from the much
older London postal district names (E - East, EC - East Central, etc.)
and a few represent more general area names (ZE - Shetland Islands, for
example.  (I could probably produce a list of these fairly easily.)

- The range of values in the rest of the "outward" code is likewise
restricted; the range is different for each area, with many restricted
to 20 or less, and none uses the full set of 1-99; however, higher
values are often used for special purposes (98 and 99 for PO Boxes, for
example), and most of the larger areas have multiple disjoint ranges.

- The only postcodes which have a final letter in the "outward" portion
of the code are some of the London districts (off the top of my head,
EC, SW, W and WC only, I think, and maybe not all of those!).

- For each "outward" code, there may also be restrictions on the range
of "inward" codes, and these will again be different for each area (for
example, for my home outward code all inward codes begin with a 2; in
the neighbouring outward code, all inward codes begin with a 3).  These
are so numerous and diverse that they're not really worth bothering
about unless you're going the full-blown PAF route.

Anyway, this is probably already far more information than you were
expecting, so I'll shut up now!

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: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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

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



[PHP] regular expressions

2004-02-17 Thread pete M
Getting completely confused how this stuff works !!!

Anyone recommend a book for a regex newbie ?

pete

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


Re: [PHP] php and texfield values

2004-02-17 Thread Richard Davey
Hello Angelo,

Tuesday, February 17, 2004, 12:52:13 PM, you wrote:

AZ> Say I want to populate a textfield from a resultset and the resultset's
AZ> field has 2 words in it say: mike smith.
AZ> when I echo the value out to the texfields value it only displays mike and
AZ> not mike smith, I cant understand why.

I would suggest tidying up the code a little to make life easier for
yourself. You don't have to have it in-line with the HTML:





Also if your database entry has quote marks in it, it will break this.
Here is one (of many) ways to solve it:

$value = htmlspecialchars($row['p_company']);

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

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



Re: [PHP] regular expressions

2004-02-17 Thread Matt Matijevich

Anyone recommend a book for a regex newbie ?


O'Reilly usually has some good stuff
http://www.oreilly.com/catalog/regex/

There is plenty of tutorials online too, just google and you will get a
bunch of results.

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



[PHP] Re: problem with resultset

2004-02-17 Thread memoimyself
Hello Angelo,

On 17 Feb 2004 at 11:21, Angelo Zanetti wrote:

> I am querying a db and getting the resultset, then to get out each
> individual field of the resultset (which is a single unique line all
> the time)  as mysql_result($result2, 0, "p_company"). the problem is
> that if the actual field has a space in it say "Sun microsystems", I
> only get "sun" and it doesnt give me anything after the first space. 

Weird, weird, weird. I'm afraid I don't have a solution to this specific problem, but 
may I 
ask why you're using mysql_result() instead of mysql_fetch_object() or 
mysql_fetch_array()? I've been coding in PHP for over four years and can't remember 
using mysql_result() on a single occasion. (Granted, it could very well be that I'm 
dumb, 
but at least you have something to think about.)

Cheers,

Erik

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



[PHP] Re: regular expressions

2004-02-17 Thread Ben Ramsey
I've always found the PHP manual to be very helpful:
http://www.php.net/manual/en/pcre.pattern.syntax.php
Pete M wrote:
Getting completely confused how this stuff works !!!

Anyone recommend a book for a regex newbie ?

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


Re: [PHP] Headers Again

2004-02-17 Thread Jason Wong
On Tuesday 17 February 2004 17:21, PETCOL wrote:

> Alliare and Macromedias forums for ColdFusion and other software, allow a
> search through the entire post, archive everything.  Which always avoid
> this problem of a newsgroup.  Maybe I'm wrong, but I don't thing there's a
> search like this for a newsgroup?

Umm, did you take a look at my signature? 

> If you do happen to know, as it would appear you may, the url of the answer
> to the original question, then could you simply supply it.

I do not know the url of the answer to the original question off hand. But I 
can assure you that a quick search of the archives will uncover plenty of 
answers.

> I'm new to this code, I appreciate any assistance, and I will troll through
> archives etc to get it.  However, if some kind sole can save me 3 hours
> work, I'll also appreciate it, which is probably why this list get
> repetative posts.

The trouble with this list is that it is too friendly and useful! People use 
it as the first resort instead of using the manual, the archives and of 
course google.

-- 
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
--
/*
If there is any realistic deterrent to marriage, it's the fact that you
can't afford divorce.
-- Jack Nicholson
*/

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



[PHP] Re: regular expressions

2004-02-17 Thread Ben Ramsey
I also forgot to mention this book, which I've never used, but I picked 
it up once and it seemed very helpful:

Regular Expression Pocket Reference
published by O'Reilly
http://www.amazon.com/exec/obidos/tg/detail/-/059600415X/qid=1077025752/sr=1-2/ref=sr_1_2/102-1251244-5472167?v=glance&s=books
Ben Ramsey wrote:

I've always found the PHP manual to be very helpful:
http://www.php.net/manual/en/pcre.pattern.syntax.php
Pete M wrote:

Getting completely confused how this stuff works !!!

Anyone recommend a book for a regex newbie ?

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


[PHP] destroy session

2004-02-17 Thread Natalia Sensini
I want to destroy a session when you click in a sing out link,
something like this

a href= link
onClick="session_destroy()"

Is ti possible? how?


Re: [PHP] Messenger via PHP

2004-02-17 Thread Raditha Dissanayake
How about channeling this through jabber?  (http://www.jabber.org)

Miguel J. Jiménez wrote:

Hi, I want to know if there's a way to send MSN messenger messages 
thru PHP... If there is How can I do it? Thanks...





--
Raditha Dissanayake.

http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 150 KB | with progress bar.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] PLEASE HELP on ClibPDF, didn't receive any answers so far....

2004-02-17 Thread Jan Broermann

Hi List, 
to say it up front, this is none of these how do I I do (with PHP) what Javascript  is 
supposed to be for (Client Side)? Or my computer is broken how do I fix it, I'm deeply 
in the need for help.

 
I run Apache 1.3.x
with PHP 4.3.1
on Win2000
 

I'm doing a paper comparing some of the PDF Creating Tools and I'm having no fun at all
with the Clibpdf Lib. By the way, if you google it is realy hard not find the PHP 
Manual, which
is great, but doesn't realy help, especially if you find it 10.000 times. ;-)


This is the output I get:
on oppening Adobe Reader (6) 
 I get the message Illegal Operation 'TM' outside Text object???
+ the picture doesn't show (no error message)
+ all text is in the same line. (but not the header surprisingly)


Below is my code, which works perfectly when using PDFLib, but as I said I need ClibPDF
If you can't help me, please give me a tutorial or forum where I can get help.

I need help on the stated problems above + how do I save the header stream to a file? 
If I try it with the fopen I get an incorrect PDF.

many many thx
Janbro










__
Nachrichten, Musik und Spiele schnell und einfach per Quickstart im 
WEB.DE Screensaver - Gratis downloaden: http://screensaver.web.de/?mc=021110

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



Re: [PHP] php and texfield values

2004-02-17 Thread Jarratt Ingram
Hello Angelo

Have you tried, 



You are missing in your example the closing " tag for the value
parameter. 

regards 
Jarratt



On Tue, 2004-02-17 at 12:52, Angelo Zanetti wrote:
> Say I want to populate a textfield from a resultset and the resultset's
> field has 2 words in it say: mike smith.
> when I echo the value out to the texfields value it only displays mike and
> not mike smith, I cant understand why.
> 
> here is my code:
> 
> 
> 
>  {   echo("value=" . $row["p_company"]); }?>
> 
> >
> 
> is the space between mike and smith possibly causing it to only recognize
> the first word as all that is needed. Should i be running some function on
> the returned value or is my code for entering the value of the textfield
> simply incorrect??
> 
> TIA
> Angelo
> 
> 
> Disclaimer 
> This e-mail transmission contains confidential information,
> which is the property of the sender.
> The information in this e-mail or attachments thereto is 
> intended for the attention and use only of the addressee. 
> Should you have received this e-mail in error, please delete 
> and destroy it and any attachments thereto immediately. 
> Under no circumstances will the Cape Technikon or the sender 
> of this e-mail be liable to any party for any direct, indirect, 
> special or other consequential damages for any use of this e-mail.
> For the detailed e-mail disclaimer please refer to 
> http://www.ctech.ac.za/polic or call +27 (0)21 460 3911

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



[PHP] [ANNOUNCE] :Possibility of SA PHP conference

2004-02-17 Thread Rory McKinley
Hi All

Just a quick question.My wife has gotten tired of me complaining about the lack of PHP 
(and LAMP in general I suppose) conferences etc in South Africa. Therefore, seeing as 
she runs a conference company she is thinking of hosting a PHP conference in South 
Africa, but before she get's going she needs some idea of how large the PHP 
community in SA (and neighbours) is to see whether it will be worthwhile.

Can anyone who thinks this is a good idea drop me a mail off-list, so that we can get 
some gauge of the scale of repsonse that is likely to happen should the conference 
take 
place. Also, if you like you can give me info re: which city it should take place in, 
people 
that you would like as speakers etc.

Thanks in advance

Rory McKinley
Nebula Solutions
+27 82 857 2391
[EMAIL PROTECTED]
"There are 10 kinds of people in this world, 
those who understand binary and those who don't" (Unknown)

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



Re: [PHP] destroy session

2004-02-17 Thread Richard Davey
Hello Natalia,

Tuesday, February 17, 2004, 2:27:07 PM, you wrote:

NS> I want to destroy a session when you click in a sing out link,
NS> something like this

NS> a href= link
NS> onClick="session_destroy()"

NS> Is ti possible? how?

Yes it's possible, but not like that. Make your link go to a page that
calls session_destroy().

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

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



Re: [PHP] destroy session

2004-02-17 Thread John Nichel
Natalia Sensini wrote:

I want to destroy a session when you click in a sing out link,
something like this
a href= link
onClick="session_destroy()"
Is ti possible? how?

Not like that.

// some code

if ( isset ( $_GET['session_destroy'] ) && $_GET['session_destroy'] == 
true ) {
	session_destroy();
}

// some more code



Logout

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: destroy session

2004-02-17 Thread Ben Ramsey
Take a look at the manual.  There is a session_destroy() function:
http://www.php.net/session
Natalia Sensini wrote:

I want to destroy a session when you click in a sing out link,
something like this
a href= link
onClick="session_destroy()"
Is ti possible? how?

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


[PHP] Re: [ANNOUNCE] :Possibility of SA PHP conference

2004-02-17 Thread Jakes
I'm another South African, and I think my wife is tired of hearing the same
thing!

South Africa is very Microsoft based, but it does seem to be changing
especially in the
last few years.

We don't we get a site together where we can have some sort voting poll
The more users we get voting on this poll to show the South African interest
in the PHP
community, the better the chance we have of getting  a conference down here.

Hey and to all Non South Africa who might read this Post - South Africa is
the place to be!!!
Things are cheap in most foreign currency and we have loads on scenery 
beats the hell out
of London, New York...  that's for sure!

One conference is all that we ask for! After that I know you guys will be
hooked forever...
just like our common language - PHP.

Give it try!

"Rory McKinley" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi All
>
> Just a quick question.My wife has gotten tired of me complaining about the
lack of PHP
> (and LAMP in general I suppose) conferences etc in South Africa.
Therefore, seeing as
> she runs a conference company she is thinking of hosting a PHP conference
in South
> Africa, but before she get's going she needs some idea of how large the
PHP
> community in SA (and neighbours) is to see whether it will be worthwhile.
>
> Can anyone who thinks this is a good idea drop me a mail off-list, so that
we can get
> some gauge of the scale of repsonse that is likely to happen should the
conference take
> place. Also, if you like you can give me info re: which city it should
take place in, people
> that you would like as speakers etc.
>
> Thanks in advance
>
> Rory McKinley
> Nebula Solutions
> +27 82 857 2391
> [EMAIL PROTECTED]
> "There are 10 kinds of people in this world,
> those who understand binary and those who don't" (Unknown)

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



[PHP] Re: [ANNOUNCE] :Possibility of SA PHP conference

2004-02-17 Thread Jakes
I'm another South African, and I think my wife is tired of hearing the same
thing!

South Africa is very Microsoft based, but it does seem to be changing
especially in the
last few years.

We don't we get a site together where we can have some sort voting poll
The more users we get voting on this poll to show the South African interest
in the PHP
community, the better the chance we have of getting  a conference down here.

Hey and to all Non South Africa who might read this Post - South Africa is
the place to be!!!
Things are cheap in most foreign currency and we have loads on scenery 
beats the hell out
of London, New York...  that's for sure!

One conference is all that we ask for! After that I know you guys will be
hooked forever...
just like our common language - PHP.

Give it try!

"Rory McKinley" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi All
>
> Just a quick question.My wife has gotten tired of me complaining about the
lack of PHP
> (and LAMP in general I suppose) conferences etc in South Africa.
Therefore, seeing as
> she runs a conference company she is thinking of hosting a PHP conference
in South
> Africa, but before she get's going she needs some idea of how large the
PHP
> community in SA (and neighbours) is to see whether it will be worthwhile.
>
> Can anyone who thinks this is a good idea drop me a mail off-list, so that
we can get
> some gauge of the scale of repsonse that is likely to happen should the
conference take
> place. Also, if you like you can give me info re: which city it should
take place in, people
> that you would like as speakers etc.
>
> Thanks in advance
>
> Rory McKinley
> Nebula Solutions
> +27 82 857 2391
> [EMAIL PROTECTED]
> "There are 10 kinds of people in this world,
> those who understand binary and those who don't" (Unknown)

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



[PHP] Re: destroy session

2004-02-17 Thread Jakes
rather have a link like ->   somepage.php?signout=true

on that page...

if($_GET['signout'] == true){
   session_destroy();
  header("location: someotherpage.php");
}else{
   // do something else
}

"Natalia Sensini" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
I want to destroy a session when you click in a sing out link,
something like this

a href= link
onClick="session_destroy()"

Is ti possible? how?

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



[PHP] [wandering OT!] RE: [PHP] UK Postcodes Format

2004-02-17 Thread Ford, Mike [LSS]
On 17 February 2004 12:45, Roddie Grant wrote:

> Hmm, I hadn't actually looked at the JavaScript - just at the
> description of how postcodes are structured. But the link to the
> Royal Mail site is much better for that.  If only Royal Mail
> had remembered programmers when they thought up the postcode system.

Well, I doubt there were many programmers around whn postcodes were being developed.  
The basic elements go back to Victorian times (the London postal districts, and 
division of other large cities into numbered areas), and most of the "outward" codes 
are based on internal Royal Mail codes that have probably been around equally as long. 
 Even the current postcode system was invented in the '50s, when I doubt there'd have 
been much thought of the need for being computer-friendly!

> Mike, I'm very impressed with your knowledge of postcodes! Even
> better than the Royal Mail site.

Well, it's been gleaned from many sources over a number of years (including keeping a 
number of moderately large mailing lists in order with the regular assistance of the 
old Post Code Directories) -- and every time someone asks a question like this, I seem 
to learn something else (this time a nugget about the GIR 0AA code!).  But I can still 
never remember exactly which letters aren't used in the inward codes, and have to go 
look them up every time...!

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: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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



[PHP] Re: destroy session

2004-02-17 Thread Jakes
rather have a link like ->   somepage.php?signout=true

on that page...

if($_GET['signout'] == true){
   session_destroy();
  header("location: someotherpage.php");
}else{
   // do something else
}

"Natalia Sensini" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
I want to destroy a session when you click in a sing out link,
something like this

a href= link
onClick="session_destroy()"

Is ti possible? how?

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



RE: [PHP] Re: [ANNOUNCE] :Possibility of SA PHP conference

2004-02-17 Thread Alex Hogan
You do have some nice scenery. 

My son is in the Texas Boys Choir and they hosted the Drakensberg Boys
Choir.  We are going to Drakensberg in the summer after Europe and can't
wait to see it other than pictures.

> -Original Message-
> From: Jakes [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, February 17, 2004 9:03 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Re: [ANNOUNCE] :Possibility of SA PHP conference
> 
> I'm another South African, and I think my wife is tired of hearing the
> same
> thing!
> 
> South Africa is very Microsoft based, but it does seem to be changing
> especially in the
> last few years.
> 
> We don't we get a site together where we can have some sort voting poll
> The more users we get voting on this poll to show the South African
> interest
> in the PHP
> community, the better the chance we have of getting  a conference down
> here.
> 
> Hey and to all Non South Africa who might read this Post - South Africa is
> the place to be!!!
> Things are cheap in most foreign currency and we have loads on scenery
> 
> beats the hell out
> of London, New York...  that's for sure!
> 
> One conference is all that we ask for! After that I know you guys will be
> hooked forever...
> just like our common language - PHP.
> 
> Give it try!
> 
> "Rory McKinley" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Hi All
> >
> > Just a quick question.My wife has gotten tired of me complaining about
> the
> lack of PHP
> > (and LAMP in general I suppose) conferences etc in South Africa.
> Therefore, seeing as
> > she runs a conference company she is thinking of hosting a PHP
> conference
> in South
> > Africa, but before she get's going she needs some idea of how large the
> PHP
> > community in SA (and neighbours) is to see whether it will be
> worthwhile.
> >
> > Can anyone who thinks this is a good idea drop me a mail off-list, so
> that
> we can get
> > some gauge of the scale of repsonse that is likely to happen should the
> conference take
> > place. Also, if you like you can give me info re: which city it should
> take place in, people
> > that you would like as speakers etc.
> >
> > Thanks in advance
> >
> > Rory McKinley
> > Nebula Solutions
> > +27 82 857 2391
> > [EMAIL PROTECTED]
> > "There are 10 kinds of people in this world,
> > those who understand binary and those who don't" (Unknown)
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




[PHP] PHP Login Page Issues

2004-02-17 Thread Pushpinder Singh
Hello Everyone,

I am making use of the following login module. However, it tells the 
user to login at least twice even if the username and password are 
correct. The data flow model is explained below :

The first 'correct' attempt will result in the user being redirected to 
the "logged_in.php" page.
The "logged_in.php" page is a intermediate page, which checks if a 
session 'validuser' exists and redirects the client to the welcome 
page. if the session does not exist then the user is redirected to the 
"Error Page" where he needs to login again.

The glitch in the above code is that in spite of entering the correct 
login and password, the user is redirected to the error page (via 
logged_in.php script ) EVERY TIME ON THE FIRST TRY. Each subsequent 
attempt (again assuming the correct username and password are entered) 
allows the users to get to the welcome screen.

Register_Globals is ON on the remote host,  I would really appreciate 
any pointers on this one. Thanks in advance.

regards
Pushpinder Singh
 START OF CODE 



error_reporting(E_ALL);

if ( (isset($_POST['validuser'])) && (isset($_POST['pass']))  )  {

  mysql_connect( 'localhost', 'name', 'pwd' )
 or die ( 'Unable to connect to server.' );
  // Select database on MySQL server
mysql_select_db( 'crm' )
   or die ( 'Unable to select database' );
  // Formulate the query
$sql1 = "SELECT * from `admin` where user = '{$_POST['validuser']}' 
AND pwd = '{$_POST['pass']}'";

$result1 = mysql_query($sql1)
or die ( 'ERROR ::: Database Error has occured');

$num_results = mysql_num_rows($result1);


if ($num_results == 1 ) {
  if(!isset($_SESSION['validuser'])){
  $_SESSION['validuser'] = $_POST['validuser'];
}
 }
  else {
 echo "WRONG PASSWORD:: Please re-enter your login and password.";
  }
  }



?>



ADMIN-LOGIN



if (isset($_SESSION['validuser']))
  {
//ob_start(); // buffer output
//echo "You are already logged into the system !!!";
//header ("Location: http://psg.local/~psgarcha/logged_in.php";);
	//ob_end_flush(); // flush output
	echo "http://psg.local/~psgarcha/CRM/logged_in.php\";>";
	exit;

   }

else {

 if ( (!isset($_POST['validuser'])) || (!isset($_POST['pass']))  ) {
echo "NOTE::  You 
need to enter the login and password fields. Both the fields are 
case-sensitive.";
  }

  echo "


  

  
  Please enter your Username and Password 
  
  


  Login
  




  Password
  




  
  
  


  

";

}
?>



[PHP] strftime

2004-02-17 Thread Lorderon
Hi All,

I'm using the next code:



The browser encoding is set on Windows-1255..
what's the problem?

-thanks, Lorderon

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



[PHP] Split()

2004-02-17 Thread John Taylor-Johnston
Can I while this? Not sure how to go about it?

while ($pieces exist) {
echo $pieces[i];
}

Thanks,
John

$pizza  = "piece1 piece2 piece3 piece4 piece5 piece6";
$pieces = explode(" ", $pizza);
echo $pieces[0]; // piece1
echo $pieces[1]; // piece2

http://www.php.net/manual/en/function.explode.php
http://www.php.net/manual/en/control-structures.while.php

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



[PHP] Parse error

2004-02-17 Thread Rolf van de Krol
Does anybody know what this error can meen?
Parse error: parse error, unexpected T_VARIABLE in
/www/htdocs/rolfvand/thinkquest/browsercheck.php on line 46
What is a T_VARIABLE?

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



Re: [PHP] An HTML alternative to submit button to look like anchor??

2004-02-17 Thread John Herren
If you do this, make sure you name your submit button "Submit" or 
something else, but not "submit" :)

Shaunak Kashyap wrote:
Yes, you can use elementary javascript to achieve that goal.

Just make a link (anchor) as you normally would and make the value of its
href attribute "javascript:document.formName.submit()" where formName is the
name of the form you wish to submit. As with a lot of client-side scripting
languages, I cannot guarantee that this solution is cross-browser
compatible.
Shaunak
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Split()

2004-02-17 Thread Adam Bregenzer
On Tue, 2004-02-17 at 11:03, John Taylor-Johnston wrote:
> Can I while this? Not sure how to go about it?
> 
> $pizza  = "piece1 piece2 piece3 piece4 piece5 piece6";
> $pieces = explode(" ", $pizza);
> echo $pieces[0]; // piece1
> echo $pieces[1]; // piece2

Try while(each($pieces)) or foreach($pieces as $piece)

-- 
Adam Bregenzer
[EMAIL PROTECTED]
http://adam.bregenzer.net/

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



Re: [PHP] Split()

2004-02-17 Thread Stuart
John Taylor-Johnston wrote:
Can I while this? Not sure how to go about it?

while ($pieces exist) {
echo $pieces[i];
}
This will empty the array so you might want to do this on a copy of it 
depending on whether it will be needed later in the script...

while (count($pieces) > 0)
{
echo array_shift($pieces);
}
http://php.net/array_shift

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


Re: [PHP] Parse error

2004-02-17 Thread Stuart
Rolf van de Krol wrote:
Does anybody know what this error can meen?
Parse error: parse error, unexpected T_VARIABLE in
/www/htdocs/rolfvand/thinkquest/browsercheck.php on line 46
What is a T_VARIABLE?
Could be an unclosed quote, or a number of other things. Post a few 
lines around line 46 and we can probably help.

T_VARIABLE is PHPs internal representation of a variable (I could be wrong).

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


[PHP] Re: Split()

2004-02-17 Thread John Taylor-Johnston
I can do this, but want to understand how to while it: Or should I?

  $tempslices = explode("\r\n", $pizza);
  foreach ($tempslices as $singleslice)
  {
  echo "http://www.foo.org$singleslice\";>$singleslice ";
  }

Still learning :)

John Taylor-Johnston wrote:

> Can I while this? Not sure how to go about it?
>
> while ($pieces exist) {
> echo $pieces[i];
> }
>
> Thanks,
> John
>
> $pizza  = "piece1 piece2 piece3 piece4 piece5 piece6";
> $pieces = explode(" ", $pizza);
> echo $pieces[0]; // piece1
> echo $pieces[1]; // piece2
>
> http://www.php.net/manual/en/function.explode.php
> http://www.php.net/manual/en/control-structures.while.php

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



Re: [PHP] Split()

2004-02-17 Thread Adam Bregenzer
On Tue, 2004-02-17 at 11:02, Adam Bregenzer wrote:
> Try while(each($pieces)) or foreach($pieces as $piece)

Brain to fingers problem:
while($piece = each($pieces))

http://www.php.net/each
http://www.php.net/foreach

-- 
Adam Bregenzer
[EMAIL PROTECTED]
http://adam.bregenzer.net/

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



[PHP] Why doesn't PHP see my MySQL upgrade?

2004-02-17 Thread Donpro
Hi,
 
Just installed a new RedHat 7.3 system.
 
1. I upgraded to PHP 4.3.4
2. I upgraded to MySQL 4.0.17
3. Restarted Apache; I even rebooted!
 
When I run phpinfo() in my web browser, it shows:
 
Client API version: 3.23.58
 
What's going on ???
 
Thanks,
Don

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



RE: [PHP] Why doesn't PHP see my MySQL upgrade?

2004-02-17 Thread Chris
That version number isn't the current version of MySQL PHP is running with,
it doesn't have one. PHP can be (and before 5.0 is by default) compiled with
MySQL client libraries so it is able to access MySQL databases.

The version of PHP you have installed was compiled with the 3.23.58 client
libraries. If it's really important to you that those version numbers match,
recompile PHP.

I don't think you'll have any problems.

Chris

> -Original Message-
> From: Donpro [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, February 17, 2004 8:26 AM
> To: php list
> Subject: [PHP] Why doesn't PHP see my MySQL upgrade?
>
>
> Hi,
>
> Just installed a new RedHat 7.3 system.
>
> 1. I upgraded to PHP 4.3.4
> 2. I upgraded to MySQL 4.0.17
> 3. Restarted Apache; I even rebooted!
>
> When I run phpinfo() in my web browser, it shows:
>
> Client API version: 3.23.58
>
> What's going on ???
>
> Thanks,
> Don
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

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



Re: [PHP] Why doesn't PHP see my MySQL upgrade?

2004-02-17 Thread David O'Brien
You are using built-in mysql support. It uses that version of the API
you would have to compile with your own version of mysql to change that number
-Dave
At 11:26 AM 2/17/2004, Donpro wrote:
Hi,

Just installed a new RedHat 7.3 system.

1. I upgraded to PHP 4.3.4
2. I upgraded to MySQL 4.0.17
3. Restarted Apache; I even rebooted!
When I run phpinfo() in my web browser, it shows:

Client API version: 3.23.58

What's going on ???

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


David G. O'Brien
Web Services Coordinator / Systems Administrator
NACCRRA
The Nation's Network of Child Care Resource & Referral
1319 F Street NW, Suite 500
Washington, DC 20004
(202) 393-5501 ext. 113
(202) 393-1109 fax
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Why doesn't PHP see my MySQL upgrade?

2004-02-17 Thread John W. Holmes
From: "Donpro" <[EMAIL PROTECTED]>

> 1. I upgraded to PHP 4.3.4
> 2. I upgraded to MySQL 4.0.17
> 3. Restarted Apache; I even rebooted!
>
> When I run phpinfo() in my web browser, it shows:
>
> Client API version: 3.23.58
>
> What's going on ???

That's usual, as far as I can tell. That just means PHP is using the 3.23
version of the client to connect to the server. The server is still running
4.0.17, though. There shouldn't be any issues with this. I don't think you
need new client versions until you get to MySQL 4.1 and higher.

---John Holmes...

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



Re: [PHP] Re: Split()

2004-02-17 Thread John W. Holmes
From: "John Taylor-Johnston" <[EMAIL PROTECTED]>

> I can do this, but want to understand how to while it: Or should I?
>
>   $tempslices = explode("\r\n", $pizza);
>   foreach ($tempslices as $singleslice)
>   {
>   echo "http://www.foo.org$singleslice\";>$singleslice ";
>   }
>
> Still learning :)

There's no real reason to use while() over foreach(). Why do you think you
need to use while()?

---John Holmes...

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



[PHP] UK Postcode Reg Exp

2004-02-17 Thread Shaun
Hi,

Has anyone written a regular expression for validating a UK Postcode?

Many thanks

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



RE: [PHP] UK Postcode Reg Exp

2004-02-17 Thread Jay Blanchard
[snip]
Has anyone written a regular expression for validating a UK Postcode?
[/snip]

Nope, but I did write a love note to a French woman.

Sorry, couldn't resist. :) I'll be here all week.

Can you provide several examples and perhaps we could formulate one?

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



[PHP] Sessions

2004-02-17 Thread php-general
Have a questions about sessions.  In building a simple app do I have to 
include the session id in the url string or in a hidden tag?  or does it 
normally track it by cookies and so I dont have to call it on every page?

thoughts on best way to do this



-
This mail sent through IMP: http://horde.org/imp/

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



RE: [PHP] UK Postcode Reg Exp

2004-02-17 Thread James Nunnerley
Hi Shaun,

Not that I know of - although I have looked at various things like this
myself.  Would you be interested in a small open source project on this
subject?

I see you instigated the discussion on this earlier today.  It might be
something worth putting on PEAR, and somehow linking it with the Royal
Mail Address search - assuming we can get through their login process!

Any thoughts?

James

[EMAIL PROTECTED]

-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED] 
Sent: 17 February 2004 16:55
To: Shaun; [EMAIL PROTECTED]
Subject: RE: [PHP] UK Postcode Reg Exp

[snip]
Has anyone written a regular expression for validating a UK Postcode?
[/snip]

Nope, but I did write a love note to a French woman.

Sorry, couldn't resist. :) I'll be here all week.

Can you provide several examples and perhaps we could formulate one?

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

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



[PHP] Parse Error

2004-02-17 Thread Rolf van de Krol
More info about the parse error of my previous post:
The lines 45-46:
$mysql_query = "INSERT INTO
sessions(sessionid,ver,agent,bwinf,screenwidth,screenheight,availwidth,avail
height) ";
$mysql_query .=
"VALUES('$sessionid','$ver','$agent','$bwinf',$scrwidth,$scrheight,$availwid
th,$availheight)";

The error is:
Parse error: parse error, unexpected T_VARIABLE in
/www/htdocs/rolfvand/thinkquest/browsercheck.php on line 46

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



RE: [PHP] Parse Error

2004-02-17 Thread Jay Blanchard
[snip]
More info about the parse error of my previous post:
The lines 45-46:
$mysql_query = "INSERT INTO
sessions(sessionid,ver,agent,bwinf,screenwidth,screenheight,availwidth,a
vail
height) ";
$mysql_query .=
"VALUES('$sessionid','$ver','$agent','$bwinf',$scrwidth,$scrheight,$avai
lwid
th,$availheight)";

The error is:
Parse error: parse error, unexpected T_VARIABLE in
/www/htdocs/rolfvand/thinkquest/browsercheck.php on line 46
[/snip]

All of your values are not enclosed with single quotes - the first four
are, last four aren't

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



[PHP] Re: ["solved"] Are variables persistent?

2004-02-17 Thread Paul Furman
followup...

Paul Furman wrote:
Ugh, I think I'm done for the day. header() requires output buffering 
which would span several files and sounds like another mess.


Well, for now, I set up some of the links to maintain the $pics variable 
in the url as a $_REQUEST and circumvented the header() mess with a url 
constructed from the returned $_REQUEST value that has to be clicked to 
proceed:

http://hills.ccsf.edu/~pfurma02/index.php?SCREEN=settings.php&PICS=6
It works. The settings link is way at the bottom of all pages.
and my code below:

Change Settings



  if (isset ($_REQUEST ['PICS'])){
  $pics = $_REQUEST ['PICS'];}
  if ($_POST){
if (isset ($_POST['thumbs'])){
$pics = $_POST['thumbs'];
print "
  .$pics."\">return to gallery index with ".$pics
  ." thumbnails per page note that only the top logo 
home linkwill preserve this setting while navigating the site and 
visiting links from the navigation bar at the bottom will reset to default";
}
} ?>

  " 
method="post">
  number of thumbnails per page: 
  
 value="">
  OK
  



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


RE: [PHP] Why doesn't PHP see my MySQL upgrade?

2004-02-17 Thread Donpro
Disaster!

After uphrading to MySQL 4.0.17, I uninstalled all the old PHP-4.1.2 RPMs
and recompiled PHP-4.3.4.  Now I am getting compiling errors related to PHP.

/usr/local/php-4.3.4/ett/mysql/php_mysql.c:1158 undefined reference to
'mysql_create_db'

/usr/local/php-4.3.4/ett/mysql/php_mysql.c:1200 undefined reference to
'mysql_drop_db'

What next???

Shall I wipe out my PHP directory, install the Tarball and try compiling
from scratch?

> -Original Message-
> From: John W. Holmes [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, February 17, 2004 11:46 AM
> To: Donpro; php list
> Subject: Re: [PHP] Why doesn't PHP see my MySQL upgrade?
> 
> 
> From: "Donpro" <[EMAIL PROTECTED]>
> 
> > 1. I upgraded to PHP 4.3.4
> > 2. I upgraded to MySQL 4.0.17
> > 3. Restarted Apache; I even rebooted!
> >
> > When I run phpinfo() in my web browser, it shows:
> >
> > Client API version: 3.23.58
> >
> > What's going on ???
> 
> That's usual, as far as I can tell. That just means PHP is 
> using the 3.23 version of the client to connect to the 
> server. The server is still running 4.0.17, though. There 
> shouldn't be any issues with this. I don't think you need new 
> client versions until you get to MySQL 4.1 and higher.
> 
> ---John Holmes...
> 

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



RE: [PHP] Parse Error

2004-02-17 Thread Jay Blanchard
[snip]
That's not the problem.
I want the last for values aren't enclosed with single quotation marks.
I think it's a weird problem.
This lines executed on the server of my ISP give this error.
The same lines executed on my server on my localhost (Apache 1.3.29, PHP
4.3.2, MySQL 3.? and Win2K) don't give this error.
[/snip]

Try it. It is a language construct, it does not put the single quotes in
the database.

P.S. please do not reply off-list only unless invited to do so.

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



Re: [PHP] Parse Error

2004-02-17 Thread BAO RuiXian


Jay Blanchard wrote:

[snip]
More info about the parse error of my previous post:
The lines 45-46:
$mysql_query = "INSERT INTO
sessions(sessionid,ver,agent,bwinf,screenwidth,screenheight,availwidth,a
vail
height) ";
$mysql_query .=
"VALUES('$sessionid','$ver','$agent','$bwinf',$scrwidth,$scrheight,$avai
lwid
th,$availheight)";
The error is:
Parse error: parse error, unexpected T_VARIABLE in
/www/htdocs/rolfvand/thinkquest/browsercheck.php on line 46
[/snip]
All of your values are not enclosed with single quotes - the first four
are, last four aren't
 

I think the values should not be included inside single quotes, at least 
it is true for Perl, when the real values would not be assigne to.

Best

Bao

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


Re: [PHP] Parse Error

2004-02-17 Thread John Nichel
Jay Blanchard wrote:

[snip]
More info about the parse error of my previous post:
The lines 45-46:
$mysql_query = "INSERT INTO
sessions(sessionid,ver,agent,bwinf,screenwidth,screenheight,availwidth,a
vail
height) ";
$mysql_query .=
"VALUES('$sessionid','$ver','$agent','$bwinf',$scrwidth,$scrheight,$avai
lwid
th,$availheight)";
The error is:
Parse error: parse error, unexpected T_VARIABLE in
/www/htdocs/rolfvand/thinkquest/browsercheck.php on line 46
[/snip]
All of your values are not enclosed with single quotes - the first four
are, last four aren't
I don't know if that's his issue.  He's double quoted the whole string, 
so php should include the single quotes in the $mysql_query string.

OP, post some more code...lines 1-46 maybe?

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Help with '&' character

2004-02-17 Thread Chris Bruce
I am having trouble with a string becoming truncated at an '&' 
character. I am passing the variable via a link

(http://...&campaign=MBI%20List%20-%20Steel%20&%20Concrete) and then 
when I try to grab the incoming value of campaign into a SELECT query, 
it becomes

SELECT sum(sends) from campaigns where name='MBI List - Steel '

I have tried to urlencode the variable, and also use htmlentities, etc. 
to no avail.

Does anyone have a solution for this?

Thanks.

--

Chris Bruce
[EMAIL PROTECTED]
Idextrus
E-Business Architects
http://www.idextrus.com
3282 Wilmar Cres.
Mississauga, ON
L5L4B2
CA
905.828.9189

This e-mail and its contents are privileged, confidential and
subject to copyright.  If you are not the intended recipient,
please delete this e-mail immediately.  Any unauthorized use
or disclosure of the information herein is prohibited.


Re: [PHP] PHP 4.3.4 ftp_rawlist null output

2004-02-17 Thread Federico Petronio
Finally I found the problem... I post it because could help to others...

The problem was that PHP ftp module use a fixed tmp directory (at least
I could not change it). That dir is /var/tmp and that dir was not
present in my chrooted environment. I create it, set permissions and
that was it.
Bye !!

Federico Petronio wrote:

Hi... I search about this and found different answers but not a clear 
one. Somebody talk about a PHP bug, other that it's solved in 4.3.4.

I installer PHP 4.3.4 (without ftp-support) and Apache 2.0.48 on Solaris 
8, the /tmp dir permission are 777. Time after that I compilled ftp.so 
module and included it in php.ini.

Then I wrote a script (ftp.php) that connects OK, chdir OK, but when it 
try a ftp_rawlist the answer is "". I try the same script in RedHat 
linux PHP 4.3.4 compilled with the same parameters and worked OK (the 
only differece was that the module ftp.so was compilled and installed at 
the same time as the rest of the PHP was).

BTW... what is the right way to add a module after the compilation is 
already done (I mean... doing a "make install" does not look good on a 
running production environment)?

What could be the problem with the PHP on Solaris?

In the FTP log I get this.. (the LIST command is never issued)

10.2.0.10 UNKNOWN nobody [13/Feb/2004:17:29:08 -0300] 10.2.0.10 "USER 
[EMAIL PROTECTED]" 331 -
10.2.0.10 UNKNOWN [EMAIL PROTECTED] [13/Feb/2004:17:29:08 -0300] 10.2.0.10 
UPASS (hidden)" 230 -
10.2.0.10 UNKNOWN [EMAIL PROTECTED] [13/Feb/2004:17:29:08 -0300] 10.2.0.10 
"QUIT" 221 -



but if I do the same on Linux it works ok:

10.2.0.11 "LIST /" 226 381

Any help will be welcome.


--
Federico Petronio
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] UK Postcode Reg Exp

2004-02-17 Thread James Lobley
Try this one:

$postcode2 = strtoupper(str_replace(chr(32),'',$postcode));
$pc_suffix = substr($postcode2,-3,3);
$pc_prefix = substr($postcode2,0,(strlen($postcode2)-3));
if (!preg_match('/(^[A-Z]{1,2}[0-9]{1,2}|^[A-Z]{1,2}[0-9]{1}[A-Z]{1})$/',$pc_prefix) 
&& !preg_match('/^[0-9]{1}[ABD-HJLNP-UW-Z]{2}$/',$pc_suffix)) echo("Invalid 
postcode!");

It seems to have been working nicely on all variants put through it over the past few 
months!

James


I like nonsense ~ it wakes up the brain cells.
Fantasy is a necessary ingredient in living.
It's a way of looking at life through the wrong end of a telescope...
and that enables you to laugh at all of life's realities.

~ Theodor S. Geisel, a.k.a. "Dr. Seuss"



-Original Message-
From: James Nunnerley [mailto:[EMAIL PROTECTED]
Sent: 17 February 2004 16:59
To: 'Shaun'; [EMAIL PROTECTED]
Subject: RE: [PHP] UK Postcode Reg Exp


Hi Shaun,

Not that I know of - although I have looked at various things like this
myself.  Would you be interested in a small open source project on this
subject?

I see you instigated the discussion on this earlier today.  It might be
something worth putting on PEAR, and somehow linking it with the Royal
Mail Address search - assuming we can get through their login process!

Any thoughts?

James

[EMAIL PROTECTED]

-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED] 
Sent: 17 February 2004 16:55
To: Shaun; [EMAIL PROTECTED]
Subject: RE: [PHP] UK Postcode Reg Exp

[snip]
Has anyone written a regular expression for validating a UK Postcode?
[/snip]

Nope, but I did write a love note to a French woman.

Sorry, couldn't resist. :) I'll be here all week.

Can you provide several examples and perhaps we could formulate one?

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

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

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



Re: [PHP] Help with '&' character

2004-02-17 Thread "Miguel J. Jiménez"
Have you tried using '&' ?

Chris Bruce wrote:

I am having trouble with a string becoming truncated at an '&' 
character. I am passing the variable via a link

(http://...&campaign=MBI%20List%20-%20Steel%20&%20Concrete) and then 
when I try to grab the incoming value of campaign into a SELECT query, 
it becomes

SELECT sum(sends) from campaigns where name='MBI List - Steel '

I have tried to urlencode the variable, and also use htmlentities, 
etc. to no avail.

Does anyone have a solution for this?

Thanks.


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

Re: [PHP] Why doesn't PHP see my MySQL upgrade?

2004-02-17 Thread Jason Wong
On Wednesday 18 February 2004 01:11, Donpro wrote:

> After uphrading to MySQL 4.0.17, I uninstalled all the old PHP-4.1.2 RPMs
> and recompiled PHP-4.3.4.  Now I am getting compiling errors related to
> PHP.
>
> /usr/local/php-4.3.4/ett/mysql/php_mysql.c:1158 undefined reference to
> 'mysql_create_db'
>
> /usr/local/php-4.3.4/ett/mysql/php_mysql.c:1200 undefined reference to
> 'mysql_drop_db'
>
> What next???

Did you install MySQL-devel-4.0.X ?
Did you specify where the mysql files are to be found (most likely 
--with-mysql=/usr) ?

-- 
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
--
/*
I base my fashion taste on what doesn't itch.
-- Gilda Radner
*/

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



Re: [PHP] Help with '&' character

2004-02-17 Thread John W. Holmes
From: "Chris Bruce" <[EMAIL PROTECTED]>

> I am having trouble with a string becoming truncated at an '&'
> character. I am passing the variable via a link
>
> (http://...&campaign=MBI%20List%20-%20Steel%20&%20Concrete) and then
> when I try to grab the incoming value of campaign into a SELECT query,
> it becomes
>
> SELECT sum(sends) from campaigns where name='MBI List - Steel '
>
> I have tried to urlencode the variable, and also use htmlentities, etc.
> to no avail.

Show how you tried to use urlencode() and put the value in the URL, because
that's the correct solution.

---John Holmes...

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



Re: [PHP] UK Postcode Reg Exp

2004-02-17 Thread Shaun
Sounds like a good idea,

This seems to be the current spec:

http://www.govtalk.gov.uk/gdsc/html/noframes/PostCode-2-1-Release.htm


"James Nunnerley" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi Shaun,
>
> Not that I know of - although I have looked at various things like this
> myself.  Would you be interested in a small open source project on this
> subject?
>
> I see you instigated the discussion on this earlier today.  It might be
> something worth putting on PEAR, and somehow linking it with the Royal
> Mail Address search - assuming we can get through their login process!
>
> Any thoughts?
>
> James
>
> [EMAIL PROTECTED]
>
> -Original Message-
> From: Jay Blanchard [mailto:[EMAIL PROTECTED]
> Sent: 17 February 2004 16:55
> To: Shaun; [EMAIL PROTECTED]
> Subject: RE: [PHP] UK Postcode Reg Exp
>
> [snip]
> Has anyone written a regular expression for validating a UK Postcode?
> [/snip]
>
> Nope, but I did write a love note to a French woman.
>
> Sorry, couldn't resist. :) I'll be here all week.
>
> Can you provide several examples and perhaps we could formulate one?
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

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



[PHP] Re: Help with '&' character

2004-02-17 Thread André Cerqueira
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
http://...&campaign=MBI%20List%20-%20Steel%20&%20Concrete (wrong)
http://...&campaign=MBI%20List%20-%20Steel%20%26%20Concrete (right)
where does that url come from?
is it generated by a script?
if it is, you must urlencode() it before outputing, not when receiving 
it from a request

query string works like this...
you have name and value of each field separated with '=', and each field 
separated with '&' from another field
ex.: name1=value1&name2=value2

this means that if you have an '=' on the string, IT IS separating a 
name from a value, and if you have a '&' on the string, IT IS separating 
a field from another one
no matter what you want the '=' or the '&' to be, they already are something
urlencode each piece (urlencode($fieldname) and urlencode($fieldvalue)), 
before separating them with '=' and '&', those and other characters will 
be substituted by something that will tell what they really are
as well as that %20 is a urlencoded ...

Chris Bruce wrote:
I am having trouble with a string becoming truncated at an '&' 
character. I am passing the variable via a link

(http://...&campaign=MBI%20List%20-%20Steel%20&%20Concrete) and then 
when I try to grab the incoming value of campaign into a SELECT query, 
it becomes

SELECT sum(sends) from campaigns where name='MBI List - Steel '

I have tried to urlencode the variable, and also use htmlentities, etc. 
to no avail.

Does anyone have a solution for this?

Thanks.

--

Chris Bruce
[EMAIL PROTECTED]
Idextrus
E-Business Architects
http://www.idextrus.com
3282 Wilmar Cres.
Mississauga, ON
L5L4B2
CA
905.828.9189

This e-mail and its contents are privileged, confidential and
subject to copyright.  If you are not the intended recipient,
please delete this e-mail immediately.  Any unauthorized use
or disclosure of the information herein is prohibited.
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.4 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFAMlRraxdA/5C8vH8RAj2ZAKC4wgoI0YYhoXX5SKDKGvKvi9JLewCfd0Ll
x0UHxedqC3n5Y13ZN1OG6Gc=
=UPQQ
-END PGP SIGNATURE-
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Help with '&' character

2004-02-17 Thread Chris Bruce
The problem is that the '&' character is already in a database. I am 
trying to do a query where I need to have it as '&', but like I said, 
when it comes into the script from the url it gets truncated.

--

Chris Bruce
[EMAIL PROTECTED]
Idextrus
E-Business Architects
http://www.idextrus.com
3282 Wilmar Cres.
Mississauga, ON
L5L4B2
CA
905.828.9189

This e-mail and its contents are privileged, confidential and
subject to copyright.  If you are not the intended recipient,
please delete this e-mail immediately.  Any unauthorized use
or disclosure of the information herein is prohibited.
On Feb 17, 2004, at 12:40 PM, Miguel J. Jiménez wrote:

Have you tried using '&' ?

Chris Bruce wrote:

I am having trouble with a string becoming truncated at an '&' 
character. I am passing the variable via a link

(http://...&campaign=MBI%20List%20-%20Steel%20&%20Concrete) and then 
when I try to grab the incoming value of campaign into a SELECT 
query, it becomes

SELECT sum(sends) from campaigns where name='MBI List - Steel '

I have tried to urlencode the variable, and also use htmlentities, 
etc. to no avail.

Does anyone have a solution for this?

Thanks.


Re: [PHP] Re: Split()

2004-02-17 Thread John Taylor-Johnston
John, Thanks. It's a question of understanding it. I can get a foreach to work, but my 
while doesn't.

>There's no real reason to use while() over foreach(). Why do you think you
>need to use while()?

Rather than ask people to code for me, I'm trying to spend a little extra time to try 
and learn first. My foreach works, but not my while (in any combination).

  $tempauthors = explode("\r\n", $mydata->AuthorList);
  foreach ($tempauthors as $singleauthor)
# while($tempauthors = each($singleauthor))
  {
  echo "http://www.foo.org$singleauthor\";>$singleauthor ";
  }



"John W. Holmes" wrote:

> From: "John Taylor-Johnston" <[EMAIL PROTECTED]>
>
> > I can do this, but want to understand how to while it: Or should I?
> >
> >   $tempslices = explode("\r\n", $pizza);
> >   foreach ($tempslices as $singleslice)
> >   {
> >   echo "http://www.foo.org$singleslice\";>$singleslice ";
> >   }
> >
> > Still learning :)
>
> There's no real reason to use while() over foreach(). Why do you think you
> need to use while()?
>
> ---John Holmes...

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



Re: [PHP] Help with '&' character

2004-02-17 Thread Chris Bruce
You are right John. I have it working now. Thanks.

--

Chris Bruce
[EMAIL PROTECTED]
Idextrus
E-Business Architects
http://www.idextrus.com
3282 Wilmar Cres.
Mississauga, ON
L5L4B2
CA
905.828.9189

This e-mail and its contents are privileged, confidential and
subject to copyright.  If you are not the intended recipient,
please delete this e-mail immediately.  Any unauthorized use
or disclosure of the information herein is prohibited.
On Feb 17, 2004, at 12:48 PM, John W. Holmes wrote:

From: "Chris Bruce" <[EMAIL PROTECTED]>

I am having trouble with a string becoming truncated at an '&'
character. I am passing the variable via a link
(http://...&campaign=MBI%20List%20-%20Steel%20&%20Concrete) and then
when I try to grab the incoming value of campaign into a SELECT query,
it becomes
SELECT sum(sends) from campaigns where name='MBI List - Steel '

I have tried to urlencode the variable, and also use htmlentities, 
etc.
to no avail.
Show how you tried to use urlencode() and put the value in the URL, 
because
that's the correct solution.

---John Holmes...

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


Re: [PHP] Help with '&' character

2004-02-17 Thread André Cerqueira
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
the problem is the '&' on the url
http://...&campaign=MBI%20List%20-%20Steel%20&%20Concrete
 ^
 |
there>
this url is saying:

'campaign' = 'MBI List - Steel '
' Concrete' = ''


Chris Bruce wrote:

The problem is that the '&' character is already in a database. I am 
trying to do a query where I need to have it as '&', but like I said, 
when it comes into the script from the url it gets truncated.

--

Chris Bruce
[EMAIL PROTECTED]
Idextrus
E-Business Architects
http://www.idextrus.com
3282 Wilmar Cres.
Mississauga, ON
L5L4B2
CA
905.828.9189

This e-mail and its contents are privileged, confidential and
subject to copyright.  If you are not the intended recipient,
please delete this e-mail immediately.  Any unauthorized use
or disclosure of the information herein is prohibited.
On Feb 17, 2004, at 12:40 PM, Miguel J. Jiménez wrote:

Have you tried using '&' ?

Chris Bruce wrote:

I am having trouble with a string becoming truncated at an '&' 
character. I am passing the variable via a link

(http://...&campaign=MBI%20List%20-%20Steel%20&%20Concrete) and then 
when I try to grab the incoming value of campaign into a SELECT 
query, it becomes

SELECT sum(sends) from campaigns where name='MBI List - Steel '

I have tried to urlencode the variable, and also use htmlentities, 
etc. to no avail.

Does anyone have a solution for this?

Thanks.





-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.4 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFAMlbwaxdA/5C8vH8RAhWIAKCgrG9WjjlU++J29eFj5MAnyPUtlgCgpf8s
O0pMTmplEDKwsv4APITzBHk=
=KS0s
-END PGP SIGNATURE-
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: Re[4]: [PHP] problems with spam

2004-02-17 Thread Comex
<[EMAIL PROTECTED]>
Richard Davey:
> Hello mayo,
>
> Monday, February 16, 2004, 3:51:30 PM, you wrote:
>
> m> As for my email being harvested because I wrote it out
> m> ([EMAIL PROTECTED]). Well I'll change it to
> m> something else. :-)
>
> There are other ways - spam bots can actually subscribe to the list
> and then just reap the email address of anyone who posts. Or of course
> just scan the web version of the list archives.
>
> m> As it is members of one listserv has gotten swamped. The response
> there was m> a deluge of "me too!"
>
> I bet. It's annoying, but not as annoying as when you post to the list
> and get a stack of Delivery Reports, Out of office replies, user
> mailbox full errors and various other things back again from the
> actual "subscribers".

The only way to get rid of it would be to use the newsgroup version.

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



Re: [PHP] Re: Split()

2004-02-17 Thread Adam Bregenzer
On Tue, 2004-02-17 at 13:01, John Taylor-Johnston wrote:
>   $tempauthors = explode("\r\n", $mydata->AuthorList);
>   foreach ($tempauthors as $singleauthor)
> # while($tempauthors = each($singleauthor))
>   {
>   echo "http://www.foo.org$singleauthor\";>$singleauthor ";
>   }

First of all, you are flipping your variables:
while ($singleauthor = each($tempauthors))

Secondly, check the manual to see what each() returns[1].  It returns an
array with the key and value of the result in it.  If you want to use
each() then you need to evaluate $singleauthor as $singleauthor[0] or
$singleauthor['value'] to get its value.  Another way to do this that
would be closer to what foreach does would be:
while (list($key, $singleauthor) = each($tempauthors))

This will assign the key to $key and the value you are looking for to
$singleauthor.

[1] http://www.php.net/each

-- 
Adam Bregenzer
[EMAIL PROTECTED]
http://adam.bregenzer.net/

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



Re: [PHP] Problems with authentication (I think)

2004-02-17 Thread Comex
<[EMAIL PROTECTED]>
Leif Gregory:
> Hello Leif,
>
> Monday, February 16, 2004, 7:13:30 PM, you wrote:
>>PHPTest http://www.resynthesize.com/code/phptest_info.php
>
> Just a followup. I found out that the PHPTest showing just a blank
> page was a mistype in my config.inc.php file. It now shows me the
> login screen, but when I login it does not do it. If I create a new
> user via the PHPTest interface, it does indeed create the new user,
> but I can't login with that one either.
>
> I know I'm asking about a specific app here, but the problem spans a
> few apps, and the problem is the same with all of them (namely,
> authentication won't work).
>
> Thanks again.
>
>
> Cheers,
> Leif Gregory


What does phpinfo say?

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



Re: [PHP] Headers Again

2004-02-17 Thread Comex
[EMAIL PROTECTED]>
Petcol:
> Jason,
>
> What I shock, 307,000 entries returned.
>
> Maybe someone with ability greater or other than I, should give some
> serious consideration to a solution or work around.
>
> I've been using ColdFuion for 7 years and I can do a  url="anotherlocation.htm"> anywhere in the page, no matter if I've
> run CFML, Javascript it still works.
>
> Sorry I'm just frustrated.
>
> Regards
> Col


Put ob_start(); in the beginning of the script.

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



Re: [PHP] * populate menu from directory *

2004-02-17 Thread Paul Furman
Matt Matijevich wrote:


 I want to be able to simply FTP a new movie 
onto the server, and then have the menu update itself. possible? I 
would also be looking to do something similar with JPGS.


here is some code to help start you


Here's another example:
(more error checking probably needed)
http://hills.ccsf.edu/~pfurma02/index.php
-modified from "screen" to "jpeg"
-eliminates screens that are already in the menu
JPEG Image Menu:



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


[PHP] Re: Sessions

2004-02-17 Thread Paul Furman
[EMAIL PROTECTED] wrote:

Have a questions about sessions.  In building a simple app do I have to 
include the session id in the url string or in a hidden tag?  or does it 
normally track it by cookies and so I dont have to call it on every page?

thoughts on best way to do this
I'm trying to learn this myself. It seems to make a difference what 
version you are running and what the settings are whether it wil 
semi-automatically update from cookies or the url. A 'hidden tag' 
doesn't really exist, either it's in a cookie or it's in the url in 
which case you need a secure connection if you don't want people to be 
able to hijack the session ID from the url.

Here's more of my notes:

http://www.php.net/session

I've got PHP 4.22 with "register globals" off so each global variable 
cannot be registered as session variables.

# Registering a variable with $_SESSION #

session_start();

if (!isset($_SESSION['count'])) {
   $_SESSION['count'] = 0;
} else {
   $_SESSION['count']++;
}
unset($_SESSION['count']);
I need to turn on session.use_trans_sid for easy but insecure 
transparent transforming of links (URIs will be changed to contain the 
session id automatically).

use session_set_save_handler() to create a set of user-level storage 
functions. 
http://us4.php.net/manual/en/function.session-set-save-handler.php

session_cache_expire
session_cache_limiter
session_decode -- Decodes session data from a string
session_destroy
session_encode --  Encodes the current session data as a string
session_get_cookie_params
session_id -- Get and/or set the current session id
registered in a session
session_module_name -- Get and/or set the current session module
session_name -- Get and/or set the current session name
session_regenerate_id --  Update the current session id with a newly 
generated one
current session
session_save_path
session_set_cookie_params
session_set_save_handler --  Sets user-level session storage functions
session_start -- Initialize session data
session
session_write_close -- Write session data and end, alias session_commit

pre-4.3 versions or with "register globals" off don't use these:
# session_unset --  Free all session variables
# session_is_registered --  Find out whether a global variable is
# session_register --  Register one or more global variables with the
# session_unregister --  Unregister a global variable from the current
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] ID tymfix... thanks

2004-02-17 Thread thies
Yours ID rtvfrh
--
Thank 

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

Re: [PHP] Help with '&' character

2004-02-17 Thread Chris Shiflett
--- Chris Bruce <[EMAIL PROTECTED]> wrote:
> I am having trouble with a string becoming truncated at an '&' 
> character. I am passing the variable via a link
> 
> (http://...&campaign=MBI%20List%20-%20Steel%20&%20Concrete) and then 
> when I try to grab the incoming value of campaign into a SELECT query, 
> it becomes
> 
> SELECT sum(sends) from campaigns where name='MBI List - Steel '
> 
> I have tried to urlencode the variable, and also use htmlentities, etc. 
> to no avail.
> 
> Does anyone have a solution for this?

You already mentioned it: URL encoding.

http://www.php.net/urlencode

There are a lot of user notes on that page. Some of those might also be
helpful.

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly
 Coming mid-2004
HTTP Developer's Handbook - Sams
 http://httphandbook.org/
PHP Community Site
 http://phpcommunity.org/

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



  1   2   >