[PHP] Re: using Cascading style sheet

2002-07-31 Thread Paul Dionne

I am confident nearly all browsers support CSS.  Only the oldest still 
lingering out there will not.  But keep in mind your site is still readable 
if someone is still using an outdated browser.

Advantages - many  But the most important is consistency and 
centralization.  You can change the look of your entire site by modifying 
one or two files.  And it is much easier to have a novice come in and do 
basic edits to files.  For example, I teach my clients who want to post 
articles of their own how to do bold, italic, underline, header1...6 then I 
just drop in the include files for header and footer and make any links and 
done.

Paul

Sailom wrote:

>  I just turn to use CSS instead of HTML style.  Can you explain pros and
> cons of using CSS?  I am quite concern about compatibility to client-side
> web browser.  Thanks
> 
> Sailom


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




[PHP] PHP Installation Problem

2002-07-31 Thread Mark Colvin

Thanks all. I have now resolved. For future reference, the problem was as
you said, I didn't have php configured for mysql support. I traced this back
to the installation of the operating system, Red Hat 7.2. Through the
graphical installation, all php modules apart from mysql support and odbc
support are installed by default. These two have to be specifically chosen,
which I didn't do. Anyway problem now resolved



This e-mail is intended for the recipient only and
may contain confidential information. If you are
not the intended recipient then you should reply
to the sender and take no further ation based
upon the content of the message.
Internet e-mails are not necessarily secure and
CCM Limited does not accept any responsibility
for changes made to this message. 
Although checks have been made to ensure this
message and any attchments are free from viruses
the recipient should ensure that this is the case.


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




Re: [PHP] How to become a good PHP coder?

2002-07-31 Thread Michael P. Carel

You could also visit http://devshed.com for some of their tutorials
regarding PHP specially PHP101 nad alot of sample codes and projects.

Mike



- Original Message -
From: "Wee Keat" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, July 31, 2002 12:57 PM
Subject: Re: [PHP] How to become a good PHP coder?


> Hi peter...
>
> Wow!! That's a heck lot of info for me to digest! Thank you so much for
all
> that trouble!
>
> Very useful stuffs... can't thank you enuff...
>
>
> Yours,
> Wee Keat
>
> 
> "Good timber does not grow with ease; the stronger the wind, the stronger
> the trees."
>
>
>
> - Original Message -
> From: "Peter J. Schoenster" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: 31 July, 2002 2:40 PM
> Subject: RE: [PHP] How to become a good PHP coder?
>
>
> > On 31 Jul 2002 at 11:38, Martin Towell wrote:
> >
> > > The best way to become proficient in programming (or anything, come to
> > > that) is with _lots_ of practice.
> >
> > ...snip
> >
> > > Personally, I don't bog myself down in code from the start. I think in
> > > sorta pseudo-code, then once I have a solution, I then implement in
> > > language-specific code.
> >
> > I whole-heartedly agree with the above.
> >
> > It's all to easy to just start spinning out code and weaving things
> together and before you know it you've got something. But then come the
> > inevitable changes, how will your code handle it?
> >
> > I would suggest reading some Steve McConnell.
> >
> >
>
http://www.amazon.com/exec/obidos/ASIN/1556154844/ref=ase_stevemcconnelconA/
> 103-2560652-4298245
> >
> > That's the author's affiliate id, doesn't hurt to help them make more
> money. It links to "Code Complete". As one reviewer says:
> >
> > > Code Complete showed me that it's a lot more than that, beginning by
> > > designing your program, not just starting to write code right away, up
> > > to topics like naming conventions for variables, how to determine what
> > > code to put into a routine or how to make your program easier to
debug.
> >
> > I cannot emphsize enough to follow some sort of standard. At least to
read
> through the standard once.
> >
> > http://pear.php.net/manual/en/standards.php
> >
> > Pragmatic Programmer is also quite good:
> >
> >
>
http://www.amazon.com/o/ASIN/020161622X/ref=cm_custrec_gl_acc/103-2560652-42
> 98245
> >
> > Anyone with 3/4 a brain can throw together some code to do something.
> You've got thousands of examples and you might stumble across
> > some of mine. It is another thing entirely to write code that will form
a
> basis for evolution. The web is all about evolution. We always have to get
> > the latest project done yesterday and then before we've even tested it
> we've got changes coming in ... thinking about what you are going to do
> > and how you are going to grow it and test it are very important.
> >
> > Peter
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


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




[PHP] PHP + Apache + ODBC on linux

2002-07-31 Thread Jose Morales

Hi to all!!

I have a problem and i think maby somebody can help me.

I have an MS Sql server on a Windows 2000.
I have a PHP web in a linux debian. Im trying to access to the MS SQL server through 
unixodbc.
Unixodbc  works well becouse y test it under linux , with isql and sqsh, and i know 
that it works.
in my PHP code I load the odbc module with dl('odbc'), and it works, but 
the problem is that when i do odbc_pconnect("mydsn","myuser","mypasswd"); y have an 
error like this:

Warning: SQL error: [unixODBC] Could not find DSN in odbc.ini, SQL state 08001 in 
SQLConnect in /path/to/my/page.php on line XX 
Warning: Supplied argument is not a valid ODBC-Link resource in /path/to/my/page.php 
on line XX 

When i test the odbc with isql under linux, i think that isql find an .odbc.ini under 
$HOME
the file is like this:
[ODBC Data Sources]
cdr2 = FreeTDS

[cdr2]
Servername = 192.168.129.6
TraceFile = /tmp/odbc.log
Driver = /usr/lib/odbc/libtdsodbc.so
Description = logs del call manager.
DSN = cdr2
DB = CDR
User = myuser
Password = mypasswd
Port = 1433

[Default]
Driver = /usr/lib/odbc/libtdsodbc.so


and i think that the problem is that apache user dont find this file. My apache user 
is www-data, and i try to copy an .odbc.ini file to this user $HOME, but dont works...

the conclusions are: 
1º ODBC works 
2º I have PHP compiled with ODBC support.
3º other users with an .odbc.ini file under $HOME can access to ODBC.

