[PHP] PHP and Palm Pilot interaction

2003-12-15 Thread Dave G
PHP Gurus,
I have a web site that helps people sign up for workshops and
classes. The classes happen away from any computer or web access. What I
want to do is be able to collect data about payment and attendance and
be able to send it to the web site for inclusion into the MySQL
database.
Of course, I could go low tech and just have people write things
down and then later type in results when they finally get web access.
However, if possible, I would like to take advantage of the fact
that the teachers of these classes all carry Palm Pilots. If it were
possible, could they record data in some fashion that would allow them
to copy the data over to their PC when they hot synch, and then upload
it to a page where it would automatically be integrated into the site
database.
I have only the faintest notions about how this could work, and
I suspect it may simply not be possible.
But on the other hand, I was wondering if it may be possible to
make use of the simple text editor on the Palm, or perhaps the newer
Excel editors (which I have not yet tried), to create a file of flat
data which could then be uploaded and interpreted by PHP and then
entered into the DB. It seems to me that a simple text file would
probably be easy to upload and read by PHP, but then I'd have to do more
work to get the teachers to conform to layout standards and do more
error checking since the text file allows for a wide range of mistakes
to happen. The Excel file would make it easier for the teachers to see
where to enter data and have less mistakes, but then it might be more
difficult to get the data out of it, through PHP, and into the database.
If anyone has any pointers or advice about how to best approach
this problem, please let me know.

-- 
Yoroshiku!
Dave G
[EMAIL PROTECTED]

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



[PHP] Re: PHP IDE?

2003-12-15 Thread rush
"Peter Walter" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Rush,
>
> templatetamer looks like an environment that I would be interested in
> using; however, what support resources are available for templatetamer?
> Is there a news server, bulletin board, or other help resource for
> people new to templatetamer?

Hello,

currently there is only Wiki, and mail support. However, to compensate, I
try my best not to affer only answers to strictly technical support
questions, but also to all various questions on how to do something with TT,
or how to approach some problem with it. Quite often I compile answer to
such question and put it afterwards on the wiki as an example, so I have
double benefit from it. In the future I may open a mailing list or something
similar.

Hope that helps, and if you have any questions please do not hesitate to
mail me.

rush
--
http://www.templatetamer.com/

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



Re: [PHP] treu type fonts

2003-12-15 Thread Jason Wong
On Monday 15 December 2003 11:13, cj wrote:

> How would I output the image to a file on the hard drive

Assuming you're using the gd lib functions, then whatever function you're 
using to output the image has an option to write to disk. As always see 
manual for details.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
"The vast majority of successful major crimes against property are
perpetrated by individuals abusing positions of trust."
-- Lawrence Dalzell
*/

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



Re: [PHP] PHP and Palm Pilot interaction

2003-12-15 Thread Adam i Agnieszka Gasiorowski FNORD
Dave G wrote:

[...]

> But on the other hand, I was wondering if it may be possible to
> make use of the simple text editor on the Palm, or perhaps the newer
> Excel editors (which I have not yet tried), to create a file of flat
> data which could then be uploaded and interpreted by PHP and then
> entered into the DB. It seems to me that a simple text file would
> probably be easy to upload and read by PHP, but then I'd have to do more
> work to get the teachers to conform to layout standards and do more
> error checking since the text file allows for a wide range of mistakes
> to happen. The Excel file would make it easier for the teachers to see
> where to enter data and have less mistakes, but then it might be more
> difficult to get the data out of it, through PHP, and into the database.

[...]

Make a custom sheet in Excel for the
 teachers. Excel can generate a comma delimited
 (CSV) file out of a sheet. The you can very
 easily import that file into your PHP program
 :8] (there is even a function for it, IIRC).

-- 
Seks, seksić, seksolatki... news:pl.soc.seks.moderowana
http://hyperreal.info  { iWanToDie }   WiNoNa)   (
http://szatanowskie-ladacznice.0-700.pl  foReVeR(  *  )
Poznaj jej zwiewne kształty... http://www.opera.com 007

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



Re: [PHP] true type fonts again

2003-12-15 Thread Jason Wong
On Monday 15 December 2003 13:26, cj wrote:

> I have been able to the the image to display, which is a gif image of a
> rectange.
> But the text doesn't get displayed on the image.
>
> There are no error messages on the screen
> The other messages entitled true type fonts is a thread I started as well,
> but the image was not being displayed on the screen at all.
> So now I have the image but no text on the image.
>
> What could be causing this, and what should I have a look at?

If you had read and followed the advice given in response to your earlier 
posts I'm sure you would've solved your problem by now.

Again:

1) Enable FULL error reporting by including these lines at the top of your 
code:

  error_reporting (E_ALL);
  ini_set('display_errors', 1);

2) Output the image to file. Remember to comment out the header() for the time 
being.

3) And someone else suggested that you may have specified the name of your 
font file incorrectly. In my experience you *have* to specify a path to your 
font file. So if the font file was in the same directory as your script then 
use './name_of_font_file'. So if you had followed the above steps (at the 
least step 1) you would have seen the following error:

  PHP Warning:  imagettftext(): Could not find/open font in ...

and would have clued you into what the problem was.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Alone, adj.:
In bad company.
-- Ambrose Bierce, "The Devil's Dictionary"
*/

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



[PHP] Problem with adding quotations to a mysql insert statement

2003-12-15 Thread Richard Kurth
I need to add extra quotation marks in to the following insert command for
mysql.

