[PHP] pdf question

2003-09-30 Thread Floyd Baker
Hello...

I have created a routine which outputs a pdf file of 'data only'.
It is to be printed onto a pdf form which I obtain elsewhere.

At present we are printing the blank form.  Then placing it into the
paper tray in order to print the data file to it.  

I would like to cause the data and form to both be printed on a single
sheet, in one operation.  That is; is it possible to cause the two
files to be accessed in sequence, so that there is not a paper feed
between them?  For one to overlay the other?  

Many thanks

Floyd 


--

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



Re: [PHP] pdf routine - good local / bad online

2003-06-26 Thread Floyd Baker
On Thu, 26 Jun 2003 10:40:46 +1000, you wrote:

Is the pdf module being loaded on the linux machine?
What is the error message (if any) that's displayed at the create handle
bit ?

Martin


It just stops dead.  The body color is still there on the screen but
there is no more output to the screen nor is the pdf file produced.

I'm too lite on linux for the module question.  I'll have the guru
look into that...  Thanks.  


-Original Message-
From: Floyd Baker [mailto:[EMAIL PROTECTED]
Sent: Thursday, 26 June 2003 10:32 AM
To: [EMAIL PROTECTED]
Subject: [PHP] pdf routine - good local / bad online



Hi.

I have a routine creating a pdf file.  Here is the script that works
on the win98 dev box.   But when I upload it to the linux online, it
does not work.

It stops at 'create handle'.  Can someone please tell me why?

// GET COMPANY INFO
   while($row = mysql_fetch_array($mysql_result)){
   $name1 = $row['name1'];
   $name2 = $row['name2'];
   $addr1 = $row['addr1'];
   $addr2 = $row['addr2'];
   $city = $row['city'];
   $stat = $row['stat'];
   $zipc = $row['zipc'];
   $phone = $row['phone'];}

// START PDF FILE
   unlink('f:/localhost/adobe/' . $cocode . '_info.pdf');  

// create handle for new PDF document
   pdf_delete($pdf);
   $pdf = pdf_new();

// open a file 
   pdf_open_file($pdf, 'f:/localhost/adobe/' . $cocode . '_info.pdf');


I do change the 'f:/localhost' to https://xx.xx.xx,xx when uploaded.

Any thoughts will be greatly appreciated...  TIA

Floyd

--

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



[PHP] pdf routine - good local / bad online

2003-06-25 Thread Floyd Baker

Hi.

I have a routine creating a pdf file.  Here is the script that works
on the win98 dev box.   But when I upload it to the linux online, it
does not work.

It stops at 'create handle'.  Can someone please tell me why?

// GET COMPANY INFO
   while($row = mysql_fetch_array($mysql_result)){
   $name1 = $row['name1'];
   $name2 = $row['name2'];
   $addr1 = $row['addr1'];
   $addr2 = $row['addr2'];
   $city = $row['city'];
   $stat = $row['stat'];
   $zipc = $row['zipc'];
   $phone = $row['phone'];}

// START PDF FILE
   unlink('f:/localhost/adobe/' . $cocode . '_info.pdf');  

// create handle for new PDF document
   pdf_delete($pdf);
   $pdf = pdf_new();

// open a file 
   pdf_open_file($pdf, 'f:/localhost/adobe/' . $cocode . '_info.pdf');


I do change the 'f:/localhost' to https://xx.xx.xx,xx when uploaded.

Any thoughts will be greatly appreciated...  TIA

Floyd

--

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



Re: [PHP] Re: Long screen display cut short.

2003-06-02 Thread Floyd Baker

Thanks for the guidance guys...  

Going on the idea that it was indeed a problem with script, arrays,
etc., I found a few things.  The display was well over 9000 characters
before it failed, so that 8k max thing was unlikely in this case.  But
it seems to have been fixed by other things done.  They all happened
at more or less the same time so not sure which was the culprit.

The first had to do with session_bug_compat_42.  The ini is supposed
to allow the error message to be shut off but doesn't.  I started to
get that error so the only way to eliminate it was to find the reason.
It turned out it was an empty table that caused it.

The next was a field name typo in an input query.  

Third, another table was corrupt to the point of being 'occupied',
when looked at with phpMyAdmin.  Even so, my program had seemed to run
fine otherwise.   

All in all, I'm happy for finding all these things.  We all should
have more difficulties, eh?  It would do us good.  g  Just kidding.

I have not yet tried too hard to reintroduce the problem.  If I take
the time or have other news, I'll be sure to post it.

Thanks again.

Floyd   
 



On Fri, 30 May 2003 21:02:05 -0400, you wrote:

Well, I don't know if this might be it, but a while back, I had problems
with apache + php (forget which version) and a bug in php that cause memory
problems.

I was using an array to store fairly large amounts of data. What would
happen is something similar to what you describe. Modifying the code to
avoid using an array solved the problem. Have not had the problem since
upgrading php.

Martin

Floyd Baker [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]

 Hello...

 I have a routine that works fine on local win98 but when it runs on
 linux online, the screen output is cut short.  I have lengthened the
 30 second script time max to 45 but that made no difference at all.

 Depending on the particulars, the routine stops at a certain spot.  If
 it is rerun, it stops at the very same spot again.  Putting in other
 particulars cause it to stop at a different point, further down.  It
 seems that changes which affect the number of mysql calculations, make
 some difference in the length of the screen display, but it's only a
 minor amount.  It cuts off somewhere around 4 pages.

 Any ideas please.

 Floyd

 --

--

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



Re: [PHP] Re: Long screen display cut short.

2003-06-01 Thread Floyd Baker
On Sat, 31 May 2003 13:18:13 +, you wrote:

what is the online-version?
I mean which webserver-software in which version?


Thomas

Linux  RH 7.3
Apache 1.3.24
mySql  3.23.55 
PHP4.2.0  

Also, this is an httpS connection if it makes a difference in some
way.

Floyd





On Fri, 30 May 2003 20:45:08 -0400 [EMAIL PROTECTED] (Floyd Baker) wrote:

 
 Hello...
 
 I have a routine that works fine on local win98 but when it runs on
 linux online, the screen output is cut short.  I have lengthened the
 30 second script time max to 45 but that made no difference at all.  
 
 Depending on the particulars, the routine stops at a certain spot.  If
 it is rerun, it stops at the very same spot again.  Putting in other
 particulars cause it to stop at a different point, further down.  It
 seems that changes which affect the number of mysql calculations, make
 some difference in the length of the screen display, but it's only a
 minor amount.  It cuts off somewhere around 4 pages.
 
 Any ideas please. 
 
 Floyd
 
 --

--

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



Re: [PHP] Re: Long screen display cut short.

2003-06-01 Thread Floyd Baker



Yes, there are a bunch of arrays in the program.  

This is on a DSL line...  ??  Would the asynco thing be likely, or
possibly even standard, with DSL?  

Did you come up with a workaround?

Floyd








On Sat, 31 May 2003 14:38:05 +0200, you wrote:

On Fri, 30 May 2003 20:45:08 -0400 [EMAIL PROTECTED] (Floyd Baker) wrote:
[snip] 
 I have a routine that works fine on local win98 but when it runs on
 linux online, the screen output is cut short.  I have lengthened the
 30 second script time max to 45 but that made no difference at all.  
 
 Depending on the particulars, the routine stops at a certain spot.  If
 it is rerun, it stops at the very same spot again.  Putting in other
 particulars cause it to stop at a different point, further down.  It
 seems that changes which affect the number of mysql calculations, make
 some difference in the length of the screen display, but it's only a
 minor amount.  It cuts off somewhere around 4 pages.
[snip] 

I once had this effect on pages exceeding a total size of 8k when running a
test server on an asynchronoous line (ADSL, in 712kB, out 64kB). As long as
the page fits into a single IP packet (which usually equals 8kB) no
problems occur, however if more than one packet is needed to transmit the
page the webserver will only be able to send the first packet. All pages
went fine when using a synchronous connection (in == out).


-- 
   O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/

--

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



[PHP] Long screen display cut short.

2003-05-31 Thread Floyd Baker

Hello...

I have a routine that works fine on local win98 but when it runs on
linux online, the screen output is cut short.  I have lengthened the
30 second script time max to 45 but that made no difference at all.  

Depending on the particulars, the routine stops at a certain spot.  If
it is rerun, it stops at the very same spot again.  Putting in other
particulars cause it to stop at a different point, further down.  It
seems that changes which affect the number of mysql calculations, make
some difference in the length of the screen display, but it's only a
minor amount.  It cuts off somewhere around 4 pages.

Any ideas please. 

Floyd

--

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



Re: [PHP] dynamic arraynames

2002-12-02 Thread Floyd Baker


Just want to thank everyone and tell how it finally came out...

I was making way to much of this and went into difficult concepts too
quickly.  That's where the problem came from.  Trying to build on
earlier mistakes.   

We already had an array for the column names so a suggestion that I
use one single array for all the data columns works out the best.
Now I'm unwinding that one long array according to how many name
fields there are in each row.  As each process is done, the fields are
there in the original column order, no matter how big the x-y grid is.

The data from the 'basic' column arrays is also going to be included
in the single array too.

I'm not a wiz by any means so creating the best application 'method'
can be rough no matter what I know about the individual functions.
The *single* array just never dawned on me.  Thanks for the help...
:-)  