but the problem is still there :(  
so my question is: how can i access from PHP on debian to a well configured ODBC ?



thanks in advance!!



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




[PHP] Re: my application is not able to communicate with qmail sever !

2002-07-31 Thread Sreedhar Katikireddy

Hi All !

First let me thank Jonas Pasche(qmail),David Phillips(qmail),Richard
Lynch(php)  and rest of the community for helping me to solve the problem..

Finally after a bit of trial and error it worked..Here I am pointing out
where I did the mistakes..

The first mistake I did was..what Jonas was pointing about...

1.  I should not have set the sendmail_path
 As my application is running on Win2k...I need not set the path..I
tried with all possible paths like,
  /var/qmail/bin/qmail-inject
 As the mail didn't work with qmail, which was working with sendmail, I
was confused to set this..I thought first the
 control  goes to SMTP server and then searches for the sendmail_path
there in the Linux box.

  After I commented out the sendmail_path,the mail server has thrown me
pop-up message..saying..
  "See http://pobox.com/~djb/docs/smtplf.html.";

Then  I thought it is CR LF problem.. And I tried with the following
test mail program..
mail("[EMAIL PROTECTED]","test","test");
and it worked to my excitement.
And that confirmed me that "CR LF problem" is the second mistake I did
which was also pointed out by  David Phillips..

 2. I have replaced all the headers which were separated by only "\n"
before, with "\r\n". ..and that solved my problem..
 Actually my problem was only "CR LF problem" and I couldn't diagnose
that because I set the sendmail_path..which I
 should  not..
 When sendmail_path is set, the mail(test mail for that matter also..)
failed without any error notification from
  the mail server..which gave me the impression that the mail server is
sitting idle..

Thanks once again for all the support..

Regards !
Sreedhar.










==
Sreedhar Katikireddy, Software Engineer,
CS Software Solutions Pvt. Ltd.
425 Pantheon Road, Egmore, Chennai 600 008, INDIA
Phones: +91(44) 819 1336 thru 38, 819 3335
Fax: +91(44) 819 2339
url: www.cssolutionsinc.com 
==



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




Re: [PHP] passing arrays between pages with serialize

2002-07-31 Thread Valeri Felberg

Hallo DoL,

it worked when i didn't use urldecode(), just stripslashes():

page-1
 $s_array1 = urlencode(serialize($array1));

 header("Location: page-2?h_array1=$s_array1");

page-2
 $array1 = unserialize(stripslashes($_GET["h_array1"]));


The other way that worked was passing arrays in $_SESSION. You don't need
even serialize them in that case.
 
D> Hi

D> I would like to pass three arrays, two of them are two dimensional arrays,
D> to another page (or to the same page just submit to itself) using hidden
D> field and the function serialize.

D> (this is a two dimensional array)
D> page-1
D>  $s_array1 = serialize($array1);

D> 

D> page-2
D>  $array1= unserialize(urldecode(stripslashes($_POST['h_array1'])));

D> it seems to work except there appears to be one NULL record added to the
D> beginning of the array.
D> it affects the following :-
D> count(array_keys($array1) ) returns actual_no_of_keys + 1
D> foreach () echo with one NULL record at the beginning
D> reset($array1) erase the array completely !!

D> and it doesn't help to use rawurl(en|de)code, and with | without
D> stripslashes!

D> PLEASE HELP! if you can resolve this, or has a better ways to pass arrays
D> between pages.

D> Many Thanks
D> /dl






-- 
Mit freundlichen Grüssen
Valeri Felberg
[Web developer]

trimfab - internet mediagroup
--
our mission: innovative business solutions


www.trimfab.com
mailto:[EMAIL PROTECTED]

CZEMINSKI-STR. 1A
10829 BERLIN
GERMANY

FON:  +49(0)30 - 768 033 93
FAX:  +49(0)30 - 768 033 94




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




[PHP] Bcc with the mail command

2002-07-31 Thread Carlos Fernando Scheidecker Antunes

Hello all,

Just a question about PHP mail comand.

Usually I have something like this:

if (mail($to,$Subject,$Body,$MailHeaders)) {
return 1;
}
else {
return 0;
}

Is there any way to use a BCC instead of to?

I would like that the message sent did not have the address of the person it is 
sending it to.

Any ideas or suggestions?

Thank you,

Carlos Fernando.



Re: [PHP] Re: passing variable via url ( newbye question)

2002-07-31 Thread Saci

The obvius and easy think is alwaiss the hard to find

My problem vas the > of the  tag, that I forgot, dummy issue but I made

The right adn working one now are

http://myadress/php/mypage.php?modo=123&color=red&size=3

and to get

echo $_GET['modo']."";
echo $_GET['color']."";
echo $_GET['size']."";

"Leif K-Brooks" <[EMAIL PROTECTED]> escreveu na mensagem
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> PLEASE don't tell the newbies to mess up their code!  That is not
> compatible with all versions of php!  DO NOT USE THOSE!!! STICK TO YOUR
> CURRENT GOOD CODE!  Bother with them for security and compatibly.
>
> Lord Loh. wrote:
>
>  >http://myadress/php/mypage.php?modo=123&color=red&size=3
>  >
>  >is fine!
>  >
>  >you can now use these variables like
>  >$modo $color and $size;
>  >
>  >Why bother with $_GET['modo']; ?
>  >
>  >
>  >
>  >
>  >
>  >
>
>
>



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




[PHP] Re: passing variable via url ( newbye question)

2002-07-31 Thread Saci

Besides my newbye status, I guess you are not update.

the $_GET is a must have when you use set globals to off, ( this is default
after 4.2.1), and must be maintained for security reasons.

Since I'm newbye I play with new and fresh version, and I can get details
that older "phpers"  does not take care since the are still using older
versions.

By the way thank you for your try.

"Lord Loh." <[EMAIL PROTECTED]> escreveu na mensagem
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> http://myadress/php/mypage.php?modo=123&color=red&size=3
>
> is fine!
>
> you can now use these variables like
> $modo $color and $size;
>
> Why bother with $_GET['modo']; ?
>
>
>



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




[PHP] Re: Bcc with the mail command

2002-07-31 Thread lallous

Yes, the header can contain this:
$mailheader="Bcc: [EMAIL PROTECTED]\r\nTo: [EMAIL PROTECTED]";

Elias,

"Carlos Fernando Scheidecker Antunes" <[EMAIL PROTECTED]> wrote in
message 012301c23874$982a5c70$93505ad1@Nando0">news:012301c23874$982a5c70$93505ad1@Nando0...
Hello all,

Just a question about PHP mail comand.

Usually I have something like this:

if (mail($to,$Subject,$Body,$MailHeaders)) {
return 1;
}
else {
return 0;
}

Is there any way to use a BCC instead of to?

I would like that the message sent did not have the address of the person it
is sending it to.

Any ideas or suggestions?

Thank you,

Carlos Fernando.




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




[PHP] extending class then calling its original function

2002-07-31 Thread lallous

Hello when I extended a class and overwrite a function, can i after
overwriting that function call it so it does what it used to do?

for example in Delphi I say:

procedure TMyExtendedClass.Proc1;
begin
// do new stuff here
inherited; // calls the TMyClass.Proc1;
end;


Elias



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




Re: [PHP] web services and PHP

2002-07-31 Thread Brian McGarvie

A'la ASP WebServices perhaps?

"Bob Lockie" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> >I'd like to know if it's possible to use PHP to develop and implement
> >Web Services. If so, please point me to sites, articles, or tutorials
> >that discuss this topic in more detail. Thanks.
>
> How do you define web services?
>
>
>



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




[PHP] file upload

2002-07-31 Thread sally tirchett




>From: "sally tirchett" <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>CC: [EMAIL PROTECTED]
>Date: Tue, 30 Jul 2002 21:07:05 +
>
>
>Hello,
>
>I would like some help with uploading a text file from c:\temp\trial.txt 
>(pc with windows 2000 installed) and import it to a pc (red hat linux 6 
>installed) ip 164.130.160.89 and save it into an sql database 'production'.
>Can you please help?
>
>
>If the above is not possible how can i run from php a prog found 
>ex.c:temp\db1.mdb.
>
>
>
>Thanks
>
>
>Sally
>




_
Chat with friends online, try MSN Messenger: http://messenger.msn.com


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




Re: [PHP] web services and PHP

2002-07-31 Thread Andrey Hristov


 There are two ways (SOAP) to use SOAP library written in PHP such as NuSOAP
by Dietrich Ayala or to use
PHP-SOAP toolkit (module for PHP written in C)by Brad Lafountain(coding) and
Shane Caraveo(testing) (available at sourceforge.net).

Regards,
Andrey

> "Bob Lockie" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> >
> > >I'd like to know if it's possible to use PHP to develop and implement
> > >Web Services. If so, please point me to sites, articles, or tutorials
> > >that discuss this topic in more detail. Thanks.
> >
> > How do you define web services?
> >
> >
> >



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




[PHP] Bea Weblogic Webserver

2002-07-31 Thread MindHunter

Hi,

Is it possible to configure PHP for a BEA Weblogic Webserver?  If so anyone
who did it?  and how?

Tx
MH



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




Re: [PHP] extending class then calling its original function

2002-07-31 Thread Jason Wong

On Wednesday 31 July 2002 18:36, lallous wrote:
> Hello when I extended a class and overwrite a function, can i after
> overwriting that function call it so it does what it used to do?
>
> for example in Delphi I say:
>
> procedure TMyExtendedClass.Proc1;
> begin
> // do new stuff here
> inherited; // calls the TMyClass.Proc1;
> end;

Yes.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Q:  What do you call a WASP who doesn't work for his father, isn't a
lawyer, and believes in social causes?
A:  A failure.
*/


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




[PHP] Question on File Move / Delete and Create Directory

2002-07-31 Thread Jack

Dear all
I had setup a web server in windows NT 4.0 (IIS Server), there is some
question i want to ask bask on the file management!

1. Is there any function in php that can create a folder/Directory in a
specific path?

2. Is there any function in php that can move particular files to other
location?


--
Thx a lot!
Jack
[EMAIL PROTECTED]



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




[PHP] Re: Bea Weblogic Webserver

2002-07-31 Thread Brian McGarvie

I'd suggest pursuing their customer support... It's not a very widely used
websrever. It's also primarily a webserver optimized for serving JSP-based
content/services - if I  remember correctly...

"Mindhunter" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
>
> Is it possible to configure PHP for a BEA Weblogic Webserver?  If so
anyone
> who did it?  and how?
>
> Tx
> MH
>
>



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




[PHP] Re: Question on File Move / Delete and Create Directory

2002-07-31 Thread Brian McGarvie

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

and the other 'filesystem' commands all work in windows...

"Jack" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Dear all
> I had setup a web server in windows NT 4.0 (IIS Server), there is some
> question i want to ask bask on the file management!
>
> 1. Is there any function in php that can create a folder/Directory in a
> specific path?
>
> 2. Is there any function in php that can move particular files to other
> location?
>
>
> --
> Thx a lot!
> Jack
> [EMAIL PROTECTED]
>
>



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




[PHP] Consideration on Upgrade php

2002-07-31 Thread Jack

Dear all
Currently i'm using PHP 4.04 in my Web Server, i heard that there is a bit
different on the newer version of php! Like : something different in
php.ini!
I know that the newest version of php is 4.2.2, could someone pls tell me if
there is different between PHP 4.0.4 with 4.2.2?
I heard that when you post data from a form to other page, 4.2.2 will have
problem, unless you got to set something from php.ini? is that right?


--
Thx a lot!
Jack
[EMAIL PROTECTED]



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




[PHP] Re: Question on File Move / Delete and Create Directory

2002-07-31 Thread David Robley

In article <[EMAIL PROTECTED]>, 
[EMAIL PROTECTED] says...
> Dear all
> I had setup a web server in windows NT 4.0 (IIS Server), there is some
> question i want to ask bask on the file management!
> 
> 1. Is there any function in php that can create a folder/Directory in a
> specific path?
> 
> 2. Is there any function in php that can move particular files to other
> location?
> 
> 
> --
> Thx a lot!
> Jack
> [EMAIL PROTECTED]
> 
> 
> 
http:/www.php.net/filesystem
-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




Re: [PHP] Question on File Move / Delete and Create Directory

2002-07-31 Thread Justin French

on 31/07/02 8:39 PM, Jack ([EMAIL PROTECTED]) wrote:

> Dear all
> I had setup a web server in windows NT 4.0 (IIS Server), there is some
> question i want to ask bask on the file management!
>
> 1. Is there any function in php that can create a folder/Directory in a
> specific path?

*sigh* Did you look in the manual first?

I searched for dir and got a list of directory functions, including mkdir(),
which, makes a dir.

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

Funnily enough, it's part of the FILE SYSTEM FUNCTIONS in the manual.


> 2. Is there any function in php that can move particular files to other
> location?

Not sure about moving, but there is copy() and unlink() [deletes a file],
also found in the manual's filesystem chapter.

Please at least try to find the answer before posting.


Justin


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




[PHP] DOMXML...

2002-07-31 Thread Brian McGarvie

I have a problem with DOMXML...

I installed it and it is showing up in a phpinfo() script...

However when I try a simple example it gives me an error such as:

Warning: failed to load external entity "employees.xml" in
C:\Inetpub\wwweloanshop\test\xml.php on line 36

Any hints?

[ Brian M McGarvie | www.mcgarvie.net  - www.the-local-guide.com -
www.anypurposeloans.com ]



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




Re: [PHP] Consideration on Upgrade php

2002-07-31 Thread EdwardSPL

Hello,

Before the time, many users recommend me to use php 4.2.2 and apache 1.3.26
working with MySQL / IMP etc...
So, I think I can give you some idea / suggestion, I'm installing apache 1.3.26
and php 4.2.2 now !

Edward.

Jack wrote:

> Dear all
> Currently i'm using PHP 4.04 in my Web Server, i heard that there is a bit
> different on the newer version of php! Like : something different in
> php.ini!
> I know that the newest version of php is 4.2.2, could someone pls tell me if
> there is different between PHP 4.0.4 with 4.2.2?
> I heard that when you post data from a form to other page, 4.2.2 will have
> problem, unless you got to set something from php.ini? is that right?
>
> --
> Thx a lot!
> Jack
> [EMAIL PROTECTED]
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



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




[PHP] Re: DOMXML...

2002-07-31 Thread Brian McGarvie

the line that gives the error...

Warning: failed to load external entity "employees.xml" in
C:\Inetpub\wwweloanshop\test\xml.php on line 36
What employees?

is...

$doc = xmldocfile("employees.xml") or die("What employees?");

"Lallous" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> hmm!
>
> 1)Can you show the code @ line 36 if possible
> 2)try to escape the "\" (replace every \ with \\)
>
>
> "Brian McGarvie" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > I have a problem with DOMXML...
> >
> > I installed it and it is showing up in a phpinfo() script...
> >
> > However when I try a simple example it gives me an error such as:
> >
> > Warning: failed to load external entity "employees.xml" in
> > C:\Inetpub\wwweloanshop\test\xml.php on line 36
> >
> > Any hints?
> >
> > [ Brian M McGarvie | www.mcgarvie.net  - www.the-local-guide.com -
> > www.anypurposeloans.com ]
> >
> >
>
>



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




[PHP] stripping quotes within an image tag

2002-07-31 Thread electroteque

hi how is it possible to strip quotes from an image tag ?
i need


to look like




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




[PHP] Re: stripping quotes within an image tag

2002-07-31 Thread David Robley

In article <[EMAIL PROTECTED]>, 
[EMAIL PROTECTED] says...
> hi how is it possible to strip quotes from an image tag ?
> i need
> 
> 
> to look like
> 
> 
> 
> 
$string_no_quotes = str_replace('"', '',$yourstring);

if the tag can be placed in a variable/

-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




[PHP] Re: stripping quotes within an image tag

2002-07-31 Thread lallous

]*>)/i', '\1\2\3', '');
?>

Elias,

"Electroteque" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> hi how is it possible to strip quotes from an image tag ?
> i need
> 
>
> to look like
> 
>
>



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




[PHP] Re: stripping quotes within an image tag

2002-07-31 Thread lallous

that won't really work if he used the ALT attribute too:



"David Robley" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> In article <[EMAIL PROTECTED]>,
> [EMAIL PROTECTED] says...
> > hi how is it possible to strip quotes from an image tag ?
> > i need
> > 
> >
> > to look like
> > 
> >
> >
> >
> $string_no_quotes = str_replace('"', '',$yourstring);
>
> if the tag can be placed in a variable/
>
> --
> David Robley
> Temporary Kiwi!
>
> Quod subigo farinam



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




Re: [PHP] Re: stripping quotes within an image tag

2002-07-31 Thread Jason Wong

On Wednesday 31 July 2002 20:34, lallous wrote:
> that won't really work if he used the ALT attribute too:
> 

But stripping the "'s makes it invalid HTML anyway. The OP got what (s/he) 
asked for.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Immutability, Three Rules of:
(1)  If a tarpaulin can flap, it will.
(2)  If a small boy can get dirty, he will.
(3)  If a teenager can go out, he will.
*/


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




[PHP] Re: DOMXML...

2002-07-31 Thread lallous

hmm!

1)Can you show the code @ line 36 if possible
2)try to escape the "\" (replace every \ with \\)


"Brian McGarvie" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I have a problem with DOMXML...
>
> I installed it and it is showing up in a phpinfo() script...
>
> However when I try a simple example it gives me an error such as:
>
> Warning: failed to load external entity "employees.xml" in
> C:\Inetpub\wwweloanshop\test\xml.php on line 36
>
> Any hints?
>
> [ Brian M McGarvie | www.mcgarvie.net  - www.the-local-guide.com -
> www.anypurposeloans.com ]
>
>



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




[PHP] shorter way to write include function?

2002-07-31 Thread Bas Jobsen

Hello,

i have
/include/dotest.php:


and test.php:


Us there a shorter way to write out that. I mean something like

include::dotest;

Thanks,





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




RE: [PHP] Re: PHP4 and MS Excel?

2002-07-31 Thread Jay Blanchard

[snip]
Are you actually telling me how to SAVE an excel file as text (CSV) format
THROUGH excel ?

H

Thanks (I guess...)  But I learned how to do that, oh I dunno, about 20
years ago.  My question was how to do it using PHP and COM.
[/snip]

Actually this may be a hint ... fire up a macro in Excel, perform the
actions to save a CSV, stop the macro, and look at the VBA code . I'm
not saying that this is the answer you seek, but it may get you one step
closer.

Jay

Love your enemies-it really gets them confused

*
* Want to meet other PHP developers *
* in your area? Check out:  *
* http://php.meetup.com/*
* No developer is an island ... *
*

***
* *
* Texas PHP Developers Meeting*
* Spring 2003 *
* T Bar M Resort & Conference Center  *
* New Braunfels, Texas*
* Interested? Contact;*
* [EMAIL PROTECTED] *
* *
***



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




[PHP] Re: stripping quotes within an image tag

2002-07-31 Thread electroteque

sick dude exactly what i needed , i have been doing php for a good while now
but i have never hot my head around pregs :|
"Lallous" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>  echo preg_replace('/(]*>)/i', '\1\2\3', ' height=44 alt=hspace=0 src="blah.jpg" width=148 border=0>');
> ?>
>
> Elias,
>
> "Electroteque" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > hi how is it possible to strip quotes from an image tag ?
> > i need
> > 
> >
> > to look like
> > 
> >
> >
>
>



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




[PHP] Re: shorter way to write include function?

2002-07-31 Thread lallous

if dotest.php has got the code, do this:

