Re: [PHP] Text editor for linux

2002-02-18 Thread Billy S Halsey

I used to use JEdit and Nedit -- both were satisfactory, but recently 
I've become a nut for GVim (or Vim if you're only only on a tty). If 
you'd like, I can send you my .vimrc file, which sets things up very 
nicely the way I like them.

-bsh :-)

Josep Raurell wrote:

Quoting Torkil Johnsen [EMAIL PROTECTED]:

Anyone know of a good text editor for linux, WITH syntax highlighting for
php/html + other languages?

- TOrkil


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



jedit

www.jedit.org


-- 

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




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




[PHP] implement yourname.mysite.com redirection

2002-02-18 Thread Adrian Murphy

Hi,
I'd like to implement a system whereby people have a subdomain on my site like so:
yourname.mysite.com
I've been reading the apache docs that say you can do this via virtual hosts.
Can I do it so 'yourname' can be anything - where all requests are sent
to the same page where i can parse the uri and query a db based on 'yourname'.
any reason why my isp might be reluctant to do this.I'm presuming I can't
do it via .htaccess?
as a side note what are the affects of this kind of redirection as far as search 
engines
go.I've heard that doing this kind of thing on a 404 page is a bad idea.



[PHP] upload problem...

2002-02-18 Thread Cristiano Canobbio

hi my name is Cristiano and I've a question:

why the function is_uploaded_file return 1?

my example file is index.php

thanks

?php
 function carica() {
 global $userfile;
 echo brFUNZIONE is_uploaded_file (è un boolean 0 - vero, 1 - falso)--
.is_uploaded_file ($userfile);
}

echo 
.form action=\index.php?op=carica\ method=\post\ 
.enctype=\multipart/form-data\
.input type=\hidden\ name=\MAX_FILE_SIZE\ value=\200\
.File: input name=\userfile\ type=\file\
;

echo 
.input type=\submit\ value=\invia\ name=\B1\
./form

.a href=index.phpclear form/a
;
?



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




[PHP] Q on php://stdin

2002-02-18 Thread Billy S Halsey

Hi all,

I've been trying for the last three hours to do something like this:

#!/usr/local/bin/php -q
?php
$fp = fopen(php://stdin, r);
while (!feof($fp)) {
$line = fgets($fp, 4096);
print $line;
}
fclose($fp);
?

And then calling it with something like:

cat foo.txt | ./echofile.php

The problem is, it will print the first line of foo.txt, and then exit. 
No matter what I do, I can't get it to read the next line. I've even 
added a test after the print command to see if it's at EOF, and it's 
not. I've also changed it to do this:

while (($buf = fgets($fp, 4096)) != FALSE) {
print $buf;
}

Still won't read more than one line of the file. The only thing I've 
been able to do that seems to work is this:

$fp = fopen(/dev/fd/0, r);
while (!feof($fp)) ..

[The code snippets I've quoted above are just rough sketches ... I 
really am checking the return value from fopen() to make sure I open the 
file, etc.]

I'm using PHP 4.1.1 on Solaris 8. Can somebody PLEASE tell me what the 
problem is? What stupid mistake am I making?

Thanks.

-bsh :-)

-- 

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



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




RE: [PHP] form submission error trapping

2002-02-18 Thread Jill . Baker

Here's what I did.

$error = ;
if (error_in_field_1) $error .= A;
if (error_in_field_2) $error .= B;
if (error_in_field_3) $error .= C;

and so on. Then, when displaying the form...

if (strstr($error,A)) { echo You forgot to fill in this fieldbr\n; }
echo input type=\text\ name=\Whatever\ value=\$whatever\;

etc.


 -Original Message-
 From: Jason Dulberg [SMTP:[EMAIL PROTECTED]]
 Sent: Sunday, February 17, 2002 23:40
 To:   Martin Towell
 Cc:   [EMAIL PROTECTED]
 Subject:  RE: [PHP] form submission error trapping
 
 RE: [PHP] form submission error trappingThanks for the code Is there a
 way to keep track of what fields had the errors as its possible for people
 to have like 5 errors?
 
 

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




[PHP] Sendmail, I've had enough of it!

2002-02-18 Thread Liam MacKenzie

ARGH!!!

I'm seriously sick of this!  I've spent days on end reading 
documentation, trying settings, seeking help, and it still 
won't bloody work!  So I've taken the ultimate step, and 
applied the trusty rm -rf command to everything that has 
to do with sendmail!

In other words, sendmail is no longer on my systems.  
Screw it, causes more bad than good!  

Ok, now surprisingly enough I do have a final question 
regarding PHP/Mail (And I mean final!)

How can I get PHP to send mail through a local SMTP
server?

I'm running Linux RedHat 7.1, latest Apache and PHP.
I have eXtremail installed locally.  It's a POP3/SMTP 
server.  Works fine - fact.

There's 3 configuration options in php.ini that I've been 
playing with, no matter what the combination is, I don't 
really see it doing anything different.

I've read everything relevant on php.net and still can't
find anything.  I'm sorry if this is a really stupid question.

Thanks s much for all your help!

Liam



[PHP] no-cache headers

2002-02-18 Thread Phil Ewington

Hi,

I am new to PHP and am having problems with no-cache headers, I have the
following code added as the first line of code in the page...

?
header(Expires: Mon, 01 Jan 1997 00:00:00 GMT);
header(Cache-Control: no-store, no-cache, must-revalidate);
header(Pragma: no-cache);
?

A combination of no-cache headers usually does the trick, well in ColdFusion
anyway :o), yet this code still shows the wrong images after an upload until
a refresh of the browser is performed. Have I done something wrong or are
headers not very reliable in PHP?

TIA

---
Phil Ewington - Technical Director
---
43 PLC
35 Broad Street, Wokingham
Berkshire RG40 1AU
---
T: +44 (0)118 978 9500
F: +44 (0)118 978 4994
W: http://www.43plc.com
---


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




[PHP] creating PDF. How to get the xpositioni of a text?

2002-02-18 Thread Andy

Hi there,

I would like to create a pdf file and place a heading in the center of the
page.
pdf_get_value should do the job, but it does not work out. Does anybody know
how to get
this thing working?

Thanx for help

ANdy

Code:

pdf_set_font($dokument, Times-Roman, 35, winansi);
$heading_width = pdf_get_value($dokument,textx, $country[0]);
#echo $heading_width.'test';
pdf_show_xy($dokument,$country[0], ($page_height - $heading_widht) /2 ,
700);



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




RE: [PHP] What Do You Think?

2002-02-18 Thread Ford, Mike [LSS]

 -Original Message-
 From: Erik Price [mailto:[EMAIL PROTECTED]]
 Sent: 15 February 2002 19:52
 
 Not only can I hardly find a place with Tetley's on tap, I can hardly 
 find it in stores!
 
 LOVE Tetley's.

Er -- should I mention here that I live and work within walking distance of the Tetley 
brewery?  And that I have often drunk in the closest pub to it (about 50 yards away!)?

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning  Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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




Re: [PHP] no-cache headers

2002-02-18 Thread Matt

- Original Message -
From: Phil Ewington [EMAIL PROTECTED]

 I am new to PHP and am having problems with no-cache headers, I have the
 following code added as the first line of code in the page...

 ?
 header(Expires: Mon, 01 Jan 1997 00:00:00 GMT);
 header(Cache-Control: no-store, no-cache, must-revalidate);
 header(Pragma: no-cache);
 ?

 A combination of no-cache headers usually does the trick, well in
ColdFusion
 anyway :o), yet this code still shows the wrong images after an upload
until
 a refresh of the browser is performed. Have I done something wrong or are
 headers not very reliable in PHP?


Those are fine.  I also add:
meta content=no-cache
meta http-equiv=pragma content=no-cache
meta http-equiv=Expires content=Mon, 06 Jan 1990 00:00:01 GMT

If you just added the cache control, then have you cleared the browser
cache?  Once the page is cached, the browser will return it regardless of
the cache-control.



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




[PHP] convert TIFF to JPEG

2002-02-18 Thread Norbert Eder

hi everybody!

is there a chance to convert a tiff group 4 image to an jpeg-images
via php? i haven't found anything.. so maybe you know something that way..

greets



Norbert Eder
Open.IT Informationsmanagement GmbH  CoKG
Styria Medien AG
Schönaugasse 64
A-8010 Graz
Tel.: +43 (316) 875 3945
Fax.: +43 (316) 875 3094
Mail: [EMAIL PROTECTED]
Web : http://www.open-it.at



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




[PHP] preg_match vs ereg etc

2002-02-18 Thread DigitalKoala

hi folks,

I was just wondering what your opinions were on using preg_match, preg_split
instead of ereg and explode?

I have to write a  script to parse a lot of html and text files.. and I'm
looking to use the fastest possible functions to do this...

Many thanks for all your input!

dk



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




Re: [PHP] form submission error trapping

2002-02-18 Thread Matt

I think that mixing of html and php is too complex and leads to hard to
maintain scripts. I find it extremely difficult to understand a scripts
logic when it's spread out over hundreds of lines of php/html.

I use EasyTemplates that came in Web Applications Development with PHP 4.0
by Tobias Ratschiller and Till Gerkin. It looks like the source is
copyrighted and you have to buy the book to get it.  But it says it's based
on FastTemplates.  The book itself is at
http://www.amazon.com/exec/obidos/ASIN/0735709971/

You can see a sample of the method here
http://marc.theaimsgroup.com/?l=php-generalm=101371611609042w=2

Notice that the form action handler is the same as the original form. This
is a simple example, but it does remember user input as you want.

I wrote a couple of helper functions that accept db names to build select
boxes and radio buttons.  They return strings of the html with the selected
value, and I just put them in a template container reserved for them (the
{TEMPLATE_ITEM} in the sample).

For tables with unknown number of rows, I have one template of the main
page, one for the table container, and one for each row itself.  I loop on
the row, using the row template and concatenate all of the rows of html into
a string.  I take that string and stick it into the table template, and
finally stick the table into the page template.  Very smooth, easy to read,
and no trouble with headers() since all output is done on the last
statement.  You have complete control over the script until then, and can
bail out to another page, or decide to use other templates and output
something else.

As for errors, I build an array of the messages such as:
if (!empty($thatsThere)) {
   $errors[] = Don't put $thatsThere in  there;
}
if (empty($userName)) {
  $errors[] = Username must be supplied;
}

Then you can tell if all is okay, with if (is_array($errors)).  If it is an
array, then something is wrong, so I  append the array contests into html
like this:
foreach($errors as $value) {
 $errorMsgs = $value . br\n;
}
and then put $errorMsgs into the page template container you've reserved for
it.

- Original Message -
From: Jason Dulberg [EMAIL PROTECTED]
To: [EMAIL PROTECTED]

 I am working on some error trapping for several forms on my site. After
 visiting a bunch of websites, I've noticed 2 common methods of displaying
 error messages.

 1. display an error box on a new page and force the user to hit the back
 button

 2. display the form again with appropriate error text and pre-filled
fields.

 I have part of the error on the new page working but I'm running into the
 infamous no contents in the form after going back.

 There are some useability issues with forcing the user to hit the back
 button -- some just don't want to bother.

 Is there a way to display the form w/original contents and error messages
 'without' having to code the entire form twice? I have about 5 forms with
50
 fields or so each.

 What would be the best way to go about redrawing the form with the errors
 shown beside each field?

 Any suggestions are greatly appreciated.



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




[PHP] Using Variable Variables from form values inside a function

2002-02-18 Thread Ron Dyck

Is it possible to use variable variables from form values inside a function.

For example when submitting form values,  this works fine:

foreach($_POST as $key=$value) {

if (empty($$key)) {
print empty value $keybr;
}

}

but, this doesn't:

function myFunction() {
 foreach($_POST as $key=$value) {

 if (empty($$key)) {
 print empty value $keybr;
 }

 }
}

Anyone dealt with this?

===
  Ron Dyck
  WebbTech
  www.webbtech.net
  [EMAIL PROTECTED]
  905 734-1164


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




Re: [PHP] Using Variable Variables from form values inside a function

2002-02-18 Thread Matt


- Original Message -
From: Ron Dyck [EMAIL PROTECTED]

 but, this doesn't:

 function myFunction() {
  foreach($_POST as $key=$value) {

  if (empty($$key)) {
  print empty value $keybr;
  }

  }
 }

Since php variable scope is local unless you define it global, that won't
work that way.  You might try (just guessing here):
 function myFunction() {
   foreach($_POST as $key=$value) {
   global $$key;
   if (empty($$key)) {
  print empty value $keybr;
  }
   }
 }



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




Re: [PHP] Using Variable Variables from form values inside a function

2002-02-18 Thread Ron Dyck

  but, this doesn't:
 
  function myFunction() {
   foreach($_POST as $key=$value) {
 
   if (empty($$key)) {
   print empty value $keybr;
   }
 
   }
  }

 Since php variable scope is local unless you define it global, that won't
 work that way.  You might try (just guessing here):
  function myFunction() {
foreach($_POST as $key=$value) {
global $$key;
if (empty($$key)) {
   print empty value $keybr;
   }
}
  }