Floyd 













On Fri, 29 Nov 2002 11:47:56 -, you wrote:

 -Original Message-
 From: Floyd Baker [mailto:[EMAIL PROTECTED]]
 Sent: 28 November 2002 17:09
 
OK, I think I'm finally beginning to understand what you're up to, and it seems to me 
everyine's been making rather heavy weather of it so far!

 The user's choice is made from a drop down list of available items,
 prior to running the routine itself.  The choices are predetermined
 and kept in a personal table to be called by the routine.  This part
 is finished to the point of putting the needed column names at the top
 of the input columns on the form.  The choices are fixed spellings to
 match formula if-then's, etc.

If this is the case, couldn't you use 2-dimensional arrays with the column names as 
the first dimension, and the values relating to it in the second dimension?

So you'd have something like 

  $user['colour'][0]   $user['hobby'][0]   $user['etc'][0]
  $user['colour'][1]   $user['hobby'][1]   $user['etc'][1]
  $user['colour'][2]   $user['hobby'][2]   $user['etc'][2]
  $user['colour'][3]   $user['hobby'][3]   $user['etc'][3]

etc.

Anyway, going back to your forms:

 if ($start_button==1)
  {
  print form action=$PHP_SELF method=get;
  print Input the following information;
  // these are your fixed cells and they now contain user input
print Name: input type=text name=name value=\$name\ 
 size=20br;
print Temp: input type=text name=temp value=\$temp\ 
 size=20br;
print Time: input type=text name=time value=\$time\ 
 size=20br;
print Offset: input type=text name=offset value=\$offset\
 size=20br;
  print Input the names of the desired additional cells in the spaces
 provided.;
  // this is where your user will name the cells he asked to create
  for($i=1;$i=$additional_cells;$i++)
   {
   print $i input type=text name=user_added[$i] size=20br;
   }

OK, this looks good -- it will give you your array of column names.   But you really 
should quote all those attributes, so:

  print $i input type=\text\ name=\user_added[$i]\ size=\20\br;

The next bit is where I'd do the clever stuff to build the 2-dimensional array:

  Name  Temp  Time  OffsetEtc.  As needed...
  process 1[input]   [input]   [input]   [input]   [inputs]
  process 2[input]   [input]   [input]   [input]   [inputs]
  process 3[input]   [input]   [input]   [input]   [inputs]
  process 4[input]   [input]   [input]   [input]   [inputs]
 
  Right now, for the three *basic* columns, I have the lines 
 below in a
  'while' loop.
 
  INPUT TYPE='text' NAME='temp[]' VALUE='$temp' SIZE='10'
  MAXLENGTH='10'
  INPUT TYPE='text' NAME='time[]' VALUE='$time' SIZE='10'
  MAXLENGTH='10'
  INPUT TYPE='text' NAME='offs[]' VALUE='$offs' SIZE='10'
  MAXLENGTH='10'

So, you just need additional lines in your while loop to add the entries for the user 
columns, named in such a way that you'll get back the 2-dimensional array I described 
earlier.  As you already have those column namers in the $user_added[] array built 
above, we can do it like this:

  foreach ($user_added as $user_col):
echo input type='text' name=\user['$user_col'][]\ size='10' 
maxlength='10';
  endforeach;

and, bingo, you have your user's input being submitted into a 2-dimensional array 
indexable by column name and row number.

(Actually, to be absolutely sure all the row numbers match, I'd be outputting those 
into the form field names as well.)

Additionally, having gone this far I'd consider doing the same sort of thing with 
your standard columns, something like this:

   $std_cols = array('temp', 'time', 'offs');

   // now fill the $user_added[] array from database or wherever

   echo form ..;

   
   for ($n=0; $nROWS_NEEDED; $n++):

  foreach ($std_cols as $col_id):
 echo input type='text' name=\$col_id[$n]\ size='10' ;
  endforeach;

  foreach ($user_added as $col_id):
 echo input type='text' name=\user['$col_id'][$n]\ size='10' ;
  endforeach;

   endfor;

You could even 2-dimensionalize your standard columns, so you

Re: [PHP] dynamic arraynames

2002-11-28 Thread Floyd Baker


The user's choice is made from a drop down list of available items,
prior to running the routine itself.  The choices are predetermined
and kept in a personal table to be called by the routine.  This part
is finished to the point of putting the needed column names at the top
of the input columns on the form.  The choices are fixed spellings to
match formula if-then's, etc.   The use is for data manipulation and
so proper tracking of name/data is important in that regard, but the
final output figures go to the same categories in all cases so those
tables are fixed.  

The personal list table is to be called on the action page for keeping
the arrays in their proper order and usage.  The original idea was
that the list would be used somehow for creating the required
$_request's etc. 

But as you say, the tricky part is the naming of the columns, as we do
with the 'basic' column arrays.  I don't know if this can be done.
Thought it might be possible with 'dot' adds of functions or some such
to command lines built on the fly but haven't been able to make it
happen.  

But putting together what you and others are saying is giving me good
thoughts. :-)   Although I am still not sure how to code all of this,
much less express it, I am getting the idea that all 'columns' would
have the same array name and that the position of the data within that
single array will be the determining factor as to where it is applied.

That is if we need 3 user columns and 4 rows we will end up with a
single array of 12 values...  The three columns' fields would be
arranged as 1-4-7-10, 2-5-8-11 and 3-6-9-12.  

That should work nicely.  The column name list determines the number
of fields per row and the rest is automatic.  Perhaps I was going off
the deep end before but this method seems much less involved.  Anyone
see a problem with doing it this way?  

Many thanks to all and I apologize for the verbosity.  

Floyd
  



On Thu, 28 Nov 2002 01:28:48 -0800, you wrote:

Floyd,
I thought about this some and started noodling out a solution for you, but
have a few questions before I go any farther on this.
1. The part about users inputting their own column headers is relatively
straight forward.  Something like this should work:

?php
if (!isset($start_button))
{
print form action=$PHP_SELF method=get;
print Input the following information;

 // these are your fixed cells
print Name: input type=text name=name size=20br;
print Temp: input type=text name=temp size=20br;
print Time: input type=text name=time size=20br;
print Offset: input type=text name=offset size=20br;

 // User inputs the number of additional cells needed
  print Input number of additional cells needed: input type=text
 name=additional_cells size=20br;
  print input type=hidden name=start_button value=1;
  print input type=submit value=\ Hit it! \;
  print /form;
  }


if ($start_button==1)
 {
 print form action=$PHP_SELF method=get;
 print Input the following information;
 // these are your fixed cells and they now contain user input
   print Name: input type=text name=name value=\$name\ size=20br;
   print Temp: input type=text name=temp value=\$temp\ size=20br;
   print Time: input type=text name=time value=\$time\ size=20br;
   print Offset: input type=text name=offset value=\$offset\
size=20br;
 print Input the names of the desired additional cells in the spaces
provided.;
 // this is where your user will name the cells he asked to create
 for($i=1;$i=$additional_cells;$i++)
  {
  print $i input type=text name=user_added[$i] size=20br;
  }
 print input type=hidden name=additional_cells value=\$additional_cells\
;
 print input type=hidden name=start_button value=2;
 print input type=submit value=\ Hit it! \;
 print /form;
 }
if ($start_button==2)
   {
print $name.br.$temp.br.$time.br.$offset.br;
for($i=1;$i=$additional_cells;$i++)
{
print user cell .$i. .$user_added[$i].br;
}
}
?


2. Now comes the tricky part, and the part I'm unsure about.  You can
convert the user input in the above so that it becomes the names of the
input cells, or you can leave them in a numeric array.  Leaving them in a
numeric array will be easier to deal with later.
Also, other than the display of a table, what do you want the user input
for?  If you're planning on doing any data manipulation, then your coding
will get a bit hairy because you won't know what relation the user input
data has to your standard data (name, time, temp and offset).  Finally, if
you're planning on storing the data in a database table, each table will
need to be created on the fly--it can be done, but if you're struggling with
this, it'll take you some time to get the back end working.

Hope this helps,
Hugh

