Re: [PHP] PHP Exploit via phpBB?

2004-12-22 Thread Roger Spears
John Nichel wrote:
I haven't fully researched it yet, but our domains were just hacked, and 
from the looks of it, the attack came in thru phpBB.  This morning, 
around 9:00am, I upgraded our webserver to php v4.3.10 from v4.3.9 due 
to potential security risks, and at 11:30 it looks as if the attack 
started.  By 11:48, all of the php pages, on all of our domains were 
replaced by one like this...
Isn't this a google hack?  I thought I just read something about this 
today.  They use google to find sites that have phpBB and then use a 
goodgle desktop application to hack

Check out http://www.google.com/news or http://www.cnn.com
I thought I just read it today
HTH,
Roger
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] PHP Exploit via phpBB?

2004-12-22 Thread Roger Spears
John Nichel wrote:
I haven't fully researched it yet, but our domains were just hacked, and 
from the looks of it, the attack came in thru phpBB.  This morning, 
around 9:00am, I upgraded our webserver to php v4.3.10 from v4.3.9 due 
to potential security risks, and at 11:30 it looks as if the attack 
started.  By 11:48, all of the php pages, on all of our domains were 
replaced by one like this...

http://john.nichel.net
I don't know if this is a PHP problem or a phpBB problem as of yet, but 
I wanted to get the word out here so that y'all can take precautions if 
neccessary.  I disabled the system() function on our box, and may need 
to take further action as I discover more.

Below is what I believe to be the 'offensive' access from the Apache 
logs on the domain where the attack started.  If you see something that 
I'm missing, please let the list know.
To quote someone semi-famousGoogle is your friend  :-)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Convert Characters

2004-03-29 Thread Roger Spears
 Reuben Sant wrote:

Hi,

Is there a way to convert any character to it's HTML #xxx; equivalent in
PHP?
For example #65; is the letter A where the number 65 represents it's
ASCII code.
This may help.  It's a function from Tom Rogers, or was it Tim Rogers, 
I can't remember.

function clean_ms_word($original)
  {
$crap = 
array(chr(0x82),chr(0x83),chr(0x84),chr(0x85),chr(0x86),chr(0x87),chr(0x88),chr(0x89),chr(0x8a),chr(0x8b),chr(0x8c),chr(0x91),chr(0x92),chr(0x93),chr(0x94),chr(0x95),chr(0x96),chr(0x97),chr(0x98),chr(0x99),chr(0x9a),chr(0x9b),chr(0x9c),chr(0x9f));
$clean = 
array('lsquor;','fnof;','ldquor;','ldots;','dagger;','Dagger;','','permil;','Scaron;','lsaquo;','OElig;','lsquo;','rsquo;','quot;','quot;','bull;','ndash;','mdash;','tilde;','trade;','scaron;','rsaquo;','oelig;','Yuml;');
$content = str_replace($crap,$clean,$writing);
return $content;
  }

$new = clean_ms_word($original);

$crap is the stuff you don't want.
$clean is the stuff you want.
So, chr(0x82) would become lsquor.

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


Re: [PHP] Re: Local sysadmin DFW needed

2004-03-26 Thread Roger Spears
David Robley wrote:
[EMAIL PROTECTED] (Frank Tudor) wrote in
news:[EMAIL PROTECTED]: 


Hi folks,

Sorry for the inturruption.

I'm looking for a part time sysadmin in the DFW area.



Just out of curiosity, where the hell is DFW? I gather it's not near 
Ridgehaven.

I'm going to guess DFW is just south of BFE

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


Re: [PHP] question

2004-03-25 Thread Roger Spears
Adam Voigt wrote:
Actually this is not true. For example:

$test = 22;

if(is_string($test))
echo IS A STRING;
Will print IS A STRING.

Try

$test = 22;

The  denotes a string and without quotes it denotes a value

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


Re: [PHP] How to do this in PHP?

2004-03-18 Thread Roger Spears
Mike Mapsnac wrote:

I have a table that has 5 cells and each cell has a  link.
So when I click on a cell , the visited cell will get background color.
In other words, when I click on the cell the color of the cell changes.
I often see post here that are not so PHP related.  This is due to the 
fact that the population of this list is so smart and experienced in all 
realms of web development.  :-)

