[PHP] Re: NULL value for variable

2002-02-20 Thread Sanduhr

that "global $fileId;" shouldn't be there in  downloadfile.php
"Teresa Narvaez" <[EMAIL PROTECTED]> schreef in bericht
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
: Hello,
: I am runnig php 4.1.1.  In the configuration, register_globals is
: ON.
: I have two programs and I want to pass the value from fileId from one.php
to
: downloadfile.php.  However, in downloadfile.php $fileId is NULL.  What am
I
: missing?  Thanks, -Teresa
:
:
: one.php
:   
:   
:   
:   " >
:  Download Now
:   
:   
:   
:
: downloadfile.php
:   
:
:



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




Re: [PHP] getting the "right" REMOTE_ADDR

2002-02-20 Thread Steven Walker

You lost me... but it sounds like fun! :) BTW, can anything fake 
$HTTP_REFERER?

I'm sure one of the pros on the list can answer your original question:

Is this really a fool-proof method of knowing exactly what the ip is

if (getenv(HTTP_CLIENT_IP)){
$ip=getenv(HTTP_CLIENT_IP);
}
else {
$ip=getenv(REMOTE_ADDR);
}


Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]

On Wednesday, February 20, 2002, at 10:56  PM, [EMAIL PROTECTED] 
wrote:

> My problem is a touch different, I know the IP's of the visitors who 
> can visit the site, but I need to make sure that it's *really* them.  
> Cookies are a potential solution, but don't quite fit the bill due to 
> some variables on the users sides - and what I'm really keeping out are 
> bots (that break in), not people.
> I've tested for:
> $HTTP_CONNECTION ("Keep-Alive" means not a robot - right?)
> $HTTP_REFERER (can't fake this if you're a robot...?)
> $HTTP_ACCEPT_LANGUAGE (Only comes along with browsers... yea?)
>
> In short, I need to make sure that only humans (who are on the IP list) 
> can view content... and I wanted to make sure that bots couldn't spoof 
> their IP and look like one of the human IP's.
>
> make sense?
>
>  thanks,
> Sean
>
> -Original Message-
> From: Steven Walker [mailto:[EMAIL PROTECTED]]
>
> I don't know too much about this, but IP checking is not a reliable way
> of identification anyway. Depending on how people connect to the
> internet, some people will have different IPs every time. Since I use a
> cable modem, my IP address rarely changes (if ever) so I use it as a
> safety net to prevent other users from accessing my files.
>
>
> On Wednesday, February 20, 2002, at 08:28  PM, [EMAIL PROTECTED]
> wrote:
>
>> Hi all,
>>
>> I need to know the exact ip of who is entering a site and I'm worried
>> about proxies and spoofing.  From php.net:
>> http://www.php.net/manual/en/function.getenv.php
>> This was listed:
>> 
>> This gives you the right ip:
>>
>> if (getenv(HTTP_CLIENT_IP)){
>> $ip=getenv(HTTP_CLIENT_IP);
>> }
>> else {
>> $ip=getenv(REMOTE_ADDR);
>> }
>> 
>> Is this really a fool-proof method of knowing exactly what the ip is
>> that's getting onboard?
>>
>> Thanks!
>>
>> Sean
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>



[PHP] fopen and UNC filename

2002-02-20 Thread Johannes Müller

I tried to fopen("\\machine\share\file.txt","w")

on w2k iis 5.0 with PHP 4.1.0 and I got fopen invalid argument error. I
know,
that UNC filenames are supported since PHP 4.0.6. I tried variants with
machine\\share\\file.txt, ... but the error was the same.

TIA
Jo




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




Re: [PHP] getting the "right" REMOTE_ADDR

2002-02-20 Thread sean

My problem is a touch different, I know the IP's of the visitors who can visit the 
site, but I need to make sure that it's *really* them.  Cookies are a potential 
solution, but don't quite fit the bill due to some variables on the users sides - and 
what I'm really keeping out are bots (that break in), not people.
I've tested for:
$HTTP_CONNECTION ("Keep-Alive" means not a robot - right?)
$HTTP_REFERER (can't fake this if you're a robot...?)
$HTTP_ACCEPT_LANGUAGE (Only comes along with browsers... yea?)

In short, I need to make sure that only humans (who are on the IP list) can view 
content... and I wanted to make sure that bots couldn't spoof their IP and look like 
one of the human IP's.

make sense?

 thanks,
Sean

-Original Message-
From: Steven Walker [mailto:[EMAIL PROTECTED]]

I don't know too much about this, but IP checking is not a reliable way 
of identification anyway. Depending on how people connect to the 
internet, some people will have different IPs every time. Since I use a 
cable modem, my IP address rarely changes (if ever) so I use it as a 
safety net to prevent other users from accessing my files.

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]

On Wednesday, February 20, 2002, at 08:28  PM, [EMAIL PROTECTED] 
wrote:

> Hi all,
>
> I need to know the exact ip of who is entering a site and I'm worried 
> about proxies and spoofing.  From php.net:
> http://www.php.net/manual/en/function.getenv.php
> This was listed:
> 
> This gives you the right ip:
>
> if (getenv(HTTP_CLIENT_IP)){
> $ip=getenv(HTTP_CLIENT_IP);
> }
> else {
> $ip=getenv(REMOTE_ADDR);
> }
> 
> Is this really a fool-proof method of knowing exactly what the ip is 
> that's getting onboard?
>
> Thanks!
>
> Sean


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




RE: [PHP] Re: Hyperlinks vs Buttons

2002-02-20 Thread Nick Richardson

Actually, i have seen problems with this under Oprah and Netscape (dont ask
me why... it just seems kinda flaky.

So instead, use this:

a href="javascript:document..submit()">Login

//Nick

-Original Message-
From: Gary [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 20, 2002 7:49 PM
To: [EMAIL PROTECTED]; Steven Walker
Subject: [PHP] Re: Hyperlinks vs Buttons




Steven Walker wrote:

> Is there a way to regular hyperlinked text to submit a form?
>
> For example, rather than having a button that says [Login], I just want
> underlined text: Login
>
> Steven J. Walker
> Walker Effects
> www.walkereffects.com
> [EMAIL PROTECTED]
>

Login

HTH
Gary


--
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] Difference between two dates

2002-02-20 Thread Uma Shankari T.



Hello,


  I got the solution for the date difference problem..,,

Thankyou very much.



-Uma




"Uma Shankari T." <[EMAIL PROTECTED]> wrote:
> If i gave the str date as "31-01-2001"; and  $str1="04-02-2001"; then it
> is displaying the wrong result
>
> Plz tell me how can i rectify this problem...

Uma,

I wrote a function last year that calculates the time between 2 dates in
whatever unit is preferred (everything from seconds to years).  My function
expects the date in a slightly different format, but it would be trivial to
switch the order of the date parts in one line and hard-code something for
the hours, minutes and seconds it expects in the date format.  It wouldn't
matter what you hardcode them as since it would use the same time of day for
both dates.

http://www.befriend.com/code_gallery/php/get_elapsed_time/

--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/



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




Re: [PHP] getting the "right" REMOTE_ADDR

2002-02-20 Thread Steven Walker

I don't know too much about this, but IP checking is not a reliable way 
of identification anyway. Depending on how people connect to the 
internet, some people will have different IPs every time. Since I use a 
cable modem, my IP address rarely changes (if ever) so I use it as a 
safety net to prevent other users from accessing my files.

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]

On Wednesday, February 20, 2002, at 08:28  PM, [EMAIL PROTECTED] 
wrote:

> Hi all,
>
> I need to know the exact ip of who is entering a site and I'm worried 
> about proxies and spoofing.  From php.net:
> http://www.php.net/manual/en/function.getenv.php
> This was listed:
> 
> This gives you the right ip:
>
> if (getenv(HTTP_CLIENT_IP)){
> $ip=getenv(HTTP_CLIENT_IP);
> }
> else {
> $ip=getenv(REMOTE_ADDR);
> }
> 
> Is this really a fool-proof method of knowing exactly what the ip is 
> that's getting onboard?
>
> Thanks!
>
> Sean
>
>
> ---
>I N T E R C O N N E C T
>   Internet Image Development
>Tel: 505 989 3749
>  http://www.InterConnect.is.it
> ---
>
>
>
> --
> 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] timestamp confusion

2002-02-20 Thread Justin French

Okay, that's what I needed to hear...

so I'll just add 61200seconds onto the timestamp, and i'll be "in the
ball park".

thanks to everyone,

justin

Scott Brown wrote:
> 
> Seems to me that those functions expect GMT based time.
> 
> Here in Ontario Canada, I'm GMT-5 (or -4 at some points in the year).  And
> that
> 
> You're probably GMT+10-ish??
> 
> So -- if your server is in BC or Alberta Canada, then you're looking at
> about a 17 hour hole depending on the time of year :)

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




RE: [PHP] timestamp confusion

2002-02-20 Thread Martin Towell

well, just add 17 hours (17h * 60m/h * 60s/m = 61200 [aren't calculators
wonderful :)] ) i guess

-Original Message-
From: Justin French [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 21, 2002 4:02 PM
To: php
Subject: Re: [PHP] timestamp confusion


Jeff Sheltren wrote:

> Well, what you are missing is that those are the number of seconds *on
that
> machine* since 1970...  so actually, if both of your clocks were set
> correctly, you should be getting the *same* number returned by
> time().  Hope that clears it up a little.

A geez *slaps forehead*.

okay, so the time stamps should be *close* to equal, and the difference
between the two machines is about 23 mins, so that's okay, but:

when I run
echo date('d M Y H:m:s','1014261839');

on the two machines, I get different results.

local: 21 Feb 2002 14:02:59
live:  20 Feb 2002 21:02:59

this is a difference of exactly 17 hours, so what is date() taking into
consideration?  the timezone of the server?


if i'm putting timestamps into my database (in canada, apparantly 17
hours behind me), I just need to know what I need to do to that
timestamp before running it thru date() to get my local time
(melbourne/sydney) printed to the page.


thanks,

jsutin french



> Jeff
> 
> At 03:18 PM 2/21/2002 +1100, Justin French wrote:
> >It doesn't seem to me like this is an issue... isn't the timestamp just
> >the local unix time?  It is on my LAN server.
> >
> >The issue I have is that
> >
> >echo date('d M Y H:m:s','1014261839');
> >produces 21 Feb 2002 14:02:59 on my LOCAL machine
> >
> >echo date('d M Y H:m:s','1014260440');
> >produces 20 Feb 2002 21:02:40 on my LIVE server.
> >
> >this is a difference of around 17 hours (i ran both scripts within 5
> >seconds of each other)
> >
> >however 1014261839 - 1014260440 = just 1399 seconds.
> >
> >
> >so where am I going wrong?
> >
> >there's either an issue with:
> >
> >a) time()
> >b) date()
> >c) the subtraction of one timestamp from another
> >
> >that i'm not aware of.
> >
> >
> >justin
> >
> >
> >
> >Billy S Halsey wrote:
> > >
> > > Justin,
> > >
> > > Take a look at the gettimeofday() function, which returns the timezone
> > > and daylight-savings-time values for the system.
> > >
> > > -bsh
> >
> >--
> >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] timestamp confusion

2002-02-20 Thread Justin French

Jeff Sheltren wrote:

> Well, what you are missing is that those are the number of seconds *on that
> machine* since 1970...  so actually, if both of your clocks were set
> correctly, you should be getting the *same* number returned by
> time().  Hope that clears it up a little.

A geez *slaps forehead*.

okay, so the time stamps should be *close* to equal, and the difference
between the two machines is about 23 mins, so that's okay, but:

when I run
echo date('d M Y H:m:s','1014261839');

on the two machines, I get different results.

local: 21 Feb 2002 14:02:59
live:  20 Feb 2002 21:02:59

this is a difference of exactly 17 hours, so what is date() taking into
consideration?  the timezone of the server?


if i'm putting timestamps into my database (in canada, apparantly 17
hours behind me), I just need to know what I need to do to that
timestamp before running it thru date() to get my local time
(melbourne/sydney) printed to the page.


thanks,

jsutin french



> Jeff
> 
> At 03:18 PM 2/21/2002 +1100, Justin French wrote:
> >It doesn't seem to me like this is an issue... isn't the timestamp just
> >the local unix time?  It is on my LAN server.
> >
> >The issue I have is that
> >
> >echo date('d M Y H:m:s','1014261839');
> >produces 21 Feb 2002 14:02:59 on my LOCAL machine
> >
> >echo date('d M Y H:m:s','1014260440');
> >produces 20 Feb 2002 21:02:40 on my LIVE server.
> >
> >this is a difference of around 17 hours (i ran both scripts within 5
> >seconds of each other)
> >
> >however 1014261839 - 1014260440 = just 1399 seconds.
> >
> >
> >so where am I going wrong?
> >
> >there's either an issue with:
> >
> >a) time()
> >b) date()
> >c) the subtraction of one timestamp from another
> >
> >that i'm not aware of.
> >
> >
> >justin
> >
> >
> >
> >Billy S Halsey wrote:
> > >
> > > Justin,
> > >
> > > Take a look at the gettimeofday() function, which returns the timezone
> > > and daylight-savings-time values for the system.
> > >
> > > -bsh
> >
> >--
> >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




[PHP] getting the "right" REMOTE_ADDR

2002-02-20 Thread sean

Hi all,

I need to know the exact ip of who is entering a site and I'm worried about proxies 
and spoofing.  From php.net: 
http://www.php.net/manual/en/function.getenv.php
This was listed:

This gives you the right ip:

if (getenv(HTTP_CLIENT_IP)){
$ip=getenv(HTTP_CLIENT_IP);
}
else {
$ip=getenv(REMOTE_ADDR);
}

Is this really a fool-proof method of knowing exactly what the ip is that's getting 
onboard?

Thanks!

Sean


---
   I N T E R C O N N E C T
  Internet Image Development
   Tel: 505 989 3749
 http://www.InterConnect.is.it
--- 



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




Re: [PHP] timestamp confusion

2002-02-20 Thread Jeff Sheltren