- Original Message -
From: Floyd Baker [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: 'Hugh Danaher' [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Wednesday, November 27, 2002 5:24 PM
Subject: Re: [PHP] dynamic arraynames




 Well I might

Re: [PHP] dynamic arraynames

2002-11-27 Thread Floyd Baker


Well I might be in the wrong place.  I've also asked in the HTML list
now too but I'm still stuck and need some help.  

This is pretty much as clear as I can make it.  I'm up against a
mental block and even if it's as clear as glass to others I'm dead in
the water and would appreciate some pointers.  I have a bunch of
pieces but can't seem to string them together enough to make it work.

Just trying to build an x-y array of data input fields and then send
them recursive to be used further down the program.  

I can do this fine with a fixed number of columns and rows of user
input but I cannot figure out how to make this happen using a variable
number of columns.  I'm a complete array amateur and would appreciate
a little assistance...

I want it to look something like this:

Name  Temp  Time  OffsetEtc.  As needed...   
process 1[input]   [input]   [input]   [input]   [inputs] 
process 2[input]   [input]   [input]   [input]   [inputs] 
process 3[input]   [input]   [input]   [input]   [inputs] 
process 4[input]   [input]   [input]   [input]   [inputs]

Right now, for the three *basic* columns, I have the lines below in a
'while' loop.

INPUT TYPE='text' NAME='temp[]' VALUE='$temp' SIZE='10'
MAXLENGTH='10' 
INPUT TYPE='text' NAME='time[]' VALUE='$time' SIZE='10'
MAXLENGTH='10' 
INPUT TYPE='text' NAME='offs[]' VALUE='$offs' SIZE='10'
MAXLENGTH='10' 

But when it comes to adding additional columns that a user
determines are needed, I am lost.  Users might want to add 0, or 4, or
10 additional items...  I would like only that number of usable
input columns be on the input-form, identified for what they contain,
and then be passed to the next page

Again, many thanks in advance.

Floyd






On Sun, 24 Nov 2002 23:55:56 -0500, you wrote:

I'm sorry, but I'm still confused. Can you show us a sample of the data
in the database and what you want the resulting form to look like for
that data? Maybe that'll help.

---John Holmes...



--


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




Re: [PHP] dynamic arraynames

2002-11-27 Thread Floyd Baker


Well I might be in the wrong place.  I've also asked in the HTML list
now too but I'm still stuck and need some help.  

This is pretty much as clear as I can make it.  I'm up against a
mental block and even if it's as clear as glass to others I'm dead in
the water and would appreciate some pointers.  I have a bunch of
pieces but can't seem to string them together enough to make it work.

Just trying to build an x-y array of data input fields and then send
them recursive to be used further down the program.  

I can do this fine with a fixed number of columns and rows of user
input but I cannot figure out how to make this happen using a variable
number of columns.  I'm a complete array amateur and would appreciate
a little assistance...

I want it to look something like this:

Name  Temp  Time  OffsetEtc.  As needed...   
process 1[input]   [input]   [input]   [input]   [inputs] 
process 2[input]   [input]   [input]   [input]   [inputs] 
process 3[input]   [input]   [input]   [input]   [inputs] 
process 4[input]   [input]   [input]   [input]   [inputs]

Right now, for the three *basic* columns, I have the lines below in a
'while' loop.

INPUT TYPE='text' NAME='temp[]' VALUE='$temp' SIZE='10'
MAXLENGTH='10' 
INPUT TYPE='text' NAME='time[]' VALUE='$time' SIZE='10'
MAXLENGTH='10' 
INPUT TYPE='text' NAME='offs[]' VALUE='$offs' SIZE='10'
MAXLENGTH='10' 

But when it comes to adding additional columns that a user
determines are needed, I am lost.  Users might want to add 0, or 4, or
10 additional items...  I would like only that number of usable
input columns be on the input-form, identified for what they contain,
and then be passed to the next page

Again, many thanks in advance.

Floyd






On Sun, 24 Nov 2002 23:55:56 -0500, you wrote:

I'm sorry, but I'm still confused. Can you show us a sample of the data
in the database and what you want the resulting form to look like for
that data? Maybe that'll help.

---John Holmes...





--


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




Re: [PHP] dynamic arraynames

2002-11-27 Thread Floyd Baker



Very sorry for the dupes...  Kept thinking I had pressed reply instead
of reply all.  


--


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




Re: [PHP] dynamic arraynames

2002-11-24 Thread Floyd Baker

Thank you for your efforts. The ideas are helping but sorry I am not
clear.  Not used to expressing myself regarding the coding I do. 

What I am looking to do is this:

From a loop that is reading a list of titles, I want to input pieces
of information to each...  The input fields will be in a  column on a
form with the name of the array at the top.

In a loop to n:
print INPUT TYPE='text' NAME='fred[]' SIZE='10' MAXLENGTH='10' ;

Fred works fine hard coded but i get n fred's...  I need the
individual  array names to be whatever comes from the list, column by
column.

Maybe this is very simple but I am not seeing how it's done.

Floyd





On Sat, 23 Nov 2002 15:28:13 -0800, you wrote:

Floyd,
if you are using mysql then you can use the mysql_list_fields to get the
names of the mysql table's column (field) names, then do mysql_num_fields to
get the number of columns (fields), then fill the columns with whatever
using a while loop.
I've attached a php page that fetches this info from any size table then
displays the table.  You can extract the info you need and extend it with
check boxes etc.
Hope this helps.
Hugh


!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
html
head
meta http-equiv=Content-Type content=text/html; charset=utf-8
titleInput Data Page/title
?php include (css.txt); ?
/head
body bgcolor=#1D3E81 
h1font color=#33DATABASE TABLES/font/h1

form action=?php print $php_self? method=post
?php

print table cellpadding=7 border=1 bgcolor=#d5d5d5trtd;
print h6Database name:/h6input type=text name=db
STYLE=width:140px/tdtd;
print h6Username:/h6input type=text name=user STYLE=width:140px;
print h6Password:/h6input type=text name=pass STYLE=width:140px;
print /tdtd valign=middle align=centerinput type=submit value=\ go
\;
print input type=hidden name=start value=1;
print /td/tr/table/formbr;
if ($start==1)
 {
 $link=mysql_connect(localhost,$user,$pass);
 if (! $link) die(couldn't connect mysql);
 mysql_select_db($db,$link) or die (couldn't open $db .mysql_error());
 $tables=mysql_list_tables($db,$link);
 $num=mysql_num_rows($tables)-1;
 mysql_close($link);
 ?
 form action=?php print $php_self? method=post
 ?php
 print table cellpadding=7 border=1 bgcolor=#d5d5d5trtd;
 print h6Table Name: /h6select type=text name=table
STYLE=width:140pxoption;

 for ($i=0;$i=$num;$i++)
  {
  print option.mysql_tablename($tables,$i);
  }
 print /select;

 print /tdtdinput type=submit value=\ go  \;
 print input type=hidden name=start value=2;

 print input type=hidden name=db value=$db;
 print input type=hidden name=user value=$user;
 print input type=hidden name=pass value=$pass;
 print /td/tr/table/formbr;
 }

if ($start==2)
 {
 $link=mysql_connect(localhost,$user,$pass);
 if (! $link) die(couldn't connect mysql);
 mysql_select_db($db,$link) or die (couldn't open $db .mysql_error());

 $results=mysql_query(select * from $table);
 $fields = mysql_list_fields($db, $table, $link);
 $columns = mysql_num_fields($fields);
 mysql_close($link);
 print table width=95% bgcolor=#d5d5d5 border=1 cellspacing=0
cellpadding=0trtd align=centerh3$table/h3;
 print table width=100% bgcolor=#d5d5d5 border=1 cellspacing=0
cellpadding=4;
 print tr;
 for ($i = 0; $i  $columns; $i++)
  {
  print td align=center bgcolor=#6c6c6ch5font
color=white.mysql_field_name($fields, $i)./font/h5/td;
  }
 print /tr;
 print tr;
 for ($i = 0; $i  $columns; $i++)
  {
  print td align=center bgcolor=#fbfbfbh5.mysql_field_type($results,
$i)./h5/td;
  }
 print /tr;
 while ($a_row=mysql_fetch_row($results))
  {
  print tr;
  foreach($a_row as $field)
   {
   if ($field==)
{
$field=nbsp;;
}
   print td align=centerh5.$field./h5/td;
   }
  print /tr;
  }
 print /table/td/tr/table;
 }
?
/body
/html



- Original Message -
From: Floyd Baker [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Saturday, November 23, 2002 2:07 PM
Subject: Re: [PHP] dynamic arraynames


 On Sat, 23 Nov 2002 10:58:02 -0500, you wrote:

  I am trying to generate arrays to hold inputs to columns.  Column
  titles are input to a table as needed.  They are read by the program
  and placed across the page.  Then an array goes under each column name
  to collect the inputs to the various rows.  Everything works except to
  dynamically change the name of the array.
 
 
  while($foo=mysql_fetch_array($mysql_result)){
  print INPUT TYPE=text NAME=correspondingfoo[];}
 
 Do you want this??
 
 print INPUT TYPE=text NAME= . $foo['something'] . [];
 
 ---John Holmes...


 No John.  I'm ok with simply inputting a value and otherwise using
 arrays that are hard coded and previously named but my problem is in
 creating different arrays on the fly to represent each column that
 there is a name for.  I want to end up with something like $meat[] and
 $potatoes[] and whatever else is needed from a list...  The list of
 meat, potatoes, etc determines how many arrays and their names.

 I'm not to swift when it comes to arrays and think I'm probably

Re: [PHP] dynamic arraynames

2002-11-23 Thread Floyd Baker
On Sat, 23 Nov 2002 10:58:02 -0500, you wrote:

 I am trying to generate arrays to hold inputs to columns.  Column
 titles are input to a table as needed.  They are read by the program
 and placed across the page.  Then an array goes under each column name
 to collect the inputs to the various rows.  Everything works except to
 dynamically change the name of the array.
 
 
 while($foo=mysql_fetch_array($mysql_result)){
 print INPUT TYPE=text NAME=correspondingfoo[];}

Do you want this??

print INPUT TYPE=text NAME= . $foo['something'] . [];

---John Holmes...


No John.  I'm ok with simply inputting a value and otherwise using
arrays that are hard coded and previously named but my problem is in
creating different arrays on the fly to represent each column that
there is a name for.  I want to end up with something like $meat[] and
$potatoes[] and whatever else is needed from a list...  The list of
meat, potatoes, etc determines how many arrays and their names.
  
I'm not to swift when it comes to arrays and think I'm probably stuck
on some simple misconception.  I'm trying to convert $meat to $meat[],
on the fly, to have something to input to...  I read today maybe I
don't need the brackets?  

Floyd


--


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




[PHP] dynamic arraynames

2002-11-22 Thread Floyd Baker


Please can someone offer an idea.

I am trying to generate arrays to hold inputs to columns.  Column
titles are input to a table as needed.  They are read by the program
and placed across the page.  Then an array goes under each column name
to collect the inputs to the various rows.  Everything works except to
dynamically change the name of the array.  


while($foo=mysql_fetch_array($mysql_result)){
print INPUT TYPE=text NAME=correspondingfoo[];}


I can't see how to change the name of the array on the fly.   
Or maybe their is a better way?  

Thanks in advance.  

Floyd

--


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




[PHP] which linux?

2002-03-09 Thread Floyd Baker



This is a bit ot but 'related', and I know you guys know...  

I'm about to buy a new machine and want to install linux instead of
ms.   I've never touched the stuff before but I hear Mandrake 8.1 is
good for easy install, etc.  Would anyone have suggestions on buying a
new machine, chip compatibility, best linux, etc??  And since I don't
know much more than the linux name and reputation, can I maybe get an
idea of an average learning curve time frame?  

Right now I'm set up on win32 with apache php4.1 and mysql which is
what I'll be doing with the new one.  

Thanks.

Floyd


--


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




[PHP] numeric numbers to alpha strings.

2002-02-27 Thread Floyd Baker


Hello  Are there any conversion routines around for changing numeric
dollar amounts to spelled out strings for putting on checks?  I wrote
a quick basic routine a long time ago  It took any number such as
'12532' and created a string 'one hundred, twenty-five dollars and 32
cents'  It works just fine for amounts up to 20 or 30 thousand but I
thought there might be this nice little function out there somewhere

TIA 

Floyd

 


--


-- 
PHP General Mailing List (http://wwwphpnet/)
To unsubscribe, visit: http://wwwphpnet/unsubphp




Re: [PHP] My php goes poof.

2002-02-12 Thread Floyd Baker



I've had this set up on a win98 Pentium II 350 machine for a year and
a half.  It seems the problem goes way back a long time but can't be
sure.  It doesn't happen on the isp where things go when done, so I
lived with it on this machine.  I always expected it was some needed
garbage collection, an overflow or other limited thing that was
happening.  Like maybe the ini's weren't optimal..?   Actually I
expected to hear it was a common problem but that it could be fixed.
:-/  Because it's been there through upgrades, etc.  Maybe it does
relate to an old 98 problem.  So no one else ever had this happen?
Are there any ideas on 'potential' trouble spots or 'switches' to
throw?  

If I can't just edit an ini, I'll have to give the re-installs another
try...  Bummer.  ;-

Floyd





On Tue, 12 Feb 2002 08:25:32 -0500, you wrote:

I am certainly not an apologist for M$ but the response you sent is a bit off the 
mark. Although Apache, PHP and My SQL
are not developed specifically for M$ systems they now are available and I have found 
them to be stable on both winnt
and win2k. I have never had PHP, MySQL or Apache go down.

Anyway back to the original questionhow long have you had your configuration 
installed and has it always been
funky?
If so I would say go back and reinstall (being sure to back up your data and config 
files for apache and mysql) I have  
tried multiple installations on win2k and found that abria merlin (free from 
www.abriasoft.com) was the easiest to get
up and running with a minimum of configuration issues.

Hope that helps,
 Frederic


Liam MacKenzie wrote:

 I'd be willing to bet that it's a M$ thing!

 As it says in all the documentation, neither apache, mysql
 nor php were designed for M$ systems.

 Other than bag M$, I can't help you, sorry!
 ;-)

 - Original Message -
 From: Floyd Baker [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Tuesday, February 12, 2002 2:16 PM
 Subject: [PHP] My php goes poof.

 
 
  Hi phpeople.   Can anyone tell me why my php just stops working
  periodically?
 
  I have a win32/apache/php4.1/mysql set up.  I can do things here for
  about an hour or so and then all of a sudden I get nothing but html
  remains.  I need to take down apache and restart it for the php
  parsing to kick back in.
 
  Floyd
 
  --
 
  --
  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] My php goes poof.

2002-02-11 Thread Floyd Baker



Hi phpeople.   Can anyone tell me why my php just stops working
periodically?  

I have a win32/apache/php4.1/mysql set up.  I can do things here for
about an hour or so and then all of a sudden I get nothing but html
remains.  I need to take down apache and restart it for the php
parsing to kick back in.  

Floyd

--

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




Re: [PHP] My php goes poof.

2002-02-11 Thread Floyd Baker

On Tue, 12 Feb 2002 14:25:17 +1000, you wrote:

I'd be willing to bet that it's a M$ thing!

As it says in all the documentation, neither apache, mysql
nor php were designed for M$ systems.

Other than bag M$, I can't help you, sorry!
;-)

I have better docs...  Mine say cross platform.  g  
 
But I'm losing ms on my *next* machine.  Just can't do it now.
So I'll need a different fix.   Tnx for the suggestion.  :-)





- Original Message - 
From: Floyd Baker [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, February 12, 2002 2:16 PM
Subject: [PHP] My php goes poof.


 
 
 Hi phpeople.   Can anyone tell me why my php just stops working
 periodically?  
 
 I have a win32/apache/php4.1/mysql set up.  I can do things here for
 about an hour or so and then all of a sudden I get nothing but html
 remains.  I need to take down apache and restart it for the php
 parsing to kick back in.  
 
 Floyd
 
 --
 
 -- 
 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] Manual input, to form, to array, to session register...

2002-02-06 Thread Floyd Baker


Before 4.1 we used an input form with default field values and manual
override input to an array and then posted to an action page.  All was
good until global_register were turned off.  

Now I need to make this work using the session register. I have the
all this working and passing defined variables ok.

How is this done with a manual input?  I have tried to use the same
input line as before

print INPUT TYPE='text' NAME='rate[]' VALUE='$rate' SIZE='5';

but cannot integrate it into the session register.I have also
tried track_var configurations with no luck.  I can get $vars into the
register but I need to input values to an array manually.

I know it's here somewhere but can I get a pointer.  Thanks.

Floyd


--

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




Re: [PHP] Manual input, to form, to array, to session register...

2002-02-06 Thread Floyd Baker

On Wed, 6 Feb 2002 16:23:25 -0500, you wrote:


On Wednesday, February 6, 2002, at 04:08  PM, Floyd Baker wrote:

 Now I need to make this work using the session register. I have the
 all this working and passing defined variables ok.

 How is this done with a manual input?  I have tried to use the same
 input line as before

 print INPUT TYPE='text' NAME='rate[]' VALUE='$rate' SIZE='5';

 but cannot integrate it into the session register.I have also
 tried track_var configurations with no luck.  I can get $vars into the
 register but I need to input values to an array manually.

I thought that with 4.1, you didn't need to use session_register().  
Rather, you just define the variable you want in the $_SESSION array:

$_SESSION['rate'] = $rate;

But maybe that's not what you want... ?

Erik

PS: you could get this value into the default by doing

print input type='text' name='rate[]' value=' . 
$_SESSION['rate'] . ' size='5' /;
IOW, concatenation.



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


What I'm trying to do would be more like the reverse...  I don't have
$rate predefined but need to input it manually via a form.  It needs
to go into the session register, not be read from it.

How does one make a manual *form* entry go directly into the session
register.  That's about the basic idea I think. 
  
I can make name='rate[]' work the old way but can't get name='rate[]'
into the session register.  

Floyd
   


--

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




Re: [PHP] Session updates ok first time only.

2002-01-29 Thread Floyd Baker

On Tue, 29 Jan 2002 12:11:02 +0800, you wrote:

On Tuesday 29 January 2002 06:36, Floyd Baker wrote:

 Yes I have a c:\tmp directory and I see the session being created in
 it.  And the page_view value of 1 after the first increment.  The
 editor wants to reload each time I hit the submit button after that
 but the value does not increase beyond 1.  It is also the same session
 each time.  No new sessions are being created.

 I have turned on the log and keep getting undefined_variables for
 those two lines in each page that call $page_view before it's
 incremented, unless I am engaging the $_SESSION call.  Then
 $table_view becomes 1 and there are no errors.  But the incremented
 value doesn't hold up.

 Almost like nothing is happening.., except the *editor* thinks there
 is something going on when looking at the session file??  Like a one
 is being loaded each time.  How could that be?  Or the original one is
 staying even though an overwrite is being attempted.

Here's an interesting snippet from the manual:

The track_vars and register_globals configuration settings influence how the 
session variables get stored and restored.
  
Note: As of PHP 4.0.3, track_vars is
 always turned on.
   
If track_vars is enabled and register_globals is disabled, only members of 
the global associative array $HTTP_SESSION_VARS can be registered as session 
variables. The restored session variables will only be available in the array
$HTTP_SESSION_VARS.

Try the simple example in the manual:

?php
session_register(count);
$_SESSION[count]++;
echo Count is  . $_SESSION[count];
?

Wow...  That works.  Al right!  You mean you can only increment
directly in the session register and *then* pull the value.., instead
of pulling it first and then incrementing?   Is that the basic concept
that I should to keep in mind?  I can do that...  :0)

You're all right Jason.  This is a terrific help for me.  And I'm
definitely going to print a hardcopy of the man...  Looks like using
the on-line or even the pd on screen isn't working out too well.

With the changes going on, this is probably something that will come
up again and again for some time to come.  Nice to have it figured
out, eh?  

And I'll do some more tests, etc. and put a little follow up here on
anything else I see.  

Floyd



 Now I have uploaded these scripts to my isp and they do not work up
 there either.  That is, using his ini, his php 4.0 with
 register_globals on, etc.  Could you perhaps test these scripts on
 your machine or create an 'accumulating' routine of your own that
 works?   So I can see where the difference might be coming in?

Your original scripts with the changes I suggested works on my system. 

--


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Session updates ok first time only.

2002-01-29 Thread Floyd Baker


Jason put a little snip from the man that he found that works just
fine on my pages.

It looks like you increment or change the variable directly in the
session register instead of doing it on the page.

That sounds suspiciously like what you were trying to tell me.  :-)

What do you think... 
  





On Tue, 29 Jan 2002 12:11:02 +0800, you wrote:

On Tuesday 29 January 2002 06:36, Floyd Baker wrote:

 Yes I have a c:\tmp directory and I see the session being created in
 it.  And the page_view value of 1 after the first increment.  The
 editor wants to reload each time I hit the submit button after that
 but the value does not increase beyond 1.  It is also the same session
 each time.  No new sessions are being created.

 I have turned on the log and keep getting undefined_variables for
 those two lines in each page that call $page_view before it's
 incremented, unless I am engaging the $_SESSION call.  Then
 $table_view becomes 1 and there are no errors.  But the incremented
 value doesn't hold up.

 Almost like nothing is happening.., except the *editor* thinks there
 is something going on when looking at the session file??  Like a one
 is being loaded each time.  How could that be?  Or the original one is
 staying even though an overwrite is being attempted.

Here's an interesting snippet from the manual:

The track_vars and register_globals configuration settings influence how the 
session variables get stored and restored.
  
Note: As of PHP 4.0.3, track_vars is
 always turned on.
   
If track_vars is enabled and register_globals is disabled, only members of 
the global associative array $HTTP_SESSION_VARS can be registered as session 
variables. The restored session variables will only be available in the array
$HTTP_SESSION_VARS.

Try the simple example in the manual:

?php
session_register(count);
$_SESSION[count]++;
echo Count is  . $_SESSION[count];
?

Wow...  That works.  Al right!  You mean you can only increment
directly in the session register and *then* pull the value.., instead
of pulling it first and then incrementing?   Is that the basic concept
that I should to keep in mind?  I can do that...  :0)

You're all right Jason.  This is a terrific help for me.  And I'm
definitely going to print a hardcopy of the man...  Looks like using
the on-line or even the pd on screen isn't working out too well.

With the changes going on, this is probably something that will come
up again and again for some time to come.  Nice to have it figured
out, eh?  

And I'll do some more tests, etc. and put a little follow up here on
anything else I see.  

Floyd



 Now I have uploaded these scripts to my isp and they do not work up
 there either.  That is, using his ini, his php 4.0 with
 register_globals on, etc.  Could you perhaps test these scripts on
 your machine or create an 'accumulating' routine of your own that
 works?   So I can see where the difference might be coming in?

Your original scripts with the changes I suggested works on my system. 

--


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Session updates ok first time only.

2002-01-29 Thread Floyd Baker

On Tue, 29 Jan 2002 12:11:02 +0800, you wrote:

On Tuesday 29 January 2002 06:36, Floyd Baker wrote:

 Yes I have a c:\tmp directory and I see the session being created in
 it.  And the page_view value of 1 after the first increment.  The
 editor wants to reload each time I hit the submit button after that
 but the value does not increase beyond 1.  It is also the same session
 each time.  No new sessions are being created.

 I have turned on the log and keep getting undefined_variables for
 those two lines in each page that call $page_view before it's
 incremented, unless I am engaging the $_SESSION call.  Then
 $table_view becomes 1 and there are no errors.  But the incremented
 value doesn't hold up.

 Almost like nothing is happening.., except the *editor* thinks there
 is something going on when looking at the session file??  Like a one
 is being loaded each time.  How could that be?  Or the original one is
 staying even though an overwrite is being attempted.

Here's an interesting snippet from the manual:

The track_vars and register_globals configuration settings influence how the 
session variables get stored and restored.
  
Note: As of PHP 4.0.3, track_vars is
 always turned on.
   
If track_vars is enabled and register_globals is disabled, only members of 
the global associative array $HTTP_SESSION_VARS can be registered as session 
variables. The restored session variables will only be available in the array
$HTTP_SESSION_VARS.

Try the simple example in the manual:

?php
session_register(count);
$_SESSION[count]++;
echo Count is  . $_SESSION[count];
?

 Now I have uploaded these scripts to my isp and they do not work up
 there either.  That is, using his ini, his php 4.0 with
 register_globals on, etc.  Could you perhaps test these scripts on
 your machine or create an 'accumulating' routine of your own that
 works?   So I can see where the difference might be coming in?

Your original scripts with the changes I suggested works on my system. 


This is what I am seeing now using your code above.  

The increment works when done directly into the session register but
when done on the page, it does not get applied.  I am incrementing
both ways in succession and reloading.  These are the results I get on
each reload.
  
RegisterPage
   1 1-2

   2 2-3

   3 3-4

   4 4-5
or similar.  

Any changes done outside the register just do not get recorded into
the register.  They must be done in the register itself.  

Many thanks again Jason.  That was a good one.   I am off and looking
for the next problem now.  

Floyd


--


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Session updates ok first time only.

2002-01-28 Thread Floyd Baker

On Mon, 28 Jan 2002 15:20:05 +0800, you wrote:

On Monday 28 January 2002 14:27, you wrote:

Please keep discussion on the list!

Sorry about that. I meant to..

  //pull value from session file:
  $page_views = $_SESSION['page_views'];
 
 No need for this, in fact this is what is preventing it from working! Once
 you've used session_register('var'), $var is available for use.

 Still ng..  I've eliminated the line on each and both pages in turn
 but still no improvement.  The count is going from 0 to 1 on the first
 invoke, then from 1 to 3 after passed to the second page.  From there
 on it falls apart, repeating 1 to 2 or 1 to 3 depending on the page.
 The session file never sees a higher value once the initial 1 is
 input.  It just keeps starting over from that same point.

  print brReturn Page;
  print brBefore increment = $page_views;
 
  //increment the counter:
  $page_views++;
  $page_views++;
 
 You're inc'ing $page_views twice, this is what makes you *think* the
  session is working when in fact it isn't!
 
 hth

 The double increment was to give me a different count for the second
 page just to tell where I was at any time.   I see the count go
 1-2-1-3-1-2-1-3-1-2 etc., as it passes back and forth.

Ahh, but I thought that was what the Send Page and Return Page was for :)

 But it's still not climbing.

1) You could try reloading (F5 if using IE) the Send Page, if sessions were 
working you should see the counter counting.