You may wish to search at google.com for keywords such as CSS + cell 
colors or javascript + changing cell colors.

In relation to your question, check out these two sites for some tips...
http://www.faqts.com/knowledge_base/view.phtml/aid/4005/fid/192
http://www.codetoad.com/forum/20_22951.asp
GL,
Roger
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Turn on E_ALL Error Reporting

2004-03-18 Thread Roger Spears
Hello,

I changed the title of this email so it doesn't thread hijack...

I use a simple function like this to turn on and show warnings and 
errors.  It's my understanding though, if the error is catastrophic, it 
will not be displayed on the screen no matter what you do.  Not sure 
about that though...

I did not create this function, nor am I taking credit for it.  I'm 
sharing it.  I think it came from one of my many PHP books, possibly the 
PHP Cookbook...

?php
function pc_error_handler($errno, $error, $file, $line, $context)
  {
$message = [ERROR][$errno][$error][$file:$line];
print p$messagebr;
?
pa href=mailto:[EMAIL PROTECTED]?php print 
$message; ?email this error/a
?php
print /p;
  }

error_reporting(E_ALL);
set_error_handler('pc_error_handler');
?
This will show the warning/error on the screen and provide a link for 
the viewer to use to report said error.  You must replace 
[EMAIL PROTECTED] with your email address.

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


Re: [PHP] Turn on E_ALL Error Reporting

2004-03-18 Thread Roger Spears
Also, when I use that code in my scripts, if there are any variables 
(arrays too) that are in existence with no value:

$someVariable = ;

it will throw a warning on the screen.

First time I saw that I went into panic mode thinking that I had a huge 
amount of errors/warnings...

You are also going to see some numbers associated with the 
errors/warnings.  You can find out what they mean by going here:
http://us2.php.net/manual/en/function.error-reporting.php

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


Re: [PHP] Get form name after submission

2004-03-18 Thread Roger Spears
You assign it to a hidden field in your form

input type=hidden name=formName value=actualFormName

in your PHP:
$formName = $_POST['formName'];
of course, this would have to be accomplished BEFORE the form is 
submitted.  Not sure if that is what you are looking for or not...

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


[PHP] load a URL and trap output

2004-03-12 Thread Roger Spears
Hello,

I have this application which is accessed via a web portal.  The first 
thing my application must do is make sure the visitor is logged in via 
the portal.  The only way to do this is by making a request to a 
specific URL.  This URL (which includes the log in cookie id) will 
return XML to my application.  Once I parse this XML, I will know if 
visitors are logged in.

Simple enough.  

How do I make my application load a URL and trap the returned data so 
that it never creates any browser output?

My first reaction was header(Location: URL) but then I'd be handing 
off control to the URL and the output would appear in the browser.

I've done some research and found system(), exec(), and passthru().  But 
I'm not sure if these functions are the proper way to do such a task 
especially since I'm calling a URL and not a specific UNIX command.

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


[PHP] load a URL and trap output

2004-03-12 Thread Roger Spears
Tom Meinlschmidt wrote:

simple use fopen() or file()