I need one that is part of the info right before the |$wrapper resend and
right after the
$outgoing,nobody
$query = "insert into majordomoaliases
(domain,listname,var,address1,address2)values
(/"$domname/",\"$listname\",\"a\",\"$listdomain-$listname:\",\" |$wrapper
resend -C $domaincf -l
$listname -h $listdomain $listdomain-$listname-$outgoing,nobody\")";

The whole line should look like this when it is printed out to the page it
will be written to from the database
"|/var/wrapper resend -C /var/domaincf -l list1 -h domain.com
domain.com-list1-outgoing,nobody"

I am totaly stuped on haw to add this extra quotation mark no mater what I
do I get mysql errors.

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



[PHP] $GLOBALS containing itself!!!

2003-12-15 Thread Gerard Samuel
Just curious about something I came across.
I was looking at the $GLOBAL array, to see what my script was leaving behind.
$GLOBALS contains a reference to itself.
Even though its a reference, whats the sense with that??
Once its global, why should it have to call on itself?
Im currently running php 4.3.4 on FreeBSD 4.9

Thanks

A script to try out ->


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



Re: [PHP] $GLOBALS containing itself!!!

2003-12-15 Thread Robert Cummings
On Mon, 2003-12-15 at 04:23, Gerard Samuel wrote:
> Just curious about something I came across.
> I was looking at the $GLOBAL array, to see what my script was leaving behind.
> $GLOBALS contains a reference to itself.
> Even though its a reference, whats the sense with that??
> Once its global, why should it have to call on itself?

It's global isn't it? SOunds like completeness.

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



Re: [PHP] PHP IDE?

2003-12-15 Thread SLanger
Hello

If you don't mind running a JVM you can use PHPEclipse with the Eclipse 
Framework. Additionally to the php plugin there are a lot of other plugins 
out there that  can assist you. 

http://www.phpeclipse.org

Regards
Stefan Langer

[PHP] searching and replacing in a file

2003-12-15 Thread Richard Kurth
How can I read through a file and find a string and then replace it with a
new string and then save the whole file.

Below is a peace of what I need to search through. I need to find the string
subscribe_policy = open and replace it with subscribe_policy = open+confirm.
Then save the whole file.

I have tried str_replace but it just wipes out the original file.

$file = "/var/lib/majordomo/domain.com/lists/listname.config";
$fp = fopen("$file", "w+");
$content = fread($fp, filesize($file));
$replace= "subscribe_policy =  open+confirm";
$search_str = "subscribe_policy =  open";
$content2 = str_replace($search_str,$replace, $content);
fwrite($fp,$content2);
fclose($fp);

# restrict_post[restrict_post] (autoupdates) 
# If defined, only addresses listed in these files (colon or space
# separated) can post to the mailing list. By default, these files
# are relative to the lists directory. These files are also checked
# when get_access, index_access, info_access, intro_access,
# which_access, or who_access is set to 'list'. This is less useful
# than it seems it should be since there is no way to create these
# files if you do not have access to the machine running resend.
# This mechanism will be replaced in a future version of
# majordomo/resend.
restrict_post = autoupdates.posters

# subscribe_policy [enum] (open)  /open;closed;auto;op
# One of three values: open, closed, auto; plus an optional
# modifier: '+confirm'.  Open allows people to subscribe themselves
# to the list. Auto allows anybody to subscribe anybody to the list
# without maintainer approval. Closed requires maintainer approval
# for all subscribe requests to the list.  Adding '+confirm', ie,
# 'open+confirm', will cause majordomo to send a reply back to the
# subscriber which includes a authentication number which must be
# sent back in with another subscribe command.
subscribe_policy = open

# unsubscribe_policy   [enum] (closed)  /open;closed;auto/
# One of three values: open, closed, auto.  Open allows people to
# unsubscribe themselves from the list. Auto allows anybody to
# unsubscribe anybody to the list without maintainer approval. The
# existence of the file .auto is the same as specifying
# the value auto.  Closed requires maintainer approval for all
# unsubscribe requests to the list. In addition to the keyword, if
# the file .closed exists, it is the same as specifying
# the value closed. The value of this keyword overrides the value
# supplied by any existent files.
unsubscribe_policy = open

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



[PHP] searching and replacing in a file

2003-12-15 Thread Richard Kurth
How can I read through a file and find a string and then replace it with a
new string and then save the whole file.

Below is a peace of what I need to search through. I need to find the string
subscribe_policy = open and replace it with subscribe_policy = open+confirm.
Then save the whole file.

I have tried str_replace but it just wipes out the original file.

$file = "/var/lib/majordomo/domain.com/lists/listname.config";
$fp = fopen("$file", "w+");
$content = fread($fp, filesize($file));
$replace= "subscribe_policy =  open+confirm";
$search_str = "subscribe_policy =  open";
$content2 = str_replace($search_str,$replace, $content);
fwrite($fp,$content2);
fclose($fp);

# restrict_post[restrict_post] (autoupdates) 
# If defined, only addresses listed in these files (colon or space
# separated) can post to the mailing list. By default, these files
# are relative to the lists directory. These files are also checked
# when get_access, index_access, info_access, intro_access,
# which_access, or who_access is set to 'list'. This is less useful
# than it seems it should be since there is no way to create these
# files if you do not have access to the machine running resend.
# This mechanism will be replaced in a future version of
# majordomo/resend.
restrict_post = autoupdates.posters

# subscribe_policy [enum] (open)  /open;closed;auto;op
# One of three values: open, closed, auto; plus an optional
# modifier: '+confirm'.  Open allows people to subscribe themselves
# to the list. Auto allows anybody to subscribe anybody to the list
# without maintainer approval. Closed requires maintainer approval
# for all subscribe requests to the list.  Adding '+confirm', ie,
# 'open+confirm', will cause majordomo to send a reply back to the
# subscriber which includes a authentication number which must be
# sent back in with another subscribe command.
subscribe_policy = open

# unsubscribe_policy   [enum] (closed)  /open;closed;auto/
# One of three values: open, closed, auto.  Open allows people to
# unsubscribe themselves from the list. Auto allows anybody to
# unsubscribe anybody to the list without maintainer approval. The
# existence of the file .auto is the same as specifying
# the value auto.  Closed requires maintainer approval for all
# unsubscribe requests to the list. In addition to the keyword, if
# the file .closed exists, it is the same as specifying
# the value closed. The value of this keyword overrides the value
# supplied by any existent files.
unsubscribe_policy = open

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



RE: [PHP] PHP IDE?

2003-12-15 Thread Wouter van Vliet
Yeah .. vim is my god too. You can do so many things with so little
keystrokes. And it basically has the best syntax highlighting I've ever
seen. With some easy tricks you can even let it highlight your own
functions. I haven't doen so, but I know it's possible :P... Also, it exists
on most servers so you can work directly on the server. Without having to
mess with (Samba) filesharing. Another advantage is that it runs both on
Linux as well as on Windows.

W.

(ps. Ahbaid or anyone else .. how can I get code to re-fold. I've setup my
vim to fold every PHP function and class, which works when I load te file.
But when I'm done editing a certain block, what do I do to make it fold back
in again?)

On zondag 14 december 2003 18:27 Ahbaid Gaffoor told the butterflies:
> with folding you can "fold" your code in chunks, you
> basically setup a "start fold" and an "end fold" and place
> code between them, then you can open and close (fold) that
> block of code as you need to or don't need to see it...
> 
> for example:
> 
> # {{{ PHP Code to do something...
> 
> ..
> ..
> 1 lines of code...
> ..
> ..
> # }}}
> 
> would collapse to one line when folded and look something like:
> 
> + PHP Code to do something
> 
> then when you hit space on it it expands. (I use {{{ and }}}
> as my start and end folds)
> 
> 
> ctags allows you to build a dictionary of words which you can
> hook into
> vim, that way you can do tab completion on PHP words etc.
> 
> I also like to map keystrokes to coding templates for things like
> functions, loops, declarations etc.
> 
> Everyone's got their own setup :)
> 
> Plus I always use a CVS repository for my work, so my routine
> of, code,
> test, commit is habit.
> 
> Looking at the responses there seems to be a lot of neat editors out
> there, to each his own. 
> 
> regards,
> 
> Ahbaid.
> 
> Jough Jeaux wrote:
> 
> > Hmm, I'm currently a vim user also.  You'll have to
> > elaborate on this folding and ctag business though...
> > 
> > 
> > --- Ahbaid Gaffoor <[EMAIL PROTECTED]> wrote:
> > 
> > 
> > > vim - with folding and ctags
> > > 
> > > sweet.
> > > 
> > > Ahbaid
> > > 
> > > Jough Jeaux wrote:
> > > 
> > > 
> > > 
> > > > Was wondering what everyone's favortie IDE is for
> > > > coding in PHP.  I've got a big PHP project in the
> > > > works.  I'll be doing alot with it and am looking
> > > > 
> > > > 
> > > for
> > > 
> > > 
> > > > ways to boost my productivity.
> > > > 
> > > > --Jough
> > > > 
> > > > 
> > > > __
> > > > Do you Yahoo!?
> > > > New Yahoo! Photos - easier uploading and sharing.
> > > > http://photos.yahoo.com/
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > > 
> > > 
> > > 
> > 
> > __
> > Do you Yahoo!?
> > New Yahoo! Photos - easier uploading and sharing.
> > http://photos.yahoo.com/

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



Re: [PHP] searching and replacing in a file

2003-12-15 Thread olinux
$filename = '/path/to/file.txt';

$contents = file_get_contents($filename);
$contents = str_replace($search,$replace,$contents);

$handle = fopen($filename, "w");
if (fwrite($handle, $contents)) {
   echo 'file write successful';
} else {
   echo 'file write failed';
   exit;
}
fclose($handle);

also - there's no need to enclose the variable $file
in quotes here:
> $fp = fopen("$file", "w+");


olinux


--- Richard Kurth <[EMAIL PROTECTED]> wrote:
> How can I read through a file and find a string and
> then replace it with a
> new string and then save the whole file.
> 


__
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/

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



RE: [PHP] $GLOBALS containing itself!!!

2003-12-15 Thread Wouter van Vliet
On maandag 15 december 2003 10:24 Gerard Samuel told the butterflies:
> Just curious about something I came across.
> I was looking at the $GLOBAL array, to see what my script was leaving
> behind. $GLOBALS contains a reference to itself.
> Even though its a reference, whats the sense with that??
> Once its global, why should it have to call on itself?
> Im currently running php 4.3.4 on FreeBSD 4.9
> 
> Thanks
> 
> A script to try out ->
>  
> header('content-type: text/plain');
> 
> var_dump(isset($GLOBALS['GLOBALS']['GLOBALS']));  // returns true
> 
> // Prints out the $GLOBALS array
> // including one reference to itself
> // then starts another but quits with *RECURSION* var_dump($GLOBALS);
> 
> > 

Well .. it basically just "Contains a reference to every variable which is
currently available within the global scope of the script. The keys of this
array are the names of the global variables.". Since $GLOBALS itself is
global, that too is contained.

So: 


var_dump(isset($GLOBALS['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS
']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBAL
S']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBA
LS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOB
ALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLO
BALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GL
OBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['G
LOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['
GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS'][
'GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']
['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS'
]['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS
']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBAL
S']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBA
LS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOB
ALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLO
BALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GL
OBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['G
LOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['
GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS'][
'GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']
['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS'
]['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS
']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBAL
S']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBA
LS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOB
ALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLO
BALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GL
OBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['G
LOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['
GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS'][
'GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']
['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS']['GLOBALS'
]));

Will still print out true. the displaying of *RECURSION* is to prevent, well
.. ehmm, recursively printing out the $GLOBALS array over and over again.
This is something new in PHP 4.0.4. Read the manual on page
http://nl3.php.net/manual/en/function.print-r.php:

Note: Prior to PHP 4.0.4, print_r() will continue forever if given
an array or object that contains a direct or indirect reference to itself.
An example is print_r($GLOBALS) because $GLOBALS is itself a global variable
that contains a reference to itself. 

:),
Wouter

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



[PHP] problem with files bigger than 2GB

2003-12-15 Thread php-admin
I use PHP 4.1.2 under Linux (Kernel 2.4.18).
On files bigger than 2GB the php-function 'file_exists'
exits with 'Warning: stat failed on ... (errno=75 - 
Value too large for defined data type') ...

How can I solve this problem?
Thanks for every help.

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



Re: [PHP] searching and replacing in a file

2003-12-15 Thread John Nichel
Richard Kurth wrote:

How can I read through a file and find a string and then replace it with a
new string and then save the whole file.
Below is a peace of what I need to search through. I need to find the string
subscribe_policy = open and replace it with subscribe_policy = open+confirm.
Then save the whole file.
I have tried str_replace but it just wipes out the original file.


Have php...

1) Make a copy of the original:

if ( ! copy ( $old_file, $backup_file . ".bak" ) ) {
// Uh-oh, there's an error
}
2) Read the original and open a temp file:

$file_contents = file ( $old_file );
if ( ! $fp = fopen ( $temp_file, "w+" ) ) {
//  Oh my, can't open the file
}
3) Parse and write:

for ( $i = 0; $i < sizeof ( $file_contents ); $i++ ) {
$write_this = preg_replace ( $pattern, $replacement, $file_contents[$i] );
if ( ! fwrite ( $fp, $write_this ) ) {
// Darn, can't write to the temp file
}
}
4) Cleanup and copy temp file:

fclose ( $fp );
if ( ! copy ( $temp_file, $old_file ) ) {
// Zoinks, there seems to be a problem
}
It's 5:00 am for me, and I'm typing all this from memory, so there may 
be bugs :)  You can remove the temp file if you so desire if the above 
runs without error.

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] trouble parsing an XML document

2003-12-15 Thread alfredo
thank you,
but the error:
>> Parse error: parse error, unexpected '$', expecting T_VARIABLE in 
(mypath)...on line...

refers to the line whit the
>> var ${'REG-ORIG'};
code, anyway I took the code by the PHP manual.
bye
Alfredo
Raditha Dissanayake wrote:

> doesn't look like a xml parser problem. I haven't tried your code but 
i think the error is $this->$k
>
> alfredo wrote:
>
>> Hello,
>> I'm trying to parse a XML doc, but the doc has some tags like:
>> 
>>
>> so when I try to initialize variables:
>>
>> class Documenti {
>> var $FILE; //nomefile
>> var $NUMERO; //numerodiserie
>> var ${'REG-OR;IG'}; // here is the broblem
>> function Documenti($aa) {
>> foreach ($aa as $k=>$v)
>> $this->$k = $aa[$k];
>> }
>>
>> i have an error:
>> Parse error: parse error, unexpected '$', expecting T_VARIABLE...
>>
>> I tryed changing the $ position:
>> var {$'REG-ORIG'}; // here is the broblem
>>

>> does not change anything:
>> Parse error: parse error, unexpected '{', expecting T_VARIABLE...
>>
>> thanks for any suggestion,
>> Alfredo (Italy)
>>
>
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Fatal Error: PDFlib error ...

2003-12-15 Thread Sven
Matthias Nothhaft schrieb:

Hi,

I'm trying to get the pdflib work...

I use pdflib 4.0.3 downloaded from pdflib.de and php 4.3.4 on Debian Linux.

I wrote this test code:
hi matthias,
if you want to use this lib it's good to be familiar with classes and 
objects in php. the manual can help you at this. now to your code.


dl("libpdf_php.so");

$pdf = pdf_new();
you just created a php-object $pdf.
for your further methods you must explicit declare them to your objects:
pdf_begin_page($pdf, 421, 595);
$pdf->pdf_begin_page($pdf, 421, 595);
... and so on.
hth SVEN
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


php-general Digest 15 Dec 2003 12:55:31 -0000 Issue 2474

2003-12-15 Thread php-general-digest-help

php-general Digest 15 Dec 2003 12:55:31 - Issue 2474

Topics (messages 172697 through 172729):

Re: PHP IDE?
172697 by: Peter Walter
172702 by: Pablo Gosse
172713 by: rush
172720 by: SLanger.spirit21.de
172723 by: Wouter van Vliet

Pear install problem
172698 by: Pablo Gosse

How could I count the elements of each dimension of an array?
172699 by: orlandopozo.icnet.com.ve
172700 by: Al

Re: Operation in an Array
172701 by: Al

Printing PHP Source with a PHP Script
172703 by: Gohaku
172704 by: John W. Holmes
172706 by: Mike
172707 by: Gohaku

Re: treu type fonts
172705 by: cj
172714 by: Jason Wong

Re: Trying to check for a valid URL String.
172708 by: Al
172710 by: Justin French

Re: session_start() make netscape 4.7 reload page.
172709 by: Jonathan Zhang

true type fonts again
172711 by: cj
172716 by: Jason Wong

PHP and Palm Pilot interaction
172712 by: Dave G
172715 by: Adam i Agnieszka Gasiorowski FNORD

Problem with adding quotations to a mysql insert statement
172717 by: Richard Kurth

$GLOBALS containing itself!!!
172718 by: Gerard Samuel
172719 by: Robert Cummings
172725 by: Wouter van Vliet

searching and replacing in a file
172721 by: Richard Kurth
172722 by: Richard Kurth
172724 by: olinux
172727 by: John Nichel

problem with files bigger than 2GB
172726 by: php-admin.kabeljournal.de

Re: trouble parsing an XML document
172728 by: alfredo

Re: Fatal Error: PDFlib error ...
172729 by: Sven

Administrivia:

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

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

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


--
--- Begin Message ---
Rush,

templatetamer looks like an environment that I would be interested in 
using; however, what support resources are available for templatetamer? 
Is there a news server, bulletin board, or other help resource for 
people new to templatetamer?

Peter

Rush wrote:
"Jough Jeaux" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Was wondering what everyone's favortie IDE is for
coding in PHP.  I've got a big PHP project in the
works.  I'll be doing alot with it and am looking for
ways to boost my productivity.


If you are going to work with templates, you can take a look at
TemplateTamer, which has IDE geared for such development.
rush
--
http://www.templatetamer.com/
--- End Message ---
--- Begin Message ---

>Was wondering what everyone's favortie IDE is for
>coding in PHP.  I've got a big PHP project in the
>works.  I'll be doing alot with it and am looking for
>ways to boost my productivity.
>
>--Jough


If you're willing to purchase a commercial product I'd highly recommend
Zend's IDE.  I've been working on a large PHP development project for a
little over a year now and switched to the Zend IDE about three months
ago and it has really increased my productivity.

My $0.02 CDN ($0.0151483 USD).

P.
--- End Message ---
--- Begin Message ---
"Peter Walter" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Rush,
>
> templatetamer looks like an environment that I would be interested in
> using; however, what support resources are available for templatetamer?
> Is there a news server, bulletin board, or other help resource for
> people new to templatetamer?

Hello,

currently there is only Wiki, and mail support. However, to compensate, I
try my best not to affer only answers to strictly technical support
questions, but also to all various questions on how to do something with TT,
or how to approach some problem with it. Quite often I compile answer to
such question and put it afterwards on the wiki as an example, so I have
double benefit from it. In the future I may open a mailing list or something
similar.

Hope that helps, and if you have any questions please do not hesitate to
mail me.

rush
--
http://www.templatetamer.com/
--- End Message ---
--- Begin Message ---
Hello

If you don't mind running a JVM you can use PHPEclipse with the Eclipse 
Framework. Additionally to the php plugin there are a lot of other plugins 
out there that  can assist you. 

http://www.phpeclipse.org

Regards
Stefan Langer--- End Message ---
--- Begin Message ---
Yeah .. vim is my god too. You can do so many things with so little
keystrokes. And it basically has the best syntax highlighting I've ever
seen. With some easy tricks you can even let it highlight your own
functions. I haven't doen so, but I know it's possible :P... Also, it exists
on most servers so you can work directly on the server. Without having to
mess with (Samba) filesharing. Another advantage is that it runs both on
Linux as well as on Windows.

W.

(ps. Ahbaid or anyone else .. how 

Re: [PHP] How do i save images created using PHP

2003-12-15 Thread Marek Kilimajer
Please be more specific.

[EMAIL PROTECTED] wrote:
hi, i am able to create images in php (png, jpeg) in IE.
What has IE with creating images?

> when i try to
save the image it gets saved to the directed path. when i try to open 
the saved document i get an error message
What error message? Where does the message come from?

or else the file opens but 
with a whole lot of text gibberish (stuff life division by zero , etc) 
this code is for a optimization proj and has some math in it.Kindly help,
CLive.

Show us some code.

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


[PHP] Re: help with install

2003-12-15 Thread Sven
Paul Vinten schrieb:

ok, Just installed PHP with Xitami, with Apache 1.3 AND 2. I've used PHP
versions 4.33 and 4.3.4. I'm running Windows XP, mucking around with some
pages that came with my Web Programming book, most of the php pages work,
but anything involving sessions, forms and cookies etc just doesn't work.
Anyone any pages that they know work that I can try, so I can figure out
what the problem is? Should they work, even though the PHP code is actually
quite old? (the version that came with the book is 4.0.3) The stuff works ok
under 4.0.3, but I need the functionality of the latest version for some
stuff on my Uni course... Anyone able to help me, or point me in the right
direction?
hi,

just some thoughts:

for sessions it's possible, that in php.ini 'session.save_path' or 
'session.cookie_path' isn't correctly defined?

another possiblility is, that your scripts depend on 'register_globals = 
On', which is (now) set to 'off' by default (location: php.ini). either 
you set it 'on' (not recommended, search the newsgroup for that and the 
security issues), or rewrite your scripts for "off-support", e.g. 
$_SESSION['sess_var'].

hth SVEN

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


[PHP] DGS Search Script Modifications

2003-12-15 Thread K. Praveen Kumar
Dear All,
I recently downloaded the DGS search, which has the great features. Now
I would like to modify the script a bit.
Requirement:
I wanted to search different tables for the entered keywords. If find
the file name and id will be different for each so, I wanted to get the
id of that particular row and the type and show that as a link.

Example:
I have two tables. 1) Countries 2) Credits.
Countries table have the following fields: overview, description
Credits table have the following fields: overview, description

IF the given word matches the word in Countris.overview and
Credits.description then it should display
http://localhost/overview.php?CountryId=1 and
http://localhost/description.php?CountryId=10&CreditId=3 Please suggest
me where I can modify the script to get the script working for me.


-- 
Thanks in Advance
Praveen Kumar
SoftPro Systems Ltd

---SOFTPRO DISCLAIMER--

Information contained in this E-MAIL and any attachments are
confidential being  proprietary to SOFTPRO SYSTEMS  is 'privileged'
and 'confidential'.

If you are not an intended or authorised recipient of this E-MAIL or
have received it in error, You are notified that any use, copying or
dissemination  of the information contained in this E-MAIL in any
manner whatsoever is strictly prohibited. Please delete it immediately
and notify the sender by E-MAIL.

In such a case reading, reproducing, printing or further dissemination
of this E-MAIL is strictly prohibited and may be unlawful.

SOFTPRO SYSYTEMS does not REPRESENT or WARRANT that an attachment
hereto is free from computer viruses or other defects. 

The opinions expressed in this E-MAIL and any ATTACHEMENTS may be
those of the author and are not necessarily those of SOFTPRO SYSTEMS.


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



Re: [PHP] trouble parsing an XML document

2003-12-15 Thread Sven
hi,

Raditha Dissanayake schrieb:

doesn't look like a xml parser problem. I haven't tried your code but i 
think the error is $this->$k
no, why not a variable method depending on $k?

alfredo wrote:

Hello,
I'm trying to parse a XML doc, but the doc has some tags like:

so when I try to initialize variables:

class Documenti {
var $FILE; //nomefile
var $NUMERO; //numerodiserie
var ${'REG-ORIG'}; // here is the broblem
take a look at http://www.php.net/manual/language.variables.php:
"A valid variable name starts with a letter or underscore, followed by 
any number of letters, numbers, or underscores."
so, a minus isn't allowed in varnames!
hth SVEN

function Documenti($aa) {
foreach ($aa as $k=>$v)
$this->$k = $aa[$k];
}
i have an error:
Parse error: parse error, unexpected '$', expecting T_VARIABLE...
I tryed changing the $ position:
var {$'REG-ORIG'}; // here is the broblem
does not change anything:
Parse error: parse error, unexpected '{', expecting T_VARIABLE...
thanks for any suggestion,
Alfredo (Italy)


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


[PHP] Re: Problem with adding quotations to a mysql insert statement

2003-12-15 Thread Sven
Richard Kurth schrieb:

I need to add extra quotation marks in to the following insert command for
mysql.
I need one that is part of the info right before the |$wrapper resend and
right after the
$outgoing,nobody
$query = "insert into majordomoaliases
(domain,listname,var,address1,address2)values
(/"$domname/",\"$listname\",\"a\",\"$listdomain-$listname:\",\" |$wrapper
resend -C $domaincf -l
$listname -h $listdomain $listdomain-$listname-$outgoing,nobody\")";
The whole line should look like this when it is printed out to the page it
will be written to from the database
"|/var/wrapper resend -C /var/domaincf -l list1 -h domain.com
domain.com-list1-outgoing,nobody"
I am totaly stuped on haw to add this extra quotation mark no mater what I
do I get mysql errors.
hi richard,

take a look at
mysql-manual
 /6 MySQL Language Reference
  /6.1 Language Structure
   /6.1.1 Literals: How to Write Strings and Numbers
/6.1.1.1 Strings
 "A `"' inside a string quoted with `"' may be written as `""'."
so for your query:
$query = "insert into majordomoaliases (domain, listname, var, address1, 
address2) values (\"$domname\", \"$listname\", \"a\", 
\"$listdomain-$listname:\", \" \"\"$wrapper resend -C $domaincf -l 
$listname -h $listdomain $listdomain-$listname-$outgoing,nobody\"\"\")";

hth SVEN

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


[PHP] DGS Search Modifications

2003-12-15 Thread K. Praveen Kumar
Dear All,
I recently downloaded the DGS search, which has the great
features. Now
I would like to modify the script a bit.
Requirement:
I wanted to search different tables for the entered keywords. If
find
the file name and id will be different for each so, I wanted to get the
id of that particular row and the type and show that as a link.

Example:
I have two tables. 1) Countries 2) Credits.
Countries table have the following fields: overview, description
Credits table have the following fields: overview, description

IF the given word matches the word in Countris.overview and
Credits.description then it should display
http://localhost/overview.php?CountryId=1 and
http://localhost/description.php?CountryId=10&CreditId=3 Please suggest
me where I can modify the script to get the script working for me.
-- 
Thanks & Regards
Praveen Kumar
SoftPro Systems Ltd

---SOFTPRO DISCLAIMER--

Information contained in this E-MAIL and any attachments are
confidential being  proprietary to SOFTPRO SYSTEMS  is 'privileged'
and 'confidential'.

If you are not an intended or authorised recipient of this E-MAIL or
have received it in error, You are notified that any use, copying or
dissemination  of the information contained in this E-MAIL in any
manner whatsoever is strictly prohibited. Please delete it immediately
and notify the sender by E-MAIL.

In such a case reading, reproducing, printing or further dissemination
of this E-MAIL is strictly prohibited and may be unlawful.

SOFTPRO SYSYTEMS does not REPRESENT or WARRANT that an attachment
hereto is free from computer viruses or other defects. 

The opinions expressed in this E-MAIL and any ATTACHEMENTS may be
those of the author and are not necessarily those of SOFTPRO SYSTEMS.


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



[PHP] Help Cookie

2003-12-15 Thread abdi
Warning: Cannot modify header information - headers already sent by (output
started at /home/ewako/public_html/cintadp/config.php:153)
in /home/ewako/public_html/cintadp/mod/forum/forum_functions.php on line 547

help me!!!



This email sending using iNterNUX Free WebMail.
"To Sign Up click here :"
http://www.internux.web.id/

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



RE: [PHP] Help Cookie

2003-12-15 Thread Jay Blanchard
[snip]
Warning: Cannot modify header information - headers already sent by
(output
started at /home/ewako/public_html/cintadp/config.php:153)
in /home/ewako/public_html/cintadp/mod/forum/forum_functions.php on line
547

help me!!!
[/snip]

Stop sending headers And send a little code

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



Re: [PHP] Help Cookie

2003-12-15 Thread John Nichel
[EMAIL PROTECTED] wrote:

Warning: Cannot modify header information - headers already sent by (output
started at /home/ewako/public_html/cintadp/config.php:153)
in /home/ewako/public_html/cintadp/mod/forum/forum_functions.php on line 547
help me!!!
Output has been sent to the browser before you tried to set the cookie.

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Help Cookie

2003-12-15 Thread Joaquin Bernal
aiwi> Warning: Cannot modify header information - headers already sent by (output
aiwi> started at /home/ewako/public_html/cintadp/config.php:153)
aiwi> in
aiwi> /home/ewako/public_html/cintadp/mod/forum/forum_functions.php on
aiwi> line 547

aiwi> help me!!!

Check there are no spaces or newlines before the opening tag  embedded into an HTML
page here. If this is so, you should use buffered output to be able to
send cookies. Tell us if is the case.

Greets.

-- 
Joaquin Bernal

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



[PHP] var check not working...

2003-12-15 Thread Jas
For some reason this will not work... my $_POST variables check for no 
form variables and display a form... if they choose an item from a 
select box it queries the database for a field matching the $_post var 
and builds a new form creating 8 separate $_post variables to check 
for.. so far it works except when selecting an item from the select box 
it will only display the first form when there are $_post vars present. 
 I think I am missing something, could someone look over my code?
Thanks in advance,
Jas

function vlans_dhcp() {
$lvl = base64_decode($_SESSION['lvl']);
	if ($lvl != "admin") {
		$_SESSION['lvl'] = base64_encode($lvl);
		$_SESSION['msg'] = $dberrors[12];
		call_user_func("db_logs");
	} elseif ($lvl == "admin") {
		$_SESSION['lvl'] = base64_encode($lvl);
		if (($_POST == "") || (!isset($_POST['dhcp_vlans'])) || 
(!isset($_POST['sub'])) || (!isset($_POST['msk'])) || 
(!isset($_POST['dns01'])) || (!isset($_POST['dns02'])) || 
(!isset($_POST['rtrs'])) || (!isset($_POST['vlans']))) {
			create 1st form with dhcp_vlans as $_post var;
		} elseif (($_POST != "") || (isset($_POST['dhcp_vlans'])) || 
($_POST['dhcp_vlans'] != "--") || (!isset($_POST['sub'])) || 
(!isset($_POST['msk'])) || (!isset($_POST['dns01'])) || 
(!isset($_POST['dns02'])) || (!isset($_POST['rtrs'])) || 
(!isset($_POST['vlans']))) {
			create 2nd form based on dhcp_vlans $_post var and create 8 different 
$_post vars...;
		} elseif (($_POST != "") || (!isset($_POST['dhcp_vlans'])) || 
(isset($_POST['id'])) || (isset($_POST['sub'])) || 
(isset($_POST['msk'])) || (isset($_POST['dns01'])) || 
(isset($_POST['dns02'])) || (isset($_POST['rtrs'])) || 
(isset($_POST['rnge'])) || (isset($_POST['vlans']))) {
			now put 8 $_post vars in database...;
		} else {
			$_SESSION['lvl'] = base64_encode($lvl);
			header("Location: help.php"); }
	} else {
		$_SESSION['lvl'] = base64_encode($lvl);
		$_SESSION['msg'] = $dberrors[12];
		call_user_func("db_logs"); }
}

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


Re: [PHP] PHP IDE?

2003-12-15 Thread daniel hahler
on Sat, 13 Dec 2003 09:06:56 -0800 (PST) Jough Jeaux wrote:

JJ> Was wondering what everyone's favortie IDE is for
JJ> coding in PHP.  I've got a big PHP project in the
JJ> works.  I'll be doing alot with it and am looking for
JJ> ways to boost my productivity.

Used to use UltraEdit some time, but now I'm with jEdit.

It's an OpenSource Java editor and supports plugins.. so you can
manage Projects and a lot more.

It's main target (from the number of plugins) is Java development, but
it's great for PHP/HTML also.

http://www.jedit.org/


-- 
shinE!
http://www.thequod.de ICQ#152282665
PGP 8.0 key: http://thequod.de/danielhahler.asc

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



[PHP] Q on RegExp & extended Char

2003-12-15 Thread jsWalter
I've hit my limit on regular expressions.

I need to check a string to see if it contains legal characters...

A thru Z [a-z], SPACE, PERIOD, DASH/HYPHEN, APOSTROPHE [\' -,\.]

OK, this is not a problem.

My problem comes in with extended characters, as these examples...
  González
  Vänligen
  före
  innehålla

I'm trying to build a RegExp that will see if the string is a proper name
format or not.

Names only have A thru Z, extended characters for other languages (than
English), SPACE, PERIOD, DASH/HYPHEN, APOSTROPHE
  Dr. Roger O'Malley
  Mrs. Sara Harris-Henderson

I have a RegExp to do English letters, but not the extended set...
  Manuel González
  Försök Bokstäver
  Contém Espaço-Válido

(Ok, these are not really names, but you get the idea)

Any ideas on this?

All I want to know is if a given string contains only these types of
characters. anything else would give me a FALSE.

Thanks
Walter

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



[PHP] Re: Q on RegExp & extended Char

2003-12-15 Thread Jas
Well have you thought about maybe an array of illegal or extended 
characters and simply replacing them?
eg.
$b = $_POST['whatever_variables_you_have'];
$match = array("ö","ç","ä");
$replace = array("o","c","a");
$z = str_replace($match,$replace,$b);

Might not be exactly what you want but hope it helps.
Jas
Jswalter wrote:
I've hit my limit on regular expressions.

I need to check a string to see if it contains legal characters...

A thru Z [a-z], SPACE, PERIOD, DASH/HYPHEN, APOSTROPHE [\' -,\.]

OK, this is not a problem.

My problem comes in with extended characters, as these examples...
  González
  Vänligen
  före
  innehålla
I'm trying to build a RegExp that will see if the string is a proper name
format or not.
Names only have A thru Z, extended characters for other languages (than
English), SPACE, PERIOD, DASH/HYPHEN, APOSTROPHE
  Dr. Roger O'Malley
  Mrs. Sara Harris-Henderson
I have a RegExp to do English letters, but not the extended set...
  Manuel González
  Försök Bokstäver
  Contém Espaço-Válido
(Ok, these are not really names, but you get the idea)

Any ideas on this?

All I want to know is if a given string contains only these types of
characters. anything else would give me a FALSE.
Thanks
Walter
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Subject: searching for open source php module

2003-12-15 Thread matt shultz

hi,
i am looking for an open source php module that does some simple content 
management.   it seems that something like this must exists, since it is a 
pretty common need, but i'm not sure where to find such a thing.  here is 
a description of the functionality i am looking for: ability to update 
many page withing a website with content unique to each, hopefully with 
versioning for each of these pages (so that previous versions can be 
referenced or reverted to). in my thinking, each page is just a single 
text field that the updater fills in on the backend of the site.  it also 
would be usefull if the module took care of paragraph breaks without 
makeing the user type in html.  as you can see, this is a very very simple 
module, and i would just write it myself except that it seems like someone 
may have already done so.  let me know where to look (or for something 
similar, since i can easily mod anything that's out there), and also if 
there is a good resource for open source php projects of this type.


m.

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



[PHP] Re: Q on RegExp & extended Char

2003-12-15 Thread Sven
Jswalter schrieb:
I've hit my limit on regular expressions.

I need to check a string to see if it contains legal characters...

A thru Z [a-z], SPACE, PERIOD, DASH/HYPHEN, APOSTROPHE [\' -,\.]

OK, this is not a problem.

My problem comes in with extended characters, as these examples...
  González
  Vänligen
  före
  innehålla
I'm trying to build a RegExp that will see if the string is a proper name
format or not.
Names only have A thru Z, extended characters for other languages (than
English), SPACE, PERIOD, DASH/HYPHEN, APOSTROPHE
  Dr. Roger O'Malley
  Mrs. Sara Harris-Henderson
I have a RegExp to do English letters, but not the extended set...
  Manuel González
  Försök Bokstäver
  Contém Espaço-Válido
(Ok, these are not really names, but you get the idea)

Any ideas on this?

All I want to know is if a given string contains only these types of
characters. anything else would give me a FALSE.
Thanks
Walter
hi walter,
because most of these chars are extended ascii (decimal: 128-255), this 
regex should work: '/\x80-\xFF/' (hex-values). also take care of the 
minus in your regex if it doesn't stand on start or end of your 
char-group it means 'from-to'!
hth SVEN

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


[PHP] Re: var check not working...

2003-12-15 Thread Sven
Jas schrieb:

For some reason this will not work... my $_POST variables check for no 
form variables and display a form... if they choose an item from a 
select box it queries the database for a field matching the $_post var 
and builds a new form creating 8 separate $_post variables to check 
for.. so far it works except when selecting an item from the select box 
it will only display the first form when there are $_post vars present. 
 I think I am missing something, could someone look over my code?
Thanks in advance,
Jas

function vlans_dhcp() {
$lvl = base64_decode($_SESSION['lvl']);
if ($lvl != "admin") {
$_SESSION['lvl'] = base64_encode($lvl);
$_SESSION['msg'] = $dberrors[12];
call_user_func("db_logs");
} elseif ($lvl == "admin") {
$_SESSION['lvl'] = base64_encode($lvl);
if (($_POST == "") || (!isset($_POST['dhcp_vlans'])) || 
(!isset($_POST['sub'])) || (!isset($_POST['msk'])) || 
(!isset($_POST['dns01'])) || (!isset($_POST['dns02'])) || 
(!isset($_POST['rtrs'])) || (!isset($_POST['vlans']))) {
create 1st form with dhcp_vlans as $_post var;
} elseif (($_POST != "") || (isset($_POST['dhcp_vlans'])) || 
($_POST['dhcp_vlans'] != "--") || (!isset($_POST['sub'])) || 
(!isset($_POST['msk'])) || (!isset($_POST['dns01'])) || 
(!isset($_POST['dns02'])) || (!isset($_POST['rtrs'])) || 
(!isset($_POST['vlans']))) {
create 2nd form based on dhcp_vlans $_post var and create 8 
different $_post vars...;
} elseif (($_POST != "") || (!isset($_POST['dhcp_vlans'])) || 
(isset($_POST['id'])) || (isset($_POST['sub'])) || 
(isset($_POST['msk'])) || (isset($_POST['dns01'])) || 
(isset($_POST['dns02'])) || (isset($_POST['rtrs'])) || 
(isset($_POST['rnge'])) || (isset($_POST['vlans']))) {
now put 8 $_post vars in database...;
} else {
$_SESSION['lvl'] = base64_encode($lvl);
header("Location: help.php"); }
} else {
$_SESSION['lvl'] = base64_encode($lvl);
$_SESSION['msg'] = $dberrors[12];
call_user_func("db_logs"); }
}
hi jas,

the problem is, that your second form is only executed if your first 
condition is false (else if). but because of your or condition (||) only 
  one of them has to be true. right? right! so it doesn't matter if 
your $_POST['dhcp_vlans'] is not set, when any other isn't set. a 
solution might be:


hth SVEN

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


[PHP] Re: var check not working...

2003-12-15 Thread Jas
Sven wrote:

Jas schrieb:

For some reason this will not work... my $_POST variables check for no 
form variables and display a form... if they choose an item from a 
select box it queries the database for a field matching the $_post var 
and builds a new form creating 8 separate $_post variables to check 
for.. so far it works except when selecting an item from the select 
box it will only display the first form when there are $_post vars 
present.  I think I am missing something, could someone look over my 
code?
Thanks in advance,
Jas

function vlans_dhcp() {
$lvl = base64_decode($_SESSION['lvl']);
if ($lvl != "admin") {
$_SESSION['lvl'] = base64_encode($lvl);
$_SESSION['msg'] = $dberrors[12];
call_user_func("db_logs");
} elseif ($lvl == "admin") {
$_SESSION['lvl'] = base64_encode($lvl);
if (($_POST == "") || (!isset($_POST['dhcp_vlans'])) || 
(!isset($_POST['sub'])) || (!isset($_POST['msk'])) || 
(!isset($_POST['dns01'])) || (!isset($_POST['dns02'])) || 
(!isset($_POST['rtrs'])) || (!isset($_POST['vlans']))) {
create 1st form with dhcp_vlans as $_post var;
} elseif (($_POST != "") || (isset($_POST['dhcp_vlans'])) || 
($_POST['dhcp_vlans'] != "--") || (!isset($_POST['sub'])) 
|| (!isset($_POST['msk'])) || (!isset($_POST['dns01'])) || 
(!isset($_POST['dns02'])) || (!isset($_POST['rtrs'])) || 
(!isset($_POST['vlans']))) {
create 2nd form based on dhcp_vlans $_post var and create 
8 different $_post vars...;
} elseif (($_POST != "") || (!isset($_POST['dhcp_vlans'])) || 
(isset($_POST['id'])) || (isset($_POST['sub'])) || 
(isset($_POST['msk'])) || (isset($_POST['dns01'])) || 
(isset($_POST['dns02'])) || (isset($_POST['rtrs'])) || 
(isset($_POST['rnge'])) || (isset($_POST['vlans']))) {
now put 8 $_post vars in database...;
} else {
$_SESSION['lvl'] = base64_encode($lvl);
header("Location: help.php"); }
} else {
$_SESSION['lvl'] = base64_encode($lvl);
$_SESSION['msg'] = $dberrors[12];
call_user_func("db_logs"); }
}


hi jas,

the problem is, that your second form is only executed if your first 
condition is false (else if). but because of your or condition (||) only 
  one of them has to be true. right? right! so it doesn't matter if your 
$_POST['dhcp_vlans'] is not set, when any other isn't set. a solution 
might be:


hth SVEN
Yah I figured that out.. those operators always throw me off... Thanks 
again.
Jas

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


[PHP] 4 project questions - help appreciated

2003-12-15 Thread Ryan A
Hi,
I am making a personal project like so:

I enter something in the text box (eg. "PHP REALLY ROCKS!!!")
then the program checks if that string already exists in the database, if
no, then it should enter it into the database and also generate a "key"
This key can be given to pals and they can read the "secret message"

Key:
Key should first be 1-1000 then a-z then A-Z then axxx (eg: a001, the xxx
will always be numbers) once it reaches 999 it should become Axxx then b
then B etc after a,A,b,B are done it should go for aaxx,AAxx etc always 4
characters

A few questions:
1.Looking at the above (database part) I figured that doing this via a mysql
database would be better rather than a text database...do you agree?

2.I was thinking of making the "key" field a primary key and unique and
indexedright?

3.The way I see it theres 3 sql statements that need to be run, a) connect
and see if string exists b)read the last key c)write to the
database...anyway to break the above to 2 statements or am I following this
wrong?

4. Logic for the key, I am coming up with crummy logic to make the "key",
basically a block of code for 1-1000,another block for a-z another block for
A-Z etc.. any ideas,links,URLs or code snippets off the top of your head
would be greatly appreciated.


Thanks in advance.

Cheers,
-Ryan

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



[PHP] php compile error with mysql undefined reference to `mysql_real_escape_string'

2003-12-15 Thread Ivone Uribe
Hi all!
I'm installing php4.3.3, apache 1.3.28 with
mysql3.22.32
I'm using this option --with-mysql=/usr/local/mysql

But when I compile the php code, I get this error:

ext/mysql/php_mysql.o: In function
`zif_mysql_client_encoding':
/root/fuente/archivos/php-4.3.3/ext/mysql/php_mysql.c:1118:
undefined reference to `mysql_character_set_name'
ext/mysql/php_mysql.o: In function
`zif_mysql_real_escape_string':
/root/fuente/archivos/php-4.3.3/ext/mysql/php_mysql.c:1705:
undefined reference to `mysql_real_escape_string'
collect2: ld returned 1 exit status

To solve it..I try the option --disable-cli on
./configure, and all ok.
But now I have the same problem
(/php-4.3.3/ext/mysql/php_mysql.c:1118: undefined
reference to `mysql_character_set_name')
when I try to compile the apache...

Please!!! Does anybody  know how to solve it?

Thanks in advance!!


__
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/

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



[PHP] Re: 4 project questions - help appreciated

2003-12-15 Thread Jas
1. MySQL is free, fairly easy to use and is way better than using a text 
file.

2. I would use something to effect of a 'id' field in the database and 
set that to be indexed, auto-incrementing and unique vs. using your 
'public key' as the indexed portion of the database

3. Sounds like you already know what kind of function you need.  If you 
need an example here is one.
[snippit]

function keys() {
/* Connect to database */
$db = @mysql_pconnect('localhost','user_name','password') or 
die(mysql_error());
/* Select databse to use */
@mysql_select_db('keys') or die("Could not connect to remote database.");
$tble = "messages";
/* Look for existing key */
$sql = mysql_query("SELECT * FROM $tble WHERE key = '$key'",$db)or 
die(mysql_error());
/* Create array of variables retrieved */	
while ($row = mysql_fetch_array($sql)) {
	$id = $row["session"]; }
	/* Check to see if any results were returned */		
	if (mysql_num_rows($sql) == 0) {
		$insert = @mysql_query("INSERT INTO $tble VALUES 
('','$var1','$var2','$var3','$var4','$var5')",$db)or die(mysql_error());
	/* If key exists update data with form data */
	} elseif (mysql_num_rows($sql) != 0) {
		$update = @mysql_query("UPDATE $tble SET var1=\"$var1\", 
var2=\"$var2\", var3=\"$var3\", var4=\"$var4\", var5=\"$var5\" WHERE 
key=\"$key\"",$db)or die(mysql_error());
	} else {
		exit(); }	
} else {
	exit(); }
}
?>
[end snippit]

4. You are talking about a one way hash to be used as a public key 
right? If you are I generate a unique key in this manner (I really don't 
loop through any array's of numbers or letters) instead I pull an image 
randomly selected from a specified directory and then through it through 
a system of functions as illustrated below.  You can record the key in 
the database and use it as a "public key" so to speak so the person your 
sending the secret message to would need to know that "public key".
[snippit]

/* Function to create array of images */
$rand_image = array();
$x = 0;
$x++; $rand_image[$x] = "shared/image01.jpg";
$x++; $rand_image[$x] = "shared/image02.jpg";
$x++; $rand_image[$x] = "shared/image03.jpg";
$x++; $rand_image[$x] = "shared/image04.jpg";
/* Randomly select image to encrypt and use as session variable */
function random_image() {
	global $rand_image;
	srand ((double) microtime() * 100);
	print $rand_image[rand(1,sizeof($rand_image))]; }
	/* Encryption function for random image */
	$hash = md5(uniqid(microtime($rand_image),1));
}
echo $hash;
?>
[end snippit]
Hope that helps some...
Jas

Ryan A wrote:

Hi,
I am making a personal project like so:
I enter something in the text box (eg. "PHP REALLY ROCKS!!!")
then the program checks if that string already exists in the database, if
no, then it should enter it into the database and also generate a "key"
This key can be given to pals and they can read the "secret message"
Key:
Key should first be 1-1000 then a-z then A-Z then axxx (eg: a001, the xxx
will always be numbers) once it reaches 999 it should become Axxx then b
then B etc after a,A,b,B are done it should go for aaxx,AAxx etc always 4
characters
A few questions:
1.Looking at the above (database part) I figured that doing this via a mysql
database would be better rather than a text database...do you agree?
2.I was thinking of making the "key" field a primary key and unique and
indexedright?
3.The way I see it theres 3 sql statements that need to be run, a) connect
and see if string exists b)read the last key c)write to the
database...anyway to break the above to 2 statements or am I following this
wrong?
4. Logic for the key, I am coming up with crummy logic to make the "key",
basically a block of code for 1-1000,another block for a-z another block for
A-Z etc.. any ideas,links,URLs or code snippets off the top of your head
would be greatly appreciated.
Thanks in advance.

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


[PHP] Re: php compile error with mysql undefined reference to `mysql_real_escape_string'

2003-12-15 Thread Jas
You really should be subscribing to the php.install list when asking 
questions of this type.  But it sounds like you need to first install 
mysql, then install apache, then install php.  In that order and you 
should be ok.  When in doubt read the manuals for each application for 
further information on the different options available for your ./configure.
HTH
Jas

Ivone Uribe wrote:

Hi all!
I'm installing php4.3.3, apache 1.3.28 with
mysql3.22.32
I'm using this option --with-mysql=/usr/local/mysql
But when I compile the php code, I get this error:

ext/mysql/php_mysql.o: In function
`zif_mysql_client_encoding':
/root/fuente/archivos/php-4.3.3/ext/mysql/php_mysql.c:1118:
undefined reference to `mysql_character_set_name'
ext/mysql/php_mysql.o: In function
`zif_mysql_real_escape_string':
/root/fuente/archivos/php-4.3.3/ext/mysql/php_mysql.c:1705:
undefined reference to `mysql_real_escape_string'
collect2: ld returned 1 exit status
To solve it..I try the option --disable-cli on
./configure, and all ok.
But now I have the same problem
(/php-4.3.3/ext/mysql/php_mysql.c:1118: undefined
reference to `mysql_character_set_name')
when I try to compile the apache...
Please!!! Does anybody  know how to solve it?

Thanks in advance!!

__
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Email problem

2003-12-15 Thread Naveen Glore

Hello all, 

I have freebsd server with apache, PHP and mysql. i wrote a simple PHP program using 
mail(). The mail() function returns true without any error. but the problem is the 
email is never delivered. I viewed the log file for mail(/var/log/maillog) and i saw 
the following error: 

Server sendmail[351]:NOQUEUE:SYSERR(www):can not chdir(/var/spool/clientmqueue/): 
Permission denied. 

I would be really thankful if someone could tell me where i am doing wrong. 

In PHP.INI , i have set sendmail_path = "/usr/sbin/sendmail". 

thanks in advance. 

Naveen.



-
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing

[PHP] logic for displaying hierarchical data (ala windows explorer)

2003-12-15 Thread Chris W. Parker
Hi everyone,

Last Friday I struggled for a long time with displaying some data that's
stored using the Modified Preorder Tree Traversal method. Without making
this email overly long and complicated (like my first draft was) I'd
like to simply ask if someone has any links or functions or instructions
they can give me on how to display my data in such a way.

I want the following:

Level 1A
|--Level 2A
|  \--Level 3A
| |--Level 4A
| |  \--Level 5A
| \--Level 3B
|--Level 2B
|  \--Level 3C
\--Level 2C
   \--Level 3D

What I always end up with is this (or some variant of it):

Level 1A
|--Level 2A
|  \--Level 3A
|  |  |--Level 4A
|  |  |  \--Level 5A
|  |  \--Level 3B
|--Level 2B
|  \--Level 3C
\--Level 2C
|  \--Level 3D


Any help is appreciated.

Chris.

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



Re: [PHP] PHP IDE?

2003-12-15 Thread Al
I searched for weeks and tried about 8 php editors and settled on 
http://www.phpedit.net/products/PHPEdit/

Code hints and completion, and highlighting, etc. are superb. 

Has a few minor bugs, but they are not serious. 

The automatic documenter [they call it help, which it really isn't] is 
super. 

Has built-in debugger. 

Daniel Hahler wrote:

on Sat, 13 Dec 2003 09:06:56 -0800 (PST) Jough Jeaux wrote:

JJ> Was wondering what everyone's favortie IDE is for
JJ> coding in PHP.  I've got a big PHP project in the
JJ> works.  I'll be doing alot with it and am looking for
JJ> ways to boost my productivity.
Used to use UltraEdit some time, but now I'm with jEdit.

It's an OpenSource Java editor and supports plugins.. so you can
manage Projects and a lot more.
It's main target (from the number of plugins) is Java development, but
it's great for PHP/HTML also.
http://www.jedit.org/

 

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


Re: [PHP] Email problem

2003-12-15 Thread Eugene Lee
On Mon, Dec 15, 2003 at 12:05:54PM -0800, Naveen Glore wrote:
: 
: I have freebsd server with apache, PHP and mysql. i wrote a simple PHP
: program using mail(). The mail() function returns true without any
: error. but the problem is the email is never delivered. I viewed the
: log file for mail(/var/log/maillog) and i saw the following error: 
: 
: Server sendmail[351]:NOQUEUE:SYSERR(www):can not chdir(/var/spool/clientmqueue/): 
Permission denied. 

It's a Sendmail issue.  Make sure that directory has the right
permission and ownership settings.  Mine looks like this:

drwxrwx---   2 smmsp   smmsp68 11 Dec 07:17 /var/spool/clientmqueue

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



Re: [PHP] Email problem

2003-12-15 Thread Naveen Glore
Eugene Lee <[EMAIL PROTECTED]> wrote:
On Mon, Dec 15, 2003 at 12:05:54PM -0800, Naveen Glore wrote:
: 
: I have freebsd server with apache, PHP and mysql. i wrote a simple PHP
: program using mail(). The mail() function returns true without any
: error. but the problem is the email is never delivered. I viewed the
: log file for mail(/var/log/maillog) and i saw the following error: 
: 
: Server sendmail[351]:NOQUEUE:SYSERR(www):can not chdir(/var/spool/clientmqueue/): 
Permission denied. 

It's a Sendmail issue. Make sure that directory has the right
permission and ownership settings. Mine looks like this:

drwxrwx--- 2 smmsp smmsp 68 11 Dec 07:17 /var/spool/clientmqueue

Hello,

thanks for the quick response. I have the same permissions as yours. My email server 
is working fine, i use sendmail MTA and outlook MUA. I am able to send emails and view 
my received emails in outlook through my server. But I am having problem when i use 
mail() function in php code. Email is never delievered.

thanks,

Naveen.



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




-
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing

RE: [PHP] PHP IDE?

2003-12-15 Thread Chris W. Parker
Al 
on Monday, December 15, 2003 12:52 PM said:

> I searched for weeks and tried about 8 php editors and settled on
> http://www.phpedit.net/products/PHPEdit/
> 
> Code hints and completion, and highlighting, etc. are superb.
> 
> Has a few minor bugs, but they are not serious.
> 
> The automatic documenter [they call it help, which it really isn't] is
> super.
> 
> Has built-in debugger.

Of all these things can it connect to FTP locations?

I tried it out but could only manage to open files from my local
harddrive which is exactly where my php files are not.


Chris.
--
Don't like reformatting your Outlook replies? Now there's relief!
http://home.in.tum.de/~jain/software/outlook-quotefix/

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



[PHP] Re: Q on RegExp & extended Char

2003-12-15 Thread jsWalter
I should have posted some "rules" with this...

assuming:
 - a SPACE is used to delimit first from last name [Walter Torres]
 - a HYPHEN is used to separate a dual name (British style) [Conrad-Smyth]
 - an APOSTROPHE is used in many Irish and Scotish names [O'Reilly]
 - a PERIOD is used in titles, suffixes [Dr. Sr. Jr.]
 - a PERIOD is used for Initials [Walter G. Torres]

then...
 - allow apostrophes, but only if preceded *and* followed by a Alpha/Extend
 - allow hyphen/dash, but only if preceded *and* followed by a Alpha/Extend
 - allow PERIOD, but only if preceded by a Alpha/Extend *and* followed by a
   SPACE or EOS
 - allow SPACE, but only if preceded *and* followed by a Alpha/Extend

also...
 - allow x80 thru xFF

I've come up with this...

/^([a-z\x80-\xFF]+(. )?[ ]?)+$/i
   |_||___||__| ^
   ^^   ^   |
   ||   |   | whole block ONE or more times
   ||   |
   ||   | SPACE - ZERO or ONE times
  alpha & extended  |
  ONE or more   | PERIOD - ZERO or ONE times


but I can't seem to figure out how to get the HYPEN & apostrophe rules in
here.

But this does allow multiple spaces - which It really shouldn't but...

It also lets me add SPACEs at the end, oh well...

Any ideas?

Thanks

Walter

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



[PHP] rand(min, max) always returns min

2003-12-15 Thread Jeff Mainville
Howdy,

I've seen this topic posted once before, but without ever reaching a
conclusion.  The earlier posting is at
http://marc.theaimsgroup.com/?l=php-general&m=105414659615227&w=3

The problem:  rand(min, max) always returns min on some systems.

rand(), mt_rand, and mt_rand(min, max) all work fine.

I've seen this fail on the following systems:

4.3.4/apache2/solaris 8 sparc
4.3.4/apache2/solaris 9 sparc
5.0.0b2/apache2/solaris 9 sparc

But it works on 

4.3.0/apache2/win2k
4.3.4/apache2/solaris 8 sparc

All of the systems where it fails have /dev/*random on them.
All of the systems where it works do not have /dev/*random on them.

Code to test:

";
echo "rand():  "  . rand() . "";  // works
echo "rand(1,100):  " . rand(1,100). "";  // fails; always
returns 1
echo "mt_rand():  "   . mt_rand()  . "";  // works
echo "mt_rand(1,100):  "  . mt_rand(1,100) . "";  // works
?> 

Any insight or pointers as to why this might be failing will be appreciated.

Thanks,

jeff



Re: [PHP] Email problem

2003-12-15 Thread Eugene Lee
On Mon, Dec 15, 2003 at 12:58:17PM -0800, Naveen Glore wrote:
: 
: thanks for the quick response. I have the same permissions as yours.
: My email server is working fine, i use sendmail MTA and outlook MUA. I
: am able to send emails and view my received emails in outlook through
: my server. But I am having problem when i use mail() function in php
: code. Email is never delievered.

Hmmm, what about the permission and ownship of Sendmail itself?

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



[PHP] Starting OOP

2003-12-15 Thread Mike Smith
I've been doing procedural coding for a few month's, but perceive the 
need for OOP for some of the projects I've done. I'm starting out and 
and would like some feedback, before I tread down the wrong path. The 
books I'm looking at Professional PHP (Wrox), and Visual QuickStart PHP 
have examples, but I seem to need something more concrete so I've 
started a skeleton to rewrite a Purchase Order application. Here is the 
layout:


function AddItem($ponum,$item){
...INSERT SQL CODE
}
function DeleteItem($ponum,$item){
...DELETE SQL CODE
}
function UpdateItem($ponum,$item){
...UPDATE SQL CODE
}
function ListItems($ponum){
...SELECT SQL CODE, RETURN RESULTS (ie. 
while($row=mssql_fetch_array($rst)){echo $row[0]})
}

}
?>
I would then include that in my page,
and add items to a PO by doing something like

If($_POST['submit']=='Add'){
//A HTML Button next to a text box to add a line item
$po->AddItem('12345','5063');
}
$po->ListItems('12345');

?>

Do I have the basic concept right? This is like relearning to code. 
Perhaps I learned in a bad way if that's the case. Any especially good 
tutorials or books to recommend?

Thanks

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


[PHP] PHP and MySQL date

2003-12-15 Thread Cesar Aracena
Hi all,

I'm making a site and need some tables from wich I can extract date, time
and/or date/time later with PHP and I neved had very clear the way the
possible formats work with each other so my question is what is the best (or
recommended) method to store dates and/or times in a MySQL DB for PHP to
work later?

Thanks in advanced,
___
Cesar L. Aracena
Commercial Manager / Developer
ICAAM Web Solutions
2K GROUP
Neuquen, Argentina
Tel: +54.299.4774532
Cel: +54.299.6356688
E-mail: [EMAIL PROTECTED]

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



RE: [PHP] Starting OOP

2003-12-15 Thread Martin Towell
I would rewrite your class slighly like this:
1. pass $ponum into the class during the constructor
2. since you're passing in $item into each function, no need to have it as
an attribute

class PurchaseOrder
{
//Variables
var $ponum; //This will be a $_SESSION variable if that matters

function PurchaseOrder($ponum){
$this->ponum = $ponum;
}

function AddItem($item){
...INSERT SQL CODE using $this->ponum
}

function DeleteItem($item){
...DELETE SQL CODE using $this->ponum
}

function UpdateItem($item){
...UPDATE SQL CODE using $this->ponum
}

function ListItems(){
...SELECT SQL CODE using $this->ponum, RETURN RESULTS (ie. 
while($row=mssql_fetch_array($rst)){echo $row[0]})
}

}
?>

HTH
Martin


> -Original Message-
> From: Mike Smith [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, 16 December 2003 10:22 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Starting OOP
> 
> 
> I've been doing procedural coding for a few month's, but perceive the 
> need for OOP for some of the projects I've done. I'm starting out and 
> and would like some feedback, before I tread down the wrong path. The 
> books I'm looking at Professional PHP (Wrox), and Visual 
> QuickStart PHP 
> have examples, but I seem to need something more concrete so I've 
> started a skeleton to rewrite a Purchase Order application. 
> Here is the 
> layout:
> 
>  class PurchaseOrder
> {
> //Variables
> var $ponum; //This will be a $_SESSION variable if that matters
> var $item;
> 
> function AddItem($ponum,$item){
> ...INSERT SQL CODE
> }
> 
> function DeleteItem($ponum,$item){
> ...DELETE SQL CODE
> }
> 
> function UpdateItem($ponum,$item){
> ...UPDATE SQL CODE
> }
> 
> function ListItems($ponum){
> ...SELECT SQL CODE, RETURN RESULTS (ie. 
> while($row=mssql_fetch_array($rst)){echo $row[0]})
> }
> 
> }
> ?>
> 
> I would then include that in my page,
> and add items to a PO by doing something like
>  include('pocode.php');
> $po = new PO();
> 
> If($_POST['submit']=='Add'){
> //A HTML Button next to a text box to add a line item
> $po->AddItem('12345','5063');
> }
> 
> $po->ListItems('12345');
> 
> ?>
> 
> Do I have the basic concept right? This is like relearning to code. 
> Perhaps I learned in a bad way if that's the case. Any 
> especially good 
> tutorials or books to recommend?
> 
> Thanks
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

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



[PHP] Opening large file problem - fopen

2003-12-15 Thread Kim Steinhaug
Hello

Im having real problems working with large files in PHP. At
the moment Im trying to parse an error_log file, and it works
like a charm, except that the scipt stopps after parsing around
70.000 lines, or around 8MB of data. Im using this :

$file= "error_log"; // 280MB file
if($fp=fopen($file, "r+"))
{
 while($line=trim(fgets($fp)))
  {
 // Do the business
   }

}

Surely this is not the way to work with e.g. a 280MB file. I solved the
sollution by chopping the file into 7MB files, and adding a fileopen
loop around the script above which solves my problem. But ->
How do I parse the 280MB file all in 1 go?

I have plenty of timeout and plenty of RAM in the php.ini file, so the
problem isnt here.

-- 
Kim Steinhaug
---
There are 10 types of people when it comes to binary numbers:
those who understand them, and those who don't.
---

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



Re: [PHP] PHP and MySQL date

2003-12-15 Thread Website Managers.net
If you need to store both date and time, there are several ways to accomplish this. 
MySQL has built-in date/timestamp options, but those long strings would need to be 
converted for be human readable.

The option I use most is telling PHP what format I want to use and entering it into 
the database as a variable character (VARCHAR) field.

$Today = date((Y-m-d H:i),mktime());
 Returns: 2003-12-15 18:20

See the PHP help file for mktime() and date()

Jim
www.websitemanagers.net

- Original Message - 
From: "Cesar Aracena" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, December 15, 2003 5:23 PM
Subject: [PHP] PHP and MySQL date


| Hi all,
| 
| I'm making a site and need some tables from wich I can extract date, time
| and/or date/time later with PHP and I neved had very clear the way the
| possible formats work with each other so my question is what is the best (or
| recommended) method to store dates and/or times in a MySQL DB for PHP to
| work later?
| 
| Thanks in advanced,
| ___
| Cesar L. Aracena
| Commercial Manager / Developer
| ICAAM Web Solutions
| 2K GROUP
| Neuquen, Argentina
| Tel: +54.299.4774532
| Cel: +54.299.6356688
| E-mail: [EMAIL PROTECTED]
| 
| -- 
|

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



[PHP] Re: PHP and MySQL date

2003-12-15 Thread Justin Patrin
Cesar Aracena wrote:

Hi all,

I'm making a site and need some tables from wich I can extract date, time
and/or date/time later with PHP and I neved had very clear the way the
possible formats work with each other so my question is what is the best (or
recommended) method to store dates and/or times in a MySQL DB for PHP to
work later?
Thanks in advanced,
___
Cesar L. Aracena
Commercial Manager / Developer
ICAAM Web Solutions
2K GROUP
Neuquen, Argentina
Tel: +54.299.4774532
Cel: +54.299.6356688
E-mail: [EMAIL PROTECTED]
The best way is to use a datetime or timestamp type in MySql, depending 
on your use of it. Using MySql's types allows you to use MySql's date 
comparison and functions for queries. You can get a UNIX timestamp using 
the UNIX_TIMESTAMP() function in mysql or by using strtotime() in PHP on 
the value.

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


[PHP] Re: PHP and MySQL date

2003-12-15 Thread Cesar Aracena
Thanks both of you for the answer.

I tried what both of you told me and I found very easy to use the datetime
value under MySQL and then fetch it using strtotime() as fireball at
sizzling dot com recommended at the "User Contributed Notes" of php.net's
function.date.php page rather than using mktime() which can output incorrect
dates.

Thankis to both and everyone.

"Cesar Aracena" <[EMAIL PROTECTED]> escribió en el mensaje
news:[EMAIL PROTECTED]
> Hi all,
>
> I'm making a site and need some tables from wich I can extract date, time
> and/or date/time later with PHP and I neved had very clear the way the
> possible formats work with each other so my question is what is the best
(or
> recommended) method to store dates and/or times in a MySQL DB for PHP to
> work later?
>
> Thanks in advanced,
> ___
> Cesar L. Aracena
> Commercial Manager / Developer
> ICAAM Web Solutions
> 2K GROUP
> Neuquen, Argentina
> Tel: +54.299.4774532
> Cel: +54.299.6356688
> E-mail: [EMAIL PROTECTED]

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



RE: [PHP] true type fonts again

2003-12-15 Thread cj
I included the
error_reporting (E_ALL);
  ini_set('display_errors', 1);
and commented out the header information, and I got the cannot open/find
font
So I copied the font to the correct places where I thought the font should
go, and tried the web page again.
The image is displayed but no text, I will be looking through the web pages
for a way to output the image to harddrive directly.
would running php script.php > filename.gif be suitable, or is there another
method.

I do appreciate your help
Thanks
CJ

-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED]
Sent: Monday, 15 December 2003 7:22 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] true type fonts again


On Monday 15 December 2003 13:26, cj wrote:

> I have been able to the the image to display, which is a gif image of a
> rectange.
> But the text doesn't get displayed on the image.
>
> There are no error messages on the screen
> The other messages entitled true type fonts is a thread I started as well,
> but the image was not being displayed on the screen at all.
> So now I have the image but no text on the image.
>
> What could be causing this, and what should I have a look at?

If you had read and followed the advice given in response to your earlier
posts I'm sure you would've solved your problem by now.

Again:

1) Enable FULL error reporting by including these lines at the top of your
code:

  error_reporting (E_ALL);
  ini_set('display_errors', 1);

2) Output the image to file. Remember to comment out the header() for the
time
being.

3) And someone else suggested that you may have specified the name of your
font file incorrectly. In my experience you *have* to specify a path to your
font file. So if the font file was in the same directory as your script then
use './name_of_font_file'. So if you had followed the above steps (at the
least step 1) you would have seen the following error:

  PHP Warning:  imagettftext(): Could not find/open font in ...

and would have clued you into what the problem was.

--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Alone, adj.:
In bad company.
-- Ambrose Bierce, "The Devil's Dictionary"
*/

--
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] CVS on Windows

2003-12-15 Thread Chris W. Parker
Hey everyone,

Sorry for the OT post but I don't know of any other lists where this
would be appropriate so I'm sending it here.

I will be interfacing with a CVS server not hosted on a Windows machine
(it will be a bsd/*nix variant) and frankly I've never used it. What
client do all you Windows people use? Also, how does it wotk in
conjuction with your favorite editor? (Mine is HTML-Kit.) Is it
necessary to run some command-line scripts to get the updates populated
to the CVS server?

Also, when working with CVS do you work directly on your local station
or on the remote server? Take for example my situation. I'm just running
plain win2k pro. and I don't have Apache OR PHP installed and I don't
want to install them either. I use HTML-Kit to ftp into my linux server
and work on the files that way.

>From the little reading I've done on CVS you download the entire source
tree and then sync your changes with everything else at a certain time.
If I have to download everything will I then have to move it all to a
PHP compatible server (i.e. the one I use for dev now)?

As I'm thinking about it, maybe an alternative would be to have the CVS
client on the dev server I currently use and then modify the files the
way I always do. Then when I'm ready to sync I can just ssh into the dev
server and run some scripts...

Some guidance in this area would be greatly appreicated!!


Thanks,
Chris.

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



Re: [PHP] 4 project questions - help appreciated

2003-12-15 Thread Justin French
Ryan,

As usual, telling us more about the project will help.  I'm a little 
confused about the key -- is it just a unique key, or is it some form 
of password, or somewhere in between?

Let's look at the flow...

1.  You send your pal a key in an email or whatever like so:
http://www.site.com/view.php?key=123457890
2. they go to that URL, and view the message

What I don't understand is why the key needs to be so complicated.  
Surely starting at 1 and incrementing is enough?  MySQL's in-built 
auto-increment makes life very easy to have a numbered unique key :)

Or perhaps you want something less predictable... like PHP's unique key 
function:
http://www.php.net/manual/en/function.uniqid.php

Before you even bother figuring out the queries, take a step back, and 
think long and hard about what you're trying to achieve.  You sound 
like you're trying to invent something secure, but in reality, it's a 
mess, with predictable, plain-text keys.

If I wanted to publish a list of secret messages on a website, each 
message would have a unique ID (starting at one, and incrementing), a 
password (*at least* stored as an md5(), and not transmitted with the 
id), and finally the message field.

Even then, I still don't get it, so perhaps you need to tell us more.

Justin French

On Tuesday, December 16, 2003, at 05:43  AM, Ryan A wrote:

Hi,
I am making a personal project like so:
I enter something in the text box (eg. "PHP REALLY ROCKS!!!")
then the program checks if that string already exists in the database, 
if
no, then it should enter it into the database and also generate a "key"
This key can be given to pals and they can read the "secret message"

Key:
Key should first be 1-1000 then a-z then A-Z then axxx (eg: a001, the 
xxx
will always be numbers) once it reaches 999 it should become Axxx then 
b
then B etc after a,A,b,B are done it should go for aaxx,AAxx etc 
always 4
characters

A few questions:
1.Looking at the above (database part) I figured that doing this via a 
mysql
database would be better rather than a text database...do you agree?

2.I was thinking of making the "key" field a primary key and unique and
indexedright?
3.The way I see it theres 3 sql statements that need to be run, a) 
connect
and see if string exists b)read the last key c)write to the
database...anyway to break the above to 2 statements or am I following 
this
wrong?

4. Logic for the key, I am coming up with crummy logic to make the 
"key",
basically a block of code for 1-1000,another block for a-z another 
block for
A-Z etc.. any ideas,links,URLs or code snippets off the top of 
your head
would be greatly appreciated.

Thanks in advance.

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


Re: [PHP] Re: PHP and MySQL date

2003-12-15 Thread John W. Holmes
Cesar Aracena wrote:

I tried what both of you told me and I found very easy to use the datetime
value under MySQL and then fetch it using strtotime() as fireball at
sizzling dot com recommended at the "User Contributed Notes" of php.net's
function.date.php page rather than using mktime() which can output incorrect
dates.
You can also use the MySQL function DATE_FORMAT() to format the MySQL 
timestamp to your liking. It is very similar to the PHP date() function.

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com

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


Re: [PHP] 4 project questions - help appreciated

2003-12-15 Thread Ryan A
Hi Justin,
Yes, I admit the project sounds pretty screwy.

The project is needed for a clients son, he's a small twerp who wanted
something like this and since this is an old client who gave us quite a bit
of business, rather than say no and upset him...I took this on.

The key has to be a max of 4 chars and minimum of 1..
It has to be 1- and a-z. I am well aware its easily "crackable" but its
for a kids game so...who cares?
According to the game, when you go to one address it tells you where to go
from there...going 1 after one will not make sense as the messages will then
be screwy.
Since its for kids and REAL security is not really wanted, i want to do this
in the simpliest fashion and not bother with MD5

The goal is, make it as fast as possible with as little effort as possible,
then wait for the dad to give me something really good..:-)

Cheers,
-Ryan



> Ryan,
>
> As usual, telling us more about the project will help.  I'm a little
> confused about the key -- is it just a unique key, or is it some form
> of password, or somewhere in between?
>
> Let's look at the flow...
>
> 1. You send your pal a key in an email or whatever like so:
> http://www.site.com/view.php?key=123457890
>
> 2. they go to that URL, and view the message
>
>
> What I don't understand is why the key needs to be so complicated.
> Surely starting at 1 and incrementing is enough?  MySQL's in-built
> auto-increment makes life very easy to have a numbered unique key :)
>
> Or perhaps you want something less predictable... like PHP's unique key
> function:
> http://www.php.net/manual/en/function.uniqid.php
>
>
> Before you even bother figuring out the queries, take a step back, and
> think long and hard about what you're trying to achieve.  You sound
> like you're trying to invent something secure, but in reality, it's a
> mess, with predictable, plain-text keys.
>
>
> If I wanted to publish a list of secret messages on a website, each
> message would have a unique ID (starting at one, and incrementing), a
> password (*at least* stored as an md5(), and not transmitted with the
> id), and finally the message field.
>
> Even then, I still don't get it, so perhaps you need to tell us more.
>
>
> Justin French
>
>
> On Tuesday, December 16, 2003, at 05:43  AM, Ryan A wrote:
>
> > Hi,
> > I am making a personal project like so:
> >
> > I enter something in the text box (eg. "PHP REALLY ROCKS!!!")
> > then the program checks if that string already exists in the database,
> > if
> > no, then it should enter it into the database and also generate a "key"
> > This key can be given to pals and they can read the "secret message"
> >
> > Key:
> > Key should first be 1-1000 then a-z then A-Z then axxx (eg: a001, the
> > xxx
> > will always be numbers) once it reaches 999 it should become Axxx then
> > b
> > then B etc after a,A,b,B are done it should go for aaxx,AAxx etc
> > always 4
> > characters
> >
> > A few questions:
> > 1.Looking at the above (database part) I figured that doing this via a
> > mysql
> > database would be better rather than a text database...do you agree?
> >
> > 2.I was thinking of making the "key" field a primary key and unique and
> > indexedright?
> >
> > 3.The way I see it theres 3 sql statements that need to be run, a)
> > connect
> > and see if string exists b)read the last key c)write to the
> > database...anyway to break the above to 2 statements or am I following
> > this
> > wrong?
> >
> > 4. Logic for the key, I am coming up with crummy logic to make the
> > "key",
> > basically a block of code for 1-1000,another block for a-z another
> > block for
> > A-Z etc.. any ideas,links,URLs or code snippets off the top of
> > your head
> > would be greatly appreciated.
> >
> >
> > Thanks in advance.
> >
> > Cheers,
> > -Ryan
>
> -- 
> 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] can't access a GET variable on function?

2003-12-15 Thread Louie Miranda
$emailto = $_GET['EmailTO'];

function wtemp_mainbody() {
print "Contact (";
echo "$emailto";
print ") Info";
}

Why can't i display a GET variable from a function? Or should i registered
it on global session?




-- -
Louie Miranda
http://www.axishift.com

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



RE: [PHP] can't access a GET variable on function?

2003-12-15 Thread Chris
$emailto is in the global scope, so it's not accessible like that.

You can do it one of three ways:

$emailto = $_GET['EmailTO'];

function wtemp_mainbody() {
global $emailto;
print "Contact (";
echo $emailto;
print ") Info";
}
 or

$emailto = $_GET['EmailTO'];

function wtemp_mainbody() {
print "Contact (";
echo $GLOBALS['emailto'];
print ") Info";
}
or (recommended)

function wtemp_mainbody() {
print "Contact (";
echo $_GET['EmailTO'];
print ") Info";
}
-Original Message-
From: Louie Miranda [mailto:[EMAIL PROTECTED]
Sent: Monday, December 15, 2003 8:32 PM
To: [EMAIL PROTECTED]
Subject: [PHP] can't access a GET variable on function?


$emailto = $_GET['EmailTO'];

function wtemp_mainbody() {
print "Contact (";
echo "$emailto";
print ") Info";
}

Why can't i display a GET variable from a function? Or should i registered
it on global session?




-- -
Louie Miranda
http://www.axishift.com

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

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



[PHP] Browser displays source of php files instead of supposed output on random basis

2003-12-15 Thread Stephan Gloor
Hello.

Randomly the php-source is displayed instead of the output
(http://www.engstringen.ch/).
This was the case when having installed apache 1.3 und php 4.1.

After ugrading to apache 2 and php 4.3.4 the bug still occurs. But the
browser shows now a file download dialog box for downloading the php
-script instead of having executed it !!!
The header of the response contains the php - mime type configured
application/x-httpd-php.

The apache config contains
AddType application/x-httpd-php .php .php4 .php3 .phtml
AddType application/x-httpd-php-source .phps
Include conf/confixx_vhost.conf

The confixx_vhost.conf contains lots of virtual host configured on a
named vhost basis.

php is minimally configured with
 './configure' '--with-mysql' '--with-apxs'

Linux version Linux 2.4.20.

Thanks for any hint
Stephan

 
Gloor Informatik Zurlindenstr. 215 a 8003 Zürich Tel: 01 461 24 11 Fax: 01
461 22 39 [EMAIL PROTECTED]

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



Re: [PHP] CVS on Windows

2003-12-15 Thread Mike Migurski
>I will be interfacing with a CVS server not hosted on a Windows machine
>(it will be a bsd/*nix variant) and frankly I've never used it. What
>client do all you Windows people use? Also, how does it wotk in
>conjuction with your favorite editor? (Mine is HTML-Kit.) Is it necessary
>to run some command-line scripts to get the updates populated to the CVS
>server?

Tortoise is a popular CVS client for windows -- CVS commands are added to
the contextual menu in [[whatever windows calls its Finder]]. All of your
files are edited locally, using the editor of your choice. Tortoise
informs you of a file's status with regard to CVS by coloring its icon:
red for modified, green for unchanged, etc. It also works well with
Pageant, if you need to connect to the server via SSH and don't want to
hassle with your password everytime. Some editors provide built-in CVS
functionality, but in my experience with BBEdit, I've not found this to be
as useful as it sounds. YMMV.


>Also, when working with CVS do you work directly on your local station or
>on the remote server?

>As I'm thinking about it, maybe an alternative would be to have the CVS
>client on the dev server I currently use and then modify the files the
>way I always do. Then when I'm ready to sync I can just ssh into the dev
>server and run some scripts...

It's probably best to do testing and development in one spot, and have the
CVS checkout live there. That way, you don't have to worry about file
consistency between your development and testing directories. Since you
don't intend to have writing and running happening in the same place, you
may find it more sane to learn the command-line CVS client and use it on
the remote server, so that you can be sure that the files you're checking
in are the ones that work.

One drawback of using CVS on the command line is that it has little
support for batch operations on groups of files; a lot of people who use
CVS like this create some variety of CVS status script they can use to
automate the process of finding new or modified files in a group of
directories. Mine is here:
http://saturn5.com/mike/public/cvstatus.pl



-
michal migurski- contact info and pgp key:
sf/cahttp://mike.teczno.com/contact.html

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