2) session.save_path = c:/tmp, I don't use PHP on Windows, but looking at the 
other settings, paths for Windows systems are specified with a backslash. Try

  session.save_path = c:\tmp


Refreshing was what I was doing in the original single page, but it
wasn't working.  I went to two pages to try and help show what was
going on.  Still reloading doesn't help.  Neither does the dos slash
reversal.  I thought that might be going to do it for a while, but
nothing.  :-  

I only listed the *un* rem'ed lines of the ini session portion.  Is it
possible I need to remove a rem on one of those that were rem'ed?
It's a vanilla 'suggested' ini.   

Or maybe an error log I can look at?  Can such a report be created?  

Floyd


--


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Session updates ok first time only.

2002-01-28 Thread Floyd Baker

On Mon, 28 Jan 2002 21:10:02 +0800, you wrote:

On Monday 28 January 2002 20:52, Floyd Baker wrote:
 On Mon, 28 Jan 2002 15:20:05 +0800, you wrote:
 On Monday 28 January 2002 14:27, you wrote:

 2) session.save_path = c:/tmp, I don't use PHP on Windows, but looking at
  the other settings, paths for Windows systems are specified with a
  backslash. Try
 
   session.save_path = c:\tmp


 Refreshing was what I was doing in the original single page, but it
 wasn't working.  I went to two pages to try and help show what was
 going on.  Still reloading doesn't help.  Neither does the dos slash
 reversal.  I thought that might be going to do it for a while, but
 nothing.  :-