as $fp = fopen(http://somedomain/some.url?blablah,r;);

and read via fread()

 

Perhaps I was mistaken, I thought:

$fp = fopen(http://somedomain/some.url?blablah,r;);
fread();
Would just return the actual HTML code of the page and NOT the results 
of running the page?.?.?.?.?

I will test it out and see.  Thank you for your suggestion!

Roger

Hello,

I have this application which is accessed via a web portal.  The first 
thing my application must do is make sure the visitor is logged in via 
the portal.  The only way to do this is by making a request to a 
specific URL.  This URL (which includes the log in cookie id) will 
return XML to my application.  Once I parse this XML, I will know if 
visitors are logged in.

Simple enough.  

How do I make my application load a URL and trap the returned data so 
that it never creates any browser output?

My first reaction was header(Location: URL) but then I'd be handing 
off control to the URL and the output would appear in the browser.

I've done some research and found system(), exec(), and passthru().  But 
I'm not sure if these functions are the proper way to do such a task 
especially since I'm calling a URL and not a specific UNIX command.

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



 

--
...and I say unto you, the Geek shall inherit the earth.



Re: [PHP] load a URL and trap output

2004-03-12 Thread Roger Spears
Tom Meinlschmidt wrote:


simple use fopen() or file()

as $fp = fopen(http://somedomain/some.url?blablah,r;);

and read via fread()

 

Then I replied with:

Perhaps I was mistaken, I thought:

$fp = fopen(http://somedomain/some.url?blablah,r;);
fread();
Would just return the actual HTML code of the page and NOT the results 
of running the page?.?.?.?.?

I will test it out and see.  Thank you for your suggestion!

Hello All,

It seems fopen() did not work.  However, it did stop the FORBIDDEN 
message I was receiving.  So I think I'm on the right track.  Here's 
what I tried...

$filename = actual URL;

$fd = fopen($filename, r);
$contents = fread($fd, $filename);
fclose($fd);
print strlen($contents);
print p.$contents;
I can open the URL, that works ( fopen() ).
I've tested out the fread(), file(), fgets(), and file_get_contents 
functions.  Nothing works.
I can close the URL, that works ( fclose() ).

With each attempt, I get 0 for the strlen of $contents and nothing else 
prints out.

I also tried adding this to the script right before fopen:
ini_set('allow_url_fopen','1');
That didn't work either...

Any idea(s) on what I'm doing wrong?  I'm using php 4.3.3 and I believe 
it's Apache 1.3

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


[PHP] PHP, Cache Control and Mac IE

2004-02-18 Thread Roger Spears
Hello List,

I am using the following in a PHP script:

header(Expires: Mon, 26 Jul 1997 05:00:00 GMT);
header(Last-Modified:  . gmdate(D, d M Y H:i:s) .  GMT);
header(Cache-Control: no-store, no-cache, must-revalidate);
header(Cache-Control: post-check=0, pre-check=0, false);
header(Pragma: no-cache);
Most browsers will prompt the visitor to reload the data, but if a 
visitor is using IE 5.? on a Mac OS X machine, their browser's back 
button still shows them the original page from cache.  At the top of the 
page, in HTML, I've also added (along with the above headers):

META HTTP-EQUIV=Cache-Control CONTENT=no-store, no-cache, 
must-revalidate
META HTTP-EQUIV=Pragma CONTENT=no-cache
META HTTP-EQUIV=Expires CONTENT=0

and still, the browser pulls from the cache.

I'm guessing this is a bug, but I'm wondering if any one has a work around?

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


Re: [PHP] Why we love Microsoft (0t) - JELLO

2004-01-23 Thread Roger Spears
Another big one is Jello

It's a brand if I'm not mistakenthe product is gelatin

Jello brand gelatin

but all forms of pudding and gelatin are sometimes referred to as Jello...

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


[PHP] SOLVED = is ' or different in MS-Word then ascII?

2004-01-16 Thread Roger Spears
Here is a real code solution instead of my original posted client 
solution

My original problem involved text submitted via the good old fashion 
textarea in a web form.  If a visitor created their text in MS-Word 
and then cut and paste their text over to the web form and submitted, 
any place within their text that they used ' or  would be turned into 
little white boxes.

After spending a day researching this problem, I realized I could just 
inform the visitors to turn off Smart Quotes in their word processor 
application.

Overcome with frustration and exhaustion, I posted this to the list as 
SOLVED and provided my client solution.  As many of you pointed out 
(thank you), it's not a valid solution for a large user base.  And as 
some pointed out (thank you), it's not a solution by any means...

Tom Rogers explained the problem and provided a code solution:
The problem is that Microsoft uses a non standard Latin-1 code for their 
smart quotes and a lot of programs don't know what to do with them as 
a few are actually control codes in other languages.

?php
function clean_ms_word($text){
$crap = array( 
chr(0x82),chr(0x83),chr(0x84),chr(0x85),chr(0x86),chr(0x87),chr(0x88),chr(0x89), 

chr(0x8a),chr(0x8b),chr(0x8c),chr(0x91),chr(0x92),chr(0x93),chr(0x94),chr(0x95), 

chr(0x96),chr(0x97),chr(0x98),chr(0x99),chr(0x9a),chr(0x9b),chr(0x9c),chr(0x9f)
);
$clean = array( 
'lsquor;','fnof;','ldquor;','ldots;','dagger;','Dagger;','','permil;', 

'Scaron;','lsaquo;','OElig;','lsquo;','rsquo;','ldquo;','rdquo;','bull;', 

'ndash;','mdash;','tilde;','trade;','scaron;','rsaquo;','oelig;','Yuml;'
);
$content = str_replace($crap,$clean,$text);
return $content;
}
$string = chr(0x93).'Test'.chr(0x94);

echo clean_ms_word($string).'br';

Thanks Tom!  Works like a charm!!  Also, thanks to everyone who offered 
tips, suggestions, and solutions...

R

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


[PHP] is ' or different in MS-Word then ascII?

2004-01-14 Thread Roger Spears
Hello,

This question may border on OT...

I have a web form where visitors must enter large amounts of text at one 
time (text area).  Once submitted, the large amount of text is stored as 
a CLOB in an Oracle database.

Some of my visitors create their text in Ms-Word and then cut and paste 
it into the text area and then submit the form.

When I retrieve it from the database, I do a stripslahses, htmlentities 
and nl2br in that order to preserve the format of the submitted test. 
When I view this text, single or double quotes show up as little white 
square blocks.  I've tested this out with MS-Word on a windows machine 
and a mac machine.  Same thing happens with either OS.  This only 
happens when they cut and paste from MS-Word into the text area.  If 
they type text into the text area directly, everything is fine...

I know I can search through their submitted text and swap out the 
unrecognized character and insert the proper one.  I just don't know 
what to look for as being the unrecognized character.

I've googled all over looking at ascII charts and keyboard maps. 
Nothing mentions MS-Word specific information though.

Anyone out there dealt with this before?

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


Re: [PHP] is ' or different in MS-Word then ascII?

2004-01-14 Thread Roger Spears
Marek Kilimajer wrote:
 I don't know what the character is but if you paste it into the
 textarea, ord() will tell you.

I have done some further testing.  I created a form with a text area. 
When you hit submit, it just redisplays what ever you typed.  Now, using 
this new test script if I cut and paste from MS-Word, there is no problem.

So that leads me to believe that it has something to do with either 
writing the CLOB onto the Oracel database or retrieving the CLOB from 
the Oracle database.  In either of those two actions, the data is 
becoming corrupted of sorts

I'm currently playing around with my arrangment of stripslashes, 
htmlentities and nl2br.  Trying to arrange them either before placing 
onto the database or after retrieval.

I'm also creating a test where I just cut and paste  into the area and 
use ord() to find out what it's returning...

Thanks for the tip(s)!

R


Roger Spears wrote:

Hello,

This question may border on OT...

I have a web form where visitors must enter large amounts of text at 
one time (text area).  Once submitted, the large amount of text is 
stored as a CLOB in an Oracle database.

Some of my visitors create their text in Ms-Word and then cut and 
paste it into the text area and then submit the form.

When I retrieve it from the database, I do a stripslahses, 
htmlentities and nl2br in that order to preserve the format of the 
submitted test. When I view this text, single or double quotes show up 
as little white square blocks.  I've tested this out with MS-Word on a 
windows machine and a mac machine.  Same thing happens with either 
OS.  This only happens when they cut and paste from MS-Word into the 
text area.  If they type text into the text area directly, everything 
is fine...

I know I can search through their submitted text and swap out the 
unrecognized character and insert the proper one.  I just don't know 
what to look for as being the unrecognized character.

I've googled all over looking at ascII charts and keyboard maps. 
Nothing mentions MS-Word specific information though.

Anyone out there dealt with this before?

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


Re: [PHP] is ' or different in MS-Word then ascII?

2004-01-14 Thread Roger Spears
Marek Kilimajer wrote:
 I don't know what the character is but if you paste it into the
 textarea, ord() will tell you.

When I run ord(), it returns the value of 19.  I'm guessing that is a 
hex value.  And when I look that up on the ascII table, it says:
19 DC3 (Device Control 3)

For some reason when it retrieves the CLOB from the database it is 
converting any  that were created with MS-Word into this DC3 character.

Strange indeed

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


[PHP] SOLVED= is ' or different in MS-Word then ascII?

2004-01-14 Thread Roger Spears
Hello Everybody,

I have found a solution and/or the root of the problem.  I googled on 
the topic of MS-Word + smart quotes.

That lead me to this site:
http://www.rpgtimes.net/rpgtimes/guide.php?guide=1
It seems that the default for Word is to have smart quotes to on. 
When you have smart quotes on it replaces the ordinary straight quotes 
with a left specific and right specific quote.

To correct this:
Go into TOOLSAUTO-CORRECTAUTO-FORMATremove checkmark from replace 
straight quotes with smart quotes.  Also in TOOLSAUTO-CORRECT you must 
remove the line in AUTO-REPLACE about replacing ... with three dots that 
are closer together.

Once I did that, my problem was solved  Thanks to all who have 
helped today.  I appreaciate it!!

BEFORE I changed these two Word settings, when writing to the database, 
the ord() (ordinate) value for the left quote was 147 and the right 
quote was 148.  When being retrieved from the database, the ord() 
(ordinate) value for the left quote was 17 and the right quote was 19.

Thanks again to everyone who offered help!

Roger

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


Re: [PHP] Not working?

2004-01-08 Thread Roger Spears
Jas wrote:

 I think I must be missing something but this command isn't renaming the
 file specified...  Pointers, tips appreciated!

 system(rename('/path/to/new.sh', '/path/to/old.$today'));

 /to directory has permissions set to current user and is also owned by
 the current user (test_user)... I can write files into the directory and
 delete files form the directory using the 'unlink()' command but the
 rename function I am having problems with.
 Jas

remove the  from around the rename function:

You have this:
system(rename('/path/to/new.sh', '/path/to/old.$today'));
Try this:
system(rename('/path/to/new.sh', '/path/to/old.$today'));
HTH,
Roger
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Rename generates level 2 warning but works

2003-12-31 Thread Roger Spears
Hello,

I have this magical script which uses rename.  A visitor to the site 
uploads a file and I want to rename it to a timestamp.  Oddly enough, 
the rename() function actually works, it renames the file AND then 
generates a level 2 warning:

Error code: 2
Error message: rename() failed (No such file or directory)
Why does it work AND create a warning?

Here's the snippet of code:
$rename = time();
$old_name = $_FILES['uploadedFile']['name'];
$read_extension = explode(., $old_name);
$ext = $read_extension[1];
$new_name = $rename...$ext;
rename($old_name, $new_name);
I know I can suppress the the warning with @, but I'm more interested in 
WHY this warning gets generated.  I'm using PHP 4.2.2 on a Linux box. 
Any hints or suggestions are greatly appreciated...

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


Re: [PHP] Rename generates level 2 warning but works

2003-12-31 Thread Roger Spears
Lowell Allen wrote:

Try using $HTTP_POST_FILES['uploadedFile']['name'] instead. I wasted a bunch
of time yesterday with an upload script that did not recognize files when
using $_FILES, but worked fine with $HTTP_POST_FILES -- PHP 4.3.4 on
Linux.
Thank you for the suggestion.  Unfortunately, it didn't resolve the 
issue.  Still getting the warning AND the rename function works.  Odd 
indeed...

Thanks,
Roger


[PHP] SOLVED: [PHP] Rename generates level 2 warning but works

2003-12-31 Thread Roger Spears
Lowell Allen wrote

So, I think you need to pass rename parameters that are file locations.

HTH

--
Lowell Allen
 

Thank you!!!

I was not in tune to what was happening.  You are correct.  You must 
pass file locations and not just file namesonce I passed the 
locations, the warning went away.

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


[PHP] preserving blank space padding when using fgetcsv

2003-12-03 Thread Roger Spears
Hello,

I've been researching this for most of the day and am unable to find an 
answer.

I'm using fgetcsv to read a comma delimited file (Microsoft Excel CSV).  
I'm trying to create a PHP application which will read a csv file line 
by line, remove the commas and preserve the padding that is in each 
column.  That means if a column is a fixed length of 15 characters and 
the actual text in that column is only 5 characters long, the 
application will preserve the extra 10 blank spaces.

I'm able to open and read the csv using fgetcsv:
$handle = fopen ($filename, r);
while ($mpt_line = fgetcsv ($handle, filesize ($filename), ,))
{
Then I check each member of that array to make sure it is the proper 
length for that column:
if (strlen($mpt_line[0])4)
{
str_pad($mpt_line[0], 4,  , STR_PAD_RIGHT);
}
When all of the length checks are finished I remove the commas and then 
print out the finished product:
}
$no_commas = str_replace(,, , $mpt_line);
print aa/.$no_commas[0]./aa;

For output all I get is the actual text and no blank space padding.  
Meaning that if the field contains two characters of data it should 
still appear 4 characters in length.  I was hoping to achieve aa/hi  /aa 
instead all I get is aa/hi/aa. 

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


[PHP] preserving blank space padding when using fgetcsv

2003-12-03 Thread Roger Spears
The first time I sent this message to the list, this is what bounced back...

Hi. This is the qmail-send program at pb1.pair.com.
I'm afraid I wasn't able to deliver your message to the following addresses.
This is a permanent error; I've given up. Sorry it didn't work out.
[EMAIL PROTECTED]:
This message is looping: it already has my Delivered-To line. (#5.4.6)
So I am resending it.  I apologize if anyone is getting this message twice..



Hello,

I've been researching this for most of the day and am unable to find an 
answer.

I'm using fgetcsv to read a comma delimited file (Microsoft Excel CSV).  
I'm trying to create a PHP application which will read a csv file line 
by line, remove the commas and preserve the padding that is in each 
column.  That means if a column is a fixed length of 15 characters and 
the actual text in that column is only 5 characters long, the 
application will preserve the extra 10 blank spaces.

I'm able to open and read the csv using fgetcsv:

$handle = fopen ($filename, r);

while ($mpt_line = fgetcsv ($handle, filesize ($filename), ,))

{

Then I check each member of that array to make sure it is the proper 
length for that column:

if (strlen($mpt_line[0])4)

   {

   str_pad($mpt_line[0], 4,  , STR_PAD_RIGHT);

   }

When all of the length checks are finished I remove the commas and then 
print out the finished product:

}

$no_commas = str_replace(,, , $mpt_line);

print aa/.$no_commas[0]./aa;



For output all I get is the actual text and no blank space padding.  
Meaning that if the field contains two characters of data it should 
still appear 4 characters in length.  I was hoping to achieve aa/hi  /aa 
instead all I get is aa/hi/aa. 

Thanks,

Roger

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


Re: [PHP] [Stats] PHP Net List: October 2003

2003-11-05 Thread Roger Spears
That is funny stuff..I often wonder why no one ever cracks jokes or 
makes a connection...

John W. Holmes wrote:

John Nichel wrote:

Hey, I beat John Holmes  


You mean you're bigger than 14 inc... err, nevermind, you're talking 
about something else...



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


[PHP] Maeler Deamon Problem with PHP-DB list

2003-10-17 Thread Roger Spears
WTF does all this mean? 

Hi. This is the qmail-send program at pb1.pair.com.
I'm afraid I wasn't able to deliver your message to the following addresses.
This is a permanent error; I've given up. Sorry it didn't work out.
[EMAIL PROTECTED]:
This message is looping: it already has my Delivered-To line. (#5.4.6)
Everytime I try to post to the PHP-DB list, I get this email

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


[PHP] PDFlib Page Dimensions and Word Wrap

2003-10-08 Thread Roger Spears
Hello,

I have read the http://us4.php.net/manual/en/ref.pdf.php and am unable 
to find a solution for what I'm trying to do.  I've also tried googling 
for what I'm trying to do.  No luck there either.  I've also downloaded 
the PDFlib docs but no luck there.

When using PDFlib you specify page dimensions.  Why then, does it not 
automatically wrap words/texts/sentences to the next line?  Is there 
something I'm missing to have PDFlib automatically do this?  No matter 
the amount of text in the variable I'm trying to print in the pdf, it 
just runs off the right side of the pdf document.

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


Re: [PHP] PDFlib Page Dimensions and Word Wrap

2003-10-08 Thread Roger Spears
Tried that.  Unless I overlooked something, the PDFlib.com docs were of 
no help.

Thanks,
Roger
Curt Zirzow wrote:

* Thus wrote Roger Spears ([EMAIL PROTECTED]):
 

Hello,

I have read the http://us4.php.net/manual/en/ref.pdf.php and am unable 
to find a solution for what I'm trying to do.  I've also tried googling 
for what I'm trying to do.  No luck there either.  I've also downloaded 
the PDFlib docs but no luck there.

When using PDFlib you specify page dimensions.  Why then, does it not 
automatically wrap words/texts/sentences to the next line?  Is there 
something I'm missing to have PDFlib automatically do this?  No matter 
the amount of text in the variable I'm trying to print in the pdf, it 
just runs off the right side of the pdf document.
   

You might want to refer to the  API documentation at:
 http://www.pdflib.com/
It seems that the pdflib documentation on the php site needs some
work :)
Curt
 

--
Roger Spears
Technology Project Coordinator
College of Arts and Sciences
Bowling Green State University
Bowling Green, Ohio  43403
VOICE: (419) 372-2015
FAX: (419) 372-8548


[PHP] PHP Contest/Marathon at geek.org

2003-10-08 Thread Roger Spears
Sorry if this is a double post or if it's already been talked about. 

I just found out a few moments ago that http://www.dotgeek.org/ is 
having a php programming contest/marathon in November.  Here's the link:

http://www.dotgeek.org/?q=node/view/9

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


[PHP] Printer Functions

2003-10-03 Thread Roger Spears
Hello,

I was wondering if anyone has had any level of success with printer 
functions.

I'm trying to get the following code to work:

?php
$handle = printer_open();
printer_start_doc($handle, Hello World);
printer_start_page($handle);
printer_end_page($handle);
printer_end_doc($handle);
printer_close($handle);
?
I get the following error: printer_open() is an undefined function.  
I'm guessing that the printer functions were never installed with my 
version of PHP?.?.?.?  I'm currently running PHP Version 4.3.3

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


[PHP] Logged Out of Seesion, Then use back button

2003-09-23 Thread Roger Spears
Hello,

I've googled to try to find an answer to this.  I've also checked the 
php.net site.  Perhaps I'm not using the correct search parameters.  The 
only suggestion I've found is the following code:

?php
header('Cache-Control: no-cache');
header('Pragma: no-cache');
?
But this doesn't seem to solve my problems.

My problem/question is as follows.

I have an email script that works in the following steps:

1) Login (if success then FROM and a personal email signature are 
properly populated)

2) Choose specifics for the email (this populates the TO variable and 
the other BODY variables)

3) Then click on preview (this creates the email with all the current 
variables, on the screen for viewing)

4) Then send the email

5) Prompted to create another or logout (if create another, then some 
session variables are unset) (if logout then session is destroyed)

