[PHP] e-mail list app

2002-03-25 Thread Michael A. Peters

Anyone know of a free app that allows users to submit-

name, nickname, e-mail addy

app sends a url confirm to e-mail addy.
upon confirm, the info gets stored in a mysql database with the email
encrypted.

addresses should only be decryptable with a key that does not need to be
stored on the machine.
Thanks.

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




[PHP] Resume/recover uploads in PHP 4.2 ? WAS: RE: upload forms, how much was uploaded before upload fails..

2002-03-25 Thread Jimmy Lantz

Hi
following up on the text below...
Will there then be possible to recover uploads in 4.2?
Maybe even  resuming uploads? (wishfull thinking) ?
Cheers
Jimmy

Rasmus Lerdorf wrote:
Re: [PHP] upload forms, how much was uploaded before upload fails..
You'll probably need PHP 4.2 for uploads that big to work well. Before
4.2 uploads were buffered in ram, so no, you have no way to recover a
broken upload.

On Sun, 24 Mar 2002, Gerhard Hoogterp wrote:
  Hello all,
 
  I'm still having problems uploading BIG files (15MB and more) Is there a 
way
  to find howmuch data was uploaded before the connection was broken?
 
  For some weird reason no browser has a half decent user feedback if it come
  to upload forms.
 
  Gerhard


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




Re: [PHP] From To to BCC in a Mail script

2002-03-25 Thread Justin French

on 25/03/02 6:31 PM, anti-blank ([EMAIL PROTECTED]) wrote:

 I've got this script here to send out a mail whenever I enter an update to my
 site to my mailing list.
 The problem is it wants to dump everyone's email into the To field, and since
 I don't want to give my
 users email addresses away I need to convert this to the bcc field.  Below is
 the original code and then
 the modification that I made (which doesn't seem to work).  Also if anyone has
 any idea how to include
 in this block a line to tell php to send this as HTML email as well that would
 be even more helpful.

To answer your question, you'd need to set the $to to a dummy address, or
*perhaps* to null, and use headers to add a Bcc line with the address on it.

Instead of $from, you should build a $headers var, of which Bcc is one of.

UNTESTED:
?

$bcc = ;
$query = mysql_query(SELECT * FROM members);
while ($member = mysql_fetch_array($query))
  {
  if ($bcc == )
{
$bcc = $member['email'];
}
  else
{
$bcc .= ,  . $member['email'];
}
  }
$from = From:  . $setting_mail_email . \r\n;
$to = [EMAIL PROTECTED];
$headers = $from.$bcc;

mail ($to, $setting_site_name, $mailpost, $headers) or $emailsuccess =
Failure sending email.;

?



HOWEVER, Instead of sending the email in one hit ie:

   Bcc: [EMAIL PROTECTED], [EMAIL PROTECTED], etc

Use the while loop of your SQL query to send the mail individualy to each
recipient.

This has a few benefits:

1. They can see exactly which address they recieved the email through, which
is mighty helpfull for people like me with 10+ email address' all hitting my
one POP box

2. You can personalise the email with things like:
  a) Greeting them with their name
  b) you are currently subscribed as [EMAIL PROTECTED],
 to remove your self, or modify your subscription, visit
 this URL: http://site.com/mail.php?subscriber_id=1page=edit;

3. You can split the query into smaller chunks, for ISPs with limits on
script timeouts etc etc.

4. customise the content of the email to suit thier interests

Plus a heap more probably...


MY VERSION, UNTESTED:

?
$mailpost = $mailpost;
$mailpost = str_replace({setting_site_name}, $setting_site_name,
$mailpost);
$mailpost = str_replace({setting_site_url}, $setting_site_url, $mailpost);
$mailpost = str_replace({setting_mail_email}, $setting_mail_email,
$mailpost);
$mailpost = str_replace({post_poster}, $cookie_username, $mailpost);
$mailpost = str_replace({post_headline}, $headline, $mailpost);
$mailpost = str_replace({post_date}, date(M d, Y, time()), $mailpost);
$mailpost = str_replace({post_post}, $post, $mailpost);
$to = ;
$from = from:  . $setting_mail_email;

$query = mysql_query(SELECT * FROM members);
while ($member = mysql_fetch_array($query))
  {
  if ($to == )
{
$to = $member['email'];
mail ($to, $setting_site_name, $mailpost, $from) or $emailsuccess =
Failure sending email.;
}
  }
?




 ORIGINAL CODE:
 $mailpost = $mailpost;
 $mailpost = str_replace({setting_site_name}, $setting_site_name, $mailpost);
 $mailpost = str_replace({setting_site_url}, $setting_site_url, $mailpost);
 $mailpost = str_replace({setting_mail_email}, $setting_mail_email,
 $mailpost);
 $mailpost = str_replace({post_poster}, $cookie_username, $mailpost);
 $mailpost = str_replace({post_headline}, $headline, $mailpost);
 $mailpost = str_replace({post_date}, date(M d, Y, time()), $mailpost);
 $mailpost = str_replace({post_post}, $post, $mailpost);
 $to = ;
 $query = mysql_query(SELECT * FROM members);
 while ($member = mysql_fetch_array($query)) {
 if ($to == ) {$to = $member['email'];}
 else {$to .= ,  . $member['email'];}
 }
 $from = from:  . $setting_mail_email;
 mail ($to, $setting_site_name, $mailpost, $from) or $emailsuccess = Failure
 sending email.;
 if ($emailsuccess == ) {$emailsuccess = Email Sent Successfully.;}
 }
 
 
 
 My MODIFIED CODE:
 $mailpost = $mailpost;
 $mailpost = str_replace({setting_site_name}, $setting_site_name, $mailpost);
 $mailpost = str_replace({setting_site_url}, $setting_site_url, $mailpost);
 $mailpost = str_replace({setting_mail_email}, $setting_mail_email,
 $mailpost);
 $mailpost = str_replace({post_poster}, $cookie_username, $mailpost);
 $mailpost = str_replace({post_headline}, $headline, $mailpost);
 $mailpost = str_replace({post_date}, date(M d, Y, time()), $mailpost);
 $mailpost = str_replace({post_post}, $post, $mailpost);
 $bcc = ;
 $query = mysql_query(SELECT * FROM members);
 while ($member = mysql_fetch_array($query)) {
 if ($bcc == ) {$bcc = $member['email'];}
 else {$bcc .= ,  . $member['email'];}
 }
 $from = from:  . $setting_mail_email;
 mail ($bcc, $setting_site_name, $mailpost, $from) or $emailsuccess = Failure
 sending email.;
 if ($emailsuccess == ) {$emailsuccess = Email Sent Successfully.;}
 }
 
 


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




[PHP] Empty strings

2002-03-25 Thread Manuzhai

I have an array with elements of which a lot are empty strings (according to
var_dump, string (0)). I try to unset() these elements from the array by
checking for $p[$i] == , or strlen($p[$i])  1, or !$p[$i], but it only
deletes a few of them, not all. Anyone have an idea as to how this could be
the case?

TIA...

Manuzhai



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




[PHP] Re: Why?

2002-03-25 Thread Arve Bersvendsen

Gunter Ohrner wrote:

 The HTTP-based network protocol for controlling coffee machines
 was not bad, either.

Which we seriously considered implementing here at my job.  But: A 
webcam and a pair of legs suffices.

-- 
Arve X-No-Archive? Never

He's the greatest cowboy of them all

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




Re: [PHP] Still REG EX

2002-03-25 Thread liljim

Have a look at this:

function ValidateUrl($url) {
 // Check the syntax
 if
(!preg_match(!((https?|ftp)://)(www\.)?([a-zA-Z0-9/\-]*)+\.([a-zA-Z0-9/\-]*
)+([a-zA-Z0-9/\-\.]*)?!, $url)) {
  return false;
 }
 // If it's correct, then try and open it
 if (!@fopen($url, r)) {
  return false;
 }
 return true;
}