But you *do* have a c:\tmp directory  ?

This is where php will store the session info and if it doesn't find that 
directory your sessions stuff wouldn't work.

 I only listed the *un* rem'ed lines of the ini session portion.  Is it
 possible I need to remove a rem on one of those that were rem'ed?
 It's a vanilla 'suggested' ini.

If it were the vanilla 'suggested' ini as per the standard php distribution 
then it *should* work, as those are more or less the same settings that I use 
myself (but under Linux).

 Or maybe an error log I can look at?  Can such a report be created?

Yes, in php.ini,

log_errors = On
error_log = c:\tmp\php-error.log


Don't forget to restart your webserver or whatever.


-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk


Yes I have a c:\tmp directory and I see the session being created in
it.  And the page_view value of 1 after the first increment.  The
editor wants to reload each time I hit the submit button after that
but the value does not increase beyond 1.  It is also the same session
each time.  No new sessions are being created. 

I have turned on the log and keep getting undefined_variables for
those two lines in each page that call $page_view before it's
incremented, unless I am engaging the $_SESSION call.  Then
$table_view becomes 1 and there are no errors.  But the incremented
value doesn't hold up. 

Almost like nothing is happening.., except the *editor* thinks there
is something going on when looking at the session file??  Like a one
is being loaded each time.  How could that be?  Or the original one is
staying even though an overwrite is being attempted.