Everything works as intended.  

One user, however, has created a glitch.  He/she logged out and later 
returned to their still opened browser and used the back button to 
return to step 2 in the process.  Every email they created after using 
the back button has the following problems:
1) The reply to address and the from address are both default server 
address's and not the users personal email address.
2) Their is no personal signature.

Here's my questions
1) How can I prevent the use of the browser back button after someone 
logs out?
2) If, after a user has attained step 3, they use their back button to 
change a variables value in step 2, the new value is never saved by the 
session and their original entry is used in the email.  How can I adjust 
for people using their back buttons during the individual steps of the 
script?
3) Should the header calls appear before the session_start or after?

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


Re: [PHP] Logged Out of Seesion, Then use back button

2003-09-23 Thread Roger Spears
Sorry Didier, your suggestion did not solve the problem.  I appreciate 
the information though!

I'm still having the back button problem in the middle of using the 
script.

Thanks,
Roger
Didier McGillis wrote:

http://www.php.net/manual/en/function.header.php

?php
// Date in the past
header(Expires: Mon, 26 Jul 1997 05:00:00 GMT);
// always modified
header(Last-Modified:  . gmdate(D, d M Y H:i:s) .  GMT);
// HTTP/1.1
header(Cache-Control: no-store, no-cache, must-revalidate);
header(Cache-Control: post-check=0, pre-check=0, false);
// HTTP/1.0
header(Pragma: no-cache);
?