That did it.
I assumed that since $_POST was global, the key/value pair would be. Guess
not :-|

Thanks!

ron


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




Re: [PHP] implement yourname.mysite.com redirection

2002-02-18 Thread Jason G.

Hi, Look into mod_rewrite with Apache.

We use it to capture www.univo.biz/yourname and display a page about you.

However, my experience is very limited.  I would imagine you could figure 
it out though.

-Jason Garber
IonZOft.com


At 09:47 AM 2/18/2002 +, Adrian Murphy wrote:
Hi,
I'd like to implement a system whereby people have a subdomain on my site 
like so:
yourname.mysite.com
I've been reading the apache docs that say you can do this via virtual hosts.
Can I do it so 'yourname' can be anything - where all requests are sent
to the same page where i can parse the uri and query a db based on 'yourname'.
any reason why my isp might be reluctant to do this.I'm presuming I can't
do it via .htaccess?
as a side note what are the affects of this kind of redirection as far as 
search engines
go.I've heard that doing this kind of thing on a 404 page is a bad idea.


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




[PHP] exec()

2002-02-18 Thread Chad

Does anyone know if I can exec a perl script from a php script even if my isp doesn't 
allow me to run perl scripts from the command line?




[PHP] Re: [PHP-DB] I cant get the logic for this...

2002-02-18 Thread Jason G.

$nWidth = 3;
$oRow = TRUE;

while($oRow)
{
 //Write tr here
 for($i=0; $i$nWidth; $i++)
 {
 $oRow = mysql_fetch_object($dbResult);
 //Write td/td here
 }
 //write /tr here
}

At 12:06 PM 2/18/2002 +, you wrote:
Hi all,

I want to display return results from my query (which works fine)
In I tidy way on screen.

So my result returns say seven results, I have a table, and I want to
show
3 results per row of the table... I.e.:

Table
TR
TD = result1 /TD  TD result2 /TD TD = result3 /TD
/TD
/TR
TR
TD = result4 /TD  TD result5 /TD TD = result6 /TD
/TD
/TR
TR
TD = result7 /TD  TD resultempty /TD TD = resultempty /TD
/TD
/TR
/table

The last two td in row 3 are empty because result found 7 results.

This cant be fixed so echo statements wont work as the result could
Be 3 or 10 or 56 or whatever.

As Always your help and or guidance in this matter is appreciated.

Dave Carrera
Php / MySql Development
Web Design
Site Marketing
http://www.davecarrera.com




--
PHP Database 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] Mysql_num_rows

2002-02-18 Thread Frank Miller

Thanks to everyone that helped me with my last problem I've run into 
another problem and was wondering if someone here could offer any help or 
suggestions.  The project I'm working on is an event calender. It does 
several things but the problem I've run into is when I click a date on the 
calendar if there are no events for that day I want to print a message on 
the web page saying as much.  I've read the documentaion that said if I'm 
using a select statement to use mysql_num_rows and that it returns an 
integer. Here is a snippet of my code

$query = SELECT *,TIME_FORMAT(eventtime, '%l:%i %p')AS eventtime, 
DATE_FORMAT(dateofevent,'%M %e, %Y') AS fdateofevent  FROM tamutevents 
where refid=$refid;

$result = mysql_query($query,$connection) or die(Error in Query);
$num = mysql_num_rows($result);


Next I say  if ($num == 0)
{
  echo  There are no events scheduled today!;
}
else
 {
 echo blah, blah, blah;
}

The problem is if there are no records that match the select then it always 
goes to the  else part.  I've tried printing the value of $num and it works 
if there is something scheduled but when there is nothing scheduled $num 
shows nothing on the screen.

I'm using Mysql 3.23.38 and php 4.06 on a windows test machine but it works 
the same on php 4.06 and Mysql 3.23.46 on my Linux server.

Has anyone else run into this and if so can you tell me what to do about it.

Thanks in advance - Frank


Frank Miller
Computer Specialist and Webmaster
Technology and Distance Education
Texas AM University-Texarkana
2600 North Robison Rd
Texarkana, Texas 75501

Phone:  903-223-3156
Fax:  903-223-3139
Office:   165


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




[PHP] .htaccess login id

2002-02-18 Thread Dave

Hi,

I currently have a directory of my web site access protected using .htaccess
and .htpasswd.

Is there any way of retrieving the user ID in PHP after the person
successfully logs in?

Thanks in advance
Dave




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




RE: [PHP] Mysql_num_rows

2002-02-18 Thread Niklas Lampén

Maybe you can round the problem with

if ($num  1)
echo Nothing today!;
else
echo Something to do today!;

if (!isset($num) || $num == 0)...


Niklas


-Original Message-
From: Frank Miller [mailto:[EMAIL PROTECTED]] 
Sent: 18. helmikuuta 2002 16:05
To: [EMAIL PROTECTED]
Subject: [PHP] Mysql_num_rows


Thanks to everyone that helped me with my last problem I've run into 
another problem and was wondering if someone here could offer any help
or 
suggestions.  The project I'm working on is an event calender. It does 
several things but the problem I've run into is when I click a date on
the 
calendar if there are no events for that day I want to print a message
on 
the web page saying as much.  I've read the documentaion that said if
I'm 
using a select statement to use mysql_num_rows and that it returns an 
integer. Here is a snippet of my code

$query = SELECT *,TIME_FORMAT(eventtime, '%l:%i %p')AS eventtime, 
DATE_FORMAT(dateofevent,'%M %e, %Y') AS fdateofevent  FROM tamutevents 
where refid=$refid;

$result = mysql_query($query,$connection) or die(Error in Query); $num
= mysql_num_rows($result);


Next I say  if ($num == 0)
{
  echo  There are no events scheduled today!;
}
else
 {
 echo blah, blah, blah;
}

The problem is if there are no records that match the select then it
always 
goes to the  else part.  I've tried printing the value of $num and it
works 
if there is something scheduled but when there is nothing scheduled $num

shows nothing on the screen.

I'm using Mysql 3.23.38 and php 4.06 on a windows test machine but it
works 
the same on php 4.06 and Mysql 3.23.46 on my Linux server.

Has anyone else run into this and if so can you tell me what to do about
it.

Thanks in advance - Frank


Frank Miller
Computer Specialist and Webmaster
Technology and Distance Education
Texas AM University-Texarkana
2600 North Robison Rd
Texarkana, Texas 75501

Phone:  903-223-3156
Fax:  903-223-3139
Office:   165


-- 
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] date problem

2002-02-18 Thread eoghan

hello

i am running into some trouble with a very basic problem.
i want to insert the current date/time into my db. i have 
the field set up as a datetime field. when i submit info,
i just get a blank date, i mean it all zeros, like
-00-00 00.00:00:00. how do i insert the current datetime
into my db? i tried using a hidden field with a foramtted
gmt date value, but its not working... any help

thanks - eoghan

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




Re: [PHP] form submission error trapping

2002-02-18 Thread Jason G.

Why do not you all just put all your PHP logic, db access, etc at the TOP 
of the script.  Once you have your results and variables created, then 
start into html.

This method produces MUCH cleaner scripts, and there is a very minimal 
amount of PHP interspersed within the HTML. Also, you have time to bail 
out, or redirect, etc...


?
 Connect to DB

 Are we to process the form?
 Yes:
 Validate fields
 Generate Error Messages
 break;
 No Error Messages?
 Update the DB
 Header(Location: bla.php?NEWID=$NEWID);
 exit;

?
html

Firstname: ? if(error) echo(error message); ?br
input type=text name=txtFIRSTNAME value=?= 
htmlspecialchars($txtFIRSTNAME); ?br
br
Lastname: ? if(error) echo(error message); ?br
input type=text name=txtLASTNAME value=?= 
htmlspecialchars($txtLASTNAME); ?br
br

/html




At 08:35 AM 2/18/2002 -0500, Matt wrote:
I think that mixing of html and php is too complex and leads to hard to
maintain scripts. I find it extremely difficult to understand a scripts
logic when it's spread out over hundreds of lines of php/html.

I use EasyTemplates that came in Web Applications Development with PHP 4.0
by Tobias Ratschiller and Till Gerkin. It looks like the source is
copyrighted and you have to buy the book to get it.  But it says it's based
on FastTemplates.  The book itself is at
http://www.amazon.com/exec/obidos/ASIN/0735709971/

You can see a sample of the method here
http://marc.theaimsgroup.com/?l=php-generalm=101371611609042w=2

Notice that the form action handler is the same as the original form. This
is a simple example, but it does remember user input as you want.

I wrote a couple of helper functions that accept db names to build select
boxes and radio buttons.  They return strings of the html with the selected
value, and I just put them in a template container reserved for them (the
{TEMPLATE_ITEM} in the sample).

For tables with unknown number of rows, I have one template of the main
page, one for the table container, and one for each row itself.  I loop on
the row, using the row template and concatenate all of the rows of html into
a string.  I take that string and stick it into the table template, and
finally stick the table into the page template.  Very smooth, easy to read,
and no trouble with headers() since all output is done on the last
statement.  You have complete control over the script until then, and can
bail out to another page, or decide to use other templates and output
something else.

As for errors, I build an array of the messages such as:
if (!empty($thatsThere)) {
$errors[] = Don't put $thatsThere in  there;
}
if (empty($userName)) {
   $errors[] = Username must be supplied;
}

Then you can tell if all is okay, with if (is_array($errors)).  If it is an
array, then something is wrong, so I  append the array contests into html
like this:
foreach($errors as $value) {
  $errorMsgs = $value . br\n;
}
and then put $errorMsgs into the page template container you've reserved for
it.

- Original Message -
From: Jason Dulberg [EMAIL PROTECTED]
To: [EMAIL PROTECTED]

  I am working on some error trapping for several forms on my site. After
  visiting a bunch of websites, I've noticed 2 common methods of displaying
  error messages.
 
  1. display an error box on a new page and force the user to hit the back
  button
 
  2. display the form again with appropriate error text and pre-filled
fields.
 
  I have part of the error on the new page working but I'm running into the
  infamous no contents in the form after going back.
 
  There are some useability issues with forcing the user to hit the back
  button -- some just don't want to bother.
 
  Is there a way to display the form w/original contents and error messages
  'without' having to code the entire form twice? I have about 5 forms with
50
  fields or so each.
 
  What would be the best way to go about redrawing the form with the errors
  shown beside each field?
 
  Any suggestions are greatly appreciated.



--
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] how to test ob_start(ob_gzhandler);

2002-02-18 Thread Rein Velt

Dear PHP coders,

i am using ob_start(ob_gzhandler)  to compress all html output.
Is there any way to check if the output is really compressed? (and how
much)?

Thanks in advance,

Rein Velt



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




[PHP] Re: date problem

2002-02-18 Thread Julio Nobrega Trabalhando

  Mysql?

INSERT INTO table VALUES (NOW());

--

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


Eoghan [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 hello

 i am running into some trouble with a very basic problem.
 i want to insert the current date/time into my db. i have
 the field set up as a datetime field. when i submit info,
 i just get a blank date, i mean it all zeros, like
 -00-00 00.00:00:00. how do i insert the current datetime
 into my db? i tried using a hidden field with a foramtted
 gmt date value, but its not working... any help

 thanks - eoghan



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




[PHP] readline() Fails in PHP for Win2000

2002-02-18 Thread Rick Emery

What do I need to do to allow the readline functions to work?

The following short program fails when run from the command line:

?php
$line = readline(Input data: );
print $line;
?

Execution command and error message:

C:\php -q myscript.php
br
bFatal error/b:  Call to undefined function:  readline() in
bC:\myscript.php/b
 on line b2/bbr

My system:
Windows 2000
PHP version 4.1.1
I installed PHP from binaries.


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




RE: [PHP] date problem

2002-02-18 Thread Niklas Lampén

date() is your answer, use it in the piece of code generating the query.
$DateTime = date(Y-m-d H:i:s); // 2002-02-18 16:10:43


Niklas


-Original Message-
From: eoghan [mailto:[EMAIL PROTECTED]] 
Sent: 18. helmikuuta 2002 16:14
To: [EMAIL PROTECTED]
Subject: [PHP] date problem


hello

i am running into some trouble with a very basic problem.
i want to insert the current date/time into my db. i have 
the field set up as a datetime field. when i submit info,
i just get a blank date, i mean it all zeros, like
-00-00 00.00:00:00. how do i insert the current datetime into my db?
i tried using a hidden field with a foramtted gmt date value, but its
not working... any help

thanks - eoghan

-- 
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] Breadcrumbs in PHP

2002-02-18 Thread Matt Williams

Hi Laurie

Not really looked at the script there. But I wrote one a while back which is
similar.

http://oozoo.co.uk/nobba/php-here.php

Have look at that and see if you have the same problems

m:

 I was trying out this breadcrumbs code found at evolt.org:

 http://www.evolt.org/article/Breadcrumbs_for_PHP_Lovers/17/4455/

 and tried it on my site. The same problem as documented on that page
 exists on my page, being that it doesn't include any directories between
 the home and the current page, such as:

 home  about us  contact us.

 Instead it shows as

 home  contact us

 I've made some changes as recommended by the postings below, such as
 changing SCRIPT_URL to PATH_INFO, but still no changes.

 Has anyone had any experience and workaroudn with this particular script,
 or if there's a better script that I can use for breadcrumbs?


 --
 Laurie Landry
 [EMAIL PROTECTED] - email
 (604) 693-1120 - voicemail/fax



 --
 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] Mysql_num_rows