Now I have uploaded these scripts to my isp and they do not work up
there either.  That is, using his ini, his php 4.0 with
register_globals on, etc.  Could you perhaps test these scripts on
your machine or create an 'accumulating' routine of your own that
works?   So I can see where the difference might be coming in?   

Floyd 

--


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Session updates ok first time only.

2002-01-27 Thread Floyd Baker



Can someone tell me why this is not working right?  Two pages are
basically the same, passing an accumulating value back and forth.
There is no other session being created.  The first time it increments
and passes to the second page, and is picked up.  It puts a 1 in the
session file.  After that, it seems to try, as in editor wanting to
reload, but the contents don't increase beyond 1.
 
I have 4.1, register globals off, on Windows 98.

TIA


session_start(); 

print html;
print body;

// determine session id
$session = $_REQUEST['session'];
if ($session == ''){
$session = session_id();}

print SESSION = $session;

// create a registered variable.
session_register('page_views');


//pull value from session file:
$page_views = $_SESSION['page_views'];

print brSend Page;
print brBefore increment = $page_views;

$page_views++;

print brAfter increment = $page_views;

// go to next page with session id:
print FORM ACTION='sess_return.php3' METHOD='post';
print INPUT TYPE=hidden NAME='session' VALUE=$session;
print INPUT TYPE=submit  VALUE=Submit  or  INPUT TYPE=reset
VALUE=Clear/form;
?
/body
/html



session_start();  

print html;
print head;
print /head;
print body;

//determine a session id:
$session = $_REQUEST['session'];
if ($session == ''){
$session = session_id();
}
print SESSION = $session;

// create a registered variable.  
// alredy done.
//session_register('page_views'); 

//pull a value from the session file:
$page_views = $_SESSION['page_views'];

print brReturn Page;
print brBefore increment = $page_views;

//increment the counter:
$page_views++;
$page_views++;

print brAfter increment = $page_views;

//going to next page with session id:
print FORM ACTION='sess_send.php3' METHOD='post';
print INPUT TYPE=hidden NAME='session' VALUE=$session;
print INPUT TYPE=submit  VALUE=Submit  or  INPUT TYPE=reset
VALUE=Clear/form;

?
/body
/html



php.ini  

[Session]
session.save_handler = files
session.save_path = c:/tmp
session.use_cookies = 
session.name = PHPSESSID
session.auto_start = 0
session.cookie_lifetime = 0
session.cookie_path = /
session.cookie_domain =
session.serialize_handler = php
session.gc_probability = 1
session.gc_maxlifetime = 1440
session.referer_check =
session.entropy_length = 0
session.entropy_file =
session.cache_limiter = nocache
session.cache_expire = 180
session.use_trans_sid = 1
url_rewriter.tags =
a=href,area=href,frame=src,input=src,form=fakeentry

--


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] File open with 4.1

2002-01-26 Thread Floyd Baker





I'm now using $S_REQUEST to pass things on a win32 with apache and
php4.1.  In touching stuff up on the isp however, things are
incompatible.  I have gone to using $HTTP_POST_VAR, etc. instead, so
when the isp goes to 4.1 we only need to replace them with $_REQUEST.

Is that the way to go?


Now a new thing. I have gotten to this point where everything is on
the page but it doesn't open the file.  Is there some more conversion
needed re 4.1?  It would be nice to know just yes or no.  tks...

$textfile = fopen($filename,'w');
 
if(!($textfile))
{
print(The File could not be opened.);
exit;
}
  
if($text  ) //  write a line to the file
{
fputs($textfile, (stripslashes($text)));

}
 
fclose($textfile);



Floyd

--


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] One more time... Sessions questons?

2002-01-24 Thread Floyd Baker


Hi 

I have been reading but can't get sessions to even try working..  

The set up is win32/php4.1/apache. 

Reading the list I have done what was suggested where it I could
understand it.  Just went nuts creating /tmp dirs everywhere I could
think of to see if any of them worked...  Nada!  Also changed the ini
line to point to c:/tmp, etc. Still ng.

Here is one of the scrips that doesn't work.

session_start();
session_register('page_views');
$page_views++;

print br You have viewed this page ;
print $page_views;
print  times(s).;


The ini is the 'recommended' version with register_globals off and
whatever vanilla settings were in there.  Everything else seems to be
working...  I can pass vars using $_REQUEST just fine.  What's wrong?

TVMIA

Floyd
--


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Passing. Which method to use?

2002-01-22 Thread Floyd Baker

On Tue, 22 Jan 2002 14:21:56 +0530 (IST), you wrote:

Hi,
  I'm using sessions extremely to do that. 

with regards
Sukumar .S
On Tue, 22 Jan 2002, Floyd Baker wrote:

 Date: Tue, 22 Jan 2002 01:17:18 -0500
 From: Floyd Baker [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: [PHP] Passing.  Which method to use?  
 
 
 Hi once again.
 
 What's the consensus on the best way to pass arrays from page to page?
 
 By serializing?  But I think it's not recommended?
 
 By writing then reading to a text file?  Maybe?
 
 By inputting to and pulling from db records?  Possibilities?  
 
 Any other?  
 
 Thanks in advance.
 
 Floyd




Ok then that makes it unanimous.  I will use sessions...  

Except it isn't working yet.  

I have just put in 4.1.1 and everything seems good with that.  I have
been able to pass vars using $_request() etc...  But here is the
script I just now tested and it stays at the count of '1'.  Other
sessions test scripts do not work either.   I was not using sessions
before this install of 4.1.1 either.  

Can there be anything, new or old, in 4.1.1 that I need to fix? 
As with register_globals and whatever else that has been changed?  

Here is the script straight off the tutorial:

//? //'s here only.

// initialize a session
session_start();

// register a session variable
session_register('counter');

// increment and display the value of the counter
$counter++ ;
echo(You have visited this page $counter times! Don't you have
anything else to do, you bum?!);

//?


Thanks.

Floyd

--


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Passing. Which method to use?

2002-01-21 Thread Floyd Baker


Hi once again.

What's the consensus on the best way to pass arrays from page to page?

By serializing?  But I think it's not recommended?

By writing then reading to a text file?  Maybe?

By inputting to and pulling from db records?  Possibilities?  

Any other?  

Thanks in advance.

Floyd


--


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Passing vars w/refresh w/register globals off?

2002-01-18 Thread Floyd Baker

On Fri, 18 Jan 2002 18:13:50 +0800, you wrote:

On Friday 18 January 2002 04:11, Floyd Baker wrote:

 Yes.  I was using the url to pass variables without a form.

 It looks like the javascript idea would cover that now that you remind
 me.  I've used it before to refresh two frames at once.

 But even so I'd rather not go that way if at all possible.  I'd like
 to stay within php's ability.

Not being able to POST and GET is a 'limitation' of HTTP not PHP.

 Not knowing what I'm talking about for sure but is there no way of
 putting a variable into the 'post' status or condition, prior to being
 redirected, without actually using a form?

Only be using a form will you be able to POST.

 Thanks for the idea though.  It'll work if nothing else. :-)


Up to now we (I?) still don't know exactly what you're trying to do. Maybe if 
you could tell us what you're doing and if appropriate post some code, then 
we could see if there is another solution to your problem.


-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
I am just a nice, clean-cut Mongolian boy.
   -- Yul Brynner, 1956
*/

This should be fairly standard.  Filling out a form and using a
recursive call and if/then, to bring the variables around to a case
switch for routing to desired pages according to form input data.

if 'completed = y 
(

switch 
  case 
get to go here
  case 
get go there

)
else
(
post to /this page 
form
submit
)


This draft does work but I don't like the visible url variables.  

Of course in addition we have all the fields passed by the form post
that were used as required on switch case and receiving pages...  Now
we need to REQUEST every one.  That's fine for the sake of the
security but now it's beneficial to get into arrays, etc. to keep
script shorter and easier to maintain.  More learning. Always good.
4.1 is pushing me.  :-)  

The solutions look more involved than my poor coding has been til now.
We need to put more things into function form maybe, instead of
passing between separate pages.  

I'm probably still out in left field with a lot of this *visualizing*
but it's coming.  And always good to talk it out.  

Can you tell me if it's possible to run 4.03 and 4.1 *both* on the
same machine?  I'm thinking the old script would be php3 and the new
stuff php4.  Is that something that could be done until the old
scripts are upgraded?  

Floyd 



--


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Passing vars w/refresh w/register globals off?

2002-01-17 Thread Floyd Baker

On Thu, 17 Jan 2002 07:06:50 +0200, you wrote:

What do you mean by 'hidden'? If you're talking about a hidden form input,
how can it not be post?