From: Roger Spears [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: [PHP] Logged Out of Seesion, Then use back button
Date: Tue, 23 Sep 2003 11:51:40 -0400
Hello,

I've googled to try to find an answer to this.  I've also checked the 
php.net site.  Perhaps I'm not using the correct search parameters.  
The only suggestion I've found is the following code:

?php
header('Cache-Control: no-cache');
header('Pragma: no-cache');
?
But this doesn't seem to solve my problems.

My problem/question is as follows.

I have an email script that works in the following steps:

1) Login (if success then FROM and a personal email signature are 
properly populated)

2) Choose specifics for the email (this populates the TO variable 
and the other BODY variables)

3) Then click on preview (this creates the email with all the current 
variables, on the screen for viewing)

4) Then send the email

5) Prompted to create another or logout (if create another, then some 
session variables are unset) (if logout then session is destroyed)

Everything works as intended.

One user, however, has created a glitch.  He/she logged out and later 
returned to their still opened browser and used the back button to 
return to step 2 in the process.  Every email they created after 
using the back button has the following problems:
1) The reply to address and the from address are both default server 
address's and not the users personal email address.
2) Their is no personal signature.

Here's my questions
1) How can I prevent the use of the browser back button after 
someone logs out?
2) If, after a user has attained step 3, they use their back button 
to change a variables value in step 2, the new value is never saved 
by the session and their original entry is used in the email.  How 
can I adjust for people using their back buttons during the 
individual steps of the script?
3) Should the header calls appear before the session_start or after?