2002-02-18 Thread Rick Emery

Please show your exact code, because your code snippet looks right.

Then, again, maybe it's because it's an Aggie machine...GRIN

-Original Message-
From: Niklas Lampén [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 18, 2002 8:11 AM
To: Php-General
Subject: RE: [PHP] Mysql_num_rows


Maybe you can round the problem with

if ($num  1)
echo Nothing today!;
else
echo Something to do today!;

if (!isset($num) || $num == 0)...


Niklas


-Original Message-
From: Frank Miller [mailto:[EMAIL PROTECTED]] 
Sent: 18. helmikuuta 2002 16:05
To: [EMAIL PROTECTED]
Subject: [PHP] Mysql_num_rows


Thanks to everyone that helped me with my last problem I've run into 
another problem and was wondering if someone here could offer any help
or 
suggestions.  The project I'm working on is an event calender. It does 
several things but the problem I've run into is when I click a date on
the 
calendar if there are no events for that day I want to print a message
on 
the web page saying as much.  I've read the documentaion that said if
I'm 
using a select statement to use mysql_num_rows and that it returns an 
integer. Here is a snippet of my code

$query = SELECT *,TIME_FORMAT(eventtime, '%l:%i %p')AS eventtime, 
DATE_FORMAT(dateofevent,'%M %e, %Y') AS fdateofevent  FROM tamutevents 
where refid=$refid;

$result = mysql_query($query,$connection) or die(Error in Query); $num
= mysql_num_rows($result);


Next I say  if ($num == 0)
{
  echo  There are no events scheduled today!;
}
else
 {
 echo blah, blah, blah;
}

The problem is if there are no records that match the select then it
always 
goes to the  else part.  I've tried printing the value of $num and it
works 
if there is something scheduled but when there is nothing scheduled $num

shows nothing on the screen.

I'm using Mysql 3.23.38 and php 4.06 on a windows test machine but it
works 
the same on php 4.06 and Mysql 3.23.46 on my Linux server.

Has anyone else run into this and if so can you tell me what to do about
it.

Thanks in advance - Frank


Frank Miller
Computer Specialist and Webmaster
Technology and Distance Education
Texas AM University-Texarkana
2600 North Robison Rd
Texarkana, Texas 75501

Phone:  903-223-3156
Fax:  903-223-3139
Office:   165


-- 
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-general Digest 18 Feb 2002 14:28:21 -0000 Issue 1179

2002-02-18 Thread php-general-digest-help


php-general Digest 18 Feb 2002 14:28:21 - Issue 1179

Topics (messages 85141 through 85200):

Re: form opens a php window.
85141 by: Gary

Re: Running php from shell - passing parameters
85142 by: Greg Donald

phpmyadmin-mysql
85143 by: jtjohnston
85169 by: hugh danaher

Re: session password problems.
85144 by: Greg Donald

Include file for MySQL insert rows
85145 by: Paul Fowler
85154 by: Janet Valade

Re: zend studio 2.0
85146 by: Chris Lott

building dynamic pdf files?
85147 by: Jeff D. Hamann
85149 by: Martin Towell
85150 by: Bradley Goldsmith
85158 by: michael kimsal

Re: php4.1.1, oci8 functions, Oracle 9i and VARCHAR2 selects no t working
85148 by: Bradley Goldsmith

Debate scripts
85151 by: Tshering Norbu

help with Header call
85152 by: Robbie Newton
85155 by: Martin Towell

Re: storing arrays
85153 by: Clark

Re: form submission error trapping
85156 by: Navid Yar
85174 by: Jill.Baker.aculab.com
85182 by: Matt
85193 by: Jason G.
85194 by: Jason G.

Re: [PHP-DB] Updating Database at a specified time
85157 by: Peter J. Schoenster

How to start a secure HTTP session?
85159 by: gaukia 345
85160 by: Janet Valade

Frustrating ?
85161 by: jtjohnston
85163 by: CC Zona
85164 by: jtjohnston
85165 by: CC Zona
85166 by: Martin Lucas

Report generator for Linux
85162 by: Todd Cary

Re: Text editor for linux
85167 by: Josep Raurell
85168 by: Alexander Weber
85170 by: Billy S Halsey

implement yourname.mysite.com redirection
85171 by: Adrian Murphy
85186 by: Jason G.

upload problem...
85172 by: Cristiano Canobbio

Q on php://stdin
85173 by: Billy S Halsey

Sendmail, I've had enough of it!
85175 by: Liam MacKenzie

no-cache headers
85176 by: Phil Ewington
85179 by: Matt

creating PDF. How to get the xpositioni of a text?
85177 by: Andy

Re: What Do You Think?
85178 by: Ford, Mike   [LSS]

convert TIFF to JPEG
85180 by: Norbert Eder

preg_match vs ereg etc
85181 by: DigitalKoala

Using Variable Variables from form values inside a function
85183 by: Ron Dyck
85184 by: Matt
85185 by: Ron Dyck

exec()
85187 by: Chad

Re: [PHP-DB] I cant get the logic for this...
85188 by: Jason G.

Mysql_num_rows
85189 by: Frank Miller
85191 by: Niklas Lampén
85200 by: Rick Emery

.htaccess login id
85190 by: Dave

date problem
85192 by: eoghan
85196 by: Julio Nobrega Trabalhando
85198 by: Niklas Lampén

how to test   ob_start(ob_gzhandler);
85195 by: Rein Velt

readline() Fails in PHP for Win2000
85197 by: Rick Emery

Re: Breadcrumbs in PHP
85199 by: Matt Williams

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



Webmaster Mbtradingco wrote:

 Hi, I have a form, that I need to control the parameters in the _blank 
 target once it is submitted.
 
  
 
 Everything works, fine except the client wants the result of the poll in 
 a popup window, and I am not able to control the parameters on the new 
 window.
 
  
 
 Can any one help me with this? Thanks.
 
  
 
 E
 

you are trying to use a server side language to do a client side task. 
You have two choices, write the form in javascript and pass it to the 
new window or use something like a cookie or database to collect and 
pass on the information to the page that resides in the window.

Gary



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

 I have to run php script from Linux shell.

 I have no trouble except with passing the parameters.
 What is the right sintax to pass them to the script?

 I would like to do something like this:
 /usr/local/bin/php ./test.php param=value


What you want is $argc and $argv as described in the predefined variables
documentation:

http://www.php.net/manual/en/language.variables.predefined.php


Greg Donald - http://destiney.com/
http://phprated.com/ | http://phplinks.org/ | http://phptopsites.com/



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

Hello,

I'm looking for code to display all my mysql databases in a select.
On change, I want to display all my tables in a select.
Finally, on change, it has to display all record of the table selected:

Print Record


id YR   AU   BT
 1 1997 Fee, Margery Writing Orality: Interpreting Literature
 Display 

[PHP] Re: Mysql_num_rows

2002-02-18 Thread Corey Eiseman

Hi Frank,

I'm not exactly sure what's up with this, I've definitely used something
similar before without any problems. However, maybe you can work around it
by switching the logic...

if($num)
  echo blah, blah, blah;
else
  echo There are no events scheduled today!;


Wish I had a better suggestion.. Good luck!


Corey Eiseman
Infinite Orange Incorporated
http://infiniteorange.com/




Frank Miller [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Thanks to everyone that helped me with my last problem I've run into
 another problem and was wondering if someone here could offer any help or
 suggestions.  The project I'm working on is an event calender. It does
 several things but the problem I've run into is when I click a date on the
 calendar if there are no events for that day I want to print a message on
 the web page saying as much.  I've read the documentaion that said if I'm
 using a select statement to use mysql_num_rows and that it returns an
 integer. Here is a snippet of my code

 $query = SELECT *,TIME_FORMAT(eventtime, '%l:%i %p')AS eventtime,
 DATE_FORMAT(dateofevent,'%M %e, %Y') AS fdateofevent  FROM tamutevents
 where refid=$refid;

 $result = mysql_query($query,$connection) or die(Error in Query);
 $num = mysql_num_rows($result);


 Next I say  if ($num == 0)
 {
   echo  There are no events scheduled today!;
 }
 else
  {
  echo blah, blah, blah;
 }

 The problem is if there are no records that match the select then it
always
 goes to the  else part.  I've tried printing the value of $num and it
works
 if there is something scheduled but when there is nothing scheduled $num
 shows nothing on the screen.

 I'm using Mysql 3.23.38 and php 4.06 on a windows test machine but it
works
 the same on php 4.06 and Mysql 3.23.46 on my Linux server.

 Has anyone else run into this and if so can you tell me what to do about
it.

 Thanks in advance - Frank


 Frank Miller
 Computer Specialist and Webmaster
 Technology and Distance Education
 Texas AM University-Texarkana
 2600 North Robison Rd
 Texarkana, Texas 75501

 Phone:  903-223-3156
 Fax:  903-223-3139
 Office:   165




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




RE: [PHP] Mysql_num_rows

2002-02-18 Thread Niklas Lampén

Do everything as you did, except for that if-statement.

$Query = SELECT * FROM table;
$Results = mysql_query($Query);
$num = mysql_num_rows($Results);

if ($num  1 || !isset($num))
echo Nothing here!;
else
echo Do something today!;


Niklas

-Original Message-
From: Rick Emery [mailto:[EMAIL PROTECTED]] 
Sent: 18. helmikuuta 2002 16:27
To: Php-General; ':[EMAIL PROTECTED]'
Subject: RE: [PHP] Mysql_num_rows


Please show your exact code, because your code snippet looks right.

Then, again, maybe it's because it's an Aggie machine...GRIN

-Original Message-
From: Niklas Lampén [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 18, 2002 8:11 AM
To: Php-General
Subject: RE: [PHP] Mysql_num_rows


Maybe you can round the problem with

if ($num  1)
echo Nothing today!;
else
echo Something to do today!;

if (!isset($num) || $num == 0)...


Niklas


-Original Message-
From: Frank Miller [mailto:[EMAIL PROTECTED]] 
Sent: 18. helmikuuta 2002 16:05
To: [EMAIL PROTECTED]
Subject: [PHP] Mysql_num_rows


Thanks to everyone that helped me with my last problem I've run into 
another problem and was wondering if someone here could offer any help
or 
suggestions.  The project I'm working on is an event calender. It does 
several things but the problem I've run into is when I click a date on
the 
calendar if there are no events for that day I want to print a message
on 
the web page saying as much.  I've read the documentaion that said if
I'm 
using a select statement to use mysql_num_rows and that it returns an 
integer. Here is a snippet of my code

$query = SELECT *,TIME_FORMAT(eventtime, '%l:%i %p')AS eventtime, 
DATE_FORMAT(dateofevent,'%M %e, %Y') AS fdateofevent  FROM tamutevents 
where refid=$refid;

$result = mysql_query($query,$connection) or die(Error in Query); $num
= mysql_num_rows($result);


Next I say  if ($num == 0)
{
  echo  There are no events scheduled today!;
}
else
 {
 echo blah, blah, blah;
}

The problem is if there are no records that match the select then it
always 
goes to the  else part.  I've tried printing the value of $num and it
works 
if there is something scheduled but when there is nothing scheduled $num

shows nothing on the screen.

I'm using Mysql 3.23.38 and php 4.06 on a windows test machine but it
works 
the same on php 4.06 and Mysql 3.23.46 on my Linux server.

Has anyone else run into this and if so can you tell me what to do about
it.

Thanks in advance - Frank


Frank Miller
Computer Specialist and Webmaster
Technology and Distance Education
Texas AM University-Texarkana
2600 North Robison Rd
Texarkana, Texas 75501

Phone:  903-223-3156
Fax:  903-223-3139
Office:   165


-- 
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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Getting the pixelwidth of a text in PDF possible?

2002-02-18 Thread Andy

Hi there,

I would like to place a text in the middle of a PDF page. This requires to
know the length of the text in pixels prior creating the text on the page.

Is there a method to find the length of the text?

Thanx Andy



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




[PHP] Mail () problems - Need help!

2002-02-18 Thread Anthony Rodriguez

I''ve a php script that gets e-mail addresses from a MySQL db and then 
using the mail() sends the same message to 100+ recipients.

I tested the script twice.

FIRST TEST.

(1) I commented out the mail() routine.
(2) I looped to get the e-mail addresses.
(3) I echoed the e-mail addresses on the screen.

It worked fine (displayed 136 e-mail addresses) and fast!

SECOND TEST.

(1) I uncommented out the mail() routine.
(2) I used my own e-mail address as the recipient in the mail().

It was supposed to loop to get the e-mail addresses, display them on the 
screen, and send me an e-mail every time (136 times).

It loaded very slow (loading indicator). Finally it displayed url not 
found with the name of the script file. And, I got no e-mails.

Is there a conflict between php mail() and the mail server when multiple 
e-mails are involved?

Thanks!

Anthony F. Rodriguez
([EMAIL PROTECTED])


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




[PHP] RE: [PHP-DB] I cant get the logic for this...

2002-02-18 Thread SpamSucks86

I had this same problem. It's very aggravating. Jason G's solution won't
work, because $oRow will always be true as long as there is more
results, NOT if there are less than 3 results left.

Why don't you true something like this

?php
$nWidth = 3;
$numrows = mysql_num_rows($result);

//Now take the number of rows and figure out the number of extra cells
not divisible by $nWidth
$tmp = $numrows % $nWidth;

//Cut off the extra number of cells
$numevenrows = $numrows - $tmp;

//Let's bring the number down to something easier to work with (number
of even rows)
$numevenrows = $numevenrows/$nWidth;

//$tmp still contains the number of cells which don't fall evenly into a
row

while ($numevenrows  0) {
//echo your row with 3 cells
$numevenrows = $numevenrows - 1;
}

if ($numrows == 2) {
//Write the last row with only two cells. You might want to just
close the old table and make a new one and center it so that those two
cells are centered, or you could use colspan=2 in the HTML so that one
of the cells spans more.
}

elseif ($numrows == 1) {
//same thing
}
?

This code is definitely untested, but I think you should understand the
logic behind it, I did more commenting than I did coding.


-Original Message-
From: Jason G. [mailto:[EMAIL PROTECTED]] 
Sent: Monday, February 18, 2002 9:11 AM
To: Dave Carrera; [EMAIL PROTECTED]
Subject: Re: [PHP-DB] I cant get the logic for this...

$nWidth = 3;
$oRow = TRUE;

while($oRow)
{
 //Write tr here
 for($i=0; $i$nWidth; $i++)
 {
 $oRow = mysql_fetch_object($dbResult);
 //Write td/td here
 }
 //write /tr here
}

At 12:06 PM 2/18/2002 +, you wrote:
Hi all,

I want to display return results from my query (which works fine)
In I tidy way on screen.

So my result returns say seven results, I have a table, and I want to
show
3 results per row of the table... I.e.:

Table
TR
TD = result1 /TD  TD result2 /TD TD = result3 /TD
/TD
/TR
TR
TD = result4 /TD  TD result5 /TD TD = result6 /TD
/TD
/TR
TR
TD = result7 /TD  TD resultempty /TD TD = resultempty /TD
/TD
/TR
/table

The last two td in row 3 are empty because result found 7 results.

This cant be fixed so echo statements wont work as the result could
Be 3 or 10 or 56 or whatever.

As Always your help and or guidance in this matter is appreciated.

Dave Carrera
Php / MySql Development
Web Design
Site Marketing
http://www.davecarrera.com




--
PHP Database 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] storing arrays

2002-02-18 Thread Rick Emery

?php
$myarray = array(123,abcdef,4.567,another string);
$ser = serialize($myarray);
$ff = fopen(C:\myfile,w);
fwrite($ff,$ser);
fclose($ff);

$fr = fopen(C:\myfile,r);
$outser = fgets($fr,1000);
fclose($fr);
$outarray = unserialize($outser);
print $outarray[0].\n;
print $outarray[1].\n;
print $outarray[2].\n;
print $outarray[3].\n;
print $outarray[4].\n;
?

-Original Message-
From: Clark [mailto:[EMAIL PROTECTED]]
Sent: Sunday, February 17, 2002 11:15 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] storing arrays