Well, what you are missing is that those are the number of seconds *on that 
machine* since 1970...  so actually, if both of your clocks were set 
correctly, you should be getting the *same* number returned by 
time().  Hope that clears it up a little.

Jeff

At 03:18 PM 2/21/2002 +1100, Justin French wrote:
>It doesn't seem to me like this is an issue... isn't the timestamp just
>the local unix time?  It is on my LAN server.
>
>The issue I have is that
>
>echo date('d M Y H:m:s','1014261839');
>produces 21 Feb 2002 14:02:59 on my LOCAL machine
>
>echo date('d M Y H:m:s','1014260440');
>produces 20 Feb 2002 21:02:40 on my LIVE server.
>
>this is a difference of around 17 hours (i ran both scripts within 5
>seconds of each other)
>
>however 1014261839 - 1014260440 = just 1399 seconds.
>
>
>so where am I going wrong?
>
>there's either an issue with:
>
>a) time()
>b) date()
>c) the subtraction of one timestamp from another
>
>that i'm not aware of.
>
>
>justin
>
>
>
>Billy S Halsey wrote:
> >
> > Justin,
> >
> > Take a look at the gettimeofday() function, which returns the timezone
> > and daylight-savings-time values for the system.
> >
> > -bsh
>
>--
>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] timestamp confusion

2002-02-20 Thread Justin French

It doesn't seem to me like this is an issue... isn't the timestamp just
the local unix time?  It is on my LAN server.

The issue I have is that

echo date('d M Y H:m:s','1014261839');
produces 21 Feb 2002 14:02:59 on my LOCAL machine

echo date('d M Y H:m:s','1014260440');
produces 20 Feb 2002 21:02:40 on my LIVE server.

this is a difference of around 17 hours (i ran both scripts within 5
seconds of each other)

however 1014261839 - 1014260440 = just 1399 seconds.


so where am I going wrong?

there's either an issue with:

a) time()
b) date()
c) the subtraction of one timestamp from another

that i'm not aware of.


justin



Billy S Halsey wrote:
> 
> Justin,
> 
> Take a look at the gettimeofday() function, which returns the timezone
> and daylight-savings-time values for the system.
> 
> -bsh

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




Re: [PHP] Trouble with Sessions

2002-02-20 Thread Richard Baskett

Well actually I believe if you do a header pragma cache or another way of
caching the page it should work.  If I am wrong someone please correct me..
I don¹t want to give out bad advice :)

Rick

"The old law about "an eye for an eye" leaves everybody blind." - Dr. Martin
Luther King, Jr.

> From: Steven Walker <[EMAIL PROTECTED]>
> Date: Wed, 20 Feb 2002 19:57:48 -0800
> To: "Phillip S. Baker" <[EMAIL PROTECTED]>
> Cc: PHP Email List <[EMAIL PROTECTED]>
> Subject: Re: [PHP] Trouble with Sessions
> 
> Phillip,
> 
> I had the same problem. It's even worse in IE5 since no error was
> displayed, just an empty form. To circumvent this, I put PHP controls
> for navigating. To go back, a button called 'modify' resubmits the data
> to the form page. On my site, if the user clicks the back button, they
> get hosed what can you do?
> 
> Any one else know?
> 
> Steven J. Walker
> Walker Effects
> www.walkereffects.com
> [EMAIL PROTECTED]
> 
> On Wednesday, February 20, 2002, at 07:36  PM, Phillip S. Baker wrote:
> 
>> Hey All,
>> 
>> I just converted my login process to sessions.
>> It works great.
>> 
>> However I am having one annoying issue come up.
>> 
>> The site is a secure site. So each page has an include to check to see
>> if a validated session is there. If not a login forma appears and so on.
>> It all works just fine.
>> 
>> However I am coming up against a problem with forms now.
>> 
>> I have a searchable listing of members.
>> So there is a form to search for particular members.
>> I preform the search, get a listing of possible matches.
>> 
>> Now I click on a member name to get more info about him bringing up
>> another page.
>> If I hit the back button on the browser to get the search results again
>> I get the following message
>> 
>> Warning: Page has Expired The page you requested was created using
>> information you submitted in a form. This page is no longer available.
>> As a security precaution, Internet Explorer does not automatically
>> resubmit your information for you.
>> 
>> To resubmit your information and view this Web page, click the Refresh
>> button.
>> 
>> Under my previous scheme where login was through the use of cookies.
>> I did not get the above message.
>> 
>> Anyone have any ideas how to get ride of this message and just allow
>> the back button to work like it did before?
>> 
>> (Oh I get similiar messages in NN 6.2 or NN 4.+)
>> 
>> Phillip
>> 
>> 
>> -- 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] Q on php://stdin

2002-02-20 Thread Billy S Halsey

Hi all,

I still have been completely unable to get this to work like it should. 
I have a simple script:

#!/usr/local/bin/php -q


So if I call this echo.php, then if I try something like

cat /etc/hosts | ./echo.php

It prints a # (first line of /etc/hosts) followed by two blank lines. 
Then it quits. /etc/hosts does contain real data. This occurs with ANY 
file that I try to cat.

If you know what the problem might be, I would LOVE to hear your 
suggestions. I didn't get any replies the first time I asked, so I'm 
hoping that someone has something to contribute.

I'm using PHP 4.1.1 on Solaris 8.

Thanks in advance,

-bsh

Billy S Halsey wrote:

> Hi all,
>
> I've been trying for the last three hours to do something like this:
>
>#!/usr/local/bin/php -q
>$fp = fopen("php://stdin", "r");
>while (!feof($fp)) {
>$line = fgets($fp, 4096);
>print $line;
>}
>fclose($fp);
>?>
>
> And then calling it with something like:
>
>cat foo.txt | ./echofile.php
>
> The problem is, it will print the first line of foo.txt, and then 
> exit. No matter what I do, I can't get it to read the next line. I've 
> even added a test after the print command to see if it's at EOF, and 
> it's not. I've also changed it to do this:
>
>while (($buf = fgets($fp, 4096)) != FALSE) {
>print $buf;
>}
>
> Still won't read more than one line of the file. The only thing I've 
> been able to do that seems to work is this:
>
>$fp = fopen("/dev/fd/0", "r");
>while (!feof($fp)) ..
>
> [The code snippets I've quoted above are just rough sketches ... I 
> really am checking the return value from fopen() to make sure I open 
> the file, etc.]
>
> I'm using PHP 4.1.1 on Solaris 8. Can somebody PLEASE tell me what the 
> problem is? What stupid mistake am I making?
>
> Thanks.
>
> -bsh :-)
>

-- 

===
Billy S Halsey  Software Problem Resolution
ESP Solaris Software
Email [EMAIL PROTECTED]Sun Microsystems, Inc
   -NO DAY BUT TODAY-
===




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




[PHP] Re: Which Portal System?

2002-02-20 Thread Gary

Curtis Strite wrote:

> I'm looking for some recommendations on which portal system to use for my
> website.  I have sifted through most of what I think will suite my needs at
> hotscripts.com.  HOwever I wanted to get some feedback from somone who has
> used any of the ones I'm looking at before I take the time to set it up and
> it turns out to be a bust.
> 
> Here are the ones I've downloaded.  All of which require PHP and MySQL.  Let
> me know if there are any I should stay away from or any that are worth
> using.
> 
> PHP-NUKE:
> PHP-Nuke-5.5.tar.gz
> http://phpnuke.org/
> 
> PHP SITE ADMIN:
> PHPSiteAdmin-2.1.zip
> http://www.phpsiteadmin.org/
> 
> PHP WEB Things:
> phpwebthings-0.btest4.zip
> http://www.phpdbform.com/
> 
> POST NUKE:
> PN703.zip
> http://www.postnuke.com/
> 
> My PHP NUke:
> mpn188_final.zip
> http://www.myphpnuke.com/
> 
> Thanks in advance,
> Curt
> 
> 
> 
> 

One more for you to check out.
http://phpwebsite.appstate.edu/

Gary



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




Re: [PHP] Trouble with Sessions

2002-02-20 Thread Steven Walker

Phillip,

I had the same problem. It's even worse in IE5 since no error was 
displayed, just an empty form. To circumvent this, I put PHP controls 
for navigating. To go back, a button called 'modify' resubmits the data 
to the form page. On my site, if the user clicks the back button, they 
get hosed what can you do?

Any one else know?

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]

On Wednesday, February 20, 2002, at 07:36  PM, Phillip S. Baker wrote:

> Hey All,
>
> I just converted my login process to sessions.
> It works great.
>
> However I am having one annoying issue come up.
>
> The site is a secure site. So each page has an include to check to see 
> if a validated session is there. If not a login forma appears and so on.
> It all works just fine.
>
> However I am coming up against a problem with forms now.
>
> I have a searchable listing of members.
> So there is a form to search for particular members.
> I preform the search, get a listing of possible matches.
>
> Now I click on a member name to get more info about him bringing up 
> another page.
> If I hit the back button on the browser to get the search results again 
> I get the following message
>
> Warning: Page has Expired The page you requested was created using 
> information you submitted in a form. This page is no longer available. 
> As a security precaution, Internet Explorer does not automatically 
> resubmit your information for you.
>
> To resubmit your information and view this Web page, click the Refresh 
> button.
>
> Under my previous scheme where login was through the use of cookies.
> I did not get the above message.
>
> Anyone have any ideas how to get ride of this message and just allow 
> the back button to work like it did before?
>
> (Oh I get similiar messages in NN 6.2 or NN 4.+)
>
> Phillip
>
>
> -- 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: Hyperlinks vs Buttons

2002-02-20 Thread Gary



Steven Walker wrote:

> Is there a way to regular hyperlinked text to submit a form?
> 
> For example, rather than having a button that says [Login], I just want 
> underlined text: Login
> 
> Steven J. Walker
> Walker Effects
> www.walkereffects.com
> [EMAIL PROTECTED]
> 

Login

HTH
Gary


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




Re: [PHP] wordwrap not working

2002-02-20 Thread Steven Walker

This may be a nl2br() problem. If you are setting \n as your newline 
character, it probably needs to be  if your just echoing it. 
Depending on where it ultimately gets displayed, you'll want one or the 
other. For example, sending an email message you want \n.

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]

On Wednesday, February 20, 2002, at 07:25  PM, Michael P. Carel wrote:

>
> Hi,
>
> Im testing the example in the
> http://www.php.net/manual/en/function.wordwrap.php and it seems not 
> working
> it still printing the whole word and not wrapping. Im using php4.05 in 
> my
> redhat 6.2 using an apache.
> Here's the sample:
>  $text = "The quick brown fox jumped over the lazy dog.";
> $newtext = wordwrap( $text, 20 );
>
> echo "$newtext\n";
> ?>
>
> it should print like this:
>
> The quick brown fox
> jumped over the lazy dog.
>
> but it still printing like this:
>
> The quick brown fox jumped over the lazy dog.
>
>
>
> Please help
>
>
>
> Regards,
> Mike
>
>
>
> --
> 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] wordwrap not working

2002-02-20 Thread Joel Boonstra

> If your viewing the output through a browser, try this;
>
>  $text = "The quick brown fox jumped over the lazy dog.";
> $newtext = wordwrap( $text, 20, "");
> echo "$newtext\n";
> ?>

Ah, this is a better solution than mine -- I didn't know wordwrap had the
3rd (and 4th) parameters till now.

Joel

-- 
[ joel boonstra | [EMAIL PROTECTED] ]


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




[PHP] Trouble with Sessions

2002-02-20 Thread Phillip S. Baker

Hey All,

I just converted my login process to sessions.
It works great.

However I am having one annoying issue come up.

The site is a secure site. So each page has an include to check to see if a 
validated session is there. If not a login forma appears and so on.
It all works just fine.

However I am coming up against a problem with forms now.

I have a searchable listing of members.
So there is a form to search for particular members.
I preform the search, get a listing of possible matches.

Now I click on a member name to get more info about him bringing up another 
page.
If I hit the back button on the browser to get the search results again I 
get the following message

Warning: Page has Expired The page you requested was created using 
information you submitted in a form. This page is no longer available. As a 
security precaution, Internet Explorer does not automatically resubmit your 
information for you.

To resubmit your information and view this Web page, click the Refresh button.

Under my previous scheme where login was through the use of cookies.
I did not get the above message.

Anyone have any ideas how to get ride of this message and just allow the 
back button to work like it did before?

(Oh I get similiar messages in NN 6.2 or NN 4.+)

Phillip


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




Re: [PHP] wordwrap not working

2002-02-20 Thread Joel Boonstra


> it should print like this:
>
> The quick brown fox
> jumped over the lazy dog.
>
> but it still printing like this:
>
> The quick brown fox jumped over the lazy dog.

HTML treats bunches of whitespace as one space.  Look at the source of the
page; you'll see that it's doing what it should.

If you want your HTML to appear wordwrapped, modify your PHP to use the
'nl2br()' function:



This will convert all newlines to  tags, and your HTML output will
look just like your text output.

Joel

-- 
[ joel boonstra | [EMAIL PROTECTED] ]



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




RE: [PHP] wordwrap not working

2002-02-20 Thread David Redmond

If your viewing the output through a browser, try this;

");
echo "$newtext\n";
?>

-Original Message-
From: Michael P. Carel [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, 21 February 2002 1:25 PM
To: php
Subject: [PHP] wordwrap not working



Hi,

Im testing the example in the
http://www.php.net/manual/en/function.wordwrap.php and it seems not working
it still printing the whole word and not wrapping. Im using php4.05 in my
redhat 6.2 using an apache.
Here's the sample:


it should print like this:

The quick brown fox
jumped over the lazy dog.

but it still printing like this:

The quick brown fox jumped over the lazy dog.



Please help



Regards,
Mike



-- 
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] wordwrap not working

2002-02-20 Thread Martin Towell

Are you looking at the output in a web browser?

Martin