Thanks in advance,
Roger
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
_
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.  
http://join.msn.com/?page=features/virus

--
Roger Spears
Technology Project Coordinator
College of Arts and Sciences
Bowling Green State University
205 Administration Bldg.
Bowling Green, OH 43403
419-372-2015
419-372-8548 fax
The best accelerator available for a Mac is one that causes it to go at 9.81 m/s2.
(The rate at which objects fall to earth)
It would be just like programmers to shorten 'the year 2000 problem' to 'Y2K'... exactly 
the kind of thinking that created this situation in the first place.
- Steven C. Meyer
The significant problems we face cannot be solved at the same level of thinking we were at 
when we created them.
- Albert Einstein
If a cluttered desk is a sign of a cluttered mind, of what then, is an empty desk?
- Albert Einstein
It is well to remember that the entire universe, with one trifling exception, is composed 
of others.
- John Andrew Holmes
The only thing more dangerous than a hardware guy with a code patch is a programmer with a soldering iron.

3 Biggest Computer Room Lies:
1) As long as you remember to 'SAVE' your input, you'll never lose any files.
2) We run the stuff through as fast as it comes in the door.
3) The new machines are in order.
Murphy's Laws of Computing
--
  1. When computing, whatever happens, behave as though you meant it to happen.
  2. When you get to the point where you really understand your computer, it's 