I'm having trouble storing my array to a text file, utilizing serialize()
and unserialize().  Could you please show a very basic layout of the proper
way to serialize and unserialize and store that to a file?  Thanks.

Matt [EMAIL PROTECTED] wrote in message
001e01c1b7c0$404d5be0$059aa8c0@Pooch">news:001e01c1b7c0$404d5be0$059aa8c0@Pooch...

 - Original Message -
 From: Clark [EMAIL PROTECTED]
 Sent: Saturday, February 16, 2002 9:15 PM


  Two questions:
 
  1) Is it possible to write an array to a file?

 Yes, serialize it first with http://www.php.net/serialize.  You can also
 place this in a db text field because it will be a character
representation.

  2) Is it possible to specify the name of the key to each item of an
array
  when you get the array using file().

 When retrieving the saved array, unserialize it, and you'll get the same
 array back.




-- 
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] .htaccess login id

2002-02-18 Thread Mohamed Ismail Bulale


To get username and password with php, use this below code:

$headers = getallheaders(); 
$auth=$headers['Authorization'];
$pos = strpos($auth, ' '); 
$delivered_auth_type = strtolower(substr($auth, 0, $pos)); 
$authorization_params = substr($auth, $pos+1); 
//* analyse parameters 
if ($delivered_auth_type == 'basic') { 
$userpas = base64_decode($authorization_params);
list($loginname, $password) =
explode(':',base64_decode($authorization_params));
}
echo Auth: $auth br login: $loginname - userpas: $password br;



Best regards,

Bulale
+-+
: Bulale Mohamed Ismail [EMAIL PROTECTED]   :
: Odegaard A/S:
: A company in the Oedegaard and Danneskiold-Samsoe Group :
: 15 Titangade, DK-2200 Copenhagen N, DENMARK :
: Switchboard:  +45 35 31 10 10   :
: Direct phone: +45 35 31 10 16   :
: Fax:  +45 35 31 10 11   :
: Home page: www.oedegaard.com:
+-+


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




Re: [PHP] Mail () problems - Need help!

2002-02-18 Thread Bogdan Stancescu

Your browser probably timed out. Try using flush() after the echo in the 
loop. You may also encounter PHP timeout - take a look at 
set_time_limit() if you bump into that.

What I don't understand is why you received no mail - are you sure your 
mail() syntax is correct? You should try a third test:
(1) Change the loop condition so it only loops once;
(2) Use the uncommented mail() version;

See if you get any mail / error messages...

HTH

Bogdan

Anthony Rodriguez wrote:

 I''ve a php script that gets e-mail addresses from a MySQL db and then 
 using the mail() sends the same message to 100+ recipients.

 I tested the script twice.

 FIRST TEST.

 (1) I commented out the mail() routine.
 (2) I looped to get the e-mail addresses.
 (3) I echoed the e-mail addresses on the screen.

 It worked fine (displayed 136 e-mail addresses) and fast!

 SECOND TEST.

 (1) I uncommented out the mail() routine.
 (2) I used my own e-mail address as the recipient in the mail().

 It was supposed to loop to get the e-mail addresses, display them on 
 the screen, and send me an e-mail every time (136 times).

 It loaded very slow (loading indicator). Finally it displayed url not 
 found with the name of the script file. And, I got no e-mails.

 Is there a conflict between php mail() and the mail server when 
 multiple e-mails are involved?

 Thanks!

 Anthony F. Rodriguez
 ([EMAIL PROTECTED])






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




Re: [PHP] Mail () problems - Need help!

2002-02-18 Thread DL Neil

Anthony,
A common issue.

Pertinent info required:
1 Win or *nix?
2 able to send a single msg to a single email addr?
3 does loop get address and send msg to that address, 136 times; or does loop collect 
136 addresses and then
after closing the loop a single msg is sent to 136 recipients in the To: field?

Might also be helpful if you post the pertinent piece(s) of code, and the Email para 
from the php.ini file.

Please advise,
=dn


 I''ve a php script that gets e-mail addresses from a MySQL db and then
 using the mail() sends the same message to 100+ recipients.

 I tested the script twice.

 FIRST TEST.

 (1) I commented out the mail() routine.
 (2) I looped to get the e-mail addresses.
 (3) I echoed the e-mail addresses on the screen.

 It worked fine (displayed 136 e-mail addresses) and fast!

 SECOND TEST.

 (1) I uncommented out the mail() routine.
 (2) I used my own e-mail address as the recipient in the mail().

 It was supposed to loop to get the e-mail addresses, display them on the
 screen, and send me an e-mail every time (136 times).

 It loaded very slow (loading indicator). Finally it displayed url not
 found with the name of the script file. And, I got no e-mails.

 Is there a conflict between php mail() and the mail server when multiple
 e-mails are involved?

 Thanks!

 Anthony F. Rodriguez
 ([EMAIL PROTECTED])


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




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




[PHP] stupid problem

2002-02-18 Thread John Gurley

I am getting a variable from a web page ($inst) which is looked at by the 
loop:

if ($inst == 2)
{
do stuff
}

the problem is that no matter what the value of $inst the code enters the 
loop. I know it is some thing small and stupid, but any help would be 
appreciated.
john

_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.


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




RE: [PHP] stupid problem

2002-02-18 Thread Rick Emery

show html
show code

-Original Message-
From: John Gurley [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 18, 2002 9:36 AM
To: [EMAIL PROTECTED]
Subject: [PHP] stupid problem


I am getting a variable from a web page ($inst) which is looked at by the 
loop:

if ($inst == 2)
{
do stuff
}

the problem is that no matter what the value of $inst the code enters the 
loop. I know it is some thing small and stupid, but any help would be 
appreciated.
john

_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.


-- 
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] zend studio 2.0

2002-02-18 Thread Zeev Suraski

At 05:02 18/02/2002, Peter J. Schoenster wrote:
Well, as you said, no point in arguing.  Just that I think if someone
really wants to develop they should learn some better tools than a
GUI but it's a question of balance.

That's quite an arguable point.  I don't code PHP but C++ and Java, and I 
can say that I'm much more productive using an advanced GUI (Visual C++, 
IntelliJ IDEA) than I am using a text editor and aid tools.  There are 
still things I do in a shell (diffing, grepping, patching, even tiny text 
edits), but to actually write big code portions, and/or refactor existing 
code portions, IDE's give you tools that simple text editors just don't.
Of course, it's a matter of habits and taste, but saying that 'someone who 
really wants to develop should learn some better tools than a GUI' is 
simply bogus in my opinion.  GUIs are better than text-mode tools in many 
ways, and text-mode tools sometimes get the job done quicker than GUIs.   A 
good GUI would address 80% of your needs, and you can fill in the gap with 
the tools you were used to.

Zeev


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




RE: [PHP] Frustrating ?

2002-02-18 Thread Rick Emery

It means your query failed.

Change
$news = mysql_query('select * from ccl where '.$where.' order by AU desc');

TO:
$news = mysql_query('select * from ccl where '.$where.' order by AU desc')
or die(error: .mysql_error());