echo eval(join('', file('dotest.php'));



"Bas Jobsen" <[EMAIL PROTECTED]> wrote in message
02073113582400.32156@bjobsen">news:02073113582400.32156@bjobsen...
> Hello,
>
> i have
> /include/dotest.php:
>  function dotest() {echo 'test';}
> ?>
>
> and test.php:
>  include('/include/dotest.php');
> dotest();
> ?>
>
> Us there a shorter way to write out that. I mean something like
>
> include::dotest;
>
> Thanks,
>
>
>
>



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




Re: [PHP] Re: DOMXML...

2002-07-31 Thread Dan Hardiker

Check that the file employees.xml exists, and try providing it with an
absolute reference rather than relative (eg:
"c:\\xmlfiles\\employees.xml"). Also check that the xml file renders ok in
Internet Explorer.


> the line that gives the error...
>
> Warning: failed to load external entity "employees.xml" in
> C:\Inetpub\wwweloanshop\test\xml.php on line 36
> What employees?
>
> is...
>
> $doc = xmldocfile("employees.xml") or die("What employees?");
>
> "Lallous" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>> hmm!
>>
>> 1)Can you show the code @ line 36 if possible
>> 2)try to escape the "\" (replace every \ with \\)
>>
>>
>> "Brian McGarvie" <[EMAIL PROTECTED]> wrote in
>> message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>> > I have a problem with DOMXML...
>> >
>> > I installed it and it is showing up in a phpinfo() script...
>> >
>> > However when I try a simple example it gives me an error such as:
>> >
>> > Warning: failed to load external entity "employees.xml" in
>> > C:\Inetpub\wwweloanshop\test\xml.php on line 36
>> >
>> > Any hints?
>> >
>> > [ Brian M McGarvie | www.mcgarvie.net  - www.the-local-guide.com -
>> www.anypurposeloans.com ]
>> >
>> >
>>
>>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


-- 
Dan Hardiker [[EMAIL PROTECTED]]
ADAM Software & Systems Engineer
First Creative Ltd



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




[PHP] Re: stripping quotes within an image tag

2002-07-31 Thread electroteque

hmm sorry it didnt seem to work , it  did then i gave it more than an img
tag in a string and now it doesnt
"Lallous" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>  echo preg_replace('/(]*>)/i', '\1\2\3', ' height=44 alt=hspace=0 src="blah.jpg" width=148 border=0>');
> ?>
>
> Elias,
>
> "Electroteque" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > hi how is it possible to strip quotes from an image tag ?
> > i need
> > 
> >
> > to look like
> > 
> >
> >
>
>



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




[PHP] Re: passing variable via url ( newbye question)

2002-07-31 Thread Martin Clifford

Because you HAVE to use it if you have register_globals OFF.  Only when 
register_globals is ON can you do what you thought is more efficient, but isn't.

Martin Clifford
Homepage: http://www.completesource.net
Developer's Forums: http://www.completesource.net/forums/


>>> "Lord Loh." <[EMAIL PROTECTED]> 07/31/02 02:37AM >>>
Why bother with $_GET['modo']; ?


-- 
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] There has to be a more elegant way of doing this

2002-07-31 Thread Mike

Heya, 
I was just wondering If there is a more elegant way of doing this...