Bogdan


Just saying I've tried it.  Figured it wouldn't work but wasn't sure
how 'refresh' might relate to 'post'.  Post passing works fine with
$_request on the other end but I've got a lot of this refresh kind of
passing that doesn't work, and not sure how best to fix it.  

I don't want to rewrite the entire method to not include refresh.  :-

Floyd




Floyd Baker wrote:

 Hi..

 Got 4.1.1 going and think it's going to work fine.  Except for this.

 A form calls itself and then uses the menu selection to route through
 a switch to various refresh redirects...

 'Hidden' isn't working and it's not post, get, cookie, etc.  Can it be
 done?

 TIA

 Floyd

 --

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

--


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Passing vars w/refresh w/register globals off?

2002-01-17 Thread Floyd Baker

On Fri, 18 Jan 2002 01:03:19 +0800, you wrote:

On Friday 18 January 2002 00:41, Floyd Baker wrote:
 On Thu, 17 Jan 2002 07:06:50 +0200, you wrote:
 What do you mean by 'hidden'? If you're talking about a hidden form input,
 how can it not be post?
 
 Bogdan

 Just saying I've tried it.  Figured it wouldn't work but wasn't sure
 how 'refresh' might relate to 'post'.  Post passing works fine with
 $_request on the other end but I've got a lot of this refresh kind of
 passing that doesn't work, and not sure how best to fix it.

 I don't want to rewrite the entire method to not include refresh.  :-

If they are refresh redirects as in using the META tags then you're not going 
to get any form (POST) data. Perhaps you can elaborate on what you're trying 
to do. And if appropriate, post some code.


-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
Sorry, no fortune this time.
*/


Jason.  

The thing is, I *was* using GET in the refresh line and I guess I
wasn't saying that.  Moreover I want to pass passwords in the same
transfer but obviously letting them show up in the url is not cool...

My question should be more like, how can one pass variables in a way
that doesn't use a form but is still secure? 


And thanks too for asking.  I hope everyone understands that even
questions make it easier for a person to focus their thoughts.  I hate
to ask dumb questions, or put things the wrong way, but the problem is
I don't know they're dumb at first.  One little question I didn't
think to ask myself can make it all come clear.   

Floyd

--


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Passing vars w/refresh w/register globals off?

2002-01-17 Thread Floyd Baker

On Fri, 18 Jan 2002 03:39:21 +0800, you wrote:

On Friday 18 January 2002 02:36, Floyd Baker wrote:

 The thing is, I *was* using GET in the refresh line and I guess I
 wasn't saying that.  Moreover I want to pass passwords in the same
 transfer but obviously letting them show up in the url is not cool...

If I understand you correctly you're trying to pass variables via the url 
(GET), and at the same via a form (POST)? If so, then I'm afraid that's 
impossible.

 My question should be more like, how can one pass variables in a way
 that doesn't use a form but is still secure?

I'm presuming that you don't want to use a form because you need the META tag 
refresh thing. If by 'secure' you mean that it's not visible on the url then 
you *could* use a form. Just use a bit of Javascript to automatically submit 
the form.


Yes.  I was using the url to pass variables without a form.  

It looks like the javascript idea would cover that now that you remind
me.  I've used it before to refresh two frames at once.  

But even so I'd rather not go that way if at all possible.  I'd like
to stay within php's ability.   

Not knowing what I'm talking about for sure but is there no way of
putting a variable into the 'post' status or condition, prior to being
redirected, without actually using a form?  

Thanks for the idea though.  It'll work if nothing else. :-)

Floyd




-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
The clothes have no emperor.
   -- C.A.R. Hoare, commenting on ADA.
*/

--


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Passing vars w/refresh w/register globals off?

2002-01-17 Thread Floyd Baker

On Thu, 17 Jan 2002 13:47:06 -0500, you wrote:

 
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

you could save the password to a database, associated with
an ID number, then pass the ID number.

DATABASE:
- 
id| password
12345 | blah$$

URL:
form.php?id=12345


I've done something like that in another situation.  Wrote to a flat
file and then read from it in the action page.  

If it was just a few variables maybe, but I have cases where 100 need
to be passed.  It looks like a lot of rewriting is coming...  Even
with post passing, they all have to be collected them at the other end
in some minimal script manner.   Am I right in thinking arrays in this
case?  

Thanks.

Floyd



--


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Passing vars w/refresh w/register globals off?

2002-01-16 Thread Floyd Baker



Hi..  

Got 4.1.1 going and think it's going to work fine.  Except for this.

A form calls itself and then uses the menu selection to route through
a switch to various refresh redirects...

'Hidden' isn't working and it's not post, get, cookie, etc.  Can it be
done?  

TIA

Floyd


--


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] NEWBIE IN DISTRESS: Install Instructions are not work for PHP 4.1.1!!!

2002-01-15 Thread Floyd Baker




I'm stuck here too.  Don't know that much in the first place except
that I did get it together once.  Apache/php4/mysql on win32...  Now
to upgrade it's all new again.  

I'm sure php config files are ok to the point where apache picks it
up.  There is no 4.1.1 file as called for in the apache loadmodule
line.  Instead of /sapi/php4dll, the closest I find is
/sapi/apache/php4dsp.  I can also remember some file extensions being
renamed but can't find anything on that now..  Any clue where I'm
losing it will be very helpful I'm sure.  

Thanks.

Floyd








On Sun, 6 Jan 2002 00:35:39 -0600, you wrote:

Nothing noted in the error log.  The lines I have tried using are the EXACT
ones stated in the install.txt file.  I basically copied them from the
install doc and pasted it into the httpd.conf file.

Mark

Brian Clark [EMAIL PROTECTED] wrote in message
20020105034518.GH17616@ganymede">news:20020105034518.GH17616@ganymede...
 * Mark ([EMAIL PROTECTED]) [Jan 04. 2002 12:14]:

 [...]

  the Module version (Get a Requested Operation Failed message).  can
  someone please help?  My system is as follows:

  Windows 2000 SP2
  Apache 2.0.28 (I have also tried version 1.3.22 with same results as

 People had problems in that past with 2.x; I don't know if the php-dev's
 have worked that out yet.

  mentioned above)
  PHP 4.1.1
  MDAC 2.7
  MySQL 3.23.46a

 Are there any hints in Apache's error_log? What is your exact LoadModule
 line you're using in httpd.conf?

 --
 Brian Clark | Avoiding the general public since 1805!
 Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8
 In politics, stupidity is not a handicap.


--


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Is this a typo or what?

2001-05-22 Thread Floyd Baker

On 22 May 2001 19:32:00 +0200, you wrote:

Floyd Baker [EMAIL PROTECTED] wrote:

  
  I removed one of the two above the bottom 'return rettext'.   
  

There are sure something with that script, at least I found out there
is a } too much, maybe you removed one too many, can i see the
original script? I would also advise you to try and ident the script
correctly which makes it like 100% easier to read.

-- 
Henrik Hansen


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

The top example of user contributed notes.  I didn't take anything
out..  It comes that way...  with 15 brackets. g  The extra one I
think is the second (or third) one up from the bottom.

Yes I have the whole thing indented to make sense.  I am still working
on it to make it work.

Floyd

--


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] wrapping text on a page display.

2001-05-21 Thread Floyd Baker



Hello..  Sorry, I know this is a constant problem.., at least for me.

Now I am using 'text' to store big inputs.  It does not wrap on the
screen display...   

I have it working on my machine with wordwrap with php4.
The isp does not have php4 yet, and it doesn't work with I upload.

What is the php3 alternative please?

The ascii between the ;'s is exactly this... One long line.

;I\'ll add details later.  Now is the time for all good men to come to
the aid of their country...  The quick brown fox jumped over the lazy
dogs back 12345 times...  Of all the fishes in the sea, the mermaid is
still the only one for me;


I am using include() on a net fusion .php3 page to pull the php script
to pull and print the text field.

Thanks. 

Floyd

--


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] wrapping text on a page display.

2001-05-21 Thread Floyd Baker

On Mon, 21 May 2001 12:57:13 -0400, you wrote:



Hello..  Sorry, I know this is a constant problem.., at least for me.

Now I am using 'text' to store big inputs.  It does not wrap on the
screen display...   

I have it working on my machine with wordwrap with php4.
The isp does not have php4 yet, and it doesn't work with I upload.

What is the php3 alternative please?

The ascii between the ;'s is exactly this... One long line.

;I\'ll add details later.  Now is the time for all good men to come to
the aid of their country...  The quick brown fox jumped over the lazy
dogs back 12345 times...  Of all the fishes in the sea, the mermaid is
still the only one for me;


I am using include() on a net fusion .php3 page to pull the php script
to pull and print the text field.

Thanks. 

Floyd



You know there's an extra } in the first example for word wrap, under
string functions in the manual..I'm still having trouble with it
so I'd like someone else to take a crack at it too.  

Thanks..

Floyd



--


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Is this a typo or what?

2001-05-21 Thread Floyd Baker



There's an extra '}' in the first example for a word wrap function,
under string functions in the manual..

I think I removed the right one but I'm still having trouble with it.
Can someone else take a crack at it too?  

Or give me a new one?  

Thanks..

Floyd





--


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Is this a typo or what?

2001-05-21 Thread Floyd Baker