this will display the error
-Original Message-
From: jtjohnston [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 18, 2002 12:30 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Frustrating ?


Heres's a frustrating, and maybe not so stupid question?

I'm getting Warning: Supplied argument is not a valid MySQL result
resource on this line:

while ($mydata = mysql_fetch_object($news))

So what am I doing wrong here:

$where = id like $id;
$news = mysql_query('select * from ccl where '.$where.' order by AU desc');
//desc = z-a

 while ($mydata = mysql_fetch_object($news))
  {
 echo tr bgcolor=\#CC\td align=centera
href=\index.html?id=$mydata-id\Print
View/a/tdtd$mydata-id/tdtd$mydata-AU/tdtd$mydata-ST/tdtd
$mydata-BT/td/tr\n;

  }#end of while

I've tried variations like:

$news = mysql_query('select * from ccl where id like $id order by AU
desc');
$news = mysql_query(select * from ccl where id like $id order by AU
desc);

$id checks out ok. I use index.html?id=4
AU exists; ok. So ... ?

John


-- 
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] response

2002-02-18 Thread John Gurley

here is the html part of the code::

h3 align=center Instrument/h3
center
   select name=inst
 option selected value=1Beeps/option
 option value=2Violin/option
   /select
/center

and the php::

echo($inst);
if($inst == 2)
{

}

cheers



_
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


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




RE: [PHP] response

2002-02-18 Thread Rick Emery

A little more code would be handy.  We promise not to steal it for our own
use GRIN
When you print $inst, is the correct value displayed?
May we assume the SELECT block is in a form?

-Original Message-
From: John Gurley [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 18, 2002 10:06 AM
To: [EMAIL PROTECTED]
Subject: [PHP] response


here is the html part of the code::

h3 align=center Instrument/h3
center
   select name=inst
 option selected value=1Beeps/option
 option value=2Violin/option
   /select
/center

and the php::

echo($inst);
if($inst == 2)
{

}

cheers



_
Join the world's largest e-mail service with MSN Hotmail. 
http://www.hotmail.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] Using Variable Variables from form values inside a function

2002-02-18 Thread Ford, Mike [LSS]

 -Original Message-
 From: Ron Dyck [mailto:[EMAIL PROTECTED]]
 Sent: 18 February 2002 13:38
 
[... snip working example]
 
 but, this doesn't:
 
 function myFunction() {
  foreach($_POST as $key=$value) {
 
  if (empty($$key)) {
  print empty value $keybr;
  }
 
  }
 }

What's wrong with:
   if (empty($_POST[$key])):
?

This should work whether or not register_globals is switched on, and is therefore much 
to be preferred.

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning  Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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




[PHP] code

2002-02-18 Thread John Gurley

not trying to be sneaky or hide anything, the only thing is that it is a 
long code and what ever is wrong with what I am using it will not let me 
paste the code over!?!
when I echo $inst i get the expected result (i.e. 1 or 2) but even if the 
result is 1 it goes into the loop...and yes the select method is in the html 
code.

thanks again...sorry I'm making life so difficult by not including enough 
code...I'll try again and post it if I am able to paste it.

_
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


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




Re: [PHP] zend studio 2.0

2002-02-18 Thread Zeev Suraski

Chris,

Stability improved *a lot* since the beta in December.  Remember, it *was* 
a beta release, and like most betas, stability was not perfect.  It's quite 
good now, and it also got a whole new (well, mostly new) code completion 
engine which is really revolutionary for PHP.
I'm not objective, obviously, but in my opinion, the integrated debugging 
and the powerful code completion engine make the Zend Studio the 
environment that gets the job done in the quickest way possible, way faster 
than any text editor out there.  We also think a lot about keyboard-only 
users, so default focus locations and tab order, accessibility to all of 
the functionality from the keyboard, etc. - are things which we worked on 
quite a lot.  There's always room for improvement, but it's pretty good in 
2.0.0 as it is.

Much more is coming in upcoming versions - you guys are all more than 
welcome to provide feedback about things you'd like to see in future 
versions of the studio (www.zend.com/store/products/studio-feedback.php, or 
by mailing me directly).

Zeev

At 03:12 18/02/2002, Chris Lott wrote:
I hope we aren't going to get another chest-pounding real coders type of
argument going here. Homesite *IS* a text editor. It provides an amazing
number of shortcuts to tasks, including mouse-based tasks, many of which I
guarantee you I can get done faster with a mouse than anyone can typing. It
also offers a lot of pseudo-time-saving features as well, for which one
would be better of learning to do it manually. But it isn't a GUI in any
real sense as, say, Dreamweaver is. TextPad is at least as much of a GUI as
Homesite in that respect.

I use both of these great tools a lot... none of them are the stigmata of
the under-developed programmer. People should use what they want, but don't
dump on everyone who realizes that clicking a button or using a keyboard
shortcut in something like Homesite or Textpad to create common HTML
structures or PHP control structures is always going to be faster than
typing them out by hand, no matter how craven a Notepad warrior one might
be.

Zend looks pretty good in terms of providing what I like in a development
environment, particularly real debugging... unfortunately it was definitely
not particularly stable when I last tried it in late December.

Integrated debugging, syntax coloring, function reference, keyboard
shortcuts-- these are all useful tools. TextPad has good PHP dictionaries,
Homesite handles PHP well. Homesite is STILL the only editor I have found
that enables an easy preview through the server mapping so that I can,
with one touch toggle between my editing and the live code through my local
development server, something that saves a lot of time vs jockeying between
windows with other tools.

Not all mouse use is just waving one's hands through the air, none of the
programs mentioned are particularly mouse-centric.

c
--
Chris Lott
http://www.chrislott.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] zend studio 2.0

2002-02-18 Thread Zeev Suraski

At 00:27 18/02/2002, robert janeczek wrote:
hi
i write in php about 1.5 years. from the beginning i use macromedia homesite
and i`m quite content of it. but...debugger, environment not optimized for
php developers etc. so i wanted to try zend studio, i downloaded it,
installed (w2k, i already had an apache, so i deleted what came with
installer). then: apache unstability, server downs, generaly - not usable.
so i uninstalled everything and came back to homesite.

The problems you were having with the server components of the studio sound 
quite odd - can you elaborate on them?  (probably off-list, it's best if 
you could submit a bug report about it through zend.com/store/pickup.php, 
evaluation support).

This is water under the bridge now, but you could also install the server 
components of the studio onto your existing Apache installation instead of 
reinstalling it.  Maybe the uninstall/reinstall brought some mess into your 
system...

Zeev


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




Re: [PHP] Sessions that last for ever

2002-02-18 Thread Erik Price


On Saturday, February 16, 2002, at 03:10  PM, Nigel Gilbert wrote:

 But very many commercial sites, including Apple and Amazon to name two, 
 do exactly this.  When you re-enter the site they 'remember' who you 
 are using a cookie.  In my case, I'm building a multi-player strategy 
 game and while I want the players to go through an initial briefing the 
 first time they ever join the game, thereafter they should be able to 
 get straight into the game if they are still using the same PC.  But as 
 I said, the specifics of my use aren't so important - lots of sites 
 leave permanent cookies around and the results don't seem to be 
 catastrophic.

The data that these sites leave in their cookies is usually trivial -- 
things like UserID, or UserName, or something like that.  This way they 
know who you are when you bring up the site again, all the actual data 
is still stored at the site in a database.  It's way too easy for 
cookies to be intercepted or faked to leave sensitive data in them, like 
credit card numbers or whatever.  If you left game stats and what-not 
(say, weapons or items or something) in cookies, then an HTTP-aware 
player could probably give themself quad damage or equivalent whenever 
they wanted.

 The question is still: how to do it?

Store all their critical info and stats in a database, and use a cookie 
to store their name or something.  Then, when they get to the site, you 
can either run a password authentication to make sure that they are who 
their cookie says they are, or skip that and deal with the fact that 
some people may change their cookie to be the name of their opponent so 
that they can play as another character.

Sounds like a cool site, good luck




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] pg_result pg_fetch_row pg_fetch_array

2002-02-18 Thread * nea *


Which is the diference between this functions:

pg_result, pg_fetch_row, and pg_fetch_array



   
  @@()@@ wWWWw  Andrea Hernandez Alfaro
     (___)  Dpto. Computo, Area Internet
/  YUniversidad Latina de Costa Rica
 \ | \ |/
jgs|//   \\|///   Your mind is your most powerful resource
^^^




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




RE: [PHP] pg_result pg_fetch_row pg_fetch_array

2002-02-18 Thread Rick Emery

If they'e like the mysql equivalents, then:

pg_result() fetches a single value
pg_fetch_row() fetches a row from the result set.  Access each value with an
integer subscript.
pg_fetch_array() fetches a row from the result set.  Access each value with
the name of the column/field

read the manual for more exciting, definitive, informative explanations

-Original Message-
From: * nea * [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 18, 2002 10:55 AM
To: [EMAIL PROTECTED]
Subject: [PHP] pg_result pg_fetch_row pg_fetch_array



Which is the diference between this functions:

pg_result, pg_fetch_row, and pg_fetch_array



   
  @@()@@ wWWWw  Andrea Hernandez Alfaro
     (___)  Dpto. Computo, Area Internet
/  YUniversidad Latina de Costa Rica
 \ | \ |/
jgs|//   \\|///   Your mind is your most powerful resource
^^^




-- 
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] NULL Apache environment variables

2002-02-18 Thread Narvaez, Teresa

Hello, 
I'm running PHP version 4.1.1.  When I invoke this function, ?php
phpinfo()?, all variables are set.  However, when I try to retrieve a value
of a certain variable like this: 

  ?php echo $HTTP_USER_AGENT; ?  

It returns NULL.  Is there a missing configuration on apache or php? 

Thanks, 
-Teresa



Re: [PHP] pg_result pg_fetch_row pg_fetch_array

2002-02-18 Thread Jim Lucas [php]

http://php.blue-box.net/manual/en/function.pg-result.php
http://php.blue-box.net/manual/en/function.pg-fetch-row.php
http://php.blue-box.net/manual/en/function.pg-fetch-array.php

This should tell you all you need to know.

Jim Lucas
- Original Message - 
From: * nea * [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, February 18, 2002 8:55 AM
Subject: [PHP] pg_result pg_fetch_row pg_fetch_array


 
 Which is the diference between this functions:
 
 pg_result, pg_fetch_row, and pg_fetch_array
 
 
 

   @@()@@ wWWWw Andrea Hernandez Alfaro
  (___) Dpto. Computo, Area Internet
 /  YUniversidad Latina de Costa Rica
  \ | \ |/
 jgs|//   \\|///   Your mind is your most powerful resource
 ^^^
 
 
 
 
 -- 
 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] Re: building dynamic pdf files?

2002-02-18 Thread Erik Price


On Monday, February 18, 2002, at 12:31  AM, michael kimsal wrote:

 Seems a couple other answers pointed you to Adobe, but if you need to 
 run this under Unix, you're kinda outta luck.  Adobe don't make current 
 tools for Unix (as far as I can tell).

Well... don't forget that Mac OS X is Unix.  Though the Adobe software 
for Mac OS X only runs with Aqua, the display layer of OS X (won't work 
with xwindows).

Actually, IIRC there is at least one piece of non-OS X unix software 
made by Adobe.  I think they have a version of FrameMaker for Unix, for 
writing SGML documents and whatnot.  I'm also pretty sure that it's 
somewhere between $800 and $1100 for a one-license desktop copy!


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] What Do You Think?

2002-02-18 Thread Erik Price


On Monday, February 18, 2002, at 07:01  AM, Ford, Mike [LSS] wrote:

 -Original Message-
 From: Erik Price [mailto:[EMAIL PROTECTED]]
 Sent: 15 February 2002 19:52

 Not only can I hardly find a place with Tetley's on tap, I can hardly
 find it in stores!

 LOVE Tetley's.

 Er -- should I mention here that I live and work within walking 
 distance of the Tetley brewery?  And that I have often drunk in the 
 closest pub to it (about 50 yards away!)?

 Cheers!

 Mike


drool
jealousy level=seething /
/drool




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] Re: F/U on mail () problems

2002-02-18 Thread DL Neil

Dear Anthony,

[I've put this back on the list, because others know far more about *nix and email 
than I do]

BTW: people will respond more readily if you include a reassurance that you are 
emailing a 'membership' list or
its some sort of client opt-in situation - not spamming!

 Thank you for your reply!

 1 - The host server runs Apache under Unix.  My computer (where I call the
 scripts to be executed by the server) is Windows 98.

There are differences between the handling of email on a *nix server (cf a Windows 
box). Regardless of your
Win98 client, the server is Unix and that's what's important.

In the php.ini file [mail function], do you have the sendmail_path set correctly? I 
assume you do, because of
what you have said elsewhere, but just for info, what does it look like?

 2 - Yes. The script works if the # of e-mails is small.

Do you know which email server package is in use? - again, just for info.

 3 - No.  The loop gets one e-mail address and sends the e-mail message one
 at a time.

Throw in an EXIT; immediately before the end of the loop, and see if you can get the 
first msg out!

I've re-read your first msg, and the URL not found part. Are you sure there's no 
server error, or typo
involved? I must admit I was expecting to see a time limit exceeded message!

Because you are using Unix, you should assign the result of the mail() call somewhere, 
and inspect it - you may
be getting back some illuminating errmsg from the email server interface.

It may be that you are overloading the PHP mail() to sendmail interface with rapid 
looping - others with
practical experience should comment here. There are a couple of strategies.

Hope we're getting closer to a solution!
=dn



 Here's a copy:

 ?php
 $connection=mysql_connect(localhost,wagner,xxx) or die (No
 connection!);
 $db=mysql_select_db(sbwresearch_com,$connection) or die (No database!);

 $message=Dear consumer,\n ... etc ...\n;

 $qry_1=select e_mail from con_inf;
 $result_1=mysql_query($qry_1,$connection) or die (No query # 1!);
 while ($row_1=mysql_fetch_array($result_1, MYSQL_ASSOC))
 {
 $e_mail=$row_1[e_mail];
 mail($e_mail,
   News from SBW Research,
   $message,
   From:SBW Research [EMAIL PROTECTED]\n);
 echo $e_mailbr;
 };
 mysql_free_result($result_1);
 mysql_close($connection);
 exit;
 ?

 Thanks!

 Anthony Rodriguez
 ([EMAIL PROTECTED])




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




RE: [PHP] implement yourname.mysite.com redirection

2002-02-18 Thread Rick Emery

You can also do this via a PHP script, which is what I do.  I have 5 URLs
all going to the same site (500 megs disk space).  I parse the subdomain,
and re-driect to the appropriate sub-directory.

Actually, you don't even need to parse the URL for sub-domain.  Just search
for the yourname.mysite.com as a string in the database and then
re-direct.  You don't needt vitual hosts to accomplish this.  HOWEVER, you
do need access to your DNS so that you can create A and CNAME records
therein.

-Original Message-
From: Adrian Murphy [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 18, 2002 3:48 AM
To: [EMAIL PROTECTED]
Subject: [PHP] implement yourname.mysite.com redirection


Hi,
I'd like to implement a system whereby people have a subdomain on my site
like so:
yourname.mysite.com
I've been reading the apache docs that say you can do this via virtual
hosts.
Can I do it so 'yourname' can be anything - where all requests are sent
to the same page where i can parse the uri and query a db based on
'yourname'.
any reason why my isp might be reluctant to do this.I'm presuming I can't
do it via .htaccess?
as a side note what are the affects of this kind of redirection as far as
search engines
go.I've heard that doing this kind of thing on a 404 page is a bad idea.

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




[PHP] got the code

2002-02-18 Thread John Gurley


here is a larger chunk of the code:

html
body background = backgrnd.gif text = ff8c00 link = ff  vlink = 
00 
/body
/html
?
$f=fopen(/home/jgurley/www/test.txt,w);
?
html
center
h1WEB BASED MUSIC COMPOSITION/h1
hr
font size =6 Enjoy the Tune /font
hr
br
font size = 4Tone Row:/font
/center


/html
?

fwrite($f,2\n);
fwrite($f,$tune\n);
fwrite($f,$tempo\n);
fwrite($f,$form\n);
fwrite($f,$tonerow\n);
fwrite($f,1\n);
fwrite($f,tune.sco\n);
fwrite($f,3\n);
fclose($f);

echo($inst);

if($inst == '2');
{
$fp = fopen(xtune.sco,r);

$txtarr = array();
$linenum = 1;
$linetext =  ;

while (!feof($fp))
{

$ch = fgetc($fp);
$linetext .= $ch;

if ($ch ==\n)
{

$txtarr[$linenum] = $linetext;
$linenum++;
$linetext =  ;
}
}

$txtarr[2] = f1 0 512 10 1 .9 .9 .8 .7 .33\n;

$remove = rm xtune.sco;
`$remove`;
$change  = fopen(xtune.sco,w);
$line = $linenum;

$n=0;
print_r($txtarr);

while ($n = $line)
{
fwrite($change,$txtarr[$n]);
$n++;
}

_
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx


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




[PHP] Unsubscribe s.osborne

2002-02-18 Thread Rick Emery

List Moderator,

Can you please unsubscribe s.osborne

Every post I send earns a Postmaster - Cannot Deliver return.

-Original Message-
From: Postmaster [mailto:Postmaster]
Sent: None
To: [EMAIL PROTECTED]
Subject: Error delivering message to: [EMAIL PROTECTED]!


Your message was not delivered for the following reason:

E-mail Account: s.osborne is over the limit of 31457280 bytes.

Automated Postmaster

Original E-mail
From [EMAIL PROTECTED]  Mon Feb 18 11:22:32 2002
Return-Path: [EMAIL PROTECTED]
Received: from pb1.pair.com ([216.92.131.4]) by  ; Mon, 18 Feb 2002 11:22:32
-0600
Received: (qmail 5408 invoked by uid 1010); 18 Feb 2002 17:22:12 -
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
Precedence: bulk
list-help: mailto:[EMAIL PROTECTED]
list-unsubscribe: mailto:[EMAIL PROTECTED]
list-post: mailto:[EMAIL PROTECTED]
Delivered-To: mailing list [EMAIL PROTECTED]
Received: (qmail 5392 invoked from network); 18 Feb 2002 17:22:09 -
Message-ID: [EMAIL PROTECTED]
From: Rick Emery [EMAIL PROTECTED]
To: 'Adrian Murphy' [EMAIL PROTECTED], 
[EMAIL PROTECTED]
Date: Mon, 18 Feb 2002 11:21:22 -0600
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2653.19)
Content-Type: text/plain;
charset=iso-8859-1
Subject: RE: [PHP] implement yourname.mysite.com redirection
X-Rcpt-To: [EMAIL PROTECTED]

You can also do this via a PHP script, which is what I do.  I have 5 URLs
all going to the same site (500 megs disk space).  I parse the subdomain,
and re-driect to the appropriate sub-directory.

Actually, you don't even need to parse the URL for sub-domain.  Just search
for the yourname.mysite.com as a string in the database and then
re-direct.  You don't needt vitual hosts to accomplish this.  HOWEVER, you
do need access to your DNS so that you can create A and CNAME records
therein.

-Original Message-
From: Adrian Murphy [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 18, 2002 3:48 AM
To: [EMAIL PROTECTED]
Subject: [PHP] implement yourname.mysite.com redirection


Hi,
I'd like to implement a system whereby people have a subdomain on my site
like so:
yourname.mysite.com
I've been reading the apache docs that say you can do this via virtual
hosts.
Can I do it so 'yourname' can be anything - where all requests are sent
to the same page where i can parse the uri and query a db based on
'yourname'.
any reason why my isp might be reluctant to do this.I'm presuming I can't
do it via .htaccess?
as a side note what are the affects of this kind of redirection as far as
search engines
go.I've heard that doing this kind of thing on a 404 page is a bad idea.

-- 
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] Re: F/U on mail () problems

2002-02-18 Thread Michael Geier

 2 - Yes. The script works if the # of e-mails is small.

More than likely, the script is timing out.
see http://www.php.net/set_time_limit

 Here's a copy:

 ?php
 $connection=mysql_connect(localhost,wagner,xxx) or die (No
 connection!);
 $db=mysql_select_db(sbwresearch_com,$connection) or die (No
database!);

 $message=Dear consumer,\n ... etc ...\n;

 $qry_1=select e_mail from con_inf;
 $result_1=mysql_query($qry_1,$connection) or die (No query # 1!);
 while ($row_1=mysql_fetch_array($result_1, MYSQL_ASSOC))
 {
 $e_mail=$row_1[e_mail];
 mail($e_mail,
   News from SBW Research,
   $message,
   From:SBW Research [EMAIL PROTECTED]\n);
 echo $e_mailbr;
 };
 mysql_free_result($result_1);
 mysql_close($connection);
 exit;
 ?

 Thanks!

 Anthony Rodriguez
 ([EMAIL PROTECTED])




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




RE: [PHP] got the code

2002-02-18 Thread Rick Emery

First, where is $inst set prior to being echoed and tested?

second, please stop changing the subject.  It makes following the thread
very difficult.

-Original Message-
From: John Gurley [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 18, 2002 11:25 AM
To: [EMAIL PROTECTED]
Subject: [PHP] got the code



here is a larger chunk of the code:

html
body background = backgrnd.gif text = ff8c00 link = ff  vlink = 
00 
/body
/html
?
$f=fopen(/home/jgurley/www/test.txt,w);
?
html
center
h1WEB BASED MUSIC COMPOSITION/h1
hr
font size =6 Enjoy the Tune /font
hr
br
font size = 4Tone Row:/font
/center


/html
?

fwrite($f,2\n);
fwrite($f,$tune\n);
fwrite($f,$tempo\n);
fwrite($f,$form\n);
fwrite($f,$tonerow\n);
fwrite($f,1\n);
fwrite($f,tune.sco\n);
fwrite($f,3\n);
fclose($f);

echo($inst);

if($inst == '2');
{
$fp = fopen(xtune.sco,r);

$txtarr = array();
$linenum = 1;
$linetext =  ;

while (!feof($fp))
{

$ch = fgetc($fp);
$linetext .= $ch;

if ($ch ==\n)
{

$txtarr[$linenum] = $linetext;
$linenum++;
$linetext =  ;
}
}

$txtarr[2] = f1 0 512 10 1 .9 .9 .8 .7 .33\n;

$remove = rm xtune.sco;
`$remove`;
$change  = fopen(xtune.sco,w);
$line = $linenum;

$n=0;
print_r($txtarr);

while ($n = $line)
{
fwrite($change,$txtarr[$n]);
$n++;
}

_
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx


-- 
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] Text editor for linux

2002-02-18 Thread Chris Lott

 Anyone know of a good text editor for linux, WITH syntax highlighting for
 php/html + other languages?

emacs. There is no alternative. :)

c
--
Chris Lott
http://www.chrislott.org/


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




[PHP] get_browser();

2002-02-18 Thread Chris Boget

The following example that is in the onsite documentation:

?
function list_array ($array) {
while (list ($key, $value) = each ($array)) {
$str .= b$key:/b $valuebr\n;
}
return $str;
}
echo $HTTP_USER_AGENThr\n;
$browser = get_browser();
echo list_array ((array) $browser);
?

Isn't working as described in the example output provided on
the page.  In fact, half the time, get_browser() is returning
nothing.  And HTTP_USER_AGENT is only returning:

Mozilla/4.7 [en] (Win95; I)

for Netscape.  Why isn't it (get_browser()) providing all the
information as displayed in the example provided in the docs?

Ultimately, I'm trying to figure out how I can determine if the
user is using NS 4.x or not...

Chris


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




Re: [PHP] implement yourname.mysite.com redirection

2002-02-18 Thread Chris Lott


 You can also do this via a PHP script, which is what I do.  I have 5 URLs
 all going to the same site (500 megs disk space).  I parse the subdomain,
 and re-driect to the appropriate sub-directory.

So do you have this code running on every page or does it only redirect from
the index page or ??

c
--
Chris Lott
http://www.chrislott.org/



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




Re: [PHP] NULL Apache environment variables

2002-02-18 Thread Neil Freeman

Have a look at the function getenv()..

eg:
$ip = getenv (REMOTE_ADDR); // get the ip number of the user

HTH

Neil

Narvaez, Teresa wrote:

 Hello,
 I'm running PHP version 4.1.1.  When I invoke this function, ?php
 phpinfo()?, all variables are set.  However, when I try to retrieve a value
 of a certain variable like this:

   ?php echo $HTTP_USER_AGENT; ?

 It returns NULL.  Is there a missing configuration on apache or php?

 Thanks,
 -Teresa

 ***
  This message was virus checked with: SAVI 3.53 Jan 2002
  last updated 30th January 2002
 ***

--

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]




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




RE: [PHP] implement yourname.mysite.com redirection

2002-02-18 Thread Rick Emery

Only re-directed from the index.html page.

My web-host service is set-up so that .HTML suffix files can execute PHP
script files without re-directing to them.

-Original Message-
From: Chris Lott [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 18, 2002 11:49 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] implement yourname.mysite.com redirection



 You can also do this via a PHP script, which is what I do.  I have 5 URLs
 all going to the same site (500 megs disk space).  I parse the subdomain,
 and re-driect to the appropriate sub-directory.

So do you have this code running on every page or does it only redirect from
the index page or ??

c
--
Chris Lott
http://www.chrislott.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] zend studio 2.0

2002-02-18 Thread DL Neil

Zeev,

Didn't experience any stability problems with the beta per-se, but using a Windows box 
was an exercise in
Unix-ification. Has the released version for Win32 seen significant alterations to the 
GUI?

=dn

- Original Message -
From: Zeev Suraski [EMAIL PROTECTED]
To: Chris Lott [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: 18 February 2002 15:57
Subject: Re: [PHP] zend studio 2.0


 Chris,

 Stability improved *a lot* since the beta in December.  Remember, it *was*
 a beta release, and like most betas, stability was not perfect.  It's quite
 good now, and it also got a whole new (well, mostly new) code completion
 engine which is really revolutionary for PHP.
 I'm not objective, obviously, but in my opinion, the integrated debugging
 and the powerful code completion engine make the Zend Studio the
 environment that gets the job done in the quickest way possible, way faster
 than any text editor out there.  We also think a lot about keyboard-only
 users, so default focus locations and tab order, accessibility to all of
 the functionality from the keyboard, etc. - are things which we worked on
 quite a lot.  There's always room for improvement, but it's pretty good in
 2.0.0 as it is.

 Much more is coming in upcoming versions - you guys are all more than
 welcome to provide feedback about things you'd like to see in future
 versions of the studio (www.zend.com/store/products/studio-feedback.php, or
 by mailing me directly).

 Zeev

 At 03:12 18/02/2002, Chris Lott wrote:
 I hope we aren't going to get another chest-pounding real coders type of
 argument going here. Homesite *IS* a text editor. It provides an amazing
 number of shortcuts to tasks, including mouse-based tasks, many of which I
 guarantee you I can get done faster with a mouse than anyone can typing. It
 also offers a lot of pseudo-time-saving features as well, for which one
 would be better of learning to do it manually. But it isn't a GUI in any
 real sense as, say, Dreamweaver is. TextPad is at least as much of a GUI as
 Homesite in that respect.
 
 I use both of these great tools a lot... none of them are the stigmata of
 the under-developed programmer. People should use what they want, but don't
 dump on everyone who realizes that clicking a button or using a keyboard
 shortcut in something like Homesite or Textpad to create common HTML
 structures or PHP control structures is always going to be faster than
 typing them out by hand, no matter how craven a Notepad warrior one might
 be.
 
 Zend looks pretty good in terms of providing what I like in a development
 environment, particularly real debugging... unfortunately it was definitely
 not particularly stable when I last tried it in late December.
 
 Integrated debugging, syntax coloring, function reference, keyboard
 shortcuts-- these are all useful tools. TextPad has good PHP dictionaries,
 Homesite handles PHP well. Homesite is STILL the only editor I have found
 that enables an easy preview through the server mapping so that I can,
 with one touch toggle between my editing and the live code through my local
 development server, something that saves a lot of time vs jockeying between
 windows with other tools.
 
 Not all mouse use is just waving one's hands through the air, none of the
 programs mentioned are particularly mouse-centric.
 
 c
 --
 Chris Lott
 http://www.chrislott.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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Returning table rows from MySQL

2002-02-18 Thread Scott Saraniero

Hi.

I've got a piece of code below that works great for me. Now I would like to
modify the rows with alternating colors in the displayed results. Any
suggestions on how to do this?

?php

$Host = ;
$User = ;
$Password = ;
$DBName = ;
$TableName = ;

$Link = mysql_connect($Host, $User, $Password);

$Query = SELECT * FROM $TableName;

$Result = mysql_db_query($DBName, $Query, $Link);



print (table border=1 width=\65%\ cellpadding=3 align=center);
print (tr);
print (th class=\textOnWhite\Song/th);
print (th class=\textOnWhite\Artist/th);

while ($Row =mysql_fetch_array($Result)) {
print (tr);
print (td class=\textOnWhite\$Row[song]/td);
print (td class=\textOnWhite\$Row[artist1] $Row[artist]/td);

print /tr;

}
print /table;




mysql_close($Link);

?

Thanks,
Scott


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




RE: [PHP] Returning table rows from MySQL

2002-02-18 Thread Rick Emery

?php

$Host = ;
$User = ;
$Password = ;
$DBName = ;
$TableName = ;

$Link = mysql_connect($Host, $User, $Password);

$Query = SELECT * FROM $TableName;

$Result = mysql_db_query($DBName, $Query, $Link);


$ctr = 1;
print (table border=1 width=\65%\ cellpadding=3 align=center);
print (tr);
print (th class=\textOnWhite\Song/th);
print (th class=\textOnWhite\Artist/th);

while ($Row =mysql_fetch_array($Result)) {
print (tr);
$ctr = -$ctr;
if( $ctr == 1) {
print (td class=\textOnWhite\$Row[song]/td);
print (td class=\textOnWhite\$Row[artist1] $Row[artist]/td);
}
else {
print (td class=\textOnRed\$Row[song]/td);
print (td class=\textOnred\$Row[artist1] $Row[artist]/td);
}

print /tr;

}
print /table;




mysql_close($Link);

?

Thanks,
Scott


-- 
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] Reading PHP Session Files?

2002-02-18 Thread Devin Atencio

I have a program that saves session information into the database. It saves the session
info much like the PHP4 session files. I need to allow my script to pull the session 
info
out of the database then update one of the fields and then write back out the entire
session string back to the database, how can i do this?

The session info in the database looks like this:

a:1:{i:0;a:7:{s:2:id;s:16:Default identity;s:8:fullname;s:13:Devin 
Atencio;s:9:from_addr;s:0:;s:12:replyto_addr;s:0:;s:9:signature;s:0:;s:10:sig_dashes;i:0;s:9:sig_first;i:0;}}





RE: [PHP] Reading PHP Session Files?

2002-02-18 Thread Rick Emery

You, of course, recognize this as serialized data.  Therefore, simply use
unserialize(), change the data value, the serialize() it again.

-Original Message-
From: Devin Atencio [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 18, 2002 12:09 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Reading PHP Session Files?


I have a program that saves session information into the database. It saves
the session
info much like the PHP4 session files. I need to allow my script to pull the
session info
out of the database then update one of the fields and then write back out
the entire
session string back to the database, how can i do this?

The session info in the database looks like this:

a:1:{i:0;a:7:{s:2:id;s:16:Default identity;s:8:fullname;s:13:Devin
Atencio;s:9:from_addr;s:0:;s:12:replyto_addr;s:0:;s:9:signature;s
:0:;s:10:sig_dashes;i:0;s:9:sig_first;i:0;}}



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




RE: [PHP] get_browser();

2002-02-18 Thread Alastair Battrick

Have you got the browscap.ini file installed properly ?

and

have you got a up to date version of browscap.ini ?

and

What is reported by IE visitng the script ?


Alastair

 -Original Message-
 From: Chris Boget [mailto:[EMAIL PROTECTED]]
 Sent: 18 February 2002 17:48
 To: [EMAIL PROTECTED]
 Subject: [PHP] get_browser();
 
 
 The following example that is in the onsite documentation:
 
 ?
 function list_array ($array) {
 while (list ($key, $value) = each ($array)) {
 $str .= b$key:/b $valuebr\n;
 }
 return $str;
 }
 echo $HTTP_USER_AGENThr\n;
 $browser = get_browser();
 echo list_array ((array) $browser);
 ?
 
 Isn't working as described in the example output provided on
 the page.  In fact, half the time, get_browser() is returning
 nothing.  And HTTP_USER_AGENT is only returning:
 
 Mozilla/4.7 [en] (Win95; I)
 
 for Netscape.  Why isn't it (get_browser()) providing all the
 information as displayed in the example provided in the docs?
 
 Ultimately, I'm trying to figure out how I can determine if the
 user is using NS 4.x or not...
 
 Chris
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php

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




RE: [PHP] Returning table rows from MySQL

2002-02-18 Thread Ford, Mike [LSS]

 -Original Message-
 From: Scott Saraniero [mailto:[EMAIL PROTECTED]]
 Sent: 18 February 2002 18:02
 To: [EMAIL PROTECTED]
 
 I've got a piece of code below that works great for me. Now I 
 would like to
 modify the rows with alternating colors in the displayed results. Any
 suggestions on how to do this?

Easy one: see additional/changed lines below:

 
 ?php
 
 $Host = ;
 $User = ;
 $Password = ;
 $DBName = ;
 $TableName = ;
 
 $Link = mysql_connect($Host, $User, $Password);
 
 $Query = SELECT * FROM $TableName;
 
 $Result = mysql_db_query($DBName, $Query, $Link);
 
 
 
 print (table border=1 width=\65%\ cellpadding=3 align=center);
 print (tr);
 print (th class=\textOnWhite\Song/th);
 print (th class=\textOnWhite\Artist/th);

  print /tr;  // ** missing in your original!! **

  $alt_color = TRUE;

 
 while ($Row =mysql_fetch_array($Result)) {
 print (tr);
  $class = $alt_color ? 'textOnColor' : 'textOnWhite';
 print (td class=\$class\$Row[song]/td);
 print (td class=\$class\$Row[artist1] 
 $Row[artist]/td);
 
 

  $alt_color = !$alt_color;
 
 }
 print /table;
 
 
 
 
 mysql_close($Link);
 
 ?
 
 Thanks,
 Scott
 
 
 -- 
 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] http_referer

2002-02-18 Thread tom hilton

Hi,

I am trying to pull http_referer info on users accessing a certain page, but
am not having any luck. When I run phpinfo(), the referer information is
listed with all the other server variables, but when I pull a list of the
server variables as an array and print them, they all appear except for the
http_referer variable.  Does anyone have any idea of why this one variable
might not be available as part of the server array, put is accessible by
phpinfo()?



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




RE: [PHP] http_referer

2002-02-18 Thread Rick Emery


Try accessing the variable:  $HTTP_REFERER
without specifying the array.  it works for me


-Original Message-
From: tom hilton [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 18, 2002 12:25 PM
To: [EMAIL PROTECTED]
Subject: [PHP] http_referer


Hi,

I am trying to pull http_referer info on users accessing a certain page, but
am not having any luck. When I run phpinfo(), the referer information is
listed with all the other server variables, but when I pull a list of the
server variables as an array and print them, they all appear except for the
http_referer variable.  Does anyone have any idea of why this one variable
might not be available as part of the server array, put is accessible by
phpinfo()?



-- 
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] PHP and HTTPS

2002-02-18 Thread wm

hi.

wondering if anybody has any insight into this.

i have written some PHP scripts that work every single time under http.

under https (we have a valid security certificate) they work every
single time on IE on mac and on NN on mac and pc.

on IE on pc a this page cannot be displayed error (with possible
reasons like your browser needs to be set to accept SSL2 and SSL3 [it is
by the way]) is generated half of the time. the other half it works.

again, it works every time under http.

i have spent literally 10 hours trying to error trap. there is no
pattern whatsover. the exact same data being posted will produce an
error half of the time and will work the other half.

i'm assuming then that this must be some server side config problem???

does anybody have any ideas as to the solution for this?

it's killing me.

thanks.


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




Re: [PHP] Returning table rows from MySQL

2002-02-18 Thread Matt Drake

On Mon, 18 Feb 2002, Scott Saraniero wrote:

 I've got a piece of code below that works great for me. Now I would like to
 modify the rows with alternating colors in the displayed results. Any
 suggestions on how to do this?

Try this:

$Count = 0;
while ($Row = mysql_fetch_array($Result) {
print(tr);
print('td ');
if($Count % 2)
print ('class=textOnWhite)';
else
print ('class=textOnGray)';
print('');

...
$Count++;
}

You could probably replace $Count with some mysql function (it would be named 
something like
mysql_current_row($Result)), but I obviously don't know that much about it.

Matt



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




[PHP] major redirection woes!

2002-02-18 Thread DigitalKoala

hi folks,

i've been tearing my hair out over a redirection problem ... but i can't
seem to find a satisfactory solution.

i'm sending some variables to a script on an external webpage, the webpage
sends me the data i need back.. except that this page goes through a
redirect page...

i want to keep this redirect page hidden from the end user.

i cannot link directly to the redirect target, as the redirection is
actually retrieving essential data from elsewhere before arriving at its
destination.

also i tried using fopen to read the complete html from this fetch, parse it
and retrieve the data that i want.. but this is so slow.

is there a way i can just get the results from the final html page and
display that to the user directly?

i hope i've explained this clearly enough :)

thanks for your help!!

dk




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




Re: [PHP] PHP and HTTPS

2002-02-18 Thread Matt Drake

On Mon, 18 Feb 2002, wm wrote:

 i have written some PHP scripts that work every single time under http.

 under https (we have a valid security certificate) they work every
 single time on IE on mac and on NN on mac and pc.

 on IE on pc a this page cannot be displayed error (with possible
 reasons like your browser needs to be set to accept SSL2 and SSL3 [it is
 by the way]) is generated half of the time. the other half it works.

Do you have any static HTML pages in your SSL-protected area? How do those work?

If they have the same problem, you can eliminate PHP from the equation...if
not, you can focus more directly on PHP.

Matt


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




Re: [PHP] zend studio 2.0

2002-02-18 Thread Zeev Suraski

At 19:53 18/02/2002, DL Neil wrote:
Zeev,

Didn't experience any stability problems with the beta per-se, but using a 
Windows box was an exercise in
Unix-ification. Has the released version for Win32 seen significant 
alterations to the GUI?

I'm not sure which beta you've seen, but the GUI is very Windowish (I use 
Windows as my desktop OS).

Zeev


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




Re: [PHP] zend studio 2.0

2002-02-18 Thread robert janeczek

 The problems you were having with the server components of the studio
sound
 quite odd - can you elaborate on them?  (probably off-list, it's best if
 you could submit a bug report about it through zend.com/store/pickup.php,
 evaluation support).

 This is water under the bridge now, but you could also install the server
 components of the studio onto your existing Apache installation instead of
 reinstalling it.  Maybe the uninstall/reinstall brought some mess into
your
 system...

like i wrote to zeev privately - it probably was my fault and i`ll try
installing again all the tools.

rash



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




[PHP] Re: PHP and HTTPS

2002-02-18 Thread Michael Kimsal

Wm wrote:
 hi.
 
 wondering if anybody has any insight into this.
 
 i have written some PHP scripts that work every single time under http.
 
 under https (we have a valid security certificate) they work every
 single time on IE on mac and on NN on mac and pc.
 
 on IE on pc a this page cannot be displayed error (with possible
 reasons like your browser needs to be set to accept SSL2 and SSL3 [it is
 by the way]) is generated half of the time. the other half it works.
 
 again, it works every time under http.
 
 i have spent literally 10 hours trying to error trap. there is no
 pattern whatsover. the exact same data being posted will produce an
 error half of the time and will work the other half.
 
 i'm assuming then that this must be some server side config problem???
 
 does anybody have any ideas as to the solution for this?
 
 it's killing me.


We've worked with this several times - it's an issue with IE under 
Windows.  The claim is that it only affect 'high security' (SGP or 
something) but my own experience is that it's always affected.  IE
just won't work right with SSL if the web server isn't IIS.  You pretty 
much have no choice but to live with it or move to IIS as a server platform.


Michael Kimsal
http://www.tapinternet.com/php
734-480-9961
aim:mgkimsal



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




Re: [PHP] Unsubscribe s.osborne

2002-02-18 Thread Erik Price

Yes, me too (to verify) --

Check the archives for Friday, you'll see that this has been ongoing for 
a few days.

Thank you


Erik


On Monday, February 18, 2002, at 12:24  PM, Rick Emery wrote:

 List Moderator,

 Can you please unsubscribe s.osborne

 Every post I send earns a Postmaster - Cannot Deliver return.
 
 -Original Message-
 From: Postmaster [mailto:Postmaster]
 Sent: None
 To: [EMAIL PROTECTED]
 Subject: Error delivering message to: [EMAIL PROTECTED]!


 Your message was not delivered for the following reason:

 E-mail Account: s.osborne is over the limit of 31457280 bytes.

 Automated Postmaster

 Original E-mail
 From [EMAIL PROTECTED]  Mon Feb 18 11:22:32 2002
 Return-Path: [EMAIL PROTECTED]
 Received: from pb1.pair.com ([216.92.131.4]) by  ; Mon, 18 Feb 2002 
 11:22:32
 -0600
 Received: (qmail 5408 invoked by uid 1010); 18 Feb 2002 17:22:12 -
 Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
 Precedence: bulk
 list-help: mailto:[EMAIL PROTECTED]
 list-unsubscribe: mailto:[EMAIL PROTECTED]
 list-post: mailto:[EMAIL PROTECTED]
 Delivered-To: mailing list [EMAIL PROTECTED]
 Received: (qmail 5392 invoked from network); 18 Feb 2002 17:22:09 -
 Message-ID: 
 [EMAIL PROTECTED]
 From: Rick Emery [EMAIL PROTECTED]
 To: 'Adrian Murphy' [EMAIL PROTECTED],
   [EMAIL PROTECTED]
 Date: Mon, 18 Feb 2002 11:21:22 -0600
 MIME-Version: 1.0
 X-Mailer: Internet Mail Service (5.5.2653.19)
 Content-Type: text/plain;
   charset=iso-8859-1
 Subject: RE: [PHP] implement yourname.mysite.com redirection
 X-Rcpt-To: [EMAIL PROTECTED]

 You can also do this via a PHP script, which is what I do.  I have 5 
 URLs
 all going to the same site (500 megs disk space).  I parse the 
 subdomain,
 and re-driect to the appropriate sub-directory.

 Actually, you don't even need to parse the URL for sub-domain.  Just 
 search
 for the yourname.mysite.com as a string in the database and then
 re-direct.  You don't needt vitual hosts to accomplish this.  HOWEVER, 
 you
 do need access to your DNS so that you can create A and CNAME records
 therein.

 -Original Message-
 From: Adrian Murphy [mailto:[EMAIL PROTECTED]]
 Sent: Monday, February 18, 2002 3:48 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] implement yourname.mysite.com redirection


 Hi,
 I'd like to implement a system whereby people have a subdomain on my 
 site
 like so:
 yourname.mysite.com
 I've been reading the apache docs that say you can do this via virtual
 hosts.
 Can I do it so 'yourname' can be anything - where all requests are sent
 to the same page where i can parse the uri and query a db based on
 'yourname'.
 any reason why my isp might be reluctant to do this.I'm presuming I 
 can't
 do it via .htaccess?
 as a side note what are the affects of this kind of redirection as far 
 as
 search engines
 go.I've heard that doing this kind of thing on a 404 page is a bad idea.

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









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] zend studio 2.0