-Original Message-
From: Michael P. Carel [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 21, 2002 2:25 PM
To: php
Subject: [PHP] wordwrap not working



Hi,

Im testing the example in the
http://www.php.net/manual/en/function.wordwrap.php and it seems not working
it still printing the whole word and not wrapping. Im using php4.05 in my
redhat 6.2 using an apache.
Here's the sample:


it should print like this:

The quick brown fox
jumped over the lazy dog.

but it still printing like this:

The quick brown fox jumped over the lazy dog.



Please help



Regards,
Mike



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



[PHP] wordwrap not working

2002-02-20 Thread Michael P. Carel


Hi,

Im testing the example in the
http://www.php.net/manual/en/function.wordwrap.php and it seems not working
it still printing the whole word and not wrapping. Im using php4.05 in my
redhat 6.2 using an apache.
Here's the sample:


it should print like this:

The quick brown fox
jumped over the lazy dog.

but it still printing like this:

The quick brown fox jumped over the lazy dog.



Please help



Regards,
Mike



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




Re: [PHP] timestamp confusion

2002-02-20 Thread Billy S Halsey

Justin,

Take a look at the gettimeofday() function, which returns the timezone 
and daylight-savings-time values for the system.

-bsh

Justin French wrote:

>hi,
>
>when people add something to a table, i'm logging the time()... later,
>when I pull it out, i'm doing something like date('d M Y',$stamp), which
>all works fine, printing something like "21 Jan 2002".
>
>problem is, i'm on a server in canada, but 99% of my users will be in Australia.
>
>to get an idea of the time difference, I made a simple php file called
>time on both my local test server and the live server:
>
>
>$stamp = time();
>echo $stamp."";
>echo date('d M Y H:m:s', $stamp);
>
>?>
>
>I ran both scripts within 5 seconds of each other, and got the following:
>
>local:
>1014261839
>21 Feb 2002 14:02:59
>
>live:
>1014260440
>20 Feb 2002 21:02:40
>
>
>So, if I look at the second line of the output, they're about 17 hours
>behind me, but if I look at the first line [time()] (according to the
>manual, the number of seconds since that date in 1970 i think), I get a
>way different result:
>
>1014261839 - 1014260440 = 1399 seconds difference, about 23 minutes.
>
>
>I want to be able to determine the $difference between the two stamps in
>seconds, then do something like:
>echo date('d M Y',$stamp - $difference);
>?>
>
>
>Seems easy enough, but 1399 doesn't seem right to me!
>
>Where have I lost the plot???
>
>
>Justin French
>http://indent.com.au
>http://soundpimps.com
>

-- 

===
Billy S Halsey  Software Problem Resolution
ESP Solaris Software
Email [EMAIL PROTECTED]Sun Microsystems, Inc
   -NO DAY BUT TODAY-
===




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




Re: [PHP] Using 'Location' and variables

2002-02-20 Thread John Steele

Hi Jim,

  Glad that it makes sense now.  In fact, the other page may not even need to exist.  
Instead of including a seperate page, you could simply display the output from within 
this same form script.  I find this extremely useful in combination with a templating 
system.

Happy coding,
  John

>John,
>
>I never even thought of just including the page I was wanting to
>redirect/switch to. I was always ending my processing portion with a
>header("Location : ") thingy in all of my scripts. As no output comes
>out during the processing stage it should all work.
>
>It seems so straight forward now, thank you.
>
>Jim.
>
>> Hi Jim,
>>
>>   The header() function call you use below IS doing a GET.  Maybe if you
>told us why you need to redirect to this new page might help.  Simply doing
>the processing then including the new page should work fine, as long as the
>processing part doesn't do any output.  A simple example:
>>
>> if ($REQUEST_METHOD == 'POST') {
>>   if (!isset($name))
>> echo "Please enter your name!";  // content here or
>>   else
>> require 'http://www.somehost.com/somescript.php'; // $name & $age set
>>   }
>>
>> John
>>
>> >Thanks for your reply John.
>> >
>> >In fact I'm using the method you describe where the same script is used
>to
>> >both display and process the form.
>> >
>> >However, in the area where I'm doing the processing, I want to redirect
>at
>> >the end of it and still be able to use some of the variables in the
>location
>> >I'm going to go to. Now I know I can just whack them on the end of the
>> >location header:
>> >
>> >header("Location:
>> >http://www.somehost.com/somescript.php?name=fred&age=5";);
>> >
>> >But I don't want to use this method, I'd rather something similar to GET.
>> >
>> >BTW I'm using PHP4+
>> >
>> >Jim.
>> >
>> >> Hi Jim,
>> >>
>> >>   There are several ways to accomplish this such as flat files,
>database
>> >records, sessions, and the like.  But I prefer to simply include a file
>(or
>> >have the one file do both form display and processing) and then you get
>all
>> >your variables:
>> >>
>> >> if ($REQUEST_METHOD == 'POST') {
>> >>   // either do you processing and diplay here, or
>> >>   include './destination.php';  // with access to all posted vars
>> >>   }
>> >> else {
>> >>   // display your form
>> >>   }
>> >>
>> >>   Remember that header() requires a FULLY QUALIFIED DOMAIN NAME and
>path:
>> >>
>> >> header("Location: http://www.somehost.com/somescript.php";);
>> >>
>> >> and that it is a GET ($REQUEST_METHOD == 'GET').  The fact that some
>web
>> >servers will display the page anyway is no reason to depend on that.
>> >>
>> >>   For PHP4+ of course you can use $_SERVER['REQUEST_METHOD'] instead.
>> >>
>> >> HTH,
>> >>   John
>> >>
>> >> >I'm sure that this is possible, but I haven't found any info/examples
>on
>> >it
>> >> >yet,..
>> >> >
>> >> >What I have is a php script that processes data that been submitted by
>a
>> >> >FORM.
>> >> >
>> >> >That's OK,...
>> >> >
>> >> >At the end of my script, depending upon the processing, I want to GOTO
>> >> >another php script, that's also OK, I can simply use the function
>> >> >
>> >> >header("Location:destination.php");
>> >> >
>> >> >However, I have a whole lot of variables that were initially
>submitted,
>> >and
>> >> >I want to take some of them with me when I go to the new
>destination.php.
>> >> >
>> >> >Now, I know I can just tack them on the end like a POST, but I'd
>prefer
>> >to
>> >> >NOT get them there in the URL, like a GET does,... any ideas ??
>> >> >
>> >> >Thanks in advance,
>> >> >
>> >> >Jim.
--
/* SteeleSoft Consulting John Steele - Systems Analyst/Programmer
 *  We also walk dogs...  Dynamic Web Design  PHP/MySQL/Linux/Hosting
 *  www.steelesoftconsulting.com [EMAIL PROTECTED]
 */

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




[PHP] timestamp confusion

2002-02-20 Thread Justin French

hi,

when people add something to a table, i'm logging the time()... later,
when I pull it out, i'm doing something like date('d M Y',$stamp), which
all works fine, printing something like "21 Jan 2002".

problem is, i'm on a server in canada, but 99% of my users will be in Australia.

to get an idea of the time difference, I made a simple php file called
time on both my local test server and the live server:

";
echo date('d M Y H:m:s', $stamp);

?>

I ran both scripts within 5 seconds of each other, and got the following:

local:
1014261839
21 Feb 2002 14:02:59

live:
1014260440
20 Feb 2002 21:02:40


So, if I look at the second line of the output, they're about 17 hours
behind me, but if I look at the first line [time()] (according to the
manual, the number of seconds since that date in 1970 i think), I get a
way different result:

1014261839 - 1014260440 = 1399 seconds difference, about 23 minutes.


I want to be able to determine the $difference between the two stamps in
seconds, then do something like:



Seems easy enough, but 1399 doesn't seem right to me!

Where have I lost the plot???


Justin French
http://indent.com.au
http://soundpimps.com

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




RE: [PHP] Need help

2002-02-20 Thread Martin Towell

or maybe explode using ";" as your delimiter first
then loop through the returned array
depending on what the current item is, and the previous item(s) are (maybe
using flags to know where you are, and what has happened), act on the
current one in a certain way

dunno if i've written it in an understandable way, but as Steven says, break
it down into smaller steps

Martin

-Original Message-
From: Steven Walker [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 21, 2002 1:30 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Need help


John,

You could create a function to do this. Just think of it in small steps. 
You can use the string replace function to replace certain parts with 
other characters, or nothing at all. For example:

$data = "Wilson; Hope,(i) Alec Derwent; King,(i) Bruce; James,(i) 
Henry;";
$new_data = str_replace(",(i) ", "\t", $data);

You can then use explode() to put it into an array. You'll have to 
figure out the details, but that should get you started.

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]

On Wednesday, February 20, 2002, at 06:01  PM, jtjohnston wrote:

> Yeeesch! I neet help.
>
> I need a method to flush out lists of authors in a MySQL field called
> "KW".
>
> The field looks a bit like this:
>


>
> &&1; Caribbean and West Indies; Guyana;&&4; Birney,(i) Earle; Harris,(i)
> Wilson; Hope,(i) Alec Derwent; King,(i) Bruce; James,(i) Henry;
> Olson,(i) Charles; Rushdie,(i) Salman; Purdy,(i) Al; Joyce,(i) James;
> Macleish,(i) Archibald; Cummings,(i) Edward Estlin (E.E.); Auden,(i) W.
> H.; Atwood,(i) Margaret; Tutuola,(i) Amos; Simon,(i) Claude;&&7;
> comparison of authors and works;
>


>
> In the section that starts with &&4
> I need to look for (i) search backward to the prewious ; and search
> forward to the next ; and extract into an array the contents between the
> semi-colons to arrive at something that looks like:
>
> Birney, Earle
> Harris, Wilson
> Hope, Alec Derwent
> King, Bruce
> James, Henry
> Olson, Charles
> Rushdie, Salman
> Purdy, Al
> Joyce, James
> Macleish, Archibald
> Cummings, Edward Estlin (E.E.)
> Auden, W. H.
> Atwood, Margaret
> Tutuola, Amos
> Simon, Claude
>
> Can someone please help me get started?
>
> John
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



Re: [PHP] text box truncate

2002-02-20 Thread Steven Walker

How about wordwrap()?
http://www.php.net/manual/en/function.wordwrap.php

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]

On Wednesday, February 20, 2002, at 06:02  PM, Michael P. Carel wrote:

> Hi there,
>
> I have here a problem regarding how to truncate the data that was 
> written in
> the text box form? I want the data to be displayed in the html collumn 
> in
> standard length and format. Setting the  text box in WRAP will not 
> solve the
> problem it will not add a new line. I want that instead of wrapping it 
> will
> just add a newline(\n) to display it properly in the html column.
>
> Any idea? Please help me im stuck here.
>
>
>
> Regards,
> mike
>
>
> --
> 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] Need help

2002-02-20 Thread Steven Walker

John,

You could create a function to do this. Just think of it in small steps. 
You can use the string replace function to replace certain parts with 
other characters, or nothing at all. For example:

$data = "Wilson; Hope,(i) Alec Derwent; King,(i) Bruce; James,(i) 
Henry;";
$new_data = str_replace(",(i) ", "\t", $data);

You can then use explode() to put it into an array. You'll have to 
figure out the details, but that should get you started.

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]

On Wednesday, February 20, 2002, at 06:01  PM, jtjohnston wrote:

> Yeeesch! I neet help.
>
> I need a method to flush out lists of authors in a MySQL field called
> "KW".
>
> The field looks a bit like this:
> 
>
>
> &&1; Caribbean and West Indies; Guyana;&&4; Birney,(i) Earle; Harris,(i)
> Wilson; Hope,(i) Alec Derwent; King,(i) Bruce; James,(i) Henry;
> Olson,(i) Charles; Rushdie,(i) Salman; Purdy,(i) Al; Joyce,(i) James;
> Macleish,(i) Archibald; Cummings,(i) Edward Estlin (E.E.); Auden,(i) W.
> H.; Atwood,(i) Margaret; Tutuola,(i) Amos; Simon,(i) Claude;&&7;
> comparison of authors and works;
> 
>
>
> In the section that starts with &&4
> I need to look for (i) search backward to the prewious ; and search
> forward to the next ; and extract into an array the contents between the
> semi-colons to arrive at something that looks like:
>
> Birney, Earle
> Harris, Wilson
> Hope, Alec Derwent
> King, Bruce
> James, Henry
> Olson, Charles
> Rushdie, Salman
> Purdy, Al
> Joyce, James
> Macleish, Archibald
> Cummings, Edward Estlin (E.E.)
> Auden, W. H.
> Atwood, Margaret
> Tutuola, Amos
> Simon, Claude
>
> Can someone please help me get started?
>
> John
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



[PHP] Where to look for developers?

2002-02-20 Thread Francisco Reyes

Suggestions where to place an ad for a part time/per project developer?
I looked at several sites and none of them seemed heavily trafficed or
like a "good place". Also the major places likes monster.com probably
charge a fee to list.

The links I found were from  the "Developers and Job
Opportunities" links on php.net



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




Re: [PHP] Using 'Location' and variables

2002-02-20 Thread Jim Koutoumis

John,

I never even thought of just including the page I was wanting to
redirect/switch to. I was always ending my processing portion with a
header("Location : ") thingy in all of my scripts. As no output comes
out during the processing stage it should all work.

It seems so straight forward now, thank you.

Jim.