probably obsolete.
  3. The first place to look for information is in the section of the manual where you 
least expect to find it.
  4. When the going gets tough, upgrade.
  5. For every action, there is an equal and opposite malfunction.
  6. To err is human... to blame your computer for your mistakes is even more human, 
it is downright natural.
  7. He who laughs last probably made a back-up.
  8. If at first you do not succeed, blame your computer.
  9. A complex system that does not work is invariably found to have evolved from a 
simpler system that worked just fine.
 10. The number one cause of computer problems is computer solutions.
 11. A computer program will always do what you tell it to do, but rarely what you 
want to do.


--
PHP General Mailing List (http://www.php.net

[PHP] email receipts

2003-09-18 Thread Roger Spears
and please, could we turn off the email receipt requested before 
sending messages to this list???  I find them most annoying and time 
consuming for a list this large.

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


[PHP] 'while' not picking up on first DB record

2003-09-17 Thread Roger Spears
Hello,

Can anyone from the lists please tell me why this bit of code is not 
picking up on the first record in the database?  If the 'id' I'm looking 
for is '1' it doesn't populate the _SESSION variables.  Any 'id' greater 
then '1' will populate the _SESSION variables.

$q = SELECT * FROM employee;
$r = mysql_query($q);
$row = mysql_fetch_array($r);
while ($row = mysql_fetch_array($r))
 {
   if ($employee == $row[id])
   {
   $_SESSION['dear'] = $row[last_name];
   $_SESSION['to_email'] = $row[email];
   }
 }
Thanks,
Roger
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] SOLVED= 'while' not picking up on first DB record

2003-09-17 Thread Roger Spears
I'm sorry for the double post.  Other then letting both lists know this 
was solved, it won't happen again.  Sorry.

Thank you for the solution!

I new it was simple.  I've been staring at it too long.  Fresh eyes 
always helps!

Thanks again,
Roger
You are making the fetch twice, and not using the first fetch.

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


[PHP] Test Please Delete

2003-08-14 Thread Roger Spears
test, please delete



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