2002-02-18 Thread Scott

FYI-

My two cents.  I have been running the demo version since a day or two 
after it was released.  On Windows 2000 it has been solid as a rock.  I 
have not tried it on my XP laptop yet, but will soon.  

Zend Studio is really helping to make PHP 'legitimate' in the 
corporate world since it now has a great tool!  Home Site is ok, 
but not PHP specific, only color codes.

Matter of fact my boss was so impressed he is ordering 4 copies for our 
staff!  Nice job guys!

-Scott



On Mon, 18 Feb 2002, Zeev Suraski wrote:

 At 19:53 18/02/2002, DL Neil wrote:
 Zeev,
 
 Didn't experience any stability problems with the beta per-se, but using a 
 Windows box was an exercise in
 Unix-ification. Has the released version for Win32 seen significant 
 alterations to the GUI?
 
 I'm not sure which beta you've seen, but the GUI is very Windowish (I use 
 Windows as my desktop OS).
 
 Zeev
 
 
 

-- 



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




Re: [PHP] http_referer

2002-02-18 Thread Erik Price


In PHP4.1 or later, try:

echo $_SERVER['HTTP_REFERER'];


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] Re: preg_match vs ereg etc

2002-02-18 Thread CC Zona

In article [EMAIL PROTECTED],
 [EMAIL PROTECTED] (Digitalkoala) wrote:

 I was just wondering what your opinions were on using preg_match, preg_split
 instead of ereg and explode?
 
 I have to write a  script to parse a lot of html and text files.. and I'm
 looking to use the fastest possible functions to do this...