On 21 May 2001 23:22:17 +0200, you wrote:

Floyd Baker [EMAIL PROTECTED] wrote:

  There's an extra '}' in the first example for a word wrap function,
  under string functions in the manual..
  
  I think I removed the right one but I'm still having trouble with it.
  Can someone else take a crack at it too?  
  

I dont see any extra } what i see is:

$text = The quick brown fox jumped over the lazy dog.;
$newtext = wordwrap( $text, 20 );

echo $newtext\n;

a note for wordwrap is if you use if for wrapping in html you might
want to do something like this, to split every line with a br:

wordwrap($text, 20, br);

-- 
Henrik Hansen



Henrik

You are looking in the wrong area..  I'm working with php3.  

 There's an extra '}' in the first example for a word wrap function,
 under string functions in the manual..

Here is what I see... and if you count the brackets, there are 15.. ?

[EMAIL PROTECTED]
12-Nov-1999 05:15 
A quick and dirty function to wrap text at a given wrap margin: 

function wraptext($text, $wrapmargin) 
{ 
$rettext = ; 
$linebuf = ; 
$linelen = 0; 
$tok = split([ \t], $text); 
$numtok = count($tok); 
for ($i = 0; $i  $numtok; $i++) 
{ 
$elem = $tok[$i]; 
$elemlength = strlen($elem) + 1; 
if ($linelen + $elemlength  $wrapmargin) 
{ 
$rettext = $rettext . $linebuf . \n; 
$linebuf = ; 
$linelen = 0; 
} 

// Do we have a newline in this element? 
$pos = strrpos($elem, \n); 
if ($pos) 
{ 
$before = substr($elem, 0, $pos); 
$after = substr($elem, $pos); 
$rettext = $rettext . $linebuf .   . $before . \n; 
$linebuf = $after; 
$linelen = strlen($after); 
} 
else 
{ 
$linebuf = $linebuf .   . $elem; 
$linelen = $linelen + $elemlength; 
} 
} 

// Do we have a newline in this element? 
$pos = strrpos($elem, \n); 
if ($pos) 
{ 
$before = substr($elem, 0, $pos); 
$after = substr($elem, $pos); 
$rettext = $rettext . $linebuf .   . $before . \n; 
$linebuf = $after; 
$linelen = strlen($after); 
} 
else 
{ 
$linebuf = $linebuf .   . $elem; 
$linelen = $linelen + $elemlength; 
} 
} 
return $rettext; 
} 

 


--


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Is this a typo or what?

2001-05-21 Thread Floyd Baker

On 22 May 2001 00:19:41 +0200, you wrote:

Floyd Baker [EMAIL PROTECTED] wrote:

  Henrik
  
  You are looking in the wrong area..  I'm working with php3.  
  
   There's an extra '}' in the first example for a word wrap function,
   under string functions in the manual..
  
  Here is what I see... and if you count the brackets, there are 15.. ?
  

ok well, I can see the script inserts \n, if you are wrapping in html
you dont see the text is actual wraping because you need to add br
instead, maybe do a nl2br() on the ourput from the functions and see
if the text wraps as wanted.

-- 
Henrik Hansen

Well there are no br's in the field to convert. 

The ascii between the ;'s is exactly this... One long line.

;I\'ll add details later.  Now is the time for all good men to come to
the aid of their country...  The quick brown fox jumped over the lazy
dogs back 12345 times...  Of all the fishes in the sea, the mermaid is
still the only one for me;

So this routine with the bracket should work to insert the slashes but
I've removed the extra (correct?) bracket and it does not work..  ?

I removed one of the two above the bottom 'return rettext'.   

Floyd

--


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] linking to specific spot on map?

2001-03-02 Thread Floyd Baker



Hi..  We have a city map using co-ordinates to link to specific info on various
buildings, etc.  The links bring up an information page with data and photos for
each building locations on the map.

My question is, when this information page is accessed from another direction,
say a menu, can there be a link that operates in 'reverse', back to the map and
the building in question?   We still want people to see the map, relating to a
specific building, whether they start there or end up there. 

I thought the map could perhaps position itself so that the point of interest is
always in the center, or that it blinks, or has a arrow pointing to it.  It
doesn't matter what the final display looks like, just that is shows a
particular location clearly.  

Can anyone say if this is even possible?  

Thanks.

Floyd

--


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] my bugaboo.

2001-02-11 Thread Floyd Baker



The problem seems to be solved.

Some suggestions didn't work, in my application at least, but what I found from
a combination of them was that I can eliminate the problem using a character
entity for the apostrophe.  It prints a single quote but does not parse as a
single quote.

 $text = (stripslashes($text));
 $text = ereg_replace("'","#39;",$text);

 It doesn't work in one shot (ie \' to `).

Further; I originally placed the apostrophes into the database field as they
were, without escaping them with slashes.  I have since added slashes.  However
converting ' to #39 may eliminate the need for add/strip slashes?  I have to
try that.  

Many tnx to Anne and all.  

Floyd



On Sat, 10 Feb 2001 18:36:36 -0600, you wrote:

- Original Message -
From: "Floyd Baker" [EMAIL PROTECTED]



 Hello and thanks to all for the help on the magic quotes, etc.
 It gives me a better handle on what I'm dealing with.

 Except for one more thing.

 When I bring back text from a field which contains a ', and try to apply
it as
 the value of an input box, it still truncates in the box.

 When I simply print $text, it prints out correctly as *Don't do this* .
 When I make $text the default value of an input box, it shows as *Don*.

 If the slash is still in place, it reads *Don\'t* above the box and *Don\*
in
 the box.

 My bugaboo continues..  :-

 Thanks again for any further advice.

 Floyd


That's  a problem with HTML.
example:
input type='text' name='textName' value='Don't do this'
Sees the ' in Don't as the signal for the end of the value string.
I haven't come up with an automatic way to deal with this,
but what I have done is in these lines (where there might be an apostrophe)
make sure I use double quotes:
input type="text" name="textName" value="Don't do this"
or
print "input type=\"text\" name=\"textName\" value=\"Don't do this\"";

Of course, then you may have the same trouble with double quotes. To avoid
that you can do ereg_replace("\"", "''", $text) -- that is, replace a double
quote with two single quotes? I think, I've never bothered.

Hope this helps somehow.

Anna

--


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] open_basedir error message.

2001-02-11 Thread Floyd Baker


Hello.  

I need an explanation of this error message please.

This is the entire result of my upload of a jpg to a blob and I get the
open_basedir error on straight uploads also.  Although they do get uploaded.

On this one I started from scratch with some 5 star directions and still flunk
out.  :- 

==
Warning: open_basedir restriction in effect. File is in wrong directory. in
/usr/local/plesk/apache/vhosts/webpay.com/httpdocs/php/pic2blob/do_insert.php3
on line 10

Warning: fopen("/tmp/phpfbQ1wb","r") - Invalid argument in
/usr/local/plesk/apache/vhosts/webpay.com/httpdocs/php/pic2blob/do_insert.php3
on line 10

Warning: Unable to find file identifier 0 in
/usr/local/plesk/apache/vhosts/webpay.com/httpdocs/php/pic2blob/do_insert.php3
on line 10

Success!
You have inserted the following into your database:
tn_999.jpg, a 2937 byte file with a mime type of image/pjpeg.
==

Here is the offending line 10.

$binary_junk = addslashes(fread(fopen($img1, "r"), filesize($img1)));

Can someone tell me what's going on here.  I don't seem to have a problem in
fact, but there are enough messages that say I do.  

Thanks.

Floyd



--


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] my bugaboo.

2001-02-10 Thread Floyd Baker


Hello and thanks to all for the help on the magic quotes, etc.  
It gives me a better handle on what I'm dealing with.

Except for one more thing.  

When I bring back text from a field which contains a ', and try to apply it as
the value of an input box, it still truncates in the box.

When I simply print $text, it prints out correctly as *Don't do this* .
When I make $text the default value of an input box, it shows as *Don*.

If the slash is still in place, it reads *Don\'t* above the box and *Don\* in
the box.

My bugaboo continues..  :-

Thanks again for any further advice.

Floyd







On Sat, 03 Feb 2001 19:42:23 -0500, you wrote:


Hi..  

I have a routine where we input text to fields. When there is an apostrophe it
handles it correctly.  When the form is brought back for editing, the field
values show up in the input fields, with all apostrophes intact, just as it
should be. 

When I upload this script to my isp, it doesn't work..  The apostrophes truncate
the rest of the text.   'Don't cry over spilled milk', in a field, turns into
'Don'...  

I have php4 mod in my win32 devbox.  The isp is php3.  Is this the problem? 
What is the best way out of it please?

Thanks in advance.

Floyd

 
--

--


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] my bugaboo.

2001-02-03 Thread Floyd Baker


Hi..  

I have a routine where we input text to fields. When there is an apostrophe it
handles it correctly.  When the form is brought back for editing, the field
values show up in the input fields, with all apostrophes intact, just as it
should be. 

When I upload this script to my isp, it doesn't work..  The apostrophes truncate
the rest of the text.   'Don't cry over spilled milk', in a field, turns into
'Don'...  

I have php4 mod in my win32 devbox.  The isp is php3.  Is this the problem? 
What is the best way out of it please?

Thanks in advance.

Floyd

 
--


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]