if (!ValidateUrl(http://www.yoursite.com;)) {
 echo Invalid url;
} else {
 echo It's there.;
}

Not particularly clean, but it seems to work ok.  Will check for http,
https, ftp, followed by an optional www. followed by numbers, digits,
hyphens etc. If it gets passed that check, then the function then attempts
to open the url. You may need to play around with it a little...

~James


John Fishworld [EMAIL PROTECTED] wrote in message
004001c1d2cc$caff60e0$04010a0a@fishworld">news:004001c1d2cc$caff60e0$04010a0a@fishworld...
 Okay good point but still why doesn't it work ?

 thanks
 john


  On Sun, 24 Mar 2002, John Fishworld wrote:
   I'm still playing about trying to validate an url
   www(dot)something(dot)something !
  
   I thought this would work but know
  
   if (ereg(^(w{3})(\\.)([a-zA-Z]+)(\\.)([a-z]{2,4})$, $str))
 
  First of all, web server hostnames don't need to start with www.
Secondly,
  they can have any number of components (separated by periods) from 1 to
  dozens. Thirdly, the last term doesn't have to be 4 characters or less.
 
   ([a-z]{2,4})$ = at least 2 leters eg de but upto 4 eg info
 
  .museum...
 
  miguel
 
 





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




[PHP] No php being built...

2002-03-25 Thread rjp

G'day.

Problem:
Following  [b] install trail in INSTALL  using php 4.1.2 source distro,
and with the  configure setup shown below [1].

Conditions:
Using Mandrake 7 / updated bintools / kernel 2.4..95.214 / kde 2.2.2
gcc 2.95.2

Apache  1.3.23  already successfully built from source, installed  running.

Observations:

--[1]-

#!/bin/bash
#  PHP build   22-mar-02
rm -rf  configure.cache
./configure  \
--prefix=/opt/G  \
--with-mysql=/usr/local/mysql   \
--enable-track-vars \
--with-apache=../../apache_1.3.23


I find that after [what appears to be]  a successul completion of the gmake 
no php executable bas been built
( make test  failed  'no rule to make target ' )

The only build problem encountered up to this point was in 'microtiime.c'
read FAQ article, applied `broken library test'  which did not produce 'a 
stream of errors'  so proceeded to patch microtime.c by forcing #include  
sys/resource.h  on the assumprion that base libs actually OK.

after looking  at ~/Makefile  et.al   , it appears that 'gmake php'  should
make the php executable.

-[2]---
/bin/sh /home/pkg/apache/PHP/php-4.1.2/libtool --silent --mode=link gcc \
-I. -I/home/pkg/apache/PHP/php-4.1.2/ -I/home/pkg/apache/PHP/php-4.1.2/main \
 -I/home/pkg/apache/PHP/php-4.1.2 
-I/home/pkg/apache/apache_1.3.23/src/include \
 -I/home/pkg/apache/apache_1.3.23/src/os/unix 
-I/home/pkg/apache/PHP/php-4.1.2/Zend \
 -I/usr/local/mysql/include/mysql 
-I/home/pkg/apache/PHP/php-4.1.2/ext/xml/expat \
  -I/home/pkg/apache/PHP/php-4.1.2/TSRM -g -O2   -o php -export-dynamic  
stub.lo libphp4.la

/usr/lib/crt1.o: In function `_start':
/usr/lib/crt1.o(.text+0x18): undefined reference to `main'
collect2: ld returned 1 exit status
gmake: *** [php] Error 1


From [2]  it seems that either ~/stub.lo  must be made from something other 
than  ~/stub.c   (which is blank)  or that libphp4.la  should contain a 
procedure   main()  -- strange?



I have had a dig on the news://   list archive  - works with konqueror 
(didn't know that!) but found only one tangential reference.
  

Anyway,  before digging further, does any of this look familiar to U lot?

Regards, RJP




-- 
RJP - [EMAIL PROTECTED] http://www.sedric.demon.co.uk.


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




[PHP] Re:[PHP] HELP ME PLEASE: php not run on IIS 4.0

2002-03-25 Thread Liam

25/03/2002 8:27:51 PM

hehehe
You could start with loosing IIS, it's bad news.
The port of Apache for windows is good, if not, Xitami's also quite good.

http://www.apache.org/dist/httpd/binaries/win32/
http://www.xitami.com/

But, no, sorry.  I can't help you.



Berlina [EMAIL PROTECTED] wrote on 25/03/2002 10:19:46 AM:

Hi,

Im trying to install PHP 4.1.2 under Windows 2000 Server and IIS 4.0

* If I configure PHP as a MODULE, all run but SESSIONS DON'T WORK
* If I configure PHP as a CGI, SESSIONS WORK but ORACLE MODULE for PHP not
load

Any ideas?
Anybody can help me?

Advanced thanks,
Berli

-- 
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] [newbie] Something is messed up, anybody can help?

2002-03-25 Thread Mantas Kriauciunas

Hey PHP General List,

Intro:
I am creating small login script and few things doesn't work right.
Code is hare:

admin.php

if(isset($subm_login))
{
$session[logged]=0;
$session[uzeriz]=;
$result = mysql_query(select * from uzer where user='$uzr_name' and 
pass='$uzr_passwd');
 if(!$result)   {
 echo This error should not be hare. But it sayes that it could not 
search for your user;
 } else {
  if(mysql_num_rows($result)!=1) {
   echo Login Not Found;
} else {
  while($row = mysql_fetch_row($result)){
  $session[uzeriz]=$row[user];
  $session[logged]=1;
  $session[pass]=$row[pass];
  }
}
 }
 session_register(session);
}

if( $session[logged]==1 )
{
  draw_admin_menu($session[uzeriz]);
}
if( $session[logged]==0 )
{
draw_login_box();
}

--
adm_func.php (this file is included in admin.php)

function draw_admin_menu($uzer)
{
global $session;
echo pUser Logged In/p\n;
echo p--/p\n;
echo p$uzer/P\n;
}

--

Problem:
the problem is that i cant see $uzer its empty. nothing is
therewhat i am doing wrong? all table names and everything is
correct but i get empty thing.

If that is dumb question im sorry :) i am kinda new in this :)

:--:
Have A Nice Day! 
 Mantas Kriauciunas A.k.A mNTKz

Contacts:
[EMAIL PROTECTED]
Http://mntkz-hata.visiems.lt



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




[PHP] Uploading files without an HTML form

2002-03-25 Thread Sam Rose

Hi there,

I was wondering if it is possible to upload an known file without having to
use an HTML form with the post command?

If so, could you point me in the right direction?

Thanks alot

Sam Rose

p.s. I'm only on the digest list, so it would be really handy if you could
send any replies back to me as well. Thanks.



[PHP] php 4.1.2 XSLT on solaris

2002-03-25 Thread ghislain MUKOKA

Hi
I m under SOLRIS 8 on Sparc
My question is How fixe this errors on APACHE start whith php module.
Apache ERROR MSG on start
Syntax error on line 205 of /opt/local/apachessl/conf/httpd.conf:
Cannot load /opt/local/apachessl/libexec/libphp4.so into server: ld.so.1: 
/opt/local/apachessl/bin/httpd: fatal: /opt/local/apachessl/libexec/libphp4.so: open 
failed: No such file or directory
./bin/apachectl start: httpd could not be started

could you Help me please


Ghislain MUKOKA
Unix System Ingineer
Ingénieur Système Unix 
AOL FRANCE
+33172250682



[PHP] MS Access data = mySQL database

2002-03-25 Thread Thomas Edison Jr.

Can anyone tell me how to convert/send data stored in
an MS Access database to a mySQL table through PHP??

T. Edison Jr.



=
Rahul S. Johari (Director)
**
Abraxas Technologies Inc.
Homepage : http://www.abraxastech.com
Email : [EMAIL PROTECTED]
Tel : 91-4546512/4522124
***

__
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards®
http://movies.yahoo.com/

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




[PHP] HELP ME PLEASE: php not run on IIS 4.0

2002-03-25 Thread Berlina

Hi,

Im trying to install PHP 4.1.2 under Windows 2000 Server and IIS 4.0

* If I configure PHP as a MODULE, all run but SESSIONS DON'T WORK
* If I configure PHP as a CGI, SESSIONS WORK but ORACLE MODULE for PHP not
load

Any ideas?
Anybody can help me?

Advanced thanks,
Berli

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




[PHP] File Upload

2002-03-25 Thread David McInnis

I wrote s script to upload a file.  The script works, but when I point
my browser to the file it downloads, but I can no longer open the file
in MS Word.  What is happening to my file?  My client is Windows and the
server is Linux.

David McInnis




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




[PHP] reg-ex

2002-03-25 Thread John Fishworld

How can I change this to accept spaces as well ?

(ereg(^[A-Za-zÀ-ÖØ-öø-ÿ]*$, $str))



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




php-general Digest 25 Mar 2002 12:40:27 -0000 Issue 1247

2002-03-25 Thread php-general-digest-help


php-general Digest 25 Mar 2002 12:40:27 - Issue 1247

Topics (messages 89952 through 90011):

Re: what's undefined index ?
89952 by: Martin Towell
89970 by: Jason Wong

Re: [PHP-DEV] Resume of my problem
89953 by: Zak Greant

mcrypt kills Apache children
89954 by: Thalis A. Kalfigopoulos

Why?
89955 by: Alberto Wagner
89956 by: Zak Greant
89959 by: Martin Towell
89962 by: maxwello.hotpop.com
89991 by: Matt Parlane
89994 by: Gunter Ohrner
90001 by: Arve Bersvendsen

Re: Retrieving POP mail
89957 by: Kearns, Terry

Text Editor
89958 by: Hiroshi Ayukawa
89964 by: Yasuo Ohgaki
89968 by: Tyler Longren

Re: [NEWMAN] Why?
89960 by: Philip J. Newman

problem with multiple cookies, PHP, and proxypass under apache
89961 by: Vincent Cunniffe
89965 by: Tom Rogers
89966 by: Tom Rogers
89969 by: Vincent Cunniffe

Image Displayed From Database
89963 by: Shaun Martinec
89975 by: Miguel Cruz

Creating an SQL database and finding the path to SQL
89967 by: Ivan Olson

Re: Image manipulation with PHP on RHLinux 7.1
89971 by: Jason Wong

Re: Trouble with mysql_pconnect unable to connect to database?
89972 by: Jim Hankins

Re: Non-Cache in forms?
89973 by: David Robley

Re: Displaying a 2 column html table with N elements
89974 by: David Robley

Form  POST
89976 by: Kevin Maynard
89979 by: Jason Wong

Re:[PHP] Why?
89977 by: Liam

Re:[2]  [PHP] Text Editor
89978 by: Liam

How to use bind arguments
89980 by: Vincent Bergeron
89983 by: Martin Towell

When Click a HyperLink, Promp password before Showing the Page
89981 by: Jack
89982 by: Justin French

Is there anyway to save a file into Mysql database
89984 by: Jack

Regular Expression Challenge
89985 by: Cameron Just
89987 by: Thalis A. Kalfigopoulos
89989 by: Matt Moreton
89990 by: Matt Moreton

mail...
89986 by: Mantas Kriauciunas

How to Pass the Username which from Windows Login
89988 by: Jack

Re: Does anybody use UltraDev?
89992 by: Philippe Saladin

From To to BCC in a Mail script
89993 by: anti-blank
89995 by: Jason Wong
8 by: Justin French

Re: Rebuilding PHP4 with IBM DB2 Support Causes Apache to Die Upon Restart
89996 by: Josep Raurell

e-mail list app
89997 by: Michael A. Peters

Resume/recover uploads in PHP 4.2 ? WAS: RE: upload forms, how much was uploaded 
before upload fails..
89998 by: Jimmy Lantz

Empty strings
9 by: Manuzhai

Re: Still REG EX
90002 by: liljim

No php being built...
90003 by: rjp.sedric.demon.co.uk

HELP ME PLEASE:  php not run on IIS 4.0
90004 by: Berlina

Re:[PHP] HELP ME PLEASE:  php not run on IIS 4.0
90005 by: Liam

File Upload
90006 by: David McInnis

[newbie] Something is messed up, anybody can help?
90007 by: Mantas Kriauciunas

Uploading files without an HTML form
90008 by: Sam Rose

php 4.1.2 XSLT on solaris
90009 by: ghislain MUKOKA

MS Access data = mySQL database
90010 by: Thomas Edison Jr.

reg-ex
90011 by: John Fishworld

Administrivia:

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

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

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


--

---BeginMessage---

undefined variable is when you try to use a variable before you set it, eg
$foobar
undefined index is when you try to reference an array index before you set
it, eg $foobar[10]

-Original Message-
From: Kai Schaetzl [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 25, 2002 11:31 AM
To: [EMAIL PROTECTED]
Subject: [PHP] what's undefined index ?


When I enable display of warnings I get an undefined index warning 
instead of an undefined variable for some variables.

Why and what's the difference?

Warning: Undefined index: KundeRemark in 
C:\Server\www\conadmin\admin-beta\lib\kunden_functions.inc on line 
138

Warning: Undefined variable: KundeStatusNeu_show in 
C:\Server\www\conadmin\admin-beta\lib\kunden_functions.inc on line 
192



Kai

--

Kai Schätzl, Berlin, Germany
Get your web at Conactive Internet Services: http://www.conactive.com
IE-Center: http://ie5.de  http://msie.winware.org




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

---End Message---
---BeginMessage---

On Monday 25 March 2002 08:35, Martin Towell wrote:
 undefined variable is when you try to use a variable before you set it,
 eg $foobar
 undefined index is when you try to reference an array index before you
 set it, eg $foobar[10]

Just to extend the explanation further. The most common cause of 

Re: [PHP] Image Displayed From Database

2002-03-25 Thread Kai Schaetzl

 Also when I right-click and
 choose Save As it only lets me save as a bmp. Again, it displays fine, I
 would just like to make it work like a real image.


Clear your IE cache (TIF (Temporary Internet Files)). If that doesn't help, 
follow Miguel's advice.


Kai

--

Kai Schätzl, Berlin, Germany
Get your web at Conactive Internet Services: http://www.conactive.com
IE-Center: http://ie5.de  http://msie.winware.org
ClubWin - Help for Windows Users: http://www.clubwin.com




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




[PHP] Creating forums in php

2002-03-25 Thread Denis L. Menezes

Hello friends,

I am running a website having php and mysql support on which I want to set
up a discussions forum. Can someone advise me any web resources for building
a php-mysql forum?

Thanks
denis


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




[PHP] Re: reg-ex

2002-03-25 Thread liljim


John Fishworld [EMAIL PROTECTED] wrote in message
002301c1d3fa$b2c2f350$04010a0a@fishworld">news:002301c1d3fa$b2c2f350$04010a0a@fishworld...
 How can I change this to accept spaces as well ?

 (ereg(^[A-Za-zÀ-ÖØ-öø-ÿ]*$, $str))

Put a space in the character class.

~James



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




[PHP] GIF support in PHP

2002-03-25 Thread Todor Stoyanov

Is there a way to add GIF support in PHP without recompiling?
Just adding as an extension.

Tanks a lot.



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




RE: [PHP] [newbie] Something is messed up, anybody can help?

2002-03-25 Thread Rick Emery

1.  Just pass uzeriz to the function, not session(uzeriz);

2.  FYI: you don't need this construct:  while($row =
mysql_fetch_row($result)){
Based upon the previous tests, there is ONLY 1 entry.  Therefore, go with:
$row = mysql_fetch_row($result);


-Original Message-
From: Mantas Kriauciunas [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 25, 2002 6:39 AM
To: PHP General List
Subject: [PHP] [newbie] Something is messed up, anybody can help?


Hey PHP General List,

Intro:
I am creating small login script and few things doesn't work right.
Code is hare:

admin.php

if(isset($subm_login))
{
$session[logged]=0;
$session[uzeriz]=;
$result = mysql_query(select * from uzer where user='$uzr_name' and
pass='$uzr_passwd');
 if(!$result)   {
 echo This error should not be hare. But it sayes that it
could not search for your user;
 } else {
  if(mysql_num_rows($result)!=1) {
   echo Login Not Found;
} else {
  while($row = mysql_fetch_row($result)){
  $session[uzeriz]=$row[user];
  $session[logged]=1;
  $session[pass]=$row[pass];
  }
}
 }
 session_register(session);
}

if( $session[logged]==1 )
{
  draw_admin_menu($session[uzeriz]);
}
if( $session[logged]==0 )
{
draw_login_box();
}

--
adm_func.php (this file is included in admin.php)

function draw_admin_menu($uzer)
{
global $session;
echo pUser Logged In/p\n;
echo p--/p\n;
echo p$uzer/P\n;
}

--

Problem:
the problem is that i cant see $uzer its empty. nothing is
therewhat i am doing wrong? all table names and everything is
correct but i get empty thing.

If that is dumb question im sorry :) i am kinda new in this :)

:--:
Have A Nice Day! 
 Mantas Kriauciunas A.k.A mNTKz

Contacts:
[EMAIL PROTECTED]
Http://mntkz-hata.visiems.lt



-- 
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] GIF support in PHP

2002-03-25 Thread Andrey Hristov

This is the way under windows. Hmm, possibly you want GD extension but GIF format was 
excluded from the supported in the past but
you can apply a crack over the GD and then recompile. For *nix : Get the sources, 
compile GD as a module and edit php.ini so PHP
(possibly libphp4.so) will load the extension on Apache restart. Restart Apache.


Best regards,
Andrey Hristov

- Original Message -
From: Todor Stoyanov [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, March 25, 2002 3:43 PM
Subject: [PHP] GIF support in PHP


 Is there a way to add GIF support in PHP without recompiling?
 Just adding as an extension.

 Tanks a lot.



 --
 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: Creating forums in php

2002-03-25 Thread Jason Sheets

Why build one when someone else already has built something that will work?
Take a look at www.hotscripts.com, http://php.resourceindex.com and
www.zend.com they all have libraries of scripts for PHP.

Jason
Denis L. Menezes [EMAIL PROTECTED] wrote in message
001a01c1d401$7c90ba40$c900a8c0@d8d0l7">news:001a01c1d401$7c90ba40$c900a8c0@d8d0l7...
 Hello friends,

 I am running a website having php and mysql support on which I want to set
 up a discussions forum. Can someone advise me any web resources for
building
 a php-mysql forum?

 Thanks
 denis




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




[PHP] date (j) not working on Unix - any ideas

2002-03-25 Thread geoff

Any ideas why  date (j)   doesn't  appear to work when I use it on my ISP
that has a Unix Server, but on my Windows ISP , it works fine ?  The other
date() functions Y,m,d etc all work fine on both systems.

(I'm using PHP3 by the way.)

Any help would be very much appreciated.

Thanks

Geoff



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




[PHP] Why using this? When....

2002-03-25 Thread ...::: Rober2.com :::...

Hey!

What's really the meaning with
whatever.php?page=1 when you are NOT using a db?
Just cuz it looks cool? Or is there a better reason?

-Cuz you could do a href=whatever.htm instead of blabla.php?page=1
(having include('blabla.htm'); in a script in blabla.php...of course)

Thanks



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




Re: [PHP] Why using this? When....

2002-03-25 Thread Erik Price


On Monday, March 25, 2002, at 09:31  AM, ...::: Rober2.com :::... wrote:

 What's really the meaning with
 whatever.php?page=1 when you are NOT using a db?
 Just cuz it looks cool? Or is there a better reason?

 -Cuz you could do a href=whatever.htm instead of blabla.php?page=1
 (having include('blabla.htm'); in a script in blabla.php...of course)

You can pass $_GET variables in this way, which become available on the 
next page.  Here's an example:

http://domain.com/whatever.php?theme=metallic

Now in the whatever.php script, if there is code like this:

// determine user's theme preferences
print link rel=\stylesheet\ type=\text/css\ href=\;
if ($_GET['theme']) {
   switch $_GET['theme'] {
 case 'sky':
   print 'sky.css';
 case 'metallic':
   print 'metallic.css';
 default:
   print 'standard.css';
   }
} else {
   print 'standard.css';
}
print \ /;   // finish the link tag

Obviously, you wouldn't really use a theme in this fashion since you'd 
have to replicate this value in every link in your document -- this kind 
of thing is more appropriate to have in a session variable.  But the 
lesson is the same -- variables can be passed in this fashion for any 
purpose, not just database access.  (It's called passing a variable in 
the querystring.)



HTH,

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:[PHP] Why?

2002-03-25 Thread Rick Emery

I'm ex-USAF.
FUBAR means Fucked-Up Beyond All Repair

-Original Message-
From: Liam [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 25, 2002 9:02 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Re:[PHP] Why?


25/03/2002 3:01:36 PM

FBAR was a term used in the second world war.
It turned into FUBAR for better pronounciation.
FUBAR turned into FOO BAR

FBAR stands for:
Fucked Beyond All Recognition


I hope you find this completely unrelated snippet
of trivial knowledge amusing, as I certainly do   :-)



Alberto Wagner [EMAIL PROTECTED] wrote on 31/03/2002 2:39:35 AM:

Why everyone uses $foo or $foobar as examples?




-- 
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] Why using this? When....

2002-03-25 Thread ...::: Rober2.com :::...

Ok, I get it.

Exepet passing information there isn't other meaning right?

...


Erik Price [EMAIL PROTECTED] escribió en el mensaje
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

 On Monday, March 25, 2002, at 09:31  AM, ...::: Rober2.com :::... wrote:

  What's really the meaning with
  whatever.php?page=1 when you are NOT using a db?
  Just cuz it looks cool? Or is there a better reason?
 
  -Cuz you could do a href=whatever.htm instead of blabla.php?page=1
  (having include('blabla.htm'); in a script in blabla.php...of course)

 You can pass $_GET variables in this way, which become available on the
 next page.  Here's an example:

 http://domain.com/whatever.php?theme=metallic

 Now in the whatever.php script, if there is code like this:

 // determine user's theme preferences
 print link rel=\stylesheet\ type=\text/css\ href=\;
 if ($_GET['theme']) {
switch $_GET['theme'] {
  case 'sky':
print 'sky.css';
  case 'metallic':
print 'metallic.css';
  default:
print 'standard.css';
}
 } else {
print 'standard.css';
 }
 print \ /;   // finish the link tag

 Obviously, you wouldn't really use a theme in this fashion since you'd
 have to replicate this value in every link in your document -- this kind
 of thing is more appropriate to have in a session variable.  But the
 lesson is the same -- variables can be passed in this fashion for any
 purpose, not just database access.  (It's called passing a variable in
 the querystring.)



 HTH,

 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




[PHP] newbyie - date conversion to human readable form

2002-03-25 Thread ROBERT MCPEAK

I've dug around for a while but I can't find a direct answer on how to
convert a date in this format: 2002-03-25 to a human readable format
such as  March 25, 2002, or even better, Monday, March 25, 2002.

Can anybody help me with this, or point me to some clear directions on
how to do this?

Thanks!

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




[PHP] User validation and Session management

2002-03-25 Thread javier

Hi, I'm new to the newsgroup.
I would like to know how can I do with php to keep user track
and let him or not access to specified pages.

I thought about validating (u/p) first and then giving a session 
variable. And then on each script I would check sessionID with
a permissions table.

Is there any tutorial that talk about above?

Thanks.


Bye!


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




Re: [PHP] Why using this? When....

2002-03-25 Thread Erik Price


On Monday, March 25, 2002, at 09:49  AM, ...::: Rober2.com :::... wrote:

 Ok, I get it.

 Exepet passing information there isn't other meaning right?


Hm?



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




[PHP] Another Session Question

2002-03-25 Thread John Fishworld

I've seen various tutorials on sessions where they specify the session id
instead of just using one
generated by php !

Why ?



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




RE: [PHP] newbyie - date conversion to human readable form

2002-03-25 Thread Dan Vande More

Straight from my code:

$value = date(m/d/Y, strtotime($value));


If you want it otherwise, modify the paramters in the 'date' command to your
liking.
Dan

-Original Message-
From: ROBERT MCPEAK [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 25, 2002 7:55 AM
To: [EMAIL PROTECTED]
Subject: [PHP] newbyie - date conversion to human readable form


I've dug around for a while but I can't find a direct answer on how to
convert a date in this format: 2002-03-25 to a human readable format
such as  March 25, 2002, or even better, Monday, March 25, 2002.

Can anybody help me with this, or point me to some clear directions on
how to do this?

Thanks!

-- 
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] newbyie - date conversion to human readable form

2002-03-25 Thread Rick Emery

In PHP, you look at the date() function.

If retrieving this from a mysql database, mysql will do it for you:
SELECT DATE( mydate, %W, %M %d, %Y) AS thedate FROM mytable;


-Original Message-
From: ROBERT MCPEAK [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 25, 2002 8:55 AM
To: [EMAIL PROTECTED]
Subject: [PHP] newbyie - date conversion to human readable form


I've dug around for a while but I can't find a direct answer on how to
convert a date in this format: 2002-03-25 to a human readable format
such as  March 25, 2002, or even better, Monday, March 25, 2002.

Can anybody help me with this, or point me to some clear directions on
how to do this?

Thanks!

-- 
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] localization - internationalization

2002-03-25 Thread Matt Friedman

Hi,

Just wondering how many folks are working on localization issues. I am
building an application and have built in support for multi-languages,
but I do not yet have anything set up for handling different monetary
and date formatting. What other issues should I consider?

Any pointers to help on this subject and your input are appreciated as
always.

Many thanks,
Matt Friedman
www.SpryNewMedia.com




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




Re: [PHP] localization - internationalization

2002-03-25 Thread Andrey Hristov

use setlocale() to set locale in every script.
then the output from different functions - number_format(), strftime(), etc. will be 
according to the locale.
I've not tried this but it have to work.

Best regards,
Andrey


- Original Message - 
From: Matt Friedman [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, March 25, 2002 5:03 PM
Subject: [PHP] localization - internationalization


 Hi,
 
 Just wondering how many folks are working on localization issues. I am
 building an application and have built in support for multi-languages,
 but I do not yet have anything set up for handling different monetary
 and date formatting. What other issues should I consider?
 
 Any pointers to help on this subject and your input are appreciated as
 always.
 
 Many thanks,
 Matt Friedman
 www.SpryNewMedia.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] fatal: /opt/local/apachessl/libexec/libphp4.so

2002-03-25 Thread ghislain MUKOKA

Hi
I m under SOLRIS 8 on Sparc
My question is How fixe this errors on APACHE start whith php module.
Apache ERROR MSG on start
Syntax error on line 205 of /opt/local/apachessl/conf/httpd.conf:
Cannot load /opt/local/apachessl/libexec/libphp4.so into server: ld.so.1: /o=
pt/local/apachessl/bin/httpd: fatal: /opt/local/apachessl/libexec/libphp4.so=
: open failed: No such file or directory
./bin/apachectl start: httpd could not be started

could you Help me please
Ghislain MUKOKA
Unix System Ingineer
Ingénieur Système Unix 
AOL FRANCE
+33172250682



Re: [PHP] MS Access data = mySQL database

2002-03-25 Thread Jon Farmer

 Can anyone tell me how to convert/send data stored in
 an MS Access database to a mySQL table through PHP??

3 Ways of doing this come to mind. Only one uses PHP though.



1. From PHP use ODBC to extract from access and send to MySQL through PHP
functions.

2. Export to csv from Access and use mysqlimport to import into MySQL.

3. Use the MySQL ODBC driver to link the MySQL tables into Access and run a
query to copy the records over.

Regards

Jon


--
Jon Farmer
Systems Programmer, Entanet www.enta.net
Tel 01952 428969
PGP Key available, send email with subject: Send PGP Key




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




[PHP] Confused About Classes

2002-03-25 Thread arti

I am getting the error Undefined variable this in my class.  I am new to
PHP and presume I am just doing something wrong.  But, I don't understand
what it could be as the code looks straightforward to me.  Note that I
trimmed out some code to keep this listing from being huge, but the relevant
pieces are included.


?php

class standardquestion
{

var $private;

function standardquestion($xmlfilename)
{

 $this-private=FALSE;

 $parser=xml_parser_create();

 xml_set_element_handler($parser,
array(standardquestion,startElementHandler),
array(standardquestion,endElementHandler));

 while ($data = fread($fp, 4096))
 {
  if (!xml_parse($parser, $data, feof($fp)))
  {
   die(sprintf(XML error %d %d,
xml_get_currentnode_line_number($parser),
xml_get_currentnode_column_number($parser)));
  }
 }
}

function startElementHandler($parser, $name, $attribs)
{
 if ($name==private)
  $this-private = TRUE;

 if ($this-private==FALSE) //   Undefined variable this
  return;
}


function endElementHandler($parser, $name)
{
}


}
?




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




RE: [PHP] Confused About Classes

2002-03-25 Thread Rick Emery

  if ($this-private==FALSE) //   Undefined variable
this
  return;
 }

$this is relevant ONLY within the scope of the class definition.
The above snippet is located OUTSIDE of the class definition.
You must use an object pointer.  That is:

$newobj = new standardquestion($filename);
if( $newobj-private==FALSE)
{
}
-Original Message-
From: arti [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 25, 2002 9:33 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Confused About Classes


I am getting the error Undefined variable this in my class.  I am new to
PHP and presume I am just doing something wrong.  But, I don't understand
what it could be as the code looks straightforward to me.  Note that I
trimmed out some code to keep this listing from being huge, but the relevant
pieces are included.


?php

class standardquestion
{

var $private;

function standardquestion($xmlfilename)
{

 $this-private=FALSE;

 $parser=xml_parser_create();

 xml_set_element_handler($parser,
array(standardquestion,startElementHandler),
array(standardquestion,endElementHandler));

 while ($data = fread($fp, 4096))
 {
  if (!xml_parse($parser, $data, feof($fp)))
  {
   die(sprintf(XML error %d %d,
xml_get_currentnode_line_number($parser),
xml_get_currentnode_column_number($parser)));
  }
 }
}

function startElementHandler($parser, $name, $attribs)
{
 if ($name==private)
  $this-private = TRUE;

 if ($this-private==FALSE) //   Undefined variable this
  return;
}


function endElementHandler($parser, $name)
{
}


}
?




-- 
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] Confused About Classes

2002-03-25 Thread arti

No, the only thing I supplied is the class.  The startElementHandler IS a
function in the class.



Rick Emery [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
   if ($this-private==FALSE) //   Undefined variable
 this
   return;
  }

 $this is relevant ONLY within the scope of the class definition.
 The above snippet is located OUTSIDE of the class definition.
 You must use an object pointer.  That is:

 $newobj = new standardquestion($filename);
 if( $newobj-private==FALSE)
 {
 }
 -Original Message-
 From: arti [mailto:[EMAIL PROTECTED]]
 Sent: Monday, March 25, 2002 9:33 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Confused About Classes


 I am getting the error Undefined variable this in my class.  I am new to
 PHP and presume I am just doing something wrong.  But, I don't understand
 what it could be as the code looks straightforward to me.  Note that I
 trimmed out some code to keep this listing from being huge, but the
relevant
 pieces are included.


 ?php

 class standardquestion
 {

 var $private;

 function standardquestion($xmlfilename)
 {

  $this-private=FALSE;

  $parser=xml_parser_create();

  xml_set_element_handler($parser,
 array(standardquestion,startElementHandler),
 array(standardquestion,endElementHandler));

  while ($data = fread($fp, 4096))
  {
   if (!xml_parse($parser, $data, feof($fp)))
   {
die(sprintf(XML error %d %d,
 xml_get_currentnode_line_number($parser),
 xml_get_currentnode_column_number($parser)));
   }
  }
 }

 function startElementHandler($parser, $name, $attribs)
 {
  if ($name==private)
   $this-private = TRUE;

  if ($this-private==FALSE) //   Undefined variable
this
   return;
 }


 function endElementHandler($parser, $name)
 {
 }


 }
 ?




 --
 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] header and session?

2002-03-25 Thread Johnson, Kirk

Do you have register_globals turned on or off in php.ini? What values are $a
and $b being set to?

Kirk

 -Original Message-
 From: bob [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, March 24, 2002 4:21 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] header and session?
 
 
  1.php?2.php
 session_start(); session_start();
 .. ..
 $_SESSION['a'] =$a; echo $_SESSION['a']; 
 $_SESSION['b'] =$b; echo $_SESSION['b']; 
 header(location: 2.php);
 
 after jump to 2.php ,there is an warning: undefined index a ,b
 
 
 if i  change 1.phpto
   
 session_start(); 
 ..  
 $_SESSION['a'] =$a;
 $_SESSION['b'] =$b;
 a href='2.php' go on /a
 
 it works well!

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




RE: [PHP] Confused About Classes

2002-03-25 Thread Rick Emery

However, startElementHandler() is not be called in a class context.
According to the manual for xml_set_element_handler():
There is currently no support for object/method handlers.


-Original Message-
From: arti [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 25, 2002 9:43 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Confused About Classes


No, the only thing I supplied is the class.  The startElementHandler IS a
function in the class.



Rick Emery [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
   if ($this-private==FALSE) //   Undefined variable
 this
   return;
  }

 $this is relevant ONLY within the scope of the class definition.
 The above snippet is located OUTSIDE of the class definition.
 You must use an object pointer.  That is:

 $newobj = new standardquestion($filename);
 if( $newobj-private==FALSE)
 {
 }
 -Original Message-
 From: arti [mailto:[EMAIL PROTECTED]]
 Sent: Monday, March 25, 2002 9:33 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Confused About Classes


 I am getting the error Undefined variable this in my class.  I am new to
 PHP and presume I am just doing something wrong.  But, I don't understand
 what it could be as the code looks straightforward to me.  Note that I
 trimmed out some code to keep this listing from being huge, but the
relevant
 pieces are included.


 ?php

 class standardquestion
 {

 var $private;

 function standardquestion($xmlfilename)
 {

  $this-private=FALSE;

  $parser=xml_parser_create();

  xml_set_element_handler($parser,
 array(standardquestion,startElementHandler),
 array(standardquestion,endElementHandler));

  while ($data = fread($fp, 4096))
  {
   if (!xml_parse($parser, $data, feof($fp)))
   {
die(sprintf(XML error %d %d,
 xml_get_currentnode_line_number($parser),
 xml_get_currentnode_column_number($parser)));
   }
  }
 }

 function startElementHandler($parser, $name, $attribs)
 {
  if ($name==private)
   $this-private = TRUE;

  if ($this-private==FALSE) //   Undefined variable
this
   return;
 }


 function endElementHandler($parser, $name)
 {
 }


 }
 ?




 --
 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] Echo Informative Text will Script Runs - how ?

2002-03-25 Thread Chris

Hi,

How can I echo some text such as Processing, please wait... whilst the PHP
script runs. Rather than displaying a blank screen with the results being
echoed once the script has fully completed.

Thanks,
Chris



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




[PHP] Re: Confused About Classes

2002-03-25 Thread Cirstoiu Aurel Sorin

I am sorry but your code works just fine.
What server do you have?And what configuration?

--
---
Cirstoiu Aurel Sorin
Interakt Online Support
http://www.interakt.ro/
Arti [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I am getting the error Undefined variable this in my class.  I am new to
 PHP and presume I am just doing something wrong.  But, I don't understand
 what it could be as the code looks straightforward to me.  Note that I
 trimmed out some code to keep this listing from being huge, but the
relevant
 pieces are included.


 ?php

 class standardquestion
 {

 var $private;

 function standardquestion($xmlfilename)
 {

  $this-private=FALSE;

  $parser=xml_parser_create();

  xml_set_element_handler($parser,
 array(standardquestion,startElementHandler),
 array(standardquestion,endElementHandler));

  while ($data = fread($fp, 4096))
  {
   if (!xml_parse($parser, $data, feof($fp)))
   {
die(sprintf(XML error %d %d,
 xml_get_currentnode_line_number($parser),
 xml_get_currentnode_column_number($parser)));
   }
  }
 }

 function startElementHandler($parser, $name, $attribs)
 {
  if ($name==private)
   $this-private = TRUE;

  if ($this-private==FALSE) //   Undefined variable
this
   return;
 }


 function endElementHandler($parser, $name)
 {
 }


 }
 ?






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




RE: [PHP] newbyie - date conversion to human readableform-CORRECTION

2002-03-25 Thread ROBERT MCPEAK



 Rick Emery [EMAIL PROTECTED] 03/25/02 11:04AM 
CORRECTION:
SELECT DATE_FORMAT( mydate, %W, %M %d, %Y) AS thedate FROM mytable;

-Original Message-
From: ROBERT MCPEAK [mailto:[EMAIL PROTECTED]] 
Sent: Monday, March 25, 2002 9:58 AM
To: [EMAIL PROTECTED] 
Subject: RE: [PHP] newbyie - date conversion to human readable form


This mysql syntax generates an error message.  Can you see what's
wrong
with it?

 Rick Emery [EMAIL PROTECTED] 03/25/02 10:00AM 
In PHP, you look at the date() function.

If retrieving this from a mysql database, mysql will do it for you:
SELECT DATE( mydate, %W, %M %d, %Y) AS thedate FROM mytable;


-Original Message-
From: ROBERT MCPEAK [mailto:[EMAIL PROTECTED]] 
Sent: Monday, March 25, 2002 8:55 AM
To: [EMAIL PROTECTED] 
Subject: [PHP] newbyie - date conversion to human readable form


I've dug around for a while but I can't find a direct answer on how to
convert a date in this format: 2002-03-25 to a human readable format
such as  March 25, 2002, or even better, Monday, March 25, 2002.

Can anybody help me with this, or point me to some clear directions on
how to do this?

Thanks!

-- 
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] Login displays the pass and user in url

2002-03-25 Thread David Orn Johannsson

Can I some how prevent the browser from displayin
index.php?passwd=passuser=user in the url when I use this script I
wrote.
 
  ?php
if(!IsSet($stage)){
print(form name=\login\
action=\$PHP_SELF\);
print(input type=\hidden\
name=\stage\ value=\1\);
print(table);
print(trtd
class=\maintext\bNotendanafn:/b/tdtdinput
name=\check_username\ type=\text\/td/tr);
print(trtd
class=\maintext\bLykilorð:/b/tdtdinput name=\check_passwd\
type=\password\/td/tr);
print(tdnbsp;/tdtdinput
type=\submit\ value=\Skrá inn\/td/tr);
print(/table);
}
else{
 
include(db_connect.php);
$query = select id,
passwd, system from users where username = '$check_username';
$mysql_result =
mysql_query($query, $db);
$row =
mysql_fetch_row($mysql_result);

if((crypt($check_passwd,
'dominos') == $row[1])  (($system == 0 || $system == 1 ))){
$sid =
session_id();
$uid =
$row[0];
print(a
href=\news.php\[Fréttir]/abr);
print(a
href=\sms.php\[SMS - Auglýsingar]/abr);
}
else if($session ==
session_id()){
print(a
href=\news.php\[Fréttir]/abr);
print(a
href=\sms.php\[SMS - Auglýsingar]/abr);
}
else{
print(Þú
verður að skrá þig inn. a href=\index.php\[Skrá inn]/a);
}
}
  ?
 
 http://www.atom.is/ 
Davíð Örn Jóhannssson
Vefforritari

Atómstöðin hf.
Garðastræti 37
101 Reykjavík

sími: 595-3643
fax: 595-3649
 mailto:[EMAIL PROTECTED] [EMAIL PROTECTED]
 http://www.atom.is/ http://www.atom.is

 



Re: [PHP] Echo Informative Text will Script Runs - how ?

2002-03-25 Thread Jon Farmer

 How can I echo some text such as Processing, please wait... whilst the
PHP
 script runs. Rather than displaying a blank screen with the results being
 echoed once the script has fully completed.


echo (\Processing, please wait...\);
flush();

//processing code here...


--
Jon Farmer
Systems Programmer, Entanet www.enta.net
Tel 01952 428969
PGP Key available, send email with subject: Send PGP Key




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




Re: [PHP] Login displays the pass and user in url

2002-03-25 Thread R'twick Niceorgaw


change the first line to

if(!IsSet($stage)){
print(form name=\login\ action=\$PHP_SELF\ method=\POST\);

HTH

- Original Message -
From: David Orn Johannsson [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, March 25, 2002 11:16 AM
Subject: [PHP] Login displays the pass and user in url


Can I some how prevent the browser from displayin
index.php?passwd=passuser=user in the url when I use this script I
wrote.

  ?php
if(!IsSet($stage)){
print(form name=\login\
action=\$PHP_SELF\);
print(input type=\hidden\
name=\stage\ value=\1\);
print(table);
print(trtd
class=\maintext\bNotendanafn:/b/tdtdinput
name=\check_username\ type=\text\/td/tr);
print(trtd
class=\maintext\bLykilorð:/b/tdtdinput name=\check_passwd\
type=\password\/td/tr);
print(tdnbsp;/tdtdinput
type=\submit\ value=\Skrá inn\/td/tr);
print(/table);
}
else{

include(db_connect.php);
$query = select id,
passwd, system from users where username = '$check_username';
$mysql_result =
mysql_query($query, $db);
$row =
mysql_fetch_row($mysql_result);

if((crypt($check_passwd,
'dominos') == $row[1])  (($system == 0 || $system == 1 ))){
$sid =
session_id();
$uid =
$row[0];
print(a
href=\news.php\[Fréttir]/abr);
print(a
href=\sms.php\[SMS - Auglýsingar]/abr);
}
else if($session ==
session_id()){
print(a
href=\news.php\[Fréttir]/abr);
print(a
href=\sms.php\[SMS - Auglýsingar]/abr);
}
else{
print(Þú
verður að skrá þig inn. a href=\index.php\[Skrá inn]/a);
}
}
  ?

 http://www.atom.is/ 
Davíð Örn Jóhannssson
Vefforritari

Atómstöðin hf.
Garðastræti 37
101 Reykjavík

sími: 595-3643
fax: 595-3649
 mailto:[EMAIL PROTECTED] [EMAIL PROTECTED]
 http://www.atom.is/ http://www.atom.is






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




RE: [PHP] Login displays the pass and user in url

2002-03-25 Thread Rick Emery

where are they being displayed?


-Original Message-
From: David Orn Johannsson [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 25, 2002 10:17 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Login displays the pass and user in url


Can I some how prevent the browser from displayin
index.php?passwd=passuser=user in the url when I use this script I
wrote.
 
  ?php
if(!IsSet($stage)){
print(form name=\login\
action=\$PHP_SELF\);
print(input type=\hidden\
name=\stage\ value=\1\);
print(table);
print(trtd
class=\maintext\bNotendanafn:/b/tdtdinput
name=\check_username\ type=\text\/td/tr);
print(trtd
class=\maintext\bLykilorð:/b/tdtdinput name=\check_passwd\
type=\password\/td/tr);
print(tdnbsp;/tdtdinput
type=\submit\ value=\Skrá inn\/td/tr);
print(/table);
}
else{
 
include(db_connect.php);
$query = select id,
passwd, system from users where username = '$check_username';
$mysql_result =
mysql_query($query, $db);
$row =
mysql_fetch_row($mysql_result);

if((crypt($check_passwd,
'dominos') == $row[1])  (($system == 0 || $system == 1 ))){
$sid =
session_id();
$uid =
$row[0];
print(a
href=\news.php\[Fréttir]/abr);
print(a
href=\sms.php\[SMS - Auglýsingar]/abr);
}
else if($session ==
session_id()){
print(a
href=\news.php\[Fréttir]/abr);
print(a
href=\sms.php\[SMS - Auglýsingar]/abr);
}
else{
print(Þú
verður að skrá þig inn. a href=\index.php\[Skrá inn]/a);
}
}
  ?
 
 http://www.atom.is/ 
Davíð Örn Jóhannssson
Vefforritari

Atómstöðin hf.
Garðastræti 37
101 Reykjavík

sími: 595-3643
fax: 595-3649
 mailto:[EMAIL PROTECTED] [EMAIL PROTECTED]
 http://www.atom.is/ http://www.atom.is

 

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




[PHP] XML Comparison?

2002-03-25 Thread Chris Hilbert

I was wondering if anyone would know how I could go about checking two XML
files for differences, similar to the diff command in *nix.  I'm having a
heck of a time getting a function written to achieve this task.

Thanks,

Chris Hilbert



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




Re: [PHP] what's undefined index ?

2002-03-25 Thread Kai Schaetzl

Your message of Mon, 25 Mar 2002 11:35:57 +1100:

 undefined variable is when you try to use a variable before you set it, eg
 $foobar
 undefined index is when you try to reference an array index before you set
 it, eg $foobar[10]


Hi, thank you both for the explanation. It's clear why I get the undefined, 
these variables *are* for various reasons undefined at the moment. However, 
there are NO arrays involved, f.i. KundeRemark is NOT an array it's a simple 
string variable created by

$KundeRemark   = stripslashes($val[KundeRemark]);

which is a field from a SQL result which currently doesn't exist because I 
changed the connection to a different db where this field is named 
differently. So, it's undefined, fine. But why is it called undefined index 
where it should be undefined variable ?

 Warning: Undefined index: KundeRemark in
 
 C:\Server\www\conadmin\admin-beta\lib\kunden_functions.inc on line
 
 138




Kai

--

Kai Schätzl, Berlin, Germany
Get your web at Conactive Internet Services: http://www.conactive.com
IE-Center: http://ie5.de  http://msie.winware.org




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




[PHP] HTTP, Sockets, and CRLF

2002-03-25 Thread Erik Price

The standard way to end lines when communicating via HTTP is the CRLF 
(ASCII 13  ASCII 10).  But I write my PHP scripts using only LF (ASCII 
10) for line endings.  Why am I still able to write instructions to a 
socket -- does PHP automatically translate my line endings to CRLF, or 
is HTTP just flexible like that?


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] Echo Informative Text will Script Runs - how ?

2002-03-25 Thread Erik Price


On Monday, March 25, 2002, at 10:39  AM, Chris wrote:

 How can I echo some text such as Processing, please wait... whilst 
 the PHP
 script runs. Rather than displaying a blank screen with the results 
 being
 echoed once the script has fully completed.

A hackish and inelegant way to do it would be to use JavaScript to 
create a new front window upon unLoad of the page that calls the PHP 
script.  While the PHP script executes in the back page, taking its time 
to do its thing, the front page (perhaps a small window or something 
with an animated GIF to simulate the page loading effect) sits in 
front.  When the PHP page has finally loaded, a new JavaScript command 
to close the page loading window executes, or you could have it close 
automatically after a certain number of seconds.


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] localization - internationalization

2002-03-25 Thread Matt Friedman

Looking for some more detailed information on this subject.

Any experts out there?

Thanks,

Matt Friedman


-Original Message-
From: Andrey Hristov [mailto:[EMAIL PROTECTED]] 
Sent: Monday March 25, 2002 10:04 AM
To: Matt Friedman
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] localization - internationalization

use setlocale() to set locale in every script.
then the output from different functions - number_format(), strftime(),
etc. will be according to the locale.
I've not tried this but it have to work.

Best regards,
Andrey


- Original Message - 
From: Matt Friedman [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, March 25, 2002 5:03 PM
Subject: [PHP] localization - internationalization


 Hi,
 
 Just wondering how many folks are working on localization issues. I am
 building an application and have built in support for multi-languages,
 but I do not yet have anything set up for handling different monetary
 and date formatting. What other issues should I consider?
 
 Any pointers to help on this subject and your input are appreciated as
 always.
 
 Many thanks,
 Matt Friedman
 www.SpryNewMedia.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] what's undefined index ?

2002-03-25 Thread Darren Gamble

Good day,

The error message refers to the KundeRemark in $val[KundeRemark], not
$KundeRemark which you are trying to assign the result to.  The former is
(if it existed) an index, the latter is a variable.


Darren Gamble
Planner, Regional Services
Shaw Cablesystems GP
630 - 3rd Avenue SW
Calgary, Alberta, Canada
T2P 4L4
(403) 781-4948


-Original Message-
From: Kai Schaetzl [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 25, 2002 9:31 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] what's undefined index ?


Your message of Mon, 25 Mar 2002 11:35:57 +1100:

 undefined variable is when you try to use a variable before you set it,
eg
 $foobar
 undefined index is when you try to reference an array index before you
set
 it, eg $foobar[10]


Hi, thank you both for the explanation. It's clear why I get the
undefined, 
these variables *are* for various reasons undefined at the moment. However, 
there are NO arrays involved, f.i. KundeRemark is NOT an array it's a
simple 
string variable created by

$KundeRemark   = stripslashes($val[KundeRemark]);

which is a field from a SQL result which currently doesn't exist because I 
changed the connection to a different db where this field is named 
differently. So, it's undefined, fine. But why is it called undefined
index 
where it should be undefined variable ?

 Warning: Undefined index: KundeRemark in
 
 C:\Server\www\conadmin\admin-beta\lib\kunden_functions.inc on line
 
 138




Kai

--

Kai Schätzl, Berlin, Germany
Get your web at Conactive Internet Services: http://www.conactive.com
IE-Center: http://ie5.de  http://msie.winware.org




-- 
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] localization - internationalization

2002-03-25 Thread Rasmus Lerdorf

See http://php.net/gettext

On Mon, 25 Mar 2002, Matt Friedman wrote:

 Looking for some more detailed information on this subject.

 Any experts out there?

 Thanks,

 Matt Friedman


 -Original Message-
 From: Andrey Hristov [mailto:[EMAIL PROTECTED]]
 Sent: Monday March 25, 2002 10:04 AM
 To: Matt Friedman
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] localization - internationalization

 use setlocale() to set locale in every script.
 then the output from different functions - number_format(), strftime(),
 etc. will be according to the locale.
 I've not tried this but it have to work.

 Best regards,
 Andrey


 - Original Message -
 From: Matt Friedman [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Monday, March 25, 2002 5:03 PM
 Subject: [PHP] localization - internationalization


  Hi,
 
  Just wondering how many folks are working on localization issues. I am
  building an application and have built in support for multi-languages,
  but I do not yet have anything set up for handling different monetary
  and date formatting. What other issues should I consider?
 
  Any pointers to help on this subject and your input are appreciated as
  always.
 
  Many thanks,
  Matt Friedman
  www.SpryNewMedia.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




[PHP] semi-OT: moving PWS to Apache on NT

2002-03-25 Thread Steve Clay

Hello,

I run Personal Web Server on NT just for local testing but I'm
considering installing Apache.  Would this allow me to run mod_php
instead of the CGI?  Ideally I'd like to configure Apache so that only
local requests are served - Is this easily done?

Anyone on NT/win2k have anything good to say about the v2.0 betas?

Steve
-- 
[EMAIL PROTECTED] ** http://mrclay.org


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




RE: [PHP] semi-OT: moving PWS to Apache on NT

2002-03-25 Thread SHEETS,JASON (Non-HP-Boise,ex1)

I'm currently running the SAPI module for apache on Windows NT and 2000,
works fine.

You can configure apache to only bind to the 127.0.0.1 IP address, this will
prevent requests being served over the network.

Jason

-Original Message-
From: Steve Clay [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 25, 2002 9:46 AM
To: PHP-GENERAL
Subject: [PHP] semi-OT: moving PWS to Apache on NT


Hello,

I run Personal Web Server on NT just for local testing but I'm
considering installing Apache.  Would this allow me to run mod_php
instead of the CGI?  Ideally I'd like to configure Apache so that only
local requests are served - Is this easily done?

Anyone on NT/win2k have anything good to say about the v2.0 betas?

Steve
-- 
[EMAIL PROTECTED] ** http://mrclay.org


-- 
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] list(), each()

2002-03-25 Thread Chris Boget

Ok, I've got to be doing something wrong here.  I've been
beating my head up against the wall for some time and I 
just cannot figure out what it is.  Before I say it's a bug with
list(), could someone tell me what I'm doing wrong?

?

$policy = 1016726726--1--1016643856;

// problematic
list( $policy_num, $policy_year, $application_reference ) = each( explode( --, 
$policy )); 
echo list( $policy_num, $policy_year, $application_reference ) = each( explode( 
\--\, $policy )); br\n;

// fine
$policy = explode( --, $policy );
echo $policy[0] . br\n;
echo $policy[1] . br\n;
echo $policy[2] . br\n;

?

Why isn't list() assigning the value properly?  For the first echo statement, I'm
getting:  

list( 0, 1016726726, ) = each( explode( --, 1016726726--1--1016643856 ));

but the others, where I'm echoing out the individual elements, it's working fine.

What's going on?

Chris



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




Re: [PHP] list(), each()

2002-03-25 Thread Rasmus Lerdorf

Why do you put each(explode()) ?  Just list() = explode() is what you
want.

-Rasmus

On Mon, 25 Mar 2002, Chris Boget wrote:

 Ok, I've got to be doing something wrong here.  I've been
 beating my head up against the wall for some time and I
 just cannot figure out what it is.  Before I say it's a bug with
 list(), could someone tell me what I'm doing wrong?

 ?

 $policy = 1016726726--1--1016643856;

 // problematic
 list( $policy_num, $policy_year, $application_reference ) = each( explode( --, 
$policy ));
 echo list( $policy_num, $policy_year, $application_reference ) = each( explode( 
\--\, $policy )); br\n;

 // fine
 $policy = explode( --, $policy );
 echo $policy[0] . br\n;
 echo $policy[1] . br\n;
 echo $policy[2] . br\n;

 ?

 Why isn't list() assigning the value properly?  For the first echo statement, I'm
 getting:

 list( 0, 1016726726, ) = each( explode( --, 1016726726--1--1016643856 ));

 but the others, where I'm echoing out the individual elements, it's working fine.

 What's going on?

 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




[PHP] undefined variable when using if ($var) {}

2002-03-25 Thread Martha S

I'm rather new to PHP, so this should be fairly easy to answer. I checked
the manual and FAQ already.

I'm using the following code, and I get the following message if $id has
nothing in the var (i have it set to a default of  type int, not null in
mysql). Is there a way around this or something I'm missing?

Thanks :)

-- code---

if ($id) {

   $result = mysql_query(SELECT * FROM entries WHERE id=$id,$db);

   $myrow = mysql_fetch_array($result);

   printf(table border=1tr\n);
   printf(trtd%s/td/tr, $myrow[title]);
   printf(trtd%s | , $myrow[id]);
   printf(%s/td/tr, $myrow[posted]);
   printf(trtd%s\n/td/tr, $myrow[post]);
   printf(/tabletr\n);

   printf(a href=\$PHP_SELF\all/a);

   } else {

do {

printf(%s a href=\%s?id=%s\%s/abr\n, $myrow[id], $PHP_SELF,
$myrow[id], $myrow[title], $myrow[post]);

  } while ($myrow = mysql_fetch_array($result));

} else {

  // no records to display

  echo Sorry, no records were found!;

}




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




Re: [PHP] list(), each()

2002-03-25 Thread Chris Boget

 Why do you put each(explode()) ?  Just list() = explode() is what you
 want.

I did that because I thought they were complimentary functions?  Just about
every example I've seen of list() uses each().  Just using explode() makes it
work.  Obviously I'm going to have to go back and read more about list().

thnx,
Chris


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




Re: [PHP] e-mail list app

2002-03-25 Thread Dan Harrelson


Check out Ciao EmailList Manager:
http://www.technobreeze.com/php/emaillist/

-Dan


--- Michael A. Peters [EMAIL PROTECTED] wrote:
 Anyone know of a free app that allows users to submit-
 
 name, nickname, e-mail addy
 
 app sends a url confirm to e-mail addy.
 upon confirm, the info gets stored in a mysql database with the email
 encrypted.
 
 addresses should only be decryptable with a key that does not need to
 be
 stored on the machine.
 Thanks.
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


__
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards®
http://movies.yahoo.com/

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




RE: [PHP] list(), each()

2002-03-25 Thread Rick Emery

change to:
list( $policy_num, $policy_year, $application_reference ) = explode( --,
$policy ); 


-Original Message-
From: Chris Boget [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 25, 2002 11:22 AM
To: PHP General
Subject: [PHP] list(), each()


Ok, I've got to be doing something wrong here.  I've been
beating my head up against the wall for some time and I 
just cannot figure out what it is.  Before I say it's a bug with
list(), could someone tell me what I'm doing wrong?

?

$policy = 1016726726--1--1016643856;

// problematic
list( $policy_num, $policy_year, $application_reference ) = each( explode(
--, $policy )); 
echo list( $policy_num, $policy_year, $application_reference ) = each(
explode( \--\, $policy )); br\n;

// fine
$policy = explode( --, $policy );
echo $policy[0] . br\n;
echo $policy[1] . br\n;
echo $policy[2] . br\n;

?

Why isn't list() assigning the value properly?  For the first echo
statement, I'm
getting:  

list( 0, 1016726726, ) = each( explode( --, 1016726726--1--1016643856
));

but the others, where I'm echoing out the individual elements, it's working
fine.

What's going on?

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




[PHP] getenv and ISAPI: solution?

2002-03-25 Thread Kai Schaetzl

I transferred an application from Linux/Apache to .NET/IIS6 and it 
appeared to be working fine, first. A bit later I found that it 
wouldn't switch to most functions derived from a GET variable. The 
reason being that $query seems to be empty, so it always defaults to 
this action:

$query = getenv(QUERY_STRING);
if(((!$HTTP_POST_VARS) and (!$query))

Now, checking getenv in the online docs gives a reason for this 
behavior: 

 Note: This function does not work in ISAPI mode.

So, I *can* grab all of the GET variables, but I can't check in 
general if there are any?

Is there a workaround (other than checking for a specific variable)?


Kai

--

Kai Schätzl, Berlin, Germany
Get your web at Conactive Internet Services: http://www.conactive.com
IE-Center: http://ie5.de  http://msie.winware.org




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




RE: [PHP] undefined variable when using if ($var) {}

2002-03-25 Thread Darren Gamble

Good day.

What is this message that you get, that you don't want?

A cursory glance of the code reveals two else statements attached to the
same if statement.  You should address that.


Darren Gamble
Planner, Regional Services
Shaw Cablesystems GP
630 - 3rd Avenue SW
Calgary, Alberta, Canada
T2P 4L4
(403) 781-4948


-Original Message-
From: Martha S [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 25, 2002 9:44 AM
To: [EMAIL PROTECTED]
Subject: [PHP] undefined variable when using if ($var) {}


I'm rather new to PHP, so this should be fairly easy to answer. I checked
the manual and FAQ already.

I'm using the following code, and I get the following message if $id has
nothing in the var (i have it set to a default of  type int, not null in
mysql). Is there a way around this or something I'm missing?

Thanks :)

-- code---

if ($id) {

   $result = mysql_query(SELECT * FROM entries WHERE id=$id,$db);

   $myrow = mysql_fetch_array($result);

   printf(table border=1tr\n);
   printf(trtd%s/td/tr, $myrow[title]);
   printf(trtd%s | , $myrow[id]);
   printf(%s/td/tr, $myrow[posted]);
   printf(trtd%s\n/td/tr, $myrow[post]);
   printf(/tabletr\n);

   printf(a href=\$PHP_SELF\all/a);

   } else {

do {

printf(%s a href=\%s?id=%s\%s/abr\n, $myrow[id], $PHP_SELF,
$myrow[id], $myrow[title], $myrow[post]);

  } while ($myrow = mysql_fetch_array($result));

} else {

  // no records to display

  echo Sorry, no records were found!;

}




-- 
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] Bad Email Addresses

2002-03-25 Thread Steven Walker

Hi,

I have PHP automated emails sent from my website. Does anybody know a 
good way to filter returned mail? What I want to do is extract the bad 
email addresses from returned mail and delete them from my database.

For now I have the return path sent to me, and I manually weed the bad 
ones out, but it's tedious and won't last in the long term.

Thanks,

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


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




[PHP] mimeexplode counterpart in php?

2002-03-25 Thread Jimmy Lantz

Hi!
I wonder if there's such a thing as a counterpart in PHP for MimeExplode in 
PERL?
MimeExplode takes a email and splits the attachments and text so that you 
can save it automatically to a certain dir
by using .forward files.
Or something alike to it in PHP. I've been looking at IMAP functions but 
dont see how it would be possible to do the same thing.
Cheers
Jimmy


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




Re: [PHP] getenv and ISAPI: solution?

2002-03-25 Thread Rasmus Lerdorf

if(count($HTTP_GET_VARS))

On Mon, 25 Mar 2002, Kai Schaetzl wrote:

 I transferred an application from Linux/Apache to .NET/IIS6 and it
 appeared to be working fine, first. A bit later I found that it
 wouldn't switch to most functions derived from a GET variable. The
 reason being that $query seems to be empty, so it always defaults to
 this action:

 $query = getenv(QUERY_STRING);
 if(((!$HTTP_POST_VARS) and (!$query))

 Now, checking getenv in the online docs gives a reason for this
 behavior:

  Note: This function does not work in ISAPI mode.

 So, I *can* grab all of the GET variables, but I can't check in
 general if there are any?

 Is there a workaround (other than checking for a specific variable)?


 Kai

 --

 Kai Schätzl, Berlin, Germany
 Get your web at Conactive Internet Services: http://www.conactive.com
 IE-Center: http://ie5.de  http://msie.winware.org




 --
 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: Login displays the pass and user in url

2002-03-25 Thread Martha S

You have to add an extra tag into the form tag (method=post), it should
read as follows:

(form name=\login\ action=\$PHP_SELF\ method=post

David Orn Johannsson [EMAIL PROTECTED] wrote in message
003001c1d418$7126b3f0$6500640a@gandalf">news:003001c1d418$7126b3f0$6500640a@gandalf...
Can I some how prevent the browser from displayin
index.php?passwd=passuser=user in the url when I use this script I
wrote.

  ?php
if(!IsSet($stage)){
print(form name=\login\
action=\$PHP_SELF\);
print(input type=\hidden\
name=\stage\ value=\1\);
print(table);
print(trtd
class=\maintext\bNotendanafn:/b/tdtdinput
name=\check_username\ type=\text\/td/tr);
print(trtd
class=\maintext\bLykilorð:/b/tdtdinput name=\check_passwd\
type=\password\/td/tr);
print(tdnbsp;/tdtdinput
type=\submit\ value=\Skrá inn\/td/tr);
print(/table);
}
else{

include(db_connect.php);
$query = select id,
passwd, system from users where username = '$check_username';
$mysql_result =
mysql_query($query, $db);
$row =
mysql_fetch_row($mysql_result);

if((crypt($check_passwd,
'dominos') == $row[1])  (($system == 0 || $system == 1 ))){
$sid =
session_id();
$uid =
$row[0];
print(a
href=\news.php\[Fréttir]/abr);
print(a
href=\sms.php\[SMS - Auglýsingar]/abr);
}
else if($session ==
session_id()){
print(a
href=\news.php\[Fréttir]/abr);
print(a
href=\sms.php\[SMS - Auglýsingar]/abr);
}
else{
print(Þú
verður að skrá þig inn. a href=\index.php\[Skrá inn]/a);
}
}
  ?

 http://www.atom.is/ 
Davíð Örn Jóhannssson
Vefforritari

Atómstöðin hf.
Garðastræti 37
101 Reykjavík

sími: 595-3643
fax: 595-3649
 mailto:[EMAIL PROTECTED] [EMAIL PROTECTED]
 http://www.atom.is/ http://www.atom.is






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




Re: [PHP] date (j) not working on Unix - any ideas

2002-03-25 Thread Rasmus Lerdorf

Because 'j' was probably added somewhere in between the two versions...

On Mon, 25 Mar 2002, geoff wrote:

 Any ideas why  date (j)   doesn't  appear to work when I use it on my ISP
 that has a Unix Server, but on my Windows ISP , it works fine ?  The other
 date() functions Y,m,d etc all work fine on both systems.

 (I'm using PHP3 by the way.)

 Any help would be very much appreciated.

 Thanks

 Geoff



 --
 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] Debugging tool

2002-03-25 Thread Morten Nielsen

Hi,
Can anybody tell me if it is possible to use a debugger with PHP? And what
is the name of it?

Regards,
Morten



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




Re: [PHP] GIF support in PHP

2002-03-25 Thread Rasmus Lerdorf

Depends on whether you have GD without GIF enabled already built into your
PHP already.  Check with phpinfo().  If you don't you have build a shared
gd extension against a version of GD that has GD support and add that
dynamically without recompiling PHP.  If you do have GD in there already
you have to recompile PHP.

-Rasmus

On Mon, 25 Mar 2002, Todor Stoyanov wrote:

 Is there a way to add GIF support in PHP without recompiling?
 Just adding as an extension.

 Tanks a lot.



 --
 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] reg-ex

2002-03-25 Thread Rasmus Lerdorf

^[ A-Za-z---]*$

On Mon, 25 Mar 2002, John Fishworld wrote:

 How can I change this to accept spaces as well ?

 (ereg(^[A-Za-zÀ-ÖØ-öø-ÿ]*$, $str))



 --
 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: Debugging tool

2002-03-25 Thread Julio Nobrega Trabalhando

http://www.google.com/search?q=php+debuggersourceid=operanum=0ie=utf-8oe
=utf-8

  Google good! ;-)

--

Julio Nobrega.

Um dia eu chego lá:
http://sourceforge.net/projects/toca

Ajudei? Salvei? Que tal um presentinho?
http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884


Morten Nielsen [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi,
 Can anybody tell me if it is possible to use a debugger with PHP? And what
 is the name of it?

 Regards,
 Morten





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




[PHP] Session Variables

2002-03-25 Thread Chad Gilmer

Hi There,

I am a beginner to PHP and I am tring to use session variables on my site.

I am trying to use Session Variables in PHP on the iPLANIT.tv site

When I use the following code:

?php
 $ses_counter++;

 session_register(ses_counter);

?

I get the following error

Warning: Cannot send session cookie - headers already sent by (output
started at /home/iplanit/public_html/php/login.php:8) in
/home/iplanit/public_html/php/login.php on line 11

Warning: Cannot send session cache limiter - headers already sent (output
started at /home/iplanit/public_html/php/login.php:8) in
/home/iplanit/public_html/php/login.php on line 11

Any Ideas???

Cheers

Chad



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




RE: [PHP] Session Variables

2002-03-25 Thread Rick Emery

it means you've already output some HTML or a blank line


-Original Message-
From: Chad Gilmer [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 25, 2002 12:19 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Session Variables


Hi There,

I am a beginner to PHP and I am tring to use session variables on my site.

I am trying to use Session Variables in PHP on the iPLANIT.tv site

When I use the following code:

?php
 $ses_counter++;

 session_register(ses_counter);

?

I get the following error

Warning: Cannot send session cookie - headers already sent by (output
started at /home/iplanit/public_html/php/login.php:8) in
/home/iplanit/public_html/php/login.php on line 11

Warning: Cannot send session cache limiter - headers already sent (output
started at /home/iplanit/public_html/php/login.php:8) in
/home/iplanit/public_html/php/login.php on line 11

Any Ideas???

Cheers

Chad



-- 
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: [PHP-WIN] How to Pass the Username which from Windows Login

2002-03-25 Thread Vail, Warren

Are you referring to the userid on the machine where your web application
runs (your server) or the userid of the user who connects to your website
with his browser?  I suspect you mean the latter and would be very
interested in how this could be done as well.

Warren Vail
Tools, Metrics  Quality Processes
(415) 667-7814
Pager (877) 774-9891
215 Fremont 02-658


-Original Message-
From: Jack [mailto:[EMAIL PROTECTED]]
Sent: Sunday, March 24, 2002 10:26 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: [PHP-WIN] How to Pass the Username which from Windows Login


Dear all
I want to prevent user to make another login before they can browse the
Intranet, so is there anyway that php can grep the username from the windows
Login or Domain Login?
Which means if a user can login to the Windows NT, then he/she will have the
right to browse the Intranet!

Thx a lot
Jack
[EMAIL PROTECTED]



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

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




[PHP] Regular Expressions? Help!

2002-03-25 Thread Walker, Roy

I am trying to do a match for an expression and it to a variable from the
output of a command: 

?php

$lines = file ($file);
while (list ($line_num, $line) = each ($lines)) {
$trimline = trim ($line);
$output = shell_exec ($prog $cmdline $trimline );
}
?

How can look through $output to set the information returned as different
variables the output would look like:
variable1:some information variable2:some information

I want to set each variable to a string and write it to a file.

Thank You for you help.
Roy


** PLEASE NOTE **
This E-Mail/telefax message and any documents accompanying this transmission
may contain privileged and/or confidential information and is intended
solely for the addressee(s) named above.  If you are not the intended
addressee/recipient, you are hereby notified that any use of, disclosure,
copying, distribution, or reliance on the contents of this E-Mail/telefax
information is strictly prohibited and may result in legal action against
you. Please reply to the sender advising of the error in transmission and
immediately delete/destroy the message and any accompanying documents.
Thank you. 


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




RE: [PHP] Regular Expressions? Help!

2002-03-25 Thread Rick Emery

With there be a specifc number of variables returne?  Or can the number of
variables vary?


-Original Message-
From: Walker, Roy [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 25, 2002 1:26 PM
To: '[EMAIL PROTECTED]'
Subject: [PHP] Regular Expressions? Help!


I am trying to do a match for an expression and it to a variable from the
output of a command: 

?php

$lines = file ($file);
while (list ($line_num, $line) = each ($lines)) {
$trimline = trim ($line);
$output = shell_exec ($prog $cmdline $trimline );
}
?

How can look through $output to set the information returned as different
variables the output would look like:
variable1:some information variable2:some information

I want to set each variable to a string and write it to a file.

Thank You for you help.
Roy


** PLEASE NOTE **
This E-Mail/telefax message and any documents accompanying this transmission
may contain privileged and/or confidential information and is intended
solely for the addressee(s) named above.  If you are not the intended
addressee/recipient, you are hereby notified that any use of, disclosure,
copying, distribution, or reliance on the contents of this E-Mail/telefax
information is strictly prohibited and may result in legal action against
you. Please reply to the sender advising of the error in transmission and
immediately delete/destroy the message and any accompanying documents.
Thank you. 


-- 
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] upload forms, how much was uploaded before upload fails..

2002-03-25 Thread Gerhard Hoogterp

On Sunday 24 March 2002 23:14, Rasmus Lerdorf wrote:
 You'll probably need PHP 4.2 for uploads that big to work well.  Before
 4.2 uploads were buffered in ram, so no, you have no way to recover a
 broken upload.

But what, in that case, is the use or purpose of upload_tmp_dir ?? Moving
from upload - tmpdir - realdir seems to  me like one step to many.. 

Gerhard

-- 
ICQ: 4502226

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




[PHP] Mime type prepeded at file upload

2002-03-25 Thread David McInnis

When I save a file that has been uploaded through PHP it prepends (adds
to the beginning of the file) the mime type.  This renders the file
unusable when it is downloaded as MS Word cannot open the file and tries
to install some kind of converter.

Any ideas for me?

David McInnis


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




[PHP] HTTP_REFERER

2002-03-25 Thread tom hilton

Hi, I am using the $HTTP_REFERER variable to ensure that users of a website
are getting to a certain page through a link from the index.html page, and
not going straight to the page through a bookmark.

$page=$HTTP_REFERER;
if ($page!=http://www.somedomain.com/index.html;)
  {
  echo h3Please log in through the home page/h3br;
  echo META HTTP-EQUIV='Refresh'
CONTENT='1;URL=http://www.somedomain.com/index.html';
  }
 This is working fine for most users, but one user is telling me that even
though she is following the link from the index page, she's still getting
the error message,  and are being bounced back to the index page.  She is
using Internet Explorer 6.0.  Are there any security or privacy settings
that might restrict use of the $HTTP_REFERER variable?  Or is there a better
way to make sure users follow links to pages, rather than bookmarking and
going straight to a page?  Thanks for any help you can give me.



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




[PHP] PHP and Oracle

2002-03-25 Thread Scarbrough, Jeb (ISS Atlanta)

Is it possible to create a transaction the involves multiple pages using PHP
and oracle.  For example, can I log onto oracle using OCIPLogon on one page
named master, insert information, go to the next page named detail, insert
information and commit both transactions at the same time?

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




RE: [PHP] Regular Expressions? Help!

2002-03-25 Thread Walker, Roy

There will be a specific number of variables returned.  I just wanted to set
all the output to a string and just run through it to grab the variables.

Thanx

 -Original Message-
From:   Rick Emery [mailto:[EMAIL PROTECTED]] 
Sent:   Monday, March 25, 2002 1:28 PM
To: 'Walker, Roy'; '[EMAIL PROTECTED]'
Subject:RE: [PHP] Regular Expressions?  Help!

With there be a specifc number of variables returne?  Or can the number of
variables vary?


-Original Message-
From: Walker, Roy [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 25, 2002 1:26 PM
To: '[EMAIL PROTECTED]'
Subject: [PHP] Regular Expressions? Help!


I am trying to do a match for an expression and it to a variable from the
output of a command: 

?php

$lines = file ($file);
while (list ($line_num, $line) = each ($lines)) {
$trimline = trim ($line);
$output = shell_exec ($prog $cmdline $trimline );
}
?

How can look through $output to set the information returned as different
variables the output would look like:
variable1:some information variable2:some information

I want to set each variable to a string and write it to a file.

Thank You for you help.
Roy


** PLEASE NOTE **
This E-Mail/telefax message and any documents accompanying this transmission
may contain privileged and/or confidential information and is intended
solely for the addressee(s) named above.  If you are not the intended
addressee/recipient, you are hereby notified that any use of, disclosure,
copying, distribution, or reliance on the contents of this E-Mail/telefax
information is strictly prohibited and may result in legal action against
you. Please reply to the sender advising of the error in transmission and
immediately delete/destroy the message and any accompanying documents.
Thank you. 


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


** PLEASE NOTE **
This E-Mail/telefax message and any documents accompanying this transmission
may contain privileged and/or confidential information and is intended
solely for the addressee(s) named above.  If you are not the intended
addressee/recipient, you are hereby notified that any use of, disclosure,
copying, distribution, or reliance on the contents of this E-Mail/telefax
information is strictly prohibited and may result in legal action against
you. Please reply to the sender advising of the error in transmission and
immediately delete/destroy the message and any accompanying documents.
Thank you. 


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




RE: [PHP] Regular Expressions? Help!

2002-03-25 Thread Walker, Roy

I just realized why nothing I was trying for the regular expressions wasn't
working.  The command I am running is a C program on the command line of a
Linux box.  I can't capture the output, it just gets output onto the screen.
I just echo'd $output after the command was run and it was empty.  Any
ideas?

 -Original Message-
From:   Rick Emery [mailto:[EMAIL PROTECTED]] 
Sent:   Monday, March 25, 2002 1:54 PM
To: 'Walker, Roy'
Subject:RE: [PHP] Regular Expressions?  Help!

well, ya might try:
$my_array = explode( \ ,$output);

this would set:
$my_vars[0] = variable1:\some text info\
$my_vars[1] = variable2:\some text info\

then, you can do an explode on each of the my_vars

another, which might work:
?php
$output = variable1:\some information\ variable2:\some information\;
ereg( (variable[0-9]*):\(.*)\ (variable[0-9]*):\(.*)\, $output,
$regs);
print output = $output\n;
print $regs[0]. - 0\n;
print $regs[1]. - 1\n;
print $regs[2]. - 2\n;
print $regs[3]. - 3\n;
print $regs[4]. - 4\n;
?

WHEN EXECUTED DISPLAYS THIS:

C:\php -q zz.php\
output = variable1:some information variable2:some information
variable1:some information variable2:some information - 0
variable1 - 1
some information - 2
variable2 - 3
some information - 4

-Original Message-
From: Walker, Roy [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 25, 2002 1:31 PM
To: 'Rick Emery'
Subject: RE: [PHP] Regular Expressions? Help!


There will be a specific number of variables returned.  I just wanted to set
all the output to a string and just run through it to grab the variables.

Thanx

 -Original Message-
From:   Rick Emery [mailto:[EMAIL PROTECTED]] 
Sent:   Monday, March 25, 2002 1:28 PM
To: 'Walker, Roy'; '[EMAIL PROTECTED]'
Subject:RE: [PHP] Regular Expressions?  Help!

With there be a specifc number of variables returne?  Or can the number of
variables vary?


-Original Message-
From: Walker, Roy [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 25, 2002 1:26 PM
To: '[EMAIL PROTECTED]'
Subject: [PHP] Regular Expressions? Help!


I am trying to do a match for an expression and it to a variable from the
output of a command: 

?php

$lines = file ($file);
while (list ($line_num, $line) = each ($lines)) {
$trimline = trim ($line);
$output = shell_exec ($prog $cmdline $trimline );
}
?

How can look through $output to set the information returned as different
variables the output would look like:
variable1:some information variable2:some information

I want to set each variable to a string and write it to a file.

Thank You for you help.
Roy


** PLEASE NOTE **
This E-Mail/telefax message and any documents accompanying this transmission
may contain privileged and/or confidential information and is intended
solely for the addressee(s) named above.  If you are not the intended
addressee/recipient, you are hereby notified that any use of, disclosure,
copying, distribution, or reliance on the contents of this E-Mail/telefax
information is strictly prohibited and may result in legal action against
you. Please reply to the sender advising of the error in transmission and
immediately delete/destroy the message and any accompanying documents.
Thank you. 


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


** PLEASE NOTE **
This E-Mail/telefax message and any documents accompanying this transmission
may contain privileged and/or confidential information and is intended
solely for the addressee(s) named above.  If you are not the intended
addressee/recipient, you are hereby notified that any use of, disclosure,
copying, distribution, or reliance on the contents of this E-Mail/telefax
information is strictly prohibited and may result in legal action against
you. Please reply to the sender advising of the error in transmission and
immediately delete/destroy the message and any accompanying documents.
Thank you. 


** PLEASE NOTE **
This E-Mail/telefax message and any documents accompanying this transmission
may contain privileged and/or confidential information and is intended
solely for the addressee(s) named above.  If you are not the intended
addressee/recipient, you are hereby notified that any use of, disclosure,
copying, distribution, or reliance on the contents of this E-Mail/telefax
information is strictly prohibited and may result in legal action against
you. Please reply to the sender advising of the error in transmission and
immediately delete/destroy the message and any accompanying documents.
Thank you. 


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




Re: [PHP] HTTP_REFERER

2002-03-25 Thread Dan Harrelson

Have you checked that your user is indeed coming from
http://www.somedomain.com/index.html;?  There are lots of other ways
to load your homepage:

http://xxx.xxx.xxx.xxx/index.html; (ip address, not domain)
http://www.somedomain.com/;
http://www.somedomain.com;
http://xxx.xxx.xxx.xxx;
http://xxx.xxx.xxx.xxx/;

You'll have to check for all of them

-Dan


--- tom hilton [EMAIL PROTECTED] wrote:
 Hi, I am using the $HTTP_REFERER variable to ensure that users of a
 website
 are getting to a certain page through a link from the index.html
 page, and
 not going straight to the page through a bookmark.
 
 $page=$HTTP_REFERER;
 if ($page!=http://www.somedomain.com/index.html;)
   {
   echo h3Please log in through the home page/h3br;
   echo META HTTP-EQUIV='Refresh'
 CONTENT='1;URL=http://www.somedomain.com/index.html';
   }
  This is working fine for most users, but one user is telling me that
 even
 though she is following the link from the index page, she's still
 getting
 the error message,  and are being bounced back to the index page. 
 She is
 using Internet Explorer 6.0.  Are there any security or privacy
 settings
 that might restrict use of the $HTTP_REFERER variable?  Or is there a
 better
 way to make sure users follow links to pages, rather than bookmarking
 and
 going straight to a page?  Thanks for any help you can give me.
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


__
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards®
http://movies.yahoo.com/

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




Re: [PHP] HTTP_REFERER

2002-03-25 Thread Erik Price


On Monday, March 25, 2002, at 02:52  PM, tom hilton wrote:

  This is working fine for most users, but one user is telling me that 
 even
 though she is following the link from the index page, she's still 
 getting
 the error message,  and are being bounced back to the index page.  She 
 is
 using Internet Explorer 6.0.  Are there any security or privacy settings
 that might restrict use of the $HTTP_REFERER variable?  Or is there a 
 better
 way to make sure users follow links to pages, rather than bookmarking 
 and
 going straight to a page?  Thanks for any help you can give me.

I'm not sure about Internet Explorer 6's use of HTTP headers, but the 
referer header in the HTTP protocol is not required by any user 
agent.  Legally, IE6 can choose not to send it, and still be in complete 
compliance with HTTP.

There may not be an easy way to do what you want.  One possible solution 
is to make the typical calls itself PHP page and display certain 
content based on certain variables being present, and use POST variables 
so that they do not appear in the URL.  The problem with this is that it 
requires a ton of code to wrap your content in the 'protective' 
index.html layer, and also you would have to use form buttons rather 
than hyperlinks (unless you used post_to_host(), see archives if you're 
not sure what I mean).


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] Regular Expressions? Help!

2002-03-25 Thread Rick Emery

exec()

-Original Message-
From: Walker, Roy [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 25, 2002 2:05 PM
To: '[EMAIL PROTECTED]'
Subject: RE: [PHP] Regular Expressions? Help!


I just realized why nothing I was trying for the regular expressions wasn't
working.  The command I am running is a C program on the command line of a
Linux box.  I can't capture the output, it just gets output onto the screen.
I just echo'd $output after the command was run and it was empty.  Any
ideas?

 -Original Message-
From:   Rick Emery [mailto:[EMAIL PROTECTED]] 
Sent:   Monday, March 25, 2002 1:54 PM
To: 'Walker, Roy'
Subject:RE: [PHP] Regular Expressions?  Help!

well, ya might try:
$my_array = explode( \ ,$output);

this would set:
$my_vars[0] = variable1:\some text info\
$my_vars[1] = variable2:\some text info\

then, you can do an explode on each of the my_vars

another, which might work:
?php
$output = variable1:\some information\ variable2:\some information\;
ereg( (variable[0-9]*):\(.*)\ (variable[0-9]*):\(.*)\, $output,
$regs);
print output = $output\n;
print $regs[0]. - 0\n;
print $regs[1]. - 1\n;
print $regs[2]. - 2\n;
print $regs[3]. - 3\n;
print $regs[4]. - 4\n;
?

WHEN EXECUTED DISPLAYS THIS:

C:\php -q zz.php\
output = variable1:some information variable2:some information
variable1:some information variable2:some information - 0
variable1 - 1
some information - 2
variable2 - 3
some information - 4

-Original Message-
From: Walker, Roy [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 25, 2002 1:31 PM
To: 'Rick Emery'
Subject: RE: [PHP] Regular Expressions? Help!


There will be a specific number of variables returned.  I just wanted to set
all the output to a string and just run through it to grab the variables.

Thanx

 -Original Message-
From:   Rick Emery [mailto:[EMAIL PROTECTED]] 
Sent:   Monday, March 25, 2002 1:28 PM
To: 'Walker, Roy'; '[EMAIL PROTECTED]'
Subject:RE: [PHP] Regular Expressions?  Help!

With there be a specifc number of variables returne?  Or can the number of
variables vary?


-Original Message-
From: Walker, Roy [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 25, 2002 1:26 PM
To: '[EMAIL PROTECTED]'
Subject: [PHP] Regular Expressions? Help!


I am trying to do a match for an expression and it to a variable from the
output of a command: 

?php

$lines = file ($file);
while (list ($line_num, $line) = each ($lines)) {
$trimline = trim ($line);
$output = shell_exec ($prog $cmdline $trimline );
}
?

How can look through $output to set the information returned as different
variables the output would look like:
variable1:some information variable2:some information

I want to set each variable to a string and write it to a file.

Thank You for you help.
Roy


** PLEASE NOTE **
This E-Mail/telefax message and any documents accompanying this transmission
may contain privileged and/or confidential information and is intended
solely for the addressee(s) named above.  If you are not the intended
addressee/recipient, you are hereby notified that any use of, disclosure,
copying, distribution, or reliance on the contents of this E-Mail/telefax
information is strictly prohibited and may result in legal action against
you. Please reply to the sender advising of the error in transmission and
immediately delete/destroy the message and any accompanying documents.
Thank you. 


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


** PLEASE NOTE **
This E-Mail/telefax message and any documents accompanying this transmission
may contain privileged and/or confidential information and is intended
solely for the addressee(s) named above.  If you are not the intended
addressee/recipient, you are hereby notified that any use of, disclosure,
copying, distribution, or reliance on the contents of this E-Mail/telefax
information is strictly prohibited and may result in legal action against
you. Please reply to the sender advising of the error in transmission and
immediately delete/destroy the message and any accompanying documents.
Thank you. 


** PLEASE NOTE **
This E-Mail/telefax message and any documents accompanying this transmission
may contain privileged and/or confidential information and is intended
solely for the addressee(s) named above.  If you are not the intended
addressee/recipient, you are hereby notified that any use of, disclosure,
copying, distribution, or reliance on the contents of this E-Mail/telefax
information is strictly prohibited and may result in legal action against
you. Please reply to the sender advising of the error in transmission and
immediately delete/destroy the message and any accompanying documents.
Thank you. 


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


[PHP] oracle exec

2002-03-25 Thread matthew clay shultz


hi.. is there any way to use the php oracle function to check to see if
there are any records in the selected set before calling ora_fetch?
ora_exec doesn't error if ther are no records, and ora_num_rows doesn't
return the numbe of rows in the set.,

thanks!
matt


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




RE: [PHP] Regular Expressions? Help!

2002-03-25 Thread Walker, Roy

Perhaps it is how I am calling the $lines in a while loop.?  I have tried
`$cmd`, exec(), exec($cmd, $ouput) (to capture the output as an array),
system(), shell_exec().  None of them let me capture the STDOUT from the
program.  There has to be a way to do this.   Anyone?

Thanx

 -Original Message-
From:   Rick Emery [mailto:[EMAIL PROTECTED]] 
Sent:   Monday, March 25, 2002 2:07 PM
To: 'Walker, Roy'; '[EMAIL PROTECTED]'
Subject:RE: [PHP] Regular Expressions?  Help!

exec()

-Original Message-
From: Walker, Roy [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 25, 2002 2:05 PM
To: '[EMAIL PROTECTED]'
Subject: RE: [PHP] Regular Expressions? Help!


I just realized why nothing I was trying for the regular expressions wasn't
working.  The command I am running is a C program on the command line of a
Linux box.  I can't capture the output, it just gets output onto the screen.
I just echo'd $output after the command was run and it was empty.  Any
ideas?

 -Original Message-
From:   Rick Emery [mailto:[EMAIL PROTECTED]] 
Sent:   Monday, March 25, 2002 1:54 PM
To: 'Walker, Roy'
Subject:RE: [PHP] Regular Expressions?  Help!

well, ya might try:
$my_array = explode( \ ,$output);

this would set:
$my_vars[0] = variable1:\some text info\
$my_vars[1] = variable2:\some text info\

then, you can do an explode on each of the my_vars

another, which might work:
?php
$output = variable1:\some information\ variable2:\some information\;
ereg( (variable[0-9]*):\(.*)\ (variable[0-9]*):\(.*)\, $output,
$regs);
print output = $output\n;
print $regs[0]. - 0\n;
print $regs[1]. - 1\n;
print $regs[2]. - 2\n;
print $regs[3]. - 3\n;
print $regs[4]. - 4\n;
?

WHEN EXECUTED DISPLAYS THIS:

C:\php -q zz.php\
output = variable1:some information variable2:some information
variable1:some information variable2:some information - 0
variable1 - 1
some information - 2
variable2 - 3
some information - 4

-Original Message-
From: Walker, Roy [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 25, 2002 1:31 PM
To: 'Rick Emery'
Subject: RE: [PHP] Regular Expressions? Help!


There will be a specific number of variables returned.  I just wanted to set
all the output to a string and just run through it to grab the variables.

Thanx

 -Original Message-
From:   Rick Emery [mailto:[EMAIL PROTECTED]] 
Sent:   Monday, March 25, 2002 1:28 PM
To: 'Walker, Roy'; '[EMAIL PROTECTED]'
Subject:RE: [PHP] Regular Expressions?  Help!

With there be a specifc number of variables returne?  Or can the number of
variables vary?


-Original Message-
From: Walker, Roy [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 25, 2002 1:26 PM
To: '[EMAIL PROTECTED]'
Subject: [PHP] Regular Expressions? Help!


I am trying to do a match for an expression and it to a variable from the
output of a command: 

?php

$lines = file ($file);
while (list ($line_num, $line) = each ($lines)) {
$trimline = trim ($line);
$output = shell_exec ($prog $cmdline $trimline );
}
?

How can look through $output to set the information returned as different
variables the output would look like:
variable1:some information variable2:some information

I want to set each variable to a string and write it to a file.

Thank You for you help.
Roy


** PLEASE NOTE **
This E-Mail/telefax message and any documents accompanying this transmission
may contain privileged and/or confidential information and is intended
solely for the addressee(s) named above.  If you are not the intended
addressee/recipient, you are hereby notified that any use of, disclosure,
copying, distribution, or reliance on the contents of this E-Mail/telefax
information is strictly prohibited and may result in legal action against
you. Please reply to the sender advising of the error in transmission and
immediately delete/destroy the message and any accompanying documents.
Thank you. 


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


** PLEASE NOTE **
This E-Mail/telefax message and any documents accompanying this transmission
may contain privileged and/or confidential information and is intended
solely for the addressee(s) named above.  If you are not the intended
addressee/recipient, you are hereby notified that any use of, disclosure,
copying, distribution, or reliance on the contents of this E-Mail/telefax
information is strictly prohibited and may result in legal action against
you. Please reply to the sender advising of the error in transmission and
immediately delete/destroy the message and any accompanying documents.
Thank you. 


** PLEASE NOTE **
This E-Mail/telefax message and any documents accompanying this transmission
may contain privileged and/or confidential information and is intended
solely for the addressee(s) named above.  If you are not the 

[PHP] New Chat interface on weberdev to the #PHP channel

2002-03-25 Thread Boaz Yahav

Hi
 
One of the ways to get PHP support is from IRC channels that exist for
this purpose (you can see them listed on http://www.php.net).
If you don't have a way to connect to the IRC servers for any reason, or
just prefer a web based client, try the ActiveX client (assuming you are
using IE) 
on  http://www.weberdev.com. The chat is accessed from the left menu.
 
P.S. I suggest you stick to PHP and don't mention the word ActiveX on
that channel since the people there have a VERY
short temper and love to kick others out :), specially if they say words
that are not PHP / UNIX related...
 
Enjoy
 
Sincerely

berber

Visit http://www.weberdev.com/ Today!!!
To see where PHP might take you tomorrow.




RE: [PHP] Regular Expressions? Help!

2002-03-25 Thread Rick Emery

exec() works for me.

Remember, though, it returns only the LAST line.  Have you tried the
following to ensure it's constructing the command you think it is:

$mycmd = $prog $cmdline $trimline ;
print $mycmd;
$output = exec($mycmd);

-Original Message-
From: Walker, Roy [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 25, 2002 2:27 PM
To: 'Rick Emery'; '[EMAIL PROTECTED]'
Subject: RE: [PHP] Regular Expressions? Help!


Perhaps it is how I am calling the $lines in a while loop.?  I have tried
`$cmd`, exec(), exec($cmd, $ouput) (to capture the output as an array),
system(), shell_exec().  None of them let me capture the STDOUT from the
program.  There has to be a way to do this.   Anyone?

Thanx

 -Original Message-
From:   Rick Emery [mailto:[EMAIL PROTECTED]] 
Sent:   Monday, March 25, 2002 2:07 PM
To: 'Walker, Roy'; '[EMAIL PROTECTED]'
Subject:RE: [PHP] Regular Expressions?  Help!

exec()

-Original Message-
From: Walker, Roy [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 25, 2002 2:05 PM
To: '[EMAIL PROTECTED]'
Subject: RE: [PHP] Regular Expressions? Help!


I just realized why nothing I was trying for the regular expressions wasn't
working.  The command I am running is a C program on the command line of a
Linux box.  I can't capture the output, it just gets output onto the screen.
I just echo'd $output after the command was run and it was empty.  Any
ideas?

 -Original Message-
From:   Rick Emery [mailto:[EMAIL PROTECTED]] 
Sent:   Monday, March 25, 2002 1:54 PM
To: 'Walker, Roy'
Subject:RE: [PHP] Regular Expressions?  Help!

well, ya might try:
$my_array = explode( \ ,$output);

this would set:
$my_vars[0] = variable1:\some text info\
$my_vars[1] = variable2:\some text info\

then, you can do an explode on each of the my_vars

another, which might work:
?php
$output = variable1:\some information\ variable2:\some information\;
ereg( (variable[0-9]*):\(.*)\ (variable[0-9]*):\(.*)\, $output,
$regs);
print output = $output\n;
print $regs[0]. - 0\n;
print $regs[1]. - 1\n;
print $regs[2]. - 2\n;
print $regs[3]. - 3\n;
print $regs[4]. - 4\n;
?

WHEN EXECUTED DISPLAYS THIS:

C:\php -q zz.php\
output = variable1:some information variable2:some information
variable1:some information variable2:some information - 0
variable1 - 1
some information - 2
variable2 - 3
some information - 4

-Original Message-
From: Walker, Roy [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 25, 2002 1:31 PM
To: 'Rick Emery'
Subject: RE: [PHP] Regular Expressions? Help!


There will be a specific number of variables returned.  I just wanted to set
all the output to a string and just run through it to grab the variables.

Thanx

 -Original Message-
From:   Rick Emery [mailto:[EMAIL PROTECTED]] 
Sent:   Monday, March 25, 2002 1:28 PM
To: 'Walker, Roy'; '[EMAIL PROTECTED]'
Subject:RE: [PHP] Regular Expressions?  Help!

With there be a specifc number of variables returne?  Or can the number of
variables vary?


-Original Message-
From: Walker, Roy [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 25, 2002 1:26 PM
To: '[EMAIL PROTECTED]'
Subject: [PHP] Regular Expressions? Help!


I am trying to do a match for an expression and it to a variable from the
output of a command: 

?php

$lines = file ($file);
while (list ($line_num, $line) = each ($lines)) {
$trimline = trim ($line);
$output = shell_exec ($prog $cmdline $trimline );
}
?

How can look through $output to set the information returned as different
variables the output would look like:
variable1:some information variable2:some information

I want to set each variable to a string and write it to a file.

Thank You for you help.
Roy


** PLEASE NOTE **
This E-Mail/telefax message and any documents accompanying this transmission
may contain privileged and/or confidential information and is intended
solely for the addressee(s) named above.  If you are not the intended
addressee/recipient, you are hereby notified that any use of, disclosure,
copying, distribution, or reliance on the contents of this E-Mail/telefax
information is strictly prohibited and may result in legal action against
you. Please reply to the sender advising of the error in transmission and
immediately delete/destroy the message and any accompanying documents.
Thank you. 


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


** PLEASE NOTE **
This E-Mail/telefax message and any documents accompanying this transmission
may contain privileged and/or confidential information and is intended
solely for the addressee(s) named above.  If you are not the intended
addressee/recipient, you are hereby notified that any use of, disclosure,
copying, distribution, or reliance on the contents of this E-Mail/telefax
information is strictly prohibited and may result in legal action against
you. 

RE: [PHP] Regular Expressions? Help!

2002-03-25 Thread Walker, Roy

The cmd is running running correctly as I see the output on the screen (this
is being run from a command line).  The command output is seen on the screen
and nothing gets set to $output.

 -Original Message-
From:   Rick Emery [mailto:[EMAIL PROTECTED]] 
Sent:   Monday, March 25, 2002 2:50 PM
To: 'Walker, Roy'; '[EMAIL PROTECTED]'
Subject:RE: [PHP] Regular Expressions?  Help!

exec() works for me.

Remember, though, it returns only the LAST line.  Have you tried the
following to ensure it's constructing the command you think it is:

$mycmd = $prog $cmdline $trimline ;
print $mycmd;
$output = exec($mycmd);

-Original Message-
From: Walker, Roy [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 25, 2002 2:27 PM
To: 'Rick Emery'; '[EMAIL PROTECTED]'
Subject: RE: [PHP] Regular Expressions? Help!


Perhaps it is how I am calling the $lines in a while loop.?  I have tried
`$cmd`, exec(), exec($cmd, $ouput) (to capture the output as an array),
system(), shell_exec().  None of them let me capture the STDOUT from the
program.  There has to be a way to do this.   Anyone?

Thanx

 -Original Message-
From:   Rick Emery [mailto:[EMAIL PROTECTED]] 
Sent:   Monday, March 25, 2002 2:07 PM
To: 'Walker, Roy'; '[EMAIL PROTECTED]'
Subject:RE: [PHP] Regular Expressions?  Help!

exec()

-Original Message-
From: Walker, Roy [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 25, 2002 2:05 PM
To: '[EMAIL PROTECTED]'
Subject: RE: [PHP] Regular Expressions? Help!


I just realized why nothing I was trying for the regular expressions wasn't
working.  The command I am running is a C program on the command line of a
Linux box.  I can't capture the output, it just gets output onto the screen.
I just echo'd $output after the command was run and it was empty.  Any
ideas?

 -Original Message-
From:   Rick Emery [mailto:[EMAIL PROTECTED]] 
Sent:   Monday, March 25, 2002 1:54 PM
To: 'Walker, Roy'
Subject:RE: [PHP] Regular Expressions?  Help!

well, ya might try:
$my_array = explode( \ ,$output);

this would set:
$my_vars[0] = variable1:\some text info\
$my_vars[1] = variable2:\some text info\

then, you can do an explode on each of the my_vars

another, which might work:
?php
$output = variable1:\some information\ variable2:\some information\;
ereg( (variable[0-9]*):\(.*)\ (variable[0-9]*):\(.*)\, $output,
$regs);
print output = $output\n;
print $regs[0]. - 0\n;
print $regs[1]. - 1\n;
print $regs[2]. - 2\n;
print $regs[3]. - 3\n;
print $regs[4]. - 4\n;
?

WHEN EXECUTED DISPLAYS THIS:

C:\php -q zz.php\
output = variable1:some information variable2:some information
variable1:some information variable2:some information - 0
variable1 - 1
some information - 2
variable2 - 3
some information - 4

-Original Message-
From: Walker, Roy [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 25, 2002 1:31 PM
To: 'Rick Emery'
Subject: RE: [PHP] Regular Expressions? Help!


There will be a specific number of variables returned.  I just wanted to set
all the output to a string and just run through it to grab the variables.

Thanx

 -Original Message-
From:   Rick Emery [mailto:[EMAIL PROTECTED]] 
Sent:   Monday, March 25, 2002 1:28 PM
To: 'Walker, Roy'; '[EMAIL PROTECTED]'
Subject:RE: [PHP] Regular Expressions?  Help!

With there be a specifc number of variables returne?  Or can the number of
variables vary?


-Original Message-
From: Walker, Roy [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 25, 2002 1:26 PM
To: '[EMAIL PROTECTED]'
Subject: [PHP] Regular Expressions? Help!


I am trying to do a match for an expression and it to a variable from the
output of a command: 

?php

$lines = file ($file);
while (list ($line_num, $line) = each ($lines)) {
$trimline = trim ($line);
$output = shell_exec ($prog $cmdline $trimline );
}
?

How can look through $output to set the information returned as different
variables the output would look like:
variable1:some information variable2:some information

I want to set each variable to a string and write it to a file.

Thank You for you help.
Roy


** PLEASE NOTE **
This E-Mail/telefax message and any documents accompanying this transmission
may contain privileged and/or confidential information and is intended
solely for the addressee(s) named above.  If you are not the intended
addressee/recipient, you are hereby notified that any use of, disclosure,
copying, distribution, or reliance on the contents of this E-Mail/telefax
information is strictly prohibited and may result in legal action against
you. Please reply to the sender advising of the error in transmission and
immediately delete/destroy the message and any accompanying documents.
Thank you. 


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


** PLEASE NOTE **
This E-Mail/telefax message and any documents 

[PHP] Program control question

2002-03-25 Thread Brad Harriger

I'm trying to debug a program written by someone else.  There are two 
files that I'm having problems with.  File A uses require_once to call 
file B.  Near the beginning of File B is a Header(Location:) that 
calls  File A.  Can anyone tell me if the part of file B that comes 
after the Header(Location:) is ever read by File A?

Thanks in advance,

Brad


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




Re[2]: [PHP] [newbie] Something is messed up, anybody can help?

2002-03-25 Thread Mantas Kriauciunas

Hey PHP General List,

Well thanks for helping but still i get nothing and i have no idea
why. I changed the line as you said to:

if( $session[logged]==1 )
{
  draw_admin_menu($uzeriz);
}

and took out that while.
It shows the box but the $uzeriz that i pass doesn't show up :/

maybe anybody see more mistakes?

:

Got your email on:Monday, March 25, 2002, 5:45:49 AM writing:

:
RE 1.  Just pass uzeriz to the function, not session(uzeriz);

RE 2.  FYI: you don't need this construct:  while($row =
RE mysql_fetch_row($result)){
RE Based upon the previous tests, there is ONLY 1 entry.  Therefore, go with:
RE $row = mysql_fetch_row($result);


RE -Original Message-
RE From: Mantas Kriauciunas [mailto:[EMAIL PROTECTED]]
RE Sent: Monday, March 25, 2002 6:39 AM
RE To: PHP General List
RE Subject: [PHP] [newbie] Something is messed up, anybody can help?


RE Hey PHP General List,

RE Intro:
RE I am creating small login script and few things doesn't work right.
RE Code is hare:

RE admin.php

RE if(isset($subm_login))
RE {
RE $session[logged]=0;
RE $session[uzeriz]=;
RE $result = mysql_query(select * from uzer where user='$uzr_name' and
RE pass='$uzr_passwd');
RE  if(!$result)   {
RE  echo This error should not be hare. But it sayes that it
RE could not search for your user;
RE  } else {
RE   if(mysql_num_rows($result)!=1) {
REecho Login Not Found;
RE } else {
RE   while($row = mysql_fetch_row($result)){
RE   $session[uzeriz]=$row[user];
RE   $session[logged]=1;
RE   $session[pass]=$row[pass];
RE   }
RE }
RE  }
RE  session_register(session);
RE }

RE if( $session[logged]==1 )
RE {
RE   draw_admin_menu($session[uzeriz]);
RE }
RE if( $session[logged]==0 )
RE {
RE draw_login_box();
RE }

RE --
RE adm_func.php (this file is included in admin.php)

RE function draw_admin_menu($uzer)
RE {
RE global $session;
RE echo pUser Logged In/p\n;
RE echo p--/p\n;
RE echo p$uzer/P\n;
RE }

RE --

RE Problem:
RE the problem is that i cant see $uzer its empty. nothing is
RE therewhat i am doing wrong? all table names and everything is
RE correct but i get empty thing.

RE If that is dumb question im sorry :) i am kinda new in this :)

RE :--:
RE Have A Nice Day! 
RE  Mantas Kriauciunas A.k.A mNTKz

RE Contacts:
RE [EMAIL PROTECTED]
RE Http://mntkz-hata.visiems.lt



:--:
Have A Nice Day! 
 Mantas Kriauciunas A.k.A mNTKz

Contacts:
[EMAIL PROTECTED]
Http://mntkz-hata.visiems.lt



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




RE: [PHP] Regular Expressions? Help!

2002-03-25 Thread Rick Emery

Again, I ask:

Does $mycmd contain the command you expect to see
$mycmd = $prog $cmdline $trimline ;
print $mycmd;
$output = exec($mycmd);


-Original Message-
From: Walker, Roy [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 25, 2002 2:56 PM
To: 'Rick Emery'; '[EMAIL PROTECTED]'
Subject: RE: [PHP] Regular Expressions? Help!


The cmd is running running correctly as I see the output on the screen (this
is being run from a command line).  The command output is seen on the screen
and nothing gets set to $output.

 -Original Message-
From:   Rick Emery [mailto:[EMAIL PROTECTED]] 
Sent:   Monday, March 25, 2002 2:50 PM
To: 'Walker, Roy'; '[EMAIL PROTECTED]'
Subject:RE: [PHP] Regular Expressions?  Help!

exec() works for me.

Remember, though, it returns only the LAST line.  Have you tried the
following to ensure it's constructing the command you think it is:

$mycmd = $prog $cmdline $trimline ;
print $mycmd;
$output = exec($mycmd);

-Original Message-
From: Walker, Roy [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 25, 2002 2:27 PM
To: 'Rick Emery'; '[EMAIL PROTECTED]'
Subject: RE: [PHP] Regular Expressions? Help!


Perhaps it is how I am calling the $lines in a while loop.?  I have tried
`$cmd`, exec(), exec($cmd, $ouput) (to capture the output as an array),
system(), shell_exec().  None of them let me capture the STDOUT from the
program.  There has to be a way to do this.   Anyone?

Thanx

 -Original Message-
From:   Rick Emery [mailto:[EMAIL PROTECTED]] 
Sent:   Monday, March 25, 2002 2:07 PM
To: 'Walker, Roy'; '[EMAIL PROTECTED]'
Subject:RE: [PHP] Regular Expressions?  Help!

exec()

-Original Message-
From: Walker, Roy [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 25, 2002 2:05 PM
To: '[EMAIL PROTECTED]'
Subject: RE: [PHP] Regular Expressions? Help!


I just realized why nothing I was trying for the regular expressions wasn't
working.  The command I am running is a C program on the command line of a
Linux box.  I can't capture the output, it just gets output onto the screen.
I just echo'd $output after the command was run and it was empty.  Any
ideas?

 -Original Message-
From:   Rick Emery [mailto:[EMAIL PROTECTED]] 
Sent:   Monday, March 25, 2002 1:54 PM
To: 'Walker, Roy'
Subject:RE: [PHP] Regular Expressions?  Help!

well, ya might try:
$my_array = explode( \ ,$output);

this would set:
$my_vars[0] = variable1:\some text info\
$my_vars[1] = variable2:\some text info\

then, you can do an explode on each of the my_vars

another, which might work:
?php
$output = variable1:\some information\ variable2:\some information\;
ereg( (variable[0-9]*):\(.*)\ (variable[0-9]*):\(.*)\, $output,
$regs);
print output = $output\n;
print $regs[0]. - 0\n;
print $regs[1]. - 1\n;
print $regs[2]. - 2\n;
print $regs[3]. - 3\n;
print $regs[4]. - 4\n;
?

WHEN EXECUTED DISPLAYS THIS:

C:\php -q zz.php\
output = variable1:some information variable2:some information
variable1:some information variable2:some information - 0
variable1 - 1
some information - 2
variable2 - 3
some information - 4

-Original Message-
From: Walker, Roy [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 25, 2002 1:31 PM
To: 'Rick Emery'
Subject: RE: [PHP] Regular Expressions? Help!


There will be a specific number of variables returned.  I just wanted to set
all the output to a string and just run through it to grab the variables.

Thanx

 -Original Message-
From:   Rick Emery [mailto:[EMAIL PROTECTED]] 
Sent:   Monday, March 25, 2002 1:28 PM
To: 'Walker, Roy'; '[EMAIL PROTECTED]'
Subject:RE: [PHP] Regular Expressions?  Help!

With there be a specifc number of variables returne?  Or can the number of
variables vary?


-Original Message-
From: Walker, Roy [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 25, 2002 1:26 PM
To: '[EMAIL PROTECTED]'
Subject: [PHP] Regular Expressions? Help!


I am trying to do a match for an expression and it to a variable from the
output of a command: 

?php

$lines = file ($file);
while (list ($line_num, $line) = each ($lines)) {
$trimline = trim ($line);
$output = shell_exec ($prog $cmdline $trimline );
}
?

How can look through $output to set the information returned as different
variables the output would look like:
variable1:some information variable2:some information

I want to set each variable to a string and write it to a file.

Thank You for you help.
Roy


** PLEASE NOTE **
This E-Mail/telefax message and any documents accompanying this transmission
may contain privileged and/or confidential information and is intended
solely for the addressee(s) named above.  If you are not the intended
addressee/recipient, you are hereby notified that any use of, disclosure,
copying, distribution, or reliance on the contents of this E-Mail/telefax
information is strictly prohibited and may result in legal action against
you. Please reply to the sender 

RE: [PHP] Regular Expressions? Help!

2002-03-25 Thread Walker, Roy

Sorry.  Yes. It looks exactly like it should.  And I see the ouput from the
command like it should on the screen, I just can't capture it in the script.

 -Original Message-
From:   Rick Emery [mailto:[EMAIL PROTECTED]] 
Sent:   Monday, March 25, 2002 2:59 PM
To: 'Walker, Roy'; '[EMAIL PROTECTED]'
Subject:RE: [PHP] Regular Expressions?  Help!

Again, I ask:

Does $mycmd contain the command you expect to see
$mycmd = $prog $cmdline $trimline ;
print $mycmd;
$output = exec($mycmd);


-Original Message-
From: Walker, Roy [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 25, 2002 2:56 PM
To: 'Rick Emery'; '[EMAIL PROTECTED]'
Subject: RE: [PHP] Regular Expressions? Help!


The cmd is running running correctly as I see the output on the screen (this
is being run from a command line).  The command output is seen on the screen
and nothing gets set to $output.

 -Original Message-
From:   Rick Emery [mailto:[EMAIL PROTECTED]] 
Sent:   Monday, March 25, 2002 2:50 PM
To: 'Walker, Roy'; '[EMAIL PROTECTED]'
Subject:RE: [PHP] Regular Expressions?  Help!

exec() works for me.

Remember, though, it returns only the LAST line.  Have you tried the
following to ensure it's constructing the command you think it is:

$mycmd = $prog $cmdline $trimline ;
print $mycmd;
$output = exec($mycmd);

-Original Message-
From: Walker, Roy [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 25, 2002 2:27 PM
To: 'Rick Emery'; '[EMAIL PROTECTED]'
Subject: RE: [PHP] Regular Expressions? Help!


Perhaps it is how I am calling the $lines in a while loop.?  I have tried
`$cmd`, exec(), exec($cmd, $ouput) (to capture the output as an array),
system(), shell_exec().  None of them let me capture the STDOUT from the
program.  There has to be a way to do this.   Anyone?

Thanx

 -Original Message-
From:   Rick Emery [mailto:[EMAIL PROTECTED]] 
Sent:   Monday, March 25, 2002 2:07 PM
To: 'Walker, Roy'; '[EMAIL PROTECTED]'
Subject:RE: [PHP] Regular Expressions?  Help!

exec()

-Original Message-
From: Walker, Roy [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 25, 2002 2:05 PM
To: '[EMAIL PROTECTED]'
Subject: RE: [PHP] Regular Expressions? Help!


I just realized why nothing I was trying for the regular expressions wasn't
working.  The command I am running is a C program on the command line of a
Linux box.  I can't capture the output, it just gets output onto the screen.
I just echo'd $output after the command was run and it was empty.  Any
ideas?

 -Original Message-
From:   Rick Emery [mailto:[EMAIL PROTECTED]] 
Sent:   Monday, March 25, 2002 1:54 PM
To: 'Walker, Roy'
Subject:RE: [PHP] Regular Expressions?  Help!

well, ya might try:
$my_array = explode( \ ,$output);

this would set:
$my_vars[0] = variable1:\some text info\
$my_vars[1] = variable2:\some text info\

then, you can do an explode on each of the my_vars

another, which might work:
?php
$output = variable1:\some information\ variable2:\some information\;
ereg( (variable[0-9]*):\(.*)\ (variable[0-9]*):\(.*)\, $output,
$regs);
print output = $output\n;
print $regs[0]. - 0\n;
print $regs[1]. - 1\n;
print $regs[2]. - 2\n;
print $regs[3]. - 3\n;
print $regs[4]. - 4\n;
?

WHEN EXECUTED DISPLAYS THIS:

C:\php -q zz.php\
output = variable1:some information variable2:some information
variable1:some information variable2:some information - 0
variable1 - 1
some information - 2
variable2 - 3
some information - 4

-Original Message-
From: Walker, Roy [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 25, 2002 1:31 PM
To: 'Rick Emery'
Subject: RE: [PHP] Regular Expressions? Help!


There will be a specific number of variables returned.  I just wanted to set
all the output to a string and just run through it to grab the variables.

Thanx

 -Original Message-
From:   Rick Emery [mailto:[EMAIL PROTECTED]] 
Sent:   Monday, March 25, 2002 1:28 PM
To: 'Walker, Roy'; '[EMAIL PROTECTED]'
Subject:RE: [PHP] Regular Expressions?  Help!

With there be a specifc number of variables returne?  Or can the number of
variables vary?


-Original Message-
From: Walker, Roy [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 25, 2002 1:26 PM
To: '[EMAIL PROTECTED]'
Subject: [PHP] Regular Expressions? Help!


I am trying to do a match for an expression and it to a variable from the
output of a command: 

?php

$lines = file ($file);
while (list ($line_num, $line) = each ($lines)) {
$trimline = trim ($line);
$output = shell_exec ($prog $cmdline $trimline );
}
?

How can look through $output to set the information returned as different
variables the output would look like:
variable1:some information variable2:some information

I want to set each variable to a string and write it to a file.

Thank You for you help.
Roy


** PLEASE NOTE **
This E-Mail/telefax message and any documents accompanying this transmission
may contain privileged and/or 

Re: [PHP] oracle exec

2002-03-25 Thread heinisch

At 25.03.2002  15:10, you wrote:


hi.. is there any way to use the php oracle function to check to see if
there are any records in the selected set before calling ora_fetch?
ora_exec doesn't error if ther are no records, and ora_num_rows doesn't
return the numbe of rows in the set.,

thanks!
matt
Seems that there´s no short way,
just have a 'select count(your_id_col) from footable where ...'
This will bring the number of records.
As a tip, use this var to get your results in an for() statement,
as there is no way tho catch errors if you use while(..).
(OCI functions, PHP3)

HTH Oliver


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




  1   2   >