$string =
str_replace('%mp3number%',$ARRAY['mp3number'],str_replace('%file_size%',
$file_size,str_replace('%url%',$url,str_replace('%title%',$title,str_rep
lace('%artist%',$artist,$format)

Thank You,
Mike
[EMAIL PROTECTED]
[EMAIL PROTECTED]



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




[PHP] Re: There has to be a more elegant way of doing this

2002-07-31 Thread lallous

NEWSTRING = preg_replace( array(/WHAT TO SEARCH FOR ARRAY/), array(/WHAT TO
REPLACE WITH ARRAY/), STRING)


"Mike" <[EMAIL PROTECTED]> wrote in message
007201c23891$4fee8400$[EMAIL PROTECTED]">news:007201c23891$4fee8400$[EMAIL PROTECTED]...
> Heya,
> I was just wondering If there is a more elegant way of doing this...
>
> $string =
> str_replace('%mp3number%',$ARRAY['mp3number'],str_replace('%file_size%',
> $file_size,str_replace('%url%',$url,str_replace('%title%',$title,str_rep
> lace('%artist%',$artist,$format)
>
> Thank You,
> Mike
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
>
>



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




[PHP] select multiple

2002-07-31 Thread [EMAIL PROTECTED]

Hello,
i have done as told to select multiple value from a html
form, but i cannot insert all of them into  MySql
database.
it inserts Array into the field, instead of the list of
values.
What can i do?
Is there a special script to insert them?
i tried,
$str = "";
foreach ($tableau as $k=>$v)
$str= $v . " ";
$sjt1=$_POST["sjt1"]; and then the insert command
(among others )but it's always the same story. Please
help, thanks

---
L'e-mail gratuit pas comme les autres.
NOMADE.FR, pourquoi chercher ailleurs ?



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




Re: [PHP] Re: stripping quotes within an image tag

2002-07-31 Thread Jason Wong

On Wednesday 31 July 2002 20:38, electroteque wrote:
> hmm sorry it didnt seem to work , it  did then i gave it more than an img
> tag in a string and now it doesnt

If all you're doing is stripping the double-quotes why don't you use 
str_replace() as someone suggested?

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Denver, n.:
A smallish city located just below the `O' in Colorado.
*/


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




Re: [PHP] select multiple

2002-07-31 Thread Martin Clifford

It depends on how you want them to be in the database.  If you want comma-delimited, 
then just use implode().

$array = array("Red", "Blue", "Green");
$comma_seperated = implode(", ", $array);
$space_seperated = implode(" ", $array);

There really is no limit to how you want to do this.  Then just use explode() with the 
same arguments (although replace array with the comma_seperated string) to go back to 
an array.

HTH!

Martin Clifford
Homepage: http://www.completesource.net
Developer's Forums: http://www.completesource.net/forums/


>>> "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> 07/31/02 08:56AM >>>
Hello,
i have done as told to select multiple value from a html
form, but i cannot insert all of them into  MySql
database.
it inserts Array into the field, instead of the list of
values.
What can i do?
Is there a special script to insert them?
i tried,
$str = "";
foreach ($tableau as $k=>$v)
$str= $v . " ";
$sjt1=$_POST["sjt1"]; and then the insert command
(among others )but it's always the same story. Please
help, thanks

---
L'e-mail gratuit pas comme les autres.
NOMADE.FR, pourquoi chercher ailleurs ?



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



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




Re: [PHP] select multiple

2002-07-31 Thread 1LT John W. Holmes

Use implode to make the array into a string and insert that. Depends on your
database structure exactly how you'd do it...

www.php.net/implode

---John Holmes...

- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 31, 2002 8:56 AM
Subject: [PHP] select multiple


Hello,
i have done as told to select multiple value from a html
form, but i cannot insert all of them into  MySql
database.
it inserts Array into the field, instead of the list of
values.
What can i do?
Is there a special script to insert them?
i tried,
$str = "";
foreach ($tableau as $k=>$v)
$str= $v . " ";
$sjt1=$_POST["sjt1"]; and then the insert command
(among others )but it's always the same story. Please
help, thanks

---
L'e-mail gratuit pas comme les autres.
NOMADE.FR, pourquoi chercher ailleurs ?



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



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




Re: [PHP] Re: stripping quotes within an image tag

2002-07-31 Thread electroteque

easy done but then it would replace all matches ie "blah" in the content
would be removed :|

it worked when i did

$string = "";

but when i do

$string ="



View your account information. This option is only available to
investors who have authorised us to make this facility available.
Please contact us if you wish to have enquiry access to your
data.


";

this doesnt work

using this echo preg_replace('/(]*>)/i', '\1\2\3',
$string);
"Jason Wong" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> On Wednesday 31 July 2002 20:38, electroteque wrote:
> > hmm sorry it didnt seem to work , it  did then i gave it more than an
img
> > tag in a string and now it doesnt
>
> If all you're doing is stripping the double-quotes why don't you use
> str_replace() as someone suggested?
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
>
> /*
> Denver, n.:
> A smallish city located just below the `O' in Colorado.
> */
>



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




RE: [PHP] shorter way to write include function?

2002-07-31 Thread John Holmes

No.

---John Holmes...

> -Original Message-
> From: Bas Jobsen [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 31, 2002 7:58 AM
> To: PHP General
> Subject: [PHP] shorter way to write include function?
> 
> Hello,
> 
> i have
> /include/dotest.php:
>  function dotest() {echo 'test';}
> ?>
> 
> and test.php:
>  include('/include/dotest.php');
> dotest();
> ?>
> 
> Us there a shorter way to write out that. I mean something like
> 
> include::dotest;
> 
> 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] Trouble Getting PHP Activated on Mac OS X 10.1.4

2002-07-31 Thread Robert Contursi

I'm having difficulty getting PHP activated on Mac OS X 10.1.4. I'm 
using the activation script from Marc Liyanage's page at 
http://www.entropy.ch. If anyone has any advise or can help me trouble 
shoot please let me know.

Thanks,

Robert Contursi
Hendriks Institute
5500 Brush Hollow Road
Westbury, NY 11590
516.338.5400


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




[PHP] sablotron debian(unstable) iconv configure problems [please help]

2002-07-31 Thread Niklas Fondberg

I get:

checking whether to enable xslt support... yes
checking for XSLT Sablotron backend... yes
checking libexpat dir for Sablotron XSL support... no
checking enable JavaScript for Sablotron... yes
checking for Sablotron libraries in the default path... found Sablotron in
/usr
checking for iconv... no
checking for libiconv... no
checking for libiconv in -liconv... no
checking for iconv in -liconv... no
configure: error: iconv not found, in order to build sablotron you need the
iconv library
make[1]: Entering directory
`/opt/build/system_servers/deb/apache-php/php-4.2.2'
make[1]: *** No targets specified and no makefile found.  Stop.
make[1]: Leaving directory
`/opt/build/system_servers/deb/apache-php/php-4.2.2'
make[1]: Entering directory
`/opt/build/system_servers/deb/apache-php/php-4.2.2'
make[1]: *** No rule to make target `install'.  Stop.
make[1]: Leaving directory
`/opt/build/system_servers/deb/apache-php/php-4.2.2'
make[1]: Entering directory
`/opt/build/system_servers/deb/apache-php/php-4.2.2'
make[1]: *** No rule to make target `clean'.  Stop.
make[1]: Leaving directory
`/opt/build/system_servers/deb/apache-php/php-4.2.2'
make: *** [deb] Error 2

when I try to build php-4.2.2

CONFIG_OPTS =   --with-mysql \
--with-config-file-path=/etc \
--disable-rpath \
--enable-inline-optimization \
--with-mm \
--enable-sysvsem \
--enable-sysvshm \
--enable-shmop \
--with-bz2 \
--with-curl \
--with-dom \
--with-zlib \
--with-xml \
--with-gd \
--with-regex=system \
--enable-magic-quotes \
--enable-safe-mode \
--enable-track-vars \
--enable-wddx \
--with-imap \
--with-kerberos \
--with-imap-ssl \
--enable-trans-sid \
--enable-ftp  \
--with-dom  \
--with-dom-xslt  \
--with-sablot-js\
--with-xslt-sablot  \
--enable-xslt   \
--with-dom-exslt\
--with-openssl  \
--enable-bcmath \
--with-pear=/var/devel  \
--enable-sockets \
--with-soap

--
Best Regards

Niklas Fondberg  -  [EMAIL PROTECTED]
System Developer  -  I3 Micro Technology


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




[PHP] mail () will send to everyone except my own domain

2002-07-31 Thread Gareth

Hello all,

Having a real problem. Have written a very simple php email script that I'm
testing on our server. The script works fine if I set the 'to' field as any
email address but our own - i.e. [EMAIL PROTECTED] This works fine, however as
soon as I set the script to email me at the domain to which the server
resolves too it fails. I do not get a error message, it says that the mail
has been sent. The server runs Apache 1.3 and Php 4.1.2 (I will update to
4.2.2 once I have resolved this). The error logs on the server give no
indication of any problem. I cannot work this out at all - it simply will
not email to the same address as the DNS resolves its own IP address too.
Our mx records are held elsewhere.

I'm at complete loss on this one - I've been checking php.ini, httpd.conf
etc etc and cannot work out why this is happening. Php.ini is set too:

sendmail_from
 [EMAIL PROTECTED]
sendmail_path
 /usr/sbin/sendmail -t -i
smtp localhost


do I need to set the smtp to point to the server that holds the mx records?

any help/advice much appreciated,

thanks,

Gareth


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.380 / Virus Database: 213 - Release Date: 24/07/2002



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




RE: [PHP] Re: There has to be a more elegant way of doing this

2002-07-31 Thread Mike

Sweet! You rock! It worked perfectly and now I don't have this giant
line in the middle of my script :)

Thanks,
Mike
[EMAIL PROTECTED]
[EMAIL PROTECTED]

-Original Message-
From: lallous [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, July 31, 2002 10:11 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: There has to be a more elegant way of doing this

NEWSTRING = preg_replace( array(/WHAT TO SEARCH FOR ARRAY/), array(/WHAT
TO
REPLACE WITH ARRAY/), STRING)


"Mike" <[EMAIL PROTECTED]> wrote in message
007201c23891$4fee8400$[EMAIL PROTECTED]">news:007201c23891$4fee8400$[EMAIL PROTECTED]...
> Heya,
> I was just wondering If there is a more elegant way of doing this...
>
> $string =
>
str_replace('%mp3number%',$ARRAY['mp3number'],str_replace('%file_size%',
>
$file_size,str_replace('%url%',$url,str_replace('%title%',$title,str_rep
> lace('%artist%',$artist,$format)
>
> Thank You,
> Mike
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
>
>



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



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




[PHP] More ???s on passing variables

2002-07-31 Thread Paul Dionne

Hello everyone,

I have a class in my script which has information on specific tables such 
as standard queries, tablenames, Index field...

Then there is a function called StandardDropDown($ItemNum, $Name) which 
gets the info from the appropriate table you want and displays a dropdown 
menu based on the table.

$ItemNum referrs to the table I want to output, $Name is what I want to 
call the dropdown in the HTML output.

When I call the function directly from a page it works great.

When I call it from another function I get an error:
Fatal error: Call to a member function on a non-object in
/var/www/html/COMESA/theme/functions.inc on line 61

This is line 61: $TableName= $ItemNum->get_TableName();

As I said, I only get this error when I call from a function, not if I call 
directly from a page.  I don't see why that should make any difference 
though.

Paul

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




[PHP] Re: Consideration on Upgrade php

2002-07-31 Thread j.ellermann

>
>
>I know that the newest version of php is 4.2.2, could someone pls tell me if
>there is different between PHP 4.0.4 with 4.2.2?
>I heard that when you post data from a form to other page, 4.2.2 will have
>problem, unless you got to set something from php.ini? is that right?
>  
>
It's that register_globals is off by default.


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




Re: [PHP] More ???s on passing variables

2002-07-31 Thread Jason Wong

On Wednesday 31 July 2002 22:40, Paul Dionne wrote:
>
> I have a class in my script which has information on specific tables such
> as standard queries, tablenames, Index field...
>
> Then there is a function called StandardDropDown($ItemNum, $Name) which
> gets the info from the appropriate table you want and displays a dropdown
> menu based on the table.
>
> $ItemNum referrs to the table I want to output, $Name is what I want to
> call the dropdown in the HTML output.
>
> When I call the function directly from a page it works great.
>
> When I call it from another function I get an error:
> Fatal error: Call to a member function on a non-object in
> /var/www/html/COMESA/theme/functions.inc on line 61
>
> This is line 61: $TableName= $ItemNum->get_TableName();
>
> As I said, I only get this error when I call from a function, not if I call
> directly from a page.  I don't see why that should make any difference
> though.

In your function declare your object as global.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Save the Whales -- Harpoon a Honda.
*/


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




[PHP] HowTo: Mutiple Radio Button Values

2002-07-31 Thread Shew

Hi - I'm a TOTAL php NEWBIE - my 1st bit of code!!!.

Basically the input form page has 17 sets of radio buttons, each
representing one game with 2 options - team 1 and team 2. What I want to do
is a better way of checking each radio button value instead of using an if
statement for each. This code doesn't really work - it finds that vars
ALWAYS exist.

IE:

Chicago
whatever

Minny
Nobody

Code above is processed by the following code:

for ($GameIdx = 1; $GameIdx <= 17; $GameIdx++) {
 /* instead "hardcoding each radio button name - just do it programmatically
by concatenating / creating the name */
 $frmGame = "Game" + $GameIdx;
 if ($frmGame) {
  /* U want to check if the length is 5 or 6 bytes because it could be
"game1" or "game14" */
  $Length = strlen($frmGame);
  if ($Length == 5) {
   $GetNumber = 1;
  }
  else {
   $GetNumber = 2;
  }

  $GameID = intval(substr($frmGame, $Length - $GetNumber, $GetNumber));
  print "Game ---> $GameIdx - $frmGame - $GetNumber - $GameID ";
if ($GameID == $GameIdx) {
   print "Yeah Match - $GameID = $GameIdx ";
   /* OK, here is where U want to do the actual insert */
  }
 } /* $frmGame endif */
}

?>


Thanks




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




Re: [PHP] How to become a good PHP coder?

2002-07-31 Thread Lee Doolan

> "Wee" == Wee Keat <[EMAIL PROTECTED]> writes:
   [. . .]
Wee> might be new, but I deeply appreciate the generosity that all
Wee> of you have given us

One way to show your appreciation sincerely would be to help others
in the same way that people have helped you.


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




[PHP] stripping quotes from urls and images

2002-07-31 Thread electroteque

hi guys i now have a problem with urls i need to remove the quotes from both
href="" and src=""

so
  needs to be   and i cant
remove quotes from all string matches :|



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




[PHP] Browser Javascript capabilities

2002-07-31 Thread Dennis Gearon

Is it possible from the browser requests to tell if it is jscript
enabled so that an appropriate page can be sent for en/disabled
browsers?
-- 

If You want to buy computer parts, see the reviews at:
http://www.cnet.com/
**OR EVEN BETTER COMPILATIONS**!!
http://sysopt.earthweb.com/userreviews/products/

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




RE: [PHP] mail () will send to everyone except my own domain

2002-07-31 Thread Tom Ray

Gareth-

This sounds more like a sendmail issue to me. I've run into this a few times myself. 

What's happening is simple, sendmail has a file that it reads generally called 
"domains" this file tells sendmail what domains it should be handling mail for. When 
you submit your form the first thing sendmail is doing is checking that domains file, 
and if your domain is listed in that file sendmail will then handle the mail locally. 
So basically the server is sending mail to itself. You need to edit that domains file 
and remove the domain name in question. Once that's done sendmail will look outside 
the server for answers on what it needs to do with the mail delievery.

I can't remember the exact path off the top of my head because we use EXIM here (and 
it has the same issue) I would try either /etc/sendmail or /etc/mail or you can always 
do a find or whereis for "domains"



Hello all,

Having a real problem. Have written a very simple php email script that I'm
testing on our server. The script works fine if I set the 'to' field as any
email address but our own - i.e. [EMAIL PROTECTED] This works fine, however as
soon as I set the script to email me at the domain to which the server
resolves too it fails. I do not get a error message, it says that the mail
has been sent. The server runs Apache 1.3 and Php 4.1.2 (I will update to
4.2.2 once I have resolved this). The error logs on the server give no
indication of any problem. I cannot work this out at all - it simply will
not email to the same address as the DNS resolves its own IP address too.
Our mx records are held elsewhere.

I'm at complete loss on this one - I've been checking php.ini, httpd.conf
etc etc and cannot work out why this is happening. Php.ini is set too:

sendmail_from
 [EMAIL PROTECTED]
sendmail_path
 /usr/sbin/sendmail -t -i
smtp localhost


do I need to set the smtp to point to the server that holds the mx records?

any help/advice much appreciated,

thanks,

Gareth


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.380 / Virus Database: 213 - Release Date: 24/07/2002



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





RE: [PHP] Browser Javascript capabilities

2002-07-31 Thread Matt Babineau

You could use a dummy page, with 



location.href='newpage.php?jscript=on';


What this should do is redirect if javascript is enabled or disabled
giving you a URL variable to parse. I have not tested it but
theorectically could work.

Matt Babineau
MCWD / CCFD
-
e: [EMAIL PROTECTED]
p: 603.943.4237
w: http://www.criticalcode.com
PO BOX 601
Manchester, NH 03105


-Original Message-
From: Dennis Gearon [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, July 31, 2002 12:12 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Browser Javascript capabilities


Is it possible from the browser requests to tell if it is jscript
enabled so that an appropriate page can be sent for en/disabled
browsers?
-- 

If You want to buy computer parts, see the reviews at:
http://www.cnet.com/ **OR EVEN BETTER COMPILATIONS**!!
http://sysopt.earthweb.com/userreviews/products/

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


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




Re: [PHP] Browser Javascript capabilities

2002-07-31 Thread Brent Baisley

You can't tell from the server side, but you can have a page send them 
to a different page depending on whether or not Javascript is enable.
You could have a temp page with a Javascript redirect that is kicked off 
with an onLoad event handler and also have a meta refresh on the same 
page the executes after a second or two. If Javascript is enable, the 
javascript will direct them to one page, if javascript is not enabled, 
then the meta refresh will kick off.

Or, you can have javascript write a cookie. Then on subsequent pages you 
could have the server check for the cookie, if it's not there, then they 
have javascript disabled (or cookies disabled).


On Wednesday, July 31, 2002, at 12:12 PM, Dennis Gearon wrote:

> Is it possible from the browser requests to tell if it is jscript
> enabled so that an appropriate page can be sent for en/disabled
> browsers?
> --
>
> If You want to buy computer parts, see the reviews at:
> http://www.cnet.com/
> **OR EVEN BETTER COMPILATIONS**!!
> http://sysopt.earthweb.com/userreviews/products/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577


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




Re: [PHP] Browser Javascript capabilities

2002-07-31 Thread Chris Boget

> 

Pardon my ignorance, but wouldn't this immediately send the browser onto the 
next page before it had the opportunity to get to and run this:

> 
> location.href='newpage.php?jscript=on';
> 

?  If that's the case, wouldn't you want to delay the refresh by a few seconds to
allow the javascript to force the redirection?

Chris



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




RE: [PHP] Browser Javascript capabilities

2002-07-31 Thread Matt Babineau

Yeah probably, you might need to add a 1 or 2 second delay to the meta
refresh...


Matt Babineau
MCWD / CCFD
-
e: [EMAIL PROTECTED]
p: 603.943.4237
w: http://www.criticalcode.com
PO BOX 601
Manchester, NH 03105


-Original Message-
From: Chris Boget [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, July 31, 2002 12:36 PM
To: Matt Babineau; [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] Browser Javascript capabilities


> 

Pardon my ignorance, but wouldn't this immediately send the browser onto
the 
next page before it had the opportunity to get to and run this:

> 
> location.href='newpage.php?jscript=on';
> 

?  If that's the case, wouldn't you want to delay the refresh by a few
seconds to allow the javascript to force the redirection?

Chris



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


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




[PHP] Disabling Browser "BACK" button

2002-07-31 Thread Petre

HI
Is there a way I can disable the client's browser back button, forcing 
them to use the navigation I built into the page?
Ideally, when they try to press "BACK" on browser, a popup asking them 
to use the navigation instead would win first prize.

The reason I'm asking is again to do with sessions, I have an app 
running 100% now without using cookies, but if the user hits BACK and 
ignores the expire warning, the app produces unwanted results ( adds 
form data again to the db etc.)
Just want to patch the holes.

Maybe write my own little browser that has no back button??



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




Re: [PHP] Disabling Browser "BACK" button

2002-07-31 Thread Martin Clifford

There is never a way to disable back, forward, home, etc buttons.  They all have 
shortcuts that will ALWAYS work, so there's really no point.  Additionally, it's all 
nice and good that your site works fine without using cookies, and don't take this 
offensively, but if the client cannot use the back button without getting mishapen 
results, then it doesn't sound as if the site is designed very efficiently.

Just my opinion.

Martin Clifford
Homepage: http://www.completesource.net
Developer's Forums: http://www.completesource.net/forums/


>>> Petre <[EMAIL PROTECTED]> 07/31/02 01:16PM >>>
HI
Is there a way I can disable the client's browser back button, forcing 
them to use the navigation I built into the page?
Ideally, when they try to press "BACK" on browser, a popup asking them 
to use the navigation instead would win first prize.

The reason I'm asking is again to do with sessions, I have an app 
running 100% now without using cookies, but if the user hits BACK and 
ignores the expire warning, the app produces unwanted results ( adds 
form data again to the db etc.)
Just want to patch the holes.

Maybe write my own little browser that has no back button??



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



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




Re: [PHP] Disabling Browser "BACK" button

2002-07-31 Thread Petre

Well, OK, then, How do you  design the app NOT to allow the form to POST 
again when the user hits "BACK"

Martin Clifford wrote:

>There is never a way to disable back, forward, home, etc buttons.  They all have 
>shortcuts that will ALWAYS work, so there's really no point.  Additionally, it's all 
>nice and good that your site works fine without using cookies, and don't take this 
>offensively, but if the client cannot use the back button without getting mishapen 
>results, then it doesn't sound as if the site is designed very efficiently.
>
>Just my opinion.
>
>Martin Clifford
>Homepage: http://www.completesource.net
>Developer's Forums: http://www.completesource.net/forums/
>
>
Petre <[EMAIL PROTECTED]> 07/31/02 01:16PM >>>

>HI
>Is there a way I can disable the client's browser back button, forcing 
>them to use the navigation I built into the page?
>Ideally, when they try to press "BACK" on browser, a popup asking them 
>to use the navigation instead would win first prize.
>
>The reason I'm asking is again to do with sessions, I have an app 
>running 100% now without using cookies, but if the user hits BACK and 
>ignores the expire warning, the app produces unwanted results ( adds 
>form data again to the db etc.)
>Just want to patch the holes.
>
>Maybe write my own little browser that has no back button??
>
>
>



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




RE: [PHP] Disabling Browser "BACK" button

2002-07-31 Thread César Aracena

I think that would be easy just by UNSETTING or emptying the variables
that the form passed after they are processed. Do I make sence?

César

> -Original Message-
> From: Petre [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 31, 2002 2:43 PM
> To: Martin Clifford
> Cc: php-general
> Subject: Re: [PHP] Disabling Browser "BACK" button
> 
> Well, OK, then, How do you  design the app NOT to allow the form to
POST
> again when the user hits "BACK"
> 
> Martin Clifford wrote:
> 
> >There is never a way to disable back, forward, home, etc buttons.
They
> all have shortcuts that will ALWAYS work, so there's really no point.
> Additionally, it's all nice and good that your site works fine without
> using cookies, and don't take this offensively, but if the client
cannot
> use the back button without getting mishapen results, then it doesn't
> sound as if the site is designed very efficiently.
> >
> >Just my opinion.
> >
> >Martin Clifford
> >Homepage: http://www.completesource.net
> >Developer's Forums: http://www.completesource.net/forums/
> >
> >
> Petre <[EMAIL PROTECTED]> 07/31/02 01:16PM >>>
> 
> >HI
> >Is there a way I can disable the client's browser back button,
forcing
> >them to use the navigation I built into the page?
> >Ideally, when they try to press "BACK" on browser, a popup asking
them
> >to use the navigation instead would win first prize.
> >
> >The reason I'm asking is again to do with sessions, I have an app
> >running 100% now without using cookies, but if the user hits BACK and
> >ignores the expire warning, the app produces unwanted results ( adds
> >form data again to the db etc.)
> >Just want to patch the holes.
> >
> >Maybe write my own little browser that has no back button??
> >
> >
> >
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



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




[PHP] Re: Disabling Browser "BACK" button

2002-07-31 Thread Tony Harrison

If you write your own browser, who would use it? And without a back button -
nobody

"Petre" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> HI
> Is there a way I can disable the client's browser back button, forcing
> them to use the navigation I built into the page?
> Ideally, when they try to press "BACK" on browser, a popup asking them
> to use the navigation instead would win first prize.
>
> The reason I'm asking is again to do with sessions, I have an app
> running 100% now without using cookies, but if the user hits BACK and
> ignores the expire warning, the app produces unwanted results ( adds
> form data again to the db etc.)
> Just want to patch the holes.
>
> Maybe write my own little browser that has no back button??
>
>



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




RE: [PHP] Disabling Browser "BACK" button

2002-07-31 Thread Dan Vande More

I do it this way


Page1 (fill in data)->Page2(write data, instant redirect to p1, unless dies from 
php/mysql)

Then the only way to repost, is to push the forward button.


-Original Message-
From: Petre [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 11:43 AM
To: Martin Clifford
Cc: php-general
Subject: Re: [PHP] Disabling Browser "BACK" button


Well, OK, then, How do you  design the app NOT to allow the form to POST 
again when the user hits "BACK"

Martin Clifford wrote:

>There is never a way to disable back, forward, home, etc buttons.  They all have 
>shortcuts that will ALWAYS work, so there's really no point.  Additionally, it's all 
>nice and good that your site works fine without using cookies, and don't take this 
>offensively, but if the client cannot use the back button without getting mishapen 
>results, then it doesn't sound as if the site is designed very efficiently.
>
>Just my opinion.
>
>Martin Clifford
>Homepage: http://www.completesource.net
>Developer's Forums: http://www.completesource.net/forums/
>
>
Petre <[EMAIL PROTECTED]> 07/31/02 01:16PM >>>

>HI
>Is there a way I can disable the client's browser back button, forcing 
>them to use the navigation I built into the page?
>Ideally, when they try to press "BACK" on browser, a popup asking them 
>to use the navigation instead would win first prize.
>
>The reason I'm asking is again to do with sessions, I have an app 
>running 100% now without using cookies, but if the user hits BACK and 
>ignores the expire warning, the app produces unwanted results ( adds 
>form data again to the db etc.)
>Just want to patch the holes.
>
>Maybe write my own little browser that has no back button??
>
>
>



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


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




Re: [PHP] Disabling Browser "BACK" button

2002-07-31 Thread Petre

I hear you, but how do I know if the POST comes from a valid form 
submit, or from a "back" ? I cannot simply unset the $_POST vars, as 
that will prevent anything from being posted correctly, right?


César Aracena wrote:

>I think that would be easy just by UNSETTING or emptying the variables
>that the form passed after they are processed. Do I make sence?
>
>César
>
>>-Original Message-
>>From: Petre [mailto:[EMAIL PROTECTED]]
>>Sent: Wednesday, July 31, 2002 2:43 PM
>>To: Martin Clifford
>>Cc: php-general
>>Subject: Re: [PHP] Disabling Browser "BACK" button
>>
>>Well, OK, then, How do you  design the app NOT to allow the form to
>>
>POST
>
>>again when the user hits "BACK"
>>
>>Martin Clifford wrote:
>>
>>>There is never a way to disable back, forward, home, etc buttons.
>>>
>They
>
>>all have shortcuts that will ALWAYS work, so there's really no point.
>>Additionally, it's all nice and good that your site works fine without
>>using cookies, and don't take this offensively, but if the client
>>
>cannot
>
>>use the back button without getting mishapen results, then it doesn't
>>sound as if the site is designed very efficiently.
>>
>>>Just my opinion.
>>>
>>>Martin Clifford
>>>Homepage: http://www.completesource.net
>>>Developer's Forums: http://www.completesource.net/forums/
>>>
>>>
>>Petre <[EMAIL PROTECTED]> 07/31/02 01:16PM >>>
>>
>>>HI
>>>Is there a way I can disable the client's browser back button,
>>>
>forcing
>
>>>them to use the navigation I built into the page?
>>>Ideally, when they try to press "BACK" on browser, a popup asking
>>>
>them
>
>>>to use the navigation instead would win first prize.
>>>
>>>The reason I'm asking is again to do with sessions, I have an app
>>>running 100% now without using cookies, but if the user hits BACK and
>>>ignores the expire warning, the app produces unwanted results ( adds
>>>form data again to the db etc.)
>>>Just want to patch the holes.
>>>
>>>Maybe write my own little browser that has no back button??
>>>
>>>
>>>
>>
>>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>>
>
>



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




Re: [PHP] Disabling Browser "BACK" button

2002-07-31 Thread Chris Boget

> Page1 (fill in data)->Page2(write data, instant redirect to p1,
> unless dies from php/mysql) 
> Then the only way to repost, is to push the forward button.

Unless, of course, they hit the "Submit" button again and I think
that was the point the original poster was getting at.  If the user
cannot hit the back button, they cannot hit submit again.

Chris



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




RE: [PHP] web services and PHP

2002-07-31 Thread Andrew Chase

There is also a PEAR SOAP package available:

http://pear.php.net/package-info.php?pacid=87

Some web services also use XML-RPC, a simpler predecessor to SOAP:

http://www.xmlrpc.com

There are a couple of PHP classes available for implementing XML-RPC clients
and servers:

http://phpxmlrpc.sourceforge.net/


-Andy

> -Original Message-
> From: Andrey Hristov [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 31, 2002 2:40 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] web services and PHP
>
>
>
>  There are two ways (SOAP) to use SOAP library written in PHP
> such as NuSOAP
> by Dietrich Ayala or to use
> PHP-SOAP toolkit (module for PHP written in C)by Brad
> Lafountain(coding) and
> Shane Caraveo(testing) (available at sourceforge.net).


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




RE: [PHP] Disabling Browser "BACK" button

2002-07-31 Thread César Aracena

Well... you simple can't unless you take advantage from all the
wonderful features of PHP like it's capability to know where the request
comes from. Another interesting point would be to see if your program is
made correctly, so your script(s) will handle just the right stuff. That
is, if you point your form in Page1 to a Script in Page2, you should be
pretty sure that it will handle the right stuff. After all the handling
was done, you should be able to unset the variables in order *FORBID*
the user to push the REFRESH or BACK buttons, submitting the data all
over again.

> -Original Message-
> From: Petre [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 31, 2002 2:50 PM
> To: César Aracena
> Cc: php-general
> Subject: Re: [PHP] Disabling Browser "BACK" button
> 
> I hear you, but how do I know if the POST comes from a valid form
> submit, or from a "back" ? I cannot simply unset the $_POST vars, as
> that will prevent anything from being posted correctly, right?
> 
> 
> César Aracena wrote:
> 
> >I think that would be easy just by UNSETTING or emptying the
variables
> >that the form passed after they are processed. Do I make sence?
> >
> >César
> >
> >>-Original Message-
> >>From: Petre [mailto:[EMAIL PROTECTED]]
> >>Sent: Wednesday, July 31, 2002 2:43 PM
> >>To: Martin Clifford
> >>Cc: php-general
> >>Subject: Re: [PHP] Disabling Browser "BACK" button
> >>
> >>Well, OK, then, How do you  design the app NOT to allow the form to
> >>
> >POST
> >
> >>again when the user hits "BACK"
> >>
> >>Martin Clifford wrote:
> >>
> >>>There is never a way to disable back, forward, home, etc buttons.
> >>>
> >They
> >
> >>all have shortcuts that will ALWAYS work, so there's really no
point.
> >>Additionally, it's all nice and good that your site works fine
without
> >>using cookies, and don't take this offensively, but if the client
> >>
> >cannot
> >
> >>use the back button without getting mishapen results, then it
doesn't
> >>sound as if the site is designed very efficiently.
> >>
> >>>Just my opinion.
> >>>
> >>>Martin Clifford
> >>>Homepage: http://www.completesource.net
> >>>Developer's Forums: http://www.completesource.net/forums/
> >>>
> >>>
> >>Petre <[EMAIL PROTECTED]> 07/31/02 01:16PM >>>
> >>
> >>>HI
> >>>Is there a way I can disable the client's browser back button,
> >>>
> >forcing
> >
> >>>them to use the navigation I built into the page?
> >>>Ideally, when they try to press "BACK" on browser, a popup asking
> >>>
> >them
> >
> >>>to use the navigation instead would win first prize.
> >>>
> >>>The reason I'm asking is again to do with sessions, I have an app
> >>>running 100% now without using cookies, but if the user hits BACK
and
> >>>ignores the expire warning, the app produces unwanted results (
adds
> >>>form data again to the db etc.)
> >>>Just want to patch the holes.
> >>>
> >>>Maybe write my own little browser that has no back button??
> >>>
> >>>
> >>>
> >>
> >>
> >>--
> >>PHP General Mailing List (http://www.php.net/)
> >>To unsubscribe, visit: http://www.php.net/unsub.php
> >>
> >
> >
> 



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




Re: [PHP] Disabling Browser "BACK" button

2002-07-31 Thread R'twick Niceorgaw

Here's what I think may work, not sure though..

set a session variable form_submitted=false before displaying the form for
input.
when posted, check if form_submitted==false, then only set the session
variable form_submitted to true and process it. Else show an error message
If the user hits BACK button and resubmits it, then form_submitted will
evaluate to true and in this case it will not be further processed.

R'twick
- Original Message -
From: "Petre" <[EMAIL PROTECTED]>
To: "Martin Clifford" <[EMAIL PROTECTED]>
Cc: "php-general" <[EMAIL PROTECTED]>
Sent: Wednesday, July 31, 2002 1:42 PM
Subject: Re: [PHP] Disabling Browser "BACK" button


> Well, OK, then, How do you  design the app NOT to allow the form to POST
> again when the user hits "BACK"
>
> Martin Clifford wrote:
>
> >There is never a way to disable back, forward, home, etc buttons.  They
all have shortcuts that will ALWAYS work, so there's really no point.
Additionally, it's all nice and good that your site works fine without using
cookies, and don't take this offensively, but if the client cannot use the
back button without getting mishapen results, then it doesn't sound as if
the site is designed very efficiently.
> >
> >Just my opinion.
> >
> >Martin Clifford
> >Homepage: http://www.completesource.net
> >Developer's Forums: http://www.completesource.net/forums/
> >
> >
> Petre <[EMAIL PROTECTED]> 07/31/02 01:16PM >>>
> 
> >HI
> >Is there a way I can disable the client's browser back button, forcing
> >them to use the navigation I built into the page?
> >Ideally, when they try to press "BACK" on browser, a popup asking them
> >to use the navigation instead would win first prize.
> >
> >The reason I'm asking is again to do with sessions, I have an app
> >running 100% now without using cookies, but if the user hits BACK and
> >ignores the expire warning, the app produces unwanted results ( adds
> >form data again to the db etc.)
> >Just want to patch the holes.
> >
> >Maybe write my own little browser that has no back button??
> >
> >
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



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




Re: [PHP] Disabling Browser "BACK" button

2002-07-31 Thread Lee

An Idea I have just had but not tested.

To start:-
Page1 - Input Form
Page2 - Data Handling (i.e. processing the form)
Page3 - Redirect handler.

So, User fills in form on Page1 then submits it.  Page2 then processes this
data and if it handles it correctly it simply sends a redirect (something
like a Meta Refresh with time set to 0) to Page3 which then sends you onto
the final page.

By using a querystring variable and checking this in page2 you could
probably get rid of Page3 and have its part handled in page2.

I hope this makes sense.

Cheers

Lee
- Original Message -
From: "César Aracena" <[EMAIL PROTECTED]>
To: "'Petre'" <[EMAIL PROTECTED]>
Cc: "'php-general'" <[EMAIL PROTECTED]>
Sent: Wednesday, July 31, 2002 7:06 PM
Subject: RE: [PHP] Disabling Browser "BACK" button


Well... you simple can't unless you take advantage from all the
wonderful features of PHP like it's capability to know where the request
comes from. Another interesting point would be to see if your program is
made correctly, so your script(s) will handle just the right stuff. That
is, if you point your form in Page1 to a Script in Page2, you should be
pretty sure that it will handle the right stuff. After all the handling
was done, you should be able to unset the variables in order *FORBID*
the user to push the REFRESH or BACK buttons, submitting the data all
over again.

> -Original Message-
> From: Petre [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 31, 2002 2:50 PM
> To: César Aracena
> Cc: php-general
> Subject: Re: [PHP] Disabling Browser "BACK" button
>
> I hear you, but how do I know if the POST comes from a valid form
> submit, or from a "back" ? I cannot simply unset the $_POST vars, as
> that will prevent anything from being posted correctly, right?
>
>
> César Aracena wrote:
>
> >I think that would be easy just by UNSETTING or emptying the
variables
> >that the form passed after they are processed. Do I make sence?
> >
> >César
> >
> >>-Original Message-
> >>From: Petre [mailto:[EMAIL PROTECTED]]
> >>Sent: Wednesday, July 31, 2002 2:43 PM
> >>To: Martin Clifford
> >>Cc: php-general
> >>Subject: Re: [PHP] Disabling Browser "BACK" button
> >>
> >>Well, OK, then, How do you  design the app NOT to allow the form to
> >>
> >POST
> >
> >>again when the user hits "BACK"
> >>
> >>Martin Clifford wrote:
> >>
> >>>There is never a way to disable back, forward, home, etc buttons.
> >>>
> >They
> >
> >>all have shortcuts that will ALWAYS work, so there's really no
point.
> >>Additionally, it's all nice and good that your site works fine
without
> >>using cookies, and don't take this offensively, but if the client
> >>
> >cannot
> >
> >>use the back button without getting mishapen results, then it
doesn't
> >>sound as if the site is designed very efficiently.
> >>
> >>>Just my opinion.
> >>>
> >>>Martin Clifford
> >>>Homepage: http://www.completesource.net
> >>>Developer's Forums: http://www.completesource.net/forums/
> >>>
> >>>
> >>Petre <[EMAIL PROTECTED]> 07/31/02 01:16PM >>>
> >>
> >>>HI
> >>>Is there a way I can disable the client's browser back button,
> >>>
> >forcing
> >
> >>>them to use the navigation I built into the page?
> >>>Ideally, when they try to press "BACK" on browser, a popup asking
> >>>
> >them
> >
> >>>to use the navigation instead would win first prize.
> >>>
> >>>The reason I'm asking is again to do with sessions, I have an app
> >>>running 100% now without using cookies, but if the user hits BACK
and
> >>>ignores the expire warning, the app produces unwanted results (
adds
> >>>form data again to the db etc.)
> >>>Just want to patch the holes.
> >>>
> >>>Maybe write my own little browser that has no back button??
> >>>
> >>>
> >>>
> >>
> >>
> >>--
> >>PHP General Mailing List (http://www.php.net/)
> >>To unsubscribe, visit: http://www.php.net/unsub.php
> >>
> >
> >
>



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







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




Re: [PHP] Disabling Browser "BACK" button

2002-07-31 Thread Danny Shepherd

On processing page (I.e the form's action page - where the stuff is entered
into the db) set another session var so that your app knows that the form
has been submitted, data entered etc. The actual form page should have some
extra logic at the top which checks for this extra session var, redirecting
to an 'already done this' page if the var is set. I suppose this logic
should also exist in the action page, in case the user hits back and browser
reposts the data.

Example:

1. User fills out form on 'form.php' and hits submit - browser loads
'action.php'
2. action.php checks for $_SESSION['formIsFilled'] and redirects if found,
enters data into db otherwise.
3. user hits back and goes back to form.php - if browser has cached then
user will be able to resubmit but will be caught at step2. If the browser
didn't cache they'll be caught here.

This method will prevent them resubmitting for the length of their session
(or until $_SESSION['formIsFilled'] is unset)

HTH

Danny.
- Original Message -
From: "Chris Boget" <[EMAIL PROTECTED]>
To: "Dan Vande More" <[EMAIL PROTECTED]>; "Petre" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Wednesday, July 31, 2002 6:53 PM
Subject: Re: [PHP] Disabling Browser "BACK" button


> > Page1 (fill in data)->Page2(write data, instant redirect to p1,
> > unless dies from php/mysql)
> > Then the only way to repost, is to push the forward button.
>
> Unless, of course, they hit the "Submit" button again and I think
> that was the point the original poster was getting at.  If the user
> cannot hit the back button, they cannot hit submit again.
>
> Chris
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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




[PHP] ARRRRGGGGHHHH! Weird Problems!

2002-07-31 Thread Tony Harrison

OK, im having some minor problems with my site.
In artist.php (http://members.lycos.co.uk/ajohnh/artist.php - Source at:
http://members.lycos.co.uk/ajohnh/source/artist.txt) If for example you view
lyrics by Weird Al Yankovic
(http://members.lycos.co.uk/ajohnh/artist.php?id=1) You'll see that the
bottom lyric (The Sage Begins) does not display. Now when you sort them by
views (http://members.lycos.co.uk/ajohnh/artist.php?id=1&sortby=views) you
will see that err, The Sage Begins is there, and the other one can no longer
be seen. PLease examine my source and tell me whats wrong. And another thing
about that page. The rows are meant to be alternating between #DFDFDF (grey)
and #FF (white) - why the hell are they all grey?!?!?!!? It worked fine
in index.php - source at http://members.lycos.co.uk/ajohnh/source/index.txt


Please help !!



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




Re: [PHP] Disabling Browser "BACK" button

2002-07-31 Thread Petre

Exactly.
The only way I've seen that this can be prevented is if the form action 
is PHP_SELF, so, you call the page onto itself and use a isset($submit), 
but I have reasons for not going that route, one being that I have 
already have a navigation laid out, and changing that will be a nightmare!


Chris Boget wrote:

>>Page1 (fill in data)->Page2(write data, instant redirect to p1,
>>unless dies from php/mysql) 
>>Then the only way to repost, is to push the forward button.
>>
>
>Unless, of course, they hit the "Submit" button again and I think
>that was the point the original poster was getting at.  If the user
>cannot hit the back button, they cannot hit submit again.
>
>Chris
>
>



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




FW: [PHP] Disabling Browser "BACK" button

2002-07-31 Thread Dan Vande More

You are correct Chris.

However if you designed your application as the generic

Master-Detail-(write changes) structure 

you would merely have to use 

echo ""; to take 
you back to the master set, assuming js is turned on, and that is the flow of your app.

I mainly design in an intranet environment, and variables are more controlled here 
than in other places.

For instance, I'm sure that noone uses anything but IE, and JS is almost for sure on.

Dan

-Original Message-
From: Chris Boget [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 11:54 AM
To: Dan Vande More; Petre; [EMAIL PROTECTED]
Subject: Re: [PHP] Disabling Browser "BACK" button


> Page1 (fill in data)->Page2(write data, instant redirect to p1,
> unless dies from php/mysql) 
> Then the only way to repost, is to push the forward button.

Unless, of course, they hit the "Submit" button again and I think
that was the point the original poster was getting at.  If the user
cannot hit the back button, they cannot hit submit again.

Chris



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




[PHP] dir to array?

2002-07-31 Thread Jas

Not sure why this isn't working, any help is appreciated.  I am trying to
read the files in a directory and place them into an array.  Here is the
code:

/* Function to create array of directory contents */
function dCNTS($files) {
 $dir = opendir("/path/to/directory/");
  while($imgs = readdir($dir)) {
   if (($imgs != ".") && ($imgs != "..")) {
$cnt[count($imgs)] = $cnt;
   } else {
print "Cannot create array of files in directory!"; }
   }
  closedir($dir);
 }



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




[PHP] Creating Image...

2002-07-31 Thread mp

I want to create simple image... 
I execute this script:

 $im = imagecreate (50, 100);
 $fp = fopen("test/im.jpg","w");
 fwrite($fp, imagegd($im));
 fclose($fp);

But there is some problems about this... 
Could somebody help me?




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




[PHP] I cannot use mail() ?!?

2002-07-31 Thread Aaron Paxson

I am currently using PHP 4.2.2 with Apache 1.3 on RedHat 7.2.  My email
server is Exchange 5.5sp3

SMTP is set correctly in my php.ini file, and have restarted Apache.
However, I still cannot send out a simple text email:



The function returns true, but no delivery is made.  In looking in my
Exchange Queues, I do not see any sign of an email going through.  However,
using an email client in KDE, email is sent just fine through SMTP.  Did I
miss something?

Aaron




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




[PHP] String Question

2002-07-31 Thread Randy Johnson

Hello,

I would like to be able to do the following but have not figured out a way to handle it

$string="abcdefghijklmnopqrstuvwxz";

I would like to divde the above string into separate strings 8 charactes long , example

$string1=abcdefgh
$string2=ijklmnop
$string3=qrstuvwx
$string4=yz

if the string were only 10 long

$string=abcdefghij

then

$string1=abcdefgh
$string2=ij

any suggestions would be greatly appreciated.

Thanks,


Randy



RE: [PHP] I cannot use mail() ?!?

2002-07-31 Thread Vail, Warren

Outgoing email requires access to a SMTP client or relay.  To prevent these
relays from being used for SPAM, most shops will restrict which IP's can use
the relay.  Suggest you contact the administrators of your exchange server,
and make sure the IP is on the list of eligible IP's for using the relay, or
install the smtp client software on your RedHat machine.  Another concern
would be access to DNS serving the domains you intend to send mail to.  Your
SMTP client will need have access a good dns.  Key question, are you
attempting to send email thru a firewall?  Unless you get the an ok for
that, you may find your ability to send email limited to within the domain.

just a few ideas,

Warren Vail
Tools, Metrics & Quality Processes


-Original Message-
From: Aaron Paxson [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 12:18 PM
To: [EMAIL PROTECTED]
Subject: [PHP] I cannot use mail() ?!?


I am currently using PHP 4.2.2 with Apache 1.3 on RedHat 7.2.  My email
server is Exchange 5.5sp3

SMTP is set correctly in my php.ini file, and have restarted Apache.
However, I still cannot send out a simple text email:



The function returns true, but no delivery is made.  In looking in my
Exchange Queues, I do not see any sign of an email going through.  However,
using an email client in KDE, email is sent just fine through SMTP.  Did I
miss something?

Aaron




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

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




Re: [PHP] I cannot use mail() ?!?

2002-07-31 Thread Aaron Paxson

Excellent ideas Warren!!

Being the IT Systems Administrator, I administrate everything from the
firewalls to the exchange/DNS servers.  Everything seems to be okay there.

In doing another test, I was able to send out an email via my SMTP server to
other domains, just not to me.  It apparently did not use the
"sendmail_from" setting since the email says root.  I'll look at that issue
later 

You are correct, that I am set to "not be a relay".  However, there is no
relaying involved, since it is coming from "within" my own domain.  Also,
the KDE environment works just fine with SMTP messaging, just not PHP.  I'm
wondering if I'm missing something.  I'm fairly new to PHP.  Maybe my
settings?  I just compiled PHP, Apache, and MySql just last week.

Thanks for the response!!!
Aaron
"Warren Vail" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Outgoing email requires access to a SMTP client or relay.  To prevent
these
> relays from being used for SPAM, most shops will restrict which IP's can
use
> the relay.  Suggest you contact the administrators of your exchange
server,
> and make sure the IP is on the list of eligible IP's for using the relay,
or
> install the smtp client software on your RedHat machine.  Another concern
> would be access to DNS serving the domains you intend to send mail to.
Your
> SMTP client will need have access a good dns.  Key question, are you
> attempting to send email thru a firewall?  Unless you get the an ok for
> that, you may find your ability to send email limited to within the
domain.
>
> just a few ideas,
>
> Warren Vail
> Tools, Metrics & Quality Processes
>
>
> -Original Message-
> From: Aaron Paxson [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 31, 2002 12:18 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] I cannot use mail() ?!?
>
>
> I am currently using PHP 4.2.2 with Apache 1.3 on RedHat 7.2.  My email
> server is Exchange 5.5sp3
>
> SMTP is set correctly in my php.ini file, and have restarted Apache.
> However, I still cannot send out a simple text email:
>
> 
>
> The function returns true, but no delivery is made.  In looking in my
> Exchange Queues, I do not see any sign of an email going through.
However,
> using an email client in KDE, email is sent just fine through SMTP.  Did I
> miss something?
>
> Aaron
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



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




Re: [PHP] String Question

2002-07-31 Thread Martin Clifford

Give this a whirl:

\n";
}

?>

I haven't tested it, but in theory it should find the length of the string (26), loop 
through it as long as $i is less than 26, incrementing 8 at a time.  Each time it goes 
through, $str_array[] is fed a new element, which is a substring of $string that 
starts at $i (0, 8, 16, 24, etc) and grabs 8 characters.  So here is how the data 
should be retrieved.

1st loop:  0-7 (8 elements)
2nd loop:  8-15 (8 elements)
3rd loop:  16-23 (8 elements)
4th loop:  24-26 (3 elements)

Let me know how it works out for you :o)

Martin Clifford
Homepage: http://www.completesource.net
Developer's Forums: http://www.completesource.net/forums/


>>> "Randy Johnson" <[EMAIL PROTECTED]> 07/31/02 03:26PM >>>
Hello,

I would like to be able to do the following but have not figured out a way to handle it

$string="abcdefghijklmnopqrstuvwxz";

I would like to divde the above string into separate strings 8 charactes long , example

$string1=abcdefgh
$string2=ijklmnop
$string3=qrstuvwx
$string4=yz

if the string were only 10 long

$string=abcdefghij

then

$string1=abcdefgh
$string2=ij

any suggestions would be greatly appreciated.

Thanks,


Randy


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




Re: [PHP] String Question

2002-07-31 Thread Richard Baskett

";
?>

Rick

A sense of humor can help you over look the unattractive, tolerate the
unpleasant, cope with the unexpected, and smile through the unbearable. -
Moshe Waldoks

> From: "Randy Johnson" <[EMAIL PROTECTED]>
> Date: Wed, 31 Jul 2002 15:26:15 -0400
> To: <[EMAIL PROTECTED]>
> Subject: [PHP] String Question
> 
> Hello,
> 
> I would like to be able to do the following but have not figured out a way to
> handle it
> 
> $string="abcdefghijklmnopqrstuvwxz";
> 
> I would like to divde the above string into separate strings 8 charactes long
> , example
> 
> $string1=abcdefgh
> $string2=ijklmnop
> $string3=qrstuvwx
> $string4=yz
> 
> if the string were only 10 long
> 
> $string=abcdefghij
> 
> then
> 
> $string1=abcdefgh
> $string2=ij
> 
> any suggestions would be greatly appreciated.
> 
> Thanks,
> 
> 
> Randy
> 


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




Re: [PHP] mcrypt

2002-07-31 Thread J Smith


If all you need is some generic encryption that doesn't require mcrypt, you 
might want to take a look at a crypto extension I wrote called 
cryptopp-php. It does everything that the mcrypt extension does and might 
be a touch easier to use as far as syntax and such goes. (Plus, it works on 
Windows if you're into that sort of thing.) It's fairly stable at the 
moment, and doesn't have the memory allocation problems.

See http://www.tutorbuddy.com/software/, and 
http://www.tutorbuddy.com/software/cryptopp/ for the manual.

(I hate the shameless plugging, but the more people who use my extension the 
easier it is for me to debug...)

J


Purushotham Komaravolu wrote:

> Hi,
>  Thanks for the prompt answer. But I am still getting the same error.
> 
> /
> original: meet at secret place
> encrypted: d40d72f1b224b9bf86a7dbc52402c1d02a5cf90adb9050f0
> 
> Warning: mcrypt_generic_init: Memory allocation error in
> 
/mount/marsellus/gwolfe/puruclient/staging/vhosts/partnersdev.sec.yaga.com/h
> tml/time/cancelsubscription/new.php on line 29
> 
> Warning: mdecrypt_generic(): 2 is not a valid MCrypt resource in
> 
/mount/marsellus/gwolfe/puruclient/staging/vhosts/partnersdev.sec.yaga.com/h
> tml/time/cancelsubscription/new.php on line 30
> 
> Warning: mcrypt_generic_end(): 2 is not a valid MCrypt resource in
> 
/mount/marsellus/gwolfe/puruclient/staging/vhosts/partnersdev.sec.yaga.com/h
> tml/time/cancelsubscription/new.php on line 31
> decrypted:
> 
> 
> ///
> 
> 
> Regards,
> 
> Purushotham Komaravolu
> Software Engineer
> Yaga, Inc. - "advanced payment services"
> Direct: 415-901-7343
> Fax: 415-901-1586
> http://www.yaga.com
> 
> 
> 
> - Original Message -
> From: "Tech Support" <[EMAIL PROTECTED]>
> To: "Purushotham Komaravolu" <[EMAIL PROTECTED]>
> Sent: Tuesday, July 30, 2002 11:34 AM
> Subject: Re: [PHP] mcrypt
> 
> 
>> Rather than tease you with hints I'll give you some working code ;-)
>>
>> Documentation for practical usage of mcrypt is weak. I agree.
>>
>> > // crypto.inc
>> $key = "secret key crap";
>>
>> function hex2bin($data)
>> {
>> $len = strlen($data);
>> return pack("H" . $len, $data);
>> }
>>
>> function encrypt($string, $key)
>> {
>>  // version 2.4.x of lib mcrypt
>>  $td = mcrypt_module_open (MCRYPT_TripleDES, "", MCRYPT_MODE_ECB,
>>  ""); $iv = mcrypt_create_iv (mcrypt_enc_get_iv_size ($td),
>>  MCRYPT_RAND); mcrypt_generic_init ($td, $key, $iv);
>>  $crypted = mcrypt_generic ($td, $string);
>>  mcrypt_generic_end ($td);
>>  return bin2hex($crypted);
>> }
>>
>> function decrypt($string, $key)
>> {
>>  //version 2.4.x of lib mcrypt
>>  $string = hex2bin($string);
>>  $td = mcrypt_module_open (MCRYPT_TripleDES, "", MCRYPT_MODE_ECB,
>>  ""); $iv = mcrypt_create_iv (mcrypt_enc_get_iv_size ($td),
>>  MCRYPT_RAND); mcrypt_generic_init ($td, $key, $iv);
>>  $decrypted = mdecrypt_generic ($td, $string);
>>  mcrypt_generic_end ($td);
>>  return trim($decrypted);
>> }
>> ?>
>>
>>
>> usage:
>> > include ("path/to/crypto.inc");
>> $secret = "meet at secret place";
>> $encrypted = encrypt($secret, $key);
>> print "original: " . $secret . "";
>> print "encrypted: " . $encrypted . "";
>> $decrypted = decrypt($encrypted, $key);
>> print "decrypted: " . $decrypted . "";
>> ?>
>>
>> Note: if you are encrypting really secret crap like credit card numbers
>> or something of that nature then NEVER include the key anywhere in your
>> code. Make a form where you have to type it in or something in order to
>> display the results.
>>
>>
>> Jim Grill
>> Support
>> Web-1 Hosting
>> http://www.web-1hosting.net
>> - Original Message -
>> From: "Purushotham Komaravolu" <[EMAIL PROTECTED]>
>> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
>> Sent: Tuesday, July 30, 2002 12:52 PM
>> Subject: [PHP] mcrypt
>>
>>
>> Hello,
>>   I am getting some odd errors trying to get an encrypt/decrypt
>> process to
>>   work. Looking at the manual examples and some other literature, I
> have
>> tried
>>   the two approaches listed below. For each, I get a sometimes-works,
>>   sometimes fails result. The manual entry has a string of user notes
>> with
>>   problem like mine, but I still have problems.
>>
>>
>>
>>   Server API Apache
>>
>>
>>
>>   mcrypt
>> mcrypt support enabled
>> version 2.4.x
>> Supported ciphers twofish rijndael-128 rijndael-192
> rijndael-256
>>   saferplus rc2 xtea serpent safer-sk64 safer-sk128 cast-256 loki97
> gost
>>   threeway cast-128 des tripledes enigma arcfour panama wake
>> Supported modes ofb cfb nofb cbc ecb stream
>>
>>
>>   --]
>>
>>
>>
>>   The first attempt used the following code:
>>
>>
>>   -->
>>   >   $key = "this is a secret key";
>>   $input = "Let us meet at 9 o'clock at the secret place.";
>>
>>

[PHP] A Fond Farewell

2002-07-31 Thread Martin Clifford

Howdy List,

Well, apparently we are no longer permitted to receive "personal" emails where I am 
working, so I'm afraid I'll have to part ways with the lot of you.  It's unfortunate, 
considering I think this one of the best places to find information about PHP (and 
more!) on the internet.  It sure as hell as taught me a lot about our craft.

To those that I have helped, thank you for giving me the opportunity to do so.  It has 
truly been MY pleasure.  You can always contact me at this address if you're in a 
bind, and I'll do what I can :o)

To those that have helped me, one HUGE THANK YOU!!!  You all are the best of the best, 
and I'll always been grateful for the advice and knowledge that you all have shared 
with me.  You are truly great people to be so generous.  Thank you again!

If anyone wants to contact me, you'll have to reply directly, as I'm unsubscribing 
after I send this last mail.  Against my will, no doubt, but leaving just the same.  
Take care, everyone, and as always...

Happy Coding! :o)

Martin Clifford
Homepage: http://www.completesource.net
Developer's Forums: http://www.completesource.net/forums/



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




[PHP] text area with quotes

2002-07-31 Thread Nathan Kline

this seems so obvious yet it is giving me problems.

I have a text area in a form that is passed to a php page to be 
written to a database. first though It displays the contents of the 
form in a preview page. then if everything is good the user click the 
button and it write to the DB. I pass the contents of the text area 
straight to the next page (i.e. $form_item_name) so i never mess with 
the variable.

now for the problem.

when it displays the variable it adds the escape character (\) to any 
' or " in the text. if I resend the same document it adds more. how 
do i get it to display 's and "s in a variable without php adding the 
\??


-- 
Nathan Kline
i.e. Man in the Box
[EMAIL PROTECTED]

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




Re: [PHP] Disabling Browser "BACK" button

2002-07-31 Thread Jason Reid

Actually a meta refresh isnt a good idea for this example. id personally use
a header, because then there is no entry in the back list for the processing
page, unlike if u used a meta refresh, which, if i am correct, leaves an
entry.

Jason Reid
[EMAIL PROTECTED]
--
AC Host Canada
www.achost.ca

- Original Message -
From: "Lee" <[EMAIL PROTECTED]>
To: "César Aracena" <[EMAIL PROTECTED]>; "'Petre'" <[EMAIL PROTECTED]>
Cc: "'php-general'" <[EMAIL PROTECTED]>
Sent: Wednesday, July 31, 2002 12:17 PM
Subject: Re: [PHP] Disabling Browser "BACK" button


> An Idea I have just had but not tested.
>
> To start:-
> Page1 - Input Form
> Page2 - Data Handling (i.e. processing the form)
> Page3 - Redirect handler.
>
> So, User fills in form on Page1 then submits it.  Page2 then processes
this
> data and if it handles it correctly it simply sends a redirect (something
> like a Meta Refresh with time set to 0) to Page3 which then sends you onto
> the final page.
>
> By using a querystring variable and checking this in page2 you could
> probably get rid of Page3 and have its part handled in page2.
>
> I hope this makes sense.
>
> Cheers
>
> Lee
> - Original Message -
> From: "César Aracena" <[EMAIL PROTECTED]>
> To: "'Petre'" <[EMAIL PROTECTED]>
> Cc: "'php-general'" <[EMAIL PROTECTED]>
> Sent: Wednesday, July 31, 2002 7:06 PM
> Subject: RE: [PHP] Disabling Browser "BACK" button
>
>
> Well... you simple can't unless you take advantage from all the
> wonderful features of PHP like it's capability to know where the request
> comes from. Another interesting point would be to see if your program is
> made correctly, so your script(s) will handle just the right stuff. That
> is, if you point your form in Page1 to a Script in Page2, you should be
> pretty sure that it will handle the right stuff. After all the handling
> was done, you should be able to unset the variables in order *FORBID*
> the user to push the REFRESH or BACK buttons, submitting the data all
> over again.
>
> > -Original Message-
> > From: Petre [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, July 31, 2002 2:50 PM
> > To: César Aracena
> > Cc: php-general
> > Subject: Re: [PHP] Disabling Browser "BACK" button
> >
> > I hear you, but how do I know if the POST comes from a valid form
> > submit, or from a "back" ? I cannot simply unset the $_POST vars, as
> > that will prevent anything from being posted correctly, right?
> >
> >
> > César Aracena wrote:
> >
> > >I think that would be easy just by UNSETTING or emptying the
> variables
> > >that the form passed after they are processed. Do I make sence?
> > >
> > >César
> > >
> > >>-Original Message-
> > >>From: Petre [mailto:[EMAIL PROTECTED]]
> > >>Sent: Wednesday, July 31, 2002 2:43 PM
> > >>To: Martin Clifford
> > >>Cc: php-general
> > >>Subject: Re: [PHP] Disabling Browser "BACK" button
> > >>
> > >>Well, OK, then, How do you  design the app NOT to allow the form to
> > >>
> > >POST
> > >
> > >>again when the user hits "BACK"
> > >>
> > >>Martin Clifford wrote:
> > >>
> > >>>There is never a way to disable back, forward, home, etc buttons.
> > >>>
> > >They
> > >
> > >>all have shortcuts that will ALWAYS work, so there's really no
> point.
> > >>Additionally, it's all nice and good that your site works fine
> without
> > >>using cookies, and don't take this offensively, but if the client
> > >>
> > >cannot
> > >
> > >>use the back button without getting mishapen results, then it
> doesn't
> > >>sound as if the site is designed very efficiently.
> > >>
> > >>>Just my opinion.
> > >>>
> > >>>Martin Clifford
> > >>>Homepage: http://www.completesource.net
> > >>>Developer's Forums: http://www.completesource.net/forums/
> > >>>
> > >>>
> > >>Petre <[EMAIL PROTECTED]> 07/31/02 01:16PM >>>
> > >>
> > >>>HI
> > >>>Is there a way I can disable the client's browser back button,
> > >>>
> > >forcing
> > >
> > >>>them to use the navigation I built into the page?
> > >>>Ideally, when they try to press "BACK" on browser, a popup asking
> > >>>
> > >them
> > >
> > >>>to use the navigation instead would win first prize.
> > >>>
> > >>>The reason I'm asking is again to do with sessions, I have an app
> > >>>running 100% now without using cookies, but if the user hits BACK
> and
> > >>>ignores the expire warning, the app produces unwanted results (
> adds
> > >>>form data again to the db etc.)
> > >>>Just want to patch the holes.
> > >>>
> > >>>Maybe write my own little browser that has no back button??
> > >>>
> > >>>
> > >>>
> > >>
> > >>
> > >>--
> > >>PHP General Mailing List (http://www.php.net/)
> > >>To unsubscribe, visit: http://www.php.net/unsub.php
> > >>
> > >
> > >
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



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

Re: [PHP] text area with quotes

2002-07-31 Thread 1LT John W. Holmes

www.php.net/stripslashes

---John Holmes...

- Original Message - 
From: "Nathan Kline" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 31, 2002 3:50 PM
Subject: [PHP] text area with quotes


> this seems so obvious yet it is giving me problems.
> 
> I have a text area in a form that is passed to a php page to be 
> written to a database. first though It displays the contents of the 
> form in a preview page. then if everything is good the user click the 
> button and it write to the DB. I pass the contents of the text area 
> straight to the next page (i.e. $form_item_name) so i never mess with 
> the variable.
> 
> now for the problem.
> 
> when it displays the variable it adds the escape character (\) to any 
> ' or " in the text. if I resend the same document it adds more. how 
> do i get it to display 's and "s in a variable without php adding the 
> \??
> 
> 
> -- 
> Nathan Kline
> i.e. Man in the Box
> [EMAIL PROTECTED]
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


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




Re: [PHP] Creating Image...

2002-07-31 Thread Jason Wong

On Thursday 01 August 2002 02:11, mp wrote:
> I want to create simple image...
> I execute this script:
>
>  $im = imagecreate (50, 100);
>  $fp = fopen("test/im.jpg","w");
>  fwrite($fp, imagegd($im));
>  fclose($fp);
>
> But there is some problems about this...
> Could somebody help me?

Only if you say what the problems are.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
I'm proud to be paying taxes in the United States.  The only thing is
-- I could be just as proud for half the money.
-- Arthur Godfrey
*/


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




Re: [PHP] dir to array?

2002-07-31 Thread Jason Wong

On Thursday 01 August 2002 03:00, Jas wrote:
> Not sure why this isn't working, any help is appreciated.  I am trying to
> read the files in a directory and place them into an array.  Here is the
> code:
>
> /* Function to create array of directory contents */
> function dCNTS($files) {
>  $dir = opendir("/path/to/directory/");
>   while($imgs = readdir($dir)) {
>if (($imgs != ".") && ($imgs != "..")) {
> $cnt[count($imgs)] = $cnt;
>} else {
> print "Cannot create array of files in directory!"; }
>}
>   closedir($dir);
>  }

HOW isn't it working?

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
One person's error is another person's data.
*/


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




Re: [PHP] text area with quotes

2002-07-31 Thread Jason Reid

If it adds the slashes, before u echo it back out, try stripslashes($var)
first

Jason Reid
[EMAIL PROTECTED]
--
AC Host Canada
www.achost.ca

- Original Message -
From: "Nathan Kline" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 31, 2002 1:50 PM
Subject: [PHP] text area with quotes


> this seems so obvious yet it is giving me problems.
>
> I have a text area in a form that is passed to a php page to be
> written to a database. first though It displays the contents of the
> form in a preview page. then if everything is good the user click the
> button and it write to the DB. I pass the contents of the text area
> straight to the next page (i.e. $form_item_name) so i never mess with
> the variable.
>
> now for the problem.
>
> when it displays the variable it adds the escape character (\) to any
> ' or " in the text. if I resend the same document it adds more. how
> do i get it to display 's and "s in a variable without php adding the
> \??
>
>
> --
> Nathan Kline
> i.e. Man in the Box
> [EMAIL PROTECTED]
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>



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




RE: [PHP] Creating Image...

2002-07-31 Thread Andrew Chase

To write a GD image to disk as a jpeg, do this instead:


$im = imagecreate(50,100);

imagejpeg($im, "test/im.jpg");


You don't need to use file handlers. Of course, without doing anything like
adding text or lines to $im, it will just be written to disk as a blank
image. :)

-Andy

> -Original Message-
> From: mp [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 31, 2002 11:11 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Creating Image...
>
>
> I want to create simple image...
> I execute this script:
>
>  $im = imagecreate (50, 100);
>  $fp = fopen("test/im.jpg","w");
>  fwrite($fp, imagegd($im));
>  fclose($fp);
>
> But there is some problems about this...
> Could somebody help me?
> Could somebody help me?


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




Re: [PHP] text area with quotes

2002-07-31 Thread Kevin Stone

addslashes($st); before you put the string into the d-base
stripslashes($str); after you retrieve the string from the d-base
Otherwise MySQL is going to do its best to limit the illegal characters on
its own.  :)
-Kevin

- Original Message -
From: "Nathan Kline" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 31, 2002 1:50 PM
Subject: [PHP] text area with quotes


> this seems so obvious yet it is giving me problems.
>
> I have a text area in a form that is passed to a php page to be
> written to a database. first though It displays the contents of the
> form in a preview page. then if everything is good the user click the
> button and it write to the DB. I pass the contents of the text area
> straight to the next page (i.e. $form_item_name) so i never mess with
> the variable.
>
> now for the problem.
>
> when it displays the variable it adds the escape character (\) to any
> ' or " in the text. if I resend the same document it adds more. how
> do i get it to display 's and "s in a variable without php adding the
> \??
>
>
> --
> Nathan Kline
> i.e. Man in the Box
> [EMAIL PROTECTED]
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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




Re: [PHP] I cannot use mail() ?!?

2002-07-31 Thread Jason Wong

On Thursday 01 August 2002 03:17, Aaron Paxson wrote:
> I am currently using PHP 4.2.2 with Apache 1.3 on RedHat 7.2.  My email
> server is Exchange 5.5sp3
>
> SMTP is set correctly in my php.ini file, and have restarted Apache.
> However, I still cannot send out a simple text email:

I believe the SMTP setting in php.ini is only used if the server is running 
Windows. Under Linux, the sendmail setting is used. Read the comments in 
php.ini.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
panic: kernel segmentation violation. core dumped   (only kidding)
*/


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




[PHP] Re: stripping quotes from urls and images

2002-07-31 Thread Joel Boonstra

> hi guys i now have a problem with urls i need to remove the quotes from both
> href="" and src=""
>
> so
>   needs to be   and i cant
> remove quotes from all string matches :|

Someone mentioned this already, but you should really know that if you
remove quotes from your HTML attributes, your HTML will no longer be
forward-compatible with XHTML, which you really should strive for.  What
reason would you have for removing the quotes?  There must be a better
workaround than removing them.

Regarding your question, it really depends on how you can operate on
your HTML.  Where is your HTML?  Is it in a database, string, etc?  Is
it all in one chunk?  That is, do you have stuff like this:

  This link has "quotes"

that can't just have all quotes removed entirely from it?  If you really
need to remove quotes from attributes (and I don't think you do), and
all of your HTML is in one big string, you're looking at a regular
expression.  Read up on them here:

  http://www.php.net/manual/en/pcre.pattern.syntax.php

Yep, that's a lot of reading.  But you should learn about regular
expressions; they'll be useful all over the place.  If you happen to be
on a Linux/Unix/BSD/whatever machine that has man pages and perl
installed, check out `man perlre`.  Or read on-line here:

  http://www.perldoc.com/perl5.6.1/pod/perlre.html

Some things to watch out for -- even if you do want to remove quotes
from your attributes, I'm 100% sure you don't want to remove from *all*
of them.  Like this:

  

Removing the quotes from the title attribute will likely break at least
some browsers, if not all.  So your regular expression needs to be able
to handle that gracefully.

Good luck!

-- 
[ joel boonstra | [EMAIL PROTECTED] ]


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




Re: [PHP] Creating Image...

2002-07-31 Thread hugh danaher

You might also want to add a "quality" factor to the imagejpeg() function if
the image "as is" looks a bit ratty.
$factor="100" // or another suitable number between 100 and 0
imagejpeg($im, "test/im.jpg",$factor);
hope this helps.
Hugh

- Original Message -
From: "Andrew Chase" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 31, 2002 1:10 PM
Subject: RE: [PHP] Creating Image...


> To write a GD image to disk as a jpeg, do this instead:
>
>
> $im = imagecreate(50,100);
>
> imagejpeg($im, "test/im.jpg");
>
>
> You don't need to use file handlers. Of course, without doing anything
like
> adding text or lines to $im, it will just be written to disk as a blank
> image. :)
>
> -Andy
>
> > -Original Message-
> > From: mp [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, July 31, 2002 11:11 AM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] Creating Image...
> >
> >
> > I want to create simple image...
> > I execute this script:
> >
> >  $im = imagecreate (50, 100);
> >  $fp = fopen("test/im.jpg","w");
> >  fwrite($fp, imagegd($im));
> >  fclose($fp);
> >
> > But there is some problems about this...
> > Could somebody help me?
> > Could somebody help me?
>
>
> --
> 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] Printing a PHP Class

2002-07-31 Thread Marty McGowan

PHPers,
In a genaology application, where I add individuals to
an array:

 $everyone[] = new Individual($id);  

I'd like to print the indiviuals' attributes.  Some of these are
in array's themselves: like a list of event's in one's life.

My problem is:
when printing the Class Variables using the "standard" approach:
=
function print_vars($obj) {
$arr = get_object_vars($obj);
while (list($prop, $val) = each($arr))
{
echo "$prop\t$val\n";
}
}
=
I see the message:  

 Variables: Person: Added RELI attribute

id I6
last McGOWAN
first Martin James
suffix Sr.

sex M

lifeevent Array
attribute Array


  My question is:
 How does one print out the "Array"?

  My attempt at testing .

   (strcmp($val,"Array") == 0)

  was fruitless, as the print value of 
 $var is always a string, but not always
 in other contexts.

  What am I missing?

Thanks,
 -- Marty McGowan




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




  1   2   >