preg_match() vs. ereg(): preg_* functions are supposed to be siginficantly 
faster than their ereg_* equivalents, so preg_match() should be the 
winner here.

preg_split() vs. explode(): these aren't equivalent functions.  The 
former splits on a regular expression; the latter splits on a string value.

-- 
CC

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




Re: [PHP] php blocking functions

2002-02-18 Thread Sofhian Mahat

Hey List,

That is a great question.  I too would like to know.  Does anyone on this list know 
anything about this?

Thanks,
Chad
  - Original Message - 
  From: Sofhian Mahat 
  To: [EMAIL PROTECTED] 
  Sent: Saturday, February 16, 2002 9:33 PM
  Subject: [PHP] php blocking functions


  Hello everyone,

  I am searching for an alternate way to accomplish user synchronization.

  I would like two or more users to block on the read of some stream, so that when one 
person writes to it, the other person(s) will read it.  The only way I currently know 
to do this is with the socket functions.  However, this poses a small problem.  If I 
use the socket functions, I have to keep a script running on the server at all times.  
I would really like to have users block at the end of a file until new information is 
appended.  I certainly don't want to have all my clients sit in infinite while loops, 
and I'm sure my isp doesn't either.  I may be shit out of luck anyway, if they are 
killing processes that run for too long.

  I appreciate any and all suggestions.  If someone knows exactly which functions 