"John Steele" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi Jim,
>
>   The header() function call you use below IS doing a GET.  Maybe if you
told us why you need to redirect to this new page might help.  Simply doing
the processing then including the new page should work fine, as long as the
processing part doesn't do any output.  A simple example:
>
> if ($REQUEST_METHOD == 'POST') {
>   if (!isset($name))
> echo "Please enter your name!";  // content here or
>   else
> require 'http://www.somehost.com/somescript.php'; // $name & $age set
>   }
>
> John
>
> >Thanks for your reply John.
> >
> >In fact I'm using the method you describe where the same script is used
to
> >both display and process the form.
> >
> >However, in the area where I'm doing the processing, I want to redirect
at
> >the end of it and still be able to use some of the variables in the
location
> >I'm going to go to. Now I know I can just whack them on the end of the
> >location header:
> >
> >header("Location:
> >http://www.somehost.com/somescript.php?name=fred&age=5";);
> >
> >But I don't want to use this method, I'd rather something similar to GET.
> >
> >BTW I'm using PHP4+
> >
> >Jim.
> >
> >"John Steele" <[EMAIL PROTECTED]> wrote in message
> >[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> >> Hi Jim,
> >>
> >>   There are several ways to accomplish this such as flat files,
database
> >records, sessions, and the like.  But I prefer to simply include a file
(or
> >have the one file do both form display and processing) and then you get
all
> >your variables:
> >>
> >> if ($REQUEST_METHOD == 'POST') {
> >>   // either do you processing and diplay here, or
> >>   include './destination.php';  // with access to all posted vars
> >>   }
> >> else {
> >>   // display your form
> >>   }
> >>
> >>   Remember that header() requires a FULLY QUALIFIED DOMAIN NAME and
path:
> >>
> >> header("Location: http://www.somehost.com/somescript.php";);
> >>
> >> and that it is a GET ($REQUEST_METHOD == 'GET').  The fact that some
web
> >servers will display the page anyway is no reason to depend on that.
> >>
> >>   For PHP4+ of course you can use $_SERVER['REQUEST_METHOD'] instead.
> >>
> >> HTH,
> >>   John
> >>
> >> >I'm sure that this is possible, but I haven't found any info/examples
on
> >it
> >> >yet,..
> >> >
> >> >What I have is a php script that processes data that been submitted by
a
> >> >FORM.
> >> >
> >> >That's OK,...
> >> >
> >> >At the end of my script, depending upon the processing, I want to GOTO
> >> >another php script, that's also OK, I can simply use the function
> >> >
> >> >header("Location:destination.php");
> >> >
> >> >However, I have a whole lot of variables that were initially
submitted,
> >and
> >> >I want to take some of them with me when I go to the new
destination.php.
> >> >
> >> >Now, I know I can just tack them on the end like a POST, but I'd
prefer
> >to
> >> >NOT get them there in the URL, like a GET does,... any ideas ??
> >> >
> >> >Thanks in advance,
> >> >
> >> >Jim.
> --
> /* SteeleSoft Consulting John Steele - Systems Analyst/Programmer
>  *  We also walk dogs...  Dynamic Web Design  PHP/MySQL/Linux/Hosting
>  *  www.steelesoftconsulting.com [EMAIL PROTECTED]
>  */





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




RE: [PHP] array session variable problem (register_global=off)

2002-02-20 Thread Harry Yu

Thanks Kirk,

That works.

Harry

__
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com

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




[PHP] text box truncate

2002-02-20 Thread Michael P. Carel

Hi there,

I have here a problem regarding how to truncate the data that was written in
the text box form? I want the data to be displayed in the html collumn in
standard length and format. Setting the  text box in WRAP will not solve the
problem it will not add a new line. I want that instead of wrapping it will
just add a newline(\n) to display it properly in the html column.

Any idea? Please help me im stuck here.



Regards,
mike


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




[PHP] Need help

2002-02-20 Thread jtjohnston

Yeeesch! I neet help.

I need a method to flush out lists of authors in a MySQL field called
"KW".

The field looks a bit like this:


&&1; Caribbean and West Indies; Guyana;&&4; Birney,(i) Earle; Harris,(i)
Wilson; Hope,(i) Alec Derwent; King,(i) Bruce; James,(i) Henry;
Olson,(i) Charles; Rushdie,(i) Salman; Purdy,(i) Al; Joyce,(i) James;
Macleish,(i) Archibald; Cummings,(i) Edward Estlin (E.E.); Auden,(i) W.
H.; Atwood,(i) Margaret; Tutuola,(i) Amos; Simon,(i) Claude;&&7;
comparison of authors and works;


In the section that starts with &&4
I need to look for (i) search backward to the prewious ; and search
forward to the next ; and extract into an array the contents between the
semi-colons to arrive at something that looks like:

Birney, Earle
Harris, Wilson
Hope, Alec Derwent
King, Bruce
James, Henry
Olson, Charles
Rushdie, Salman
Purdy, Al
Joyce, James
Macleish, Archibald
Cummings, Edward Estlin (E.E.)
Auden, W. H.
Atwood, Margaret
Tutuola, Amos
Simon, Claude

Can someone please help me get started?

John


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




Re: [PHP] Using 'Location' and variables

2002-02-20 Thread John Steele

Hi Jim,

  The header() function call you use below IS doing a GET.  Maybe if you told us why 
you need to redirect to this new page might help.  Simply doing the processing then 
including the new page should work fine, as long as the processing part doesn't do any 
output.  A simple example:

if ($REQUEST_METHOD == 'POST') {
  if (!isset($name))
echo "Please enter your name!";  // content here or
  else
require 'http://www.somehost.com/somescript.php'; // $name & $age set
  }

John

>Thanks for your reply John.
>
>In fact I'm using the method you describe where the same script is used to
>both display and process the form.
>
>However, in the area where I'm doing the processing, I want to redirect at
>the end of it and still be able to use some of the variables in the location
>I'm going to go to. Now I know I can just whack them on the end of the
>location header:
>
>header("Location:
>http://www.somehost.com/somescript.php?name=fred&age=5";);
>
>But I don't want to use this method, I'd rather something similar to GET.
>
>BTW I'm using PHP4+
>
>Jim.
>
>"John Steele" <[EMAIL PROTECTED]> wrote in message
>[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>> Hi Jim,
>>
>>   There are several ways to accomplish this such as flat files, database
>records, sessions, and the like.  But I prefer to simply include a file (or
>have the one file do both form display and processing) and then you get all
>your variables:
>>
>> if ($REQUEST_METHOD == 'POST') {
>>   // either do you processing and diplay here, or
>>   include './destination.php';  // with access to all posted vars
>>   }
>> else {
>>   // display your form
>>   }
>>
>>   Remember that header() requires a FULLY QUALIFIED DOMAIN NAME and path:
>>
>> header("Location: http://www.somehost.com/somescript.php";);
>>
>> and that it is a GET ($REQUEST_METHOD == 'GET').  The fact that some web
>servers will display the page anyway is no reason to depend on that.
>>
>>   For PHP4+ of course you can use $_SERVER['REQUEST_METHOD'] instead.
>>
>> HTH,
>>   John
>>
>> >I'm sure that this is possible, but I haven't found any info/examples on
>it
>> >yet,..
>> >
>> >What I have is a php script that processes data that been submitted by a
>> >FORM.
>> >
>> >That's OK,...
>> >
>> >At the end of my script, depending upon the processing, I want to GOTO
>> >another php script, that's also OK, I can simply use the function
>> >
>> >header("Location:destination.php");
>> >
>> >However, I have a whole lot of variables that were initially submitted,
>and
>> >I want to take some of them with me when I go to the new destination.php.
>> >
>> >Now, I know I can just tack them on the end like a POST, but I'd prefer
>to
>> >NOT get them there in the URL, like a GET does,... any ideas ??
>> >
>> >Thanks in advance,
>> >
>> >Jim.
--
/* SteeleSoft Consulting John Steele - Systems Analyst/Programmer
 *  We also walk dogs...  Dynamic Web Design  PHP/MySQL/Linux/Hosting
 *  www.steelesoftconsulting.com [EMAIL PROTECTED]
 */

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




Re: [PHP] INT function?

2002-02-20 Thread James Taylor

Heh, that's interesting.. Only difference is you have to put parenthesis 
around int.  
Weird

On Wednesday 20 February 2002 05:10 pm, you wrote:
> $z = (int)($x / $y);   // should work
>
> or
>
> $z = $x / $y;
> settype($z, "integer");
>
> -Original Message-
> From: James Taylor [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, February 21, 2002 12:07 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] INT function?
>
>
> Just curious what the function is to convert x into an integer if it's a
> float Say for example I have something like this
>
>
> $x = 7;
> $y = 3;
>
> $z = $x / $y;
>
> I want $z to equal 2.  In perl it would be
>
> $z = int($x / $y);
>
> I'm just not sure how to do this in PHP, as int apparently doesn't work
> (darn).  I'm using 4.06 by the way, so if there's some new function in 4.1
> that does this, I can't use it... so < 4.1 functions please

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




RE: [PHP] INT function?

2002-02-20 Thread bvr

On Thu, 21 Feb 2002 12:10:53 +1100, Martin Towell wrote:

>$z = (int)($x / $y);   // should work
>
>or
>
>$z = $x / $y;
>settype($z, "integer");

or

$z = intval($x / $y);


bvr.



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




Re: [PHP] INT function?

2002-02-20 Thread Bas Jobsen

$z = intval($x / $y);

Op donderdag 21 februari 2002 02:06, schreef James Taylor:
> Just curious what the function is to convert x into an integer if it's a
> float Say for example I have something like this
>
>
> $x = 7;
> $y = 3;
>
> $z = $x / $y;
>
> I want $z to equal 2.  In perl it would be
>
> $z = int($x / $y);
>
> I'm just not sure how to do this in PHP, as int apparently doesn't work
> (darn).  I'm using 4.06 by the way, so if there's some new function in 4.1
> that does this, I can't use it... so < 4.1 functions please

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




Re: [PHP] INT function?

2002-02-20 Thread Michael Sims

At 05:06 PM 2/20/2002 -0800, James Taylor wrote:
>$x = 7;
>$y = 3;
>
>$z = $x / $y;
>
>I want $z to equal 2.  In perl it would be
>
>$z = int($x / $y);

This is untested, but:

$z = (int) ($x / $y);

Should work.


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




RE: [PHP] INT function?

2002-02-20 Thread Martin Towell

$z = (int)($x / $y);   // should work

or

$z = $x / $y;
settype($z, "integer");

-Original Message-
From: James Taylor [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 21, 2002 12:07 PM
To: [EMAIL PROTECTED]
Subject: [PHP] INT function?


Just curious what the function is to convert x into an integer if it's a 
float Say for example I have something like this


$x = 7;
$y = 3;

$z = $x / $y;

I want $z to equal 2.  In perl it would be

$z = int($x / $y);

I'm just not sure how to do this in PHP, as int apparently doesn't work 
(darn).  I'm using 4.06 by the way, so if there's some new function in 4.1 
that does this, I can't use it... so < 4.1 functions please

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



[PHP] INT function?

2002-02-20 Thread James Taylor

Just curious what the function is to convert x into an integer if it's a 
float Say for example I have something like this


$x = 7;
$y = 3;

$z = $x / $y;

I want $z to equal 2.  In perl it would be

$z = int($x / $y);

I'm just not sure how to do this in PHP, as int apparently doesn't work 
(darn).  I'm using 4.06 by the way, so if there's some new function in 4.1 
that does this, I can't use it... so < 4.1 functions please

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




Re: [PHP] dealing with MSWord curly quotes in text

2002-02-20 Thread Analysis and Solutions

Hey Austin:

> text has been edited in MSWord and the
> quotes that it uses get turned into question marks.  does anyone know a
> way to convert these MSWord quotes to normal " marks?

Replace the nasties with preg...

   $Data = preg_replace('/[\x93\x94]/', '"', $Data);


I figured out the Hex numbers of the offending characters by pasting such an
offensive character into the following piece of code where the "x" is...

   echo dechex(ord('x'));


You could use the same principles to replace all sorts of junk.

Enjoy,

--Dan

-- 
PHP scripts that make your job easier
  http://www.analysisandsolutions.com/code/
 SQL Solution  |  Layout Solution  |  Form Solution
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Ave, Brooklyn NY 11232v: 718-854-0335f: 718-854-0409

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




[PHP] Zend debug server trouble

2002-02-20 Thread bvr



Hi,

I'm trying to install the debug server for linux, but having
trouble to make it work for remote clients through Apache.

I installed the debug server and compiled php with --enable-debug

The debug server works when I use the 'gdbclient -c' command.

The Zend studio windows client debugs fine using local php.exe .

When I click 'Go' in Zend studio a dialog pops up saying it could
not establish a connection.

I went through the troubleshooting list in the dialog but to no avail.

When I look at the apache logs, there's just the plain request the
IDE did, and there's no errors.

When I paste the request into my browser I get 'document contains no data'.

phpinfo() reports the following:

ZEND_DEBUG  enabled


Please help!

bvr.






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




Re: [PHP] Using 'Location' and variables

2002-02-20 Thread Jim Koutoumis

Thanks for your reply John.

In fact I'm using the method you describe where the same script is used to
both display and process the form.

However, in the area where I'm doing the processing, I want to redirect at
the end of it and still be able to use some of the variables in the location
I'm going to go to. Now I know I can just whack them on the end of the
location header:

header("Location:
http://www.somehost.com/somescript.php?name=fred&age=5";);

But I don't want to use this method, I'd rather something similar to GET.

BTW I'm using PHP4+

Jim.

"John Steele" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi Jim,
>
>   There are several ways to accomplish this such as flat files, database
records, sessions, and the like.  But I prefer to simply include a file (or
have the one file do both form display and processing) and then you get all
your variables:
>
> if ($REQUEST_METHOD == 'POST') {
>   // either do you processing and diplay here, or
>   include './destination.php';  // with access to all posted vars
>   }
> else {
>   // display your form
>   }
>
>   Remember that header() requires a FULLY QUALIFIED DOMAIN NAME and path:
>
> header("Location: http://www.somehost.com/somescript.php";);
>
> and that it is a GET ($REQUEST_METHOD == 'GET').  The fact that some web
servers will display the page anyway is no reason to depend on that.
>
>   For PHP4+ of course you can use $_SERVER['REQUEST_METHOD'] instead.
>
> HTH,
>   John
>
> >I'm sure that this is possible, but I haven't found any info/examples on
it
> >yet,..
> >
> >What I have is a php script that processes data that been submitted by a
> >FORM.
> >
> >That's OK,...
> >
> >At the end of my script, depending upon the processing, I want to GOTO
> >another php script, that's also OK, I can simply use the function
> >
> >header("Location:destination.php");
> >
> >However, I have a whole lot of variables that were initially submitted,
and
> >I want to take some of them with me when I go to the new destination.php.
> >
> >Now, I know I can just tack them on the end like a POST, but I'd prefer
to
> >NOT get them there in the URL, like a GET does,... any ideas ??
> >
> >Thanks in advance,
> >
> >Jim.
>
> --
> /* SteeleSoft Consulting John Steele - Systems Analyst/Programmer
>  *  We also walk dogs...  Dynamic Web Design  PHP/MySQL/Linux/Hosting
>  *  www.steelesoftconsulting.com [EMAIL PROTECTED]
>  */



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




Re: [PHP] Using 'Location' and variables

2002-02-20 Thread John Steele

Hi Jim,

  There are several ways to accomplish this such as flat files, database records, 
sessions, and the like.  But I prefer to simply include a file (or have the one file 
do both form display and processing) and then you get all your variables:

if ($REQUEST_METHOD == 'POST') {
  // either do you processing and diplay here, or
  include './destination.php';  // with access to all posted vars
  }
else {
  // display your form
  }

  Remember that header() requires a FULLY QUALIFIED DOMAIN NAME and path:

header("Location: http://www.somehost.com/somescript.php";);

and that it is a GET ($REQUEST_METHOD == 'GET').  The fact that some web servers will 
display the page anyway is no reason to depend on that.

  For PHP4+ of course you can use $_SERVER['REQUEST_METHOD'] instead.

HTH,
  John

>I'm sure that this is possible, but I haven't found any info/examples on it
>yet,..
>
>What I have is a php script that processes data that been submitted by a
>FORM.
>
>That's OK,...
>
>At the end of my script, depending upon the processing, I want to GOTO
>another php script, that's also OK, I can simply use the function
>
>header("Location:destination.php");
>
>However, I have a whole lot of variables that were initially submitted, and
>I want to take some of them with me when I go to the new destination.php.
>
>Now, I know I can just tack them on the end like a POST, but I'd prefer to
>NOT get them there in the URL, like a GET does,... any ideas ??
>
>Thanks in advance,
>
>Jim.

--
/* SteeleSoft Consulting John Steele - Systems Analyst/Programmer
 *  We also walk dogs...  Dynamic Web Design  PHP/MySQL/Linux/Hosting
 *  www.steelesoftconsulting.com [EMAIL PROTECTED]
 */

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




Re: [PHP] regexp on user supplied link

2002-02-20 Thread DL Neil

I'll offer the following code to get you started on the task - and invite 
critiques/improvements!
(cribbed from various sources and 'tuned' - note that either apostrophes or double 
quotes can be used to delimit
the URL)

 $bValidity  = $iFound
   = preg_match_all( "/(href *= *['\"]?)([^'\" >]*)(['\" >])/i", 
$HTML, $aRegExOut );
 if ( 0  < $iFound )
 {
  $aA  = $aRegExOut[2];
  if ( DEBUG ) { ShowList( "Located", $aA ); }

BTW I'm covering a case of finding multiple links in one piece of HTML. This can be 
dialed-back for single
cases.

The rest I'll leave to you.

Regards,
=dn

- Original Message -
From: "SpamSucks86" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: 20 February 2002 21:16
Subject: RE: [PHP] regexp on user supplied link


> I absolutely hate regular expressions because I suck at writing
> them...but I can help you with the logic. I was thinking search for a
> pattern which matches HREF=" + any number of characters + ". Your match
> would be HREF="blahblahblah". Then, you could go and chop off the HREF="
> and the lagging ", and then you are left with just a URL. Then, you can
> use that built in url parser function (I forget its name, I think it
> might be urlparse()). Then, see if there is no host, it's obviously a
> relative link, otherwise, you can just see if the host matches or not.
> This should work well. Good luck
>
> -Original Message-
> From: Martin Towell [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, February 19, 2002 6:59 PM
> To: '[EMAIL PROTECTED]'; php
> Subject: RE: [PHP] regexp on user supplied link
>
> reg.ex. something like (not tested):
> "]*>"
> this would give you the entire anchor tag, then go from there?
>
> or what about using the XML parsing routines, get it to find the anchors
> and
> give you it's attributes, then go from there?
>
> Martin
>
> -Original Message-
> From: Justin French [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, February 20, 2002 10:46 AM
> To: php
> Subject: [PHP] regexp on user supplied link
>
>
> Hi,
>
> I have a website which is based purely on user-added content.  The
> problem with this is that some areas allow users to use links in the
> text, and it's difficult to ensure that they all have a decent knowledge
> of attributes such as tartget="_new", etc etc.
>
> So, I'd like a script that...
>
> 1. looks at $text for any link tags, and for each tag, does the
> following:
>
> 2. throws out everything except the HREF eg:
> http://www.somesite.com"; target="_new">click becomes
> http://www.somesite.com
>  becomes javascript:something();
>
> 3. prefixe the url with  content is user-driven, I'd like to be a little safer, and say "anything
> that begins with http://www.mysite.com OR http://mysite.com"; is an
> external link.
>
> 5. if it's an external link, suffix the URL with " TARGET="_new">, or if
> it's internal, suffix it with ">
>
>
> Anyway, that'd be a great start.  From there, I might like to prex each
> external link to go thru a program called out.php to log affiliate
> activity, and I might like to retain onmouseover, onclick, onmouseout
> etc etc properties in the tag, I might like to ensure a session ID is
> found within each internal link, and stripped from each external link,
> ensure that the  has a matching  etc etc, but the above would be
> a great start.
>
>
> Any help, especially with steps 1, 2 & 4, would be much appreciated.
>
>
> Thanks in advance,
>
> Justin French
> http://indent.com.au
> http://soundpimps.com
>
> --
> 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] array session variable problem (register_global=off)

2002-02-20 Thread Johnson, Kirk

Doh! I meant this:

$_SESSION['name']['first'] = 'First Name';

> -Original Message-
> From: Harry Yu [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, February 20, 2002 4:52 PM
> To: [EMAIL PROTECTED]
> Subject: RE: [PHP] array session variable problem 
> (register_global=off)
> 
> 
> Thanks for your reply,
> 
> I have no problem assigning variable.  I just can't
> retrieve them. If I use $_SESSION[foo['bar']], I got
> this error in Apache log.
> 
> [Wed Feb 20 16:44:50 2002] [error] PHP Parse error: 
> parse error, expecting `']''.
> 
> Any other idea?
> 
> Thanks,
> Harry
> 
> The code in the first file is correct if
> register_globals is on. Since it is
> off, remove the call to session_register() and just
> assign values directly
> to $_SESSION, e.g.,
> 
> $_SESSION[name['first']] = 'First Name';
> 
> Kirk
> 
> > -Original Message-
> > From: Harry Yu [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, February 20, 2002 2:12 PM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] array session variable problem
> (register_global=off)
> > 
> > 
> > Hi All,
> > 
> > I have register_global = off and I have problem
> > retrieving array session variable. For example;
> > 
> > Page1.php
> > 
> >  > 
> > $name = array();
> > session_register ("name");
> > 
> > $name[first] = "First Name";
> > $name[last] = "Last Name";
> > 
> > ?>
> > 
> > Page2.php
> > 
> >  > 
> > session_start();
> > 
> > echo $_SESSION[name['first']];
> > echo $_SESSION[name][first];
> > 
> > ?>
> > 
> > None of these works.  The session file does
> registered
> > the array and variables.  I can retrieve the array
> > with the register_global on.  Any ideas?
> > 
> > Thanks,
> > Harry
hp
> 

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




RE: [PHP] array session variable problem (register_global=off)

2002-02-20 Thread Harry Yu

Thanks for your reply,

I have no problem assigning variable.  I just can't
retrieve them. If I use $_SESSION[foo['bar']], I got
this error in Apache log.

[Wed Feb 20 16:44:50 2002] [error] PHP Parse error: 
parse error, expecting `']''.

Any other idea?

Thanks,
Harry

The code in the first file is correct if
register_globals is on. Since it is
off, remove the call to session_register() and just
assign values directly
to $_SESSION, e.g.,

$_SESSION[name['first']] = 'First Name';

Kirk

> -Original Message-
> From: Harry Yu [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, February 20, 2002 2:12 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] array session variable problem
(register_global=off)
> 
> 
> Hi All,
> 
> I have register_global = off and I have problem
> retrieving array session variable. For example;
> 
> Page1.php
> 
>  
> $name = array();
> session_register ("name");
> 
> $name[first] = "First Name";
> $name[last] = "Last Name";
> 
> ?>
> 
> Page2.php
> 
>  
> session_start();
> 
> echo $_SESSION[name['first']];
> echo $_SESSION[name][first];
> 
> ?>
> 
> None of these works.  The session file does
registered
> the array and variables.  I can retrieve the array
> with the register_global on.  Any ideas?
> 
> Thanks,
> Harry
> 


__
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com

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




RE: [PHP] Hyperlinks vs Buttons

2002-02-20 Thread Johnson, Kirk

Another way would be to create an image of the text, then use the  form element as a submit button.

Kirk

> -Original Message-

> > Is there a way to regular hyperlinked text to submit a form?
> > 
> > For example, rather than having a button that says [Login], I 
> > just want underlined text: Login
> 
> You can use JavaScript on that link. An onClick event 
> which triggers document.formname.submit() would work,
> but then you lose backward compatibility (and thus
> accessibility) with non-JavaScript browsers.
> 
> Jason

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




[PHP] NULL value for variable

2002-02-20 Thread Narvaez, Teresa

Hello, 
I am runnig php 4.1.1.  In the configuration, register_globals is
ON.  
I have two programs and I want to pass the value from fileId from one.php to
downloadfile.php.  However, in downloadfile.php $fileId is NULL.  What am I
missing?  Thanks, -Teresa 


one.php
  
  
  
  " >
 Download Now
  
  
 

downloadfile.php
   




[PHP] Using 'Location' and variables

2002-02-20 Thread Jim Koutoumis

I'm sure that this is possible, but I haven't found any info/examples on it
yet,..

What I have is a php script that processes data that been submitted by a
FORM.

That's OK,...

At the end of my script, depending upon the processing, I want to GOTO
another php script, that's also OK, I can simply use the function

header("Location:destination.php");

However, I have a whole lot of variables that were initially submitted, and
I want to take some of them with me when I go to the new destination.php.

Now, I know I can just tack them on the end like a POST, but I'd prefer to
NOT get them there in the URL, like a GET does,... any ideas ??

Thanks in advance,

Jim.





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




RE: [PHP] Removing every thing between ( )

2002-02-20 Thread Martin Towell

I agree - I think that if you've worked at something and feel that you're
getting nowhere - then by all means ask. But I do feel that there have been
some people that have posted to this list in past who have posted just to
get someone else to do their code for them, without trying themselves. And
no doubt there will be more in the furure...

Just me 2c worth
Martin

-Original Message-
From: Brian Paulson [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 21, 2002 11:06 AM
To: 'bvr'; [EMAIL PROTECTED]
Subject: RE: [PHP] Removing every thing between ( )


Ok help me out here, isn't the point of this list to get help?

How long is too long to work on a solution before ask for help?

Brian

-Original Message-
From: bvr [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, February 20, 2002 2:33 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Removing every thing between ( )




whoops.. I see you allready got a cut and clean answer.

now your lazy *and* lucky  ;)

try to figure it yourself next time, believe me it'll open up
possibilities!!

bvr.






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



RE: [PHP] Help for passing variable to all pages

2002-02-20 Thread WG4- Cook, Janet

Well I tried setting the variable to a constant value and it still didn't
work.  What I eventually want to pass is an ID retrieved from the DB that
will be needed by every page 

Janet


-Original Message-
From: Simon Willison [mailto:[EMAIL PROTECTED]]
Sent: Thursday, 21 February 2002 2:37
To: Rick Emery
Cc: 'WG4- Cook, Janet'; PHP List
Subject: Re: [PHP] Help for passing variable to all pages


>
>
>test link
>
You can't pass resource types like database connection IDs in URLs as 
they are only relevant for the instance of the script in which they are 
created. The same goes for things like file identifiers (from fopen) and 
other stuff like that.

Simon


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




RE: [PHP] Removing every thing between ( )

2002-02-20 Thread bvr


I believe I *am* helping you!

bvr.


On Wed, 20 Feb 2002 16:06:24 -0800, Brian Paulson wrote:

>Ok help me out here, isn't the point of this list to get help?
>
>How long is too long to work on a solution before ask for help?
>
>Brian
>
>-Original Message-
>From: bvr [mailto:[EMAIL PROTECTED]] 
>Sent: Wednesday, February 20, 2002 2:33 PM
>To: [EMAIL PROTECTED]
>Subject: Re: [PHP] Removing every thing between ( )




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




RE: [PHP] Help for passing variable to all pages

2002-02-20 Thread WG4- Cook, Janet

Thanks for the suggestion but it made no difference!

I am still getting nothing through

I think its something to do with the "test link" bit - what actually should
go in here - how does it relate this to all links?

Janet


-Original Message-
From: Rick Emery [mailto:[EMAIL PROTECTED]]
Sent: Thursday, 21 February 2002 2:04
To: 'WG4- Cook, Janet'; PHP List
Subject: RE: [PHP] Help for passing variable to all pages


change:
test link

to:
>test link

-Original Message-
From: WG4- Cook, Janet [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 19, 2002 5:30 PM
To: PHP List
Subject: [PHP] Help for passing variable to all pages


Hi All,

I am new to PHP and learning as I go by reading many of the tutorials
around.  I have however come up against a problem that I can't seem to solve
of find any other references to.

I need to make some information available to every page and one of the
series of articles by Kevin Yank which talks about PHP and MySql seemed to
suggest how to do exactly what I wanted but I can't get it to work. His
suggestion was to do something like




I think my problem is in the ...A LINK.. bit - what exactly should go here?


I tried some code to see if it worked and this is what I did:

in login.html



DMS Login
 Connection established on $dbcnx");
if (!$dbcnx) {
echo( "Unable to connect to MySql Server at this time."};
exit();
}
if (! @mysql_connect_db("DMS", $dbcnx) ) {
echo( "Unable to connect to DMS database at this time."};
exit();
}
?>

test link


First name: 
Last Name: 







In the welcome.php3 file I have 


Today's Date


Today's date (according to this server)




What I get is on login page - the texttest linkin blue (i.e. a
link?) and the login prompts.
On the welcome page I get the firstname and lastname ok, but the other
parameter is not in the $QUERY_STRING

Does anyone have any ideas as to what I am doing wrong?

Maybe there is a better way to have some information, that will be retrieved
from the DB available to all pages in the session.  We are not actually
going to have all the users with logins to the DB - but have our own
internal table of users, password and rights information, thus the userid
form this table needs to be available to all pages.


Many Thanks in advance for your help

Janet Cook
Software Engineer
IT &CM
CSDD
NEC Australia Pty Ltd
Ph +613 9264 3813
Email: [EMAIL PROTECTED]
 




-- 
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] Removing every thing between ( )

2002-02-20 Thread Brian Paulson

Ok help me out here, isn't the point of this list to get help?

How long is too long to work on a solution before ask for help?

Brian

-Original Message-
From: bvr [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, February 20, 2002 2:33 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Removing every thing between ( )




whoops.. I see you allready got a cut and clean answer.

now your lazy *and* lucky  ;)

try to figure it yourself next time, believe me it'll open up
possibilities!!

bvr.






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




Re: [PHP] Pulling Variables from URL

2002-02-20 Thread Steve Werby

"Phillip S. Baker" <[EMAIL PROTECTED]> wrote:
> Thanks that is what I needed.
> I am starting to learn more about phpinfo.
>
> Is there a really good place that documents all the options and variables
> and such?

You can find info about the environment variables and PHP variables in the
PHP manual and apache.org (assuming you run Apache webserver).  I'm sure a
quick search of google or a few Linux / PHP tutorial sites will turn
something up.  I don't have any references offhand.

--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/



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




Re: [PHP] Hyperlinks vs Buttons

2002-02-20 Thread Steven Walker

Thanks for the replies.. one of these methods should work. I'm not 
targeting the general public, so it's ok my site requires a modern 
browser. Web development sure would a lot more fun without all the 
compatibility issues!!! ;P

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]

> You can use JavaScript on that link. An onClick event
> which triggers document.formname.submit() would work,
> but then you lose backward compatibility (and thus
> accessibility) with non-JavaScript browsers.
> 
> 


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




RE: [PHP] regexp on user supplied link

2002-02-20 Thread SpamSucks86

I absolutely hate regular expressions because I suck at writing
them...but I can help you with the logic. I was thinking search for a
pattern which matches HREF=" + any number of characters + ". Your match
would be HREF="blahblahblah". Then, you could go and chop off the HREF="
and the lagging ", and then you are left with just a URL. Then, you can
use that built in url parser function (I forget its name, I think it
might be urlparse()). Then, see if there is no host, it's obviously a
relative link, otherwise, you can just see if the host matches or not.
This should work well. Good luck

-Original Message-
From: Martin Towell [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, February 19, 2002 6:59 PM
To: '[EMAIL PROTECTED]'; php
Subject: RE: [PHP] regexp on user supplied link

reg.ex. something like (not tested):
"]*>"
this would give you the entire anchor tag, then go from there?

or what about using the XML parsing routines, get it to find the anchors
and
give you it's attributes, then go from there?

Martin

-Original Message-
From: Justin French [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 20, 2002 10:46 AM
To: php
Subject: [PHP] regexp on user supplied link


Hi,

I have a website which is based purely on user-added content.  The
problem with this is that some areas allow users to use links in the
text, and it's difficult to ensure that they all have a decent knowledge
of attributes such as tartget="_new", etc etc.

So, I'd like a script that...

1. looks at $text for any link tags, and for each tag, does the
following:

2. throws out everything except the HREF eg:
http://www.somesite.com"; target="_new">click becomes
http://www.somesite.com
 becomes javascript:something();

3. prefixe the url with http://www.mysite.com OR http://mysite.com"; is an
external link.

5. if it's an external link, suffix the URL with " TARGET="_new">, or if
it's internal, suffix it with ">


Anyway, that'd be a great start.  From there, I might like to prex each
external link to go thru a program called out.php to log affiliate
activity, and I might like to retain onmouseover, onclick, onmouseout
etc etc properties in the tag, I might like to ensure a session ID is
found within each internal link, and stripped from each external link,
ensure that the  has a matching  etc etc, but the above would be
a great start.


Any help, especially with steps 1, 2 & 4, would be much appreciated.


Thanks in advance,

Justin French
http://indent.com.au
http://soundpimps.com

-- 
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] Which Portal System?

2002-02-20 Thread Erik Price

I'll probably get flamed for this, but I've heard wonderful things about 
Zope (Python-based).  Though I admit that I have zero experience with 
it.  I'm pretty sure it's an all-in-one package, you don't need a 
separate web server even (though if you have Apache already you can use 
that).


Erik


On Wednesday, February 20, 2002, at 11:20  AM, Curtis Strite wrote:

> I'm looking for some recommendations on which portal system to use for 
> my
> website.  I have sifted through most of what I think will suite my 
> needs at
> hotscripts.com.  HOwever I wanted to get some feedback from somone who 
> has
> used any of the ones I'm looking at before I take the time to set it up 
> and
> it turns out to be a bust.
>
> Here are the ones I've downloaded.  All of which require PHP and 
> MySQL.  Let
> me know if there are any I should stay away from or any that are worth
> using.



Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




RE: [PHP] Help for passing variable to all pages

2002-02-20 Thread David Robley

In article <[EMAIL PROTECTED]>, 
[EMAIL PROTECTED] says...
> That's not a lot of help - its a new installation, as far as I know
> everything has been done to default settings.
> What can I do to check the server setup
> Janet
>  
> 
> -Original Message-
> From: Martin Towell [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, 20 February 2002 10:59
> To: 'WG4- Cook, Janet'; PHP List
> Subject: RE: [PHP] Help for passing variable to all pages
> 
> 
> 
> that makes me think that your page isn't being executed through php. why
> this is happening, i don't know - maybe a misconfigured web server
> 
> Martin 
> 
> -Original Message- 
> From: WG4- Cook, Janet [ mailto:[EMAIL PROTECTED]
>  ] 
> Sent: Wednesday, February 20, 2002 10:50 AM 
> To: Martin Towell; PHP List 
> Subject: RE: [PHP] Help for passing variable to all pages 
> 
> 
> Ok - I changed it to 
>   
> ">test link 
>   
> First login page now has 
> >test linkthen the login stuff, 
>   
> and I still don't get the value through 
>   
> Janet 
>   
> 
> -Original Message- 
> From: Martin Towell [ mailto:[EMAIL PROTECTED]
>  ] 
> Sent: Wednesday, 20 February 2002 10:38 
> To: 'WG4- Cook, Janet'; PHP List 
> Subject: RE: [PHP] Help for passing variable to all pages 
> 
> 
> 
> looks like there's a problem with this line: 
> test link 

Just do a page with phpinfo() on it - if that works you know your server 
is parsing PHP. If not, more info about your setup would help for 
troubleshooting.


-- 
David Robley
Temporary Kiwi!

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




Re: [PHP] Pulling Variables from URL

2002-02-20 Thread Phillip S. Baker


>phpinfo(); is your friend.  Insert into a PHP script which has a query
>string (the part of the URL after the ?) and look at the environment
>variables available and listed in the output generated by phpinfo().  The
>variable you're looking for is $QUERY_STRING, but you really should get
>familiar with all of the other variables available since there are many that
>are quite useful.  Also see parse_url() in the manual since it lets you grab
>each of the URL's components separately and you can supply the URL as
>$SCRIPT_URI, $SCRIPT_URL or something similar.

Thanks that is what I needed.
I am starting to learn more about phpinfo.

Is there a really good place that documents all the options and variables 
and such?


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




RE: [PHP] Removing every thing between ( )

2002-02-20 Thread Martin Towell

(not tested but...) something like:

$string = ereg_replace("\([0-9]* Test\)", "", $string);

if you want to keep the backets, then:

$string = ereg_replace("\([0-9]* Test\)", "()", $string);

HTH
Martin

-Original Message-
From: bvr [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 21, 2002 9:30 AM
To: Brian Paulson; php-general
Subject: Re: [PHP] Removing every thing between ( )



what do you have so far ?

at least you need to 'replace', and I recommend
perl style preg_replace() which is very powerfull.

then you need an expressions that matches the
'(001 Test)' part, how to do this can be found in
the manual, however here's a small tip:

/[0-9]+/  matches a series of one or more numbers

bvr.



On Wed, 20 Feb 2002 14:24:33 -0800, Brian Paulson wrote:

>Hello,
>
>   What would the regular expression be to remove all the text
>between  (  )
>
>$string = "This is a (001 Test) and (002 Test)";
>
>The numbers always change but the word stays the same 
>
>Any help would be appreciated.
>
>
>Thank You
>Brian Paulson
>Sr. Web Developer
>[EMAIL PROTECTED]
>http://www.chieftain.com
> 
>
>
>
>-- 
>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] change request for function highlight_string

2002-02-20 Thread Lars Torben Wilson

On Wed, 2002-02-20 at 14:13, Rein Velt wrote:
> At  this moment (php4.1.1) the function "highlight_string" has the following
> syntax:
> 
> 
> [quote]
> bool highlight_string ( string str)
> This function prints out a syntax highlighted version of str using the
> colors defined in the built-in syntax highlighter for PHP. Returns TRUE or
> FALSE.
> [/quote]
> 
> 
> 
> The function will be more flexible if it returns a string (with highlights)
> and nothing is printed directly.

The Bugs Database is the place for feature requests: 
http://bugs.php.net. But read the instructions first. :)

Anyway, as noted in the docs, you can do this yourself:

');

echo "The highlighted string: $str";

?>


Cheers,

Torben

> str highlight_string ( string str)
> This function returns a string containing a syntax highted version of str
> using the colors defined in the built-in syntax highlighter for PHP. Returns
> TRUE or FALSE.
> 
> Reference: http://lxr.php.net/source/ZendEngine2/zend_highlight.c#84
> 
> 
> 
> --
> Rein Velt  web application engineering
> mailto:[EMAIL PROTECTED]
> http://velt.net

-- 
 Torben Wilson <[EMAIL PROTECTED]>
 http://www.thebuttlesschaps.com
 http://www.hybrid17.com
 http://www.inflatableeye.com
 +1.604.709.0506


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




[PHP] Which Portal System?

2002-02-20 Thread Curtis Strite

I'm looking for some recommendations on which portal system to use for my
website.  I have sifted through most of what I think will suite my needs at
hotscripts.com.  HOwever I wanted to get some feedback from somone who has
used any of the ones I'm looking at before I take the time to set it up and
it turns out to be a bust.

Here are the ones I've downloaded.  All of which require PHP and MySQL.  Let
me know if there are any I should stay away from or any that are worth
using.

PHP-NUKE:
PHP-Nuke-5.5.tar.gz
http://phpnuke.org/

PHP SITE ADMIN:
PHPSiteAdmin-2.1.zip
http://www.phpsiteadmin.org/

PHP WEB Things:
phpwebthings-0.btest4.zip
http://www.phpdbform.com/

POST NUKE:
PN703.zip
http://www.postnuke.com/

My PHP NUke:
mpn188_final.zip
http://www.myphpnuke.com/

Thanks in advance,
Curt





This mail was sent by UebiMiau 2.5


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




Re: [PHP] Removing every thing between ( )

2002-02-20 Thread bvr


what do you have so far ?

at least you need to 'replace', and I recommend
perl style preg_replace() which is very powerfull.

then you need an expressions that matches the
'(001 Test)' part, how to do this can be found in
the manual, however here's a small tip:

/[0-9]+/  matches a series of one or more numbers

bvr.



On Wed, 20 Feb 2002 14:24:33 -0800, Brian Paulson wrote:

>Hello,
>
>   What would the regular expression be to remove all the text
>between  (  )
>
>$string = "This is a (001 Test) and (002 Test)";
>
>The numbers always change but the word stays the same 
>
>Any help would be appreciated.
>
>
>Thank You
>Brian Paulson
>Sr. Web Developer
>[EMAIL PROTECTED]
>http://www.chieftain.com
> 
>
>
>
>-- 
>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: using sendtohost on a secure site

2002-02-20 Thread Jim Winstead

In php.general Jeremy Reed <[EMAIL PROTECTED]> wrote:
> Is great for posting results to a regular http site.  But what I need to do
> is post to a secure site (https).  I looked through some of the php
> documentation and couldn't find anything about manually encrypting the data
> to send or anything like that.

http://php.net/curl

(and please do not cross-post to lists that are unrelated to your
question.)

jim

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




RE: [PHP] how the "ticks" works?

2002-02-20 Thread Martin Towell

As the manual says - it executes the "tick" function every 'n' low-level
statement - but what's counted as a low-level statement, I don't know...

It appears that, in the example, the low-level statements are the "for" and
the "echo"

If anyone can shed light on this subject, I'd be interested too

Martin


-Original Message-
From: bob [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 21, 2002 12:39 AM
To: [EMAIL PROTECTED]
Subject: [PHP] how the "ticks" works?


I don't understand how the 'ticks' works:   please help me.






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



Re: [PHP] Pulling Variables from URL

2002-02-20 Thread Steve Werby

"Phillip S. Baker" <[EMAIL PROTECTED]> wrote:
> Is there an easy way to pull all the variables after the URL?
>
> Let use say that the page I am looking at is this.
>
> www.somewhere.com/pages.php?id=27&color=red&bgcolor=green
>
> Now on the page I want a link to have the 3 variables from above.
> I know I can do this.
> Click Here
>
> But I am wondering if there is a basica funciton or call I can use to pull
> all the values and variables.
> So the code might be as simple as
>
> Click
Here

phpinfo(); is your friend.  Insert into a PHP script which has a query
string (the part of the URL after the ?) and look at the environment
variables available and listed in the output generated by phpinfo().  The
variable you're looking for is $QUERY_STRING, but you really should get
familiar with all of the other variables available since there are many that
are quite useful.  Also see parse_url() in the manual since it lets you grab
each of the URL's components separately and you can supply the URL as
$SCRIPT_URI, $SCRIPT_URL or something similar.

--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/



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




Re: [PHP] using sendtohost on a secure site

2002-02-20 Thread bvr


The answer to this and many related questions is:

Use CURL. See manual.

bvr.

>Is great for posting results to a regular http site.  But what I need to do
>is post to a secure site (https).  I looked through some of the php
>documentation and couldn't find anything about manually encrypting the data
>to send or anything like that.




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




RE: [PHP] using sendtohost on a secure site

2002-02-20 Thread Jason Murray

> The function sendtohost:
[snip]
> Is great for posting results to a regular http site.  But 
> what I need to do is post to a secure site (https).  

At that point, you'll want to look into using CURL extensions
to PHP.

http://www.php.net/manual/en/ref.curl.php

Jason

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




[PHP] change request for function highlight_string

2002-02-20 Thread Rein Velt

At  this moment (php4.1.1) the function "highlight_string" has the following
syntax:


[quote]
bool highlight_string ( string str)
This function prints out a syntax highlighted version of str using the
colors defined in the built-in syntax highlighter for PHP. Returns TRUE or
FALSE.
[/quote]



The function will be more flexible if it returns a string (with highlights)
and nothing is printed directly.

str highlight_string ( string str)
This function returns a string containing a syntax highted version of str
using the colors defined in the built-in syntax highlighter for PHP. Returns
TRUE or FALSE.

Reference: http://lxr.php.net/source/ZendEngine2/zend_highlight.c#84



--
Rein Velt  web application engineering
mailto:[EMAIL PROTECTED]
http://velt.net



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




RE: [PHP] Hyperlinks vs Buttons

2002-02-20 Thread Jason Murray

> Is there a way to regular hyperlinked text to submit a form?
> 
> For example, rather than having a button that says [Login], I 
> just want underlined text: Login

You can use JavaScript on that link. An onClick event 
which triggers document.formname.submit() would work,
but then you lose backward compatibility (and thus
accessibility) with non-JavaScript browsers.

Jason

-- 
Jason Murray
[EMAIL PROTECTED]
Web Developer, Melbourne IT
"Work now, freak later!"

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




[PHP] Pulling Variables from URL

2002-02-20 Thread Phillip S. Baker

Is there an easy way to pull all the variables after the URL?

Let use say that the page I am looking at is this.

www.somewhere.com/pages.php?id=27&color=red&bgcolor=green

Now on the page I want a link to have the 3 variables from above.
I know I can do this.
Click Here

But I am wondering if there is a basica funciton or call I can use to pull 
all the values and variables.
So the code might be as simple as

Click Here

And get the same result.
Thanks all

Phillip



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




[PHP] using sendtohost on a secure site

2002-02-20 Thread Jeremy Reed

The function sendtohost:

-BEGIN CODE
function sendToHost($host,$method,$path,$data,$useragent=0)
{
 // Supply a default method of GET if the one passed was empty
 if (empty($method))
  $method = 'GET';
 $method = strtoupper($method);
 $fp = fsockopen($host,443);
 echo("open");
 if ($method == 'GET')
  $path .= '?' . $data;
 fputs($fp, "$method $path");
 fputs($fp, "Host: $host\n");
 fputs($fp, "Content-type: application/x-www-form-urlencoded\n");
 fputs($fp, "Content-length: " . strlen($data) . "\n");
 if ($useragent)
  fputs($fp, "User-Agent: MSIE\n");
 fputs($fp, "Connection: close\n\n");
 if ($method == 'POST')
  fputs($fp, $data);

 while (!feof($fp)) {
  $buf .= fgets($fp,128);
  echo("buf: " . $buf);
}
 fclose($fp);
 echo("close");
 echo($buf);
 return $buf;
}
-END CODE

Is great for posting results to a regular http site.  But what I need to do
is post to a secure site (https).  I looked through some of the php
documentation and couldn't find anything about manually encrypting the data
to send or anything like that.

Any help would be greatly appreciated.

Thanks,

Jeremy Reed




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




[PHP] Hyperlinks vs Buttons

2002-02-20 Thread Steven Walker

Is there a way to regular hyperlinked text to submit a form?

For example, rather than having a button that says [Login], I just want 
underlined text: Login

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]



[PHP] how can you tell the url of a remote script?

2002-02-20 Thread Ed Lazor

I have a script, which is called by scripts located on other sites.  Is it 
possible to tell the url of the remote script that is calling my script?

-Ed


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




Re: [PHP] Removing every thing between ( )

2002-02-20 Thread Erik Price


On Wednesday, February 20, 2002, at 05:24  PM, Brian Paulson wrote:

> What would the regular expression be to remove all the text
> between  (  )
>
> $string = "This is a (001 Test) and (002 Test)";
>
> The numbers always change but the word stays the same


preg_replace("/(\()\d{3,3} Test(\))/", "\1\2", $string);

That will leave your string looking like "This is a () and ()".


Erik





Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




RE: [PHP] Re: Removing every thing between ( )

2002-02-20 Thread Brian Paulson

Great,

Thanks for the help, worked like a charm

Brian

-Original Message-
From: CC Zona [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, February 20, 2002 1:50 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: Removing every thing between ( )


In article <001901c1ba5d$634e3840$89010a0a@bpaulson>,
 [EMAIL PROTECTED] (Brian Paulson) wrote:

>   What would the regular expression be to remove all the text
between  
> (  )
> 
> $string = "This is a (001 Test) and (002 Test)";

$string=preg_replace("/\(.+\)/U",'',$string);

Note that leading/trailing spaces are left in, and the parens are
dropped, 
so you may want to adjust it a bit.

-- 
CC

-- 
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] monitoring banwith used by a script

2002-02-20 Thread Paul Roberts


is there a way to monitor bandwidth use of a script

any ideas welcome.


Paul Roberts
[EMAIL PROTECTED]



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




[PHP] Re: Removing every thing between ( )

2002-02-20 Thread CC Zona

In article <001901c1ba5d$634e3840$89010a0a@bpaulson>,
 [EMAIL PROTECTED] (Brian Paulson) wrote:

>   What would the regular expression be to remove all the text
> between  (  )
> 
> $string = "This is a (001 Test) and (002 Test)";

$string=preg_replace("/\(.+\)/U",'',$string);

Note that leading/trailing spaces are left in, and the parens are dropped, 
so you may want to adjust it a bit.

-- 
CC

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




[PHP] dealing with MSWord curly quotes in text

2002-02-20 Thread austin swinney


im having a problem with text being submitted to my site through forms
into the database, where the text has been edited in MSWord and the
quotes that it uses get turned into question marks.  does anyone know a
way to convert these MSWord quotes to normal " marks?


-- 
austin swinney"ET-Arrr"
[EMAIL PROTECTED]   pirates of programming

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




RE: [PHP] form submission error trapping

2002-02-20 Thread Jason Dulberg

Okay... I messed around with things a bit and moved the php stuff to the top
as you suggested. I have part of the validation working however if more than
1 error exists, it still only prints the 1st one.

Below are 2 example places where there would be an error... if I leave them
both blank, they should both give an error message.

$error=array();
if (strlen($username)< 3) {
$error['username']="Username must be more than 3 characters";
}
elseif (strlen($password)< 3) {
$error['password']="Password must be more than 3 characters";
}



".$error['username'];?>


".$error['password'];?>


Am I assigning errors to the array incorrectly?

Thanks for your help :)

Jason


> -Original Message-
> From: Jason G. [mailto:[EMAIL PROTECTED]]
> Sent: February 18, 2002 9:19 AM
> To: Matt; [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] form submission error trapping
>
>
> Why do not you all just put all your PHP logic, db access, etc at the TOP
> of the script.  Once you have your results and variables created, then
> start into html.
>
> This method produces MUCH cleaner scripts, and there is a very minimal
> amount of PHP interspersed within the HTML. Also, you have time to bail
> out, or redirect, etc...
>
> 
>   Connect to DB
>
>  Are we to process the form?
>  Yes:
>  Validate fields
>  Generate Error Messages
>  break;
>  No Error Messages?
>  Update the DB
>  Header("Location: bla.php?NEWID=$NEWID");
>  exit;
>
> ?>
> 
>
> Firstname: 
> 
> 
> Lastname: 
> 
> 
>
> 
>
>
>
>
> At 08:35 AM 2/18/2002 -0500, Matt wrote:
> >I think that mixing of html and php is too complex and leads to hard to
> >maintain scripts. I find it extremely difficult to understand a scripts
> >logic when it's spread out over hundreds of lines of php/html.
> >
> >I use EasyTemplates that came in Web Applications Development
> with PHP 4.0
> >by Tobias Ratschiller and Till Gerkin. It looks like the source is
> >copyrighted and you have to buy the book to get it.  But it says
> it's based
> >on FastTemplates.  The book itself is at
> >http://www.amazon.com/exec/obidos/ASIN/0735709971/
> >
> >You can see a sample of the method here
> >http://marc.theaimsgroup.com/?l=php-general&m=101371611609042&w=2
> >
> >Notice that the form action handler is the same as the original
> form. This
> >is a simple example, but it does "remember" user input as you want.
> >
> >I wrote a couple of helper functions that accept db names to build select
> >boxes and radio buttons.  They return strings of the html with
> the selected
> >value, and I just put them in a template container reserved for them (the
> >{TEMPLATE_ITEM} in the sample).
> >
> >For tables with unknown number of rows, I have one template of the main
> >page, one for the table container, and one for each row itself.
> I loop on
> >the row, using the row template and concatenate all of the rows
> of html into
> >a string.  I take that string and stick it into the table template, and
> >finally stick the table into the page template.  Very smooth,
> easy to read,
> >and no trouble with headers() since all output is done on the last
> >statement.  You have complete control over the script until then, and can
> >bail out to another page, or decide to use other templates and output
> >something else.
> >
> >As for errors, I build an array of the messages such as:
> >if (!empty($thatsThere)) {
> >$errors[] = "Don't put $thatsThere in  there";
> >}
> >if (empty($userName)) {
> >   $errors[] = "Username must be supplied";
> >}
> >
> >Then you can tell if all is okay, with if (is_array($errors)).
> If it is an
> >array, then something is wrong, so I  append the array contests into html
> >like this:
> >foreach($errors as $value) {
> >  $errorMsgs = $value . "\n";
> >}
> >and then put $errorMsgs into the page template container you've
> reserved for
> >it.
> >
> >- Original Message -
> >From: "Jason Dulberg" <[EMAIL PROTECTED]>
> >To: <[EMAIL PROTECTED]>
> >
> > > I am working on some error trapping for several forms on my
> site. After
> > > visiting a bunch of websites, I've noticed 2 common methods
> of displaying
> > > error messages.
> > >
> > > 1. display an error box on a new page and force the user to
> hit the 
> > > button
> > >
> > > 2. display the form again with appropriate error text and pre-filled
> >fields.
> > >
> > > I have part of the error on the new page working but I'm
> running into the
> > > infamous no contents in the form after going .
> > >
> > > There are some useability issues with forcing the user to hit the back
> > > button -- some just don't want to bother.
> > >
> > > Is there a way to display the form w/original contents and
> error messages
> > > 'without' having to code the entire form twice? I have about
> 5 f

[PHP] Removing every thing between ( )

2002-02-20 Thread Brian Paulson

Hello,

What would the regular expression be to remove all the text
between  (  )

$string = "This is a (001 Test) and (002 Test)";

The numbers always change but the word stays the same 

Any help would be appreciated.


Thank You
Brian Paulson
Sr. Web Developer
[EMAIL PROTECTED]
http://www.chieftain.com
 



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




RE: [PHP] array session variable problem (register_global=off)

2002-02-20 Thread Johnson, Kirk

The code in the first file is correct if register_globals is on. Since it is
off, remove the call to session_register() and just assign values directly
to $_SESSION, e.g.,

$_SESSION[name['first']] = 'First Name';

Kirk

> -Original Message-
> From: Harry Yu [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, February 20, 2002 2:12 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] array session variable problem (register_global=off)
> 
> 
> Hi All,
> 
> I have register_global = off and I have problem
> retrieving array session variable. For example;
> 
> Page1.php
> 
>  
> $name = array();
> session_register ("name");
> 
> $name[first] = "First Name";
> $name[last] = "Last Name";
> 
> ?>
> 
> Page2.php
> 
>  
> session_start();
> 
> echo $_SESSION[name['first']];
> echo $_SESSION[name][first];
> 
> ?>
> 
> None of these works.  The session file does registered
> the array and variables.  I can retrieve the array
> with the register_global on.  Any ideas?
> 
> Thanks,
> Harry
> 
> __
> Do You Yahoo!?
> Yahoo! Sports - Coverage of the 2002 Olympic Games
> http://sports.yahoo.com
> 
> -- 
> 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] array session variable problem (register_global=off)

2002-02-20 Thread Harry Yu

Hi All,

I have register_global = off and I have problem
retrieving array session variable. For example;

Page1.php



Page2.php



None of these works.  The session file does registered
the array and variables.  I can retrieve the array
with the register_global on.  Any ideas?

Thanks,
Harry

__
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com

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




Re: [PHP] What Do You Think?

2002-02-20 Thread Jon Abernathy

"Richard Crawford" <[EMAIL PROTECTED]> wrote in message
1013802064.4935.5.camel@mossroot">news:1013802064.4935.5.camel@mossroot...
> I'd be much more interested in microbreweries, though.  Most commercial
> breweries like Anheuser Busch and Coors don't brew beer.  Send some of
> their product to a lab, and the results will say something like, "Your
> horse has diabetes."
>
> Hmm.  I'd also be interested in a "Guinness Finder" site.  Plug in your
> zip code, and you get a list of all of the pubs and bars in your area
> that serve draft Guinness.  I could support a site like that, or help
> build one.

As it happens, I'm building a site that (among other things) will be a
directory of breweries, micorbreweries, brewpubs, etc.-- all in a PHP app
framework I'm developing. The site is still highly in beta though, with
several design possibilities and data being entered. If anyone's interested,
though, I could send a link.

--
Jon Abernathy - [EMAIL PROTECTED]




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




RE: [PHP] question

2002-02-20 Thread Kevin Stone

I'm not sure from your question whether or you understand that the PHP
printer functions only work with printers connected directly to the
server.  They're not for client side printing.  And there are no
equivalent functions for non-Windows platforms.  However I do recall
coming across a Javascript that could open the printer dialog box in the
browser automatically.  A quick search on Usenet should turn up
something.  I'm afraid this about as automated as you're going to get.

-Kevin

> -Original Message-
> From: Matthew Berwald [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, February 20, 2002 1:48 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] question
> 
> In php for windows, you can use the printer_open()
> function found in the php_printer.dll.  Unfortuantly,
> I run a Red hat/Apache web server and this won't work.
>  Do you know of any method/package out there that I
> could install on my linux machine that will all me to
> print data to a printer?  Thanks for the help.
> 
> 
> Matthew Berwald
> 
> 
> __
> Do You Yahoo!?
> Yahoo! Sports - Coverage of the 2002 Olympic Games
> http://sports.yahoo.com
> 
> --
> 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] Class question

2002-02-20 Thread Jeff Sheltren

Well, I guess many things are "accepted" now, but here's my two cents:

I wouldn't access global variables, instead you should pass everything you 
need as parameters.  Using global variables can come back to bite you 
occasionally because you may think you are changing a local variable at one 
point, but you actually change a global variable, and then who knows what 
will happen when you try to access the global variable later in your code 
expecting an int, for example, and it is suddenly a string...

As for using other user defined functions from elsewhere in your code, I 
think it depends on the context...  But think about what if you want to use 
this class elsewhere, then you will always need to copy over whatever file 
contains your other functions.  In that case it would obviously make more 
sense to contain whatever functions are needed inside of the class.

Hope that gives you some ideas.

Jeff

At 02:58 PM 2/20/2002 -0600, Chris Boget wrote:
>I'm still kind of new when it comes to dealing with classes.
>I'm curious, is it accepted practice for member functions of
>your class to:
>
>* access global variables
>* use non member, user defined functions
>
>Chris
>
>
>--
>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] getenv & $REMOTE_ADDR

2002-02-20 Thread Lars Torben Wilson

On Wed, 2002-02-20 at 12:42, Steven Walker wrote:
> What is the difference between $_SERVER and getenv()? Why should one be 
> more reliable/better than the other?
> 
> > Better: avoid globals and use $_SERVER['REMOTE_ADDR'].
> 
> Sorry, if I'm asking you to repeat yourself... the documentation doesn't 
> relate the two.
> 
> Steven J. Walker
> Walker Effects
> www.walkereffects.com
> [EMAIL PROTECTED]

Sorry, I meant that $_SERVER is better than using register_globals=on,
not that it's better than getenv(). Anyway, getenv() just gets a 
variable value from the environment, and $_SERVER contains a hash of
server variables.


-- 
 Torben Wilson <[EMAIL PROTECTED]>
 http://www.thebuttlesschaps.com
 http://www.hybrid17.com
 http://www.inflatableeye.com
 +1.604.709.0506


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




RE: [PHP] Class question

2002-02-20 Thread Hunter, Ray

The whole idea with object-oriented programming is polymorphism and
encapsulation.  You do not want your classes to access global variables but
access that information through objects and messaging between objects.  If
you are referring to the use of non-member as being outside of the class,
then again you want to use objects.  

As for practice, it is up to you.  For me, no...

Ray Hunter
Firmware Engineer

ENTERASYS NETWORKS


-Original Message-
From: Chris Boget [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, February 20, 2002 1:58 PM
To: PHP General
Subject: [PHP] Class question


I'm still kind of new when it comes to dealing with classes. I'm curious, is
it accepted practice for member functions of your class to:

* access global variables
* use non member, user defined functions

Chris


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



[PHP] Re: textarea form input converting < and > to < >

2002-02-20 Thread Jim Winstead

Byron Albert <[EMAIL PROTECTED]> wrote:
> I have a few forms that  are used to input html.  We have run into a
> problem of < and >  getting turned into < and > when you hit
> submit, Or if you hit submit more than once. I have attached a sample
> form.  The major problem here is that some times we want < and some
> times we want to input html tags. Has any one else run into this problem
> maybe even found a solution.

when you re-display user input in a textarea (or as the value
attribute of a text input field), you should use the htmlentities()
function. so, from your code:

> 

should be:

> 

(you could also probably use CDATA sections and avoid calling
htmlentities(). i haven't tried it, and am skeptical that the various
browsers all get that right. i've never had a problem using
htmlentities() in this manner.)

jim

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




[PHP] Class question

2002-02-20 Thread Chris Boget

I'm still kind of new when it comes to dealing with classes.
I'm curious, is it accepted practice for member functions of
your class to:

* access global variables
* use non member, user defined functions

Chris


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




[PHP] Re: question

2002-02-20 Thread Jim Winstead

Matthew Berwald <[EMAIL PROTECTED]> wrote:
> Do you know of any method/package out there that I
> could install on my linux machine that will all me to
> print data to a printer?  Thanks for the help.

$lp = popen("lpr", "w");
fwrite($lp, "stuff to print");
pclose($lp);

this uses the unix-standard 'lpr' utility.

jim

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




[PHP] Bizarre problem.

2002-02-20 Thread Andres Plaza R.

Hi everybody!

Some days ago, I asked about a problem making "configure" in PHP
4.1.1. When I try to configure PHP + Oracle:

./configure --with-mysql --with-apxs=/usr/local/apache/bin/apxs
--with-openssl=/usr/local/ssl --with-zlib=/usr --with-curl=/usr/local
--with-oci8=/usr/local/oracle/8.0.5 --with-gd

this message appears:

|   *** ATTENTION ***|
||
| Something is likely to be messed up here, because the configure|
| script was not able to detect a simple feature on your platform.   |
| This is often caused by incorrect configuration parameters. Please |
| see the file debug.log for error messages. |
||

and if I look the debug.log, the error is:

gcc -o conftest -g -O2  -DLINUX=22 -DMOD_SSL=208105 -DUSE_HSREGEX -DEAPI  
-Wl,-rpath,/usr/local/ssl/lib -L/usr/local/ssl/lib -Wl,-rpath,/usr/local/lib 
-L/usr/local/lib -Wl,-rpath,/usr/local/oracle/8.0.5/lib -L/usr/local/oracle/8.0.5/lib 
conftest.c -lclntsh -lpsa -lcore4 -lnsl -lgd -lcurl -ldl -lcrypto -lssl -lcurl -lz 
-lcrypt -lssl -lcrypto -lresolv -lm -ldl -lnsl  -lresolv -lcrypt 1>&5
/usr/bin/ld: cannot find -lm
collect2: ld returned 1 exit status

Everything looks strange, because I know that libm is in my system
(Linux RH 7.2) and the other test (if I look config.log) that used libm
didn't have problems.

BUT, the other day I used vi to see the debug.log, and the error
appears like this:

gcc -o conftest -g -O2  -DLINUX=22 -DMOD_SSL=208105 -DUSE_HSREGEX -DEAPI  
-Wl,-rpath,/usr/local/ssl/lib -L/usr/local/ssl/lib -Wl,-rpath,/usr/local/lib 
-L/usr/local/lib -Wl,-rpath,/usr/local/oracle/8.0.5/lib -L/usr/local/oracle/8.0.5/lib 
conftest.c -lclntsh -lpsa -lcore4 -lnlsrtl3 -lm^M -lnsl -lgd -lcurl -ldl -lcrypto 
-lssl -lcurl -lz -lcrypt -lssl -lcrypto -lresolv -lm -ldl -lnsl  -lresolv -lcrypt 1>&5
/usr/bin/ld: cannot find -lm^M
collect2: ld returned 1 exit status

You will notice that there is a ^M after -lm ! And, of course, ld
didn't find -lm^M . :-)

Obviously, I edited the configure file, but there's no ^M.

Now, the question: somebody had the same problem? Somebody had a
solution for this? Somebody can help me?!?!?!? :-)

Thanks in advance...
-- 

Andres Plaza R.
 [EMAIL PROTECTED]
  http://la.mafia.cl/aplaza





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




RE: [PHP] question

2002-02-20 Thread Hunter, Ray

A "work around" is using the one of the system commands and print that way.

Check here for the program execution functions:
http://www.php.net/manual/en/ref.exec.php



Ray Hunter
Firmware Engineer

ENTERASYS NETWORKS


-Original Message-
From: Matthew Berwald [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, February 20, 2002 1:48 PM
To: [EMAIL PROTECTED]
Subject: [PHP] question


In php for windows, you can use the printer_open()
function found in the php_printer.dll.  Unfortuantly,
I run a Red hat/Apache web server and this won't work.
 Do you know of any method/package out there that I
could install on my linux machine that will all me to
print data to a printer?  Thanks for the help.


Matthew Berwald


__
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games http://sports.yahoo.com

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



Re: [PHP] PDF Fonts Files

2002-02-20 Thread Rasmus Lerdorf

You need to sit through my PDF/PHP talk where I go through all this.  See
conf.php.net/paris2 specifically slides 7 and 8

In particular see the example:

http://conf.php.net/pres/slides/intro/pdf_font_ex2.php

the code for which is on slide #8.  This example shows how to use each of
the built-in fonts, a couple of AFM (Adobe Font Metric) fonts and also a
couple of TTF fonts all on the same PDF page.

-Rasmus

On Mon, 18 Feb 2002, Richard Lynch wrote:

> Please Cc: me on replies...
>
> I recently installed PHP 4.1.0 + PDF 4.0.1 on my development box.
>
> I can't seem to get the PDF fonts to work properly at all...
>
> Here are a lot of details about things I understand, and a lot of
> remarks about what I half-understand.
>
> Note that, as a rule, font technology seems to be such a morass that
> I don't really understand it as a whole, even after reading all the
> HowTos and explanations.  There are just too many players, and too
> many variables involved for my poor little brain...  I grok all the
> little pieces and even some of the big-picture stuff okay, but when
> it comes time to actually use them all, I feel like I need eight
> brains to track it all...
>
> At any rate, I'm afraid this post goes on quit a bit to explain all
> the things I've tried, and it would be a lot shorter if I was
> smarter, but I'm not. :-v
>
> To paraphrase Blaise Pascal:
> "I'm sorry this post is so long, I didn't have the brains to make it
> short." :-)
>
> Okay, enough apologies:
>
> I'm using
> pdf_set_parameter($pdf, "resourcefile", "/home/www/pdffonts/pdflib.upr");
> and I can muck with that pdflib.upr file and screw it up to cause
> different error messages, so I'm reasonably certain it's getting
> read. :-)
>
> However, my choices for http://php.net/pdf_findfont seem to be using
> "host" fonts, not "checked" (0) -- so they get rendered by the client
> at the time of drawing (more on *that* later), or using "winansi" and
> "checked" (1) or "host" and "checked" (1) in which case I get my
> choice of error messages like:
>
> Can't find Outline Font data for "Helvetica"
> Can't find Font Metrics for "Helvetica"
>
> Those are paraphrases, but I could get the precise messages if you
> really need 'em...  And I can't remember which message goes with
> which combination of host/winansi, checked/unchecked, but does it
> really matter?  It can't find the damn Helvetica.afm file, as near as
> I can figure.
>
> And I've tried some of the other 14 built-in fonts, even ones that
> would be unacceptable in the end, just to see.  No joy in Mudville.
> Oh, and using "builtin" instead of "host" or "winansi" didn't work.
> Not sure I even understand the difference between "builtin" and
> "host" anyway...  I forget exactly which of the not-working states it
> generated, but it was the same as one of the ones described herein,
> so let's just skip that for now, okay?
>
> I get these differences based on my inputs to http://pdf_findfont and
> by altering the pdflib.upr file as noted in the comments within that.
> I've tried so *many* things, none of which work, so I can't be sure,
> but I don't think the "path entry" in pdflib.upr has any effect
> whatsoever...
>
> Actually, I think I can break it badly enough to get a different
> error message about an invalid pdflib.pdr file (something about not
> finding the FontAFM section, which comes right after the "path
> entry"), but any parse-able pathname at all seems to be just as good,
> or should I say just as bad, as the actual path to my fonts
> directory.  Currently, it's set at:
>
> //home/www/pdffonts
>
> which is, indeed a valid directory with all my fonts and the
> pdflib.upr file in it, which, as noted above, seems to be getting
> read in.
>
> NOTE:  The docs in pdflib.upr say that the "extra" leading "/" for
> "path entry" is required by PDF, and that there should be no trailing
> "/"   Honest.  If you're on a Mac, you'd be using ":" instead of "/"
> for all but the first "/".
>
> So, of course, I already tried it without either or both extra front
> and trailing "/" and it doesn't work.  Doesn't make it any worse, but
> it didn't help either.  :-)  Point is, I'm pretty sure that that
> entry is correct syntactically.
>
> I've also tried everything up to, and including, chmod 777 on the
> font files and their enclosing directory.  Naturally, after that
> failed, I set them back to something sensible like 664 and owned by
> www:www, the PHP User in httpd.conf who should be the user attempting
> to read these files, right?
>
> Or does PDFlib actually do chroot or whatever that's called?...  This
> is behind a firewall, not a real web-server, so I could live with
> making these files even root executable and world writable it if
> would just make the darn thing work.  No, it didn't help to make them
> root-owned and chmod 777.  Yes, I was desperate enough to try.  Yes,
> I put them back to something sensible.
>
> I've even tried swapping in the font files from a PHP-4.2.0-dev + PDF
> 

[PHP] question

2002-02-20 Thread Matthew Berwald

In php for windows, you can use the printer_open()
function found in the php_printer.dll.  Unfortuantly,
I run a Red hat/Apache web server and this won't work.
 Do you know of any method/package out there that I
could install on my linux machine that will all me to
print data to a printer?  Thanks for the help.


Matthew Berwald


__
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com

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




  1   2   >