block, aside from the socket functions, could you please tell me?  Thank you.

  Respectfully,
  Chad


[PHP] Php Enum Field

2002-02-18 Thread Wee Chua

Hi all,
How can I get the preset values for Enum field inside the table. For
example, table A has a field called AccessRight, the enum fields are
Read,Add,Delete. How can I write the query to get these values out from
AccessRight field?

Thanks,
Wee

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




[PHP] Re: PHP and HTTPS

2002-02-18 Thread J Smith


Sourceforge has a bit on this, too. Basically, they have a checkbox that 
lets you drop out of SSL after you login, so your username and password 
aren't sent over the wire in plaintext. However, after that, everything is 
plaintext, no SSL at all. Useful if you want to keep your password safe 
during transmission, but it sucks that everything can't be encrypted.

I haven't had any problems yet myself, but I've included that option in the 
stuff I work on just in case. I'm using apache 1.3.22, PHP 4.1.1 and 
mod_ssl 1.3.22. Seems to work so far, at least. (Although getting Konqueror 
to work it under KDE 2.2.2 is another story...)

J



Michael Kimsal wrote:

 Wm wrote:
 
 
 We've worked with this several times - it's an issue with IE under
 Windows.  The claim is that it only affect 'high security' (SGP or
 something) but my own experience is that it's always affected.  IE
 just won't work right with SSL if the web server isn't IIS.  You pretty
 much have no choice but to live with it or move to IIS as a server
 platform.
 
 
 Michael Kimsal
 http://www.tapinternet.com/php
 734-480-9961
 aim:mgkimsal


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




Re: [PHP] code

2002-02-18 Thread Tyler Longren

make sure you're doing it like this:
if ($inst == 1) {
// do this
}
else {
   // do something else
}

instead of this:
if ($inst = 1) {
// do this
}
else {
// do this
}

Just a thought.

Tyler

- Original Message -
From: John Gurley [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, February 18, 2002 10:28 AM
Subject: [PHP] code


 not trying to be sneaky or hide anything, the only thing is that it is a
 long code and what ever is wrong with what I am using it will not let me
 paste the code over!?!
 when I echo $inst i get the expected result (i.e. 1 or 2) but even if the
 result is 1 it goes into the loop...and yes the select method is in the
html
 code.

 thanks again...sorry I'm making life so difficult by not including enough
 code...I'll try again and post it if I am able to paste it.

 _
 Join the world's largest e-mail service with MSN Hotmail.
 http://www.hotmail.com


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




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




[PHP] Re: got the code

2002-02-18 Thread J Smith


Could you please leave the subject alone when you're following up on a 
thread. It's hard to follow what you're talking about when we can't see the 
references to the other parts of the thread.

As for your problem, try removing the semi-colon after the if ($inst == 
'2') statement. It's a simple logic error.

J



John Gurley wrote:

 
 here is a larger chunk of the code:
 
snip

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




RE: [PHP] Php Enum Field

2002-02-18 Thread Rick Emery

I must not understand your question.

As you've asked it, the answer is:
SELECT AccessRight FROM tableA;

-Original Message-
From: Wee Chua [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 18, 2002 1:27 PM
To: PHP (E-mail)
Subject: [PHP] Php Enum Field


Hi all,
How can I get the preset values for Enum field inside the table. For
example, table A has a field called AccessRight, the enum fields are
Read,Add,Delete. How can I write the query to get these values out from
AccessRight field?

Thanks,
Wee

-- 
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] Php Enum Field

2002-02-18 Thread Wee Chua

Sorry, my question was how can I retrieve the preset Enum values from
AccessRight field property? Thanks.

-Original Message-
From: Rick Emery [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 18, 2002 2:51 PM
To: 'Wee Chua'; PHP (E-mail)
Subject: RE: [PHP] Php Enum Field


I must not understand your question.

As you've asked it, the answer is:
SELECT AccessRight FROM tableA;

-Original Message-
From: Wee Chua [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 18, 2002 1:27 PM
To: PHP (E-mail)
Subject: [PHP] Php Enum Field


Hi all,
How can I get the preset values for Enum field inside the table. For
example, table A has a field called AccessRight, the enum fields are
Read,Add,Delete. How can I write the query to get these values out from
AccessRight field?

Thanks,
Wee

-- 
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: Polymorphism in PHP

2002-02-18 Thread Richard Fox

That's right, the difference between C++ pure virtual and virtual is
that a virtual function has an implementation but pure virtual only defines
an interface.

But can we get back to my original PHP question: Can I do something like the
following in php:

class Base {
   function Foo() { echo Base; }
   }

class Derived1 extends Base {
   function Foo() { echo Derived1; }
   }

class Derived2 extends Base {
   function Foo() { echo Derived2; }
   }

function Example ( $objvar ) {
   $objvar-Foo();
   }

...

$obj1 = new Base();
$obj2 = new Derived1();
$obj3 = new Derived2();
Example($obj1);
Example($obj2);
Example($obj3);

I think what I am asking is, is there any concept of a virtual function in
PHP, with a virtual function table?

Rich


-Original Message-
From: Martin Towell [mailto:[EMAIL PROTECTED]]
Sent: Sunday, February 17, 2002 5:31 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Polymorphism question


A bit late in replying - but what the hay (or is that hey??) oh well...

From my understanding of virtual functions (and it's been at least 3 to 4
years since I've done C++) is that a virtual function has basic
functionality and a pure virtual function has no, and can't have, and
code.

Please correct me if I'm wrong

Martin


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




Re: [PHP] Php Enum Field

2002-02-18 Thread Chris Lott

 Sorry, my question was how can I retrieve the preset Enum values from
 AccessRight field property? Thanks.

Untested, but I think I remember:

$result = mysql_query(SHOW COLUMNS FROM main LIKE `colname`);

c
--
Chris Lott
http://www.chrislott.org/


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




RE: [PHP] Re: Polymorphism in PHP

2002-02-18 Thread Rick Emery

I must be missing something in your question, because I just tried your
script below and it worked as advertised.

Did you try the script and it failed?

-Original Message-
From: Richard Fox [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 18, 2002 2:13 PM
To: PHP
Subject: [PHP] Re: Polymorphism in PHP


That's right, the difference between C++ pure virtual and virtual is
that a virtual function has an implementation but pure virtual only defines
an interface.

But can we get back to my original PHP question: Can I do something like the
following in php:

class Base {
   function Foo() { echo Base; }
   }

class Derived1 extends Base {
   function Foo() { echo Derived1; }
   }

class Derived2 extends Base {
   function Foo() { echo Derived2; }
   }

function Example ( $objvar ) {
   $objvar-Foo();
   }

...

$obj1 = new Base();
$obj2 = new Derived1();
$obj3 = new Derived2();
Example($obj1);
Example($obj2);
Example($obj3);

I think what I am asking is, is there any concept of a virtual function in
PHP, with a virtual function table?

Rich


-Original Message-
From: Martin Towell [mailto:[EMAIL PROTECTED]]
Sent: Sunday, February 17, 2002 5:31 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Polymorphism question


A bit late in replying - but what the hay (or is that hey??) oh well...

From my understanding of virtual functions (and it's been at least 3 to 4
years since I've done C++) is that a virtual function has basic
functionality and a pure virtual function has no, and can't have, and
code.

Please correct me if I'm wrong

Martin


-- 
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] get_browser();

2002-02-18 Thread Erik Price


On Monday, February 18, 2002, at 12:47  PM, Chris Boget wrote:

 Isn't working as described in the example output provided on
 the page.  In fact, half the time, get_browser() is returning
 nothing.  And HTTP_USER_AGENT is only returning:

 Mozilla/4.7 [en] (Win95; I)

 for Netscape.  Why isn't it (get_browser()) providing all the
 information as displayed in the example provided in the docs?

 Ultimately, I'm trying to figure out how I can determine if the
 user is using NS 4.x or not...

Hm.  I don't have the exact answer to your question, but keep in mind 
that this kind of information depends on the user-agent -- you're not 
guaranteed to get any information, as some user-agents handle headers in 
nonconformant ways.


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] Timed Redirect

2002-02-18 Thread Steven Walker

Is there way to have a page automatically redirect the user to another 
page, but with a timed delay?

I'm working on a purchasing system. After a successful purchase, a thank 
you page is shown, and then I want to take the user to a download page a 
few seconds afterward.

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




  1   2   >